Commit 28bd723b authored by Daniel C Halperin's avatar Daniel C Halperin Committed by John W. Linville

iwlwifi: configure HT40 channels in iwl_mac_config

As indicated by note in iwl_ht_conf, some HT parameters are set on association
(e.g., channel width) and some vary over time (HT protection mode) and per
station (e.g., short GI support).  The global parameters should be set in
iwl_mac_config and the local/varying parameters in iwl_ht_conf.

This patch moves the channel width configuration from iwl_ht_conf to
iwl_mac_config, and defers further cleanup of the local/global conflation for a
later patch.

This fixes a bug in using HT40 channels in some modes.
Signed-off-by: default avatarDaniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9f30e04e
...@@ -2398,25 +2398,6 @@ static void iwl_ht_conf(struct iwl_priv *priv, ...@@ -2398,25 +2398,6 @@ static void iwl_ht_conf(struct iwl_priv *priv,
iwl_conf->is_green_field = !!(ht_conf->cap & IEEE80211_HT_CAP_GRN_FLD); iwl_conf->is_green_field = !!(ht_conf->cap & IEEE80211_HT_CAP_GRN_FLD);
iwl_conf->supported_chan_width =
!!(ht_conf->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40);
/*
* XXX: The HT configuration needs to be moved into iwl_mac_config()
* to be done there correctly.
*/
iwl_conf->extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE;
if (conf_is_ht40_minus(&priv->hw->conf))
iwl_conf->extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
else if (conf_is_ht40_plus(&priv->hw->conf))
iwl_conf->extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
/* If no above or below channel supplied disable HT40 channel */
if (iwl_conf->extension_chan_offset != IEEE80211_HT_PARAM_CHA_SEC_ABOVE &&
iwl_conf->extension_chan_offset != IEEE80211_HT_PARAM_CHA_SEC_BELOW)
iwl_conf->supported_chan_width = 0;
iwl_conf->sm_ps = (u8)((ht_conf->cap & IEEE80211_HT_CAP_SM_PS) >> 2); iwl_conf->sm_ps = (u8)((ht_conf->cap & IEEE80211_HT_CAP_SM_PS) >> 2);
memcpy(&iwl_conf->mcs, &ht_conf->mcs, 16); memcpy(&iwl_conf->mcs, &ht_conf->mcs, 16);
...@@ -2733,6 +2714,7 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed) ...@@ -2733,6 +2714,7 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
struct iwl_priv *priv = hw->priv; struct iwl_priv *priv = hw->priv;
const struct iwl_channel_info *ch_info; const struct iwl_channel_info *ch_info;
struct ieee80211_conf *conf = &hw->conf; struct ieee80211_conf *conf = &hw->conf;
struct iwl_ht_info *ht_conf = &priv->current_ht_config;
unsigned long flags = 0; unsigned long flags = 0;
int ret = 0; int ret = 0;
u16 ch; u16 ch;
...@@ -2774,10 +2756,32 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed) ...@@ -2774,10 +2756,32 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
goto set_ch_out; goto set_ch_out;
} }
priv->current_ht_config.is_ht = conf_is_ht(conf);
spin_lock_irqsave(&priv->lock, flags); spin_lock_irqsave(&priv->lock, flags);
/* Configure HT40 channels */
ht_conf->is_ht = conf_is_ht(conf);
if (ht_conf->is_ht) {
if (conf_is_ht40_minus(conf)) {
ht_conf->extension_chan_offset =
IEEE80211_HT_PARAM_CHA_SEC_BELOW;
ht_conf->supported_chan_width =
IWL_CHANNEL_WIDTH_40MHZ;
} else if (conf_is_ht40_plus(conf)) {
ht_conf->extension_chan_offset =
IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
ht_conf->supported_chan_width =
IWL_CHANNEL_WIDTH_40MHZ;
} else {
ht_conf->extension_chan_offset =
IEEE80211_HT_PARAM_CHA_SEC_NONE;
ht_conf->supported_chan_width =
IWL_CHANNEL_WIDTH_20MHZ;
}
} else
ht_conf->supported_chan_width = IWL_CHANNEL_WIDTH_20MHZ;
/* Default to no protection. Protection mode will later be set
* from BSS config in iwl_ht_conf */
ht_conf->ht_protection = IEEE80211_HT_OP_MODE_PROTECTION_NONE;
/* if we are switching from ht to 2.4 clear flags /* if we are switching from ht to 2.4 clear flags
* from any ht related info since 2.4 does not * from any ht related info since 2.4 does not
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment