summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2006-08-15 12:06:14 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2006-08-15 12:06:14 +0000
commit8550ecd7b76f1088fe9d0fb9ada953576a40ce3f (patch)
tree71c440014e3646243c7293205c19cf88e631f1d3 /sys
parentb6c71ea1e53a33c1e3428dc37b37d11d187ce716 (diff)
Improve watchdog handler.
ok jsg@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/acx.c31
-rw-r--r--sys/dev/ic/acxvar.h3
2 files changed, 27 insertions, 7 deletions
diff --git a/sys/dev/ic/acx.c b/sys/dev/ic/acx.c
index b3b13407f65..a7c95f57732 100644
--- a/sys/dev/ic/acx.c
+++ b/sys/dev/ic/acx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acx.c,v 1.41 2006/08/14 23:13:28 mglocker Exp $ */
+/* $OpenBSD: acx.c,v 1.42 2006/08/15 12:06:13 mglocker Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
@@ -1040,16 +1040,34 @@ acx_start(struct ifnet *ifp)
ifp->if_flags |= IFF_OACTIVE;
if (trans && ifp->if_timer == 0)
- ifp->if_timer = 5;
+ ifp->if_timer = 1;
+ sc->sc_txtimer = 5;
}
void
acx_watchdog(struct ifnet *ifp)
{
- printf("%s: watchdog timeout\n", ifp->if_xname);
- acx_txeof(ifp->if_softc);
+ struct acx_softc *sc = ifp->if_softc;
+
+ DPRINTF(("%s: watchdog\n", ifp->if_xname));
+
+ ifp->if_timer = 0;
+
+ if ((ifp->if_flags & IFF_RUNNING) == 0)
+ return;
+
+ if (sc->sc_txtimer) {
+ if (--sc->sc_txtimer == 0) {
+ printf("%s: watchdog timeout\n", ifp->if_xname);
+ acx_stop(ifp->if_softc);
+ acx_init(ifp->if_softc);
+ ifp->if_oerrors++;
+ return;
+ }
+ ifp->if_timer = 1;
+ }
- /* TODO */
+ ieee80211_watchdog(ifp);
}
int
@@ -1152,7 +1170,8 @@ acx_txeof(struct acx_softc *sc)
}
bd->tx_used_start = idx;
- ifp->if_timer = bd->tx_used_count == 0 ? 0 : 5;
+ ifp->if_timer = bd->tx_used_count == 0 ? 0 : 1;
+ sc->sc_txtimer = 0;
if (bd->tx_used_count != ACX_TX_DESC_CNT) {
ifp->if_flags &= ~IFF_OACTIVE;
diff --git a/sys/dev/ic/acxvar.h b/sys/dev/ic/acxvar.h
index 0a6720e2dfc..f74e2f100fa 100644
--- a/sys/dev/ic/acxvar.h
+++ b/sys/dev/ic/acxvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: acxvar.h,v 1.11 2006/08/12 10:30:15 mglocker Exp $ */
+/* $OpenBSD: acxvar.h,v 1.12 2006/08/15 12:06:13 mglocker Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
@@ -432,6 +432,7 @@ struct acx_softc {
int sc_txrate_upd_intvl_min;
int sc_txrate_upd_intvl_max;
int sc_txrate_sample_thresh;
+ int sc_txtimer;
int sc_long_retry_limit;
int sc_short_retry_limit;
int sc_msdu_lifetime;