diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-06-10 04:21:43 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-06-14 15:39:27 -0400 |
commit | 67c282c00c9c06733aae229662d209957f6d23a7 (patch) | |
tree | 698270941e46c873e2c34fda0428ea457cd1926b /net/mac80211/agg-tx.c | |
parent | 0ab337032a0dfcd5f2527d3306d3deeba5f95b59 (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/mac80211/agg-tx.c')
-rw-r--r-- | net/mac80211/agg-tx.c | 39 |
1 files changed, 3 insertions, 36 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 | ||
136 | static int ___ieee80211_stop_tx_ba_session( | 136 | int ___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 | ||
265 | static void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid) | 264 | void 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 | ||
321 | void 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 | |||
353 | int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid) | 320 | int 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); |