aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2010-05-05 09:28:27 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-05-07 14:55:51 -0400
commit0aaffa9b9699894aab3266195a529baf9f96ac29 (patch)
tree26fe5f5277ac6d7061ea723f92d4038b0c28b0b8 /drivers/net
parentf444de05d20e27cdd960c13fcbcfca3099f03143 (diff)
mac80211: improve HT channel handling
Currently, when one interface switches HT mode, all others will follow along. This is clearly undesirable, since the new one might switch to no-HT while another one is operating in HT. Address this issue by keeping track of the HT mode per interface, and allowing only changes that are compatible, i.e. switching into HT40+ is not possible when another interface is in HT40-, in that case the second one needs to fall back to HT20. Also, to allow drivers to know what's going on, store the per-interface HT mode (channel type) in the virtual interface's bss_conf. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 62a739f6c37b..bdce71a4ba20 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -651,17 +651,17 @@ static void mac80211_hwsim_beacon(unsigned long arg)
651 add_timer(&data->beacon_timer); 651 add_timer(&data->beacon_timer);
652} 652}
653 653
654static const char *hwsim_chantypes[] = {
655 [NL80211_CHAN_NO_HT] = "noht",
656 [NL80211_CHAN_HT20] = "ht20",
657 [NL80211_CHAN_HT40MINUS] = "ht40-",
658 [NL80211_CHAN_HT40PLUS] = "ht40+",
659};
654 660
655static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed) 661static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed)
656{ 662{
657 struct mac80211_hwsim_data *data = hw->priv; 663 struct mac80211_hwsim_data *data = hw->priv;
658 struct ieee80211_conf *conf = &hw->conf; 664 struct ieee80211_conf *conf = &hw->conf;
659 static const char *chantypes[4] = {
660 [NL80211_CHAN_NO_HT] = "noht",
661 [NL80211_CHAN_HT20] = "ht20",
662 [NL80211_CHAN_HT40MINUS] = "ht40-",
663 [NL80211_CHAN_HT40PLUS] = "ht40+",
664 };
665 static const char *smps_modes[IEEE80211_SMPS_NUM_MODES] = { 665 static const char *smps_modes[IEEE80211_SMPS_NUM_MODES] = {
666 [IEEE80211_SMPS_AUTOMATIC] = "auto", 666 [IEEE80211_SMPS_AUTOMATIC] = "auto",
667 [IEEE80211_SMPS_OFF] = "off", 667 [IEEE80211_SMPS_OFF] = "off",
@@ -672,7 +672,7 @@ static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed)
672 printk(KERN_DEBUG "%s:%s (freq=%d/%s idle=%d ps=%d smps=%s)\n", 672 printk(KERN_DEBUG "%s:%s (freq=%d/%s idle=%d ps=%d smps=%s)\n",
673 wiphy_name(hw->wiphy), __func__, 673 wiphy_name(hw->wiphy), __func__,
674 conf->channel->center_freq, 674 conf->channel->center_freq,
675 chantypes[conf->channel_type], 675 hwsim_chantypes[conf->channel_type],
676 !!(conf->flags & IEEE80211_CONF_IDLE), 676 !!(conf->flags & IEEE80211_CONF_IDLE),
677 !!(conf->flags & IEEE80211_CONF_PS), 677 !!(conf->flags & IEEE80211_CONF_PS),
678 smps_modes[conf->smps_mode]); 678 smps_modes[conf->smps_mode]);
@@ -760,9 +760,10 @@ static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw,
760 } 760 }
761 761
762 if (changed & BSS_CHANGED_HT) { 762 if (changed & BSS_CHANGED_HT) {
763 printk(KERN_DEBUG " %s: HT: op_mode=0x%x\n", 763 printk(KERN_DEBUG " %s: HT: op_mode=0x%x, chantype=%s\n",
764 wiphy_name(hw->wiphy), 764 wiphy_name(hw->wiphy),
765 info->ht_operation_mode); 765 info->ht_operation_mode,
766 hwsim_chantypes[info->channel_type]);
766 } 767 }
767 768
768 if (changed & BSS_CHANGED_BASIC_RATES) { 769 if (changed & BSS_CHANGED_BASIC_RATES) {