Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hyperv/netvsc/hn_rndis.c
Show First 20 Lines • Show All 835 Lines • ▼ Show 20 Lines | if_printf(sc->hn_ifp, "RNDIS init failed: status 0x%08x\n", | ||||
comp->rm_status); | comp->rm_status); | ||||
error = EIO; | error = EIO; | ||||
goto done; | goto done; | ||||
} | } | ||||
sc->hn_rndis_agg_size = comp->rm_pktmaxsz; | sc->hn_rndis_agg_size = comp->rm_pktmaxsz; | ||||
sc->hn_rndis_agg_pkts = comp->rm_pktmaxcnt; | sc->hn_rndis_agg_pkts = comp->rm_pktmaxcnt; | ||||
sc->hn_rndis_agg_align = 1U << comp->rm_align; | sc->hn_rndis_agg_align = 1U << comp->rm_align; | ||||
if (sc->hn_rndis_agg_align < sizeof(uint32_t)) { | |||||
/* | |||||
* The RNDIS packet messsage encap assumes that the RNDIS | |||||
* packet message is at least 4 bytes aligned. Fix up the | |||||
* alignment here, if the remote side sets the alignment | |||||
* too low. | |||||
*/ | |||||
if_printf(sc->hn_ifp, "fixup RNDIS aggpkt align: %u -> %zu\n", | |||||
sc->hn_rndis_agg_align, sizeof(uint32_t)); | |||||
sc->hn_rndis_agg_align = sizeof(uint32_t); | |||||
} | |||||
if (bootverbose) { | if (bootverbose) { | ||||
if_printf(sc->hn_ifp, "RNDIS ver %u.%u, pktsz %u, pktcnt %u, " | if_printf(sc->hn_ifp, "RNDIS ver %u.%u, " | ||||
"align %u\n", comp->rm_ver_major, comp->rm_ver_minor, | "aggpkt size %u, aggpkt cnt %u, aggpkt align %u\n", | ||||
comp->rm_ver_major, comp->rm_ver_minor, | |||||
sc->hn_rndis_agg_size, sc->hn_rndis_agg_pkts, | sc->hn_rndis_agg_size, sc->hn_rndis_agg_pkts, | ||||
sc->hn_rndis_agg_align); | sc->hn_rndis_agg_align); | ||||
} | } | ||||
error = 0; | error = 0; | ||||
done: | done: | ||||
vmbus_xact_put(xact); | vmbus_xact_put(xact); | ||||
return (error); | return (error); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 139 Lines • Show Last 20 Lines |