diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2008-02-27 20:05:52 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2008-02-27 20:05:52 +0000 |
commit | 83cd7a0a02dd33fd1d1cb21795576dbe9ad13b17 (patch) | |
tree | 70a6fb4677fc325cc30175d91293af17e3b48f62 /sys/dev | |
parent | 83e35f379b54178770bc8a85dfd871d99cdad24d (diff) |
Correct the watchdog timer by moving it out from under the condition check
for the IFF_OACTIVE flag.
Tested by brad@, johan@, krw@, wilfried@
From mickey
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_em.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c index 0e57fac779d..daf810c18fd 100644 --- a/sys/dev/pci/if_em.c +++ b/sys/dev/pci/if_em.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_em.c,v 1.177 2008/02/20 00:00:06 brad Exp $ */ +/* $OpenBSD: if_em.c,v 1.178 2008/02/27 20:05:51 brad Exp $ */ /* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */ #include <dev/pci/if_em.h> @@ -2215,15 +2215,16 @@ em_txeof(struct em_softc *sc) * If there are no pending descriptors, clear the timeout. Otherwise, * if some descriptors have been freed, restart the timeout. */ - if (num_avail > EM_TX_CLEANUP_THRESHOLD) { + if (num_avail > EM_TX_CLEANUP_THRESHOLD) ifp->if_flags &= ~IFF_OACTIVE; - /* All clean, turn off the timer */ - if (num_avail == sc->num_tx_desc) - ifp->if_timer = 0; - /* Some cleaned, reset the timer */ - else if (num_avail != sc->num_tx_desc_avail) - ifp->if_timer = EM_TX_TIMEOUT; - } + + /* All clean, turn off the timer */ + if (num_avail == sc->num_tx_desc) + ifp->if_timer = 0; + /* Some cleaned, reset the timer */ + else if (num_avail != sc->num_tx_desc_avail) + ifp->if_timer = EM_TX_TIMEOUT; + sc->num_tx_desc_avail = num_avail; } |