Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sun2/dev Replace manipulating IFF_OACTIVE with an i...



details:   https://anonhg.NetBSD.org/src/rev/f78c5ad1b9d3
branches:  trunk
changeset: 745998:f78c5ad1b9d3
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Mar 19 14:01:48 2020 +0000

description:
Replace manipulating IFF_OACTIVE with an internal "txbusy" field.

diffstat:

 sys/arch/sun2/dev/if_ec.c |  17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diffs (80 lines):

diff -r 6472e5a275f2 -r f78c5ad1b9d3 sys/arch/sun2/dev/if_ec.c
--- a/sys/arch/sun2/dev/if_ec.c Thu Mar 19 11:19:25 2020 +0000
+++ b/sys/arch/sun2/dev/if_ec.c Thu Mar 19 14:01:48 2020 +0000
@@ -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 @@
        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 @@
 
        /* 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 @@
        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 @@
        /* 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 @@
                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 @@
                        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 @@
                            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);



Home | Main Index | Thread Index | Old Index