• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/net/wireless/ath/ath9k/

Lines Matching defs:ah

21 static void ar9003_hw_setup_calibration(struct ath_hw *ah,
24 struct ath_common *common = ath9k_hw_common(ah);
33 REG_RMW_FIELD(ah, AR_PHY_TIMING4,
36 REG_WRITE(ah, AR_PHY_CALMODE, AR_PHY_CALMODE_IQ);
42 REG_SET_BIT(ah, AR_PHY_TIMING4, AR_PHY_TIMING4_DO_CAL);
45 REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_THERM,
47 REG_RMW_FIELD(ah, AR_PHY_65NM_CH0_THERM,
66 static bool ar9003_hw_per_calibration(struct ath_hw *ah,
71 struct ath9k_hw_cal_data *caldata = ah->caldata;
78 if (!(REG_READ(ah, AR_PHY_TIMING4) & AR_PHY_TIMING4_DO_CAL)) {
82 currCal->calData->calCollect(ah);
83 ah->cal_samples++;
85 if (ah->cal_samples >=
96 currCal->calData->calPostProc(ah, numChains);
107 ar9003_hw_setup_calibration(ah, currCal);
112 ath9k_hw_reset_calibration(ah, currCal);
118 static bool ar9003_hw_calibrate(struct ath_hw *ah,
124 struct ath9k_cal_list *currCal = ah->cal_list_curr;
138 iscaldone = ar9003_hw_per_calibration(ah, chan,
141 ah->cal_list_curr = currCal = currCal->calNext;
145 ath9k_hw_reset_calibration(ah, currCal);
156 ath9k_hw_getnf(ah, chan);
163 ath9k_hw_loadnf(ah, ah->curchan);
166 ath9k_hw_start_nfcal(ah, false);
172 static void ar9003_hw_iqcal_collect(struct ath_hw *ah)
178 ah->totalPowerMeasI[i] +=
179 REG_READ(ah, AR_PHY_CAL_MEAS_0(i));
180 ah->totalPowerMeasQ[i] +=
181 REG_READ(ah, AR_PHY_CAL_MEAS_1(i));
182 ah->totalIqCorrMeas[i] +=
183 (int32_t) REG_READ(ah, AR_PHY_CAL_MEAS_2(i));
184 ath_print(ath9k_hw_common(ah), ATH_DBG_CALIBRATE,
186 ah->cal_samples, i, ah->totalPowerMeasI[i],
187 ah->totalPowerMeasQ[i],
188 ah->totalIqCorrMeas[i]);
192 static void ar9003_hw_iqcalibrate(struct ath_hw *ah, u8 numChains)
194 struct ath_common *common = ath9k_hw_common(ah);
206 powerMeasI = ah->totalPowerMeasI[i];
207 powerMeasQ = ah->totalPowerMeasQ[i];
208 iqCorrMeas = ah->totalIqCorrMeas[i];
216 i, ah->totalIqCorrMeas[i]);
269 REG_READ(ah, offset_array[i]));
271 REG_RMW_FIELD(ah, offset_array[i],
274 REG_RMW_FIELD(ah, offset_array[i],
282 REG_READ(ah, offset_array[i]));
288 REG_READ(ah, offset_array[i]));
296 REG_SET_BIT(ah, AR_PHY_RX_IQCAL_CORR_B0,
303 REG_READ(ah, AR_PHY_RX_IQCAL_CORR_B0));
314 static void ar9003_hw_init_cal_settings(struct ath_hw *ah)
316 ah->iq_caldata.calData = &iq_cal_single_sample;
317 ah->supp_cals = IQ_MISMATCH_CAL;
320 static bool ar9003_hw_iscal_supported(struct ath_hw *ah,
323 switch (calType & ah->supp_cals) {
339 static bool ar9003_hw_solve_iq_cal(struct ath_hw *ah,
355 struct ath_common *common = ath9k_hw_common(ah);
387 static s32 ar9003_hw_find_mag_approx(struct ath_hw *ah, s32 in_re, s32 in_im)
406 static bool ar9003_hw_calc_iq_corr(struct ath_hw *ah,
425 struct ath_common *common = ath9k_hw_common(ah);
514 mag1 = ar9003_hw_find_mag_approx(ah, cos_2phi_1, sin_2phi_1);
515 mag2 = ar9003_hw_find_mag_approx(ah, cos_2phi_2, sin_2phi_2);
531 if (!ar9003_hw_solve_iq_cal(ah,
620 static void ar9003_hw_tx_iq_cal(struct ath_hw *ah)
622 struct ath_common *common = ath9k_hw_common(ah);
649 if (ah->txchainmask & (1 << i))
653 REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_1,
656 REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_START,
660 if (!ath9k_hw_wait(ah, AR_PHY_TX_IQCAL_START,
672 if (REG_READ(ah, txiqcal_status[i]) &
683 REG_RMW_FIELD(ah, AR_PHY_CHAN_INFO_MEMORY,
687 iq_res[idx] = REG_READ(ah, chan_info_tab[i] + offset);
689 REG_RMW_FIELD(ah, AR_PHY_CHAN_INFO_MEMORY,
693 iq_res[idx+1] = 0xffff & REG_READ(ah,
702 if (!ar9003_hw_calc_iq_corr(ah, i, iq_res, iqc_coeff)) {
712 REG_RMW_FIELD(ah, tx_corr_coeff[i],
715 REG_RMW_FIELD(ah, rx_corr[i],
718 REG_RMW_FIELD(ah, rx_corr[i],
723 REG_RMW_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_3,
725 REG_RMW_FIELD(ah, AR_PHY_RX_IQCAL_CORR_B0,
734 static bool ar9003_hw_init_cal(struct ath_hw *ah,
737 struct ath_common *common = ath9k_hw_common(ah);
743 ar9003_hw_set_chain_masks(ah, 0x7, 0x7);
746 ar9003_hw_tx_iq_cal(ah);
747 REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_DIS);
749 REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_EN);
752 REG_WRITE(ah, AR_PHY_AGC_CONTROL,
753 REG_READ(ah, AR_PHY_AGC_CONTROL) |
757 if (!ath9k_hw_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL,
766 ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask);
768 ath9k_hw_start_nfcal(ah, true);
771 ah->cal_list = ah->cal_list_last = ah->cal_list_curr = NULL;
773 if (ar9003_hw_iscal_supported(ah, IQ_MISMATCH_CAL)) {
774 INIT_CAL(&ah->iq_caldata);
775 INSERT_CAL(ah, &ah->iq_caldata);
780 if (ar9003_hw_iscal_supported(ah, TEMP_COMP_CAL)) {
781 INIT_CAL(&ah->tempCompCalData);
782 INSERT_CAL(ah, &ah->tempCompCalData);
788 ah->cal_list_curr = ah->cal_list;
790 if (ah->cal_list_curr)
791 ath9k_hw_reset_calibration(ah, ah->cal_list_curr);
793 if (ah->caldata)
794 ah->caldata->CalValid = 0;
799 void ar9003_hw_attach_calib_ops(struct ath_hw *ah)
801 struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
802 struct ath_hw_ops *ops = ath9k_hw_ops(ah);