Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Don't bother with IFF_OACTIVE. Just keep process...



details:   https://anonhg.NetBSD.org/src/rev/0c14437a49db
branches:  trunk
changeset: 745988:0c14437a49db
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Mar 19 02:31:28 2020 +0000

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

diffstat:

 sys/dev/ic/am7990.c  |  23 +++++++++--------------
 sys/dev/ic/am79900.c |  23 +++++++++--------------
 2 files changed, 18 insertions(+), 28 deletions(-)

diffs (132 lines):

diff -r be4b05a01ac7 -r 0c14437a49db sys/dev/ic/am7990.c
--- a/sys/dev/ic/am7990.c       Wed Mar 18 23:53:02 2020 +0000
+++ b/sys/dev/ic/am7990.c       Thu Mar 19 02:31:28 2020 +0000
@@ -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 @@
                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 @@
        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 @@
                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;
diff -r be4b05a01ac7 -r 0c14437a49db sys/dev/ic/am79900.c
--- a/sys/dev/ic/am79900.c      Wed Mar 18 23:53:02 2020 +0000
+++ b/sys/dev/ic/am79900.c      Thu Mar 19 02:31:28 2020 +0000
@@ -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 @@
                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 @@
        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 @@
                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;



Home | Main Index | Thread Index | Old Index