diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2009-11-13 14:56:23 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-18 17:09:02 -0500 |
commit | 85f0d9e87794818356146996826b829100daa6bc (patch) | |
tree | 6420ac21cd980e3685a6adfc2d77a2cd26c92ab0 /drivers/net/wireless/iwlwifi/iwl-eeprom.c | |
parent | dfef948ed2ba69cf041840b5e860d6b4e16fa0b1 (diff) |
iwlwifi: validate enhanced tx power entry
Validate enhanced tx power entry read from EEPROM before applying the
tx power value. Different versions of EEPROM might contain different size
of table; always a good idea to make sure the entry is valid before
applying to the targeted channel.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@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 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c index 8a0709e81a9f..143728c6382e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c | |||
@@ -913,6 +913,16 @@ void iwlcore_eeprom_enhanced_txpower(struct iwl_priv *priv) | |||
913 | enhanced_txpower = (struct iwl_eeprom_enhanced_txpwr *) | 913 | enhanced_txpower = (struct iwl_eeprom_enhanced_txpwr *) |
914 | iwl_eeprom_query_addr(priv, offset); | 914 | iwl_eeprom_query_addr(priv, offset); |
915 | 915 | ||
916 | /* | ||
917 | * check for valid entry - | ||
918 | * different version of EEPROM might contain different set | ||
919 | * of enhanced tx power table | ||
920 | * always check for valid entry before process | ||
921 | * the information | ||
922 | */ | ||
923 | if (!enhanced_txpower->common || enhanced_txpower->reserved) | ||
924 | continue; | ||
925 | |||
916 | for (element = 0; element < eeprom_section_count; element++) { | 926 | for (element = 0; element < eeprom_section_count; element++) { |
917 | if (enhinfo[section].is_common) | 927 | if (enhinfo[section].is_common) |
918 | max_txpower_avg = | 928 | max_txpower_avg = |