summaryrefslogtreecommitdiffstats
path: root/sys/dev/en
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/en
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/en')
-rw-r--r--sys/dev/en/if_en_pci.c4
-rw-r--r--sys/dev/en/midway.c20
2 files changed, 12 insertions, 12 deletions
diff --git a/sys/dev/en/if_en_pci.c b/sys/dev/en/if_en_pci.c
index c167e2a..77724d4 100644
--- a/sys/dev/en/if_en_pci.c
+++ b/sys/dev/en/if_en_pci.c
@@ -304,9 +304,9 @@ en_pci_detach(device_t dev)
/*
* Stop DMA and drop transmit queue.
*/
- if ((sc->ifp->if_flags & IFF_RUNNING)) {
+ if ((sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) {
if_printf(sc->ifp, "still running\n");
- sc->ifp->if_flags &= ~IFF_RUNNING;
+ sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
}
/*
diff --git a/sys/dev/en/midway.c b/sys/dev/en/midway.c
index 165655e..219d542 100644
--- a/sys/dev/en/midway.c
+++ b/sys/dev/en/midway.c
@@ -1043,7 +1043,7 @@ en_start(struct ifnet *ifp)
continue;
}
- if ((ifp->if_flags & IFF_RUNNING) == 0) {
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
EN_UNLOCK(sc);
uma_zfree(sc->map_zone, map);
m_freem(m);
@@ -1314,12 +1314,12 @@ en_close_vcc(struct en_softc *sc, struct atmio_closevcc *cl)
goto done;
vc->vflags |= VCC_CLOSE_RX;
- while ((sc->ifp->if_flags & IFF_RUNNING) &&
+ while ((sc->ifp->if_drv_flags & IFF_DRV_RUNNING) &&
(vc->vflags & VCC_DRAIN))
cv_wait(&sc->cv_close, &sc->en_mtx);
en_close_finish(sc, vc);
- if (!(sc->ifp->if_flags & IFF_RUNNING)) {
+ if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) {
error = EIO;
goto done;
}
@@ -1350,7 +1350,7 @@ en_reset_ul(struct en_softc *sc)
int lcv;
if_printf(sc->ifp, "reset\n");
- sc->ifp->if_flags &= ~IFF_RUNNING;
+ sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
if (sc->en_busreset)
sc->en_busreset(sc);
@@ -1446,7 +1446,7 @@ en_init(struct en_softc *sc)
}
DBG(sc, INIT, ("going up"));
- sc->ifp->if_flags |= IFF_RUNNING; /* enable */
+ sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; /* enable */
if (sc->en_busreset)
sc->en_busreset(sc);
@@ -1550,7 +1550,7 @@ en_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
#if defined(INET) || defined(INET6)
if (ifa->ifa_addr->sa_family == AF_INET
|| ifa->ifa_addr->sa_family == AF_INET6) {
- if (!(ifp->if_flags & IFF_RUNNING)) {
+ if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
en_reset_ul(sc);
en_init(sc);
}
@@ -1559,7 +1559,7 @@ en_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
break;
}
#endif /* INET */
- if (!(ifp->if_flags & IFF_RUNNING)) {
+ if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
en_reset_ul(sc);
en_init(sc);
}
@@ -1569,10 +1569,10 @@ en_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case SIOCSIFFLAGS:
EN_LOCK(sc);
if (ifp->if_flags & IFF_UP) {
- if (!(ifp->if_flags & IFF_RUNNING))
+ if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
en_init(sc);
} else {
- if (ifp->if_flags & IFF_RUNNING)
+ if (ifp->if_drv_flags & IFF_DRV_RUNNING)
en_reset_ul(sc);
}
EN_UNLOCK(sc);
@@ -2434,7 +2434,7 @@ en_intr(void *arg)
"resetting\n", reg, MID_INTBITS);
#ifdef EN_DEBUG
kdb_enter("en: unexpected error");
- sc->ifp->if_flags &= ~IFF_RUNNING; /* FREEZE! */
+ sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; /* FREEZE! */
#else
en_reset_ul(sc);
en_init(sc);
OpenPOWER on IntegriCloud