drivers/net/wireless/ath/ath9k/ar9002_calib.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath9k/ar9002_calib.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath9k/ar9002_calib.c- Extension
.c- Size
- 30230 bytes
- Lines
- 1020
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
hw.hhw-ops.har9002_phy.h
Detected Declarations
enum ar9002_cal_typesfunction ar9002_hw_is_cal_supportedfunction ar9002_hw_setup_calibrationfunction ar9002_hw_per_calibrationfunction msecs_to_jiffiesfunction ar9002_hw_iqcal_collectfunction ar9002_hw_adc_gaincal_collectfunction ar9002_hw_adc_dccal_collectfunction ar9002_hw_iqcalibratefunction ar9002_hw_adc_gaincal_calibratefunction ar9002_hw_adc_dccal_calibratefunction ar9287_hw_olc_temp_compensationfunction ar9280_hw_olc_temp_compensationfunction ar9271_hw_pa_calfunction ar9285_hw_pa_calfunction ar9002_hw_pa_calfunction ar9002_hw_olc_temp_compensationfunction ar9002_hw_calibratefunction ar9285_hw_cl_calfunction ar9285_hw_clcfunction ar9002_hw_init_calfunction ar9002_hw_init_cal_settingsfunction ar9002_hw_attach_calib_ops
Annotated Snippet
msecs_to_jiffies(AR9002_CAL_MAX_TIME))) {
REG_CLR_BIT(ah, AR_PHY_TIMING_CTRL4(0),
AR_PHY_TIMING_CTRL4_DO_CAL);
ath_dbg(ath9k_hw_common(ah), CALIBRATE,
"calibration timeout\n");
currCal->calState = CAL_WAITING; /* Try later */
iscaldone = true;
}
} else if (!(caldata->CalValid & currCal->calData->calType)) {
ath9k_hw_reset_calibration(ah, currCal);
}
return iscaldone;
}
static void ar9002_hw_iqcal_collect(struct ath_hw *ah)
{
int i;
for (i = 0; i < AR5416_MAX_CHAINS; i++) {
ah->totalPowerMeasI[i] +=
REG_READ(ah, AR_PHY_CAL_MEAS_0(i));
ah->totalPowerMeasQ[i] +=
REG_READ(ah, AR_PHY_CAL_MEAS_1(i));
ah->totalIqCorrMeas[i] +=
(int32_t) REG_READ(ah, AR_PHY_CAL_MEAS_2(i));
ath_dbg(ath9k_hw_common(ah), CALIBRATE,
"%d: Chn %d pmi=0x%08x;pmq=0x%08x;iqcm=0x%08x;\n",
ah->cal_samples, i, ah->totalPowerMeasI[i],
ah->totalPowerMeasQ[i],
ah->totalIqCorrMeas[i]);
}
}
static void ar9002_hw_adc_gaincal_collect(struct ath_hw *ah)
{
int i;
for (i = 0; i < AR5416_MAX_CHAINS; i++) {
ah->totalAdcIOddPhase[i] +=
REG_READ(ah, AR_PHY_CAL_MEAS_0(i));
ah->totalAdcIEvenPhase[i] +=
REG_READ(ah, AR_PHY_CAL_MEAS_1(i));
ah->totalAdcQOddPhase[i] +=
REG_READ(ah, AR_PHY_CAL_MEAS_2(i));
ah->totalAdcQEvenPhase[i] +=
REG_READ(ah, AR_PHY_CAL_MEAS_3(i));
ath_dbg(ath9k_hw_common(ah), CALIBRATE,
"%d: Chn %d oddi=0x%08x; eveni=0x%08x; oddq=0x%08x; evenq=0x%08x;\n",
ah->cal_samples, i,
ah->totalAdcIOddPhase[i],
ah->totalAdcIEvenPhase[i],
ah->totalAdcQOddPhase[i],
ah->totalAdcQEvenPhase[i]);
}
}
static void ar9002_hw_adc_dccal_collect(struct ath_hw *ah)
{
int i;
for (i = 0; i < AR5416_MAX_CHAINS; i++) {
ah->totalAdcDcOffsetIOddPhase[i] +=
(int32_t) REG_READ(ah, AR_PHY_CAL_MEAS_0(i));
ah->totalAdcDcOffsetIEvenPhase[i] +=
(int32_t) REG_READ(ah, AR_PHY_CAL_MEAS_1(i));
ah->totalAdcDcOffsetQOddPhase[i] +=
(int32_t) REG_READ(ah, AR_PHY_CAL_MEAS_2(i));
ah->totalAdcDcOffsetQEvenPhase[i] +=
(int32_t) REG_READ(ah, AR_PHY_CAL_MEAS_3(i));
ath_dbg(ath9k_hw_common(ah), CALIBRATE,
"%d: Chn %d oddi=0x%08x; eveni=0x%08x; oddq=0x%08x; evenq=0x%08x;\n",
ah->cal_samples, i,
ah->totalAdcDcOffsetIOddPhase[i],
ah->totalAdcDcOffsetIEvenPhase[i],
ah->totalAdcDcOffsetQOddPhase[i],
ah->totalAdcDcOffsetQEvenPhase[i]);
}
}
static void ar9002_hw_iqcalibrate(struct ath_hw *ah, u8 numChains)
{
struct ath_common *common = ath9k_hw_common(ah);
u32 powerMeasQ, powerMeasI, iqCorrMeas;
u32 qCoffDenom, iCoffDenom;
int32_t qCoff, iCoff;
int iqCorrNeg, i;
Annotation
- Immediate include surface: `hw.h`, `hw-ops.h`, `ar9002_phy.h`.
- Detected declarations: `enum ar9002_cal_types`, `function ar9002_hw_is_cal_supported`, `function ar9002_hw_setup_calibration`, `function ar9002_hw_per_calibration`, `function msecs_to_jiffies`, `function ar9002_hw_iqcal_collect`, `function ar9002_hw_adc_gaincal_collect`, `function ar9002_hw_adc_dccal_collect`, `function ar9002_hw_iqcalibrate`, `function ar9002_hw_adc_gaincal_calibrate`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.