diff options
author | Brooks Davis <brooks@FreeBSD.org> | 2003-10-31 18:32:15 +0000 |
---|---|---|
committer | Brooks Davis <brooks@FreeBSD.org> | 2003-10-31 18:32:15 +0000 |
commit | 9bf40ede4a299f315bc4b0ae5329631b8c7dc271 (patch) | |
tree | 4d9e6671d486576767506230a4240131526fea49 /sys/dev/wl/if_wl.c | |
parent | dc6279b887bf4473d77b898631f74466b5f7a094 (diff) |
Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.
This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.
Approved By: re (in principle)
Reviewed By: njl, imp
Tested On: i386, amd64, sparc64
Obtained From: NetBSD (if_xname)
Notes
Notes:
svn path=/head/; revision=121816
Diffstat (limited to 'sys/dev/wl/if_wl.c')
-rw-r--r-- | sys/dev/wl/if_wl.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/sys/dev/wl/if_wl.c b/sys/dev/wl/if_wl.c index f1f4027d4043..e25f965b6505 100644 --- a/sys/dev/wl/if_wl.c +++ b/sys/dev/wl/if_wl.c @@ -554,8 +554,7 @@ wlattach(device_t device) #if MULTICAST ifp->if_flags |= IFF_MULTICAST; #endif /* MULTICAST */ - ifp->if_name = "wl"; - ifp->if_unit = unit; + if_initname(ifp, device_get_name(device), device_get_unit(device)); ifp->if_init = wlinit; ifp->if_output = ether_output; ifp->if_start = wlstart; @@ -570,7 +569,7 @@ wlattach(device_t device) ether_ifattach(ifp, &sc->wl_addr[0]); bcopy(&sc->wl_addr[0], sc->wl_ac.ac_enaddr, WAVELAN_ADDR_SIZE); - printf("%s%d: address %6D, NWID 0x%02x%02x", ifp->if_name, ifp->if_unit, + printf("%s: address %6D, NWID 0x%02x%02x", ifp->if_xname, sc->wl_ac.ac_enaddr, ":", sc->nwid[0], sc->nwid[1]); if (sc->freq24) printf(", Freq %d MHz",sc->freq24); /* 2.4 Gz */ @@ -966,7 +965,6 @@ wlbldcu(struct wl_softc *sc) static void wlstart(struct ifnet *ifp) { - int unit = ifp->if_unit; struct mbuf *m; struct wl_softc *sc = ifp->if_softc; short base = sc->base; @@ -975,7 +973,7 @@ wlstart(struct ifnet *ifp) WL_LOCK(sc); #ifdef WLDEBUG if (sc->wl_if.if_flags & IFF_DEBUG) - printf("wl%d: entered wlstart()\n",unit); + printf("%s: entered wlstart()\n", ifp->if_xname); #endif outw(PIOR1(base), OFFSET_CU); @@ -1000,8 +998,8 @@ wlstart(struct ifnet *ifp) * became idle but WE have masked interrupts so ... */ #ifdef WLDEBUG - printf("wl%d: CU idle, scb %04x %04x cu %04x\n", - unit, scb_status, scb_command, cu_status); + printf("%s: CU idle, scb %04x %04x cu %04x\n", + ifp->if_xname, scb_status, scb_command, cu_status); #endif if (xmt_watch) printf("!!"); } else { @@ -1011,10 +1009,10 @@ wlstart(struct ifnet *ifp) } else if ((scb_status & 0x0700) == SCB_CUS_ACTV || (cu_status & AC_SW_B)){ #ifdef WLDEBUG - printf("wl%d: CU unexpectedly busy; scb %04x cu %04x\n", - unit, scb_status, cu_status); + printf("%s: CU unexpectedly busy; scb %04x cu %04x\n", + ifp->if_xname, scb_status, cu_status); #endif - if (xmt_watch) printf("wl%d: busy?!",unit); + if (xmt_watch) printf("%s: busy?!",ifp->if_xname); WL_UNLOCK(sc); return; /* hey, why are we busy? */ } @@ -1078,7 +1076,7 @@ wlread(struct wl_softc *sc, u_short fd_p) printf("wl%d: entered wlread()\n", sc->unit); #endif if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) { - printf("wl%d read(): board is not running.\n", sc->unit); + printf("%s read(): board is not running.\n", ifp->if_xname); sc->hacr &= ~HACR_INTRON; CMD(sc); /* turn off interrupts */ } @@ -1235,7 +1233,6 @@ static int wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct ifreq *ifr = (struct ifreq *)data; - int unit = ifp->if_unit; struct wl_softc *sc = ifp->if_softc; short base = sc->base; short mode = 0; @@ -1251,7 +1248,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) WL_LOCK(sc); #ifdef WLDEBUG if (sc->wl_if.if_flags & IFF_DEBUG) - printf("wl%d: entered wlioctl()\n",unit); + printf("%s: entered wlioctl()\n", ifp->if_xname); #endif opri = splimp(); switch (cmd) { @@ -1282,7 +1279,7 @@ wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data) * stop it. */ if ((ifp->if_flags & IFF_UP) == 0 && sc->flags & DSF_RUNNING) { - printf("wl%d ioctl(): board is not running\n", unit); + printf("%s ioctl(): board is not running\n", ifp->if_xname); sc->flags &= ~DSF_RUNNING; sc->hacr &= ~HACR_INTRON; CMD(sc); /* turn off interrupts */ @@ -1768,7 +1765,7 @@ static int xmt_debug = 0; * locations on the WaveLAN board and starts the board off on * the transmit. * - * input : board number of interest, and a pointer to the mbuf + * input : pointers to board of interest's softc and the mbuf * output : board memory and registers are set for xfer and attention * */ @@ -1789,7 +1786,7 @@ wlxmt(struct wl_softc *sc, struct mbuf *m) #ifdef WLDEBUG if (sc->wl_if.if_flags & IFF_DEBUG) - printf("wl%d: entered wlxmt()\n", sc->unit); + printf("%s: entered wlxmt()\n", sc->wl_if.if_xname); #endif cb.ac_status = 0; @@ -1899,7 +1896,7 @@ wlxmt(struct wl_softc *sc, struct mbuf *m) break; } if ((spin == 0) && xmt_watch) { /* not waking up, and we care */ - printf("wl%d: slow accepting xmit\n", sc->unit); + printf("%s: slow accepting xmit\n", sc->wl_if.if_xname); } } outw(PIOP0(base), SCB_CU_STRT); /* new command */ |