Source-Changes-HG archive

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

[src/trunk]: src/sys/dev ALTQ'ify.



details:   https://anonhg.NetBSD.org/src/rev/a9abf9c642af
branches:  trunk
changeset: 500589:a9abf9c642af
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Dec 14 06:59:01 2000 +0000

description:
ALTQ'ify.

diffstat:

 sys/dev/bi/if_ni.c   |   8 +++++---
 sys/dev/isa/cs89x0.c |  14 +++++++-------
 sys/dev/isa/if_eg.c  |   7 ++++---
 sys/dev/isa/if_el.c  |   5 +++--
 sys/dev/isa/if_iy.c  |  11 ++++++++---
 5 files changed, 27 insertions(+), 18 deletions(-)

diffs (186 lines):

diff -r 051bb8b963a1 -r a9abf9c642af sys/dev/bi/if_ni.c
--- a/sys/dev/bi/if_ni.c        Thu Dec 14 06:42:57 2000 +0000
+++ b/sys/dev/bi/if_ni.c        Thu Dec 14 06:59:01 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ni.c,v 1.7 2000/11/15 01:02:14 thorpej Exp $ */
+/*     $NetBSD: if_ni.c,v 1.8 2000/12/14 07:02:53 thorpej Exp $ */
 /*
  * Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
  *
@@ -288,6 +288,7 @@
        ifp->if_start = nistart;
        ifp->if_ioctl = niioctl;
        ifp->if_watchdog = nitimeout;
+       IFQ_SET_READY(&ifp->if_snd);
 
        /*
         * Start init sequence.
@@ -520,17 +521,18 @@
 #endif
 
        while (fqb->nf_dforw) {
-               IF_DEQUEUE(&sc->sc_if.if_snd, m);
+               IFQ_POLL(&ifp->if_snd, m);
                if (m == 0)
                        break;
 
                data = REMQHI(&fqb->nf_dforw);
                if ((int)data == Q_EMPTY) {
-                       IF_PREPEND(&sc->sc_if.if_snd, m);
                        ifp->if_flags |= IFF_OACTIVE;
                        break;
                }
 
+               IFQ_DEQUEUE(&ifp->if_snd, m);
+
                /*
                 * Count number of mbufs in chain.
                 * Always do DMA directly from mbufs, therefore the transmit
diff -r 051bb8b963a1 -r a9abf9c642af sys/dev/isa/cs89x0.c
--- a/sys/dev/isa/cs89x0.c      Thu Dec 14 06:42:57 2000 +0000
+++ b/sys/dev/isa/cs89x0.c      Thu Dec 14 06:59:01 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cs89x0.c,v 1.16 2000/11/15 01:02:17 thorpej Exp $      */
+/*     $NetBSD: cs89x0.c,v 1.17 2000/12/14 06:59:01 thorpej Exp $      */
 
 /*
  * Copyright 1997
@@ -367,6 +367,7 @@
        ifp->if_watchdog = NULL;        /* no watchdog at this stage */
        ifp->if_flags = IFF_SIMPLEX | IFF_NOTRAILERS |
            IFF_BROADCAST | IFF_MULTICAST;
+       IFQ_SET_READY(&ifp->if_snd);
 
        /* Initialize ifmedia structures. */
        ifmedia_init(&sc->sc_media, 0, cs_mediachange, cs_mediastatus);
@@ -1481,7 +1482,7 @@
        sc->sc_txbusy = FALSE;
 
        /* If there is more to transmit */
-       if (ifp->if_snd.ifq_head != NULL) {
+       if (IFQ_IS_EMPTY(&ifp->if_snd) == 0) {
                /* Start the next transmission */
                cs_start_output(ifp);
        }
@@ -1992,14 +1993,12 @@
        struct cs_softc *sc;
        struct mbuf *pMbuf;
        struct mbuf *pMbufChain;
-       struct ifqueue *pTxQueue;
        u_int16_t BusStatus;
        u_int16_t Length;
        int txLoop = 0;
        int dropout = 0;
 
        sc = ifp->if_softc;
-       pTxQueue = &sc->sc_ethercom.ec_if.if_snd;
 
        /* check that the interface is up and running */
        if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING) {
@@ -2016,9 +2015,10 @@
         * While there are packets to transmit and a transmit is not in
         * progress
         */
-       while ((pTxQueue->ifq_head != NULL) && !(sc->sc_txbusy) &&
-           !(dropout)) {
-               IF_DEQUEUE(pTxQueue, pMbufChain);
+       while (sc->sc_txbusy == 0 && dropout == 0) {
+               IFQ_DEQUEUE(&ifp->if_snd, pMbufChain);
+               if (pMbufChain == NULL)
+                       break;
 
 #if NBPFILTER > 0
                /*
diff -r 051bb8b963a1 -r a9abf9c642af sys/dev/isa/if_eg.c
--- a/sys/dev/isa/if_eg.c       Thu Dec 14 06:42:57 2000 +0000
+++ b/sys/dev/isa/if_eg.c       Thu Dec 14 06:59:01 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_eg.c,v 1.51 2000/11/15 01:02:18 thorpej Exp $       */
+/*     $NetBSD: if_eg.c,v 1.52 2000/12/14 06:59:02 thorpej Exp $       */
 
 /*
  * Copyright (c) 1993 Dean Huxley <dean%fsa.ca@localhost>
@@ -480,7 +480,8 @@
        ifp->if_ioctl = egioctl;
        ifp->if_watchdog = egwatchdog;
        ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS;
-       
+       IFQ_SET_READY(&ifp->if_snd);
+
        /* Now we can attach the interface. */
        if_attach(ifp);
        ether_ifattach(ifp, myaddr);
@@ -598,7 +599,7 @@
 
 loop:
        /* Dequeue the next datagram. */
-       IF_DEQUEUE(&ifp->if_snd, m0);
+       IFQ_DEQUEUE(&ifp->if_snd, m0);
        if (m0 == 0)
                return;
        
diff -r 051bb8b963a1 -r a9abf9c642af sys/dev/isa/if_el.c
--- a/sys/dev/isa/if_el.c       Thu Dec 14 06:42:57 2000 +0000
+++ b/sys/dev/isa/if_el.c       Thu Dec 14 06:59:01 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_el.c,v 1.62 2000/11/15 01:02:18 thorpej Exp $       */
+/*     $NetBSD: if_el.c,v 1.63 2000/12/14 06:59:57 thorpej Exp $       */
 
 /*
  * Copyright (c) 1994, Matthew E. Kimmel.  Permission is hereby granted
@@ -233,6 +233,7 @@
        ifp->if_ioctl = elioctl;
        ifp->if_watchdog = elwatchdog;
        ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS;
+       IFQ_SET_READY(&ifp->if_snd);
 
        /* Now we can attach the interface. */
        DPRINTF(("Attaching interface...\n"));
@@ -376,7 +377,7 @@
         */
        for (;;) {
                /* Dequeue the next datagram. */
-               IF_DEQUEUE(&ifp->if_snd, m0);
+               IFQ_DEQUEUE(&ifp->if_snd, m0);
 
                /* If there's nothing to send, return. */
                if (m0 == 0)
diff -r 051bb8b963a1 -r a9abf9c642af sys/dev/isa/if_iy.c
--- a/sys/dev/isa/if_iy.c       Thu Dec 14 06:42:57 2000 +0000
+++ b/sys/dev/isa/if_iy.c       Thu Dec 14 06:59:01 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_iy.c,v 1.44 2000/11/15 01:02:18 thorpej Exp $       */
+/*     $NetBSD: if_iy.c,v 1.45 2000/12/14 06:59:02 thorpej Exp $       */
 /* #define IYDEBUG */
 /* #define IYMEMDEBUG */
 
@@ -326,6 +326,8 @@
        ifp->if_ioctl = iyioctl;
        ifp->if_watchdog = iywatchdog;
 
+       IFQ_SET_READY(&ifp->if_snd);
+
        (void)eepromreadall(iot, ioh, eaddr, 8);
        sc->hard_vers = eaddr[EEPW6] & EEPP_BoardRev;
 
@@ -650,7 +652,10 @@
        iot = sc->sc_iot;
        ioh = sc->sc_ioh;
 
-       while ((m0 = ifp->if_snd.ifq_head) != NULL) {
+       for (;;) {
+               IFQ_POLL(&ifp->if_snd, m0);
+               if (m0 == NULL)
+                       break;
 #ifdef IYDEBUG
                printf("%s: trying to write another packet to the hardware\n",
                    sc->sc_dev.dv_xname);
@@ -707,7 +712,7 @@
                }
        
                /* we know it fits in the hardware now, so dequeue it */
-               IF_DEQUEUE(&ifp->if_snd, m0);
+               IFQ_DEQUEUE(&ifp->if_snd, m0);
                
                last = sc->tx_end;
                end = last + pad + len + I595_XMT_HDRLEN; 



Home | Main Index | Thread Index | Old Index