net: Don't use IF_{EN,DE}QUEUE on ifnet.if_snd
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 3 Jan 2013 07:23:06 +0000 (15:23 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 3 Jan 2013 07:23:06 +0000 (15:23 +0800)
sys/dev/atm/en/midway.c
sys/dev/netif/ath/ath/if_ath.c
sys/dev/netif/xl/if_xl.c
sys/netgraph/eiface/ng_eiface.c
sys/netgraph/fec/ng_fec.c
sys/netgraph7/ng_eiface.c
sys/netproto/802_11/wlan/ieee80211_hostap.c

index 493eeb6..342ed4a 100644 (file)
 
 #include <net/if.h>
 #include <net/if_atm.h>
+#include <net/ifq_var.h>
 
 #include <vm/vm.h>
 
@@ -1481,7 +1482,7 @@ en_start(struct ifnet *ifp)
 
     while (1) {
 
-      IF_DEQUEUE(&ifp->if_snd, m);
+      m = ifq_dequeue(&ifp->if_snd, NULL);
       if (m == NULL)
        return;         /* EMPTY: >>> exit here <<< */
     
index 18083b2..0fb4fde 100644 (file)
@@ -1826,7 +1826,7 @@ ath_start(struct ifnet *ifp)
                if (bf == NULL)
                        break;
 
-               IF_DEQUEUE(&ifp->if_snd, m);
+               m = ifq_dequeue(&ifp->if_snd, NULL);
                if (m == NULL) {
                        STAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list);
                        break;
index ff7ceff..4e904dd 100644 (file)
@@ -812,36 +812,6 @@ xl_setmulti_hash(struct xl_softc *sc)
        return;
 }
 
-#ifdef notdef
-static void
-xl_testpacket(struct xl_softc *sc)
-{
-       struct mbuf             *m;
-       struct ifnet            *ifp;
-
-       ifp = &sc->arpcom.ac_if;
-
-       MGETHDR(m, MB_DONTWAIT, MT_DATA);
-
-       if (m == NULL)
-               return;
-
-       bcopy(&sc->arpcom.ac_enaddr,
-               mtod(m, struct ether_header *)->ether_dhost, ETHER_ADDR_LEN);
-       bcopy(&sc->arpcom.ac_enaddr,
-               mtod(m, struct ether_header *)->ether_shost, ETHER_ADDR_LEN);
-       mtod(m, struct ether_header *)->ether_type = htons(3);
-       mtod(m, unsigned char *)[14] = 0;
-       mtod(m, unsigned char *)[15] = 0;
-       mtod(m, unsigned char *)[16] = 0xE3;
-       m->m_len = m->m_pkthdr.len = sizeof(struct ether_header) + 3;
-       IF_ENQUEUE(&ifp->if_snd, m);
-       xl_start(ifp);
-
-       return;
-}
-#endif
-
 static void
 xl_setcfg(struct xl_softc *sc)
 {
index 6f9c394..c944cb1 100644 (file)
@@ -239,7 +239,7 @@ ng_eiface_start(struct ifnet *ifp)
        /*
         * Grab a packet to transmit.
         */
-       IF_DEQUEUE(&ifp->if_snd, m);
+       m = ifq_dequeue(&ifp->if_snd, NULL);
 
        /* If there's nothing to send, return. */
        if(m == NULL)
index 98eabde..e7334df 100644 (file)
@@ -989,7 +989,7 @@ ng_fec_start(struct ifnet *ifp)
        priv = ifp->if_softc;
        b = &priv->fec_bundle;
 
-       IF_DEQUEUE(&ifp->if_snd, m0);
+       m0 = ifq_dequeue(&ifp->if_snd, NULL);
        if (m0 == NULL)
                return;
 
index 1484e83..3f3a46b 100644 (file)
@@ -222,7 +222,7 @@ ng_eiface_start2(node_p node, hook_p hook, void *arg1, int arg2)
                /*
                 * Grab a packet to transmit.
                 */
-               IF_DEQUEUE(&ifp->if_snd, m);
+               m = ifq_dequeue(&ifp->if_snd, NULL);
 
                /* If there's nothing to send, break. */
                if (m == NULL)
index 5da64a1..b2cbc8a 100644 (file)
@@ -47,6 +47,7 @@
 #include <net/if.h>
 #include <net/if_media.h>
 #include <net/if_llc.h>
+#include <net/ifq_var.h>
 #include <net/ethernet.h>
 #include <net/route.h>
 
@@ -2288,6 +2289,6 @@ hostap_recv_pspoll(struct ieee80211_node *ni, struct mbuf *m0)
                ifp = vap->iv_ic->ic_ifp;
        else
                ifp = vap->iv_ifp;
-       IF_ENQUEUE(&ifp->if_snd, m);
+       ifq_enqueue(&ifp->if_snd, m, NULL);
        ifp->if_start(ifp);
 }