summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-04-29 06:55:46 +0000
committerimp <imp@FreeBSD.org>2002-04-29 06:55:46 +0000
commit9e268405661ecd7735e088325129da32fd8546f6 (patch)
tree3fde033139848700582533873aa2d4efaa1866c0
parentb8edad4923164ceeaa0858c3084c662787e4450c (diff)
downloadFreeBSD-src-9e268405661ecd7735e088325129da32fd8546f6.zip
FreeBSD-src-9e268405661ecd7735e088325129da32fd8546f6.tar.gz
Untimeout before calling timeout. I think that I have caught all the cases
where we were scheduling a timeout multiple times, but am not positive.
-rw-r--r--sys/dev/wi/if_wi.c2
-rw-r--r--sys/dev/wi/wi_hostap.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index 07333fe..26b57d9 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -61,7 +61,9 @@
#include <sys/param.h>
#include <sys/systm.h>
+#if __FreeBSD_version >= 500033
#include <sys/endian.h>
+#endif
#include <sys/sockio.h>
#include <sys/mbuf.h>
#include <sys/proc.h>
diff --git a/sys/dev/wi/wi_hostap.c b/sys/dev/wi/wi_hostap.c
index 77efd0f..bf1b06f 100644
--- a/sys/dev/wi/wi_hostap.c
+++ b/sys/dev/wi/wi_hostap.c
@@ -40,7 +40,9 @@
#include <sys/param.h>
#include <sys/systm.h>
+#if __FreeBSD_version >= 500033
#include <sys/endian.h>
+#endif
#include <sys/sockio.h>
#include <sys/mbuf.h>
#include <sys/malloc.h>
@@ -429,7 +431,6 @@ wihap_sta_alloc(struct wi_softc *sc, u_int8_t *addr)
sta->sc = sc;
whi->n_stations++;
bcopy(addr, &sta->addr, ETHER_ADDR_LEN);
- sta->inactivity_timer = whi->inactivity_time;
return(sta);
}
@@ -553,7 +554,6 @@ wihap_auth_req(struct wi_softc *sc, struct wi_frame *rxfrm,
goto fail;
}
}
- sta->inactivity_timer = whi->inactivity_time;
/* Note: it's okay to leave the station info structure around
* if the authen fails. It'll be timed out eventually.
@@ -987,7 +987,7 @@ wihap_sta_is_assoc(struct wihap_info *whi, u_int8_t addr[])
sta = wihap_sta_find(whi, addr);
if (sta != NULL && (sta->flags & WI_SIFLAGS_ASSOC)) {
/* Keep it active. */
- sta->inactivity_timer = whi->inactivity_time;
+ untimeout(wihap_sta_timeout, sta, sta->tmo);
sta->tmo = timeout(wihap_sta_timeout, sta,
hz * whi->inactivity_time);
return(1);
@@ -1016,6 +1016,7 @@ wihap_check_tx(struct wihap_info *whi, u_int8_t addr[], u_int8_t *txrate)
sta = wihap_sta_find(whi, addr);
if (sta != NULL && (sta->flags & WI_SIFLAGS_ASSOC)) {
/* Keep it active. */
+ untimeout(wihap_sta_timeout, sta, sta->tmo);
sta->tmo = timeout(wihap_sta_timeout, sta,
hz * whi->inactivity_time);
*txrate = txratetable[ sta->tx_curr_rate ];
@@ -1078,6 +1079,7 @@ wihap_data_input(struct wi_softc *sc, struct wi_frame *rxfrm, struct mbuf *m)
return(1);
}
+ untimeout(wihap_sta_timeout, sta, sta->tmo);
sta->tmo = timeout(wihap_sta_timeout, sta,
hz * whi->inactivity_time);
sta->sig_info = le16toh(rxfrm->wi_q_info);
OpenPOWER on IntegriCloud