From c32293b2947d8d6487936cf76a924f401ce9517b Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Mon, 8 Feb 2016 01:00:48 +0000 Subject: Stop requiring a BlockAck session timeout (again), and just use it if the AP is asking for it. This timeout should not be required anymore now that krw@'s hangs are fixed by working around APs which make sequence numbers jump about. --- sys/net80211/ieee80211_input.c | 18 +++++++++--------- sys/net80211/ieee80211_node.h | 5 +---- sys/net80211/ieee80211_proto.c | 4 ++-- 3 files changed, 12 insertions(+), 15 deletions(-) (limited to 'sys/net80211') diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 752774837b2..e46c5135fef 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_input.c,v 1.160 2016/02/08 00:54:57 stsp Exp $ */ +/* $OpenBSD: ieee80211_input.c,v 1.161 2016/02/08 01:00:47 stsp Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe @@ -704,7 +704,8 @@ 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 */ - timeout_add_usec(&ba->ba_to, ba->ba_timeout_val); + if (ba->ba_timeout_val != 0) + timeout_add_usec(&ba->ba_to, ba->ba_timeout_val); if (SEQ_LT(sn, ba->ba_winstart)) { /* SN < WinStartB */ ic->ic_stats.is_rx_dup++; @@ -2488,7 +2489,8 @@ 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 */ - timeout_add_usec(&ba->ba_to, ba->ba_timeout_val); + if (ba->ba_timeout_val != 0) + 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) || @@ -2525,10 +2527,6 @@ 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); @@ -2560,7 +2558,8 @@ ieee80211_recv_addba_req(struct ieee80211com *ic, struct mbuf *m, } ba->ba_state = IEEE80211_BA_AGREED; /* start Block Ack inactivity timer */ - timeout_add_usec(&ba->ba_to, ba->ba_timeout_val); + if (ba->ba_timeout_val != 0) + timeout_add_usec(&ba->ba_to, ba->ba_timeout_val); status = IEEE80211_STATUS_SUCCESS; resp: /* MLME-ADDBA.response */ @@ -3022,7 +3021,8 @@ ieee80211_bar_tid(struct ieee80211com *ic, struct ieee80211_node *ni, return; /* PBAC, do not move window */ } /* reset Block Ack inactivity timer */ - timeout_add_usec(&ba->ba_to, ba->ba_timeout_val); + if (ba->ba_timeout_val != 0) + 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 ee2ae728cfb..77d5bafe1a5 100644 --- a/sys/net80211/ieee80211_node.h +++ b/sys/net80211/ieee80211_node.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_node.h,v 1.57 2016/02/08 00:54:57 stsp Exp $ */ +/* $OpenBSD: ieee80211_node.h,v 1.58 2016/02/08 01:00:47 stsp Exp $ */ /* $NetBSD: ieee80211_node.h,v 1.9 2004/04/30 22:57:32 dyoung Exp $ */ /*- @@ -112,9 +112,6 @@ 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 a812551ca31..2d27eca691c 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_proto.c,v 1.63 2016/02/05 16:07:57 stsp Exp $ */ +/* $OpenBSD: ieee80211_proto.c,v 1.64 2016/02/08 01:00:47 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 = IEEE80211_BA_MAX_TIMEOUT; + ba->ba_timeout_val = 0; timeout_set(&ba->ba_to, ieee80211_tx_ba_timeout, ba); ba->ba_winsize = IEEE80211_BA_MAX_WINSZ; ba->ba_winstart = ssn; -- cgit v1.2.3