diff options
author | luigi <luigi@FreeBSD.org> | 2004-04-15 20:31:10 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2004-04-15 20:31:10 +0000 |
commit | 7d7307d2e1689754b4def7b381a46fd20919d442 (patch) | |
tree | 5724ee7f72224819d2453cd24c370e176d84429f | |
parent | fa9222585e2ae94c9da702e4b6a4fd959416bd33 (diff) | |
download | FreeBSD-src-7d7307d2e1689754b4def7b381a46fd20919d442.zip FreeBSD-src-7d7307d2e1689754b4def7b381a46fd20919d442.tar.gz |
Remove improper use of if_addrhead in device drivers to check
if the link-level address has been initialized already.
The majority of modern drivers never does this and works fine, which
makes me think that the check is totally unnecessary and a residue
of cut&paste from other drivers.
This change is done to simplify locking because now almost none of the
drivers uses this field. The exceptions are "ct" "ctau" and "cx"
where i am not sure if i can remove that part.
-rw-r--r-- | sys/dev/arl/if_arl.c | 3 | ||||
-rw-r--r-- | sys/dev/cs/if_cs.c | 4 | ||||
-rw-r--r-- | sys/dev/ed/if_ed.c | 4 | ||||
-rw-r--r-- | sys/dev/ex/if_ex.c | 3 | ||||
-rw-r--r-- | sys/dev/fe/if_fe.c | 8 | ||||
-rw-r--r-- | sys/dev/lnc/if_lnc.c | 7 | ||||
-rw-r--r-- | sys/dev/sbni/if_sbni.c | 4 | ||||
-rw-r--r-- | sys/dev/sn/if_sn.c | 18 | ||||
-rw-r--r-- | sys/dev/wl/if_wl.c | 2 | ||||
-rw-r--r-- | sys/dev/xe/if_xe.c | 2 |
10 files changed, 0 insertions, 55 deletions
diff --git a/sys/dev/arl/if_arl.c b/sys/dev/arl/if_arl.c index f3495fb..9a69870 100644 --- a/sys/dev/arl/if_arl.c +++ b/sys/dev/arl/if_arl.c @@ -701,9 +701,6 @@ arl_init(xsc) D(("init\n")); - if (TAILQ_EMPTY(&ifp->if_addrhead)) - return; - s = splimp(); if (ARL_CHECKREG(sc)) diff --git a/sys/dev/cs/if_cs.c b/sys/dev/cs/if_cs.c index 3b28691..a10d25d 100644 --- a/sys/dev/cs/if_cs.c +++ b/sys/dev/cs/if_cs.c @@ -699,10 +699,6 @@ cs_init(void *xsc) struct ifnet *ifp = &sc->arpcom.ac_if; int i, s, rx_cfg; - /* address not known */ - if (TAILQ_EMPTY(&ifp->if_addrhead)) /* unlikely? XXX */ - return; - /* * reset whatchdog timer */ diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index 5bac677..9b7a0d4 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -1884,10 +1884,6 @@ ed_init(xsc) if (sc->gone) return; - /* address not known */ - if (TAILQ_EMPTY(&ifp->if_addrhead)) /* unlikely? XXX */ - return; - /* * Initialize the NIC in the exact order outlined in the NS manual. * This init procedure is "mandatory"...don't change what or when diff --git a/sys/dev/ex/if_ex.c b/sys/dev/ex/if_ex.c index 9d8b9b0..c0a64e0 100644 --- a/sys/dev/ex/if_ex.c +++ b/sys/dev/ex/if_ex.c @@ -305,9 +305,6 @@ ex_init(void *xsc) DODEBUG(Start_End, printf("%s: ex_init: start\n", ifp->if_xname);); - if (TAILQ_FIRST(&ifp->if_addrhead) == NULL) { - return; - } s = splimp(); ifp->if_timer = 0; diff --git a/sys/dev/fe/if_fe.c b/sys/dev/fe/if_fe.c index 613c76a..ed89b52 100644 --- a/sys/dev/fe/if_fe.c +++ b/sys/dev/fe/if_fe.c @@ -1007,14 +1007,6 @@ fe_init (void * xsc) struct fe_softc *sc = xsc; int s; - /* We need an address. */ - if (TAILQ_EMPTY(&sc->sc_if.if_addrhead)) { /* XXX unlikely */ -#ifdef DIAGNOSTIC - printf("%s: init() without any address\n", sc->sc_xname); -#endif - return; - } - /* Start initializing 86960. */ s = splimp(); diff --git a/sys/dev/lnc/if_lnc.c b/sys/dev/lnc/if_lnc.c index 52b5412..d3aabba 100644 --- a/sys/dev/lnc/if_lnc.c +++ b/sys/dev/lnc/if_lnc.c @@ -911,13 +911,6 @@ lnc_init(xsc) int s, i; char *lnc_mem; - /* Check that interface has valid address */ - - if (TAILQ_EMPTY(&sc->arpcom.ac_if.if_addrhead)) { /* XXX unlikely */ -printf("XXX no address?\n"); - return; - } - /* Shut down interface */ s = splimp(); diff --git a/sys/dev/sbni/if_sbni.c b/sys/dev/sbni/if_sbni.c index e4cacf2..42c6573 100644 --- a/sys/dev/sbni/if_sbni.c +++ b/sys/dev/sbni/if_sbni.c @@ -264,10 +264,6 @@ sbni_init(void *xsc) sc = (struct sbni_softc *)xsc; ifp = &sc->arpcom.ac_if; - /* address not known */ - if (TAILQ_EMPTY(&ifp->if_addrhead)) - return; - /* * kludge to avoid multiple initialization when more than once * protocols configured diff --git a/sys/dev/sn/if_sn.c b/sys/dev/sn/if_sn.c index f65aada..57925fa 100644 --- a/sys/dev/sn/if_sn.c +++ b/sys/dev/sn/if_sn.c @@ -216,24 +216,6 @@ sn_attach(device_t dev) ether_ifattach(ifp, sc->arpcom.ac_enaddr); /* - * Fill the hardware address into ifa_addr if we find an AF_LINK - * entry. We need to do this so bpf's can get the hardware addr of - * this card. netstat likes this too! - */ - ifa = TAILQ_FIRST(&ifp->if_addrhead); - while ((ifa != 0) && (ifa->ifa_addr != 0) && - (ifa->ifa_addr->sa_family != AF_LINK)) - ifa = TAILQ_NEXT(ifa, ifa_link); - - if ((ifa != 0) && (ifa->ifa_addr != 0)) { - sdl = (struct sockaddr_dl *) ifa->ifa_addr; - sdl->sdl_type = IFT_ETHER; - sdl->sdl_alen = ETHER_ADDR_LEN; - sdl->sdl_slen = 0; - bcopy(sc->arpcom.ac_enaddr, LLADDR(sdl), ETHER_ADDR_LEN); - } - - /* * Activate the interrupt so we can get card interrupts. This * needs to be done last so that we don't have/hold the lock * during startup to avoid LORs in the network layer. diff --git a/sys/dev/wl/if_wl.c b/sys/dev/wl/if_wl.c index 47ee647..d582b8f 100644 --- a/sys/dev/wl/if_wl.c +++ b/sys/dev/wl/if_wl.c @@ -806,8 +806,6 @@ wlinit(void *xsc) if (sc->wl_if.if_flags & IFF_DEBUG) printf("wl%d: entered wlinit()\n",sc->unit); #endif - if (TAILQ_FIRST(&ifp->if_addrhead) == (struct ifaddr *)0) - return; WL_LOCK(sc); oldpri = splimp(); if ((stat = wlhwrst(sc)) == TRUE) { diff --git a/sys/dev/xe/if_xe.c b/sys/dev/xe/if_xe.c index dfb35ee..0d9eb92 100644 --- a/sys/dev/xe/if_xe.c +++ b/sys/dev/xe/if_xe.c @@ -317,8 +317,6 @@ xe_init(void *xscp) { unsigned i; int s; - if (TAILQ_EMPTY(&scp->ifp->if_addrhead)) return; - if (scp->autoneg_status != XE_AUTONEG_NONE) return; DEVPRINTF(2, (scp->dev, "init\n")); |