summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2004-07-02 12:16:02 +0000
committermlaier <mlaier@FreeBSD.org>2004-07-02 12:16:02 +0000
commit7bc770a2546e8a5f93ee931634d4064b3b6e08f2 (patch)
tree65f0224543a217107b8c639eebd90136c5b1386d
parent1ddf2fdcc0eaea7a1f7848fe9957f173c396c23c (diff)
downloadFreeBSD-src-7bc770a2546e8a5f93ee931634d4064b3b6e08f2.zip
FreeBSD-src-7bc770a2546e8a5f93ee931634d4064b3b6e08f2.tar.gz
Bring in the first chunk of altq driver modifications. This covers the
following drivers: bfe(4), em(4), fxp(4), lnc(4), tun(4), de(4) rl(4), sis(4) and xl(4) More patches are pending on: http://peoples.freebsd.org/~mlaier/ Please take a look and tell me if "your" driver is missing, so I can fix this. Tested-by: many No-objection: -current, -net
-rw-r--r--sys/dev/bfe/if_bfe.c10
-rw-r--r--sys/dev/de/if_de.c23
-rw-r--r--sys/dev/em/if_em.c14
-rw-r--r--sys/dev/fxp/if_fxp.c13
-rw-r--r--sys/dev/lnc/if_lnc.c6
-rw-r--r--sys/net/if_tun.c37
-rw-r--r--sys/pci/if_de.c23
-rw-r--r--sys/pci/if_rl.c10
-rw-r--r--sys/pci/if_sis.c16
-rw-r--r--sys/pci/if_xl.c14
10 files changed, 108 insertions, 58 deletions
diff --git a/sys/dev/bfe/if_bfe.c b/sys/dev/bfe/if_bfe.c
index a3a44dc..7a39b4c 100644
--- a/sys/dev/bfe/if_bfe.c
+++ b/sys/dev/bfe/if_bfe.c
@@ -402,7 +402,9 @@ bfe_attach(device_t dev)
ifp->if_init = bfe_init;
ifp->if_mtu = ETHERMTU;
ifp->if_baudrate = 100000000;
- ifp->if_snd.ifq_maxlen = BFE_TX_QLEN;
+ IFQ_SET_MAXLEN(&ifp->if_snd, BFE_TX_QLEN);
+ ifp->if_snd.ifq_drv_maxlen = BFE_TX_QLEN;
+ IFQ_SET_READY(&ifp->if_snd);
bfe_get_config(sc);
@@ -1256,7 +1258,7 @@ bfe_intr(void *xsc)
bfe_txeof(sc);
/* We have packets pending, fire them out */
- if (ifp->if_flags & IFF_RUNNING && ifp->if_snd.ifq_head != NULL)
+ if (ifp->if_flags & IFF_RUNNING && !IFQ_DRV_IS_EMPTY(&ifp->if_snd))
bfe_start(ifp);
BFE_UNLOCK(sc);
@@ -1375,7 +1377,7 @@ bfe_start(struct ifnet *ifp)
}
while(sc->bfe_tx_ring[idx].bfe_mbuf == NULL) {
- IF_DEQUEUE(&ifp->if_snd, m_head);
+ IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
if(m_head == NULL)
break;
@@ -1384,7 +1386,7 @@ bfe_start(struct ifnet *ifp)
* enough room, let the chip drain the ring.
*/
if(bfe_encap(sc, m_head, &idx)) {
- IF_PREPEND(&ifp->if_snd, m_head);
+ IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
ifp->if_flags |= IFF_OACTIVE;
break;
}
diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c
index a56f1b8..6c3592e 100644
--- a/sys/dev/de/if_de.c
+++ b/sys/dev/de/if_de.c
@@ -4619,15 +4619,17 @@ tulip_ifstart(
if ((sc->tulip_flags & (TULIP_WANTSETUP|TULIP_TXPROBE_ACTIVE)) == TULIP_WANTSETUP)
tulip_txput_setup(sc);
- while (sc->tulip_if.if_snd.ifq_head != NULL) {
+ while (!IFQ_DRV_IS_EMPTY(&sc->tulip_if.if_snd)) {
struct mbuf *m;
- IF_DEQUEUE(&sc->tulip_if.if_snd, m);
+ IFQ_DRV_DEQUEUE(&sc->tulip_if.if_snd, m);
+ if(m == NULL)
+ break;
if ((m = tulip_txput(sc, m)) != NULL) {
- IF_PREPEND(&sc->tulip_if.if_snd, m);
+ IFQ_DRV_PREPEND(&sc->tulip_if.if_snd, m);
break;
}
}
- if (sc->tulip_if.if_snd.ifq_head == NULL)
+ if (IFQ_DRV_IS_EMPTY(&sc->tulip_if.if_snd))
sc->tulip_if.if_start = tulip_ifstart_one;
}
@@ -4642,11 +4644,12 @@ tulip_ifstart_one(
tulip_softc_t * const sc = (tulip_softc_t *)ifp->if_softc;
if ((sc->tulip_if.if_flags & IFF_RUNNING)
- && sc->tulip_if.if_snd.ifq_head != NULL) {
+ && !IFQ_DRV_IS_EMPTY(&sc->tulip_if.if_snd)) {
struct mbuf *m;
- IF_DEQUEUE(&sc->tulip_if.if_snd, m);
- if ((m = tulip_txput(sc, m)) != NULL)
- IF_PREPEND(&sc->tulip_if.if_snd, m);
+ IFQ_DRV_DEQUEUE(&sc->tulip_if.if_snd, m);
+ if(m == NULL);
+ else if((m = tulip_txput(sc, m)) != NULL)
+ IFQ_DRV_PREPEND(&sc->tulip_if.if_snd, m);
}
TULIP_PERFEND(ifstart_one);
}
@@ -4788,7 +4791,9 @@ tulip_attach(
tulip_reset(sc);
ether_ifattach(&(sc)->tulip_if, sc->tulip_enaddr);
- ifp->if_snd.ifq_maxlen = ifqmaxlen;
+ IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
+ ifp->if_snd.ifq_drv_maxlen = ifqmaxlen;
+ IFQ_SET_READY(&ifp->if_snd);
}
#if defined(TULIP_BUS_DMA)
diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c
index 47eb067..28aafa4 100644
--- a/sys/dev/em/if_em.c
+++ b/sys/dev/em/if_em.c
@@ -610,15 +610,15 @@ em_start_locked(struct ifnet *ifp)
if (!adapter->link_active)
return;
- while (ifp->if_snd.ifq_head != NULL) {
+ while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
- IF_DEQUEUE(&ifp->if_snd, m_head);
+ IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
if (m_head == NULL) break;
if (em_encap(adapter, m_head)) {
ifp->if_flags |= IFF_OACTIVE;
- IF_PREPEND(&ifp->if_snd, m_head);
+ IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
break;
}
@@ -918,7 +918,7 @@ em_poll_locked(struct ifnet *ifp, enum poll_cmd cmd, int count)
em_clean_transmit_interrupts(adapter);
}
- if (ifp->if_flags & IFF_RUNNING && ifp->if_snd.ifq_head != NULL)
+ if (ifp->if_flags & IFF_RUNNING && !IFQ_DRV_IS_EMPTY(&ifp->if_snd))
em_start_locked(ifp);
}
@@ -988,7 +988,7 @@ em_intr(void *arg)
loop_cnt--;
}
- if (ifp->if_flags & IFF_RUNNING && ifp->if_snd.ifq_head != NULL)
+ if (ifp->if_flags & IFF_RUNNING && IFQ_DRV_IS_EMPTY(&ifp->if_snd))
em_start_locked(ifp);
EM_UNLOCK(adapter);
@@ -1854,7 +1854,9 @@ em_setup_interface(device_t dev, struct adapter * adapter)
ifp->if_ioctl = em_ioctl;
ifp->if_start = em_start;
ifp->if_watchdog = em_watchdog;
- ifp->if_snd.ifq_maxlen = adapter->num_tx_desc - 1;
+ IFQ_SET_MAXLEN(&ifp->if_snd, adapter->num_tx_desc - 1);
+ ifp->if_snd.ifq_drv_maxlen = adapter->num_tx_desc - 1;
+ IFQ_SET_READY(&ifp->if_snd);
#if __FreeBSD_version < 500000
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c
index 6dc1aa6..65de7e1 100644
--- a/sys/dev/fxp/if_fxp.c
+++ b/sys/dev/fxp/if_fxp.c
@@ -796,7 +796,9 @@ fxp_attach(device_t dev)
* Let the system queue as many packets as we have available
* TX descriptors.
*/
- ifp->if_snd.ifq_maxlen = FXP_NTXCB - 1;
+ IFQ_SET_MAXLEN(&ifp->if_snd, FXP_NTXCB - 1);
+ ifp->if_snd.ifq_drv_maxlen = FXP_NTXCB - 1;
+ IFQ_SET_READY(&ifp->if_snd);
/*
* Hook our interrupt after all initialization is complete.
@@ -1278,12 +1280,15 @@ fxp_start_body(struct ifnet *ifp)
* NOTE: One TxCB is reserved to guarantee that fxp_mc_setup() can add
* a NOP command when needed.
*/
- while (ifp->if_snd.ifq_head != NULL && sc->tx_queued < FXP_NTXCB - 1) {
+ while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd) &&
+ sc->tx_queued < FXP_NTXCB - 1) {
/*
* Grab a packet to transmit.
*/
- IF_DEQUEUE(&ifp->if_snd, mb_head);
+ IFQ_DRV_DEQUEUE(&ifp->if_snd, mb_head);
+ if (mb_head == NULL)
+ break;
/*
* Get pointer to next available tx desc.
@@ -1634,7 +1639,7 @@ fxp_intr_body(struct fxp_softc *sc, struct ifnet *ifp, u_int8_t statack,
/*
* Try to start more packets transmitting.
*/
- if (ifp->if_snd.ifq_head != NULL)
+ if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
fxp_start_body(ifp);
}
diff --git a/sys/dev/lnc/if_lnc.c b/sys/dev/lnc/if_lnc.c
index 25cb687..8e80530 100644
--- a/sys/dev/lnc/if_lnc.c
+++ b/sys/dev/lnc/if_lnc.c
@@ -863,7 +863,9 @@ lnc_attach_common(device_t dev)
sc->arpcom.ac_if.if_ioctl = lnc_ioctl;
sc->arpcom.ac_if.if_watchdog = lnc_watchdog;
sc->arpcom.ac_if.if_init = lnc_init;
- sc->arpcom.ac_if.if_snd.ifq_maxlen = IFQ_MAXLEN;
+ IFQ_SET_MAXLEN(&sc->arpcom.ac_if.if_snd, IFQ_MAXLEN);
+ sc->arpcom.ac_if.if_snd.ifq_drv_maxlen = IFQ_MAXLEN;
+ IFQ_SET_READY(&sc->arpcom.ac_if.if_snd);
/* Extract MAC address from PROM */
for (i = 0; i < ETHER_ADDR_LEN; i++)
@@ -1213,7 +1215,7 @@ lnc_start(struct ifnet *ifp)
do {
- IF_DEQUEUE(&sc->arpcom.ac_if.if_snd, head);
+ IFQ_DRV_DEQUEUE(&sc->arpcom.ac_if.if_snd, head);
if (!head)
return;
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index b5b3298..23cb20b 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -220,6 +220,17 @@ static void
tunstart(struct ifnet *ifp)
{
struct tun_softc *tp = ifp->if_softc;
+ struct mbuf *m;
+
+ if (ALTQ_IS_ENABLED(&ifp->if_snd)) {
+ IFQ_LOCK(&ifp->if_snd);
+ IFQ_POLL_NOLOCK(&ifp->if_snd, m);
+ if (m == NULL) {
+ IFQ_UNLOCK(&ifp->if_snd);
+ return;
+ }
+ IFQ_UNLOCK(&ifp->if_snd);
+ }
mtx_lock(&tp->tun_mtx);
if (tp->tun_flags & TUN_RWAIT) {
@@ -258,8 +269,11 @@ tuncreate(struct cdev *dev)
ifp->if_start = tunstart;
ifp->if_flags = IFF_POINTOPOINT | IFF_MULTICAST;
ifp->if_type = IFT_PPP;
- ifp->if_snd.ifq_maxlen = ifqmaxlen;
ifp->if_softc = sc;
+ IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
+ ifp->if_snd.ifq_drv_maxlen = 0;
+ IFQ_SET_READY(&ifp->if_snd);
+
if_attach(ifp);
bpfattach(ifp, DLT_NULL, sizeof(u_int));
dev->si_drv1 = sc;
@@ -319,12 +333,14 @@ tunclose(struct cdev *dev, int foo, int bar, struct thread *td)
mtx_lock(&tp->tun_mtx);
tp->tun_flags &= ~TUN_OPEN;
tp->tun_pid = 0;
- mtx_unlock(&tp->tun_mtx);
/*
* junk all pending output
*/
- IF_DRAIN(&ifp->if_snd);
+ s = splimp();
+ IFQ_PURGE(&ifp->if_snd);
+ splx(s);
+ mtx_unlock(&tp->tun_mtx);
if (ifp->if_flags & IFF_UP) {
s = splimp();
@@ -623,10 +639,13 @@ tunioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td
break;
case FIONREAD:
s = splimp();
- if (tp->tun_if.if_snd.ifq_head) {
- struct mbuf *mb = tp->tun_if.if_snd.ifq_head;
+ if (!IFQ_IS_EMPTY(&tp->tun_if.if_snd)) {
+ struct mbuf *mb;
+ IFQ_LOCK(&tp->tun_if.if_snd);
+ IFQ_POLL_NOLOCK(&tp->tun_if.if_snd, mb);
for( *(int *)data = 0; mb != 0; mb = mb->m_next)
*(int *)data += mb->m_len;
+ IFQ_UNLOCK(&tp->tun_if.if_snd);
} else
*(int *)data = 0;
splx(s);
@@ -678,7 +697,7 @@ tunread(struct cdev *dev, struct uio *uio, int flag)
s = splimp();
do {
- IF_DEQUEUE(&ifp->if_snd, m);
+ IFQ_DEQUEUE(&ifp->if_snd, m);
if (m == NULL) {
if (flag & IO_NDELAY) {
splx(s);
@@ -835,18 +854,22 @@ tunpoll(struct cdev *dev, int events, struct thread *td)
struct tun_softc *tp = dev->si_drv1;
struct ifnet *ifp = &tp->tun_if;
int revents = 0;
+ struct mbuf *m;
s = splimp();
TUNDEBUG(ifp, "tunpoll\n");
if (events & (POLLIN | POLLRDNORM)) {
- if (ifp->if_snd.ifq_len > 0) {
+ IFQ_LOCK(&ifp->if_snd);
+ IFQ_POLL_NOLOCK(&ifp->if_snd, m);
+ if (m != NULL) {
TUNDEBUG(ifp, "tunpoll q=%d\n", ifp->if_snd.ifq_len);
revents |= events & (POLLIN | POLLRDNORM);
} else {
TUNDEBUG(ifp, "tunpoll waiting\n");
selrecord(td, &tp->tun_rsel);
}
+ IFQ_UNLOCK(&ifp->if_snd);
}
if (events & (POLLOUT | POLLWRNORM))
revents |= events & (POLLOUT | POLLWRNORM);
diff --git a/sys/pci/if_de.c b/sys/pci/if_de.c
index a56f1b8..6c3592e 100644
--- a/sys/pci/if_de.c
+++ b/sys/pci/if_de.c
@@ -4619,15 +4619,17 @@ tulip_ifstart(
if ((sc->tulip_flags & (TULIP_WANTSETUP|TULIP_TXPROBE_ACTIVE)) == TULIP_WANTSETUP)
tulip_txput_setup(sc);
- while (sc->tulip_if.if_snd.ifq_head != NULL) {
+ while (!IFQ_DRV_IS_EMPTY(&sc->tulip_if.if_snd)) {
struct mbuf *m;
- IF_DEQUEUE(&sc->tulip_if.if_snd, m);
+ IFQ_DRV_DEQUEUE(&sc->tulip_if.if_snd, m);
+ if(m == NULL)
+ break;
if ((m = tulip_txput(sc, m)) != NULL) {
- IF_PREPEND(&sc->tulip_if.if_snd, m);
+ IFQ_DRV_PREPEND(&sc->tulip_if.if_snd, m);
break;
}
}
- if (sc->tulip_if.if_snd.ifq_head == NULL)
+ if (IFQ_DRV_IS_EMPTY(&sc->tulip_if.if_snd))
sc->tulip_if.if_start = tulip_ifstart_one;
}
@@ -4642,11 +4644,12 @@ tulip_ifstart_one(
tulip_softc_t * const sc = (tulip_softc_t *)ifp->if_softc;
if ((sc->tulip_if.if_flags & IFF_RUNNING)
- && sc->tulip_if.if_snd.ifq_head != NULL) {
+ && !IFQ_DRV_IS_EMPTY(&sc->tulip_if.if_snd)) {
struct mbuf *m;
- IF_DEQUEUE(&sc->tulip_if.if_snd, m);
- if ((m = tulip_txput(sc, m)) != NULL)
- IF_PREPEND(&sc->tulip_if.if_snd, m);
+ IFQ_DRV_DEQUEUE(&sc->tulip_if.if_snd, m);
+ if(m == NULL);
+ else if((m = tulip_txput(sc, m)) != NULL)
+ IFQ_DRV_PREPEND(&sc->tulip_if.if_snd, m);
}
TULIP_PERFEND(ifstart_one);
}
@@ -4788,7 +4791,9 @@ tulip_attach(
tulip_reset(sc);
ether_ifattach(&(sc)->tulip_if, sc->tulip_enaddr);
- ifp->if_snd.ifq_maxlen = ifqmaxlen;
+ IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen);
+ ifp->if_snd.ifq_drv_maxlen = ifqmaxlen;
+ IFQ_SET_READY(&ifp->if_snd);
}
#if defined(TULIP_BUS_DMA)
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c
index 262b6a1..6398752 100644
--- a/sys/pci/if_rl.c
+++ b/sys/pci/if_rl.c
@@ -1048,7 +1048,9 @@ rl_attach(dev)
ifp->if_capabilities |= IFCAP_POLLING;
#endif
ifp->if_capenable = ifp->if_capabilities;
- ifp->if_snd.ifq_maxlen = IFQ_MAXLEN;
+ IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN);
+ ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN;
+ IFQ_SET_READY(&ifp->if_snd);
callout_handle_init(&sc->rl_stat_ch);
@@ -1393,7 +1395,7 @@ rl_poll (struct ifnet *ifp, enum poll_cmd cmd, int count)
sc->rxcycles = count;
rl_rxeof(sc);
rl_txeof(sc);
- if (ifp->if_snd.ifq_head != NULL)
+ if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
rl_start(ifp);
if (cmd == POLL_AND_CHECK_STATUS) { /* also check status register */
@@ -1475,7 +1477,7 @@ rl_intr(arg)
}
- if (ifp->if_snd.ifq_head != NULL)
+ if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
rl_start(ifp);
#ifdef DEVICE_POLLING
@@ -1545,7 +1547,7 @@ rl_start(ifp)
RL_LOCK(sc);
while(RL_CUR_TXMBUF(sc) == NULL) {
- IF_DEQUEUE(&ifp->if_snd, m_head);
+ IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
if (m_head == NULL)
break;
diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c
index 108c356..6a30c7e 100644
--- a/sys/pci/if_sis.c
+++ b/sys/pci/if_sis.c
@@ -1337,7 +1337,9 @@ sis_attach(dev)
ifp->if_watchdog = sis_watchdog;
ifp->if_init = sis_init;
ifp->if_baudrate = 10000000;
- ifp->if_snd.ifq_maxlen = SIS_TX_LIST_CNT - 1;
+ IFQ_SET_MAXLEN(&ifp->if_snd, SIS_TX_LIST_CNT - 1);
+ ifp->if_snd.ifq_drv_maxlen = SIS_TX_LIST_CNT - 1;
+ IFQ_SET_READY(&ifp->if_snd);
/*
* Do MII setup.
@@ -1727,7 +1729,7 @@ sis_tick(xsc)
if (!sc->sis_link && mii->mii_media_status & IFM_ACTIVE &&
IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) {
sc->sis_link++;
- if (ifp->if_snd.ifq_head != NULL)
+ if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
sis_start(ifp);
}
@@ -1766,7 +1768,7 @@ sis_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
sc->rxcycles = count;
sis_rxeof(sc);
sis_txeof(sc);
- if (ifp->if_snd.ifq_head != NULL)
+ if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
sis_start(ifp);
if (sc->rxcycles > 0 || cmd == POLL_AND_CHECK_STATUS) {
@@ -1853,7 +1855,7 @@ sis_intr(arg)
/* Re-enable interrupts. */
CSR_WRITE_4(sc, SIS_IER, 1);
- if (ifp->if_snd.ifq_head != NULL)
+ if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
sis_start(ifp);
done:
SIS_UNLOCK(sc);
@@ -1970,12 +1972,12 @@ sis_start(ifp)
}
while(sc->sis_ldata.sis_tx_list[idx].sis_mbuf == NULL) {
- IF_DEQUEUE(&ifp->if_snd, m_head);
+ IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
if (m_head == NULL)
break;
if (sis_encap(sc, &m_head, &idx)) {
- IF_PREPEND(&ifp->if_snd, m_head);
+ IFQ_DRV_PREPEND(&ifp->if_snd, m_head);
ifp->if_flags |= IFF_OACTIVE;
break;
}
@@ -2337,7 +2339,7 @@ sis_watchdog(ifp)
sis_reset(sc);
sis_init(sc);
- if (ifp->if_snd.ifq_head != NULL)
+ if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
sis_start(ifp);
SIS_UNLOCK(sc);
diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c
index 31adf06..29e5705 100644
--- a/sys/pci/if_xl.c
+++ b/sys/pci/if_xl.c
@@ -933,7 +933,7 @@ xl_testpacket(sc)
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);
+ IFQ_ENQUEUE(&ifp->if_snd, m);
xl_start(ifp);
return;
@@ -1556,7 +1556,9 @@ xl_attach(dev)
ifp->if_watchdog = xl_watchdog;
ifp->if_init = xl_init;
ifp->if_baudrate = 10000000;
- ifp->if_snd.ifq_maxlen = XL_TX_LIST_CNT - 1;
+ IFQ_SET_MAXLEN(&ifp->if_snd, XL_TX_LIST_CNT - 1);
+ ifp->if_snd.ifq_drv_maxlen = XL_TX_LIST_CNT - 1;
+ IFQ_SET_READY(&ifp->if_snd);
ifp->if_capenable = ifp->if_capabilities;
/*
@@ -2337,7 +2339,7 @@ xl_intr(arg)
}
}
- if (ifp->if_snd.ifq_head != NULL)
+ if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
(*ifp->if_start)(ifp);
XL_UNLOCK(sc);
@@ -2513,7 +2515,7 @@ xl_start(ifp)
start_tx = sc->xl_cdata.xl_tx_free;
while(sc->xl_cdata.xl_tx_free != NULL) {
- IF_DEQUEUE(&ifp->if_snd, m_head);
+ IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
if (m_head == NULL)
break;
@@ -2646,7 +2648,7 @@ xl_start_90xB(ifp)
break;
}
- IF_DEQUEUE(&ifp->if_snd, m_head);
+ IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
if (m_head == NULL)
break;
@@ -3156,7 +3158,7 @@ xl_watchdog(ifp)
xl_reset(sc);
xl_init(sc);
- if (ifp->if_snd.ifq_head != NULL)
+ if (IFQ_DRV_IS_EMPTY(&ifp->if_snd))
(*ifp->if_start)(ifp);
XL_UNLOCK(sc);
OpenPOWER on IntegriCloud