Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hyperv/netvsc/hv_net_vsc.c
Show First 20 Lines • Show All 530 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* Send NDIS version 2 config packet containing MTU. | * Send NDIS version 2 config packet containing MTU. | ||||
* | * | ||||
* Not valid for NDIS version 1. | * Not valid for NDIS version 1. | ||||
*/ | */ | ||||
static int | static int | ||||
hv_nv_send_ndis_config(struct hn_softc *sc, uint32_t mtu) | hv_nv_send_ndis_config(struct hn_softc *sc, uint32_t mtu) | ||||
{ | { | ||||
netvsc_dev *net_dev; | struct hn_nvs_ndis_conf conf; | ||||
nvsp_msg *init_pkt; | int error; | ||||
int ret; | |||||
net_dev = hv_nv_get_outbound_net_device(sc); | memset(&conf, 0, sizeof(conf)); | ||||
if (!net_dev) | conf.nvs_type = HN_NVS_TYPE_NDIS_CONF; | ||||
return (-ENODEV); | conf.nvs_mtu = mtu; | ||||
conf.nvs_caps = HN_NVS_NDIS_CONF_VLAN; | |||||
/* | error = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, 0, | ||||
* Set up configuration packet, write MTU | &conf, sizeof(conf), (uint64_t)(uintptr_t)&hn_send_ctx_none); | ||||
* Indicate we are capable of handling VLAN tags | if (error) | ||||
*/ | if_printf(sc->hn_ifp, "send nvs ndis conf failed: %d\n", error); | ||||
init_pkt = &net_dev->channel_init_packet; | return (error); | ||||
memset(init_pkt, 0, sizeof(nvsp_msg)); | |||||
init_pkt->hdr.msg_type = nvsp_msg_2_type_send_ndis_config; | |||||
init_pkt->msgs.vers_2_msgs.send_ndis_config.mtu = mtu; | |||||
init_pkt-> | |||||
msgs.vers_2_msgs.send_ndis_config.capabilities.u1.u2.ieee8021q | |||||
= 1; | |||||
/* Send the configuration packet */ | |||||
ret = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, 0, | |||||
init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)&hn_send_ctx_none); | |||||
if (ret != 0) | |||||
return (-EINVAL); | |||||
return (0); | |||||
} | } | ||||
/* | /* | ||||
* Net VSC connect to VSP | * Net VSC connect to VSP | ||||
*/ | */ | ||||
static int | static int | ||||
hv_nv_connect_to_vsp(struct hn_softc *sc) | hv_nv_connect_to_vsp(struct hn_softc *sc) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 504 Lines • Show Last 20 Lines |