diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-02-10 15:25:54 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-13 13:45:48 -0500 |
commit | 849b7967818995a32c3017542e33eb3155944368 (patch) | |
tree | afd0a98e50c3b9a851a2b46682f6a3767df2ca04 /net/mac80211/agg-tx.c | |
parent | d75636ef9c1af224f1097941879d5a8db7cd04e5 (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>
Diffstat (limited to 'net/mac80211/agg-tx.c')
-rw-r--r-- | net/mac80211/agg-tx.c | 63 |
1 files changed, 33 insertions, 30 deletions
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 | ||
126 | static int __ieee80211_stop_tx_ba_session(struct ieee80211_local *local, | 126 | static 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 | } |
428 | EXPORT_SYMBOL(ieee80211_start_tx_ba_cb_irqsafe); | 427 | EXPORT_SYMBOL(ieee80211_start_tx_ba_cb_irqsafe); |
429 | 428 | ||
429 | int __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 | ||
431 | int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw, | 456 | int 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 | } |
476 | EXPORT_SYMBOL(ieee80211_stop_tx_ba_session); | 481 | EXPORT_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 | } |