summaryrefslogtreecommitdiffstats
path: root/sys/dev/patm/if_patm_ioctl.c
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/patm/if_patm_ioctl.c
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/patm/if_patm_ioctl.c')
-rw-r--r--sys/dev/patm/if_patm_ioctl.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/patm/if_patm_ioctl.c b/sys/dev/patm/if_patm_ioctl.c
index 651bed6..2ed466d 100644
--- a/sys/dev/patm/if_patm_ioctl.c
+++ b/sys/dev/patm/if_patm_ioctl.c
@@ -107,7 +107,7 @@ patm_open_vcc(struct patm_softc *sc, struct atmio_openvcc *arg)
return (ENOMEM);
mtx_lock(&sc->mtx);
- if (!(sc->ifp->if_flags & IFF_RUNNING)) {
+ if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) {
/* stopped while we have analyzed the arguments */
error = EIO;
goto done;
@@ -224,7 +224,7 @@ patm_close_vcc(struct patm_softc *sc, struct atmio_closevcc *arg)
cid = PATM_CID(sc, arg->vpi, arg->vci);
mtx_lock(&sc->mtx);
- if (!(sc->ifp->if_flags & IFF_RUNNING)) {
+ if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) {
/* stopped while we have analyzed the arguments */
error = EIO;
goto done;
@@ -246,7 +246,7 @@ patm_close_vcc(struct patm_softc *sc, struct atmio_closevcc *arg)
while (vcc->vflags & (PATM_VCC_TX_CLOSING | PATM_VCC_RX_CLOSING)) {
cv_wait(&sc->vcc_cv, &sc->mtx);
- if (!(sc->ifp->if_flags & IFF_RUNNING)) {
+ if (!(sc->ifp->if_drv_flags & IFF_DRV_RUNNING)) {
/* ups, has been stopped */
error = EIO;
goto done;
@@ -299,7 +299,7 @@ patm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case SIOCSIFADDR:
mtx_lock(&sc->mtx);
ifp->if_flags |= IFF_UP;
- if (!(ifp->if_flags & IFF_RUNNING))
+ if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
patm_initialize(sc);
switch (ifa->ifa_addr->sa_family) {
@@ -318,11 +318,11 @@ patm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case SIOCSIFFLAGS:
mtx_lock(&sc->mtx);
if (ifp->if_flags & IFF_UP) {
- if (!(ifp->if_flags & IFF_RUNNING)) {
+ if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
patm_initialize(sc);
}
} else {
- if (ifp->if_flags & IFF_RUNNING) {
+ if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
patm_stop(sc);
}
}
@@ -339,7 +339,7 @@ patm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
* null cells of it gets the timing wrong.
*/
mtx_lock(&sc->mtx);
- if (ifp->if_flags & IFF_RUNNING) {
+ if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
if (sc->utopia.state & UTP_ST_UNASS) {
if (!(sc->flags & PATM_UNASS)) {
cfg = patm_nor_read(sc, IDT_NOR_CFG);
OpenPOWER on IntegriCloud