Fix sis, bfe and ndis in the same way dc was fixed:

Do not tell the hardware to send when there were no packets enqueued.

Found and reviewed by:	green
MFC after:		1 days
This commit is contained in:
mlaier 2004-10-08 16:14:42 +00:00
parent 39e3ea8232
commit 371ca0c7a5
3 changed files with 29 additions and 17 deletions

View File

@ -1357,7 +1357,7 @@ bfe_start(struct ifnet *ifp)
{
struct bfe_softc *sc;
struct mbuf *m_head = NULL;
int idx;
int idx, queued = 0;
sc = ifp->if_softc;
idx = sc->bfe_tx_prod;
@ -1393,6 +1393,8 @@ bfe_start(struct ifnet *ifp)
break;
}
queued++;
/*
* If there's a BPF listener, bounce a copy of this frame
* to him.
@ -1400,15 +1402,18 @@ bfe_start(struct ifnet *ifp)
BPF_MTAP(ifp, m_head);
}
sc->bfe_tx_prod = idx;
/* Transmit - twice due to apparent hardware bug */
CSR_WRITE_4(sc, BFE_DMATX_PTR, idx * sizeof(struct bfe_desc));
CSR_WRITE_4(sc, BFE_DMATX_PTR, idx * sizeof(struct bfe_desc));
if (queued) {
sc->bfe_tx_prod = idx;
/* Transmit - twice due to apparent hardware bug */
CSR_WRITE_4(sc, BFE_DMATX_PTR, idx * sizeof(struct bfe_desc));
CSR_WRITE_4(sc, BFE_DMATX_PTR, idx * sizeof(struct bfe_desc));
/*
* Set a timeout in case the chip goes out to lunch.
*/
ifp->if_timer = 5;
}
/*
* Set a timeout in case the chip goes out to lunch.
*/
ifp->if_timer = 5;
BFE_UNLOCK(sc);
}

View File

@ -1291,6 +1291,9 @@ ndis_start(ifp)
break;
}
if (pcnt == 0)
return;
if (sc->ndis_txpending == 0)
ifp->if_flags |= IFF_OACTIVE;

View File

@ -1954,7 +1954,7 @@ sis_start(ifp)
{
struct sis_softc *sc;
struct mbuf *m_head = NULL;
u_int32_t idx;
u_int32_t idx, queued = 0;
sc = ifp->if_softc;
SIS_LOCK(sc);
@ -1982,6 +1982,8 @@ sis_start(ifp)
break;
}
queued++;
/*
* If there's a BPF listener, bounce a copy of this frame
* to him.
@ -1990,14 +1992,16 @@ sis_start(ifp)
}
/* Transmit */
sc->sis_cdata.sis_tx_prod = idx;
SIS_SETBIT(sc, SIS_CSR, SIS_CSR_TX_ENABLE);
if (queued) {
/* Transmit */
sc->sis_cdata.sis_tx_prod = idx;
SIS_SETBIT(sc, SIS_CSR, SIS_CSR_TX_ENABLE);
/*
* Set a timeout in case the chip goes out to lunch.
*/
ifp->if_timer = 5;
/*
* Set a timeout in case the chip goes out to lunch.
*/
ifp->if_timer = 5;
}
SIS_UNLOCK(sc);