diff options
author | Daniel C Halperin <daniel.c.halperin@intel.com> | 2009-08-13 16:30:57 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-20 11:33:12 -0400 |
commit | 28bd723bbaddba4e145d25117649bb6da5fafad7 (patch) | |
tree | 2b20a3714e6e5e95ae1c8a089ee464d8a86f98ad /drivers | |
parent | 9f30e04e041cf9943940f71fd76094dd5a237018 (diff) |
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: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 08345b97cb4c..104fd95dfad6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -2398,25 +2398,6 @@ static void iwl_ht_conf(struct iwl_priv *priv, | |||
2398 | 2398 | ||
2399 | iwl_conf->is_green_field = !!(ht_conf->cap & IEEE80211_HT_CAP_GRN_FLD); | 2399 | iwl_conf->is_green_field = !!(ht_conf->cap & IEEE80211_HT_CAP_GRN_FLD); |
2400 | 2400 | ||
2401 | iwl_conf->supported_chan_width = | ||
2402 | !!(ht_conf->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40); | ||
2403 | |||
2404 | /* | ||
2405 | * XXX: The HT configuration needs to be moved into iwl_mac_config() | ||
2406 | * to be done there correctly. | ||
2407 | */ | ||
2408 | |||
2409 | iwl_conf->extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE; | ||
2410 | if (conf_is_ht40_minus(&priv->hw->conf)) | ||
2411 | iwl_conf->extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_BELOW; | ||
2412 | else if (conf_is_ht40_plus(&priv->hw->conf)) | ||
2413 | iwl_conf->extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_ABOVE; | ||
2414 | |||
2415 | /* If no above or below channel supplied disable HT40 channel */ | ||
2416 | if (iwl_conf->extension_chan_offset != IEEE80211_HT_PARAM_CHA_SEC_ABOVE && | ||
2417 | iwl_conf->extension_chan_offset != IEEE80211_HT_PARAM_CHA_SEC_BELOW) | ||
2418 | iwl_conf->supported_chan_width = 0; | ||
2419 | |||
2420 | iwl_conf->sm_ps = (u8)((ht_conf->cap & IEEE80211_HT_CAP_SM_PS) >> 2); | 2401 | iwl_conf->sm_ps = (u8)((ht_conf->cap & IEEE80211_HT_CAP_SM_PS) >> 2); |
2421 | 2402 | ||
2422 | memcpy(&iwl_conf->mcs, &ht_conf->mcs, 16); | 2403 | memcpy(&iwl_conf->mcs, &ht_conf->mcs, 16); |
@@ -2733,6 +2714,7 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed) | |||
2733 | struct iwl_priv *priv = hw->priv; | 2714 | struct iwl_priv *priv = hw->priv; |
2734 | const struct iwl_channel_info *ch_info; | 2715 | const struct iwl_channel_info *ch_info; |
2735 | struct ieee80211_conf *conf = &hw->conf; | 2716 | struct ieee80211_conf *conf = &hw->conf; |
2717 | struct iwl_ht_info *ht_conf = &priv->current_ht_config; | ||
2736 | unsigned long flags = 0; | 2718 | unsigned long flags = 0; |
2737 | int ret = 0; | 2719 | int ret = 0; |
2738 | u16 ch; | 2720 | u16 ch; |
@@ -2774,10 +2756,32 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed) | |||
2774 | goto set_ch_out; | 2756 | goto set_ch_out; |
2775 | } | 2757 | } |
2776 | 2758 | ||
2777 | priv->current_ht_config.is_ht = conf_is_ht(conf); | ||
2778 | |||
2779 | spin_lock_irqsave(&priv->lock, flags); | 2759 | spin_lock_irqsave(&priv->lock, flags); |
2780 | 2760 | ||
2761 | /* Configure HT40 channels */ | ||
2762 | ht_conf->is_ht = conf_is_ht(conf); | ||
2763 | if (ht_conf->is_ht) { | ||
2764 | if (conf_is_ht40_minus(conf)) { | ||
2765 | ht_conf->extension_chan_offset = | ||
2766 | IEEE80211_HT_PARAM_CHA_SEC_BELOW; | ||
2767 | ht_conf->supported_chan_width = | ||
2768 | IWL_CHANNEL_WIDTH_40MHZ; | ||
2769 | } else if (conf_is_ht40_plus(conf)) { | ||
2770 | ht_conf->extension_chan_offset = | ||
2771 | IEEE80211_HT_PARAM_CHA_SEC_ABOVE; | ||
2772 | ht_conf->supported_chan_width = | ||
2773 | IWL_CHANNEL_WIDTH_40MHZ; | ||
2774 | } else { | ||
2775 | ht_conf->extension_chan_offset = | ||
2776 | IEEE80211_HT_PARAM_CHA_SEC_NONE; | ||
2777 | ht_conf->supported_chan_width = | ||
2778 | IWL_CHANNEL_WIDTH_20MHZ; | ||
2779 | } | ||
2780 | } else | ||
2781 | ht_conf->supported_chan_width = IWL_CHANNEL_WIDTH_20MHZ; | ||
2782 | /* Default to no protection. Protection mode will later be set | ||
2783 | * from BSS config in iwl_ht_conf */ | ||
2784 | ht_conf->ht_protection = IEEE80211_HT_OP_MODE_PROTECTION_NONE; | ||
2781 | 2785 | ||
2782 | /* if we are switching from ht to 2.4 clear flags | 2786 | /* if we are switching from ht to 2.4 clear flags |
2783 | * from any ht related info since 2.4 does not | 2787 | * from any ht related info since 2.4 does not |