diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2008-09-11 03:21:04 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2008-09-11 03:21:04 +0000 |
commit | 9831767cbcd93023f3dd16d4ca22c1ec1d4b7b55 (patch) | |
tree | ae101f8d590a6aa211d541f309bc402325c4b2b9 /sys/dev | |
parent | ac6b1f04febeebbe4ac8525f8a3d3666400fc546 (diff) |
For chips with a broken DC_ISR_RX_STATE which never signals
stopped nor the waiting state and also no other means to check
whether the receiver is idle, we have no choice but to call
mii_tick unconditionally even in the case of the DC_REDUCED_MII_POLL
handling as far as the RX side is concerned. This isn't necessarily
worse than checking whether RX is idle though because unlike as
with TX we're racing with the hardware, which might receive packets
any time while we poll the MII, anyway. Fixes the use of trunk(4)
with the affected interfaces.
From FreeBSD
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/dc.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c index 366fb99ce4c..df4dc9496e9 100644 --- a/sys/dev/ic/dc.c +++ b/sys/dev/ic/dc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dc.c,v 1.100 2008/09/03 19:29:48 brad Exp $ */ +/* $OpenBSD: dc.c,v 1.101 2008/09/11 03:21:03 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -2417,8 +2417,12 @@ dc_tick(xsc) if (sc->dc_link == 0) mii_tick(mii); } else { - r = CSR_READ_4(sc, DC_ISR); - if ((r & DC_ISR_RX_STATE) == DC_RXSTATE_WAIT && + /* + * For NICs which never report DC_RXSTATE_WAIT, we + * have to bite the bullet... + */ + if ((DC_HAS_BROKEN_RXSTATE(sc) || (CSR_READ_4(sc, + DC_ISR) & DC_ISR_RX_STATE) == DC_RXSTATE_WAIT) && sc->dc_cdata.dc_tx_cnt == 0 && !DC_IS_ASIX(sc)) { mii_tick(mii); if (!(mii->mii_media_status & IFM_ACTIVE)) |