diff options
| author | thorpej <thorpej@NetBSD.org> | 2020-03-19 14:01:48 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2020-03-19 14:01:48 +0000 |
| commit | 0f4ecd8e98f4e2e36afd2a867d141ff668fe4761 (patch) | |
| tree | b1a2aabf33b50dca9b523340318fa2e3cc9928d6 /sys/arch/sun2/dev | |
| parent | 1a1f815ec45a80eeedc0ec4a171ece4699b8a17c (diff) | |
Replace manipulating IFF_OACTIVE with an internal "txbusy" field.
Diffstat (limited to 'sys/arch/sun2/dev')
| -rw-r--r-- | sys/arch/sun2/dev/if_ec.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/arch/sun2/dev/if_ec.c b/sys/arch/sun2/dev/if_ec.c index 8708d711815..6fa948b62a8 100644 --- a/sys/arch/sun2/dev/if_ec.c +++ b/sys/arch/sun2/dev/if_ec.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ec.c,v 1.35 2020/01/29 05:39:48 thorpej Exp $ */ +/* $NetBSD: if_ec.c,v 1.36 2020/03/19 14:01:48 thorpej Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_ec.c,v 1.35 2020/01/29 05:39:48 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ec.c,v 1.36 2020/03/19 14:01:48 thorpej Exp $"); #include "opt_inet.h" #include "opt_ns.h" @@ -86,6 +86,7 @@ struct ec_softc { bus_space_tag_t sc_iot; /* bus space tag */ bus_space_handle_t sc_ioh; /* bus space handle */ + bool sc_txbusy; u_char sc_jammed; /* nonzero if the net is jammed */ u_char sc_colliding; /* nonzero if the net is colliding */ uint32_t sc_backoff_seed; /* seed for the backoff PRNG */ @@ -281,7 +282,7 @@ ec_init(struct ifnet *ifp) /* Set flags appropriately. */ ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; + sc->sc_txbusy = false; /* Start output. */ ec_start(ifp); @@ -305,7 +306,7 @@ ec_start(struct ifnet *ifp) s = splnet(); /* Don't do anything if output is active. */ - if ((ifp->if_flags & IFF_OACTIVE) != 0) { + if (sc->sc_txbusy) { splx(s); return; } @@ -334,7 +335,7 @@ ec_start(struct ifnet *ifp) /* Enable the transmitter. */ ECREG_CSR_WR((ECREG_CSR_RD & EC_CSR_PA) | EC_CSR_TBSW | EC_CSR_TINT | EC_CSR_JINT); - ifp->if_flags |= IFF_OACTIVE; + sc->sc_txbusy = true; /* Done. */ splx(s); @@ -413,7 +414,7 @@ ec_intr(void *arg) retval++; } /* Check for a transmitted packet. */ - if (ifp->if_flags & IFF_OACTIVE) { + if (sc->sc_txbusy) { /* If we got a collision. */ if (ECREG_CSR_RD & EC_CSR_JAM) { @@ -431,7 +432,7 @@ ec_intr(void *arg) retval++; if_statinc(ifp, if_opackets); sc->sc_jammed = 0; - ifp->if_flags &= ~IFF_OACTIVE; + sc->sc_txbusy = false; if_schedule_deferred_start(ifp); } } else { @@ -635,7 +636,7 @@ ec_coll(struct ec_softc *sc) device_xname(sc->sc_dev)); sc->sc_jammed = 1; sc->sc_colliding = 0; - ifp->if_flags &= ~IFF_OACTIVE; + sc->sc_txbusy = false; if_schedule_deferred_start(ifp); } else { jams = MAX(sc->sc_colliding, EC_BACKOFF_PRNG_COLL_MAX); |
