aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy/4965-mac.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-03-25 13:29:27 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-04-16 09:29:44 -0400
commit85220d71bf3ca1ba9129e0744247ae5f61bec559 (patch)
tree5bdabc71bc5da27ee71fb1272b86809ac2f95b0d /drivers/net/wireless/iwlegacy/4965-mac.c
parentb4f286a1c0ad0b84c2d502b354d4d98d5a86c64b (diff)
mac80211: support secondary channel offset in CSA
Add support for the secondary channel offset IE in channel switch announcements. This is necessary for proper handling of CSA on HT access points. For this to work it is also necessary to convert everything here to use chandef structs instead of just channels. The driver updates aren't really correct though. In particular, the TI wl18xx driver update can't possibly be right since it just ignores the new channel width for lack of firmware API. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy/4965-mac.c')
-rw-r--r--drivers/net/wireless/iwlegacy/4965-mac.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index c092fcbbe965..cb5882ea5f3a 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -6057,7 +6057,7 @@ il4965_mac_channel_switch(struct ieee80211_hw *hw,
6057 struct il_priv *il = hw->priv; 6057 struct il_priv *il = hw->priv;
6058 const struct il_channel_info *ch_info; 6058 const struct il_channel_info *ch_info;
6059 struct ieee80211_conf *conf = &hw->conf; 6059 struct ieee80211_conf *conf = &hw->conf;
6060 struct ieee80211_channel *channel = ch_switch->channel; 6060 struct ieee80211_channel *channel = ch_switch->chandef.chan;
6061 struct il_ht_config *ht_conf = &il->current_ht_config; 6061 struct il_ht_config *ht_conf = &il->current_ht_config;
6062 u16 ch; 6062 u16 ch;
6063 6063
@@ -6094,23 +6094,21 @@ il4965_mac_channel_switch(struct ieee80211_hw *hw,
6094 il->current_ht_config.smps = conf->smps_mode; 6094 il->current_ht_config.smps = conf->smps_mode;
6095 6095
6096 /* Configure HT40 channels */ 6096 /* Configure HT40 channels */
6097 il->ht.enabled = conf_is_ht(conf); 6097 switch (cfg80211_get_chandef_type(&ch_switch->chandef)) {
6098 if (il->ht.enabled) { 6098 case NL80211_CHAN_NO_HT:
6099 if (conf_is_ht40_minus(conf)) { 6099 case NL80211_CHAN_HT20:
6100 il->ht.extension_chan_offset =
6101 IEEE80211_HT_PARAM_CHA_SEC_BELOW;
6102 il->ht.is_40mhz = true;
6103 } else if (conf_is_ht40_plus(conf)) {
6104 il->ht.extension_chan_offset =
6105 IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
6106 il->ht.is_40mhz = true;
6107 } else {
6108 il->ht.extension_chan_offset =
6109 IEEE80211_HT_PARAM_CHA_SEC_NONE;
6110 il->ht.is_40mhz = false;
6111 }
6112 } else
6113 il->ht.is_40mhz = false; 6100 il->ht.is_40mhz = false;
6101 il->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE;
6102 break;
6103 case NL80211_CHAN_HT40MINUS:
6104 il->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
6105 il->ht.is_40mhz = true;
6106 break;
6107 case NL80211_CHAN_HT40PLUS:
6108 il->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
6109 il->ht.is_40mhz = true;
6110 break;
6111 }
6114 6112
6115 if ((le16_to_cpu(il->staging.channel) != ch)) 6113 if ((le16_to_cpu(il->staging.channel) != ch))
6116 il->staging.flags = 0; 6114 il->staging.flags = 0;