aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-06-10 04:21:43 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-14 15:39:27 -0400
commit67c282c00c9c06733aae229662d209957f6d23a7 (patch)
tree698270941e46c873e2c34fda0428ea457cd1926b /net
parent0ab337032a0dfcd5f2527d3306d3deeba5f95b59 (diff)
mac80211: move BA session work
Move the block-ack session works into common code, since it will be needed for RX agg too in the next patches. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/agg-tx.c39
-rw-r--r--net/mac80211/ht.c32
-rw-r--r--net/mac80211/ieee80211_i.h5
-rw-r--r--net/mac80211/sta_info.c2
4 files changed, 40 insertions, 38 deletions
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index ee8bfe18b488..9a00a79a868b 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -133,9 +133,8 @@ static void kfree_tid_tx(struct rcu_head *rcu_head)
133 kfree(tid_tx); 133 kfree(tid_tx);
134} 134}
135 135
136static int ___ieee80211_stop_tx_ba_session( 136int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
137 struct sta_info *sta, u16 tid, 137 enum ieee80211_back_parties initiator)
138 enum ieee80211_back_parties initiator)
139{ 138{
140 struct ieee80211_local *local = sta->local; 139 struct ieee80211_local *local = sta->local;
141 struct tid_ampdu_tx *tid_tx = sta->ampdu_mlme.tid_tx[tid]; 140 struct tid_ampdu_tx *tid_tx = sta->ampdu_mlme.tid_tx[tid];
@@ -262,7 +261,7 @@ ieee80211_wake_queue_agg(struct ieee80211_local *local, int tid)
262 __release(agg_queue); 261 __release(agg_queue);
263} 262}
264 263
265static void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid) 264void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
266{ 265{
267 struct tid_ampdu_tx *tid_tx = sta->ampdu_mlme.tid_tx[tid]; 266 struct tid_ampdu_tx *tid_tx = sta->ampdu_mlme.tid_tx[tid];
268 struct ieee80211_local *local = sta->local; 267 struct ieee80211_local *local = sta->local;
@@ -318,38 +317,6 @@ static void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
318 0x40, 5000); 317 0x40, 5000);
319} 318}
320 319
321void ieee80211_tx_ba_session_work(struct work_struct *work)
322{
323 struct sta_info *sta =
324 container_of(work, struct sta_info, ampdu_mlme.work);
325 struct tid_ampdu_tx *tid_tx;
326 int tid;
327
328 /*
329 * When this flag is set, new sessions should be
330 * blocked, and existing sessions will be torn
331 * down by the code that set the flag, so this
332 * need not run.
333 */
334 if (test_sta_flags(sta, WLAN_STA_BLOCK_BA))
335 return;
336
337 spin_lock_bh(&sta->lock);
338 for (tid = 0; tid < STA_TID_NUM; tid++) {
339 tid_tx = sta->ampdu_mlme.tid_tx[tid];
340 if (!tid_tx)
341 continue;
342
343 if (test_bit(HT_AGG_STATE_WANT_START, &tid_tx->state))
344 ieee80211_tx_ba_session_handle_start(sta, tid);
345 else if (test_and_clear_bit(HT_AGG_STATE_WANT_STOP,
346 &tid_tx->state))
347 ___ieee80211_stop_tx_ba_session(sta, tid,
348 WLAN_BACK_INITIATOR);
349 }
350 spin_unlock_bh(&sta->lock);
351}
352
353int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid) 320int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid)
354{ 321{
355 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); 322 struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index 4dfba7808a24..531a19d358df 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -114,6 +114,38 @@ void ieee80211_sta_tear_down_BA_sessions(struct sta_info *sta)
114 } 114 }
115} 115}
116 116
117void ieee80211_ba_session_work(struct work_struct *work)
118{
119 struct sta_info *sta =
120 container_of(work, struct sta_info, ampdu_mlme.work);
121 struct tid_ampdu_tx *tid_tx;
122 int tid;
123
124 /*
125 * When this flag is set, new sessions should be
126 * blocked, and existing sessions will be torn
127 * down by the code that set the flag, so this
128 * need not run.
129 */
130 if (test_sta_flags(sta, WLAN_STA_BLOCK_BA))
131 return;
132
133 spin_lock_bh(&sta->lock);
134 for (tid = 0; tid < STA_TID_NUM; tid++) {
135 tid_tx = sta->ampdu_mlme.tid_tx[tid];
136 if (!tid_tx)
137 continue;
138
139 if (test_bit(HT_AGG_STATE_WANT_START, &tid_tx->state))
140 ieee80211_tx_ba_session_handle_start(sta, tid);
141 else if (test_and_clear_bit(HT_AGG_STATE_WANT_STOP,
142 &tid_tx->state))
143 ___ieee80211_stop_tx_ba_session(sta, tid,
144 WLAN_BACK_INITIATOR);
145 }
146 spin_unlock_bh(&sta->lock);
147}
148
117void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata, 149void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
118 const u8 *da, u16 tid, 150 const u8 *da, u16 tid,
119 u16 initiator, u16 reason_code) 151 u16 initiator, u16 reason_code)
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index aec84c36c4c1..628a53db9f7e 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1113,9 +1113,12 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
1113 1113
1114int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, 1114int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
1115 enum ieee80211_back_parties initiator); 1115 enum ieee80211_back_parties initiator);
1116int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
1117 enum ieee80211_back_parties initiator);
1116void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid); 1118void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid);
1117void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid); 1119void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid);
1118void ieee80211_tx_ba_session_work(struct work_struct *work); 1120void ieee80211_ba_session_work(struct work_struct *work);
1121void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid);
1119 1122
1120/* Spectrum management */ 1123/* Spectrum management */
1121void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata, 1124void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 8aa8558ba21e..bd726c6204df 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -235,7 +235,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
235 spin_lock_init(&sta->lock); 235 spin_lock_init(&sta->lock);
236 spin_lock_init(&sta->flaglock); 236 spin_lock_init(&sta->flaglock);
237 INIT_WORK(&sta->drv_unblock_wk, sta_unblock); 237 INIT_WORK(&sta->drv_unblock_wk, sta_unblock);
238 INIT_WORK(&sta->ampdu_mlme.work, ieee80211_tx_ba_session_work); 238 INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work);
239 239
240 memcpy(sta->sta.addr, addr, ETH_ALEN); 240 memcpy(sta->sta.addr, addr, ETH_ALEN);
241 sta->local = local; 241 sta->local = local;