From d568f3ecfafd150db60b3a12e2fb4ff97ee18046 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Fri, 28 Oct 2016 08:32:54 +0000 Subject: [PATCH] hyperv/hn: Cleanup RNDIS related files. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8358 --- sys/dev/hyperv/netvsc/hv_rndis_filter.c | 37 ++++++++++++++----------- sys/dev/hyperv/netvsc/hv_rndis_filter.h | 10 +++++++ sys/dev/hyperv/netvsc/if_hnvar.h | 10 ------- 3 files changed, 31 insertions(+), 26 deletions(-) diff --git a/sys/dev/hyperv/netvsc/hv_rndis_filter.c b/sys/dev/hyperv/netvsc/hv_rndis_filter.c index b8463be1069e..1895a429d269 100644 --- a/sys/dev/hyperv/netvsc/hv_rndis_filter.c +++ b/sys/dev/hyperv/netvsc/hv_rndis_filter.c @@ -29,11 +29,12 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet6.h" +#include "opt_inet.h" + #include -#include #include -#include -#include +#include #include #include @@ -76,19 +77,23 @@ __FBSDID("$FreeBSD$"); #define HN_NDIS_LSOV2_CAP_IP6 \ (NDIS_LSOV2_CAP_IP6EXT | NDIS_LSOV2_CAP_TCP6OPT) -/* - * Forward declarations - */ -static int hn_rndis_query(struct hn_softc *sc, uint32_t oid, - const void *idata, size_t idlen, void *odata, size_t *odlen0); -static int hn_rndis_query2(struct hn_softc *sc, uint32_t oid, - const void *idata, size_t idlen, void *odata, size_t *odlen0, - size_t min_odlen); -static int hn_rndis_set(struct hn_softc *sc, uint32_t oid, const void *data, - size_t dlen); -static int hn_rndis_conf_offload(struct hn_softc *sc, int mtu); -static int hn_rndis_query_hwcaps(struct hn_softc *sc, - struct ndis_offload *caps); +static const void *hn_rndis_xact_exec1(struct hn_softc *, + struct vmbus_xact *, size_t, + struct hn_nvs_sendctx *, size_t *); +static const void *hn_rndis_xact_execute(struct hn_softc *, + struct vmbus_xact *, uint32_t, size_t, size_t *, + uint32_t); +static int hn_rndis_query(struct hn_softc *, uint32_t, + const void *, size_t, void *, size_t *); +static int hn_rndis_query2(struct hn_softc *, uint32_t, + const void *, size_t, void *, size_t *, size_t); +static int hn_rndis_set(struct hn_softc *, uint32_t, + const void *, size_t); +static int hn_rndis_init(struct hn_softc *); +static int hn_rndis_halt(struct hn_softc *); +static int hn_rndis_conf_offload(struct hn_softc *, int); +static int hn_rndis_query_hwcaps(struct hn_softc *, + struct ndis_offload *); static __inline uint32_t hn_rndis_rid(struct hn_softc *sc) diff --git a/sys/dev/hyperv/netvsc/hv_rndis_filter.h b/sys/dev/hyperv/netvsc/hv_rndis_filter.h index cba4ae255e2f..6dc78544b6ea 100644 --- a/sys/dev/hyperv/netvsc/hv_rndis_filter.h +++ b/sys/dev/hyperv/netvsc/hv_rndis_filter.h @@ -33,6 +33,16 @@ struct hn_softc; +int hn_rndis_attach(struct hn_softc *sc, int mtu); +void hn_rndis_detach(struct hn_softc *sc); +int hn_rndis_conf_rss(struct hn_softc *sc, uint16_t flags); +int hn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_cnt); +int hn_rndis_get_eaddr(struct hn_softc *sc, uint8_t *eaddr); +/* link_status: NDIS_MEDIA_STATE_ */ +int hn_rndis_get_linkstatus(struct hn_softc *sc, + uint32_t *link_status); +/* filter: NDIS_PACKET_TYPE_. */ +int hn_rndis_set_rxfilter(struct hn_softc *sc, uint32_t filter); void hn_rndis_rx_ctrl(struct hn_softc *sc, const void *data, int dlen); diff --git a/sys/dev/hyperv/netvsc/if_hnvar.h b/sys/dev/hyperv/netvsc/if_hnvar.h index 9f10184f0a69..c4d94d040ae8 100644 --- a/sys/dev/hyperv/netvsc/if_hnvar.h +++ b/sys/dev/hyperv/netvsc/if_hnvar.h @@ -231,14 +231,4 @@ struct hn_softc { #define HN_LINK_FLAG_LINKUP 0x0001 #define HN_LINK_FLAG_NETCHG 0x0002 -int hn_rndis_attach(struct hn_softc *sc, int mtu); -void hn_rndis_detach(struct hn_softc *sc); -int hn_rndis_conf_rss(struct hn_softc *sc, uint16_t flags); -int hn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_cnt); -int hn_rndis_get_eaddr(struct hn_softc *sc, uint8_t *eaddr); -int hn_rndis_get_linkstatus(struct hn_softc *sc, - uint32_t *link_status); -/* filter: NDIS_PACKET_TYPE_. */ -int hn_rndis_set_rxfilter(struct hn_softc *sc, uint32_t filter); - #endif /* !_IF_HNVAR_H_ */