drivers/net/wireless/ath/ath10k/core.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath10k/core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath10k/core.c- Extension
.c- Size
- 101342 bytes
- Lines
- 3785
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/export.hlinux/module.hlinux/firmware.hlinux/of.hlinux/property.hlinux/dmi.hlinux/ctype.hlinux/pm_qos.hlinux/nvmem-consumer.hasm/byteorder.hcore.hmac.hhtc.hhif.hwmi.hbmi.hdebug.hhtt.htestmode.hwmi-ops.hcoredump.hleds.h
Detected Declarations
function ath10k_core_get_fw_feature_strfunction ath10k_core_get_fw_features_strfunction ath10k_send_suspend_completefunction ath10k_init_sdiofunction ath10k_init_configure_targetfunction ath10k_push_board_ext_datafunction ath10k_core_get_board_id_from_otpfunction ath10k_core_check_bdfextfunction ath10k_core_check_smbiosfunction ath10k_core_check_dtfunction ath10k_download_fwfunction ath10k_core_free_board_filesfunction ath10k_core_free_firmware_filesfunction ath10k_fetch_cal_filefunction ath10k_core_fetch_board_data_api_1function ath10k_core_parse_bd_ie_boardfunction ath10k_core_search_bdfunction ath10k_core_fetch_board_data_api_nfunction ath10k_core_create_board_namefunction ath10k_core_create_eboard_namefunction ath10k_core_fetch_board_filefunction ath10k_core_get_ext_board_id_from_otpfunction ath10k_download_board_datafunction ath10k_download_and_run_otpfunction ath10k_download_cal_filefunction ath10k_download_cal_dtfunction ath10k_download_cal_eepromfunction ath10k_download_cal_nvmemfunction ath10k_core_fetch_firmware_api_nfunction ath10k_core_get_fw_namefunction ath10k_core_fetch_firmware_filesfunction ath10k_core_pre_cal_downloadfunction ath10k_core_pre_cal_configfunction ath10k_download_cal_datafunction ath10k_core_fetch_btcoex_dtfunction ath10k_init_uartfunction ath10k_init_hw_paramsfunction ath10k_core_recovery_check_workfunction ath10k_core_start_recoveryfunction ath10k_core_napi_enablefunction ath10k_core_napi_sync_disablefunction ath10k_core_restartfunction ath10k_core_set_coverage_class_workfunction ath10k_core_init_firmware_featuresfunction ath10k_core_reset_rx_filterfunction ath10k_core_compat_servicesfunction ath10k_core_copy_target_iramfunction ath10k_core_start
Annotated Snippet
WARN_ON(!ath10k_core_fw_feature_str[feat])) {
return scnprintf(buf, buf_len, "bit%d", feat);
}
return scnprintf(buf, buf_len, "%s", ath10k_core_fw_feature_str[feat]);
}
void ath10k_core_get_fw_features_str(struct ath10k *ar,
char *buf,
size_t buf_len)
{
size_t len = 0;
int i;
for (i = 0; i < ATH10K_FW_FEATURE_COUNT; i++) {
if (test_bit(i, ar->normal_mode_fw.fw_file.fw_features)) {
if (len > 0)
len += scnprintf(buf + len, buf_len - len, ",");
len += ath10k_core_get_fw_feature_str(buf + len,
buf_len - len,
i);
}
}
}
static void ath10k_send_suspend_complete(struct ath10k *ar)
{
ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot suspend complete\n");
complete(&ar->target_suspend);
}
static int ath10k_init_sdio(struct ath10k *ar, enum ath10k_firmware_mode mode)
{
bool mtu_workaround = ar->hw_params.credit_size_workaround;
int ret;
u32 param = 0;
ret = ath10k_bmi_write32(ar, hi_mbox_io_block_sz, 256);
if (ret)
return ret;
ret = ath10k_bmi_write32(ar, hi_mbox_isr_yield_limit, 99);
if (ret)
return ret;
ret = ath10k_bmi_read32(ar, hi_acs_flags, ¶m);
if (ret)
return ret;
param |= HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET;
if (mode == ATH10K_FIRMWARE_MODE_NORMAL && !mtu_workaround)
param |= HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE;
else
param &= ~HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE;
if (mode == ATH10K_FIRMWARE_MODE_UTF)
param &= ~HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET;
else
param |= HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET;
ret = ath10k_bmi_write32(ar, hi_acs_flags, param);
if (ret)
return ret;
ret = ath10k_bmi_read32(ar, hi_option_flag2, ¶m);
if (ret)
return ret;
param |= HI_OPTION_SDIO_CRASH_DUMP_ENHANCEMENT_HOST;
ret = ath10k_bmi_write32(ar, hi_option_flag2, param);
if (ret)
return ret;
return 0;
}
static int ath10k_init_configure_target(struct ath10k *ar)
{
u32 param_host;
int ret;
/* tell target which HTC version it is used*/
ret = ath10k_bmi_write32(ar, hi_app_host_interest,
HTC_PROTOCOL_VERSION);
if (ret) {
ath10k_err(ar, "settings HTC version failed\n");
Annotation
- Immediate include surface: `linux/export.h`, `linux/module.h`, `linux/firmware.h`, `linux/of.h`, `linux/property.h`, `linux/dmi.h`, `linux/ctype.h`, `linux/pm_qos.h`.
- Detected declarations: `function ath10k_core_get_fw_feature_str`, `function ath10k_core_get_fw_features_str`, `function ath10k_send_suspend_complete`, `function ath10k_init_sdio`, `function ath10k_init_configure_target`, `function ath10k_push_board_ext_data`, `function ath10k_core_get_board_id_from_otp`, `function ath10k_core_check_bdfext`, `function ath10k_core_check_smbios`, `function ath10k_core_check_dt`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.