diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2004-11-28 02:11:00 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2004-11-28 02:11:00 +0000 |
commit | 8a574ceecdddb14c9d84a0b506f2c7413ec744b2 (patch) | |
tree | fab20d62c68e54c9bf3063822dce0f2b37dc9c99 /sys/dev/ic | |
parent | 01767a7d6ddf4a9cbb005cde19ee420b52d1ddcb (diff) |
rev 1.74
Fix if_timer logic to make sure that there is always a timeout
pending if there are packets queued for transmission.
From FreeBSD
ok deraadt@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/dc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c index ad5ba5b7c51..9d56875cee3 100644 --- a/sys/dev/ic/dc.c +++ b/sys/dev/ic/dc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dc.c,v 1.74 2004/11/16 14:26:21 brad Exp $ */ +/* $OpenBSD: dc.c,v 1.75 2004/11/28 02:10:59 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -2229,9 +2229,6 @@ dc_txeof(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 transmitted. @@ -2253,7 +2250,6 @@ dc_txeof(sc) if (!(cur_tx->dc_ctl & htole32(DC_TXCTL_LASTFRAG)) || cur_tx->dc_ctl & htole32(DC_TXCTL_SETUP)) { - sc->dc_cdata.dc_tx_cnt--; if (cur_tx->dc_ctl & htole32(DC_TXCTL_SETUP)) { /* * Yes, the PNIC is so brain damaged @@ -2270,6 +2266,7 @@ dc_txeof(sc) } sc->dc_cdata.dc_tx_chain[idx].sd_mbuf = NULL; } + sc->dc_cdata.dc_tx_cnt--; DC_INC(idx, DC_TX_LIST_CNT); continue; } @@ -2331,9 +2328,12 @@ dc_txeof(sc) DC_INC(idx, DC_TX_LIST_CNT); } - sc->dc_cdata.dc_tx_cons = idx; - if (cur_tx != NULL) + if (idx != sc->dc_cdata.dc_tx_cons) { + /* some buffers have been freed */ + sc->dc_cdata.dc_tx_cons = idx; ifp->if_flags &= ~IFF_OACTIVE; + } + ifp->if_timer = (sc->dc_cdata.dc_tx_cnt == 0) ? 0 : 5; } void |