--- src/sys/dev/netif/gx/Attic/if_gx.c 2005/02/14 16:21:34 1.12 +++ src/sys/dev/netif/gx/Attic/if_gx.c 2005/02/18 23:15:00 1.13 @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -345,7 +346,8 @@ gx_attach(device_t dev) ifp->if_watchdog = gx_watchdog; ifp->if_init = gx_init; ifp->if_mtu = ETHERMTU; - ifp->if_snd.ifq_maxlen = GX_TX_RING_CNT - 1; + ifq_set_maxlen(&ifp->if_snd, GX_TX_RING_CNT - 1); + ifq_set_ready(&ifp->if_snd); /* see if we can enable hardware checksumming */ if (gx->gx_vflags & GXF_CSUM) { @@ -1446,7 +1448,7 @@ gx_intr(void *xsc) /* Turn interrupts on. */ CSR_WRITE_4(gx, GX_INT_MASK_SET, GX_INT_WANTED); - if (ifp->if_flags & IFF_RUNNING && ifp->if_snd.ifq_head != NULL) + if (ifp->if_flags & IFF_RUNNING && !ifq_is_empty(&ifp->if_snd)) gx_start(ifp); splx(s); @@ -1586,7 +1588,7 @@ gx_start(struct ifnet *ifp) gx = ifp->if_softc; for (;;) { - IF_DEQUEUE(&ifp->if_snd, m_head); + m_head = ifq_poll(&ifp->if_snd); if (m_head == NULL) break; @@ -1596,10 +1598,10 @@ gx_start(struct ifnet *ifp) * for the NIC to drain the ring. */ if (gx_encap(gx, m_head) != 0) { - IF_PREPEND(&ifp->if_snd, m_head); ifp->if_flags |= IFF_OACTIVE; break; } + m_head = ifq_dequeue(&ifp->if_snd); BPF_MTAP(ifp, m_head);