summaryrefslogtreecommitdiffstats
path: root/sys/dev/xl
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2009-04-21 00:42:11 +0000
committeryongari <yongari@FreeBSD.org>2009-04-21 00:42:11 +0000
commit5632a9bf6f8f6bef875d7600a9a69e26c1cf10c8 (patch)
treedb96126dc966cbd90ba03f225df3703852ed5aae /sys/dev/xl
parent7364df80c217f924e7ee7caaaf2afe9fcfd18f82 (diff)
downloadFreeBSD-src-5632a9bf6f8f6bef875d7600a9a69e26c1cf10c8.zip
FreeBSD-src-5632a9bf6f8f6bef875d7600a9a69e26c1cf10c8.tar.gz
To make it easy whether xl(4) missed Tx completion interrupt check
number of queued packets in watchdog timeout handler. If there are no queued packets just print a informational message and return without resetting controller. Also fix to invoke correct Tx completion handler as 3C905B needs different handler.
Diffstat (limited to 'sys/dev/xl')
-rw-r--r--sys/dev/xl/if_xl.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/sys/dev/xl/if_xl.c b/sys/dev/xl/if_xl.c
index 7938044..67e3bed 100644
--- a/sys/dev/xl/if_xl.c
+++ b/sys/dev/xl/if_xl.c
@@ -3211,12 +3211,31 @@ xl_watchdog(struct xl_softc *sc)
{
struct ifnet *ifp = sc->xl_ifp;
u_int16_t status = 0;
+ int misintr;
XL_LOCK_ASSERT(sc);
if (sc->xl_wdog_timer == 0 || --sc->xl_wdog_timer != 0)
return (0);
+ xl_rxeof(sc);
+ xl_txeoc(sc);
+ misintr = 0;
+ if (sc->xl_type == XL_TYPE_905B) {
+ xl_txeof_90xB(sc);
+ if (sc->xl_cdata.xl_tx_cnt == 0)
+ misintr++;
+ } else {
+ xl_txeof(sc);
+ if (sc->xl_cdata.xl_tx_head == NULL)
+ misintr++;
+ }
+ if (misintr != 0) {
+ device_printf(sc->xl_dev,
+ "watchdog timeout (missed Tx interrupts) -- recovering\n");
+ return (0);
+ }
+
ifp->if_oerrors++;
XL_SEL_WIN(4);
status = CSR_READ_2(sc, XL_W4_MEDIA_STATUS);
@@ -3226,9 +3245,6 @@ xl_watchdog(struct xl_softc *sc)
device_printf(sc->xl_dev,
"no carrier - transceiver cable problem?\n");
- xl_txeoc(sc);
- xl_txeof(sc);
- xl_rxeof(sc);
xl_reset(sc);
xl_init_locked(sc);
OpenPOWER on IntegriCloud