diff options
author | Zhu Yi <yi.zhu@intel.com> | 2009-08-13 16:30:53 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-20 11:33:10 -0400 |
commit | 3b24716fc978db9c27c4a069e5201460479340a4 (patch) | |
tree | e7a8111573b3b5e3efd19b49ca5cc85d1dca3c53 /drivers/net/wireless/iwlwifi/iwl-eeprom.c | |
parent | 7869b0eaed0447a989d8672eed27a358aa5dde0c (diff) |
iwlwifi: cleanup HT40 extension channels setup
The patch cleans up the HT40 extension channels setup for EEPROM
band 6 and 7 to make it more readable.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-eeprom.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-eeprom.c | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c index 78c4a324a3b5..ded63320a463 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c | |||
@@ -484,14 +484,14 @@ static void iwl_init_band_reference(const struct iwl_priv *priv, | |||
484 | ? # x " " : "") | 484 | ? # x " " : "") |
485 | 485 | ||
486 | /** | 486 | /** |
487 | * iwl_set_ht40_chan_info - Copy ht40 channel info into driver's priv. | 487 | * iwl_mod_ht40_chan_info - Copy ht40 channel info into driver's priv. |
488 | * | 488 | * |
489 | * Does not set up a command, or touch hardware. | 489 | * Does not set up a command, or touch hardware. |
490 | */ | 490 | */ |
491 | static int iwl_set_ht40_chan_info(struct iwl_priv *priv, | 491 | static int iwl_mod_ht40_chan_info(struct iwl_priv *priv, |
492 | enum ieee80211_band band, u16 channel, | 492 | enum ieee80211_band band, u16 channel, |
493 | const struct iwl_eeprom_channel *eeprom_ch, | 493 | const struct iwl_eeprom_channel *eeprom_ch, |
494 | u8 ht40_extension_channel) | 494 | u8 clear_ht40_extension_channel) |
495 | { | 495 | { |
496 | struct iwl_channel_info *ch_info; | 496 | struct iwl_channel_info *ch_info; |
497 | 497 | ||
@@ -523,7 +523,7 @@ static int iwl_set_ht40_chan_info(struct iwl_priv *priv, | |||
523 | ch_info->ht40_min_power = 0; | 523 | ch_info->ht40_min_power = 0; |
524 | ch_info->ht40_scan_power = eeprom_ch->max_power_avg; | 524 | ch_info->ht40_scan_power = eeprom_ch->max_power_avg; |
525 | ch_info->ht40_flags = eeprom_ch->flags; | 525 | ch_info->ht40_flags = eeprom_ch->flags; |
526 | ch_info->ht40_extension_channel = ht40_extension_channel; | 526 | ch_info->ht40_extension_channel &= ~clear_ht40_extension_channel; |
527 | 527 | ||
528 | return 0; | 528 | return 0; |
529 | } | 529 | } |
@@ -592,8 +592,7 @@ int iwl_init_channel_map(struct iwl_priv *priv) | |||
592 | /* First write that ht40 is not enabled, and then enable | 592 | /* First write that ht40 is not enabled, and then enable |
593 | * one by one */ | 593 | * one by one */ |
594 | ch_info->ht40_extension_channel = | 594 | ch_info->ht40_extension_channel = |
595 | (IEEE80211_CHAN_NO_HT40PLUS | | 595 | IEEE80211_CHAN_NO_HT40; |
596 | IEEE80211_CHAN_NO_HT40MINUS); | ||
597 | 596 | ||
598 | if (!(is_channel_valid(ch_info))) { | 597 | if (!(is_channel_valid(ch_info))) { |
599 | IWL_DEBUG_INFO(priv, "Ch. %d Flags %x [%sGHz] - " | 598 | IWL_DEBUG_INFO(priv, "Ch. %d Flags %x [%sGHz] - " |
@@ -652,7 +651,6 @@ int iwl_init_channel_map(struct iwl_priv *priv) | |||
652 | /* Two additional EEPROM bands for 2.4 and 5 GHz HT40 channels */ | 651 | /* Two additional EEPROM bands for 2.4 and 5 GHz HT40 channels */ |
653 | for (band = 6; band <= 7; band++) { | 652 | for (band = 6; band <= 7; band++) { |
654 | enum ieee80211_band ieeeband; | 653 | enum ieee80211_band ieeeband; |
655 | u8 ht40_extension_chan; | ||
656 | 654 | ||
657 | iwl_init_band_reference(priv, band, &eeprom_ch_count, | 655 | iwl_init_band_reference(priv, band, &eeprom_ch_count, |
658 | &eeprom_ch_info, &eeprom_ch_index); | 656 | &eeprom_ch_info, &eeprom_ch_index); |
@@ -663,28 +661,17 @@ int iwl_init_channel_map(struct iwl_priv *priv) | |||
663 | 661 | ||
664 | /* Loop through each band adding each of the channels */ | 662 | /* Loop through each band adding each of the channels */ |
665 | for (ch = 0; ch < eeprom_ch_count; ch++) { | 663 | for (ch = 0; ch < eeprom_ch_count; ch++) { |
666 | |||
667 | if ((band == 6) && | ||
668 | ((eeprom_ch_index[ch] == 5) || | ||
669 | (eeprom_ch_index[ch] == 6) || | ||
670 | (eeprom_ch_index[ch] == 7))) | ||
671 | /* both are allowed: above and below */ | ||
672 | ht40_extension_chan = 0; | ||
673 | else | ||
674 | ht40_extension_chan = | ||
675 | IEEE80211_CHAN_NO_HT40MINUS; | ||
676 | |||
677 | /* Set up driver's info for lower half */ | 664 | /* Set up driver's info for lower half */ |
678 | iwl_set_ht40_chan_info(priv, ieeeband, | 665 | iwl_mod_ht40_chan_info(priv, ieeeband, |
679 | eeprom_ch_index[ch], | 666 | eeprom_ch_index[ch], |
680 | &(eeprom_ch_info[ch]), | 667 | &eeprom_ch_info[ch], |
681 | ht40_extension_chan); | 668 | IEEE80211_CHAN_NO_HT40PLUS); |
682 | 669 | ||
683 | /* Set up driver's info for upper half */ | 670 | /* Set up driver's info for upper half */ |
684 | iwl_set_ht40_chan_info(priv, ieeeband, | 671 | iwl_mod_ht40_chan_info(priv, ieeeband, |
685 | (eeprom_ch_index[ch] + 4), | 672 | eeprom_ch_index[ch] + 4, |
686 | &(eeprom_ch_info[ch]), | 673 | &eeprom_ch_info[ch], |
687 | IEEE80211_CHAN_NO_HT40PLUS); | 674 | IEEE80211_CHAN_NO_HT40MINUS); |
688 | } | 675 | } |
689 | } | 676 | } |
690 | 677 | ||