summaryrefslogtreecommitdiffstats
path: root/sys/dev/ep/if_ep.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/ep/if_ep.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/ep/if_ep.c')
-rw-r--r--sys/dev/ep/if_ep.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c
index af7e3f7..3cf9623 100644
--- a/sys/dev/ep/if_ep.c
+++ b/sys/dev/ep/if_ep.c
@@ -358,7 +358,7 @@ ep_detach(device_t dev)
if (bus_child_present(dev))
epstop(sc);
- ifp->if_flags &= ~IFF_RUNNING;
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
ether_ifdetach(ifp);
if_free(ifp);
@@ -438,8 +438,8 @@ epinit_locked(struct ep_softc *sc)
CSR_WRITE_2(sc, EP_COMMAND, RX_ENABLE);
CSR_WRITE_2(sc, EP_COMMAND, TX_ENABLE);
- ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE; /* just in case */
+ ifp->if_drv_flags |= IFF_DRV_RUNNING;
+ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* just in case */
#ifdef EP_LOCAL_STATS
sc->rx_no_first = sc->rx_no_mbuf =
@@ -480,7 +480,7 @@ epstart_locked(struct ifnet *ifp)
return;
EP_ASSERT_LOCKED(sc);
EP_BUSY_WAIT(sc);
- if (ifp->if_flags & IFF_OACTIVE)
+ if (ifp->if_drv_flags & IFF_DRV_OACTIVE)
return;
startagain:
/* Sneak a peek at the next packet */
@@ -508,7 +508,7 @@ startagain:
CSR_WRITE_2(sc, EP_COMMAND, SET_TX_AVAIL_THRESH | (len + pad + 4));
/* make sure */
if (CSR_READ_2(sc, EP_W1_FREE_TX) < len + pad + 4) {
- ifp->if_flags |= IFF_OACTIVE;
+ ifp->if_drv_flags |= IFF_DRV_OACTIVE;
IF_PREPEND(&ifp->if_snd, m0);
goto done;
}
@@ -607,7 +607,7 @@ rescan:
if (status & S_TX_AVAIL) {
/* we need ACK */
ifp->if_timer = 0;
- ifp->if_flags &= ~IFF_OACTIVE;
+ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
GO_WINDOW(sc, 1);
CSR_READ_2(sc, EP_W1_FREE_TX);
epstart_locked(ifp);
@@ -681,7 +681,7 @@ rescan:
/* pops up the next status */
CSR_WRITE_1(sc, EP_W1_TX_STATUS, 0x0);
} /* while */
- ifp->if_flags &= ~IFF_OACTIVE;
+ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
GO_WINDOW(sc, 1);
CSR_READ_2(sc, EP_W1_FREE_TX);
epstart_locked(ifp);
@@ -910,8 +910,8 @@ epioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
case SIOCSIFFLAGS:
EP_LOCK(sc);
if (((ifp->if_flags & IFF_UP) == 0) &&
- (ifp->if_flags & IFF_RUNNING)) {
- ifp->if_flags &= ~IFF_RUNNING;
+ (ifp->if_drv_flags & IFF_DRV_RUNNING)) {
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
epstop(sc);
} else
/* reinitialize card on any parameter change */
@@ -956,7 +956,7 @@ epwatchdog(struct ifnet *ifp)
if (sc->gone)
return;
- ifp->if_flags &= ~IFF_OACTIVE;
+ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
epstart(ifp);
ep_intr(ifp->if_softc);
}
OpenPOWER on IntegriCloud