summaryrefslogtreecommitdiffstats
path: root/sys/dev/snc
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/snc
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/snc')
-rw-r--r--sys/dev/snc/dp83932.c22
-rw-r--r--sys/dev/snc/if_snc_pccard.c2
2 files changed, 13 insertions, 11 deletions
diff --git a/sys/dev/snc/dp83932.c b/sys/dev/snc/dp83932.c
index b85170c..bbc1e97 100644
--- a/sys/dev/snc/dp83932.c
+++ b/sys/dev/snc/dp83932.c
@@ -266,16 +266,16 @@ sncioctl(ifp, cmd, data)
case SIOCSIFFLAGS:
if ((ifp->if_flags & IFF_UP) == 0 &&
- (ifp->if_flags & IFF_RUNNING) != 0) {
+ (ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
/*
* If interface is marked down and it is running,
* then stop it.
*/
sncstop(sc);
- ifp->if_flags &= ~IFF_RUNNING;
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
snc_disable(sc);
} else if ((ifp->if_flags & IFF_UP) != 0 &&
- (ifp->if_flags & IFF_RUNNING) == 0) {
+ (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
/*
* If interface is marked up and it is stopped,
* then start it.
@@ -330,7 +330,8 @@ sncstart(ifp)
struct mbuf *m;
int mtd_next;
- if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+ if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) !=
+ IFF_DRV_RUNNING)
return;
outloop:
@@ -339,7 +340,7 @@ outloop:
mtd_next = 0;
if (mtd_next == sc->mtd_hw) {
- ifp->if_flags |= IFF_OACTIVE;
+ ifp->if_drv_flags |= IFF_DRV_OACTIVE;
return;
}
@@ -399,7 +400,7 @@ sncinit(xsc)
u_long s_rcr;
int s;
- if (sc->sc_ifp->if_flags & IFF_RUNNING)
+ if (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING)
/* already running */
return;
@@ -451,8 +452,8 @@ sncinit(xsc)
wbflush();
/* flag interface as "running" */
- sc->sc_ifp->if_flags |= IFF_RUNNING;
- sc->sc_ifp->if_flags &= ~IFF_OACTIVE;
+ sc->sc_ifp->if_drv_flags |= IFF_DRV_RUNNING;
+ sc->sc_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
splx(s);
return;
@@ -485,7 +486,8 @@ sncstop(sc)
}
sc->sc_ifp->if_timer = 0;
- sc->sc_ifp->if_flags &= ~(IFF_RUNNING | IFF_UP);
+ sc->sc_ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+ sc->sc_ifp->if_flags &= ~IFF_UP;
splx(s);
return (0);
@@ -939,7 +941,7 @@ sonictxint(sc)
}
#endif /* SNCDEBUG */
- ifp->if_flags &= ~IFF_OACTIVE;
+ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
if (mtd->mtd_mbuf != 0) {
m_freem(mtd->mtd_mbuf);
diff --git a/sys/dev/snc/if_snc_pccard.c b/sys/dev/snc/if_snc_pccard.c
index a815080..64e2faf 100644
--- a/sys/dev/snc/if_snc_pccard.c
+++ b/sys/dev/snc/if_snc_pccard.c
@@ -95,7 +95,7 @@ snc_pccard_detach(device_t dev)
return (0);
}
sncshutdown(sc);
- ifp->if_flags &= ~IFF_RUNNING;
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
if_detach(ifp);
sc->gone = 1;
bus_teardown_intr(dev, sc->irq, sc->irq_handle);
OpenPOWER on IntegriCloud