diff options
| author | thorpej <thorpej@NetBSD.org> | 2022-09-18 15:57:13 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2022-09-18 15:57:13 +0000 |
| commit | 100fd80ade9816d44ea3b93df4f9d0f4284b2c1e (patch) | |
| tree | a311339efc69a72db3a54c58b2d2e390e8fe2aad /sys/dev | |
| parent | 734badd990effb8cafa3fd40ed320d275a4226d7 (diff) | |
Eliminate use of IFF_OACTIVE.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/bi/if_ni.c | 9 | ||||
| -rw-r--r-- | sys/dev/cadence/if_cemac.c | 15 |
2 files changed, 10 insertions, 14 deletions
diff --git a/sys/dev/bi/if_ni.c b/sys/dev/bi/if_ni.c index c4cfcf20153..3c57cb28b48 100644 --- a/sys/dev/bi/if_ni.c +++ b/sys/dev/bi/if_ni.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ni.c,v 1.49 2019/05/28 07:41:48 msaitoh Exp $ */ +/* $NetBSD: if_ni.c,v 1.50 2022/09/18 16:51:28 thorpej Exp $ */ /* * Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved. * @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_ni.c,v 1.49 2019/05/28 07:41:48 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ni.c,v 1.50 2022/09/18 16:51:28 thorpej Exp $"); #include "opt_inet.h" @@ -482,7 +482,6 @@ niinit(struct ni_softc *sc) * Set flags (so ni_setup() do the right thing). */ ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; /* * Send setup messages so that the rx/tx locic starts. @@ -503,8 +502,6 @@ nistart(struct ifnet *ifp) struct mbuf *m, *m0; int i, cnt, res, mlen; - if (ifp->if_flags & IFF_OACTIVE) - return; #ifdef DEBUG if (ifp->if_flags & IFF_DEBUG) printf("%s: nistart\n", device_xname(sc->sc_dev)); @@ -517,7 +514,6 @@ nistart(struct ifnet *ifp) data = REMQHI(&fqb->nf_dforw); if ((int)data == Q_EMPTY) { - ifp->if_flags |= IFF_OACTIVE; break; } @@ -623,7 +619,6 @@ niintr(void *arg) case BVP_DGRAM: m = (struct mbuf *)data->nd_cmdref; - ifp->if_flags &= ~IFF_OACTIVE; m_freem(m); res = INSQTI(data, &fqb->nf_dforw); if (res == Q_EMPTY) { diff --git a/sys/dev/cadence/if_cemac.c b/sys/dev/cadence/if_cemac.c index 5809effc192..b53f2dcb9dc 100644 --- a/sys/dev/cadence/if_cemac.c +++ b/sys/dev/cadence/if_cemac.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_cemac.c,v 1.24 2021/12/31 14:25:22 riastradh Exp $ */ +/* $NetBSD: if_cemac.c,v 1.25 2022/09/18 16:54:30 thorpej Exp $ */ /* * Copyright (c) 2015 Genetec Corporation. All rights reserved. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v 1.24 2021/12/31 14:25:22 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v 1.25 2022/09/18 16:54:30 thorpej Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -126,6 +126,7 @@ struct cemac_softc { int txqi, txqc; struct cemac_qmeta txq[TX_QLEN]; callout_t cemac_tick_ch; + bool tx_busy; int cemac_flags; }; @@ -225,7 +226,6 @@ cemac_attach_common(device_t self, bus_space_tag_t iot, static int cemac_gctx(struct cemac_softc *sc) { - struct ifnet * ifp = &sc->sc_ethercom.ec_if; uint32_t tsr; tsr = CEMAC_READ(ETH_TSR); @@ -261,8 +261,8 @@ cemac_gctx(struct cemac_softc *sc) } // mark we're free - if (ifp->if_flags & IFF_OACTIVE) { - ifp->if_flags &= ~IFF_OACTIVE; + if (sc->tx_busy) { + sc->tx_busy = false; /* Disable transmit-buffer-free interrupt */ /*CEMAC_WRITE(ETH_IDR, ETH_ISR_TBRE);*/ } @@ -783,7 +783,7 @@ start: if (cemac_gctx(sc) == 0) { /* Enable transmit-buffer-free interrupt */ CEMAC_WRITE(ETH_IER, ETH_ISR_TBRE); - ifp->if_flags |= IFF_OACTIVE; + sc->tx_busy = true; ifp->if_timer = 10; splx(s); return; @@ -961,8 +961,9 @@ cemac_ifstop(struct ifnet *ifp, int disable) /* Down the MII. */ mii_down(&sc->sc_mii); - ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); + ifp->if_flags &= ~IFF_RUNNING; ifp->if_timer = 0; + sc->tx_busy = false; sc->sc_mii.mii_media_status &= ~IFM_ACTIVE; } |
