diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2005-05-25 20:59:05 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2005-05-25 20:59:05 +0000 |
commit | cba32a4357c3de1a16bb839490d6ec43880bb1d8 (patch) | |
tree | 47575c3f2ee173082d3e9ab46eaf54d71ac3206e | |
parent | 8864d54939803f5c472b21b73056f2f8de3d31c2 (diff) |
- Fixed resetting of the watchdog timer and queue full flag.
- When reading PHY regs over the i2c bus, the turnaround ACK bit
is read one clock edge too late. This bit is driven low by
slave (as any other input data bits from slave) when the clock
is LOW. The current code did read the bit after the clock was
driven high again.
- Do not call mii_pollstat() from within device tick routines; the status
information is updated by mii_tick().
From FreeBSD
-rw-r--r-- | sys/dev/pci/if_nge.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sys/dev/pci/if_nge.c b/sys/dev/pci/if_nge.c index 2843103d67b..9c8e94feb36 100644 --- a/sys/dev/pci/if_nge.c +++ b/sys/dev/pci/if_nge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nge.c,v 1.32 2005/04/25 17:55:51 brad Exp $ */ +/* $OpenBSD: if_nge.c,v 1.33 2005/05/25 20:59:04 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 @@ -437,9 +437,9 @@ nge_mii_readreg(sc, frame) /* Check for ack */ SIO_CLR(NGE_MEAR_MII_CLK); DELAY(1); + ack = CSR_READ_4(sc, NGE_MEAR) & NGE_MEAR_MII_DATA; SIO_SET(NGE_MEAR_MII_CLK); DELAY(1); - ack = CSR_READ_4(sc, NGE_MEAR) & NGE_MEAR_MII_DATA; /* * Now try reading data bits. If the ack failed, we still @@ -1390,15 +1390,12 @@ void nge_txeof(sc) struct nge_softc *sc; { - struct nge_desc *cur_tx = NULL; + struct nge_desc *cur_tx; struct ifnet *ifp; u_int32_t idx; ifp = &sc->arpcom.ac_if; - /* Clear the timeout timer. */ - ifp->if_timer = 0; - /* * Go through our tx list and free mbufs for those * frames that have been transmitted. @@ -1431,17 +1428,17 @@ nge_txeof(sc) if (cur_tx->nge_mbuf != NULL) { m_freem(cur_tx->nge_mbuf); cur_tx->nge_mbuf = NULL; + ifp->if_flags &= ~IFF_OACTIVE; } sc->nge_cdata.nge_tx_cnt--; NGE_INC(idx, NGE_TX_LIST_CNT); - ifp->if_timer = 0; } sc->nge_cdata.nge_tx_cons = idx; - if (cur_tx != NULL) - ifp->if_flags &= ~IFF_OACTIVE; + if (idx == sc->nge_cdata.nge_tx_prod) + ifp->if_timer = 0; } void @@ -1508,7 +1505,6 @@ nge_tick(xsc) nge_start(ifp); } else { mii_tick(mii); - mii_pollstat(mii); if (mii->mii_media_status & IFM_ACTIVE && IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { sc->nge_link++; |