Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Eliminate use of IFF_OACTIVE.



details:   https://anonhg.NetBSD.org/src/rev/59027ab468f7
branches:  trunk
changeset: 370115:59027ab468f7
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Sep 17 18:58:49 2022 +0000

description:
Eliminate use of IFF_OACTIVE.

diffstat:

 sys/arch/acorn32/podulebus/if_ie.c |  15 +++------------
 sys/arch/amiga/dev/if_es.c         |  16 ++++++++--------
 2 files changed, 11 insertions(+), 20 deletions(-)

diffs (128 lines):

diff -r f3432a4834ec -r 59027ab468f7 sys/arch/acorn32/podulebus/if_ie.c
--- a/sys/arch/acorn32/podulebus/if_ie.c        Sat Sep 17 18:41:26 2022 +0000
+++ b/sys/arch/acorn32/podulebus/if_ie.c        Sat Sep 17 18:58:49 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ie.c,v 1.52 2022/04/08 10:17:53 andvar Exp $ */
+/* $NetBSD: if_ie.c,v 1.53 2022/09/17 18:58:49 thorpej Exp $ */
 
 /*
  * Copyright (c) 1995 Melvin Tang-Richardson.
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.52 2022/04/08 10:17:53 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.53 2022/09/17 18:58:49 thorpej Exp $");
 
 #define IGNORE_ETHER1_IDROM_CHECKSUM
 
@@ -909,7 +909,6 @@
     ptr = setup_rfa(sc, ptr);
 
     ifp->if_flags |= IFF_RUNNING;
-    ifp->if_flags &= ~IFF_OACTIVE;
 
     /* Setup transmit buffers */
 
@@ -1452,20 +1451,13 @@
        char txbuf[IE_TXBUF_SIZE];
        int safety_catch = 0;
 
-       if ((ifp->if_flags & IFF_OACTIVE) != 0)
-               return;
-
-       for (;;) {
+       while (sc->xmit_free != 0) {
                if ( (safety_catch++)>100 )
                {
                    printf ( "ie: iestart safety catch tripped\n" );
                    iereset(sc);
                    return;
                }
-               if (sc->xmit_free == 0) {
-                       ifp->if_flags |= IFF_OACTIVE;
-                       break;
-               }
 
                IF_DEQUEUE(&ifp->if_snd, m);
                if (!m)
@@ -1520,7 +1512,6 @@
     int status;
 
     ifp->if_timer=0;
-    ifp->if_flags &= ~IFF_OACTIVE;
 
     READ_MEMBER(sc,struct ie_xmit_cmd, ie_xmit_status,
        sc->xmit_cmds[sc->xctail], status );
diff -r f3432a4834ec -r 59027ab468f7 sys/arch/amiga/dev/if_es.c
--- a/sys/arch/amiga/dev/if_es.c        Sat Sep 17 18:41:26 2022 +0000
+++ b/sys/arch/amiga/dev/if_es.c        Sat Sep 17 18:58:49 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_es.c,v 1.67 2022/08/20 16:47:01 thorpej Exp $ */
+/*     $NetBSD: if_es.c,v 1.68 2022/09/17 19:03:31 thorpej Exp $ */
 
 /*
  * Copyright (c) 1995 Michael L. Hitch
@@ -33,7 +33,7 @@
 #include "opt_ns.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_es.c,v 1.67 2022/08/20 16:47:01 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_es.c,v 1.68 2022/09/17 19:03:31 thorpej Exp $");
 
 
 #include <sys/param.h>
@@ -86,6 +86,7 @@
        void    *sc_base;               /* base address of board */
        short   sc_iflags;
        unsigned short sc_intctl;
+       bool    sc_txbusy;
 #ifdef ESDEBUG
        int     sc_debug;
        short   sc_intbusy;             /* counter for interrupt rentered */
@@ -289,7 +290,7 @@
 
        /* Interface is now 'running', with no output active. */
        ifp->if_flags |= IFF_RUNNING;
-       ifp->if_flags &= ~IFF_OACTIVE;
+       sc->sc_txbusy = false;
 
        /* Attempt to start output, if any. */
        if_schedule_deferred_start(ifp);
@@ -359,7 +360,7 @@
                        while (smc->b2.mmucr & MMUCR_BUSY)
                                ;
                        smc->b2.pnr = save_pnr;
-                       ifp->if_flags &= ~IFF_OACTIVE;
+                       sc->sc_txbusy = false;
                        ifp->if_timer = 0;
                }
 #ifdef ESDEBUG
@@ -757,8 +758,7 @@
        int i;
        u_char active_pnr;
 
-       if ((sc->sc_ethercom.ec_if.if_flags & (IFF_RUNNING | IFF_OACTIVE)) !=
-           IFF_RUNNING)
+       if ((sc->sc_ethercom.ec_if.if_flags & IFF_RUNNING) == 0)
                return;
 
 #ifdef ESDEBUG
@@ -772,7 +772,7 @@
                smc->b2.bsr = BSR_BANK2;
        }
 #endif
-       for (;;) {
+       while (!sc->sc_txbusy) {
 #ifdef ESDEBUG
                u_short start_ptr, end_ptr;
 #endif
@@ -801,7 +801,7 @@
                        if ((smc->b2.arr & ARR_FAILED) == 0)
                                break;
                if (smc->b2.arr & ARR_FAILED) {
-                       sc->sc_ethercom.ec_if.if_flags |= IFF_OACTIVE;
+                       sc->sc_txbusy = true;
                        sc->sc_intctl |= MSK_ALLOC;
                        sc->sc_ethercom.ec_if.if_timer = 5;
                        break;



Home | Main Index | Thread Index | Old Index