aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/eeprom.c
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2009-02-09 02:57:26 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-13 13:45:10 -0500
commit2660b81a378ab227b78c4cc618453fa7e19a7c7b (patch)
treeea305af43f0e27c86538fecce6c9a4e0151dbc78 /drivers/net/wireless/ath9k/eeprom.c
parentf74df6fbe31561091bf42be0ed30232be2b9d3ac (diff)
ath9k: Remove all the useless ah_ variable prefixes
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/eeprom.c')
-rw-r--r--drivers/net/wireless/ath9k/eeprom.c102
1 files changed, 51 insertions, 51 deletions
diff --git a/drivers/net/wireless/ath9k/eeprom.c b/drivers/net/wireless/ath9k/eeprom.c
index 2e604e1fb3e1..c0359ad2bc7b 100644
--- a/drivers/net/wireless/ath9k/eeprom.c
+++ b/drivers/net/wireless/ath9k/eeprom.c
@@ -27,7 +27,7 @@ static void ath9k_hw_analog_shift_rmw(struct ath_hw *ah,
27 27
28 REG_WRITE(ah, reg, regVal); 28 REG_WRITE(ah, reg, regVal);
29 29
30 if (ah->ah_config.analog_shiftreg) 30 if (ah->config.analog_shiftreg)
31 udelay(100); 31 udelay(100);
32 32
33 return; 33 return;
@@ -268,18 +268,18 @@ static u16 ath9k_hw_get_max_edge_power(u16 freq,
268 268
269static int ath9k_hw_4k_get_eeprom_ver(struct ath_hw *ah) 269static int ath9k_hw_4k_get_eeprom_ver(struct ath_hw *ah)
270{ 270{
271 return ((ah->ah_eeprom.map4k.baseEepHeader.version >> 12) & 0xF); 271 return ((ah->eeprom.map4k.baseEepHeader.version >> 12) & 0xF);
272} 272}
273 273
274static int ath9k_hw_4k_get_eeprom_rev(struct ath_hw *ah) 274static int ath9k_hw_4k_get_eeprom_rev(struct ath_hw *ah)
275{ 275{
276 return ((ah->ah_eeprom.map4k.baseEepHeader.version) & 0xFFF); 276 return ((ah->eeprom.map4k.baseEepHeader.version) & 0xFFF);
277} 277}
278 278
279static bool ath9k_hw_4k_fill_eeprom(struct ath_hw *ah) 279static bool ath9k_hw_4k_fill_eeprom(struct ath_hw *ah)
280{ 280{
281#define SIZE_EEPROM_4K (sizeof(struct ar5416_eeprom_4k) / sizeof(u16)) 281#define SIZE_EEPROM_4K (sizeof(struct ar5416_eeprom_4k) / sizeof(u16))
282 struct ar5416_eeprom_4k *eep = &ah->ah_eeprom.map4k; 282 struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k;
283 u16 *eep_data; 283 u16 *eep_data;
284 int addr, eep_start_loc = 0; 284 int addr, eep_start_loc = 0;
285 285
@@ -308,7 +308,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
308{ 308{
309#define EEPROM_4K_SIZE (sizeof(struct ar5416_eeprom_4k) / sizeof(u16)) 309#define EEPROM_4K_SIZE (sizeof(struct ar5416_eeprom_4k) / sizeof(u16))
310 struct ar5416_eeprom_4k *eep = 310 struct ar5416_eeprom_4k *eep =
311 (struct ar5416_eeprom_4k *) &ah->ah_eeprom.map4k; 311 (struct ar5416_eeprom_4k *) &ah->eeprom.map4k;
312 u16 *eepdata, temp, magic, magic2; 312 u16 *eepdata, temp, magic, magic2;
313 u32 sum = 0, el; 313 u32 sum = 0, el;
314 bool need_swap = false; 314 bool need_swap = false;
@@ -332,7 +332,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
332 332
333 if (magic2 == AR5416_EEPROM_MAGIC) { 333 if (magic2 == AR5416_EEPROM_MAGIC) {
334 need_swap = true; 334 need_swap = true;
335 eepdata = (u16 *) (&ah->ah_eeprom); 335 eepdata = (u16 *) (&ah->eeprom);
336 336
337 for (addr = 0; addr < EEPROM_4K_SIZE; addr++) { 337 for (addr = 0; addr < EEPROM_4K_SIZE; addr++) {
338 temp = swab16(*eepdata); 338 temp = swab16(*eepdata);
@@ -359,16 +359,16 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
359 need_swap ? "True" : "False"); 359 need_swap ? "True" : "False");
360 360
361 if (need_swap) 361 if (need_swap)
362 el = swab16(ah->ah_eeprom.map4k.baseEepHeader.length); 362 el = swab16(ah->eeprom.map4k.baseEepHeader.length);
363 else 363 else
364 el = ah->ah_eeprom.map4k.baseEepHeader.length; 364 el = ah->eeprom.map4k.baseEepHeader.length;
365 365
366 if (el > sizeof(struct ar5416_eeprom_def)) 366 if (el > sizeof(struct ar5416_eeprom_def))
367 el = sizeof(struct ar5416_eeprom_4k) / sizeof(u16); 367 el = sizeof(struct ar5416_eeprom_4k) / sizeof(u16);
368 else 368 else
369 el = el / sizeof(u16); 369 el = el / sizeof(u16);
370 370
371 eepdata = (u16 *)(&ah->ah_eeprom); 371 eepdata = (u16 *)(&ah->eeprom);
372 372
373 for (i = 0; i < el; i++) 373 for (i = 0; i < el; i++)
374 sum ^= *eepdata++; 374 sum ^= *eepdata++;
@@ -433,7 +433,7 @@ static int ath9k_hw_4k_check_eeprom(struct ath_hw *ah)
433static u32 ath9k_hw_4k_get_eeprom(struct ath_hw *ah, 433static u32 ath9k_hw_4k_get_eeprom(struct ath_hw *ah,
434 enum eeprom_param param) 434 enum eeprom_param param)
435{ 435{
436 struct ar5416_eeprom_4k *eep = &ah->ah_eeprom.map4k; 436 struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k;
437 struct modal_eep_4k_header *pModal = &eep->modalHeader; 437 struct modal_eep_4k_header *pModal = &eep->modalHeader;
438 struct base_eep_header_4k *pBase = &eep->baseEepHeader; 438 struct base_eep_header_4k *pBase = &eep->baseEepHeader;
439 439
@@ -643,7 +643,7 @@ static bool ath9k_hw_set_4k_power_cal_table(struct ath_hw *ah,
643 struct ath9k_channel *chan, 643 struct ath9k_channel *chan,
644 int16_t *pTxPowerIndexOffset) 644 int16_t *pTxPowerIndexOffset)
645{ 645{
646 struct ar5416_eeprom_4k *pEepData = &ah->ah_eeprom.map4k; 646 struct ar5416_eeprom_4k *pEepData = &ah->eeprom.map4k;
647 struct cal_data_per_freq_4k *pRawDataset; 647 struct cal_data_per_freq_4k *pRawDataset;
648 u8 *pCalBChans = NULL; 648 u8 *pCalBChans = NULL;
649 u16 pdGainOverlap_t2; 649 u16 pdGainOverlap_t2;
@@ -692,7 +692,7 @@ static bool ath9k_hw_set_4k_power_cal_table(struct ath_hw *ah,
692 692
693 for (i = 0; i < AR5416_MAX_CHAINS; i++) { 693 for (i = 0; i < AR5416_MAX_CHAINS; i++) {
694 if (AR_SREV_5416_V20_OR_LATER(ah) && 694 if (AR_SREV_5416_V20_OR_LATER(ah) &&
695 (ah->ah_rxchainmask == 5 || ah->ah_txchainmask == 5) && 695 (ah->rxchainmask == 5 || ah->txchainmask == 5) &&
696 (i != 0)) { 696 (i != 0)) {
697 regChainOffset = (i == 1) ? 0x2000 : 0x1000; 697 regChainOffset = (i == 1) ? 0x2000 : 0x1000;
698 } else 698 } else
@@ -763,7 +763,7 @@ static bool ath9k_hw_set_4k_power_per_rate_table(struct ath_hw *ah,
763 u16 twiceMaxRegulatoryPower, 763 u16 twiceMaxRegulatoryPower,
764 u16 powerLimit) 764 u16 powerLimit)
765{ 765{
766 struct ar5416_eeprom_4k *pEepData = &ah->ah_eeprom.map4k; 766 struct ar5416_eeprom_4k *pEepData = &ah->eeprom.map4k;
767 u16 twiceMaxEdgePower = AR5416_MAX_RATE_POWER; 767 u16 twiceMaxEdgePower = AR5416_MAX_RATE_POWER;
768 static const u16 tpScaleReductionTable[5] = 768 static const u16 tpScaleReductionTable[5] =
769 { 0, 3, 6, 9, AR5416_MAX_RATE_POWER }; 769 { 0, 3, 6, 9, AR5416_MAX_RATE_POWER };
@@ -791,7 +791,7 @@ static bool ath9k_hw_set_4k_power_per_rate_table(struct ath_hw *ah,
791 int tx_chainmask; 791 int tx_chainmask;
792 u16 twiceMinEdgePower; 792 u16 twiceMinEdgePower;
793 793
794 tx_chainmask = ah->ah_txchainmask; 794 tx_chainmask = ah->txchainmask;
795 795
796 ath9k_hw_get_channel_centers(ah, chan, &centers); 796 ath9k_hw_get_channel_centers(ah, chan, &centers);
797 797
@@ -997,7 +997,7 @@ static int ath9k_hw_4k_set_txpower(struct ath_hw *ah,
997 u8 twiceMaxRegulatoryPower, 997 u8 twiceMaxRegulatoryPower,
998 u8 powerLimit) 998 u8 powerLimit)
999{ 999{
1000 struct ar5416_eeprom_4k *pEepData = &ah->ah_eeprom.map4k; 1000 struct ar5416_eeprom_4k *pEepData = &ah->eeprom.map4k;
1001 struct modal_eep_4k_header *pModal = &pEepData->modalHeader; 1001 struct modal_eep_4k_header *pModal = &pEepData->modalHeader;
1002 int16_t ratesArray[Ar5416RateSize]; 1002 int16_t ratesArray[Ar5416RateSize];
1003 int16_t txPowerIndexOffset = 0; 1003 int16_t txPowerIndexOffset = 0;
@@ -1121,7 +1121,7 @@ static void ath9k_hw_4k_set_addac(struct ath_hw *ah,
1121 struct ath9k_channel *chan) 1121 struct ath9k_channel *chan)
1122{ 1122{
1123 struct modal_eep_4k_header *pModal; 1123 struct modal_eep_4k_header *pModal;
1124 struct ar5416_eeprom_4k *eep = &ah->ah_eeprom.map4k; 1124 struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k;
1125 u8 biaslevel; 1125 u8 biaslevel;
1126 1126
1127 if (ah->hw_version.macVersion != AR_SREV_VERSION_9160) 1127 if (ah->hw_version.macVersion != AR_SREV_VERSION_9160)
@@ -1134,8 +1134,8 @@ static void ath9k_hw_4k_set_addac(struct ath_hw *ah,
1134 1134
1135 if (pModal->xpaBiasLvl != 0xff) { 1135 if (pModal->xpaBiasLvl != 0xff) {
1136 biaslevel = pModal->xpaBiasLvl; 1136 biaslevel = pModal->xpaBiasLvl;
1137 INI_RA(&ah->ah_iniAddac, 7, 1) = 1137 INI_RA(&ah->iniAddac, 7, 1) =
1138 (INI_RA(&ah->ah_iniAddac, 7, 1) & (~0x18)) | biaslevel << 3; 1138 (INI_RA(&ah->iniAddac, 7, 1) & (~0x18)) | biaslevel << 3;
1139 } 1139 }
1140} 1140}
1141 1141
@@ -1143,7 +1143,7 @@ static bool ath9k_hw_4k_set_board_values(struct ath_hw *ah,
1143 struct ath9k_channel *chan) 1143 struct ath9k_channel *chan)
1144{ 1144{
1145 struct modal_eep_4k_header *pModal; 1145 struct modal_eep_4k_header *pModal;
1146 struct ar5416_eeprom_4k *eep = &ah->ah_eeprom.map4k; 1146 struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k;
1147 int regChainOffset; 1147 int regChainOffset;
1148 u8 txRxAttenLocal; 1148 u8 txRxAttenLocal;
1149 u8 ob[5], db1[5], db2[5]; 1149 u8 ob[5], db1[5], db2[5];
@@ -1328,7 +1328,7 @@ static bool ath9k_hw_4k_set_board_values(struct ath_hw *ah,
1328static u16 ath9k_hw_4k_get_eeprom_antenna_cfg(struct ath_hw *ah, 1328static u16 ath9k_hw_4k_get_eeprom_antenna_cfg(struct ath_hw *ah,
1329 struct ath9k_channel *chan) 1329 struct ath9k_channel *chan)
1330{ 1330{
1331 struct ar5416_eeprom_4k *eep = &ah->ah_eeprom.map4k; 1331 struct ar5416_eeprom_4k *eep = &ah->eeprom.map4k;
1332 struct modal_eep_4k_header *pModal = &eep->modalHeader; 1332 struct modal_eep_4k_header *pModal = &eep->modalHeader;
1333 1333
1334 return pModal->antCtrlCommon & 0xFFFF; 1334 return pModal->antCtrlCommon & 0xFFFF;
@@ -1343,19 +1343,19 @@ static u8 ath9k_hw_4k_get_num_ant_config(struct ath_hw *ah,
1343u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz) 1343u16 ath9k_hw_4k_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
1344{ 1344{
1345#define EEP_MAP4K_SPURCHAN \ 1345#define EEP_MAP4K_SPURCHAN \
1346 (ah->ah_eeprom.map4k.modalHeader.spurChans[i].spurChan) 1346 (ah->eeprom.map4k.modalHeader.spurChans[i].spurChan)
1347 1347
1348 u16 spur_val = AR_NO_SPUR; 1348 u16 spur_val = AR_NO_SPUR;
1349 1349
1350 DPRINTF(ah->ah_sc, ATH_DBG_ANI, 1350 DPRINTF(ah->ah_sc, ATH_DBG_ANI,
1351 "Getting spur idx %d is2Ghz. %d val %x\n", 1351 "Getting spur idx %d is2Ghz. %d val %x\n",
1352 i, is2GHz, ah->ah_config.spurchans[i][is2GHz]); 1352 i, is2GHz, ah->config.spurchans[i][is2GHz]);
1353 1353
1354 switch (ah->ah_config.spurmode) { 1354 switch (ah->config.spurmode) {
1355 case SPUR_DISABLE: 1355 case SPUR_DISABLE:
1356 break; 1356 break;
1357 case SPUR_ENABLE_IOCTL: 1357 case SPUR_ENABLE_IOCTL:
1358 spur_val = ah->ah_config.spurchans[i][is2GHz]; 1358 spur_val = ah->config.spurchans[i][is2GHz];
1359 DPRINTF(ah->ah_sc, ATH_DBG_ANI, 1359 DPRINTF(ah->ah_sc, ATH_DBG_ANI,
1360 "Getting spur val from new loc. %d\n", spur_val); 1360 "Getting spur val from new loc. %d\n", spur_val);
1361 break; 1361 break;
@@ -1389,18 +1389,18 @@ struct eeprom_ops eep_4k_ops = {
1389 1389
1390static int ath9k_hw_def_get_eeprom_ver(struct ath_hw *ah) 1390static int ath9k_hw_def_get_eeprom_ver(struct ath_hw *ah)
1391{ 1391{
1392 return ((ah->ah_eeprom.def.baseEepHeader.version >> 12) & 0xF); 1392 return ((ah->eeprom.def.baseEepHeader.version >> 12) & 0xF);
1393} 1393}
1394 1394
1395static int ath9k_hw_def_get_eeprom_rev(struct ath_hw *ah) 1395static int ath9k_hw_def_get_eeprom_rev(struct ath_hw *ah)
1396{ 1396{
1397 return ((ah->ah_eeprom.def.baseEepHeader.version) & 0xFFF); 1397 return ((ah->eeprom.def.baseEepHeader.version) & 0xFFF);
1398} 1398}
1399 1399
1400static bool ath9k_hw_def_fill_eeprom(struct ath_hw *ah) 1400static bool ath9k_hw_def_fill_eeprom(struct ath_hw *ah)
1401{ 1401{
1402#define SIZE_EEPROM_DEF (sizeof(struct ar5416_eeprom_def) / sizeof(u16)) 1402#define SIZE_EEPROM_DEF (sizeof(struct ar5416_eeprom_def) / sizeof(u16))
1403 struct ar5416_eeprom_def *eep = &ah->ah_eeprom.def; 1403 struct ar5416_eeprom_def *eep = &ah->eeprom.def;
1404 u16 *eep_data; 1404 u16 *eep_data;
1405 int addr, ar5416_eep_start_loc = 0x100; 1405 int addr, ar5416_eep_start_loc = 0x100;
1406 1406
@@ -1422,7 +1422,7 @@ static bool ath9k_hw_def_fill_eeprom(struct ath_hw *ah)
1422static int ath9k_hw_def_check_eeprom(struct ath_hw *ah) 1422static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)
1423{ 1423{
1424 struct ar5416_eeprom_def *eep = 1424 struct ar5416_eeprom_def *eep =
1425 (struct ar5416_eeprom_def *) &ah->ah_eeprom.def; 1425 (struct ar5416_eeprom_def *) &ah->eeprom.def;
1426 u16 *eepdata, temp, magic, magic2; 1426 u16 *eepdata, temp, magic, magic2;
1427 u32 sum = 0, el; 1427 u32 sum = 0, el;
1428 bool need_swap = false; 1428 bool need_swap = false;
@@ -1446,7 +1446,7 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)
1446 if (magic2 == AR5416_EEPROM_MAGIC) { 1446 if (magic2 == AR5416_EEPROM_MAGIC) {
1447 size = sizeof(struct ar5416_eeprom_def); 1447 size = sizeof(struct ar5416_eeprom_def);
1448 need_swap = true; 1448 need_swap = true;
1449 eepdata = (u16 *) (&ah->ah_eeprom); 1449 eepdata = (u16 *) (&ah->eeprom);
1450 1450
1451 for (addr = 0; addr < size / sizeof(u16); addr++) { 1451 for (addr = 0; addr < size / sizeof(u16); addr++) {
1452 temp = swab16(*eepdata); 1452 temp = swab16(*eepdata);
@@ -1473,16 +1473,16 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)
1473 need_swap ? "True" : "False"); 1473 need_swap ? "True" : "False");
1474 1474
1475 if (need_swap) 1475 if (need_swap)
1476 el = swab16(ah->ah_eeprom.def.baseEepHeader.length); 1476 el = swab16(ah->eeprom.def.baseEepHeader.length);
1477 else 1477 else
1478 el = ah->ah_eeprom.def.baseEepHeader.length; 1478 el = ah->eeprom.def.baseEepHeader.length;
1479 1479
1480 if (el > sizeof(struct ar5416_eeprom_def)) 1480 if (el > sizeof(struct ar5416_eeprom_def))
1481 el = sizeof(struct ar5416_eeprom_def) / sizeof(u16); 1481 el = sizeof(struct ar5416_eeprom_def) / sizeof(u16);
1482 else 1482 else
1483 el = el / sizeof(u16); 1483 el = el / sizeof(u16);
1484 1484
1485 eepdata = (u16 *)(&ah->ah_eeprom); 1485 eepdata = (u16 *)(&ah->eeprom);
1486 1486
1487 for (i = 0; i < el; i++) 1487 for (i = 0; i < el; i++)
1488 sum ^= *eepdata++; 1488 sum ^= *eepdata++;
@@ -1551,7 +1551,7 @@ static u32 ath9k_hw_def_get_eeprom(struct ath_hw *ah,
1551 enum eeprom_param param) 1551 enum eeprom_param param)
1552{ 1552{
1553#define AR5416_VER_MASK (pBase->version & AR5416_EEP_VER_MINOR_MASK) 1553#define AR5416_VER_MASK (pBase->version & AR5416_EEP_VER_MINOR_MASK)
1554 struct ar5416_eeprom_def *eep = &ah->ah_eeprom.def; 1554 struct ar5416_eeprom_def *eep = &ah->eeprom.def;
1555 struct modal_eep_header *pModal = eep->modalHeader; 1555 struct modal_eep_header *pModal = eep->modalHeader;
1556 struct base_eep_header *pBase = &eep->baseEepHeader; 1556 struct base_eep_header *pBase = &eep->baseEepHeader;
1557 1557
@@ -1611,7 +1611,7 @@ static bool ath9k_hw_def_set_board_values(struct ath_hw *ah,
1611{ 1611{
1612#define AR5416_VER_MASK (eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) 1612#define AR5416_VER_MASK (eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK)
1613 struct modal_eep_header *pModal; 1613 struct modal_eep_header *pModal;
1614 struct ar5416_eeprom_def *eep = &ah->ah_eeprom.def; 1614 struct ar5416_eeprom_def *eep = &ah->eeprom.def;
1615 int i, regChainOffset; 1615 int i, regChainOffset;
1616 u8 txRxAttenLocal; 1616 u8 txRxAttenLocal;
1617 1617
@@ -1629,7 +1629,7 @@ static bool ath9k_hw_def_set_board_values(struct ath_hw *ah,
1629 } 1629 }
1630 1630
1631 if (AR_SREV_5416_V20_OR_LATER(ah) && 1631 if (AR_SREV_5416_V20_OR_LATER(ah) &&
1632 (ah->ah_rxchainmask == 5 || ah->ah_txchainmask == 5) 1632 (ah->rxchainmask == 5 || ah->txchainmask == 5)
1633 && (i != 0)) 1633 && (i != 0))
1634 regChainOffset = (i == 1) ? 0x2000 : 0x1000; 1634 regChainOffset = (i == 1) ? 0x2000 : 0x1000;
1635 else 1635 else
@@ -1855,7 +1855,7 @@ static void ath9k_hw_def_set_addac(struct ath_hw *ah,
1855{ 1855{
1856#define XPA_LVL_FREQ(cnt) (pModal->xpaBiasLvlFreq[cnt]) 1856#define XPA_LVL_FREQ(cnt) (pModal->xpaBiasLvlFreq[cnt])
1857 struct modal_eep_header *pModal; 1857 struct modal_eep_header *pModal;
1858 struct ar5416_eeprom_def *eep = &ah->ah_eeprom.def; 1858 struct ar5416_eeprom_def *eep = &ah->eeprom.def;
1859 u8 biaslevel; 1859 u8 biaslevel;
1860 1860
1861 if (ah->hw_version.macVersion != AR_SREV_VERSION_9160) 1861 if (ah->hw_version.macVersion != AR_SREV_VERSION_9160)
@@ -1895,10 +1895,10 @@ static void ath9k_hw_def_set_addac(struct ath_hw *ah,
1895 } 1895 }
1896 1896
1897 if (IS_CHAN_2GHZ(chan)) { 1897 if (IS_CHAN_2GHZ(chan)) {
1898 INI_RA(&ah->ah_iniAddac, 7, 1) = (INI_RA(&ah->ah_iniAddac, 1898 INI_RA(&ah->iniAddac, 7, 1) = (INI_RA(&ah->iniAddac,
1899 7, 1) & (~0x18)) | biaslevel << 3; 1899 7, 1) & (~0x18)) | biaslevel << 3;
1900 } else { 1900 } else {
1901 INI_RA(&ah->ah_iniAddac, 6, 1) = (INI_RA(&ah->ah_iniAddac, 1901 INI_RA(&ah->iniAddac, 6, 1) = (INI_RA(&ah->iniAddac,
1902 6, 1) & (~0xc0)) | biaslevel << 6; 1902 6, 1) & (~0xc0)) | biaslevel << 6;
1903 } 1903 }
1904#undef XPA_LVL_FREQ 1904#undef XPA_LVL_FREQ
@@ -2073,7 +2073,7 @@ static bool ath9k_hw_set_def_power_cal_table(struct ath_hw *ah,
2073 struct ath9k_channel *chan, 2073 struct ath9k_channel *chan,
2074 int16_t *pTxPowerIndexOffset) 2074 int16_t *pTxPowerIndexOffset)
2075{ 2075{
2076 struct ar5416_eeprom_def *pEepData = &ah->ah_eeprom.def; 2076 struct ar5416_eeprom_def *pEepData = &ah->eeprom.def;
2077 struct cal_data_per_freq *pRawDataset; 2077 struct cal_data_per_freq *pRawDataset;
2078 u8 *pCalBChans = NULL; 2078 u8 *pCalBChans = NULL;
2079 u16 pdGainOverlap_t2; 2079 u16 pdGainOverlap_t2;
@@ -2129,7 +2129,7 @@ static bool ath9k_hw_set_def_power_cal_table(struct ath_hw *ah,
2129 2129
2130 for (i = 0; i < AR5416_MAX_CHAINS; i++) { 2130 for (i = 0; i < AR5416_MAX_CHAINS; i++) {
2131 if (AR_SREV_5416_V20_OR_LATER(ah) && 2131 if (AR_SREV_5416_V20_OR_LATER(ah) &&
2132 (ah->ah_rxchainmask == 5 || ah->ah_txchainmask == 5) && 2132 (ah->rxchainmask == 5 || ah->txchainmask == 5) &&
2133 (i != 0)) { 2133 (i != 0)) {
2134 regChainOffset = (i == 1) ? 0x2000 : 0x1000; 2134 regChainOffset = (i == 1) ? 0x2000 : 0x1000;
2135 } else 2135 } else
@@ -2206,7 +2206,7 @@ static bool ath9k_hw_set_def_power_per_rate_table(struct ath_hw *ah,
2206#define REDUCE_SCALED_POWER_BY_TWO_CHAIN 6 /* 10*log10(2)*2 */ 2206#define REDUCE_SCALED_POWER_BY_TWO_CHAIN 6 /* 10*log10(2)*2 */
2207#define REDUCE_SCALED_POWER_BY_THREE_CHAIN 10 /* 10*log10(3)*2 */ 2207#define REDUCE_SCALED_POWER_BY_THREE_CHAIN 10 /* 10*log10(3)*2 */
2208 2208
2209 struct ar5416_eeprom_def *pEepData = &ah->ah_eeprom.def; 2209 struct ar5416_eeprom_def *pEepData = &ah->eeprom.def;
2210 u16 twiceMaxEdgePower = AR5416_MAX_RATE_POWER; 2210 u16 twiceMaxEdgePower = AR5416_MAX_RATE_POWER;
2211 static const u16 tpScaleReductionTable[5] = 2211 static const u16 tpScaleReductionTable[5] =
2212 { 0, 3, 6, 9, AR5416_MAX_RATE_POWER }; 2212 { 0, 3, 6, 9, AR5416_MAX_RATE_POWER };
@@ -2236,7 +2236,7 @@ static bool ath9k_hw_set_def_power_per_rate_table(struct ath_hw *ah,
2236 int tx_chainmask; 2236 int tx_chainmask;
2237 u16 twiceMinEdgePower; 2237 u16 twiceMinEdgePower;
2238 2238
2239 tx_chainmask = ah->ah_txchainmask; 2239 tx_chainmask = ah->txchainmask;
2240 2240
2241 ath9k_hw_get_channel_centers(ah, chan, &centers); 2241 ath9k_hw_get_channel_centers(ah, chan, &centers);
2242 2242
@@ -2493,7 +2493,7 @@ static int ath9k_hw_def_set_txpower(struct ath_hw *ah,
2493 u8 twiceMaxRegulatoryPower, 2493 u8 twiceMaxRegulatoryPower,
2494 u8 powerLimit) 2494 u8 powerLimit)
2495{ 2495{
2496 struct ar5416_eeprom_def *pEepData = &ah->ah_eeprom.def; 2496 struct ar5416_eeprom_def *pEepData = &ah->eeprom.def;
2497 struct modal_eep_header *pModal = 2497 struct modal_eep_header *pModal =
2498 &(pEepData->modalHeader[IS_CHAN_2GHZ(chan)]); 2498 &(pEepData->modalHeader[IS_CHAN_2GHZ(chan)]);
2499 int16_t ratesArray[Ar5416RateSize]; 2499 int16_t ratesArray[Ar5416RateSize];
@@ -2621,7 +2621,7 @@ static int ath9k_hw_def_set_txpower(struct ath_hw *ah,
2621static u8 ath9k_hw_def_get_num_ant_config(struct ath_hw *ah, 2621static u8 ath9k_hw_def_get_num_ant_config(struct ath_hw *ah,
2622 enum ieee80211_band freq_band) 2622 enum ieee80211_band freq_band)
2623{ 2623{
2624 struct ar5416_eeprom_def *eep = &ah->ah_eeprom.def; 2624 struct ar5416_eeprom_def *eep = &ah->eeprom.def;
2625 struct modal_eep_header *pModal = 2625 struct modal_eep_header *pModal =
2626 &(eep->modalHeader[ATH9K_HAL_FREQ_BAND_2GHZ == freq_band]); 2626 &(eep->modalHeader[ATH9K_HAL_FREQ_BAND_2GHZ == freq_band]);
2627 struct base_eep_header *pBase = &eep->baseEepHeader; 2627 struct base_eep_header *pBase = &eep->baseEepHeader;
@@ -2639,7 +2639,7 @@ static u8 ath9k_hw_def_get_num_ant_config(struct ath_hw *ah,
2639static u16 ath9k_hw_def_get_eeprom_antenna_cfg(struct ath_hw *ah, 2639static u16 ath9k_hw_def_get_eeprom_antenna_cfg(struct ath_hw *ah,
2640 struct ath9k_channel *chan) 2640 struct ath9k_channel *chan)
2641{ 2641{
2642 struct ar5416_eeprom_def *eep = &ah->ah_eeprom.def; 2642 struct ar5416_eeprom_def *eep = &ah->eeprom.def;
2643 struct modal_eep_header *pModal = 2643 struct modal_eep_header *pModal =
2644 &(eep->modalHeader[IS_CHAN_2GHZ(chan)]); 2644 &(eep->modalHeader[IS_CHAN_2GHZ(chan)]);
2645 2645
@@ -2649,19 +2649,19 @@ static u16 ath9k_hw_def_get_eeprom_antenna_cfg(struct ath_hw *ah,
2649u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz) 2649u16 ath9k_hw_def_get_spur_channel(struct ath_hw *ah, u16 i, bool is2GHz)
2650{ 2650{
2651#define EEP_DEF_SPURCHAN \ 2651#define EEP_DEF_SPURCHAN \
2652 (ah->ah_eeprom.def.modalHeader[is2GHz].spurChans[i].spurChan) 2652 (ah->eeprom.def.modalHeader[is2GHz].spurChans[i].spurChan)
2653 2653
2654 u16 spur_val = AR_NO_SPUR; 2654 u16 spur_val = AR_NO_SPUR;
2655 2655
2656 DPRINTF(ah->ah_sc, ATH_DBG_ANI, 2656 DPRINTF(ah->ah_sc, ATH_DBG_ANI,
2657 "Getting spur idx %d is2Ghz. %d val %x\n", 2657 "Getting spur idx %d is2Ghz. %d val %x\n",
2658 i, is2GHz, ah->ah_config.spurchans[i][is2GHz]); 2658 i, is2GHz, ah->config.spurchans[i][is2GHz]);
2659 2659
2660 switch (ah->ah_config.spurmode) { 2660 switch (ah->config.spurmode) {
2661 case SPUR_DISABLE: 2661 case SPUR_DISABLE:
2662 break; 2662 break;
2663 case SPUR_ENABLE_IOCTL: 2663 case SPUR_ENABLE_IOCTL:
2664 spur_val = ah->ah_config.spurchans[i][is2GHz]; 2664 spur_val = ah->config.spurchans[i][is2GHz];
2665 DPRINTF(ah->ah_sc, ATH_DBG_ANI, 2665 DPRINTF(ah->ah_sc, ATH_DBG_ANI,
2666 "Getting spur val from new loc. %d\n", spur_val); 2666 "Getting spur val from new loc. %d\n", spur_val);
2667 break; 2667 break;
@@ -2694,10 +2694,10 @@ int ath9k_hw_eeprom_attach(struct ath_hw *ah)
2694 int status; 2694 int status;
2695 2695
2696 if (AR_SREV_9285(ah)) { 2696 if (AR_SREV_9285(ah)) {
2697 ah->ah_eep_map = EEP_MAP_4KBITS; 2697 ah->eep_map = EEP_MAP_4KBITS;
2698 ah->eep_ops = &eep_4k_ops; 2698 ah->eep_ops = &eep_4k_ops;
2699 } else { 2699 } else {
2700 ah->ah_eep_map = EEP_MAP_DEFAULT; 2700 ah->eep_map = EEP_MAP_DEFAULT;
2701 ah->eep_ops = &eep_def_ops; 2701 ah->eep_ops = &eep_def_ops;
2702 } 2702 }
2703 2703