aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/eeprom_def.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/eeprom_def.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_def.c38
1 files changed, 3 insertions, 35 deletions
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c
index 619b95d764ff..b5fba8b18b8b 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
@@ -991,9 +991,6 @@ static void ath9k_hw_set_def_power_per_rate_table(struct ath_hw *ah,
991 u16 antenna_reduction, 991 u16 antenna_reduction,
992 u16 powerLimit) 992 u16 powerLimit)
993{ 993{
994#define REDUCE_SCALED_POWER_BY_TWO_CHAIN 6 /* 10*log10(2)*2 */
995#define REDUCE_SCALED_POWER_BY_THREE_CHAIN 9 /* 10*log10(3)*2 */
996
997 struct ar5416_eeprom_def *pEepData = &ah->eeprom.def; 994 struct ar5416_eeprom_def *pEepData = &ah->eeprom.def;
998 u16 twiceMaxEdgePower; 995 u16 twiceMaxEdgePower;
999 int i; 996 int i;
@@ -1027,24 +1024,8 @@ static void ath9k_hw_set_def_power_per_rate_table(struct ath_hw *ah,
1027 1024
1028 ath9k_hw_get_channel_centers(ah, chan, &centers); 1025 ath9k_hw_get_channel_centers(ah, chan, &centers);
1029 1026
1030 scaledPower = powerLimit - antenna_reduction; 1027 scaledPower = ath9k_hw_get_scaled_power(ah, powerLimit,
1031 1028 antenna_reduction);
1032 switch (ar5416_get_ntxchains(tx_chainmask)) {
1033 case 1:
1034 break;
1035 case 2:
1036 if (scaledPower > REDUCE_SCALED_POWER_BY_TWO_CHAIN)
1037 scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN;
1038 else
1039 scaledPower = 0;
1040 break;
1041 case 3:
1042 if (scaledPower > REDUCE_SCALED_POWER_BY_THREE_CHAIN)
1043 scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN;
1044 else
1045 scaledPower = 0;
1046 break;
1047 }
1048 1029
1049 if (IS_CHAN_2GHZ(chan)) { 1030 if (IS_CHAN_2GHZ(chan)) {
1050 numCtlModes = ARRAY_SIZE(ctlModesFor11g) - 1031 numCtlModes = ARRAY_SIZE(ctlModesFor11g) -
@@ -1263,20 +1244,7 @@ static void ath9k_hw_def_set_txpower(struct ath_hw *ah,
1263 regulatory->max_power_level = ratesArray[i]; 1244 regulatory->max_power_level = ratesArray[i];
1264 } 1245 }
1265 1246
1266 switch(ar5416_get_ntxchains(ah->txchainmask)) { 1247 ath9k_hw_update_regulatory_maxpower(ah);
1267 case 1:
1268 break;
1269 case 2:
1270 regulatory->max_power_level += INCREASE_MAXPOW_BY_TWO_CHAIN;
1271 break;
1272 case 3:
1273 regulatory->max_power_level += INCREASE_MAXPOW_BY_THREE_CHAIN;
1274 break;
1275 default:
1276 ath_dbg(ath9k_hw_common(ah), EEPROM,
1277 "Invalid chainmask configuration\n");
1278 break;
1279 }
1280 1248
1281 if (test) 1249 if (test)
1282 return; 1250 return;