Add altq(4) support.
This commit is contained in:
parent
ee68591e10
commit
89f395d896
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user