Commit 6010e72c authored by Gabor Juhos's avatar Gabor Juhos Committed by John W. Linville

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: default avatarGabor Juhos <juhosg@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1e66eda1
...@@ -303,10 +303,10 @@ u16 ath9k_hw_get_scaled_power(struct ath_hw *ah, u16 power_limit, ...@@ -303,10 +303,10 @@ u16 ath9k_hw_get_scaled_power(struct ath_hw *ah, u16 power_limit,
case 1: case 1:
break; break;
case 2: case 2:
reduction += REDUCE_SCALED_POWER_BY_TWO_CHAIN; reduction += POWER_CORRECTION_FOR_TWO_CHAIN;
break; break;
case 3: case 3:
reduction += REDUCE_SCALED_POWER_BY_THREE_CHAIN; reduction += POWER_CORRECTION_FOR_THREE_CHAIN;
break; break;
} }
...@@ -327,10 +327,10 @@ void ath9k_hw_update_regulatory_maxpower(struct ath_hw *ah) ...@@ -327,10 +327,10 @@ void ath9k_hw_update_regulatory_maxpower(struct ath_hw *ah)
case 1: case 1:
break; break;
case 2: case 2:
regulatory->max_power_level += INCREASE_MAXPOW_BY_TWO_CHAIN; regulatory->max_power_level += POWER_CORRECTION_FOR_TWO_CHAIN;
break; break;
case 3: case 3:
regulatory->max_power_level += INCREASE_MAXPOW_BY_THREE_CHAIN; regulatory->max_power_level += POWER_CORRECTION_FOR_THREE_CHAIN;
break; break;
default: default:
ath_dbg(common, EEPROM, "Invalid chainmask configuration\n"); ath_dbg(common, EEPROM, "Invalid chainmask configuration\n");
......
...@@ -79,11 +79,8 @@ ...@@ -79,11 +79,8 @@
#define SUB_NUM_CTL_MODES_AT_5G_40 2 #define SUB_NUM_CTL_MODES_AT_5G_40 2
#define SUB_NUM_CTL_MODES_AT_2G_40 3 #define SUB_NUM_CTL_MODES_AT_2G_40 3
#define INCREASE_MAXPOW_BY_TWO_CHAIN 6 /* 10*log10(2)*2 */ #define POWER_CORRECTION_FOR_TWO_CHAIN 6 /* 10*log10(2)*2 */
#define INCREASE_MAXPOW_BY_THREE_CHAIN 10 /* 10*log10(3)*2 */ #define POWER_CORRECTION_FOR_THREE_CHAIN 10 /* 10*log10(3)*2 */
#define REDUCE_SCALED_POWER_BY_TWO_CHAIN 6 /* 10*log10(2)*2 */
#define REDUCE_SCALED_POWER_BY_THREE_CHAIN 10 /* 10*log10(3)*2 */
/* /*
* For AR9285 and later chipsets, the following bits are not being programmed * For AR9285 and later chipsets, the following bits are not being programmed
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment