aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@intel.com>2014-06-13 09:30:07 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-06-23 08:22:29 -0400
commita46992b441f097a971cca39f49d07a0d16a1c0d8 (patch)
treed80aacded124a3add8691ada27deb47ce6722ae0 /net/mac80211/cfg.c
parent26da23b6950cd1aaae86caa541eb4befc9e96e1d (diff)
mac80211: stop only the queues assigned to the vif during channel switch
Instead of stopping all the hardware queues during channel switch, which is especially bad when we have large CSA counts, stop only the queues that are assigned to the vif that is performing the channel switch. Additionally, check for (sdata->csa_block_tx) instead of calling ieee80211_csa_needs_block_tx(), which can now be removed. Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c52
1 files changed, 13 insertions, 39 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index e920d48f0209..a0d7a0362f1f 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -790,31 +790,6 @@ static int ieee80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,
790 return 0; 790 return 0;
791} 791}
792 792
793bool ieee80211_csa_needs_block_tx(struct ieee80211_local *local)
794{
795 struct ieee80211_sub_if_data *sdata;
796
797 lockdep_assert_held(&local->mtx);
798
799 rcu_read_lock();
800 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
801 if (!ieee80211_sdata_running(sdata))
802 continue;
803
804 if (!sdata->vif.csa_active)
805 continue;
806
807 if (!sdata->csa_block_tx)
808 continue;
809
810 rcu_read_unlock();
811 return true;
812 }
813 rcu_read_unlock();
814
815 return false;
816}
817
818static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev) 793static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
819{ 794{
820 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 795 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
@@ -834,11 +809,12 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
834 /* abort any running channel switch */ 809 /* abort any running channel switch */
835 mutex_lock(&local->mtx); 810 mutex_lock(&local->mtx);
836 sdata->vif.csa_active = false; 811 sdata->vif.csa_active = false;
837 if (!ieee80211_csa_needs_block_tx(local)) 812 if (sdata->csa_block_tx) {
838 ieee80211_wake_queues_by_reason(&local->hw, 813 ieee80211_wake_vif_queues(local, sdata,
839 IEEE80211_MAX_QUEUE_MAP, 814 IEEE80211_QUEUE_STOP_REASON_CSA);
840 IEEE80211_QUEUE_STOP_REASON_CSA, 815 sdata->csa_block_tx = false;
841 false); 816 }
817
842 mutex_unlock(&local->mtx); 818 mutex_unlock(&local->mtx);
843 819
844 kfree(sdata->u.ap.next_beacon); 820 kfree(sdata->u.ap.next_beacon);
@@ -2826,11 +2802,11 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata)
2826 ieee80211_bss_info_change_notify(sdata, changed); 2802 ieee80211_bss_info_change_notify(sdata, changed);
2827 cfg80211_ch_switch_notify(sdata->dev, &sdata->csa_chandef); 2803 cfg80211_ch_switch_notify(sdata->dev, &sdata->csa_chandef);
2828 2804
2829 if (!ieee80211_csa_needs_block_tx(local)) 2805 if (sdata->csa_block_tx) {
2830 ieee80211_wake_queues_by_reason(&local->hw, 2806 ieee80211_wake_vif_queues(local, sdata,
2831 IEEE80211_MAX_QUEUE_MAP, 2807 IEEE80211_QUEUE_STOP_REASON_CSA);
2832 IEEE80211_QUEUE_STOP_REASON_CSA, 2808 sdata->csa_block_tx = false;
2833 false); 2809 }
2834 2810
2835 return 0; 2811 return 0;
2836} 2812}
@@ -3060,10 +3036,8 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
3060 sdata->vif.csa_active = true; 3036 sdata->vif.csa_active = true;
3061 3037
3062 if (sdata->csa_block_tx) 3038 if (sdata->csa_block_tx)
3063 ieee80211_stop_queues_by_reason(&local->hw, 3039 ieee80211_stop_vif_queues(local, sdata,
3064 IEEE80211_MAX_QUEUE_MAP, 3040 IEEE80211_QUEUE_STOP_REASON_CSA);
3065 IEEE80211_QUEUE_STOP_REASON_CSA,
3066 false);
3067 3041
3068 if (changed) { 3042 if (changed) {
3069 ieee80211_bss_info_change_notify(sdata, changed); 3043 ieee80211_bss_info_change_notify(sdata, changed);