diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2016-09-20 10:36:01 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2016-09-20 10:36:01 +0000 |
commit | 15b69300ef66d9fb9a075dceeb6ec137ab0f4828 (patch) | |
tree | 2b5be6a741a66efed56b2499d0125b3ff15b3242 | |
parent | 0610409aaba82fc887be696c3737d7ef8d3d08a3 (diff) |
Switch to the new NDIS header
-rw-r--r-- | sys/dev/pv/if_hvn.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/sys/dev/pv/if_hvn.c b/sys/dev/pv/if_hvn.c index 3647a6f3506..bb316afe6b0 100644 --- a/sys/dev/pv/if_hvn.c +++ b/sys/dev/pv/if_hvn.c @@ -57,7 +57,7 @@ #include <dev/pv/hypervvar.h> #include <dev/rndis.h> -#include <dev/pv/rndisreg.h> +#include <dev/pv/ndis.h> #include <dev/pv/if_hvnreg.h> #include <net/if.h> @@ -86,8 +86,8 @@ #define HVN_RNDIS_CMPBUFSZ 512 #define HVN_RNDIS_MSG_LEN \ - (sizeof(struct rndis_packet_msg) + RNDIS_VLAN_PPI_SIZE + \ - RNDIS_CSUM_PPI_SIZE) + (sizeof(struct rndis_packet_msg) + NDIS_VLAN_INFO_SIZE + \ + NDIS_RXCSUM_INFO_SIZE) struct rndis_cmd { uint32_t rc_id; @@ -787,8 +787,8 @@ hvn_get_link_status(struct hvn_softc *sc) if (hvn_rndis_query(sc, OID_GEN_MEDIA_CONNECT_STATUS, &state, &len) == 0) - sc->sc_link_state = (state == 0) ? LINK_STATE_UP : - LINK_STATE_DOWN; + sc->sc_link_state = (state == NDIS_MEDIA_STATE_CONNECTED) ? + LINK_STATE_UP : LINK_STATE_DOWN; } int @@ -1315,8 +1315,7 @@ hvn_rxeof(struct hvn_softc *sc, caddr_t buf, uint32_t len, struct ifnet *ifp = &sc->sc_ac.ac_if; struct rndis_packet_msg *pkt; struct rndis_pktinfo *pi; - struct rndis_tcp_ip_csum_info *csum; - struct ndis_8021q_info *vlan; + uint32_t csum, vlan; struct mbuf *m; if (!(ifp->if_flags & IFF_RUNNING)) @@ -1359,20 +1358,18 @@ hvn_rxeof(struct hvn_softc *sc, caddr_t buf, uint32_t len, } switch (pi->rm_type) { case NDIS_PKTINFO_TYPE_CSUM: - csum = (struct rndis_tcp_ip_csum_info *) - ((caddr_t)pi + pi->rm_size); - if (csum->recv.ip_csum_succeeded) + memcpy(&csum, (caddr_t)pi + pi->rm_size, sizeof(csum)); + if (csum & NDIS_RXCSUM_INFO_IPCS_OK) m->m_pkthdr.csum_flags |= M_IPV4_CSUM_IN_OK; - if (csum->recv.tcp_csum_succeeded) + if (csum & NDIS_RXCSUM_INFO_TCPCS_OK) m->m_pkthdr.csum_flags |= M_TCP_CSUM_IN_OK; - if (csum->recv.udp_csum_succeeded) + if (csum & NDIS_RXCSUM_INFO_UDPCS_OK) m->m_pkthdr.csum_flags |= M_UDP_CSUM_IN_OK; break; case NDIS_PKTINFO_TYPE_VLAN: - vlan = (struct ndis_8021q_info *) - ((caddr_t)pi + pi->rm_size); + memcpy(&vlan, (caddr_t)pi + pi->rm_size, sizeof(vlan)); #if NVLAN > 0 - m->m_pkthdr.ether_vtag = vlan->vlan_id; + m->m_pkthdr.ether_vtag = vlan & 0xffff; m->m_flags |= M_VLANTAG; #endif break; |