summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_xl.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/pci/if_xl.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/pci/if_xl.c')
-rw-r--r--sys/pci/if_xl.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c
index 72c8ce0..78d100d 100644
--- a/sys/pci/if_xl.c
+++ b/sys/pci/if_xl.c
@@ -2159,7 +2159,7 @@ xl_txeof(struct xl_softc *sc)
}
if (sc->xl_cdata.xl_tx_head == NULL) {
- ifp->if_flags &= ~IFF_OACTIVE;
+ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
sc->xl_cdata.xl_tx_tail = NULL;
} else {
if (CSR_READ_4(sc, XL_DMACTL) & XL_DMACTL_DOWN_STALLED ||
@@ -2209,7 +2209,7 @@ xl_txeof_90xB(struct xl_softc *sc)
sc->xl_cdata.xl_tx_cons = idx;
if (cur_tx != NULL)
- ifp->if_flags &= ~IFF_OACTIVE;
+ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
}
/*
@@ -2611,7 +2611,7 @@ xl_start_locked(struct ifnet *ifp)
xl_txeoc(sc);
xl_txeof(sc);
if (sc->xl_cdata.xl_tx_free == NULL) {
- ifp->if_flags |= IFF_OACTIVE;
+ ifp->if_drv_flags |= IFF_DRV_OACTIVE;
return;
}
}
@@ -2729,7 +2729,7 @@ xl_start_90xB_locked(struct ifnet *ifp)
XL_LOCK_ASSERT(sc);
- if (ifp->if_flags & IFF_OACTIVE)
+ if (ifp->if_drv_flags & IFF_DRV_OACTIVE)
return;
idx = sc->xl_cdata.xl_tx_prod;
@@ -2738,7 +2738,7 @@ xl_start_90xB_locked(struct ifnet *ifp)
while (sc->xl_cdata.xl_tx_chain[idx].xl_mbuf == NULL) {
if ((XL_TX_LIST_CNT - sc->xl_cdata.xl_tx_cnt) < 3) {
- ifp->if_flags |= IFF_OACTIVE;
+ ifp->if_drv_flags |= IFF_DRV_OACTIVE;
break;
}
@@ -3029,8 +3029,8 @@ xl_init_locked(struct xl_softc *sc)
/* Select window 7 for normal operations. */
XL_SEL_WIN(7);
- ifp->if_flags |= IFF_RUNNING;
- ifp->if_flags &= ~IFF_OACTIVE;
+ ifp->if_drv_flags |= IFF_DRV_RUNNING;
+ ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
sc->xl_stat_ch = timeout(xl_stats_update, sc, hz);
}
@@ -3166,14 +3166,14 @@ xl_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
XL_SEL_WIN(5);
rxfilt = CSR_READ_1(sc, XL_W5_RX_FILTER);
if (ifp->if_flags & IFF_UP) {
- if (ifp->if_flags & IFF_RUNNING &&
+ if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
ifp->if_flags & IFF_PROMISC &&
!(sc->xl_if_flags & IFF_PROMISC)) {
rxfilt |= XL_RXFILTER_ALLFRAMES;
CSR_WRITE_2(sc, XL_COMMAND,
XL_CMD_RX_SET_FILT|rxfilt);
XL_SEL_WIN(7);
- } else if (ifp->if_flags & IFF_RUNNING &&
+ } else if (ifp->if_drv_flags & IFF_DRV_RUNNING &&
!(ifp->if_flags & IFF_PROMISC) &&
sc->xl_if_flags & IFF_PROMISC) {
rxfilt &= ~XL_RXFILTER_ALLFRAMES;
@@ -3181,11 +3181,11 @@ xl_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
XL_CMD_RX_SET_FILT|rxfilt);
XL_SEL_WIN(7);
} else {
- if ((ifp->if_flags & IFF_RUNNING) == 0)
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
xl_init_locked(sc);
}
} else {
- if (ifp->if_flags & IFF_RUNNING)
+ if (ifp->if_drv_flags & IFF_DRV_RUNNING)
xl_stop(sc);
}
sc->xl_if_flags = ifp->if_flags;
@@ -3344,7 +3344,7 @@ xl_stop(struct xl_softc *sc)
if (sc->xl_ldata.xl_tx_list != NULL)
bzero(sc->xl_ldata.xl_tx_list, XL_TX_LIST_SZ);
- ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+ ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
}
/*
OpenPOWER on IntegriCloud