Module Name: src Committed By: thorpej Date: Thu Mar 19 14:01:48 UTC 2020
Modified Files: src/sys/arch/sun2/dev: if_ec.c Log Message: Replace manipulating IFF_OACTIVE with an internal "txbusy" field. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/arch/sun2/dev/if_ec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/sun2/dev/if_ec.c diff -u src/sys/arch/sun2/dev/if_ec.c:1.35 src/sys/arch/sun2/dev/if_ec.c:1.36 --- src/sys/arch/sun2/dev/if_ec.c:1.35 Wed Jan 29 05:39:48 2020 +++ src/sys/arch/sun2/dev/if_ec.c Thu Mar 19 14:01:48 2020 @@ -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);