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/59d5f9defae4
branches:  trunk
changeset: 370128:59d5f9defae4
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Sep 18 12:39:26 2022 +0000

description:
Eliminate use of IFF_OACTIVE.

diffstat:

 sys/arch/mips/ralink/ralink_eth.c |  15 ++++-----------
 sys/arch/mips/sibyte/dev/sbmac.c  |  21 +++++----------------
 sys/arch/newsmips/apbus/if_sn.c   |  10 ++++------
 3 files changed, 13 insertions(+), 33 deletions(-)

diffs (172 lines):

diff -r 4a1bfab11eed -r 59d5f9defae4 sys/arch/mips/ralink/ralink_eth.c
--- a/sys/arch/mips/ralink/ralink_eth.c Sun Sep 18 10:54:52 2022 +0000
+++ b/sys/arch/mips/ralink/ralink_eth.c Sun Sep 18 12:39:26 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ralink_eth.c,v 1.24 2022/05/24 20:50:18 andvar Exp $   */
+/*     $NetBSD: ralink_eth.c,v 1.25 2022/09/18 12:39:26 thorpej Exp $  */
 /*-
  * Copyright (c) 2011 CradlePoint Technology, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
 /* ralink_eth.c -- Ralink Ethernet Driver */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ralink_eth.c,v 1.24 2022/05/24 20:50:18 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ralink_eth.c,v 1.25 2022/09/18 12:39:26 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -1057,7 +1057,6 @@
        if (!error) {
                /* Note that the interface is now running. */
                ifp->if_flags |= IFF_RUNNING;
-               ifp->if_flags &= ~IFF_OACTIVE;
        }
 
        return error;
@@ -1095,7 +1094,7 @@
        ralink_eth_disable(sc);
 
        /* Mark the interface down and cancel the watchdog timer.  */
-       ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+       ifp->if_flags &= ~IFF_RUNNING;
        ifp->if_timer = 0;
 }
 
@@ -1162,7 +1161,7 @@
        int error;
        int s;
 
-       if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+       if ((ifp->if_flags & IFF_RUNNING) == 0)
                return;
 
        s = splnet();
@@ -1295,11 +1294,6 @@
                fe_write(sc, RA_FE_PDMA_TX0_CPU_IDX, tx_cpu_idx);
        }
 
-       if (txs == NULL) {
-               /* No more slots left; notify upper layer. */
-               ifp->if_flags |= IFF_OACTIVE;
-       }
-
        splx(s);
 }
 
@@ -1625,7 +1619,6 @@
                SIMPLEQ_INSERT_TAIL(&sc->sc_txfreeq, txs, txs_q);
 
                struct ifnet *ifp = &sc->sc_ethercom.ec_if;
-               ifp->if_flags &= ~IFF_OACTIVE;
                if_statinc(ifp, if_opackets);
                sc->sc_evcnt_output.ev_count++;
 
diff -r 4a1bfab11eed -r 59d5f9defae4 sys/arch/mips/sibyte/dev/sbmac.c
--- a/sys/arch/mips/sibyte/dev/sbmac.c  Sun Sep 18 10:54:52 2022 +0000
+++ b/sys/arch/mips/sibyte/dev/sbmac.c  Sun Sep 18 12:39:26 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sbmac.c,v 1.64 2022/08/20 18:40:35 thorpej Exp $ */
+/* $NetBSD: sbmac.c,v 1.65 2022/09/18 12:43:41 thorpej Exp $ */
 
 /*
  * Copyright 2000, 2001, 2004
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbmac.c,v 1.64 2022/08/20 18:40:35 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbmac.c,v 1.65 2022/09/18 12:43:41 thorpej Exp $");
 
 #include "opt_inet.h"
 #include "opt_ns.h"
@@ -1025,14 +1025,6 @@
 
                d->sbdma_rem_index = SBDMA_NEXTBUF(d, d->sbdma_rem_index);
        }
-
-       /*
-        * Decide what to set the IFF_OACTIVE bit in the interface to.
-        * It's supposed to reflect if the interface is actively
-        * transmitting, but that's really hard to do quickly.
-        */
-
-       ifp->if_flags &= ~IFF_OACTIVE;
 }
 
 /*
@@ -1779,7 +1771,7 @@
        struct mbuf             *m_head = NULL;
        int                     rv;
 
-       if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+       if ((ifp->if_flags & IFF_RUNNING) == 0)
                return;
 
        sc = ifp->if_softc;
@@ -1792,8 +1784,8 @@
 
                /*
                 * Put the buffer on the transmit ring.  If we
-                * don't have room, set the OACTIVE flag and wait
-                * for the NIC to drain the ring.
+                * don't have room, we'll try to get things going
+                * again after a transmit interrupt.
                 */
 
                rv = sbdma_add_txbuffer(&(sc->sbm_txdma), m_head);
@@ -1813,9 +1805,6 @@
                                 */
                                m_freem(m_head);
                        }
-               } else {
-                   ifp->if_flags |= IFF_OACTIVE;
-                   break;
                }
        }
 }
diff -r 4a1bfab11eed -r 59d5f9defae4 sys/arch/newsmips/apbus/if_sn.c
--- a/sys/arch/newsmips/apbus/if_sn.c   Sun Sep 18 10:54:52 2022 +0000
+++ b/sys/arch/newsmips/apbus/if_sn.c   Sun Sep 18 12:39:26 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_sn.c,v 1.50 2022/08/20 18:42:03 thorpej Exp $       */
+/*     $NetBSD: if_sn.c,v 1.51 2022/09/18 12:48:03 thorpej Exp $       */
 
 /*
  * National Semiconductor  DP8393X SONIC Driver
@@ -16,7 +16,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.50 2022/08/20 18:42:03 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.51 2022/09/18 12:48:03 thorpej Exp $");
 
 #include "opt_inet.h"
 
@@ -307,7 +307,7 @@
        struct mbuf     *m;
        int             mtd_next;
 
-       if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+       if ((ifp->if_flags & IFF_RUNNING) == 0)
                return;
 
 outloop:
@@ -316,7 +316,6 @@
                mtd_next = 0;
 
        if (mtd_next == sc->mtd_hw) {
-               ifp->if_flags |= IFF_OACTIVE;
                return;
        }
 
@@ -325,8 +324,7 @@
                return;
 
        /* We need the header for m_pkthdr.len. */
-       if ((m->m_flags & M_PKTHDR) == 0)
-               panic("%s: snstart: no header mbuf", device_xname(sc->sc_dev));
+       KASSERT(m->m_flags & M_PKTHDR);
 
        /*
         * If bpf is listening on this interface, let it



Home | Main Index | Thread Index | Old Index