summaryrefslogtreecommitdiffstats
path: root/sys/dev/wl
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-08-09 10:20:02 +0000
committerrwatson <rwatson@FreeBSD.org>2005-08-09 10:20:02 +0000
commit5d770a09e85126b8b3e9fe302c36350a90210cbe (patch)
treebb70e59641e2310a3c26ec449af5ab0cb7420d9d /sys/dev/wl
parent74759aaa78777146f23aa05c856f574efdfb41d9 (diff)
downloadFreeBSD-src-5d770a09e85126b8b3e9fe302c36350a90210cbe.zip
FreeBSD-src-5d770a09e85126b8b3e9fe302c36350a90210cbe.tar.gz
Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and
IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field. Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so. Reviewed by: pjd, bz MFC after: 7 days
Diffstat (limited to 'sys/dev/wl')
-rw-r--r--sys/dev/wl/if_wl.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/wl/if_wl.c b/sys/dev/wl/if_wl.c
index ce3ed0d..aa57433 100644
--- a/sys/dev/wl/if_wl.c
+++ b/sys/dev/wl/if_wl.c
@@ -810,12 +810,12 @@ wlinit(void *xsc)
WL_LOCK(sc);
oldpri = splimp();
if ((stat = wlhwrst(sc)) == TRUE) {
- sc->ifp->if_flags |= IFF_RUNNING; /* same as DSF_RUNNING */
+ sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; /* same as DSF_RUNNING */
/*
* OACTIVE is used by upper-level routines
* and must be set
*/
- sc->ifp->if_flags &= ~IFF_OACTIVE; /* same as tbusy below */
+ sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* same as tbusy below */
sc->flags |= DSF_RUNNING;
sc->tbusy = 0;
@@ -990,7 +990,7 @@ wlstart(struct ifnet *ifp)
(cu_status & AC_SW_B) == 0){
sc->tbusy = 0;
untimeout(wlwatchdog, sc, sc->watchdog_ch);
- sc->ifp->if_flags &= ~IFF_OACTIVE;
+ sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
/*
* This is probably just a race. The xmt'r is just
* became idle but WE have masked interrupts so ...
@@ -1027,11 +1027,11 @@ wlstart(struct ifnet *ifp)
*/
/* try 10 ticks, not very long */
sc->watchdog_ch = timeout(wlwatchdog, sc, 10);
- sc->ifp->if_flags |= IFF_OACTIVE;
+ sc->ifp->if_drv_flags |= IFF_DRV_OACTIVE;
sc->ifp->if_opackets++;
wlxmt(sc, m);
} else {
- sc->ifp->if_flags &= ~IFF_OACTIVE;
+ sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
}
WL_UNLOCK(sc);
return;
@@ -1074,7 +1074,7 @@ wlread(struct wl_softc *sc, u_short fd_p)
if (sc->ifp->if_flags & IFF_DEBUG)
printf("wl%d: entered wlread()\n", sc->unit);
#endif
- if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) {
+ if (!((ifp->if_flags & IFF_UP) && (ifp->if_drv_flags & IFF_DRV_RUNNING))) {
printf("%s read(): board is not running.\n", ifp->if_xname);
sc->hacr &= ~HACR_INTRON;
CMD(sc); /* turn off interrupts */
@@ -1627,7 +1627,7 @@ wlintr(void *arg)
}
sc->tbusy = 0;
untimeout(wlwatchdog, sc, sc->watchdog_ch);
- sc->ifp->if_flags &= ~IFF_OACTIVE;
+ sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
wlstart(sc->ifp);
}
}
OpenPOWER on IntegriCloud