Page MenuHomeFreeBSD

D7466.id.diff
No OneTemporary

D7466.id.diff

Index: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
===================================================================
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c
@@ -536,33 +536,19 @@
static int
hv_nv_send_ndis_config(struct hn_softc *sc, uint32_t mtu)
{
- netvsc_dev *net_dev;
- nvsp_msg *init_pkt;
- int ret;
-
- net_dev = hv_nv_get_outbound_net_device(sc);
- if (!net_dev)
- return (-ENODEV);
-
- /*
- * Set up configuration packet, write MTU
- * Indicate we are capable of handling VLAN tags
- */
- init_pkt = &net_dev->channel_init_packet;
- 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);
+ struct hn_nvs_ndis_conf conf;
+ int error;
- return (0);
+ memset(&conf, 0, sizeof(conf));
+ conf.nvs_type = HN_NVS_TYPE_NDIS_CONF;
+ conf.nvs_mtu = mtu;
+ conf.nvs_caps = HN_NVS_NDIS_CONF_VLAN;
+
+ error = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, 0,
+ &conf, sizeof(conf), (uint64_t)(uintptr_t)&hn_send_ctx_none);
+ if (error)
+ if_printf(sc->hn_ifp, "send nvs ndis conf failed: %d\n", error);
+ return (error);
}
/*
Index: head/sys/dev/hyperv/netvsc/if_hnreg.h
===================================================================
--- head/sys/dev/hyperv/netvsc/if_hnreg.h
+++ head/sys/dev/hyperv/netvsc/if_hnreg.h
@@ -36,6 +36,7 @@
#define HN_NVS_TYPE_INIT 1
#define HN_NVS_TYPE_INIT_RESP 2
+#define HN_NVS_TYPE_NDIS_CONF 125
/*
* Any size less than this one will _not_ work, e.g. hn_nvs_init
@@ -59,4 +60,17 @@
uint32_t nvs_status; /* HN_NVS_STATUS_ */
} __packed;
+/* No reponse */
+struct hn_nvs_ndis_conf {
+ uint32_t nvs_type; /* HN_NVS_TYPE_NDIS_CONF */
+ uint32_t nvs_mtu;
+ uint32_t nvs_rsvd;
+ uint64_t nvs_caps; /* HN_NVS_NDIS_CONF_ */
+ uint8_t nvs_rsvd1[12];
+} __packed;
+CTASSERT(sizeof(struct hn_nvs_ndis_conf) >= HN_NVS_REQSIZE_MIN);
+
+#define HN_NVS_NDIS_CONF_SRIOV 0x0004
+#define HN_NVS_NDIS_CONF_VLAN 0x0008
+
#endif /* !_IF_HNREG_H_ */

File Metadata

Mime Type
text/plain
Expires
Fri, Feb 13, 11:14 AM (16 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28676574
Default Alt Text
D7466.id.diff (2 KB)

Event Timeline