Count how many frames driver lost in interrupt handler. This

register is cleared on read so make sure to clear it in driver
initialization phase.
This commit is contained in:
yongari 2011-02-19 03:01:24 +00:00
parent a3d06d520a
commit 1bd7efaa29

View File

@ -3250,7 +3250,7 @@ dc_intr(void *arg)
{
struct dc_softc *sc;
struct ifnet *ifp;
u_int32_t status;
u_int32_t r, status;
int curpkts, n;
sc = arg;
@ -3305,6 +3305,8 @@ dc_intr(void *arg)
if ((status & DC_ISR_RX_WATDOGTIMEO)
|| (status & DC_ISR_RX_NOBUF)) {
r = CSR_READ_4(sc, DC_FRAMESDISCARDED);
ifp->if_ierrors += (r & 0xffff) + ((r >> 17) & 0x7ff);
curpkts = ifp->if_ipackets;
dc_rxeof(sc);
if (curpkts == ifp->if_ipackets) {
@ -3723,6 +3725,9 @@ dc_init_locked(struct dc_softc *sc)
mii_mediachg(mii);
dc_setcfg(sc, sc->dc_if_media);
/* Clear missed frames and overflow counter. */
CSR_READ_4(sc, DC_FRAMESDISCARDED);
/* Don't start the ticker if this is a homePNA link. */
if (IFM_SUBTYPE(mii->mii_media.ifm_media) == IFM_HPNA_1)
sc->dc_link = 1;