hyperv/hn: Deprecate hn_softc_t

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7867
This commit is contained in:
Sepherosa Ziehau 2016-09-14 08:00:30 +00:00
parent 06100f2e8c
commit 555e179833
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=305791
2 changed files with 10 additions and 18 deletions

View File

@ -198,7 +198,7 @@ struct hn_tx_ring {
/* /*
* Device-specific softc structure * Device-specific softc structure
*/ */
typedef struct hn_softc { struct hn_softc {
struct ifnet *hn_ifp; struct ifnet *hn_ifp;
struct ifmedia hn_media; struct ifmedia hn_media;
device_t hn_dev; device_t hn_dev;
@ -243,7 +243,7 @@ typedef struct hn_softc {
uint32_t hn_ndis_ver; uint32_t hn_ndis_ver;
struct ndis_rssprm_toeplitz hn_rss; struct ndis_rssprm_toeplitz hn_rss;
} hn_softc_t; };
#define HN_FLAG_RXBUF_CONNECTED 0x0001 #define HN_FLAG_RXBUF_CONNECTED 0x0001
#define HN_FLAG_CHIM_CONNECTED 0x0002 #define HN_FLAG_CHIM_CONNECTED 0x0002

View File

@ -312,8 +312,8 @@ static u_int hn_cpu_index;
/* /*
* Forward declarations * Forward declarations
*/ */
static void hn_stop(hn_softc_t *sc); static void hn_stop(struct hn_softc *sc);
static void hn_ifinit_locked(hn_softc_t *sc); static void hn_ifinit_locked(struct hn_softc *sc);
static void hn_ifinit(void *xsc); static void hn_ifinit(void *xsc);
static int hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); static int hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
static int hn_start_locked(struct hn_tx_ring *txr, int len); static int hn_start_locked(struct hn_tx_ring *txr, int len);
@ -450,19 +450,17 @@ netvsc_probe(device_t dev)
static int static int
netvsc_attach(device_t dev) netvsc_attach(device_t dev)
{ {
struct hn_softc *sc = device_get_softc(dev);
struct sysctl_oid_list *child; struct sysctl_oid_list *child;
struct sysctl_ctx_list *ctx; struct sysctl_ctx_list *ctx;
uint8_t eaddr[ETHER_ADDR_LEN]; uint8_t eaddr[ETHER_ADDR_LEN];
uint32_t link_status; uint32_t link_status;
hn_softc_t *sc;
struct ifnet *ifp = NULL; struct ifnet *ifp = NULL;
int error, ring_cnt, tx_ring_cnt; int error, ring_cnt, tx_ring_cnt;
#if __FreeBSD_version >= 1100045 #if __FreeBSD_version >= 1100045
int tso_maxlen; int tso_maxlen;
#endif #endif
sc = device_get_softc(dev);
sc->hn_dev = dev; sc->hn_dev = dev;
sc->hn_prichan = vmbus_get_channel(dev); sc->hn_prichan = vmbus_get_channel(dev);
@ -1495,7 +1493,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int dlen,
static int static int
hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{ {
hn_softc_t *sc = ifp->if_softc; struct hn_softc *sc = ifp->if_softc;
struct ifreq *ifr = (struct ifreq *)data; struct ifreq *ifr = (struct ifreq *)data;
#ifdef INET #ifdef INET
struct ifaddr *ifa = (struct ifaddr *)data; struct ifaddr *ifa = (struct ifaddr *)data;
@ -1708,11 +1706,8 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
return (error); return (error);
} }
/*
*
*/
static void static void
hn_stop(hn_softc_t *sc) hn_stop(struct hn_softc *sc)
{ {
struct ifnet *ifp; struct ifnet *ifp;
int ret, i; int ret, i;
@ -1791,11 +1786,8 @@ hn_start_txeof(struct hn_tx_ring *txr)
} }
} }
/*
*
*/
static void static void
hn_ifinit_locked(hn_softc_t *sc) hn_ifinit_locked(struct hn_softc *sc)
{ {
struct ifnet *ifp; struct ifnet *ifp;
int ret, i; int ret, i;
@ -1829,7 +1821,7 @@ hn_ifinit_locked(hn_softc_t *sc)
static void static void
hn_ifinit(void *xsc) hn_ifinit(void *xsc)
{ {
hn_softc_t *sc = xsc; struct hn_softc *sc = xsc;
NV_LOCK(sc); NV_LOCK(sc);
if (sc->temp_unusable) { if (sc->temp_unusable) {
@ -3485,7 +3477,7 @@ static device_method_t netvsc_methods[] = {
static driver_t netvsc_driver = { static driver_t netvsc_driver = {
NETVSC_DEVNAME, NETVSC_DEVNAME,
netvsc_methods, netvsc_methods,
sizeof(hn_softc_t) sizeof(struct hn_softc)
}; };
static devclass_t netvsc_devclass; static devclass_t netvsc_devclass;