Module Name:    src
Committed By:   thorpej
Date:           Sun Sep 18 15:47:09 UTC 2022

Modified Files:
        src/sys/arch/arm/ti: if_cpsw.c

Log Message:
Eliminate use of IFF_OACTIVE.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/ti/if_cpsw.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/arm/ti/if_cpsw.c
diff -u src/sys/arch/arm/ti/if_cpsw.c:1.15 src/sys/arch/arm/ti/if_cpsw.c:1.16
--- src/sys/arch/arm/ti/if_cpsw.c:1.15	Sun Nov  7 17:12:55 2021
+++ src/sys/arch/arm/ti/if_cpsw.c	Sun Sep 18 15:47:09 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cpsw.c,v 1.15 2021/11/07 17:12:55 jmcneill Exp $	*/
+/*	$NetBSD: if_cpsw.c,v 1.16 2022/09/18 15:47:09 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.15 2021/11/07 17:12:55 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.16 2022/09/18 15:47:09 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -130,6 +130,7 @@ struct cpsw_softc {
 	volatile u_int sc_txnext;
 	volatile u_int sc_txhead;
 	volatile u_int sc_rxhead;
+	bool sc_txbusy;
 	void *sc_rxthih;
 	void *sc_rxih;
 	void *sc_txih;
@@ -622,8 +623,10 @@ cpsw_start(struct ifnet *ifp)
 	KERNHIST_FUNC(__func__);
 	CPSWHIST_CALLARGS(sc, 0, 0, 0);
 
-	if (__predict_false((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) !=
-	    IFF_RUNNING)) {
+	if (__predict_false((ifp->if_flags & IFF_RUNNING) == 0)) {
+		return;
+	}
+	if (__predict_false(sc->sc_txbusy)) {
 		return;
 	}
 
@@ -655,7 +658,7 @@ cpsw_start(struct ifnet *ifp)
 		}
 
 		if (dm->dm_nsegs + 1 >= txfree) {
-			ifp->if_flags |= IFF_OACTIVE;
+			sc->sc_txbusy = true;
 			bus_dmamap_unload(sc->sc_bdt, dm);
 			break;
 		}
@@ -1033,7 +1036,7 @@ cpsw_init(struct ifnet *ifp)
 	sc->sc_txeoq = true;
 	callout_schedule(&sc->sc_tick_ch, hz);
 	ifp->if_flags |= IFF_RUNNING;
-	ifp->if_flags &= ~IFF_OACTIVE;
+	sc->sc_txbusy = false;
 
 	return 0;
 }
@@ -1101,8 +1104,9 @@ cpsw_stop(struct ifnet *ifp, int disable
 		rdp->tx_mb[i] = NULL;
 	}
 
-	ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
+	ifp->if_flags &= ~IFF_RUNNING;
 	ifp->if_timer = 0;
+	sc->sc_txbusy = false;
 
 	if (!disable)
 		return;
@@ -1295,7 +1299,7 @@ cpsw_txintr(void *arg)
 
 		handled = true;
 
-		ifp->if_flags &= ~IFF_OACTIVE;
+		sc->sc_txbusy = false;
 
 next:
 		if (ISSET(dw[3], CPDMA_BD_EOP) && ISSET(dw[3], CPDMA_BD_EOQ)) {

Reply via email to