aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-09-11 08:34:12 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-10-17 05:02:09 -0400
commit04ecd2578e712c301fa1369d2a8f298a2b4b146a (patch)
tree81fc8135db27831f4456b61c3aeb5d332848b449 /net/mac80211/main.c
parent55de908ab292c03f1eb280f51170ddb9c6b57e31 (diff)
mac80211: track needed RX chains for channel contexts
On each channel that the device is operating on, it may need to listen using one or more chains depending on the SMPS settings of the interfaces using it. The previous channel context changes completely removed this ability (before, it was available as the SMPS mode). Add per-context tracking of the required static and dynamic RX chains and notify the driver on changes. To achieve this, track the chains and SMPS mode used on each virtual interface and update the channel context whenever this changes. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 9cb6280aa2f2..2c8969b67851 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -372,14 +372,6 @@ void ieee80211_restart_hw(struct ieee80211_hw *hw)
372} 372}
373EXPORT_SYMBOL(ieee80211_restart_hw); 373EXPORT_SYMBOL(ieee80211_restart_hw);
374 374
375static void ieee80211_recalc_smps_work(struct work_struct *work)
376{
377 struct ieee80211_local *local =
378 container_of(work, struct ieee80211_local, recalc_smps);
379
380 ieee80211_recalc_smps(local);
381}
382
383#ifdef CONFIG_INET 375#ifdef CONFIG_INET
384static int ieee80211_ifa_changed(struct notifier_block *nb, 376static int ieee80211_ifa_changed(struct notifier_block *nb,
385 unsigned long data, void *arg) 377 unsigned long data, void *arg)
@@ -667,7 +659,6 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
667 INIT_WORK(&local->restart_work, ieee80211_restart_work); 659 INIT_WORK(&local->restart_work, ieee80211_restart_work);
668 660
669 INIT_WORK(&local->reconfig_filter, ieee80211_reconfig_filter); 661 INIT_WORK(&local->reconfig_filter, ieee80211_reconfig_filter);
670 INIT_WORK(&local->recalc_smps, ieee80211_recalc_smps_work);
671 local->smps_mode = IEEE80211_SMPS_OFF; 662 local->smps_mode = IEEE80211_SMPS_OFF;
672 663
673 INIT_WORK(&local->dynamic_ps_enable_work, 664 INIT_WORK(&local->dynamic_ps_enable_work,
@@ -773,6 +764,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
773 if (hw->max_report_rates == 0) 764 if (hw->max_report_rates == 0)
774 hw->max_report_rates = hw->max_rates; 765 hw->max_report_rates = hw->max_rates;
775 766
767 local->rx_chains = 1;
768
776 /* 769 /*
777 * generic code guarantees at least one band, 770 * generic code guarantees at least one band,
778 * set this very early because much code assumes 771 * set this very early because much code assumes
@@ -804,6 +797,13 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
804 max_bitrates = sband->n_bitrates; 797 max_bitrates = sband->n_bitrates;
805 supp_ht = supp_ht || sband->ht_cap.ht_supported; 798 supp_ht = supp_ht || sband->ht_cap.ht_supported;
806 supp_vht = supp_vht || sband->vht_cap.vht_supported; 799 supp_vht = supp_vht || sband->vht_cap.vht_supported;
800
801 if (sband->ht_cap.ht_supported)
802 local->rx_chains =
803 max(ieee80211_mcs_to_chains(&sband->ht_cap.mcs),
804 local->rx_chains);
805
806 /* TODO: consider VHT for RX chains, hopefully it's the same */
807 } 807 }
808 808
809 local->int_scan_req = kzalloc(sizeof(*local->int_scan_req) + 809 local->int_scan_req = kzalloc(sizeof(*local->int_scan_req) +