summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2002-06-30 22:05:46 +0000
committerluigi <luigi@FreeBSD.org>2002-06-30 22:05:46 +0000
commitaf57fcc7716390be1b44583d20c263e9e7099d0d (patch)
treee8fece8a6fba32041b216e263fe45fdd78ff62ab /sys/pci
parente34ef2877bee4cc1dd4c0c6702add67b8c81c6a0 (diff)
downloadFreeBSD-src-af57fcc7716390be1b44583d20c263e9e7099d0d.zip
FreeBSD-src-af57fcc7716390be1b44583d20c263e9e7099d0d.tar.gz
Fix if_timer logic to make sure that there is always a timeout
pending if there are packets queued for transmission. MFC after: 3 days
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_dc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c
index 189835c..7c55346 100644
--- a/sys/pci/if_dc.c
+++ b/sys/pci/if_dc.c
@@ -2593,9 +2593,6 @@ static void dc_txeof(sc)
ifp = &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.
@@ -2612,7 +2609,6 @@ static void dc_txeof(sc)
if (!(cur_tx->dc_ctl & DC_TXCTL_LASTFRAG) ||
cur_tx->dc_ctl & DC_TXCTL_SETUP) {
- sc->dc_cdata.dc_tx_cnt--;
if (cur_tx->dc_ctl & DC_TXCTL_SETUP) {
/*
* Yes, the PNIC is so brain damaged
@@ -2629,6 +2625,7 @@ static void dc_txeof(sc)
}
sc->dc_cdata.dc_tx_chain[idx] = NULL;
}
+ sc->dc_cdata.dc_tx_cnt--;
DC_INC(idx, DC_TX_LIST_CNT);
continue;
}
@@ -2679,9 +2676,12 @@ static void 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;
return;
}
OpenPOWER on IntegriCloud