drivers/net/wireless/ath/ath10k/ce.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath10k/ce.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath10k/ce.c- Extension
.c- Size
- 55982 bytes
- Lines
- 1967
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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.hhif.hce.hdebug.h
Detected Declarations
function Copyrightfunction ath10k_set_ring_bytefunction ath10k_ce_read32function ath10k_ce_write32function ath10k_ce_dest_ring_write_index_setfunction ath10k_ce_dest_ring_write_index_getfunction ath10k_ce_src_ring_write_index_setfunction ath10k_ce_src_ring_write_index_getfunction ath10k_ce_src_ring_read_index_from_ddrfunction ath10k_ce_src_ring_read_index_getfunction ath10k_ce_shadow_src_ring_write_index_setfunction ath10k_ce_src_ring_base_addr_setfunction ath10k_ce_set_src_ring_base_addr_hifunction ath10k_ce_src_ring_size_setfunction ath10k_ce_src_ring_dmax_setfunction ath10k_ce_src_ring_byte_swap_setfunction ath10k_ce_dest_ring_byte_swap_setfunction ath10k_ce_dest_ring_read_index_from_ddrfunction ath10k_ce_dest_ring_read_index_getfunction ath10k_ce_dest_ring_base_addr_setfunction ath10k_ce_set_dest_ring_base_addr_hifunction ath10k_ce_dest_ring_size_setfunction ath10k_ce_src_ring_highmark_setfunction ath10k_ce_src_ring_lowmark_setfunction ath10k_ce_dest_ring_highmark_setfunction ath10k_ce_dest_ring_lowmark_setfunction ath10k_ce_copy_complete_inter_enablefunction ath10k_ce_copy_complete_intr_disablefunction ath10k_ce_watermark_intr_disablefunction ath10k_ce_error_intr_disablefunction ath10k_ce_engine_int_status_clearfunction _ath10k_ce_send_nolockfunction _ath10k_ce_send_nolock_64function ath10k_ce_send_nolockfunction __ath10k_ce_send_revertfunction ath10k_ce_sendfunction ath10k_ce_num_free_src_entriesfunction __ath10k_ce_rx_num_free_bufsfunction __ath10k_ce_rx_post_buffunction __ath10k_ce_rx_post_buf_64function ath10k_ce_rx_update_write_idxfunction ath10k_ce_rx_post_buffunction _ath10k_ce_completed_recv_next_nolockfunction _ath10k_ce_completed_recv_next_nolock_64function ath10k_ce_completed_recv_next_nolockfunction ath10k_ce_completed_recv_nextfunction _ath10k_ce_revoke_recv_nextfunction _ath10k_ce_revoke_recv_next_64
Annotated Snippet
if (ret) {
dma_free_coherent(ar->dev,
(nentries * sizeof(struct ce_desc) +
CE_DESC_RING_ALIGN),
src_ring->base_addr_owner_space_unaligned,
base_addr);
kfree(src_ring);
return ERR_PTR(ret);
}
}
return src_ring;
}
static struct ath10k_ce_ring *
ath10k_ce_alloc_src_ring_64(struct ath10k *ar, unsigned int ce_id,
const struct ce_attr *attr)
{
struct ath10k_ce_ring *src_ring;
u32 nentries = attr->src_nentries;
dma_addr_t base_addr;
int ret;
nentries = roundup_pow_of_two(nentries);
src_ring = kzalloc_flex(*src_ring, per_transfer_context, nentries);
if (!src_ring)
return ERR_PTR(-ENOMEM);
src_ring->nentries = nentries;
src_ring->nentries_mask = nentries - 1;
/* Legacy platforms that do not support cache
* coherent DMA are unsupported
*/
src_ring->base_addr_owner_space_unaligned =
dma_alloc_coherent(ar->dev,
(nentries * sizeof(struct ce_desc_64) +
CE_DESC_RING_ALIGN),
&base_addr, GFP_KERNEL);
if (!src_ring->base_addr_owner_space_unaligned) {
kfree(src_ring);
return ERR_PTR(-ENOMEM);
}
src_ring->base_addr_ce_space_unaligned = base_addr;
src_ring->base_addr_owner_space =
PTR_ALIGN(src_ring->base_addr_owner_space_unaligned,
CE_DESC_RING_ALIGN);
src_ring->base_addr_ce_space =
ALIGN(src_ring->base_addr_ce_space_unaligned,
CE_DESC_RING_ALIGN);
if (ar->hw_params.shadow_reg_support) {
ret = ath10k_ce_alloc_shadow_base(ar, src_ring, nentries);
if (ret) {
dma_free_coherent(ar->dev,
(nentries * sizeof(struct ce_desc_64) +
CE_DESC_RING_ALIGN),
src_ring->base_addr_owner_space_unaligned,
base_addr);
kfree(src_ring);
return ERR_PTR(ret);
}
}
return src_ring;
}
static struct ath10k_ce_ring *
ath10k_ce_alloc_dest_ring(struct ath10k *ar, unsigned int ce_id,
const struct ce_attr *attr)
{
struct ath10k_ce_ring *dest_ring;
u32 nentries;
dma_addr_t base_addr;
nentries = roundup_pow_of_two(attr->dest_nentries);
dest_ring = kzalloc_flex(*dest_ring, per_transfer_context, nentries);
if (dest_ring == NULL)
return ERR_PTR(-ENOMEM);
dest_ring->nentries = nentries;
dest_ring->nentries_mask = nentries - 1;
/*
* Legacy platforms that do not support cache
* coherent DMA are unsupported
Annotation
- Immediate include surface: `linux/export.h`, `hif.h`, `ce.h`, `debug.h`.
- Detected declarations: `function Copyright`, `function ath10k_set_ring_byte`, `function ath10k_ce_read32`, `function ath10k_ce_write32`, `function ath10k_ce_dest_ring_write_index_set`, `function ath10k_ce_dest_ring_write_index_get`, `function ath10k_ce_src_ring_write_index_set`, `function ath10k_ce_src_ring_write_index_get`, `function ath10k_ce_src_ring_read_index_from_ddr`, `function ath10k_ce_src_ring_read_index_get`.
- 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.
- 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.