drivers/net/wireless/ath/ath10k/ahb.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath10k/ahb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath10k/ahb.c- Extension
.c- Size
- 20848 bytes
- Lines
- 863
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/of.hlinux/platform_device.hlinux/clk.hlinux/reset.hcore.hdebug.hpci.hahb.h
Detected Declarations
function ath10k_ahb_write32function ath10k_ahb_read32function ath10k_ahb_gcc_read32function ath10k_ahb_tcsr_write32function ath10k_ahb_tcsr_read32function ath10k_ahb_soc_read32function ath10k_ahb_get_num_banksfunction ath10k_ahb_clock_initfunction ath10k_ahb_clock_deinitfunction ath10k_ahb_clock_enablefunction ath10k_ahb_clock_disablefunction ath10k_ahb_rst_ctrl_initfunction ath10k_ahb_rst_ctrl_deinitfunction ath10k_ahb_release_resetfunction ath10k_ahb_halt_axi_busfunction ath10k_ahb_halt_chipfunction ath10k_ahb_interrupt_handlerfunction ath10k_ahb_request_irq_intxfunction ath10k_ahb_release_irq_intxfunction ath10k_ahb_irq_disablefunction ath10k_ahb_resource_initfunction ath10k_ahb_resource_deinitfunction ath10k_ahb_prepare_devicefunction ath10k_ahb_chip_resetfunction ath10k_ahb_wake_target_cpufunction ath10k_ahb_hif_startfunction ath10k_ahb_hif_stopfunction ath10k_ahb_hif_power_upfunction ath10k_ahb_qca4019_targ_cpu_to_ce_addrfunction ath10k_ahb_probefunction ath10k_ahb_removefunction ath10k_ahb_initfunction ath10k_ahb_exit
Annotated Snippet
IS_ERR_OR_NULL(ar_ahb->rtc_clk)) {
ath10k_err(ar, "clock(s) is/are not initialized\n");
ret = -EIO;
goto out;
}
ret = clk_prepare_enable(ar_ahb->cmd_clk);
if (ret) {
ath10k_err(ar, "failed to enable cmd clk: %d\n", ret);
goto out;
}
ret = clk_prepare_enable(ar_ahb->ref_clk);
if (ret) {
ath10k_err(ar, "failed to enable ref clk: %d\n", ret);
goto err_cmd_clk_disable;
}
ret = clk_prepare_enable(ar_ahb->rtc_clk);
if (ret) {
ath10k_err(ar, "failed to enable rtc clk: %d\n", ret);
goto err_ref_clk_disable;
}
return 0;
err_ref_clk_disable:
clk_disable_unprepare(ar_ahb->ref_clk);
err_cmd_clk_disable:
clk_disable_unprepare(ar_ahb->cmd_clk);
out:
return ret;
}
static void ath10k_ahb_clock_disable(struct ath10k *ar)
{
struct ath10k_ahb *ar_ahb = ath10k_ahb_priv(ar);
clk_disable_unprepare(ar_ahb->cmd_clk);
clk_disable_unprepare(ar_ahb->ref_clk);
clk_disable_unprepare(ar_ahb->rtc_clk);
}
static int ath10k_ahb_rst_ctrl_init(struct ath10k *ar)
{
struct ath10k_ahb *ar_ahb = ath10k_ahb_priv(ar);
struct device *dev;
dev = &ar_ahb->pdev->dev;
ar_ahb->core_cold_rst = devm_reset_control_get_exclusive(dev,
"wifi_core_cold");
if (IS_ERR(ar_ahb->core_cold_rst)) {
ath10k_err(ar, "failed to get core cold rst ctrl: %ld\n",
PTR_ERR(ar_ahb->core_cold_rst));
return PTR_ERR(ar_ahb->core_cold_rst);
}
ar_ahb->radio_cold_rst = devm_reset_control_get_exclusive(dev,
"wifi_radio_cold");
if (IS_ERR(ar_ahb->radio_cold_rst)) {
ath10k_err(ar, "failed to get radio cold rst ctrl: %ld\n",
PTR_ERR(ar_ahb->radio_cold_rst));
return PTR_ERR(ar_ahb->radio_cold_rst);
}
ar_ahb->radio_warm_rst = devm_reset_control_get_exclusive(dev,
"wifi_radio_warm");
if (IS_ERR(ar_ahb->radio_warm_rst)) {
ath10k_err(ar, "failed to get radio warm rst ctrl: %ld\n",
PTR_ERR(ar_ahb->radio_warm_rst));
return PTR_ERR(ar_ahb->radio_warm_rst);
}
ar_ahb->radio_srif_rst = devm_reset_control_get_exclusive(dev,
"wifi_radio_srif");
if (IS_ERR(ar_ahb->radio_srif_rst)) {
ath10k_err(ar, "failed to get radio srif rst ctrl: %ld\n",
PTR_ERR(ar_ahb->radio_srif_rst));
return PTR_ERR(ar_ahb->radio_srif_rst);
}
ar_ahb->cpu_init_rst = devm_reset_control_get_exclusive(dev,
"wifi_cpu_init");
if (IS_ERR(ar_ahb->cpu_init_rst)) {
ath10k_err(ar, "failed to get cpu init rst ctrl: %ld\n",
Annotation
- Immediate include surface: `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/clk.h`, `linux/reset.h`, `core.h`, `debug.h`, `pci.h`.
- Detected declarations: `function ath10k_ahb_write32`, `function ath10k_ahb_read32`, `function ath10k_ahb_gcc_read32`, `function ath10k_ahb_tcsr_write32`, `function ath10k_ahb_tcsr_read32`, `function ath10k_ahb_soc_read32`, `function ath10k_ahb_get_num_banks`, `function ath10k_ahb_clock_init`, `function ath10k_ahb_clock_deinit`, `function ath10k_ahb_clock_enable`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.