drivers/net/wireless/ath/ath11k/ahb.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath11k/ahb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath11k/ahb.c- Extension
.c- Size
- 32581 bytes
- Lines
- 1316
- 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 user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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/platform_device.hlinux/property.hlinux/of_device.hlinux/of.hlinux/of_reserved_mem.hlinux/dma-mapping.hlinux/iommu.hahb.hdebug.hhif.hqmi.hlinux/remoteproc.hpcic.hlinux/soc/qcom/smem.hlinux/soc/qcom/smem_state.h
Detected Declarations
enum ext_irq_numfunction ath11k_ahb_get_msi_irq_wcn6750function ath11k_ahb_get_window_start_wcn6750function ath11k_ahb_window_write32_wcn6750function ath11k_ahb_window_read32_wcn6750function ath11k_ahb_read32function ath11k_ahb_write32function ath11k_ahb_kill_taskletsfunction ath11k_ahb_ext_grp_disablefunction __ath11k_ahb_ext_irq_disablefunction ath11k_ahb_ext_grp_enablefunction ath11k_ahb_setbit32function ath11k_ahb_clearbit32function ath11k_ahb_ce_irq_enablefunction ath11k_ahb_ce_irq_disablefunction ath11k_ahb_sync_ce_irqsfunction ath11k_ahb_sync_ext_irqsfunction ath11k_ahb_ce_irqs_enablefunction ath11k_ahb_ce_irqs_disablefunction ath11k_ahb_startfunction ath11k_ahb_ext_irq_enablefunction ath11k_ahb_ext_irq_disablefunction ath11k_ahb_stopfunction ath11k_ahb_power_upfunction ath11k_ahb_power_downfunction ath11k_ahb_init_qmi_ce_configfunction ath11k_ahb_free_ext_irqfunction ath11k_ahb_free_irqfunction ath11k_ahb_ce_taskletfunction ath11k_ahb_ce_interrupt_handlerfunction ath11k_ahb_ext_grp_napi_pollfunction ath11k_ahb_ext_interrupt_handlerfunction ath11k_ahb_config_ext_irqfunction ath11k_ahb_config_irqfunction ath11k_ahb_map_service_to_pipefunction ath11k_ahb_hif_suspendfunction ath11k_ahb_hif_resumefunction ath11k_core_get_rprocfunction ath11k_ahb_setup_msi_resourcesfunction ath11k_ahb_setup_smp2p_handlefunction ath11k_ahb_release_smp2p_handlefunction ath11k_ahb_setup_resourcesfunction ath11k_ahb_setup_msa_resourcesfunction ath11k_ahb_ce_remapfunction ath11k_ahb_ce_unmapfunction ath11k_ahb_fw_resources_initfunction ath11k_ahb_fw_resource_deinitfunction ath11k_ahb_probe
Annotated Snippet
if (irq_grp->napi_enabled) {
napi_synchronize(&irq_grp->napi);
napi_disable(&irq_grp->napi);
irq_grp->napi_enabled = false;
}
}
}
static void ath11k_ahb_ext_grp_enable(struct ath11k_ext_irq_grp *irq_grp)
{
int i;
for (i = 0; i < irq_grp->num_irq; i++)
enable_irq(irq_grp->ab->irq_num[irq_grp->irqs[i]]);
}
static void ath11k_ahb_setbit32(struct ath11k_base *ab, u8 bit, u32 offset)
{
u32 val;
val = ath11k_ahb_read32(ab, offset);
ath11k_ahb_write32(ab, offset, val | BIT(bit));
}
static void ath11k_ahb_clearbit32(struct ath11k_base *ab, u8 bit, u32 offset)
{
u32 val;
val = ath11k_ahb_read32(ab, offset);
ath11k_ahb_write32(ab, offset, val & ~BIT(bit));
}
static void ath11k_ahb_ce_irq_enable(struct ath11k_base *ab, u16 ce_id)
{
const struct ce_attr *ce_attr;
const struct ce_ie_addr *ce_ie_addr = ab->hw_params.ce_ie_addr;
u32 ie1_reg_addr, ie2_reg_addr, ie3_reg_addr;
ie1_reg_addr = ce_ie_addr->ie1_reg_addr + ATH11K_CE_OFFSET(ab);
ie2_reg_addr = ce_ie_addr->ie2_reg_addr + ATH11K_CE_OFFSET(ab);
ie3_reg_addr = ce_ie_addr->ie3_reg_addr + ATH11K_CE_OFFSET(ab);
ce_attr = &ab->hw_params.host_ce_config[ce_id];
if (ce_attr->src_nentries)
ath11k_ahb_setbit32(ab, ce_id, ie1_reg_addr);
if (ce_attr->dest_nentries) {
ath11k_ahb_setbit32(ab, ce_id, ie2_reg_addr);
ath11k_ahb_setbit32(ab, ce_id + CE_HOST_IE_3_SHIFT,
ie3_reg_addr);
}
}
static void ath11k_ahb_ce_irq_disable(struct ath11k_base *ab, u16 ce_id)
{
const struct ce_attr *ce_attr;
const struct ce_ie_addr *ce_ie_addr = ab->hw_params.ce_ie_addr;
u32 ie1_reg_addr, ie2_reg_addr, ie3_reg_addr;
ie1_reg_addr = ce_ie_addr->ie1_reg_addr + ATH11K_CE_OFFSET(ab);
ie2_reg_addr = ce_ie_addr->ie2_reg_addr + ATH11K_CE_OFFSET(ab);
ie3_reg_addr = ce_ie_addr->ie3_reg_addr + ATH11K_CE_OFFSET(ab);
ce_attr = &ab->hw_params.host_ce_config[ce_id];
if (ce_attr->src_nentries)
ath11k_ahb_clearbit32(ab, ce_id, ie1_reg_addr);
if (ce_attr->dest_nentries) {
ath11k_ahb_clearbit32(ab, ce_id, ie2_reg_addr);
ath11k_ahb_clearbit32(ab, ce_id + CE_HOST_IE_3_SHIFT,
ie3_reg_addr);
}
}
static void ath11k_ahb_sync_ce_irqs(struct ath11k_base *ab)
{
int i;
int irq_idx;
for (i = 0; i < ab->hw_params.ce_count; i++) {
if (ath11k_ce_get_attr_flags(ab, i) & CE_ATTR_DIS_INTR)
continue;
irq_idx = ATH11K_IRQ_CE0_OFFSET + i;
synchronize_irq(ab->irq_num[irq_idx]);
}
}
static void ath11k_ahb_sync_ext_irqs(struct ath11k_base *ab)
{
Annotation
- Immediate include surface: `linux/module.h`, `linux/platform_device.h`, `linux/property.h`, `linux/of_device.h`, `linux/of.h`, `linux/of_reserved_mem.h`, `linux/dma-mapping.h`, `linux/iommu.h`.
- Detected declarations: `enum ext_irq_num`, `function ath11k_ahb_get_msi_irq_wcn6750`, `function ath11k_ahb_get_window_start_wcn6750`, `function ath11k_ahb_window_write32_wcn6750`, `function ath11k_ahb_window_read32_wcn6750`, `function ath11k_ahb_read32`, `function ath11k_ahb_write32`, `function ath11k_ahb_kill_tasklets`, `function ath11k_ahb_ext_grp_disable`, `function __ath11k_ahb_ext_irq_disable`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.