drivers/net/wireless/ath/ath11k/dp.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath11k/dp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath11k/dp.c- Extension
.c- Size
- 31227 bytes
- Lines
- 1193
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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.hcore.hdp_tx.hhal_tx.hhif.hdebug.hdp_rx.hpeer.h
Detected Declarations
function Copyrightfunction ath11k_dp_peer_cleanupfunction ath11k_dp_peer_setupfunction ath11k_dp_srng_cleanupfunction ath11k_dp_srng_find_ring_in_maskfunction ath11k_dp_srng_calculate_msi_groupfunction ath11k_dp_srng_msi_setupfunction ath11k_dp_srng_setupfunction ath11k_dp_stop_shadow_timersfunction ath11k_dp_srng_common_cleanupfunction ath11k_dp_srng_common_setupfunction ath11k_dp_scatter_idle_link_desc_cleanupfunction ath11k_dp_scatter_idle_link_desc_setupfunction ath11k_dp_link_desc_bank_freefunction ath11k_dp_link_desc_bank_allocfunction ath11k_dp_link_desc_cleanupfunction ath11k_wbm_idle_ring_setupfunction ath11k_dp_link_desc_setupfunction ath11k_dp_service_srngfunction ath11k_dp_pdev_freefunction ath11k_dp_pdev_pre_allocfunction ath11k_dp_pdev_allocfunction ath11k_dp_htt_connectfunction ath11k_dp_update_vdev_searchfunction ath11k_dp_vdev_tx_attachfunction ath11k_dp_tx_pending_cleanupfunction ath11k_dp_freefunction ath11k_dp_allocfunction ath11k_dp_shadow_timer_handlerfunction ath11k_dp_shadow_start_timerfunction ath11k_dp_shadow_stop_timerfunction ath11k_dp_shadow_init_timerexport ath11k_dp_service_srng
Annotated Snippet
if (ret) {
ath11k_warn(ab, "failed to setup rxd tid queue for tid %d: %d\n",
tid, ret);
goto peer_clean;
}
}
ret = ath11k_peer_rx_frag_setup(ar, addr, vdev_id);
if (ret) {
ath11k_warn(ab, "failed to setup rx defrag context\n");
tid--;
goto peer_clean;
}
/* TODO: Setup other peer specific resource used in data path */
return 0;
peer_clean:
spin_lock_bh(&ab->base_lock);
peer = ath11k_peer_find(ab, vdev_id, addr);
if (!peer) {
ath11k_warn(ab, "failed to find the peer to del rx tid\n");
spin_unlock_bh(&ab->base_lock);
return -ENOENT;
}
for (; tid >= 0; tid--)
ath11k_peer_rx_tid_delete(ar, peer, tid);
spin_unlock_bh(&ab->base_lock);
return ret;
}
void ath11k_dp_srng_cleanup(struct ath11k_base *ab, struct dp_srng *ring)
{
if (!ring->vaddr_unaligned)
return;
if (ring->cached)
dma_free_noncoherent(ab->dev, ring->size, ring->vaddr_unaligned,
ring->paddr_unaligned, DMA_FROM_DEVICE);
else
dma_free_coherent(ab->dev, ring->size, ring->vaddr_unaligned,
ring->paddr_unaligned);
ring->vaddr_unaligned = NULL;
}
static int ath11k_dp_srng_find_ring_in_mask(int ring_num, const u8 *grp_mask)
{
int ext_group_num;
u8 mask = 1 << ring_num;
for (ext_group_num = 0; ext_group_num < ATH11K_EXT_IRQ_GRP_NUM_MAX;
ext_group_num++) {
if (mask & grp_mask[ext_group_num])
return ext_group_num;
}
return -ENOENT;
}
static int ath11k_dp_srng_calculate_msi_group(struct ath11k_base *ab,
enum hal_ring_type type, int ring_num)
{
const u8 *grp_mask;
switch (type) {
case HAL_WBM2SW_RELEASE:
if (ring_num == DP_RX_RELEASE_RING_NUM) {
grp_mask = &ab->hw_params.ring_mask->rx_wbm_rel[0];
ring_num = 0;
} else {
grp_mask = &ab->hw_params.ring_mask->tx[0];
}
break;
case HAL_REO_EXCEPTION:
grp_mask = &ab->hw_params.ring_mask->rx_err[0];
break;
case HAL_REO_DST:
grp_mask = &ab->hw_params.ring_mask->rx[0];
break;
case HAL_REO_STATUS:
grp_mask = &ab->hw_params.ring_mask->reo_status[0];
break;
case HAL_RXDMA_MONITOR_STATUS:
case HAL_RXDMA_MONITOR_DST:
Annotation
- Immediate include surface: `linux/export.h`, `core.h`, `dp_tx.h`, `hal_tx.h`, `hif.h`, `debug.h`, `dp_rx.h`, `peer.h`.
- Detected declarations: `function Copyright`, `function ath11k_dp_peer_cleanup`, `function ath11k_dp_peer_setup`, `function ath11k_dp_srng_cleanup`, `function ath11k_dp_srng_find_ring_in_mask`, `function ath11k_dp_srng_calculate_msi_group`, `function ath11k_dp_srng_msi_setup`, `function ath11k_dp_srng_setup`, `function ath11k_dp_stop_shadow_timers`, `function ath11k_dp_srng_common_cleanup`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.