Module Name:    src
Committed By:   thorpej
Date:           Thu Mar 19 02:31:28 UTC 2020

Modified Files:
        src/sys/dev/ic: am7990.c am79900.c

Log Message:
Don't bother with IFF_OACTIVE.  Just keep processing so long as
sc->sc_no_td is less than sc->sc_ntbuf.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/ic/am7990.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/ic/am79900.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/dev/ic/am7990.c
diff -u src/sys/dev/ic/am7990.c:1.81 src/sys/dev/ic/am7990.c:1.82
--- src/sys/dev/ic/am7990.c:1.81	Wed Jan 29 06:17:07 2020
+++ src/sys/dev/ic/am7990.c	Thu Mar 19 02:31:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: am7990.c,v 1.81 2020/01/29 06:17:07 thorpej Exp $	*/
+/*	$NetBSD: am7990.c,v 1.82 2020/03/19 02:31:28 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: am7990.c,v 1.81 2020/01/29 06:17:07 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: am7990.c,v 1.82 2020/03/19 02:31:28 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -306,8 +306,6 @@ am7990_tint(struct lance_softc *sc)
 		if (tmd.tmd1_bits & LE_T1_OWN)
 			break;
 
-		ifp->if_flags &= ~IFF_OACTIVE;
-
 		if (tmd.tmd1_bits & LE_T1_ERR) {
 			if (tmd.tmd3 & LE_T3_BUFF)
 				printf("%s: transmit buffer error\n",
@@ -467,19 +465,20 @@ am7990_start(struct ifnet *ifp)
 	int rp;
 	int len;
 
-	if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+	if ((ifp->if_flags & IFF_RUNNING) != IFF_RUNNING)
 		return;
 
 	bix = sc->sc_last_td;
 
-	for (;;) {
+	while (sc->sc_no_td < sc->sc_ntbuf) {
 		rp = LE_TMDADDR(sc, bix);
 		(*sc->sc_copyfromdesc)(sc, &tmd, rp, sizeof(tmd));
 
 		if (tmd.tmd1_bits & LE_T1_OWN) {
-			ifp->if_flags |= IFF_OACTIVE;
-			printf("missing buffer, no_td = %d, last_td = %d\n",
-			    sc->sc_no_td, sc->sc_last_td);
+			printf("%s: missing buffer, no_td = %d, last_td = %d\n",
+			    device_xname(sc->sc_dev), sc->sc_no_td,
+			    sc->sc_last_td);
+			break;
 		}
 
 		IFQ_DEQUEUE(&ifp->if_snd, m);
@@ -523,11 +522,7 @@ am7990_start(struct ifnet *ifp)
 		if (++bix == sc->sc_ntbuf)
 			bix = 0;
 
-		if (++sc->sc_no_td == sc->sc_ntbuf) {
-			ifp->if_flags |= IFF_OACTIVE;
-			break;
-		}
-
+		sc->sc_no_td++;
 	}
 
 	sc->sc_last_td = bix;

Index: src/sys/dev/ic/am79900.c
diff -u src/sys/dev/ic/am79900.c:1.29 src/sys/dev/ic/am79900.c:1.30
--- src/sys/dev/ic/am79900.c:1.29	Tue Feb  4 07:36:50 2020
+++ src/sys/dev/ic/am79900.c	Thu Mar 19 02:31:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: am79900.c,v 1.29 2020/02/04 07:36:50 skrll Exp $	*/
+/*	$NetBSD: am79900.c,v 1.30 2020/03/19 02:31:28 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -103,7 +103,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: am79900.c,v 1.29 2020/02/04 07:36:50 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: am79900.c,v 1.30 2020/03/19 02:31:28 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -338,8 +338,6 @@ am79900_tint(struct lance_softc *sc)
 		if (tmd.tmd1 & LE_T1_OWN)
 			break;
 
-		ifp->if_flags &= ~IFF_OACTIVE;
-
 		if (tmd.tmd1 & LE_T1_ERR) {
 			if (tmd.tmd2 & LE_T2_BUFF)
 				printf("%s: transmit buffer error\n",
@@ -488,19 +486,20 @@ am79900_start(struct ifnet *ifp)
 	int rp;
 	int len;
 
-	if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+	if ((ifp->if_flags & IFF_RUNNING) != IFF_RUNNING)
 		return;
 
 	bix = sc->sc_last_td;
 
-	for (;;) {
+	while (sc->sc_no_td < sc->sc_ntbuf) {
 		rp = LE_TMDADDR(sc, bix);
 		(*sc->sc_copyfromdesc)(sc, &tmd, rp, sizeof(tmd));
 
 		if (tmd.tmd1 & LE_T1_OWN) {
-			ifp->if_flags |= IFF_OACTIVE;
-			printf("missing buffer, no_td = %d, last_td = %d\n",
-			    sc->sc_no_td, sc->sc_last_td);
+			printf("%s: missing buffer, no_td = %d, last_td = %d\n",
+			    device_xname(sc->sc_dev), sc->sc_no_td,
+			    sc->sc_last_td);
+			break;
 		}
 
 		IFQ_DEQUEUE(&ifp->if_snd, m);
@@ -544,11 +543,7 @@ am79900_start(struct ifnet *ifp)
 		if (++bix == sc->sc_ntbuf)
 			bix = 0;
 
-		if (++sc->sc_no_td == sc->sc_ntbuf) {
-			ifp->if_flags |= IFF_OACTIVE;
-			break;
-		}
-
+		sc->sc_no_td++;
 	}
 
 	sc->sc_last_td = bix;

Reply via email to