aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/eeprom_def.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-08-17 21:07:23 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-20 11:36:03 -0400
commit608b88cb34b0e70a538ee1fc334cc833ef691836 (patch)
tree6d2a363cea722241581306964da6cff8724b407a /drivers/net/wireless/ath/ath9k/eeprom_def.c
parent4c48381786159ba3f3d8a33d967aeb049341a220 (diff)
ath: move regulatory info into shared common structure
This moves the shared regulatory structure into the common structure. We will use this ongoing for common data. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/eeprom_def.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_def.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c
index 5211ad94c8fb..ae7fb5dcb266 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
@@ -904,6 +904,7 @@ static void ath9k_hw_set_def_power_per_rate_table(struct ath_hw *ah,
904#define REDUCE_SCALED_POWER_BY_TWO_CHAIN 6 /* 10*log10(2)*2 */ 904#define REDUCE_SCALED_POWER_BY_TWO_CHAIN 6 /* 10*log10(2)*2 */
905#define REDUCE_SCALED_POWER_BY_THREE_CHAIN 10 /* 10*log10(3)*2 */ 905#define REDUCE_SCALED_POWER_BY_THREE_CHAIN 10 /* 10*log10(3)*2 */
906 906
907 struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
907 struct ar5416_eeprom_def *pEepData = &ah->eeprom.def; 908 struct ar5416_eeprom_def *pEepData = &ah->eeprom.def;
908 u16 twiceMaxEdgePower = AR5416_MAX_RATE_POWER; 909 u16 twiceMaxEdgePower = AR5416_MAX_RATE_POWER;
909 static const u16 tpScaleReductionTable[5] = 910 static const u16 tpScaleReductionTable[5] =
@@ -953,9 +954,9 @@ static void ath9k_hw_set_def_power_per_rate_table(struct ath_hw *ah,
953 954
954 maxRegAllowedPower = twiceMaxRegulatoryPower + twiceLargestAntenna; 955 maxRegAllowedPower = twiceMaxRegulatoryPower + twiceLargestAntenna;
955 956
956 if (ah->regulatory.tp_scale != ATH9K_TP_SCALE_MAX) { 957 if (regulatory->tp_scale != ATH9K_TP_SCALE_MAX) {
957 maxRegAllowedPower -= 958 maxRegAllowedPower -=
958 (tpScaleReductionTable[(ah->regulatory.tp_scale)] * 2); 959 (tpScaleReductionTable[(regulatory->tp_scale)] * 2);
959 } 960 }
960 961
961 scaledPower = min(powerLimit, maxRegAllowedPower); 962 scaledPower = min(powerLimit, maxRegAllowedPower);
@@ -1163,6 +1164,7 @@ static void ath9k_hw_def_set_txpower(struct ath_hw *ah,
1163 u8 powerLimit) 1164 u8 powerLimit)
1164{ 1165{
1165#define RT_AR_DELTA(x) (ratesArray[x] - cck_ofdm_delta) 1166#define RT_AR_DELTA(x) (ratesArray[x] - cck_ofdm_delta)
1167 struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
1166 struct ar5416_eeprom_def *pEepData = &ah->eeprom.def; 1168 struct ar5416_eeprom_def *pEepData = &ah->eeprom.def;
1167 struct modal_eep_header *pModal = 1169 struct modal_eep_header *pModal =
1168 &(pEepData->modalHeader[IS_CHAN_2GHZ(chan)]); 1170 &(pEepData->modalHeader[IS_CHAN_2GHZ(chan)]);
@@ -1292,19 +1294,19 @@ static void ath9k_hw_def_set_txpower(struct ath_hw *ah,
1292 i = rateHt20_0; 1294 i = rateHt20_0;
1293 1295
1294 if (AR_SREV_9280_10_OR_LATER(ah)) 1296 if (AR_SREV_9280_10_OR_LATER(ah))
1295 ah->regulatory.max_power_level = 1297 regulatory->max_power_level =
1296 ratesArray[i] + AR5416_PWR_TABLE_OFFSET * 2; 1298 ratesArray[i] + AR5416_PWR_TABLE_OFFSET * 2;
1297 else 1299 else
1298 ah->regulatory.max_power_level = ratesArray[i]; 1300 regulatory->max_power_level = ratesArray[i];
1299 1301
1300 switch(ar5416_get_ntxchains(ah->txchainmask)) { 1302 switch(ar5416_get_ntxchains(ah->txchainmask)) {
1301 case 1: 1303 case 1:
1302 break; 1304 break;
1303 case 2: 1305 case 2:
1304 ah->regulatory.max_power_level += INCREASE_MAXPOW_BY_TWO_CHAIN; 1306 regulatory->max_power_level += INCREASE_MAXPOW_BY_TWO_CHAIN;
1305 break; 1307 break;
1306 case 3: 1308 case 3:
1307 ah->regulatory.max_power_level += INCREASE_MAXPOW_BY_THREE_CHAIN; 1309 regulatory->max_power_level += INCREASE_MAXPOW_BY_THREE_CHAIN;
1308 break; 1310 break;
1309 default: 1311 default:
1310 DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, 1312 DPRINTF(ah->ah_sc, ATH_DBG_EEPROM,