diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/eeprom_4k.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/eeprom_4k.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_4k.c b/drivers/net/wireless/ath/ath9k/eeprom_4k.c index 4fa4d8e28c64..c40c534c6662 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c +++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c | |||
@@ -726,7 +726,7 @@ static void ath9k_hw_4k_set_txpower(struct ath_hw *ah, | |||
726 | u16 cfgCtl, | 726 | u16 cfgCtl, |
727 | u8 twiceAntennaReduction, | 727 | u8 twiceAntennaReduction, |
728 | u8 twiceMaxRegulatoryPower, | 728 | u8 twiceMaxRegulatoryPower, |
729 | u8 powerLimit) | 729 | u8 powerLimit, bool test) |
730 | { | 730 | { |
731 | struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah); | 731 | struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah); |
732 | struct ar5416_eeprom_4k *pEepData = &ah->eeprom.map4k; | 732 | struct ar5416_eeprom_4k *pEepData = &ah->eeprom.map4k; |
@@ -751,15 +751,20 @@ static void ath9k_hw_4k_set_txpower(struct ath_hw *ah, | |||
751 | 751 | ||
752 | ath9k_hw_set_4k_power_cal_table(ah, chan, &txPowerIndexOffset); | 752 | ath9k_hw_set_4k_power_cal_table(ah, chan, &txPowerIndexOffset); |
753 | 753 | ||
754 | regulatory->max_power_level = 0; | ||
754 | for (i = 0; i < ARRAY_SIZE(ratesArray); i++) { | 755 | for (i = 0; i < ARRAY_SIZE(ratesArray); i++) { |
755 | ratesArray[i] = (int16_t)(txPowerIndexOffset + ratesArray[i]); | 756 | ratesArray[i] = (int16_t)(txPowerIndexOffset + ratesArray[i]); |
756 | if (ratesArray[i] > AR5416_MAX_RATE_POWER) | 757 | if (ratesArray[i] > AR5416_MAX_RATE_POWER) |
757 | ratesArray[i] = AR5416_MAX_RATE_POWER; | 758 | ratesArray[i] = AR5416_MAX_RATE_POWER; |
759 | |||
760 | if (ratesArray[i] > regulatory->max_power_level) | ||
761 | regulatory->max_power_level = ratesArray[i]; | ||
758 | } | 762 | } |
759 | 763 | ||
764 | if (test) | ||
765 | return; | ||
760 | 766 | ||
761 | /* Update regulatory */ | 767 | /* Update regulatory */ |
762 | |||
763 | i = rate6mb; | 768 | i = rate6mb; |
764 | if (IS_CHAN_HT40(chan)) | 769 | if (IS_CHAN_HT40(chan)) |
765 | i = rateHt40_0; | 770 | i = rateHt40_0; |