drivers/net/wireless/ath/ath9k/eeprom.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath9k/eeprom.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath9k/eeprom.c- Extension
.c- Size
- 17478 bytes
- Lines
- 676
- 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.h
Detected Declarations
function Copyrightfunction ath9k_hw_analog_shift_rmwfunction ath9k_hw_interpolatefunction ath9k_hw_get_lower_upper_indexfunction ath9k_hw_usb_gen_fill_eepromfunction ath9k_hw_nvram_read_arrayfunction ath9k_hw_nvram_read_firmwarefunction ath9k_hw_nvram_read_nvmemfunction ath9k_hw_nvram_readfunction ath9k_hw_nvram_swap_datafunction ath9k_hw_nvram_validate_checksumfunction ath9k_hw_nvram_check_versionfunction ath9k_hw_fill_vpd_tablefunction ath9k_hw_get_legacy_target_powersfunction IS_CHAN_2GHZfunction ath9k_hw_get_target_powersfunction ath9k_hw_get_max_edge_powerfunction ath9k_hw_get_scaled_powerfunction ath9k_hw_update_regulatory_maxpowerfunction ath9k_hw_get_gain_boundaries_pdadcsfunction ath9k_hw_eeprom_init
Annotated Snippet
if (pList[i] == target) {
*indexL = *indexR = i;
return true;
}
if (target < pList[i + 1]) {
*indexL = i;
*indexR = (u16) (i + 1);
return false;
}
}
return false;
}
void ath9k_hw_usb_gen_fill_eeprom(struct ath_hw *ah, u16 *eep_data,
int eep_start_loc, int size)
{
int i = 0, j, addr;
u32 addrdata[8];
u32 data[8];
for (addr = 0; addr < size; addr++) {
addrdata[i] = AR5416_EEPROM_OFFSET +
((addr + eep_start_loc) << AR5416_EEPROM_S);
i++;
if (i == 8) {
REG_READ_MULTI(ah, addrdata, data, i);
for (j = 0; j < i; j++) {
*eep_data = data[j];
eep_data++;
}
i = 0;
}
}
if (i != 0) {
REG_READ_MULTI(ah, addrdata, data, i);
for (j = 0; j < i; j++) {
*eep_data = data[j];
eep_data++;
}
}
}
static bool ath9k_hw_nvram_read_array(u16 *blob, size_t blob_size,
off_t offset, u16 *data)
{
if (offset >= blob_size)
return false;
*data = blob[offset];
return true;
}
static bool ath9k_hw_nvram_read_firmware(const struct firmware *eeprom_blob,
off_t offset, u16 *data)
{
return ath9k_hw_nvram_read_array((u16 *) eeprom_blob->data,
eeprom_blob->size / sizeof(u16),
offset, data);
}
static bool ath9k_hw_nvram_read_nvmem(struct ath_hw *ah, off_t offset,
u16 *data)
{
return ath9k_hw_nvram_read_array(ah->nvmem_blob,
ah->nvmem_blob_len / sizeof(u16),
offset, data);
}
bool ath9k_hw_nvram_read(struct ath_hw *ah, u32 off, u16 *data)
{
struct ath_common *common = ath9k_hw_common(ah);
bool ret;
if (ah->nvmem_blob)
ret = ath9k_hw_nvram_read_nvmem(ah, off, data);
else if (ah->eeprom_blob)
ret = ath9k_hw_nvram_read_firmware(ah->eeprom_blob, off, data);
else
ret = common->bus_ops->eeprom_read(common, off, data);
if (!ret)
ath_dbg(common, EEPROM,
"unable to read eeprom region at offset %u\n", off);
return ret;
}
Annotation
- Immediate include surface: `hw.h`.
- Detected declarations: `function Copyright`, `function ath9k_hw_analog_shift_rmw`, `function ath9k_hw_interpolate`, `function ath9k_hw_get_lower_upper_index`, `function ath9k_hw_usb_gen_fill_eeprom`, `function ath9k_hw_nvram_read_array`, `function ath9k_hw_nvram_read_firmware`, `function ath9k_hw_nvram_read_nvmem`, `function ath9k_hw_nvram_read`, `function ath9k_hw_nvram_swap_data`.
- 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.