aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/hw.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-03-17 18:04:31 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-17 18:04:31 -0400
commitaf4330631cd48987755f1a8d324dc318f60cf16b (patch)
tree3c9233e81b450921326da13a7f8abacb58ab1f5e /drivers/net/wireless/ath9k/hw.c
parent2d6a5e9500103680464a723a4564961675652680 (diff)
parent808ff697b357cee54e214efd27921a9ec6461a94 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/ath9k/hw.c')
-rw-r--r--drivers/net/wireless/ath9k/hw.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c
index 60e55d8c510b..d494e98ba971 100644
--- a/drivers/net/wireless/ath9k/hw.c
+++ b/drivers/net/wireless/ath9k/hw.c
@@ -682,22 +682,16 @@ static struct ath_hw *ath9k_hw_do_attach(u16 devid, struct ath_softc *sc,
682 ah->supp_cals = ADC_GAIN_CAL | ADC_DC_CAL | IQ_MISMATCH_CAL; 682 ah->supp_cals = ADC_GAIN_CAL | ADC_DC_CAL | IQ_MISMATCH_CAL;
683 } 683 }
684 684
685 if (AR_SREV_9160(ah)) { 685 ah->ani_function = ATH9K_ANI_ALL;
686 ah->config.enable_ani = 1; 686 if (AR_SREV_9280_10_OR_LATER(ah))
687 ah->ani_function = (ATH9K_ANI_SPUR_IMMUNITY_LEVEL | 687 ah->ani_function &= ~ATH9K_ANI_NOISE_IMMUNITY_LEVEL;
688 ATH9K_ANI_FIRSTEP_LEVEL);
689 } else {
690 ah->ani_function = ATH9K_ANI_ALL;
691 if (AR_SREV_9280_10_OR_LATER(ah)) {
692 ah->ani_function &= ~ATH9K_ANI_NOISE_IMMUNITY_LEVEL;
693 }
694 }
695 688
696 DPRINTF(sc, ATH_DBG_RESET, 689 DPRINTF(sc, ATH_DBG_RESET,
697 "This Mac Chip Rev 0x%02x.%x is \n", 690 "This Mac Chip Rev 0x%02x.%x is \n",
698 ah->hw_version.macVersion, ah->hw_version.macRev); 691 ah->hw_version.macVersion, ah->hw_version.macRev);
699 692
700 if (AR_SREV_9285_12_OR_LATER(ah)) { 693 if (AR_SREV_9285_12_OR_LATER(ah)) {
694
701 INIT_INI_ARRAY(&ah->iniModes, ar9285Modes_9285_1_2, 695 INIT_INI_ARRAY(&ah->iniModes, ar9285Modes_9285_1_2,
702 ARRAY_SIZE(ar9285Modes_9285_1_2), 6); 696 ARRAY_SIZE(ar9285Modes_9285_1_2), 6);
703 INIT_INI_ARRAY(&ah->iniCommon, ar9285Common_9285_1_2, 697 INIT_INI_ARRAY(&ah->iniCommon, ar9285Common_9285_1_2,
@@ -837,6 +831,22 @@ static struct ath_hw *ath9k_hw_do_attach(u16 devid, struct ath_softc *sc,
837 if (ecode != 0) 831 if (ecode != 0)
838 goto bad; 832 goto bad;
839 833
834 if (AR_SREV_9285_12_OR_LATER(ah)) {
835 u32 txgain_type = ah->eep_ops->get_eeprom(ah, EEP_TXGAIN_TYPE);
836
837 /* txgain table */
838 if (txgain_type == AR5416_EEP_TXGAIN_HIGH_POWER) {
839 INIT_INI_ARRAY(&ah->iniModesTxGain,
840 ar9285Modes_high_power_tx_gain_9285_1_2,
841 ARRAY_SIZE(ar9285Modes_high_power_tx_gain_9285_1_2), 6);
842 } else {
843 INIT_INI_ARRAY(&ah->iniModesTxGain,
844 ar9285Modes_original_tx_gain_9285_1_2,
845 ARRAY_SIZE(ar9285Modes_original_tx_gain_9285_1_2), 6);
846 }
847
848 }
849
840 /* rxgain table */ 850 /* rxgain table */
841 if (AR_SREV_9280_20(ah)) 851 if (AR_SREV_9280_20(ah))
842 ath9k_hw_init_rxgain_ini(ah); 852 ath9k_hw_init_rxgain_ini(ah);
@@ -1173,7 +1183,7 @@ static void ath9k_hw_override_ini(struct ath_hw *ah,
1173 REG_SET_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); 1183 REG_SET_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT));
1174 1184
1175 1185
1176 if (!AR_SREV_5416_V20_OR_LATER(ah) || 1186 if (!AR_SREV_5416_20_OR_LATER(ah) ||
1177 AR_SREV_9280_10_OR_LATER(ah)) 1187 AR_SREV_9280_10_OR_LATER(ah))
1178 return; 1188 return;
1179 1189
@@ -1275,7 +1285,7 @@ static int ath9k_hw_process_ini(struct ath_hw *ah,
1275 REG_WRITE(ah, AR_PHY_ADC_SERIAL_CTL, AR_PHY_SEL_EXTERNAL_RADIO); 1285 REG_WRITE(ah, AR_PHY_ADC_SERIAL_CTL, AR_PHY_SEL_EXTERNAL_RADIO);
1276 ah->eep_ops->set_addac(ah, chan); 1286 ah->eep_ops->set_addac(ah, chan);
1277 1287
1278 if (AR_SREV_5416_V22_OR_LATER(ah)) { 1288 if (AR_SREV_5416_22_OR_LATER(ah)) {
1279 REG_WRITE_ARRAY(&ah->iniAddac, 1, regWrites); 1289 REG_WRITE_ARRAY(&ah->iniAddac, 1, regWrites);
1280 } else { 1290 } else {
1281 struct ar5416IniArray temp; 1291 struct ar5416IniArray temp;
@@ -1313,7 +1323,8 @@ static int ath9k_hw_process_ini(struct ath_hw *ah,
1313 if (AR_SREV_9280(ah)) 1323 if (AR_SREV_9280(ah))
1314 REG_WRITE_ARRAY(&ah->iniModesRxGain, modesIndex, regWrites); 1324 REG_WRITE_ARRAY(&ah->iniModesRxGain, modesIndex, regWrites);
1315 1325
1316 if (AR_SREV_9280(ah)) 1326 if (AR_SREV_9280(ah) || (AR_SREV_9285(ah) &&
1327 AR_SREV_9285_12_OR_LATER(ah)))
1317 REG_WRITE_ARRAY(&ah->iniModesTxGain, modesIndex, regWrites); 1328 REG_WRITE_ARRAY(&ah->iniModesTxGain, modesIndex, regWrites);
1318 1329
1319 for (i = 0; i < ah->iniCommon.ia_rows; i++) { 1330 for (i = 0; i < ah->iniCommon.ia_rows; i++) {