From 4d04c16b434c419b8b5e82fce5ba284ef9d5b2a1 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Wed, 3 Sep 2008 19:29:49 +0000 Subject: In dc_setcfg() suppress printing a warning when forcing the receiver and transmitter to idle state times out for chips where the status bits in question never change (observed in detail with DM9102A) and therefore the warning would highly likely be a false positive. From FreeBSD --- sys/dev/ic/dc.c | 15 +++++++++++---- sys/dev/ic/dcreg.h | 6 +++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c index 7686db16fce..366fb99ce4c 100644 --- a/sys/dev/ic/dc.c +++ b/sys/dev/ic/dc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dc.c,v 1.99 2007/11/26 17:45:14 brad Exp $ */ +/* $OpenBSD: dc.c,v 1.100 2008/09/03 19:29:48 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -1264,9 +1264,16 @@ dc_setcfg(sc, media) DELAY(10); } - if (i == DC_TIMEOUT) - printf("%s: failed to force tx and " - "rx to idle state\n", sc->sc_dev.dv_xname); + if (i == DC_TIMEOUT) { + if (!(isr & DC_ISR_TX_IDLE) && !DC_IS_ASIX(sc)) + printf("%s: failed to force tx to idle state\n", + sc->sc_dev.dv_xname); + if (!((isr & DC_ISR_RX_STATE) == DC_RXSTATE_STOPPED || + (isr & DC_ISR_RX_STATE) == DC_RXSTATE_WAIT) && + !DC_HAS_BROKEN_RXSTATE(sc)) + printf("%s: failed to force rx to idle state\n", + sc->sc_dev.dv_xname); + } } if (IFM_SUBTYPE(media) == IFM_100_TX) { diff --git a/sys/dev/ic/dcreg.h b/sys/dev/ic/dcreg.h index 94938182f44..d86887ea2f7 100644 --- a/sys/dev/ic/dcreg.h +++ b/sys/dev/ic/dcreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dcreg.h,v 1.43 2008/07/21 04:12:21 kevlo Exp $ */ +/* $OpenBSD: dcreg.h,v 1.44 2008/09/03 19:29:48 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -195,6 +195,10 @@ #define DC_RXSTATE_FLUSH 0x000C0000 /* 110 - flush from FIFO */ #define DC_RXSTATE_DEQUEUE 0x000E0000 /* 111 - dequeue from FIFO */ +#define DC_HAS_BROKEN_RXSTATE(x) \ + (DC_IS_CENTAUR(x) || DC_IS_CONEXANT(x) || (DC_IS_DAVICOM(x) && \ + sc->dc_revision >= DC_REVISION_DM9102A)) + #define DC_TXSTATE_RESET 0x00000000 /* 000 - reset */ #define DC_TXSTATE_FETCH 0x00100000 /* 001 - fetching descriptor */ #define DC_TXSTATE_WAITEND 0x00200000 /* 010 - wait for tx end */ -- cgit v1.2.3