svn commit: r304973 - head/sys/dev/hyperv/netvsc
Sepherosa Ziehau
sephe at FreeBSD.org
Mon Aug 29 04:44:25 UTC 2016
Author: sephe
Date: Mon Aug 29 04:44:24 2016
New Revision: 304973
URL: https://svnweb.freebsd.org/changeset/base/304973
Log:
hyperv/hn: Switch to new RNDIS query for link status extraction.
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7654
Modified:
head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 29 03:22:56 2016 (r304972)
+++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 29 04:44:24 2016 (r304973)
@@ -712,12 +712,12 @@ hv_rf_query_device_mac(rndis_device *dev
error = hn_rndis_query(sc, OID_802_3_PERMANENT_ADDRESS, NULL, 0,
device->hw_mac_addr, &hwaddr_len);
if (error)
- return error;
+ return (error);
if (hwaddr_len != ETHER_ADDR_LEN) {
if_printf(sc->hn_ifp, "invalid hwaddr len %zu\n", hwaddr_len);
- return EINVAL;
+ return (EINVAL);
}
- return 0;
+ return (0);
}
/*
@@ -726,10 +726,20 @@ hv_rf_query_device_mac(rndis_device *dev
static inline int
hv_rf_query_device_link_status(rndis_device *device)
{
- uint32_t size = sizeof(uint32_t);
+ struct hn_softc *sc = device->sc;
+ size_t size;
+ int error;
- return (hv_rf_query_device(device,
- RNDIS_OID_GEN_MEDIA_CONNECT_STATUS, &device->link_status, &size));
+ size = sizeof(uint32_t);
+ error = hn_rndis_query(sc, OID_GEN_MEDIA_CONNECT_STATUS, NULL, 0,
+ &device->link_status, &size);
+ if (error)
+ return (error);
+ if (size != sizeof(uint32_t)) {
+ if_printf(sc->hn_ifp, "invalid link status len %zu\n", size);
+ return (EINVAL);
+ }
+ return (0);
}
static uint8_t netvsc_hash_key[HASH_KEYLEN] = {
More information about the svn-src-head
mailing list