CVS commit: src/sys/arch/mips/sibyte/dev

2022-09-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Sep 18 12:43:41 UTC 2022

Modified Files:
src/sys/arch/mips/sibyte/dev: sbmac.c

Log Message:
Eliminate use of IFF_OACTIVE.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/mips/sibyte/dev/sbmac.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/mips/sibyte/dev/sbmac.c
diff -u src/sys/arch/mips/sibyte/dev/sbmac.c:1.64 src/sys/arch/mips/sibyte/dev/sbmac.c:1.65
--- src/sys/arch/mips/sibyte/dev/sbmac.c:1.64	Sat Aug 20 18:40:35 2022
+++ src/sys/arch/mips/sibyte/dev/sbmac.c	Sun Sep 18 12:43:41 2022
@@ -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 
-__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 @@ sbdma_tx_process(struct sbmac_softc *sc,
 
 		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 @@ sbmac_start(struct ifnet *ifp)
 	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 @@ sbmac_start(struct ifnet *ifp)
 
 		/*
 		 * 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 @@ sbmac_start(struct ifnet *ifp)
  */
 m_freem(m_head);
 			}
-		} else {
-		ifp->if_flags |= IFF_OACTIVE;
-		break;
 		}
 	}
 }



CVS commit: src/sys/arch/mips/sibyte/dev

2022-09-18 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sun Sep 18 12:43:41 UTC 2022

Modified Files:
src/sys/arch/mips/sibyte/dev: sbmac.c

Log Message:
Eliminate use of IFF_OACTIVE.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/mips/sibyte/dev/sbmac.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/arch/mips/sibyte/dev

2022-08-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Aug 20 18:40:35 UTC 2022

Modified Files:
src/sys/arch/mips/sibyte/dev: sbmac.c

Log Message:
sbmac_start(): Replace "IF_DEQUEUE() -> IF_PREPEND() on failure" with
"IF_POLL() -> IF_DEQUEUE() on success".


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/mips/sibyte/dev/sbmac.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/mips/sibyte/dev/sbmac.c
diff -u src/sys/arch/mips/sibyte/dev/sbmac.c:1.63 src/sys/arch/mips/sibyte/dev/sbmac.c:1.64
--- src/sys/arch/mips/sibyte/dev/sbmac.c:1.63	Sun Dec  5 07:21:59 2021
+++ src/sys/arch/mips/sibyte/dev/sbmac.c	Sat Aug 20 18:40:35 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: sbmac.c,v 1.63 2021/12/05 07:21:59 msaitoh Exp $ */
+/* $NetBSD: sbmac.c,v 1.64 2022/08/20 18:40:35 thorpej Exp $ */
 
 /*
  * Copyright 2000, 2001, 2004
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sbmac.c,v 1.63 2021/12/05 07:21:59 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbmac.c,v 1.64 2022/08/20 18:40:35 thorpej Exp $");
 
 #include "opt_inet.h"
 #include "opt_ns.h"
@@ -1786,7 +1786,7 @@ sbmac_start(struct ifnet *ifp)
 
 	for (;;) {
 
-		IF_DEQUEUE(>if_snd, m_head);
+		IF_POLL(>if_snd, m_head);
 		if (m_head == NULL)
 		break;
 
@@ -1803,6 +1803,7 @@ sbmac_start(struct ifnet *ifp)
 			 * If there's a BPF listener, bounce a copy of this
 			 * frame to it.
 			 */
+			IF_DEQUEUE(>if_snd, m_head);
 			bpf_mtap(ifp, m_head, BPF_D_OUT);
 			if (!sc->sbm_pass3_dma) {
 /*
@@ -1813,7 +1814,6 @@ sbmac_start(struct ifnet *ifp)
 m_freem(m_head);
 			}
 		} else {
-		IF_PREPEND(>if_snd, m_head);
 		ifp->if_flags |= IFF_OACTIVE;
 		break;
 		}



CVS commit: src/sys/arch/mips/sibyte/dev

2022-08-20 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Aug 20 18:40:35 UTC 2022

Modified Files:
src/sys/arch/mips/sibyte/dev: sbmac.c

Log Message:
sbmac_start(): Replace "IF_DEQUEUE() -> IF_PREPEND() on failure" with
"IF_POLL() -> IF_DEQUEUE() on success".


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/mips/sibyte/dev/sbmac.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.