Lines Matching refs:ah

23 static int ath9k_hw_ar9287_get_eeprom_ver(struct ath_hw *ah)
25 u16 version = le16_to_cpu(ah->eeprom.map9287.baseEepHeader.version);
31 static int ath9k_hw_ar9287_get_eeprom_rev(struct ath_hw *ah)
33 u16 version = le16_to_cpu(ah->eeprom.map9287.baseEepHeader.version);
38 static bool __ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah)
40 struct ar9287_eeprom *eep = &ah->eeprom.map9287;
46 if (!ath9k_hw_nvram_read(ah, addr + eep_start_loc, eep_data))
54 static bool __ath9k_hw_usb_ar9287_fill_eeprom(struct ath_hw *ah)
56 u16 *eep_data = (u16 *)&ah->eeprom.map9287;
58 ath9k_hw_usb_gen_fill_eeprom(ah, eep_data,
64 static bool ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah)
66 struct ath_common *common = ath9k_hw_common(ah);
68 if (!ath9k_hw_use_flash(ah)) {
73 return __ath9k_hw_usb_ar9287_fill_eeprom(ah);
75 return __ath9k_hw_ar9287_fill_eeprom(ah);
126 static u32 ath9k_hw_ar9287_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
129 struct ar9287_eeprom *eep = &ah->eeprom.map9287;
141 PR_EEP("Major Version", ath9k_hw_ar9287_get_eeprom_ver(ah));
142 PR_EEP("Minor Version", ath9k_hw_ar9287_get_eeprom_rev(ah));
176 static u32 ath9k_hw_ar9287_dump_eeprom(struct ath_hw *ah, bool dump_base_hdr,
184 static int ath9k_hw_ar9287_check_eeprom(struct ath_hw *ah)
189 struct ar9287_eeprom *eep = &ah->eeprom.map9287;
191 err = ath9k_hw_nvram_swap_data(ah, &need_swap, SIZE_EEPROM_AR9287);
201 if (!ath9k_hw_nvram_validate_checksum(ah, el))
223 if (!ath9k_hw_nvram_check_version(ah, AR9287_EEP_VER,
232 static u32 ath9k_hw_ar9287_get_eeprom(struct ath_hw *ah,
235 struct ar9287_eeprom *eep = &ah->eeprom.map9287;
238 u16 ver_minor = ath9k_hw_ar9287_get_eeprom_rev(ah);
283 static void ar9287_eeprom_get_tx_gain_index(struct ath_hw *ah,
292 ath9k_hw_get_channel_centers(ah, chan, &centers);
312 static void ar9287_eeprom_olpc_set_pdadcs(struct ath_hw *ah,
320 tmpVal = REG_READ(ah, 0xa270);
323 REG_WRITE(ah, 0xa270, tmpVal);
327 tmpVal = REG_READ(ah, 0xb270);
330 REG_WRITE(ah, 0xb270, tmpVal);
335 tmpVal = REG_READ(ah, 0xa398);
339 REG_WRITE(ah, 0xa398, tmpVal);
345 tmpVal = REG_READ(ah, 0xb398);
349 REG_WRITE(ah, 0xb398, tmpVal);
353 static void ath9k_hw_set_ar9287_power_cal_table(struct ath_hw *ah,
367 struct ar9287_eeprom *pEepData = &ah->eeprom.map9287;
371 if (ath9k_hw_ar9287_get_eeprom_rev(ah) >= AR9287_EEP_MINOR_VER_2)
374 pdGainOverlap_t2 = (u16)(MS(REG_READ(ah, AR_PHY_TPCRG5),
380 if (ath9k_hw_ar9287_get_eeprom(ah, EEP_OL_PWRCTRL)) {
383 ah->initPDADC = pRawDatasetOpenLoop->vpdPdg[0][0];
400 REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_NUM_PD_GAIN,
402 REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_1,
404 REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_2,
406 REG_RMW_FIELD(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_GAIN_3,
416 if (ath9k_hw_ar9287_get_eeprom(ah, EEP_OL_PWRCTRL)) {
418 ar9287_eeprom_get_tx_gain_index(ah, chan,
422 ar9287_eeprom_olpc_set_pdadcs(ah, txPower, i);
428 ath9k_hw_get_gain_boundaries_pdadcs(ah, chan,
437 ENABLE_REGWRITE_BUFFER(ah);
440 if (!ath9k_hw_ar9287_get_eeprom(ah,
454 REG_WRITE(ah,
475 if (!ath9k_hw_ar9287_get_eeprom(ah, EEP_OL_PWRCTRL)) {
482 REG_WRITE(ah, regOffset, reg32);
486 REGWRITE_BUFFER_FLUSH(ah);
491 static void ath9k_hw_set_ar9287_power_per_rate_table(struct ath_hw *ah,
526 struct ar9287_eeprom *pEepData = &ah->eeprom.map9287;
527 tx_chainmask = ah->txchainmask;
529 ath9k_hw_get_channel_centers(ah, chan, &centers);
530 scaledPower = ath9k_hw_get_scaled_power(ah, powerLimit,
543 ath9k_hw_get_legacy_target_powers(ah, chan,
547 ath9k_hw_get_legacy_target_powers(ah, chan,
551 ath9k_hw_get_target_powers(ah, chan,
559 ath9k_hw_get_target_powers(ah, chan,
563 ath9k_hw_get_legacy_target_powers(ah, chan,
567 ath9k_hw_get_legacy_target_powers(ah, chan,
705 static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah,
710 struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
711 struct ar9287_eeprom *pEepData = &ah->eeprom.map9287;
719 if (ath9k_hw_ar9287_get_eeprom_rev(ah) >= AR9287_EEP_MINOR_VER_2)
722 ath9k_hw_set_ar9287_power_per_rate_table(ah, chan,
727 ath9k_hw_set_ar9287_power_cal_table(ah, chan);
738 ath9k_hw_update_regulatory_maxpower(ah);
746 ENABLE_REGWRITE_BUFFER(ah);
749 REG_WRITE(ah, AR_PHY_POWER_TX_RATE1,
755 REG_WRITE(ah, AR_PHY_POWER_TX_RATE2,
763 REG_WRITE(ah, AR_PHY_POWER_TX_RATE3,
768 REG_WRITE(ah, AR_PHY_POWER_TX_RATE4,
776 REG_WRITE(ah, AR_PHY_POWER_TX_RATE5,
782 REG_WRITE(ah, AR_PHY_POWER_TX_RATE6,
790 if (ath9k_hw_ar9287_get_eeprom(ah, EEP_OL_PWRCTRL)) {
791 REG_WRITE(ah, AR_PHY_POWER_TX_RATE7,
797 REG_WRITE(ah, AR_PHY_POWER_TX_RATE8,
803 REG_WRITE(ah, AR_PHY_POWER_TX_RATE7,
813 REG_WRITE(ah, AR_PHY_POWER_TX_RATE8,
825 REG_WRITE(ah, AR_PHY_POWER_TX_RATE9,
833 if (ah->tpc_enabled) {
837 ar5008_hw_init_rate_txpower(ah, ratesArray, chan, ht40_delta);
839 REG_WRITE(ah, AR_PHY_POWER_TX_RATE_MAX,
843 REG_WRITE(ah, AR_PHY_POWER_TX_RATE_MAX, MAX_RATE_POWER);
846 REGWRITE_BUFFER_FLUSH(ah);
849 static void ath9k_hw_ar9287_set_board_values(struct ath_hw *ah,
852 struct ar9287_eeprom *eep = &ah->eeprom.map9287;
860 REG_WRITE(ah, AR_PHY_SWITCH_COM, le32_to_cpu(pModal->antCtrlCommon));
865 REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0 + regChainOffset,
868 REG_WRITE(ah, AR_PHY_TIMING_CTRL4(0) + regChainOffset,
869 (REG_READ(ah, AR_PHY_TIMING_CTRL4(0) + regChainOffset)
879 REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
882 REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
885 REG_RMW_FIELD(ah, AR_PHY_RXGAIN + regChainOffset,
888 REG_RMW_FIELD(ah, AR_PHY_RXGAIN + regChainOffset,
895 REG_RMW_FIELD(ah, AR_PHY_SETTLING,
898 REG_RMW_FIELD(ah, AR_PHY_SETTLING,
901 REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ,
904 REG_WRITE(ah, AR_PHY_RF_CTL4,
910 REG_RMW_FIELD(ah, AR_PHY_RF_CTL3,
913 REG_RMW_FIELD(ah, AR_PHY_CCA,
915 REG_RMW_FIELD(ah, AR_PHY_EXT_CCA0,
918 regval = REG_READ(ah, AR9287_AN_RF2G3_CH0);
932 ath9k_hw_analog_shift_regwrite(ah, AR9287_AN_RF2G3_CH0, regval);
934 regval = REG_READ(ah, AR9287_AN_RF2G3_CH1);
948 ath9k_hw_analog_shift_regwrite(ah, AR9287_AN_RF2G3_CH1, regval);
950 REG_RMW_FIELD(ah, AR_PHY_RF_CTL2,
952 REG_RMW_FIELD(ah, AR_PHY_RF_CTL2,
955 ath9k_hw_analog_shift_rmw(ah, AR9287_AN_TOP2,
961 static u16 ath9k_hw_ar9287_get_spur_channel(struct ath_hw *ah,
964 __le16 spur_ch = ah->eeprom.map9287.modalHeader.spurChans[i].spurChan;
969 static u8 ath9k_hw_ar9287_get_eepmisc(struct ath_hw *ah)
971 return ah->eeprom.map9287.baseEepHeader.eepMisc;