diff options
author | Ron Rindjunsky <ron.rindjunsky@intel.com> | 2007-11-26 09:14:39 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:05:43 -0500 |
commit | fd105e79d19439d29a6561178fb5fe511e141f6b (patch) | |
tree | 4867e5b41bc2a32c1d2c399f85827c5c7909c52f /drivers/net/wireless/iwlwifi/iwl-4965.c | |
parent | 8fb8803239debda77b90f7e4a5098067187d865e (diff) |
iwlwifi: 802.11n comply HT self configuration flow with mac80211 framework
This patch conforms HW configuration changes according to new mac80211's
HT framework
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index fbabcb0394df..2724208aca7c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -87,8 +87,8 @@ static int is_fat_channel(__le32 rxon_flags) | |||
87 | static u8 is_single_stream(struct iwl4965_priv *priv) | 87 | static u8 is_single_stream(struct iwl4965_priv *priv) |
88 | { | 88 | { |
89 | #ifdef CONFIG_IWL4965_HT | 89 | #ifdef CONFIG_IWL4965_HT |
90 | if (!priv->is_ht_enabled || !priv->current_assoc_ht.is_ht || | 90 | if (!priv->current_ht_config.is_ht || |
91 | (priv->active_rate_ht[1] == 0) || | 91 | (priv->current_ht_config.supp_mcs_set[1] == 0) || |
92 | (priv->ps_mode == IWL_MIMO_PS_STATIC)) | 92 | (priv->ps_mode == IWL_MIMO_PS_STATIC)) |
93 | return 1; | 93 | return 1; |
94 | #else | 94 | #else |
@@ -4541,27 +4541,27 @@ static u8 iwl4965_is_channel_extension(struct iwl4965_priv *priv, int phymode, | |||
4541 | } | 4541 | } |
4542 | 4542 | ||
4543 | static u8 iwl4965_is_fat_tx_allowed(struct iwl4965_priv *priv, | 4543 | static u8 iwl4965_is_fat_tx_allowed(struct iwl4965_priv *priv, |
4544 | const struct sta_ht_info *ht_info) | 4544 | struct ieee80211_ht_info *sta_ht_inf) |
4545 | { | 4545 | { |
4546 | struct iwl_ht_info *iwl_ht_conf = &priv->current_ht_config; | ||
4546 | 4547 | ||
4547 | if (priv->channel_width != IWL_CHANNEL_WIDTH_40MHZ) | 4548 | if ((!iwl_ht_conf->is_ht) || |
4549 | (iwl_ht_conf->supported_chan_width != IWL_CHANNEL_WIDTH_40MHZ) || | ||
4550 | (iwl_ht_conf->extension_chan_offset == IWL_EXT_CHANNEL_OFFSET_AUTO)) | ||
4548 | return 0; | 4551 | return 0; |
4549 | 4552 | ||
4550 | if (ht_info->supported_chan_width != IWL_CHANNEL_WIDTH_40MHZ) | 4553 | if (sta_ht_inf) { |
4551 | return 0; | 4554 | if ((!sta_ht_inf->ht_supported) || |
4552 | 4555 | (!sta_ht_inf->cap & IEEE80211_HT_CAP_SUP_WIDTH)) | |
4553 | if (ht_info->extension_chan_offset == IWL_EXT_CHANNEL_OFFSET_AUTO) | 4556 | return 0; |
4554 | return 0; | 4557 | } |
4555 | 4558 | ||
4556 | /* no fat tx allowed on 2.4GHZ */ | ||
4557 | if (priv->phymode != MODE_IEEE80211A) | ||
4558 | return 0; | ||
4559 | return (iwl4965_is_channel_extension(priv, priv->phymode, | 4559 | return (iwl4965_is_channel_extension(priv, priv->phymode, |
4560 | ht_info->control_channel, | 4560 | iwl_ht_conf->control_channel, |
4561 | ht_info->extension_chan_offset)); | 4561 | iwl_ht_conf->extension_chan_offset)); |
4562 | } | 4562 | } |
4563 | 4563 | ||
4564 | void iwl4965_set_rxon_ht(struct iwl4965_priv *priv, struct sta_ht_info *ht_info) | 4564 | void iwl4965_set_rxon_ht(struct iwl4965_priv *priv, struct iwl_ht_info *ht_info) |
4565 | { | 4565 | { |
4566 | struct iwl4965_rxon_cmd *rxon = &priv->staging_rxon; | 4566 | struct iwl4965_rxon_cmd *rxon = &priv->staging_rxon; |
4567 | u32 val; | 4567 | u32 val; |
@@ -4570,7 +4570,7 @@ void iwl4965_set_rxon_ht(struct iwl4965_priv *priv, struct sta_ht_info *ht_info) | |||
4570 | return; | 4570 | return; |
4571 | 4571 | ||
4572 | /* Set up channel bandwidth: 20 MHz only, or 20/40 mixed if fat ok */ | 4572 | /* Set up channel bandwidth: 20 MHz only, or 20/40 mixed if fat ok */ |
4573 | if (iwl4965_is_fat_tx_allowed(priv, ht_info)) | 4573 | if (iwl4965_is_fat_tx_allowed(priv, NULL)) |
4574 | rxon->flags |= RXON_FLG_CHANNEL_MODE_MIXED_MSK; | 4574 | rxon->flags |= RXON_FLG_CHANNEL_MODE_MIXED_MSK; |
4575 | else | 4575 | else |
4576 | rxon->flags &= ~(RXON_FLG_CHANNEL_MODE_MIXED_MSK | | 4576 | rxon->flags &= ~(RXON_FLG_CHANNEL_MODE_MIXED_MSK | |
@@ -4600,20 +4600,18 @@ void iwl4965_set_rxon_ht(struct iwl4965_priv *priv, struct sta_ht_info *ht_info) | |||
4600 | break; | 4600 | break; |
4601 | } | 4601 | } |
4602 | 4602 | ||
4603 | val = ht_info->operating_mode; | 4603 | val = ht_info->ht_protection; |
4604 | 4604 | ||
4605 | rxon->flags |= cpu_to_le32(val << RXON_FLG_HT_OPERATING_MODE_POS); | 4605 | rxon->flags |= cpu_to_le32(val << RXON_FLG_HT_OPERATING_MODE_POS); |
4606 | 4606 | ||
4607 | priv->active_rate_ht[0] = ht_info->supp_rates[0]; | ||
4608 | priv->active_rate_ht[1] = ht_info->supp_rates[1]; | ||
4609 | iwl4965_set_rxon_chain(priv); | 4607 | iwl4965_set_rxon_chain(priv); |
4610 | 4608 | ||
4611 | IWL_DEBUG_ASSOC("supported HT rate 0x%X %X " | 4609 | IWL_DEBUG_ASSOC("supported HT rate 0x%X %X " |
4612 | "rxon flags 0x%X operation mode :0x%X " | 4610 | "rxon flags 0x%X operation mode :0x%X " |
4613 | "extension channel offset 0x%x " | 4611 | "extension channel offset 0x%x " |
4614 | "control chan %d\n", | 4612 | "control chan %d\n", |
4615 | priv->active_rate_ht[0], priv->active_rate_ht[1], | 4613 | ht_info->supp_mcs_set[0], ht_info->supp_mcs_set[1], |
4616 | le32_to_cpu(rxon->flags), ht_info->operating_mode, | 4614 | le32_to_cpu(rxon->flags), ht_info->ht_protection, |
4617 | ht_info->extension_chan_offset, | 4615 | ht_info->extension_chan_offset, |
4618 | ht_info->control_channel); | 4616 | ht_info->control_channel); |
4619 | return; | 4617 | return; |