diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2016-02-04 16:23:41 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2016-02-04 16:23:41 +0000 |
commit | d68465470ce1552380a05aae1afa28797addafed (patch) | |
tree | 3d44511a046adeb47100b3594092433ba49b58b1 | |
parent | 59e32784feed2d28029aee4a28d5bebc4014abec (diff) |
Restore the BlockAck session timer. It is still required to work around
stalled BA sessions observed with iwn(4). We can revisit this later once
the underlying problem in iwn(4) has been found.
Prompted by report from krw@, I could reproduce the issue.
ok krw@
-rw-r--r-- | sys/net80211/ieee80211_input.c | 18 | ||||
-rw-r--r-- | sys/net80211/ieee80211_node.h | 5 | ||||
-rw-r--r-- | sys/net80211/ieee80211_proto.c | 4 |
3 files changed, 15 insertions, 12 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 37bb13192f6..30dfbd0bb8a 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_input.c,v 1.155 2016/02/01 18:43:22 stsp Exp $ */ +/* $OpenBSD: ieee80211_input.c,v 1.156 2016/02/04 16:23:40 stsp Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe @@ -704,8 +704,7 @@ ieee80211_input_ba(struct ieee80211com *ic, struct mbuf *m, sn = letoh16(*(u_int16_t *)wh->i_seq) >> IEEE80211_SEQ_SEQ_SHIFT; /* reset Block Ack inactivity timer */ - if (ba->ba_timeout_val != 0) - timeout_add_usec(&ba->ba_to, ba->ba_timeout_val); + timeout_add_usec(&ba->ba_to, ba->ba_timeout_val); if (SEQ_LT(sn, ba->ba_winstart)) { /* SN < WinStartB */ ifp->if_ierrors++; @@ -2458,8 +2457,7 @@ ieee80211_recv_addba_req(struct ieee80211com *ic, struct mbuf *m, if (ba->ba_state == IEEE80211_BA_AGREED) { /* XXX should we update the timeout value? */ /* reset Block Ack inactivity timer */ - if (ba->ba_timeout_val != 0) - timeout_add_usec(&ba->ba_to, ba->ba_timeout_val); + timeout_add_usec(&ba->ba_to, ba->ba_timeout_val); /* check if it's a Protected Block Ack agreement */ if (!(ni->ni_flags & IEEE80211_NODE_MFP) || @@ -2496,6 +2494,10 @@ ieee80211_recv_addba_req(struct ieee80211com *ic, struct mbuf *m, /* setup Block Ack agreement */ ba->ba_state = IEEE80211_BA_INIT; ba->ba_timeout_val = timeout * IEEE80211_DUR_TU; + if (ba->ba_timeout_val < IEEE80211_BA_MIN_TIMEOUT) + ba->ba_timeout_val = IEEE80211_BA_MIN_TIMEOUT; + else if (ba->ba_timeout_val > IEEE80211_BA_MAX_TIMEOUT) + ba->ba_timeout_val = IEEE80211_BA_MAX_TIMEOUT; ba->ba_ni = ni; timeout_set(&ba->ba_to, ieee80211_rx_ba_timeout, ba); timeout_set(&ba->ba_gap_to, ieee80211_input_ba_gap_timeout, ba); @@ -2524,8 +2526,7 @@ ieee80211_recv_addba_req(struct ieee80211com *ic, struct mbuf *m, } ba->ba_state = IEEE80211_BA_AGREED; /* start Block Ack inactivity timer */ - if (ba->ba_timeout_val != 0) - timeout_add_usec(&ba->ba_to, ba->ba_timeout_val); + timeout_add_usec(&ba->ba_to, ba->ba_timeout_val); status = IEEE80211_STATUS_SUCCESS; resp: /* MLME-ADDBA.response */ @@ -2987,8 +2988,7 @@ ieee80211_bar_tid(struct ieee80211com *ic, struct ieee80211_node *ni, return; /* PBAC, do not move window */ } /* reset Block Ack inactivity timer */ - if (ba->ba_timeout_val != 0) - timeout_add_usec(&ba->ba_to, ba->ba_timeout_val); + timeout_add_usec(&ba->ba_to, ba->ba_timeout_val); if (SEQ_LT(ba->ba_winstart, ssn)) ieee80211_ba_move_window(ic, ni, tid, ssn); diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h index 2a3ec3ff7b9..f26304a39c4 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_node.h,v 1.54 2016/02/01 18:43:22 stsp Exp $ */ +/* $OpenBSD: ieee80211_node.h,v 1.55 2016/02/04 16:23:40 stsp Exp $ */ /* $NetBSD: ieee80211_node.h,v 1.9 2004/04/30 22:57:32 dyoung Exp $ */ /*- @@ -112,6 +112,9 @@ struct ieee80211_tx_ba { struct ieee80211_node *ba_ni; /* backpointer for callbacks */ struct timeout ba_to; int ba_timeout_val; +#define IEEE80211_BA_MIN_TIMEOUT (1000 * 1000) /* 1 sec */ +#define IEEE80211_BA_MAX_TIMEOUT (5000 * 1000) /* 5 sec */ + int ba_state; #define IEEE80211_BA_INIT 0 #define IEEE80211_BA_REQUESTED 1 diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index f469cecf710..d86ab5e4944 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_proto.c,v 1.61 2016/02/01 18:43:22 stsp Exp $ */ +/* $OpenBSD: ieee80211_proto.c,v 1.62 2016/02/04 16:23:40 stsp Exp $ */ /* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */ /*- @@ -641,7 +641,7 @@ ieee80211_addba_request(struct ieee80211com *ic, struct ieee80211_node *ni, /* setup Block Ack */ ba->ba_state = IEEE80211_BA_REQUESTED; ba->ba_token = ic->ic_dialog_token++; - ba->ba_timeout_val = 0; + ba->ba_timeout_val = IEEE80211_BA_MAX_TIMEOUT; timeout_set(&ba->ba_to, ieee80211_tx_ba_timeout, ba); ba->ba_winsize = IEEE80211_BA_MAX_WINSZ; ba->ba_winstart = ssn; |