diff options
author | des <des@FreeBSD.org> | 2004-10-30 21:21:10 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2004-10-30 21:21:10 +0000 |
commit | 89f395d896ceccba3f8a9426540f97e195060e17 (patch) | |
tree | 44aad521ae46a315bdce0865bf73adea07fae85d /sys/dev/bge | |
parent | ee68591e10a9be489c2eb55d8b64f3414580d8f9 (diff) | |
download | FreeBSD-src-89f395d896ceccba3f8a9426540f97e195060e17.zip FreeBSD-src-89f395d896ceccba3f8a9426540f97e195060e17.tar.gz |
Add altq(4) support.
Diffstat (limited to 'sys/dev/bge')
-rw-r--r-- | sys/dev/bge/if_bge.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 466f2ea..f596bf8 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -2384,7 +2384,9 @@ bge_attach(dev) ifp->if_watchdog = bge_watchdog; ifp->if_init = bge_init; ifp->if_mtu = ETHERMTU; - ifp->if_snd.ifq_maxlen = BGE_TX_RING_CNT - 1; + ifp->if_snd.ifq_drv_maxlen = BGE_TX_RING_CNT - 1; + IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); + IFQ_SET_READY(&ifp->if_snd); ifp->if_hwassist = BGE_CSUM_FEATURES; /* NB: the code for RX csum offload is disabled for now */ ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_VLAN_HWTAGGING | @@ -2982,7 +2984,7 @@ bge_intr(xsc) /* Re-enable interrupts. */ CSR_WRITE_4(sc, BGE_MBX_IRQ0_LO, 0); - 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)) bge_start_locked(ifp); BGE_UNLOCK(sc); @@ -3021,7 +3023,7 @@ bge_tick_locked(sc) BGE_MACMODE_TBI_SEND_CFGS); CSR_WRITE_4(sc, BGE_MAC_STS, 0xFFFFFFFF); printf("bge%d: gigabit link up\n", sc->bge_unit); - if (ifp->if_snd.ifq_head != NULL) + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) bge_start_locked(ifp); } return; @@ -3037,7 +3039,7 @@ bge_tick_locked(sc) IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX) printf("bge%d: gigabit link up\n", sc->bge_unit); - if (ifp->if_snd.ifq_head != NULL) + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) bge_start_locked(ifp); } @@ -3202,13 +3204,13 @@ bge_start_locked(ifp) sc = ifp->if_softc; - if (!sc->bge_link && ifp->if_snd.ifq_len < 10) + if (!sc->bge_link && IFQ_DRV_IS_EMPTY(&ifp->if_snd)) return; prodidx = CSR_READ_4(sc, BGE_MBX_TX_HOST_PROD0_LO); while(sc->bge_cdata.bge_tx_chain[prodidx] == NULL) { - IF_DEQUEUE(&ifp->if_snd, m_head); + IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; @@ -3229,7 +3231,7 @@ bge_start_locked(ifp) m_head->m_pkthdr.csum_flags & (CSUM_DELAY_DATA)) { if ((BGE_TX_RING_CNT - sc->bge_txcnt) < m_head->m_pkthdr.csum_data + 16) { - IF_PREPEND(&ifp->if_snd, m_head); + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); ifp->if_flags |= IFF_OACTIVE; break; } @@ -3241,7 +3243,7 @@ bge_start_locked(ifp) * for the NIC to drain the ring. */ if (bge_encap(sc, m_head, &prodidx)) { - IF_PREPEND(&ifp->if_snd, m_head); + IFQ_DRV_PREPEND(&ifp->if_snd, m_head); ifp->if_flags |= IFF_OACTIVE; break; } |