summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrad <brad@openbsd.org>2008-02-20 12:31:48 +0000
committerbrad <brad@openbsd.org>2008-02-20 12:31:48 +0000
commit77b2bcc28c1cd2966844cb0b47a251bbffabcdac (patch)
tree3e3839d52b144f2b30eaeee41173f0d6c29d1aec
parentWhen collecting the hardware statistics add the interfaces input errors (diff)
downloadwireguard-openbsd-77b2bcc28c1cd2966844cb0b47a251bbffabcdac.tar.xz
wireguard-openbsd-77b2bcc28c1cd2966844cb0b47a251bbffabcdac.zip
- Only clear the IFF_OACTIVE flag if packets were processed.
- Only clear the watchdog timer if there are no more packets to process otherwise rearm the timer. From mickey@ Tested by krw@, mikeb@ and brad@ ok dlg@
-rw-r--r--sys/dev/ic/fxp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/ic/fxp.c b/sys/dev/ic/fxp.c
index 7eeb8f9868c..899a863fbb1 100644
--- a/sys/dev/ic/fxp.c
+++ b/sys/dev/ic/fxp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fxp.c,v 1.89 2007/10/13 16:12:29 fgsch Exp $ */
+/* $OpenBSD: fxp.c,v 1.90 2008/02/20 12:31:48 brad Exp $ */
/* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */
/*
@@ -857,10 +857,12 @@ fxp_intr(void *arg)
FXP_TXCB_SYNC(sc, txs,
BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
}
- sc->sc_cbt_cons = txs;
sc->sc_cbt_cnt = txcnt;
- ifp->if_timer = 0;
- ifp->if_flags &= ~IFF_OACTIVE;
+ /* Did we transmit any packets? */
+ if (sc->sc_cbt_cons != txs)
+ ifp->if_flags &= ~IFF_OACTIVE;
+ ifp->if_timer = sc->sc_cbt_cnt ? 5 : 0;
+ sc->sc_cbt_cons = txs;
if (!IFQ_IS_EMPTY(&ifp->if_snd)) {
/*