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/c85ee33f7abe
branches:  trunk
changeset: 500586:c85ee33f7abe
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Dec 14 06:27:23 2000 +0000

description:
ALTQ'ify.

diffstat:

 sys/dev/ic/am7990.c     |   4 ++--
 sys/dev/ic/am79900.c    |   4 ++--
 sys/dev/ic/an.c         |   7 ++++---
 sys/dev/ic/awi.c        |  25 ++++++++-----------------
 sys/dev/ic/dp8390.c     |   5 +++--
 sys/dev/ic/elink3.c     |   9 +++++----
 sys/dev/ic/elinkxl.c    |  17 +++++++++--------
 sys/dev/ic/hme.c        |   5 +++--
 sys/dev/ic/i82557.c     |  10 +++++-----
 sys/dev/ic/i82586.c     |   7 ++++---
 sys/dev/ic/lance.c      |   3 ++-
 sys/dev/ic/lemac.c      |  13 +++++++++----
 sys/dev/ic/mb86960.c    |   5 +++--
 sys/dev/ic/pdq_ifsubr.c |  14 ++++++--------
 sys/dev/ic/rrunner.c    |   5 +++--
 sys/dev/ic/rtl81x9.c    |  12 +++++-------
 sys/dev/ic/seeq8005.c   |   7 ++++---
 sys/dev/ic/sgec.c       |   7 ++++---
 sys/dev/ic/smc83c170.c  |   9 ++++-----
 sys/dev/ic/smc90cx6.c   |   5 +++--
 sys/dev/ic/smc91cxx.c   |  10 ++++++----
 sys/dev/ic/tropic.c     |  11 +++++------
 sys/dev/ic/tulip.c      |  11 +++++------
 sys/dev/pcmcia/if_cnw.c |   5 +++--
 sys/dev/pcmcia/if_ray.c |  13 +++++++------
 sys/dev/pcmcia/if_wi.c  |   7 ++++---
 sys/dev/pcmcia/if_xi.c  |  10 +++++-----
 27 files changed, 123 insertions(+), 117 deletions(-)

diffs (truncated from 1103 to 300 lines):

diff -r b4d607e804ab -r c85ee33f7abe sys/dev/ic/am7990.c
--- a/sys/dev/ic/am7990.c       Thu Dec 14 05:59:39 2000 +0000
+++ b/sys/dev/ic/am7990.c       Thu Dec 14 06:27:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: am7990.c,v 1.60 2000/09/28 10:10:14 tsutsui Exp $      */
+/*     $NetBSD: am7990.c,v 1.61 2000/12/14 06:27:23 thorpej Exp $      */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -517,7 +517,7 @@
                            sc->sc_no_td, sc->sc_last_td);
                }
 
-               IF_DEQUEUE(&ifp->if_snd, m);
+               IFQ_DEQUEUE(&ifp->if_snd, m);
                if (m == 0)
                        break;
 
diff -r b4d607e804ab -r c85ee33f7abe sys/dev/ic/am79900.c
--- a/sys/dev/ic/am79900.c      Thu Dec 14 05:59:39 2000 +0000
+++ b/sys/dev/ic/am79900.c      Thu Dec 14 06:27:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: am79900.c,v 1.7 2000/09/28 10:10:14 tsutsui Exp $      */
+/*     $NetBSD: am79900.c,v 1.8 2000/12/14 06:27:24 thorpej Exp $      */
 
 /*-
  * Copyright (c) 1998
@@ -467,7 +467,7 @@
                            sc->sc_no_td, sc->sc_last_td);
                }
 
-               IF_DEQUEUE(&ifp->if_snd, m);
+               IFQ_DEQUEUE(&ifp->if_snd, m);
                if (m == 0)
                        break;
 
diff -r b4d607e804ab -r c85ee33f7abe sys/dev/ic/an.c
--- a/sys/dev/ic/an.c   Thu Dec 14 05:59:39 2000 +0000
+++ b/sys/dev/ic/an.c   Thu Dec 14 06:27:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: an.c,v 1.7 2000/12/14 04:11:26 onoe Exp $      */
+/*     $NetBSD: an.c,v 1.8 2000/12/14 06:27:24 thorpej Exp $   */
 /*
  * Copyright (c) 1997, 1998, 1999
  *     Bill Paul <wpaul%ctr.columbia.edu@localhost>.  All rights reserved.
@@ -270,6 +270,7 @@
        ifp->if_init = an_init;
        ifp->if_stop = an_stop;
        ifp->if_watchdog = an_watchdog;
+       IFQ_SET_READY(&ifp->if_snd);
 
        memcpy(ifp->if_xname, sc->an_dev.dv_xname, IFNAMSIZ);
 
@@ -591,7 +592,7 @@
        /* Re-enable interrupts. */
        CSR_WRITE_2(sc, AN_INT_EN, AN_INTRS);
 
-       if (ifp->if_snd.ifq_head != NULL)
+       if (IFQ_IS_EMPTY(&ifp->if_snd) == 0)
                an_start(ifp);
 
        return 1;
@@ -1365,7 +1366,7 @@
        bzero((char *)&tx_frame_802_3, sizeof(tx_frame_802_3));
 
        while(sc->an_rdata.an_tx_ring[idx] == 0) {
-               IF_DEQUEUE(&ifp->if_snd, m0);
+               IFQ_DEQUEUE(&ifp->if_snd, m0);
                if (m0 == NULL)
                        break;
 
diff -r b4d607e804ab -r c85ee33f7abe sys/dev/ic/awi.c
--- a/sys/dev/ic/awi.c  Thu Dec 14 05:59:39 2000 +0000
+++ b/sys/dev/ic/awi.c  Thu Dec 14 06:27:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: awi.c,v 1.28 2000/11/26 11:08:57 takemura Exp $        */
+/*     $NetBSD: awi.c,v 1.29 2000/12/14 06:27:24 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -310,6 +310,7 @@
        memcpy(sc->sc_ec.ac_enaddr, sc->sc_mib_addr.aMAC_Address,
            ETHER_ADDR_LEN);
 #endif
+       IFQ_SET_READY(&ifp->if_snd);
 
        printf("%s: IEEE802.11 %s %dMbps (firmware %s)\n",
            sc->sc_dev.dv_xname,
@@ -858,7 +859,6 @@
 {
        struct ifnet *ifp = sc->sc_ifp;
        struct awi_bss *bp;
-       struct mbuf *m;
 
        sc->sc_status = AWI_ST_INIT;
        if (!sc->sc_invalid) {
@@ -871,18 +871,8 @@
        ifp->if_flags &= ~(IFF_RUNNING|IFF_OACTIVE);
        ifp->if_timer = 0;
        sc->sc_tx_timer = sc->sc_rx_timer = sc->sc_mgt_timer = 0;
-       for (;;) {
-               IF_DEQUEUE(&sc->sc_mgtq, m);
-               if (m == NULL)
-                       break;
-               m_freem(m);
-       }
-       for (;;) {
-               IF_DEQUEUE(&ifp->if_snd, m);
-               if (m == NULL)
-                       break;
-               m_freem(m);
-       }
+       IF_PURGE(&sc->sc_mgtq);
+       IFQ_PURGE(&ifp->if_snd);
        while ((bp = TAILQ_FIRST(&sc->sc_scan)) != NULL) {
                TAILQ_REMOVE(&sc->sc_scan, bp, list);
                free(bp, M_DEVBUF);
@@ -951,17 +941,17 @@
 
        for (;;) {
                txd = sc->sc_txnext;
-               IF_DEQUEUE(&sc->sc_mgtq, m0);
+               IF_POLL(&sc->sc_mgtq, m0);
                if (m0 != NULL) {
                        if (awi_next_txd(sc, m0->m_pkthdr.len, &frame, &ntxd)) {
-                               IF_PREPEND(&sc->sc_mgtq, m0);
                                ifp->if_flags |= IFF_OACTIVE;
                                break;
                        }
+                       IF_DEQUEUE(&sc->sc_mgtq, m0);
                } else {
                        if (!(ifp->if_flags & IFF_RUNNING))
                                break;
-                       IF_DEQUEUE(&ifp->if_snd, m0);
+                       IFQ_POLL(&ifp->if_snd, m0);
                        if (m0 == NULL)
                                break;
                        len = m0->m_pkthdr.len + sizeof(struct ieee80211_frame);
@@ -976,6 +966,7 @@
                                ifp->if_flags |= IFF_OACTIVE;
                                break;
                        }
+                       IFQ_DEQUEUE(&ifp->if_snd, m0);
                        AWI_BPF_MTAP(sc, m0, AWI_BPF_NORM);
                        m0 = awi_fix_txhdr(sc, m0);
                        if (sc->sc_wep_algo != NULL && m0 != NULL)
diff -r b4d607e804ab -r c85ee33f7abe sys/dev/ic/dp8390.c
--- a/sys/dev/ic/dp8390.c       Thu Dec 14 05:59:39 2000 +0000
+++ b/sys/dev/ic/dp8390.c       Thu Dec 14 06:27:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dp8390.c,v 1.40 2000/11/15 01:02:16 thorpej Exp $      */
+/*     $NetBSD: dp8390.c,v 1.41 2000/12/14 06:27:24 thorpej Exp $      */
 
 /*
  * Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@@ -132,6 +132,7 @@
                ifp->if_watchdog = dp8390_watchdog;
        ifp->if_flags =
            IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST;
+       IFQ_SET_READY(&ifp->if_snd);
 
        /* Initialize media goo. */
        ifmedia_init(&sc->sc_media, 0, dp8390_mediachange, dp8390_mediastatus);
@@ -478,7 +479,7 @@
                ifp->if_flags |= IFF_OACTIVE;
                return;
        }
-       IF_DEQUEUE(&ifp->if_snd, m0);
+       IFQ_DEQUEUE(&ifp->if_snd, m0);
        if (m0 == 0)
                return;
 
diff -r b4d607e804ab -r c85ee33f7abe sys/dev/ic/elink3.c
--- a/sys/dev/ic/elink3.c       Thu Dec 14 05:59:39 2000 +0000
+++ b/sys/dev/ic/elink3.c       Thu Dec 14 06:27:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: elink3.c,v 1.85 2000/11/15 01:02:16 thorpej Exp $      */
+/*     $NetBSD: elink3.c,v 1.86 2000/12/14 06:27:24 thorpej Exp $      */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -432,6 +432,7 @@
        ifp->if_watchdog = epwatchdog;
        ifp->if_flags =
            IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST;
+       IFQ_SET_READY(&ifp->if_snd);
 
        if_attach(ifp);
        ether_ifattach(ifp, enaddr);
@@ -1136,7 +1137,7 @@
 
 startagain:
        /* Sneak a peek at the next packet */
-       m0 = ifp->if_snd.ifq_head;
+       IFQ_POLL(&ifp->if_snd, m0);
        if (m0 == 0)
                return;
 
@@ -1155,7 +1156,7 @@
        if (len + pad > ETHER_MAX_LEN) {
                /* packet is obviously too large: toss it */
                ++ifp->if_oerrors;
-               IF_DEQUEUE(&ifp->if_snd, m0);
+               IFQ_DEQUEUE(&ifp->if_snd, m0);
                m_freem(m0);
                goto readcheck;
        }
@@ -1173,7 +1174,7 @@
                    SET_TX_AVAIL_THRESH | ELINK_THRESH_DISABLE);
        }
 
-       IF_DEQUEUE(&ifp->if_snd, m0);
+       IFQ_DEQUEUE(&ifp->if_snd, m0);
        if (m0 == 0)            /* not really needed */
                return;
 
diff -r b4d607e804ab -r c85ee33f7abe sys/dev/ic/elinkxl.c
--- a/sys/dev/ic/elinkxl.c      Thu Dec 14 05:59:39 2000 +0000
+++ b/sys/dev/ic/elinkxl.c      Thu Dec 14 06:27:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: elinkxl.c,v 1.45 2000/11/15 01:02:16 thorpej Exp $     */
+/*     $NetBSD: elinkxl.c,v 1.46 2000/12/14 06:27:25 thorpej Exp $     */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -435,6 +435,7 @@
        ifp->if_stop = ex_stop;
        ifp->if_flags =
            IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST;
+       IFQ_SET_READY(&ifp->if_snd);
 
        /*
         * We can support 802.1Q VLAN-sized frames.
@@ -920,8 +921,9 @@
        volatile struct ex_fraghdr *fr = NULL;
        volatile struct ex_dpd *dpd = NULL, *prevdpd = NULL;
        struct ex_txdesc *txp;
+       struct mbuf *mb_head;
        bus_dmamap_t dmamap;
-       int offset, totlen;
+       int offset, totlen, segment, error;
 
        if (sc->tx_head || sc->tx_free == NULL)
                return;
@@ -932,14 +934,13 @@
         * We're finished if there is nothing more to add to the list or if
         * we're all filled up with buffers to transmit.
         */
-       while (ifp->if_snd.ifq_head != NULL && sc->tx_free != NULL) {
-               struct mbuf *mb_head;
-               int segment, error;
-
+       while (sc->tx_free != NULL) {
                /*
                 * Grab a packet to transmit.
                 */
-               IF_DEQUEUE(&ifp->if_snd, mb_head);
+               IFQ_DEQUEUE(&ifp->if_snd, mb_head);
+               if (mb_head == NULL)
+                       break;
 
                /*
                 * Get pointer to next available tx desc.
@@ -1252,7 +1253,7 @@
        }
 
        /* no more interrupts */
-       if (ret && ifp->if_snd.ifq_head)
+       if (ret && IFQ_IS_EMPTY(&ifp->if_snd) == 0)
                ex_start(ifp);
        return ret;
 }
diff -r b4d607e804ab -r c85ee33f7abe sys/dev/ic/hme.c
--- a/sys/dev/ic/hme.c  Thu Dec 14 05:59:39 2000 +0000
+++ b/sys/dev/ic/hme.c  Thu Dec 14 06:27:23 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hme.c,v 1.19 2000/11/17 19:08:00 bouyer Exp $  */
+/*     $NetBSD: hme.c,v 1.20 2000/12/14 06:27:25 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -250,6 +250,7 @@
        ifp->if_watchdog = hme_watchdog;
        ifp->if_flags =
            IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST;
+       IFQ_SET_READY(&ifp->if_snd);
 
        /* Initialize ifmedia structures and MII info */
        mii->mii_ifp = ifp;
@@ -809,7 +810,7 @@
        ri = sc->sc_rb.rb_tdhead;
 
        for (;;) {
-               IF_DEQUEUE(&ifp->if_snd, m);
+               IFQ_DEQUEUE(&ifp->if_snd, m);
                if (m == 0)
                        break;
 
diff -r b4d607e804ab -r c85ee33f7abe sys/dev/ic/i82557.c
--- a/sys/dev/ic/i82557.c       Thu Dec 14 05:59:39 2000 +0000



Home | Main Index | Thread Index | Old Index