drivers/net/wireless/ath/ath9k/eeprom_def.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath9k/eeprom_def.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath9k/eeprom_def.c- Extension
.c- Size
- 41006 bytes
- Lines
- 1323
- 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
linux/unaligned.hhw.har9002_phy.h
Detected Declarations
function Copyrightfunction ath9k_olc_get_pdadcsfunction ath9k_hw_def_get_eeprom_verfunction ath9k_hw_def_get_eeprom_revfunction __ath9k_hw_def_fill_eepromfunction __ath9k_hw_usb_def_fill_eepromfunction ath9k_hw_def_fill_eepromfunction ath9k_def_dump_modal_eepromfunction ath9k_hw_def_dump_eepromfunction ath9k_hw_def_dump_eepromfunction ath9k_hw_def_check_eepromfunction ath9k_hw_def_get_eepromfunction ath9k_hw_def_set_gainfunction ath9k_hw_def_set_board_valuesfunction ath9k_hw_def_set_addacfunction ath9k_change_gain_boundary_settingfunction ath9k_adjust_pdadc_valuesfunction ath9k_hw_set_def_power_cal_tablefunction ath9k_hw_set_def_power_per_rate_tablefunction ath9k_hw_def_set_txpowerfunction ath9k_hw_def_get_spur_channelfunction ath9k_hw_def_get_eepmisc
Annotated Snippet
if (AR_SREV_9280_20_OR_LATER(ah)) {
REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN,
pModal->bswMargin[i]);
REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
AR_PHY_GAIN_2GHZ_XATTEN1_DB,
pModal->bswAtten[i]);
REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN,
pModal->xatten2Margin[i]);
REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
AR_PHY_GAIN_2GHZ_XATTEN2_DB,
pModal->xatten2Db[i]);
} else {
REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
SM(pModal-> bswMargin[i], AR_PHY_GAIN_2GHZ_BSW_MARGIN),
AR_PHY_GAIN_2GHZ_BSW_MARGIN);
REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
SM(pModal->bswAtten[i], AR_PHY_GAIN_2GHZ_BSW_ATTEN),
AR_PHY_GAIN_2GHZ_BSW_ATTEN);
}
}
if (AR_SREV_9280_20_OR_LATER(ah)) {
REG_RMW_FIELD(ah,
AR_PHY_RXGAIN + regChainOffset,
AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal);
REG_RMW_FIELD(ah,
AR_PHY_RXGAIN + regChainOffset,
AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[i]);
} else {
REG_RMW(ah, AR_PHY_RXGAIN + regChainOffset,
SM(txRxAttenLocal, AR_PHY_RXGAIN_TXRX_ATTEN),
AR_PHY_RXGAIN_TXRX_ATTEN);
REG_RMW(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
SM(pModal->rxTxMarginCh[i], AR_PHY_GAIN_2GHZ_RXTX_MARGIN),
AR_PHY_GAIN_2GHZ_RXTX_MARGIN);
}
REG_RMW_BUFFER_FLUSH(ah);
}
static void ath9k_hw_def_set_board_values(struct ath_hw *ah,
struct ath9k_channel *chan)
{
struct modal_eep_header *pModal;
struct ar5416_eeprom_def *eep = &ah->eeprom.def;
int i, regChainOffset;
u8 txRxAttenLocal;
u32 antCtrlCommon;
pModal = &(eep->modalHeader[IS_CHAN_2GHZ(chan)]);
txRxAttenLocal = IS_CHAN_2GHZ(chan) ? 23 : 44;
antCtrlCommon = le32_to_cpu(pModal->antCtrlCommon);
REG_WRITE(ah, AR_PHY_SWITCH_COM, antCtrlCommon & 0xffff);
for (i = 0; i < AR5416_MAX_CHAINS; i++) {
if (AR_SREV_9280(ah)) {
if (i >= 2)
break;
}
if ((ah->rxchainmask == 5 || ah->txchainmask == 5) && (i != 0))
regChainOffset = (i == 1) ? 0x2000 : 0x1000;
else
regChainOffset = i * 0x1000;
REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0 + regChainOffset,
le32_to_cpu(pModal->antCtrlChain[i]));
REG_WRITE(ah, AR_PHY_TIMING_CTRL4(0) + regChainOffset,
(REG_READ(ah, AR_PHY_TIMING_CTRL4(0) + regChainOffset) &
~(AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF |
AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF)) |
SM(pModal->iqCalICh[i],
AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) |
SM(pModal->iqCalQCh[i],
AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF));
ath9k_hw_def_set_gain(ah, pModal, eep, txRxAttenLocal,
regChainOffset, i);
}
if (AR_SREV_9280_20_OR_LATER(ah)) {
if (IS_CHAN_2GHZ(chan)) {
ath9k_hw_analog_shift_rmw(ah, AR_AN_RF2G1_CH0,
AR_AN_RF2G1_CH0_OB,
AR_AN_RF2G1_CH0_OB_S,
pModal->ob);
ath9k_hw_analog_shift_rmw(ah, AR_AN_RF2G1_CH0,
Annotation
- Immediate include surface: `linux/unaligned.h`, `hw.h`, `ar9002_phy.h`.
- Detected declarations: `function Copyright`, `function ath9k_olc_get_pdadcs`, `function ath9k_hw_def_get_eeprom_ver`, `function ath9k_hw_def_get_eeprom_rev`, `function __ath9k_hw_def_fill_eeprom`, `function __ath9k_hw_usb_def_fill_eeprom`, `function ath9k_hw_def_fill_eeprom`, `function ath9k_def_dump_modal_eeprom`, `function ath9k_hw_def_dump_eeprom`, `function ath9k_hw_def_dump_eeprom`.
- 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.