aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-02-10 15:25:54 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-13 13:45:48 -0500
commit849b7967818995a32c3017542e33eb3155944368 (patch)
treeafd0a98e50c3b9a851a2b46682f6a3767df2ca04
parentd75636ef9c1af224f1097941879d5a8db7cd04e5 (diff)
mac80211: further cleanups to stopping BA sessions
Essentially consisting of passing the sta_info pointer around, instead of repeatedly doing hash lookups. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--net/mac80211/agg-rx.c6
-rw-r--r--net/mac80211/agg-tx.c63
-rw-r--r--net/mac80211/ht.c9
-rw-r--r--net/mac80211/ieee80211_i.h5
4 files changed, 44 insertions, 39 deletions
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
index bb1f8740cbd5..3112bfd441b6 100644
--- a/net/mac80211/agg-rx.c
+++ b/net/mac80211/agg-rx.c
@@ -17,8 +17,8 @@
17#include <net/mac80211.h> 17#include <net/mac80211.h>
18#include "ieee80211_i.h" 18#include "ieee80211_i.h"
19 19
20static void __ieee80211_sta_stop_rx_ba_session(struct sta_info *sta, u16 tid, 20void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
21 u16 initiator, u16 reason) 21 u16 initiator, u16 reason)
22{ 22{
23 struct ieee80211_local *local = sta->local; 23 struct ieee80211_local *local = sta->local;
24 struct ieee80211_hw *hw = &local->hw; 24 struct ieee80211_hw *hw = &local->hw;
@@ -96,7 +96,7 @@ void ieee80211_sta_stop_rx_ba_session(struct ieee80211_sub_if_data *sdata, u8 *r
96 return; 96 return;
97 } 97 }
98 98
99 __ieee80211_sta_stop_rx_ba_session(sta, tid, initiator, reason); 99 __ieee80211_stop_rx_ba_session(sta, tid, initiator, reason);
100 100
101 rcu_read_unlock(); 101 rcu_read_unlock();
102} 102}
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index a49b76f61da3..1232d9f01ca9 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -123,10 +123,10 @@ void ieee80211_send_bar(struct ieee80211_sub_if_data *sdata, u8 *ra, u16 tid, u1
123 ieee80211_tx_skb(sdata, skb, 0); 123 ieee80211_tx_skb(sdata, skb, 0);
124} 124}
125 125
126static int __ieee80211_stop_tx_ba_session(struct ieee80211_local *local, 126static int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
127 struct sta_info *sta, u16 tid, 127 enum ieee80211_back_parties initiator)
128 enum ieee80211_back_parties initiator)
129{ 128{
129 struct ieee80211_local *local = sta->local;
130 int ret; 130 int ret;
131 u8 *state; 131 u8 *state;
132 132
@@ -165,7 +165,6 @@ static void sta_addba_resp_timer_expired(unsigned long data)
165 u16 tid = *(u8 *)data; 165 u16 tid = *(u8 *)data;
166 struct sta_info *sta = container_of((void *)data, 166 struct sta_info *sta = container_of((void *)data,
167 struct sta_info, timer_to_tid[tid]); 167 struct sta_info, timer_to_tid[tid]);
168 struct ieee80211_local *local = sta->local;
169 u8 *state; 168 u8 *state;
170 169
171 state = &sta->ampdu_mlme.tid_state_tx[tid]; 170 state = &sta->ampdu_mlme.tid_state_tx[tid];
@@ -186,7 +185,7 @@ static void sta_addba_resp_timer_expired(unsigned long data)
186 printk(KERN_DEBUG "addBA response timer expired on tid %d\n", tid); 185 printk(KERN_DEBUG "addBA response timer expired on tid %d\n", tid);
187#endif 186#endif
188 187
189 __ieee80211_stop_tx_ba_session(local, sta, tid, WLAN_BACK_INITIATOR); 188 ___ieee80211_stop_tx_ba_session(sta, tid, WLAN_BACK_INITIATOR);
190 spin_unlock_bh(&sta->lock); 189 spin_unlock_bh(&sta->lock);
191} 190}
192 191
@@ -427,6 +426,32 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw,
427} 426}
428EXPORT_SYMBOL(ieee80211_start_tx_ba_cb_irqsafe); 427EXPORT_SYMBOL(ieee80211_start_tx_ba_cb_irqsafe);
429 428
429int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
430 enum ieee80211_back_parties initiator)
431{
432 u8 *state;
433 int ret;
434
435 /* check if the TID is in aggregation */
436 state = &sta->ampdu_mlme.tid_state_tx[tid];
437 spin_lock_bh(&sta->lock);
438
439 if (*state != HT_AGG_STATE_OPERATIONAL) {
440 ret = -ENOENT;
441 goto unlock;
442 }
443
444#ifdef CONFIG_MAC80211_HT_DEBUG
445 printk(KERN_DEBUG "Tx BA session stop requested for %pM tid %u\n",
446 sta->sta.addr, tid);
447#endif /* CONFIG_MAC80211_HT_DEBUG */
448
449 ret = ___ieee80211_stop_tx_ba_session(sta, tid, initiator);
450
451 unlock:
452 spin_unlock_bh(&sta->lock);
453 return ret;
454}
430 455
431int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw, 456int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw,
432 u8 *ra, u16 tid, 457 u8 *ra, u16 tid,
@@ -434,7 +459,6 @@ int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw,
434{ 459{
435 struct ieee80211_local *local = hw_to_local(hw); 460 struct ieee80211_local *local = hw_to_local(hw);
436 struct sta_info *sta; 461 struct sta_info *sta;
437 u8 *state;
438 int ret = 0; 462 int ret = 0;
439 463
440 if (WARN_ON(!local->ops->ampdu_action)) 464 if (WARN_ON(!local->ops->ampdu_action))
@@ -450,27 +474,8 @@ int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw,
450 return -ENOENT; 474 return -ENOENT;
451 } 475 }
452 476
453 /* check if the TID is in aggregation */ 477 ret = __ieee80211_stop_tx_ba_session(sta, tid, initiator);
454 state = &sta->ampdu_mlme.tid_state_tx[tid];
455 spin_lock_bh(&sta->lock);
456
457 if (*state != HT_AGG_STATE_OPERATIONAL) {
458 ret = -ENOENT;
459 goto unlock;
460 }
461
462#ifdef CONFIG_MAC80211_HT_DEBUG
463 printk(KERN_DEBUG "Tx BA session stop requested for %pM tid %u\n",
464 ra, tid);
465#endif /* CONFIG_MAC80211_HT_DEBUG */
466
467 ret = __ieee80211_stop_tx_ba_session(local, sta, tid, initiator);
468
469 unlock:
470 spin_unlock_bh(&sta->lock);
471
472 rcu_read_unlock(); 478 rcu_read_unlock();
473
474 return ret; 479 return ret;
475} 480}
476EXPORT_SYMBOL(ieee80211_stop_tx_ba_session); 481EXPORT_SYMBOL(ieee80211_stop_tx_ba_session);
@@ -623,11 +628,9 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
623#ifdef CONFIG_MAC80211_HT_DEBUG 628#ifdef CONFIG_MAC80211_HT_DEBUG
624 printk(KERN_DEBUG "Resuming TX aggregation for tid %d\n", tid); 629 printk(KERN_DEBUG "Resuming TX aggregation for tid %d\n", tid);
625#endif /* CONFIG_MAC80211_HT_DEBUG */ 630#endif /* CONFIG_MAC80211_HT_DEBUG */
626 spin_unlock_bh(&sta->lock);
627 } else { 631 } else {
628 sta->ampdu_mlme.addba_req_num[tid]++; 632 sta->ampdu_mlme.addba_req_num[tid]++;
629 __ieee80211_stop_tx_ba_session(local, sta, tid, 633 ___ieee80211_stop_tx_ba_session(sta, tid, WLAN_BACK_INITIATOR);
630 WLAN_BACK_INITIATOR);
631 spin_unlock_bh(&sta->lock);
632 } 634 }
635 spin_unlock_bh(&sta->lock);
633} 636}
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index 1b503f3cc54c..82ea0b63a386 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -155,15 +155,12 @@ u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata,
155 155
156void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta) 156void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta)
157{ 157{
158 struct ieee80211_local *local = sta->local;
159 int i; 158 int i;
160 159
161 for (i = 0; i < STA_TID_NUM; i++) { 160 for (i = 0; i < STA_TID_NUM; i++) {
162 ieee80211_stop_tx_ba_session(&local->hw, sta->sta.addr, i, 161 __ieee80211_stop_tx_ba_session(sta, i, WLAN_BACK_INITIATOR);
163 WLAN_BACK_INITIATOR); 162 __ieee80211_stop_rx_ba_session(sta, i, WLAN_BACK_RECIPIENT,
164 ieee80211_sta_stop_rx_ba_session(sta->sdata, sta->sta.addr, i, 163 WLAN_REASON_QSTA_LEAVE_QBSS);
165 WLAN_BACK_RECIPIENT,
166 WLAN_REASON_QSTA_LEAVE_QBSS);
167 } 164 }
168} 165}
169 166
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index c6858ecde312..9122416fd6af 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -993,6 +993,8 @@ void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
993 993
994void ieee80211_sta_stop_rx_ba_session(struct ieee80211_sub_if_data *sdata, u8 *da, 994void ieee80211_sta_stop_rx_ba_session(struct ieee80211_sub_if_data *sdata, u8 *da,
995 u16 tid, u16 initiator, u16 reason); 995 u16 tid, u16 initiator, u16 reason);
996void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
997 u16 initiator, u16 reason);
996void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta); 998void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta);
997void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata, 999void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata,
998 struct sta_info *sta, 1000 struct sta_info *sta,
@@ -1006,6 +1008,9 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
1006 struct ieee80211_mgmt *mgmt, 1008 struct ieee80211_mgmt *mgmt,
1007 size_t len); 1009 size_t len);
1008 1010
1011int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
1012 enum ieee80211_back_parties initiator);
1013
1009/* Spectrum management */ 1014/* Spectrum management */
1010void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata, 1015void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
1011 struct ieee80211_mgmt *mgmt, 1016 struct ieee80211_mgmt *mgmt,