aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/agg-tx.c18
-rw-r--r--net/mac80211/ieee80211_i.h8
-rw-r--r--net/mac80211/util.c19
3 files changed, 25 insertions, 20 deletions
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index b50b2bc3b8c5..adf01fcd462e 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -175,12 +175,14 @@ static void sta_addba_resp_timer_expired(unsigned long data)
175 175
176 /* check if the TID waits for addBA response */ 176 /* check if the TID waits for addBA response */
177 spin_lock_bh(&sta->lock); 177 spin_lock_bh(&sta->lock);
178 if (!(*state & HT_ADDBA_REQUESTED_MSK)) { 178 if ((*state & (HT_ADDBA_REQUESTED_MSK | HT_ADDBA_RECEIVED_MSK)) !=
179 HT_ADDBA_REQUESTED_MSK) {
179 spin_unlock_bh(&sta->lock); 180 spin_unlock_bh(&sta->lock);
180 *state = HT_AGG_STATE_IDLE; 181 *state = HT_AGG_STATE_IDLE;
181#ifdef CONFIG_MAC80211_HT_DEBUG 182#ifdef CONFIG_MAC80211_HT_DEBUG
182 printk(KERN_DEBUG "timer expired on tid %d but we are not " 183 printk(KERN_DEBUG "timer expired on tid %d but we are not "
183 "expecting addBA response there", tid); 184 "(or no longer) expecting addBA response there",
185 tid);
184#endif 186#endif
185 return; 187 return;
186 } 188 }
@@ -649,21 +651,21 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
649 651
650 state = &sta->ampdu_mlme.tid_state_tx[tid]; 652 state = &sta->ampdu_mlme.tid_state_tx[tid];
651 653
652 del_timer_sync(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer);
653
654 spin_lock_bh(&sta->lock); 654 spin_lock_bh(&sta->lock);
655 655
656 if (!(*state & HT_ADDBA_REQUESTED_MSK)) 656 if (!(*state & HT_ADDBA_REQUESTED_MSK))
657 goto timer_still_needed; 657 goto out;
658 658
659 if (mgmt->u.action.u.addba_resp.dialog_token != 659 if (mgmt->u.action.u.addba_resp.dialog_token !=
660 sta->ampdu_mlme.tid_tx[tid]->dialog_token) { 660 sta->ampdu_mlme.tid_tx[tid]->dialog_token) {
661#ifdef CONFIG_MAC80211_HT_DEBUG 661#ifdef CONFIG_MAC80211_HT_DEBUG
662 printk(KERN_DEBUG "wrong addBA response token, tid %d\n", tid); 662 printk(KERN_DEBUG "wrong addBA response token, tid %d\n", tid);
663#endif /* CONFIG_MAC80211_HT_DEBUG */ 663#endif /* CONFIG_MAC80211_HT_DEBUG */
664 goto timer_still_needed; 664 goto out;
665 } 665 }
666 666
667 del_timer(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer);
668
667#ifdef CONFIG_MAC80211_HT_DEBUG 669#ifdef CONFIG_MAC80211_HT_DEBUG
668 printk(KERN_DEBUG "switched off addBA timer for tid %d \n", tid); 670 printk(KERN_DEBUG "switched off addBA timer for tid %d \n", tid);
669#endif /* CONFIG_MAC80211_HT_DEBUG */ 671#endif /* CONFIG_MAC80211_HT_DEBUG */
@@ -682,10 +684,6 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
682 ___ieee80211_stop_tx_ba_session(sta, tid, WLAN_BACK_INITIATOR); 684 ___ieee80211_stop_tx_ba_session(sta, tid, WLAN_BACK_INITIATOR);
683 } 685 }
684 686
685 goto out;
686
687 timer_still_needed:
688 add_timer(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer);
689 out: 687 out:
690 spin_unlock_bh(&sta->lock); 688 spin_unlock_bh(&sta->lock);
691} 689}
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 04093e84ebd7..ab2894211638 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -601,6 +601,14 @@ struct ieee80211_local {
601 bool suspended; 601 bool suspended;
602 602
603 /* 603 /*
604 * Resuming is true while suspended, but when we're reprogramming the
605 * hardware -- at that time it's allowed to use ieee80211_queue_work()
606 * again even though some other parts of the stack are still suspended
607 * and we still drop received frames to avoid waking the stack.
608 */
609 bool resuming;
610
611 /*
604 * quiescing is true during the suspend process _only_ to 612 * quiescing is true during the suspend process _only_ to
605 * ease timer cancelling etc. 613 * ease timer cancelling etc.
606 */ 614 */
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 2fb0432ac830..d09f78bb2442 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -520,9 +520,9 @@ EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces_atomic);
520 */ 520 */
521static bool ieee80211_can_queue_work(struct ieee80211_local *local) 521static bool ieee80211_can_queue_work(struct ieee80211_local *local)
522{ 522{
523 if (WARN(local->suspended, "queueing ieee80211 work while " 523 if (WARN(local->suspended && !local->resuming,
524 "going to suspend\n")) 524 "queueing ieee80211 work while going to suspend\n"))
525 return false; 525 return false;
526 526
527 return true; 527 return true;
528} 528}
@@ -1033,13 +1033,9 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1033 struct sta_info *sta; 1033 struct sta_info *sta;
1034 unsigned long flags; 1034 unsigned long flags;
1035 int res; 1035 int res;
1036 bool from_suspend = local->suspended;
1037 1036
1038 /* 1037 if (local->suspended)
1039 * We're going to start the hardware, at that point 1038 local->resuming = true;
1040 * we are no longer suspended and can RX frames.
1041 */
1042 local->suspended = false;
1043 1039
1044 /* restart hardware */ 1040 /* restart hardware */
1045 if (local->open_count) { 1041 if (local->open_count) {
@@ -1137,11 +1133,14 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1137 * If this is for hw restart things are still running. 1133 * If this is for hw restart things are still running.
1138 * We may want to change that later, however. 1134 * We may want to change that later, however.
1139 */ 1135 */
1140 if (!from_suspend) 1136 if (!local->suspended)
1141 return 0; 1137 return 0;
1142 1138
1143#ifdef CONFIG_PM 1139#ifdef CONFIG_PM
1140 /* first set suspended false, then resuming */
1144 local->suspended = false; 1141 local->suspended = false;
1142 mb();
1143 local->resuming = false;
1145 1144
1146 list_for_each_entry(sdata, &local->interfaces, list) { 1145 list_for_each_entry(sdata, &local->interfaces, list) {
1147 switch(sdata->vif.type) { 1146 switch(sdata->vif.type) {