drivers/net/wireless/ath/ath9k/calib.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath9k/calib.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath9k/calib.c- Extension
.c- Size
- 12862 bytes
- Lines
- 481
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
hw.hhw-ops.hlinux/sort.hlinux/export.h
Detected Declarations
function Copyrightfunction ath9k_hw_get_nf_hist_midfunction ath9k_hw_get_default_nffunction ath9k_hw_getchan_noisefunction ath9k_hw_update_nfcal_hist_bufferfunction ath9k_hw_get_nf_threshfunction ath9k_hw_reset_calibrationfunction ath9k_hw_reset_calvalidfunction ath9k_hw_start_nfcalfunction ath9k_hw_loadnffunction ath9k_hw_nf_sanitizefunction ath9k_hw_getnffunction ath9k_init_nfcal_hist_bufferfunction ath9k_hw_bstuck_nfcalexport ath9k_hw_getchan_noiseexport ath9k_hw_reset_calvalidexport ath9k_hw_loadnfexport ath9k_hw_getnfexport ath9k_hw_bstuck_nfcal
Annotated Snippet
if (h[i].invalidNFcount > 0) {
h[i].invalidNFcount--;
h[i].privNF = nfarray[i];
} else {
h[i].privNF =
ath9k_hw_get_nf_hist_mid(h[i].nfCalBuffer);
}
if (!h[i].privNF)
continue;
if (h[i].privNF > limit->max) {
high_nf_mid = true;
ath_dbg(common, CALIBRATE,
"NFmid[%d] (%d) > MAX (%d), %s\n",
i, h[i].privNF, limit->max,
(test_bit(NFCAL_INTF, &cal->cal_flags) ?
"not corrected (due to interference)" :
"correcting to MAX"));
/*
* Normally we limit the average noise floor by the
* hardware specific maximum here. However if we have
* encountered stuck beacons because of interference,
* we bypass this limit here in order to better deal
* with our environment.
*/
if (!test_bit(NFCAL_INTF, &cal->cal_flags))
h[i].privNF = limit->max;
}
}
/*
* If the noise floor seems normal for all chains, assume that
* there is no significant interference in the environment anymore.
* Re-enable the enforcement of the NF maximum again.
*/
if (!high_nf_mid)
clear_bit(NFCAL_INTF, &cal->cal_flags);
}
static bool ath9k_hw_get_nf_thresh(struct ath_hw *ah,
enum nl80211_band band,
int16_t *nft)
{
switch (band) {
case NL80211_BAND_5GHZ:
*nft = (int8_t)ah->eep_ops->get_eeprom(ah, EEP_NFTHRESH_5);
break;
case NL80211_BAND_2GHZ:
*nft = (int8_t)ah->eep_ops->get_eeprom(ah, EEP_NFTHRESH_2);
break;
default:
BUG_ON(1);
return false;
}
return true;
}
void ath9k_hw_reset_calibration(struct ath_hw *ah,
struct ath9k_cal_list *currCal)
{
int i;
ath9k_hw_setup_calibration(ah, currCal);
ah->cal_start_time = jiffies;
currCal->calState = CAL_RUNNING;
for (i = 0; i < AR5416_MAX_CHAINS; i++) {
ah->meas0.sign[i] = 0;
ah->meas1.sign[i] = 0;
ah->meas2.sign[i] = 0;
ah->meas3.sign[i] = 0;
}
ah->cal_samples = 0;
}
/* This is done for the currently configured channel */
bool ath9k_hw_reset_calvalid(struct ath_hw *ah)
{
struct ath_common *common = ath9k_hw_common(ah);
struct ath9k_cal_list *currCal = ah->cal_list_curr;
if (!ah->caldata)
return true;
Annotation
- Immediate include surface: `hw.h`, `hw-ops.h`, `linux/sort.h`, `linux/export.h`.
- Detected declarations: `function Copyright`, `function ath9k_hw_get_nf_hist_mid`, `function ath9k_hw_get_default_nf`, `function ath9k_hw_getchan_noise`, `function ath9k_hw_update_nfcal_hist_buffer`, `function ath9k_hw_get_nf_thresh`, `function ath9k_hw_reset_calibration`, `function ath9k_hw_reset_calvalid`, `function ath9k_hw_start_nfcal`, `function ath9k_hw_loadnf`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.