aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/agg-tx.c19
-rw-r--r--net/mac80211/sta_info.h6
2 files changed, 24 insertions, 1 deletions
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index e92f98d32746..76be61744198 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -392,6 +392,7 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
392#endif 392#endif
393 393
394 spin_lock_bh(&sta->lock); 394 spin_lock_bh(&sta->lock);
395 sta->ampdu_mlme.last_addba_req_time[tid] = jiffies;
395 sta->ampdu_mlme.addba_req_num[tid]++; 396 sta->ampdu_mlme.addba_req_num[tid]++;
396 spin_unlock_bh(&sta->lock); 397 spin_unlock_bh(&sta->lock);
397 398
@@ -492,6 +493,24 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
492 goto err_unlock_sta; 493 goto err_unlock_sta;
493 } 494 }
494 495
496 /*
497 * if we have tried more than HT_AGG_BURST_RETRIES times we
498 * will spread our requests in time to avoid stalling connection
499 * for too long
500 */
501 if (sta->ampdu_mlme.addba_req_num[tid] > HT_AGG_BURST_RETRIES &&
502 time_before(jiffies, sta->ampdu_mlme.last_addba_req_time[tid] +
503 HT_AGG_RETRIES_PERIOD)) {
504#ifdef CONFIG_MAC80211_HT_DEBUG
505 printk(KERN_DEBUG "BA request denied - "
506 "waiting a grace period after %d failed requests "
507 "on tid %u\n",
508 sta->ampdu_mlme.addba_req_num[tid], tid);
509#endif /* CONFIG_MAC80211_HT_DEBUG */
510 ret = -EBUSY;
511 goto err_unlock_sta;
512 }
513
495 tid_tx = rcu_dereference_protected_tid_tx(sta, tid); 514 tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
496 /* check if the TID is not in aggregation flow already */ 515 /* check if the TID is not in aggregation flow already */
497 if (tid_tx || sta->ampdu_mlme.tid_start_tx[tid]) { 516 if (tid_tx || sta->ampdu_mlme.tid_start_tx[tid]) {
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 15b3bb7d8629..dee284290464 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -83,7 +83,9 @@ enum ieee80211_sta_state {
83 83
84#define STA_TID_NUM 16 84#define STA_TID_NUM 16
85#define ADDBA_RESP_INTERVAL HZ 85#define ADDBA_RESP_INTERVAL HZ
86#define HT_AGG_MAX_RETRIES 0x3 86#define HT_AGG_MAX_RETRIES 15
87#define HT_AGG_BURST_RETRIES 3
88#define HT_AGG_RETRIES_PERIOD (15 * HZ)
87 89
88#define HT_AGG_STATE_DRV_READY 0 90#define HT_AGG_STATE_DRV_READY 0
89#define HT_AGG_STATE_RESPONSE_RECEIVED 1 91#define HT_AGG_STATE_RESPONSE_RECEIVED 1
@@ -179,6 +181,7 @@ struct tid_ampdu_rx {
179 * @tid_tx: aggregation info for Tx per TID 181 * @tid_tx: aggregation info for Tx per TID
180 * @tid_start_tx: sessions where start was requested 182 * @tid_start_tx: sessions where start was requested
181 * @addba_req_num: number of times addBA request has been sent. 183 * @addba_req_num: number of times addBA request has been sent.
184 * @last_addba_req_time: timestamp of the last addBA request.
182 * @dialog_token_allocator: dialog token enumerator for each new session; 185 * @dialog_token_allocator: dialog token enumerator for each new session;
183 * @work: work struct for starting/stopping aggregation 186 * @work: work struct for starting/stopping aggregation
184 * @tid_rx_timer_expired: bitmap indicating on which TIDs the 187 * @tid_rx_timer_expired: bitmap indicating on which TIDs the
@@ -198,6 +201,7 @@ struct sta_ampdu_mlme {
198 struct work_struct work; 201 struct work_struct work;
199 struct tid_ampdu_tx __rcu *tid_tx[STA_TID_NUM]; 202 struct tid_ampdu_tx __rcu *tid_tx[STA_TID_NUM];
200 struct tid_ampdu_tx *tid_start_tx[STA_TID_NUM]; 203 struct tid_ampdu_tx *tid_start_tx[STA_TID_NUM];
204 unsigned long last_addba_req_time[STA_TID_NUM];
201 u8 addba_req_num[STA_TID_NUM]; 205 u8 addba_req_num[STA_TID_NUM];
202 u8 dialog_token_allocator; 206 u8 dialog_token_allocator;
203}; 207};