From 9831767cbcd93023f3dd16d4ca22c1ec1d4b7b55 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Thu, 11 Sep 2008 03:21:04 +0000 Subject: 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 --- sys/dev/ic/dc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sys/dev/ic/dc.c') 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)) -- cgit v1.2.3