From f8b255476f6c6d013579f50dcf806de119c80ef9 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Wed, 19 Nov 2008 08:20:02 +0000 Subject: 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. --- sys/dev/ic/xl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys') 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; } /* -- cgit v1.2.3