diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-04-16 16:22:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-04-17 14:57:12 -0400 |
commit | 6010e72cdf3cb614278812cb00ecff2d1aee03dc (patch) | |
tree | 9410632d52043a0e54dfa9d3f8081c91be16c936 /drivers/net/wireless/ath/ath9k | |
parent | 1e66eda1d40c9ce3ff38782da066a14e1b88ac50 (diff) |
ath9k: merge power correction constants
The existing constants are used for reduction/increase
tx power level on devices with 2x2 and 3x3 chainmask.
Both reduction and increase must use the same value, so
it makes no sense to use separate constants for them.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/eeprom.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/eeprom.h | 7 |
2 files changed, 6 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c index 6a64dec486d0..9457825c2c7c 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom.c +++ b/drivers/net/wireless/ath/ath9k/eeprom.c | |||
@@ -303,10 +303,10 @@ u16 ath9k_hw_get_scaled_power(struct ath_hw *ah, u16 power_limit, | |||
303 | case 1: | 303 | case 1: |
304 | break; | 304 | break; |
305 | case 2: | 305 | case 2: |
306 | reduction += REDUCE_SCALED_POWER_BY_TWO_CHAIN; | 306 | reduction += POWER_CORRECTION_FOR_TWO_CHAIN; |
307 | break; | 307 | break; |
308 | case 3: | 308 | case 3: |
309 | reduction += REDUCE_SCALED_POWER_BY_THREE_CHAIN; | 309 | reduction += POWER_CORRECTION_FOR_THREE_CHAIN; |
310 | break; | 310 | break; |
311 | } | 311 | } |
312 | 312 | ||
@@ -327,10 +327,10 @@ void ath9k_hw_update_regulatory_maxpower(struct ath_hw *ah) | |||
327 | case 1: | 327 | case 1: |
328 | break; | 328 | break; |
329 | case 2: | 329 | case 2: |
330 | regulatory->max_power_level += INCREASE_MAXPOW_BY_TWO_CHAIN; | 330 | regulatory->max_power_level += POWER_CORRECTION_FOR_TWO_CHAIN; |
331 | break; | 331 | break; |
332 | case 3: | 332 | case 3: |
333 | regulatory->max_power_level += INCREASE_MAXPOW_BY_THREE_CHAIN; | 333 | regulatory->max_power_level += POWER_CORRECTION_FOR_THREE_CHAIN; |
334 | break; | 334 | break; |
335 | default: | 335 | default: |
336 | ath_dbg(common, EEPROM, "Invalid chainmask configuration\n"); | 336 | ath_dbg(common, EEPROM, "Invalid chainmask configuration\n"); |
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h index 8d779b44fe7c..689f0d02ca0c 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom.h +++ b/drivers/net/wireless/ath/ath9k/eeprom.h | |||
@@ -79,11 +79,8 @@ | |||
79 | #define SUB_NUM_CTL_MODES_AT_5G_40 2 | 79 | #define SUB_NUM_CTL_MODES_AT_5G_40 2 |
80 | #define SUB_NUM_CTL_MODES_AT_2G_40 3 | 80 | #define SUB_NUM_CTL_MODES_AT_2G_40 3 |
81 | 81 | ||
82 | #define INCREASE_MAXPOW_BY_TWO_CHAIN 6 /* 10*log10(2)*2 */ | 82 | #define POWER_CORRECTION_FOR_TWO_CHAIN 6 /* 10*log10(2)*2 */ |
83 | #define INCREASE_MAXPOW_BY_THREE_CHAIN 10 /* 10*log10(3)*2 */ | 83 | #define POWER_CORRECTION_FOR_THREE_CHAIN 10 /* 10*log10(3)*2 */ |
84 | |||
85 | #define REDUCE_SCALED_POWER_BY_TWO_CHAIN 6 /* 10*log10(2)*2 */ | ||
86 | #define REDUCE_SCALED_POWER_BY_THREE_CHAIN 10 /* 10*log10(3)*2 */ | ||
87 | 84 | ||
88 | /* | 85 | /* |
89 | * For AR9285 and later chipsets, the following bits are not being programmed | 86 | * For AR9285 and later chipsets, the following bits are not being programmed |