aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2008-12-12 01:27:43 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-12-19 15:22:54 -0500
commit094d05dc32fc2930e381189a942016e5561775d9 (patch)
tree4deedbcbe196f88cb8d9fe0cd0755775a7ff0939 /drivers/net/wireless/iwlwifi/iwl-agn.c
parent420e7fabd9c6d907280ed6b3e40eef425c5d8d8d (diff)
mac80211: Fix HT channel selection
HT management is done differently for AP and STA modes, unify to just the ->config() callback since HT is fundamentally a PHY property and cannot be per-BSS. Rename enum nl80211_sec_chan_offset as nl80211_channel_type to denote the channel type ( NO_HT, HT20, HT40+, HT40- ). Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 2f5e86e12916..bbc1c8052ffa 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -515,19 +515,27 @@ static void iwl_ht_conf(struct iwl_priv *priv,
515 iwl_conf->supported_chan_width = 515 iwl_conf->supported_chan_width =
516 !!(ht_conf->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40); 516 !!(ht_conf->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40);
517 517
518 iwl_conf->extension_chan_offset = bss_conf->ht.secondary_channel_offset; 518 /*
519 * XXX: The HT configuration needs to be moved into iwl_mac_config()
520 * to be done there correctly.
521 */
522
523 iwl_conf->extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE;
524 if (priv->hw->conf.ht.channel_type == NL80211_CHAN_HT40MINUS)
525 iwl_conf->extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
526 else if(priv->hw->conf.ht.channel_type == NL80211_CHAN_HT40PLUS)
527 iwl_conf->extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
528
519 /* If no above or below channel supplied disable FAT channel */ 529 /* If no above or below channel supplied disable FAT channel */
520 if (iwl_conf->extension_chan_offset != IEEE80211_HT_PARAM_CHA_SEC_ABOVE && 530 if (iwl_conf->extension_chan_offset != IEEE80211_HT_PARAM_CHA_SEC_ABOVE &&
521 iwl_conf->extension_chan_offset != IEEE80211_HT_PARAM_CHA_SEC_BELOW) { 531 iwl_conf->extension_chan_offset != IEEE80211_HT_PARAM_CHA_SEC_BELOW)
522 iwl_conf->extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE;
523 iwl_conf->supported_chan_width = 0; 532 iwl_conf->supported_chan_width = 0;
524 }
525 533
526 iwl_conf->sm_ps = (u8)((ht_conf->cap & IEEE80211_HT_CAP_SM_PS) >> 2); 534 iwl_conf->sm_ps = (u8)((ht_conf->cap & IEEE80211_HT_CAP_SM_PS) >> 2);
527 535
528 memcpy(&iwl_conf->mcs, &ht_conf->mcs, 16); 536 memcpy(&iwl_conf->mcs, &ht_conf->mcs, 16);
529 537
530 iwl_conf->tx_chan_width = bss_conf->ht.width_40_ok; 538 iwl_conf->tx_chan_width = iwl_conf->supported_chan_width != 0;
531 iwl_conf->ht_protection = 539 iwl_conf->ht_protection =
532 bss_conf->ht.operation_mode & IEEE80211_HT_OP_MODE_PROTECTION; 540 bss_conf->ht.operation_mode & IEEE80211_HT_OP_MODE_PROTECTION;
533 iwl_conf->non_GF_STA_present = 541 iwl_conf->non_GF_STA_present =