Module Name:    src
Committed By:   thorpej
Date:           Sun Sep 18 13:23:53 UTC 2022

Modified Files:
        src/sys/arch/sgimips/hpc: if_sq.c

Log Message:
Eliminate use of IFF_OACTIVE.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/sgimips/hpc/if_sq.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/sgimips/hpc/if_sq.c
diff -u src/sys/arch/sgimips/hpc/if_sq.c:1.54 src/sys/arch/sgimips/hpc/if_sq.c:1.55
--- src/sys/arch/sgimips/hpc/if_sq.c:1.54	Thu Jan 30 06:25:46 2020
+++ src/sys/arch/sgimips/hpc/if_sq.c	Sun Sep 18 13:23:53 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sq.c,v 1.54 2020/01/30 06:25:46 martin Exp $	*/
+/*	$NetBSD: if_sq.c,v 1.55 2022/09/18 13:23:53 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2001 Rafal K. Boni
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_sq.c,v 1.54 2020/01/30 06:25:46 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sq.c,v 1.55 2022/09/18 13:23:53 thorpej Exp $");
 
 
 #include <sys/param.h>
@@ -456,7 +456,6 @@ sq_init(struct ifnet *ifp)
 		sq_hpc_write(sc, HPC1_ENET_INTDELAY, HPC1_ENET_INTDELAY_OFF);
 
 	ifp->if_flags |= IFF_RUNNING;
-	ifp->if_flags &= ~IFF_OACTIVE;
 
 	return 0;
 }
@@ -535,7 +534,7 @@ sq_start(struct ifnet *ifp)
 	bus_dmamap_t dmamap;
 	int err, totlen, nexttx, firsttx, lasttx = -1, ofree, seg;
 
-	if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+	if ((ifp->if_flags & IFF_RUNNING) == 0)
 		return;
 
 	/*
@@ -619,13 +618,11 @@ sq_start(struct ifnet *ifp)
 			 * Not enough free descriptors to transmit this
 			 * packet.  We haven't committed to anything yet,
 			 * so just unload the DMA map, put the packet
-			 * back on the queue, and punt.  Notify the upper
-			 * layer that there are no more slots left.
+			 * back on the queue, and punt.
 			 *
 			 * XXX We could allocate an mbuf and copy, but
 			 * XXX it is worth it?
 			 */
-			ifp->if_flags |= IFF_OACTIVE;
 			bus_dmamap_unload(sc->sc_dmat, dmamap);
 			if (m != NULL)
 				m_freem(m);
@@ -719,10 +716,6 @@ sq_start(struct ifnet *ifp)
 		sc->sc_nexttx = nexttx;
 	}
 
-	/* All transmit descriptors used up, let upper layers know */
-	if (sc->sc_nfreetx == 0)
-		ifp->if_flags |= IFF_OACTIVE;
-
 	if (sc->sc_nfreetx != ofree) {
 		SQ_DPRINTF(("%s: %d packets enqueued, first %d, INTR on %d\n",
 		    device_xname(sc->sc_dev), lasttx - firsttx + 1,
@@ -839,7 +832,7 @@ sq_stop(struct ifnet *ifp, int disable)
 
 	sq_reset(sc);
 
-	ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+	ifp->if_flags &= ~IFF_RUNNING;
 	ifp->if_timer = 0;
 }
 
@@ -1101,10 +1094,6 @@ sq_txintr(struct sq_softc *sc)
 	else
 		sq_txring_hpc1(sc);
 
-	/* If we have buffers free, let upper layers know */
-	if (sc->sc_nfreetx > 0)
-		ifp->if_flags &= ~IFF_OACTIVE;
-
 	/* If all packets have left the coop, cancel watchdog */
 	if (sc->sc_nfreetx == SQ_NTXDESC)
 		ifp->if_timer = 0;

Reply via email to