summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2008-11-19 08:20:02 +0000
committerBrad Smith <brad@cvs.openbsd.org>2008-11-19 08:20:02 +0000
commitf8b255476f6c6d013579f50dcf806de119c80ef9 (patch)
treec2c8ec762bc91e55871651daa15815b225b56833
parent36f33930903a23c45fdaf1ab5035b71d04e8c526 (diff)
Make sure to check that the TX queue is empty before clearing the
watchdog timer. From FreeBSD Tested on quite a few 3c905/B/C/575 adapters.
-rw-r--r--sys/dev/ic/xl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/ic/xl.c b/sys/dev/ic/xl.c
index 05ba76ceac1..a1f4f0a030a 100644
--- a/sys/dev/ic/xl.c
+++ b/sys/dev/ic/xl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xl.c,v 1.83 2008/11/19 08:17:37 brad Exp $ */
+/* $OpenBSD: xl.c,v 1.84 2008/11/19 08:20:01 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -1321,9 +1321,6 @@ xl_txeof(struct xl_softc *sc)
ifp = &sc->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 uploaded. Note: the 3c905B
@@ -1363,6 +1360,8 @@ xl_txeof(struct xl_softc *sc)
if (sc->xl_cdata.xl_tx_head == NULL) {
ifp->if_flags &= ~IFF_OACTIVE;
+ /* Clear the timeout timer. */
+ ifp->if_timer = 0;
sc->xl_cdata.xl_tx_tail = NULL;
} else {
if (CSR_READ_4(sc, XL_DMACTL) & XL_DMACTL_DOWN_STALLED ||
@@ -1409,13 +1408,14 @@ xl_txeof_90xB(struct xl_softc *sc)
sc->xl_cdata.xl_tx_cnt--;
XL_INC(idx, XL_TX_LIST_CNT);
- ifp->if_timer = 0;
}
sc->xl_cdata.xl_tx_cons = idx;
if (cur_tx != NULL)
ifp->if_flags &= ~IFF_OACTIVE;
+ if (sc->xl_cdata.xl_tx_cnt == 0)
+ ifp->if_timer = 0;
}
/*