summaryrefslogtreecommitdiffstats
path: root/sys/dev/lnc/if_lnc.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/lnc/if_lnc.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/lnc/if_lnc.c')
-rw-r--r--sys/dev/lnc/if_lnc.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/sys/dev/lnc/if_lnc.c b/sys/dev/lnc/if_lnc.c
index 4829639..ca7f8c0 100644
--- a/sys/dev/lnc/if_lnc.c
+++ b/sys/dev/lnc/if_lnc.c
@@ -820,7 +820,7 @@ lnc_tint(struct lnc_softc *sc)
* more packets again.
*/
- sc->ifp->if_flags &= ~IFF_OACTIVE;
+ sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
lookahead++;
@@ -1070,8 +1070,8 @@ printf("Enabling lnc interrupts\n");
* running and transmit any pending packets.
*/
write_csr(sc, CSR0, STRT | INEA);
- sc->ifp->if_flags |= IFF_RUNNING;
- sc->ifp->if_flags &= ~IFF_OACTIVE;
+ sc->ifp->if_drv_flags |= IFF_DRV_RUNNING;
+ sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
lnc_start(sc->ifp);
} else
log(LOG_ERR, "%s: Initialisation failed\n",
@@ -1130,8 +1130,8 @@ lncintr(void *arg)
printf("IDON\n");
sc->ifp->if_timer = 0;
write_csr(sc, CSR0, STRT | INEA);
- sc->ifp->if_flags |= IFF_RUNNING;
- sc->ifp->if_flags &= ~IFF_OACTIVE;
+ sc->ifp->if_drv_flags |= IFF_DRV_RUNNING;
+ sc->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
lnc_start(sc->ifp);
continue;
}
@@ -1174,7 +1174,7 @@ printf("IDON\n");
* some more transmit packets.
*/
- if (!(sc->ifp->if_flags & IFF_OACTIVE))
+ if (!(sc->ifp->if_drv_flags & IFF_DRV_OACTIVE))
lnc_start(sc->ifp);
}
}
@@ -1213,9 +1213,9 @@ chain_to_cluster(struct mbuf *m)
}
/*
- * IFF_OACTIVE and IFF_RUNNING are checked in ether_output so it's redundant
- * to check them again since we wouldn't have got here if they were not
- * appropriately set. This is also called from lnc_init and lncintr but the
+ * IFF_DRV_OACTIVE and IFF_DRV_RUNNING are checked in ether_output so it's
+ * redundant to check them again since we wouldn't have got here if they were
+ * not appropriately set. This is also called from lnc_init and lncintr but the
* flags should be ok at those points too.
*/
@@ -1366,11 +1366,11 @@ lnc_start(struct ifnet *ifp)
} while (sc->pending_transmits < NDESC(sc->ntdre));
/*
- * Transmit ring is full so set IFF_OACTIVE
+ * Transmit ring is full so set IFF_DRV_OACTIVE
* since we can't buffer any more packets.
*/
- sc->ifp->if_flags |= IFF_OACTIVE;
+ sc->ifp->if_drv_flags |= IFF_DRV_OACTIVE;
LNCSTATS(trans_ring_full)
}
@@ -1412,15 +1412,15 @@ lnc_ioctl(struct ifnet * ifp, u_long command, caddr_t data)
}
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.
*/
lnc_stop(sc);
- ifp->if_flags &= ~IFF_RUNNING;
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
} 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.
OpenPOWER on IntegriCloud