aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/agg-tx.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/agg-tx.c')
-rw-r--r--net/mac80211/agg-tx.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index bd765f30dba2..89e238b001de 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -123,13 +123,18 @@ 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 sta_info *sta, u16 tid, 126int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
127 enum ieee80211_back_parties initiator) 127 enum ieee80211_back_parties initiator)
128{ 128{
129 struct ieee80211_local *local = sta->local; 129 struct ieee80211_local *local = sta->local;
130 int ret; 130 int ret;
131 u8 *state; 131 u8 *state;
132 132
133#ifdef CONFIG_MAC80211_HT_DEBUG
134 printk(KERN_DEBUG "Tx BA session stop requested for %pM tid %u\n",
135 sta->sta.addr, tid);
136#endif /* CONFIG_MAC80211_HT_DEBUG */
137
133 state = &sta->ampdu_mlme.tid_state_tx[tid]; 138 state = &sta->ampdu_mlme.tid_state_tx[tid];
134 139
135 if (*state == HT_AGG_STATE_OPERATIONAL) 140 if (*state == HT_AGG_STATE_OPERATIONAL)
@@ -143,7 +148,6 @@ static int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
143 148
144 /* HW shall not deny going back to legacy */ 149 /* HW shall not deny going back to legacy */
145 if (WARN_ON(ret)) { 150 if (WARN_ON(ret)) {
146 *state = HT_AGG_STATE_OPERATIONAL;
147 /* 151 /*
148 * We may have pending packets get stuck in this case... 152 * We may have pending packets get stuck in this case...
149 * Not bothering with a workaround for now. 153 * Not bothering with a workaround for now.
@@ -173,12 +177,14 @@ static void sta_addba_resp_timer_expired(unsigned long data)
173 177
174 /* check if the TID waits for addBA response */ 178 /* check if the TID waits for addBA response */
175 spin_lock_bh(&sta->lock); 179 spin_lock_bh(&sta->lock);
176 if (!(*state & HT_ADDBA_REQUESTED_MSK)) { 180 if ((*state & (HT_ADDBA_REQUESTED_MSK | HT_ADDBA_RECEIVED_MSK)) !=
181 HT_ADDBA_REQUESTED_MSK) {
177 spin_unlock_bh(&sta->lock); 182 spin_unlock_bh(&sta->lock);
178 *state = HT_AGG_STATE_IDLE; 183 *state = HT_AGG_STATE_IDLE;
179#ifdef CONFIG_MAC80211_HT_DEBUG 184#ifdef CONFIG_MAC80211_HT_DEBUG
180 printk(KERN_DEBUG "timer expired on tid %d but we are not " 185 printk(KERN_DEBUG "timer expired on tid %d but we are not "
181 "expecting addBA response there", tid); 186 "(or no longer) expecting addBA response there",
187 tid);
182#endif 188#endif
183 return; 189 return;
184 } 190 }
@@ -523,11 +529,6 @@ int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
523 goto unlock; 529 goto unlock;
524 } 530 }
525 531
526#ifdef CONFIG_MAC80211_HT_DEBUG
527 printk(KERN_DEBUG "Tx BA session stop requested for %pM tid %u\n",
528 sta->sta.addr, tid);
529#endif /* CONFIG_MAC80211_HT_DEBUG */
530
531 ret = ___ieee80211_stop_tx_ba_session(sta, tid, initiator); 532 ret = ___ieee80211_stop_tx_ba_session(sta, tid, initiator);
532 533
533 unlock: 534 unlock:
@@ -543,7 +544,7 @@ int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw,
543 struct sta_info *sta; 544 struct sta_info *sta;
544 int ret = 0; 545 int ret = 0;
545 546
546 if (WARN_ON(!local->ops->ampdu_action)) 547 if (!local->ops->ampdu_action)
547 return -EINVAL; 548 return -EINVAL;
548 549
549 if (tid >= STA_TID_NUM) 550 if (tid >= STA_TID_NUM)
@@ -668,24 +669,23 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
668 669
669 spin_lock_bh(&sta->lock); 670 spin_lock_bh(&sta->lock);
670 671
671 if (!(*state & HT_ADDBA_REQUESTED_MSK)) { 672 if (!(*state & HT_ADDBA_REQUESTED_MSK))
672 spin_unlock_bh(&sta->lock); 673 goto out;
673 return;
674 }
675 674
676 if (mgmt->u.action.u.addba_resp.dialog_token != 675 if (mgmt->u.action.u.addba_resp.dialog_token !=
677 sta->ampdu_mlme.tid_tx[tid]->dialog_token) { 676 sta->ampdu_mlme.tid_tx[tid]->dialog_token) {
678 spin_unlock_bh(&sta->lock);
679#ifdef CONFIG_MAC80211_HT_DEBUG 677#ifdef CONFIG_MAC80211_HT_DEBUG
680 printk(KERN_DEBUG "wrong addBA response token, tid %d\n", tid); 678 printk(KERN_DEBUG "wrong addBA response token, tid %d\n", tid);
681#endif /* CONFIG_MAC80211_HT_DEBUG */ 679#endif /* CONFIG_MAC80211_HT_DEBUG */
682 return; 680 goto out;
683 } 681 }
684 682
685 del_timer_sync(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer); 683 del_timer(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer);
684
686#ifdef CONFIG_MAC80211_HT_DEBUG 685#ifdef CONFIG_MAC80211_HT_DEBUG
687 printk(KERN_DEBUG "switched off addBA timer for tid %d \n", tid); 686 printk(KERN_DEBUG "switched off addBA timer for tid %d \n", tid);
688#endif /* CONFIG_MAC80211_HT_DEBUG */ 687#endif /* CONFIG_MAC80211_HT_DEBUG */
688
689 if (le16_to_cpu(mgmt->u.action.u.addba_resp.status) 689 if (le16_to_cpu(mgmt->u.action.u.addba_resp.status)
690 == WLAN_STATUS_SUCCESS) { 690 == WLAN_STATUS_SUCCESS) {
691 u8 curstate = *state; 691 u8 curstate = *state;
@@ -699,5 +699,7 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
699 } else { 699 } else {
700 ___ieee80211_stop_tx_ba_session(sta, tid, WLAN_BACK_INITIATOR); 700 ___ieee80211_stop_tx_ba_session(sta, tid, WLAN_BACK_INITIATOR);
701 } 701 }
702
703 out:
702 spin_unlock_bh(&sta->lock); 704 spin_unlock_bh(&sta->lock);
703} 705}