drivers/net/wireless/ath/ath12k/wifi7/hal_rx.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath12k/wifi7/hal_rx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath12k/wifi7/hal_rx.c- Extension
.c- Size
- 34105 bytes
- Lines
- 974
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
../debug.h../hal.h../hif.hhal_tx.hhal_rx.hhal_desc.hhal.h
Detected Declarations
function Copyrightfunction ath12k_wifi7_hal_reo_cmd_queue_statsfunction ath12k_wifi7_hal_reo_cmd_flush_cachefunction ath12k_wifi7_hal_reo_cmd_update_rx_queuefunction ath12k_wifi7_hal_reo_cmd_sendfunction ath12k_wifi7_hal_rx_buf_addr_info_setfunction ath12k_wifi7_hal_rx_buf_addr_info_getfunction ath12k_wifi7_hal_rx_msdu_link_info_getfunction ath12k_wifi7_hal_desc_reo_parse_errfunction ath12k_wifi7_hal_wbm_desc_parse_errfunction ath12k_wifi7_hal_rx_reo_ent_paddr_getfunction ath12k_wifi7_hal_rx_reo_ent_buf_paddr_getfunction ath12k_wifi7_hal_rx_msdu_list_getfunction ath12k_wifi7_hal_rx_msdu_link_desc_setfunction ath12k_wifi7_hal_reo_status_queue_statsfunction ath12k_wifi7_hal_reo_flush_queue_statusfunction ath12k_wifi7_hal_reo_flush_cache_statusfunction ath12k_wifi7_hal_reo_unblk_cache_statusfunction ath12k_wifi7_hal_reo_flush_timeout_list_statusfunction ath12k_wifi7_hal_reo_desc_thresh_reached_statusfunction ath12k_wifi7_hal_reo_update_rx_reo_queue_statusfunction ath12k_wifi7_hal_reo_qdesc_sizefunction ath12k_wifi7_hal_reo_qdesc_setupfunction ath12k_wifi7_hal_reo_init_cmd_ring_tlv64function ath12k_wifi7_hal_reo_init_cmd_ring_tlv32function ath12k_wifi7_hal_reo_hw_setupfunction ath12k_wifi7_hal_reo_shared_qaddr_cache_clear
Annotated Snippet
if (val == 0) {
*num_msdus = i;
break;
}
*msdu_cookies = le32_get_bits(msdu->buf_addr_info.info1,
BUFFER_ADDR_INFO1_SW_COOKIE);
msdu_cookies++;
}
}
int ath12k_wifi7_hal_desc_reo_parse_err(struct ath12k_dp *dp,
struct hal_reo_dest_ring *desc,
dma_addr_t *paddr, u32 *desc_bank)
{
struct ath12k_base *ab = dp->ab;
enum hal_reo_dest_ring_push_reason push_reason;
enum hal_reo_dest_ring_error_code err_code;
u32 cookie;
push_reason = le32_get_bits(desc->info0,
HAL_REO_DEST_RING_INFO0_PUSH_REASON);
err_code = le32_get_bits(desc->info0,
HAL_REO_DEST_RING_INFO0_ERROR_CODE);
dp->device_stats.reo_error[err_code]++;
if (push_reason != HAL_REO_DEST_RING_PUSH_REASON_ERR_DETECTED &&
push_reason != HAL_REO_DEST_RING_PUSH_REASON_ROUTING_INSTRUCTION) {
ath12k_warn(ab, "expected error push reason code, received %d\n",
push_reason);
return -EINVAL;
}
ath12k_wifi7_hal_rx_reo_ent_paddr_get(&desc->buf_addr_info, paddr,
&cookie);
*desc_bank = u32_get_bits(cookie, DP_LINK_DESC_BANK_MASK);
return 0;
}
int ath12k_wifi7_hal_wbm_desc_parse_err(struct ath12k_dp *dp, void *desc,
struct hal_rx_wbm_rel_info *rel_info)
{
struct hal_wbm_release_ring *wbm_desc = desc;
struct hal_wbm_release_ring_cc_rx *wbm_cc_desc = desc;
enum hal_wbm_rel_desc_type type;
enum hal_wbm_rel_src_module rel_src;
bool hw_cc_done;
u64 desc_va;
u32 val;
type = le32_get_bits(wbm_desc->info0, HAL_WBM_RELEASE_INFO0_DESC_TYPE);
/* We expect only WBM_REL buffer type */
if (type != HAL_WBM_REL_DESC_TYPE_REL_MSDU) {
WARN_ON(1);
return -EINVAL;
}
rel_src = le32_get_bits(wbm_desc->info0,
HAL_WBM_RELEASE_INFO0_REL_SRC_MODULE);
if (rel_src != HAL_WBM_REL_SRC_MODULE_RXDMA &&
rel_src != HAL_WBM_REL_SRC_MODULE_REO)
return -EINVAL;
/* The format of wbm rel ring desc changes based on the
* hw cookie conversion status
*/
hw_cc_done = le32_get_bits(wbm_desc->info0,
HAL_WBM_RELEASE_RX_INFO0_CC_STATUS);
if (!hw_cc_done) {
val = le32_get_bits(wbm_desc->buf_addr_info.info1,
BUFFER_ADDR_INFO1_RET_BUF_MGR);
if (val != HAL_RX_BUF_RBM_SW3_BM) {
dp->device_stats.invalid_rbm++;
return -EINVAL;
}
rel_info->cookie = le32_get_bits(wbm_desc->buf_addr_info.info1,
BUFFER_ADDR_INFO1_SW_COOKIE);
rel_info->rx_desc = NULL;
} else {
val = le32_get_bits(wbm_cc_desc->info0,
HAL_WBM_RELEASE_RX_CC_INFO0_RBM);
if (val != HAL_RX_BUF_RBM_SW3_BM) {
dp->device_stats.invalid_rbm++;
return -EINVAL;
}
rel_info->cookie = le32_get_bits(wbm_cc_desc->info1,
Annotation
- Immediate include surface: `../debug.h`, `../hal.h`, `../hif.h`, `hal_tx.h`, `hal_rx.h`, `hal_desc.h`, `hal.h`.
- Detected declarations: `function Copyright`, `function ath12k_wifi7_hal_reo_cmd_queue_stats`, `function ath12k_wifi7_hal_reo_cmd_flush_cache`, `function ath12k_wifi7_hal_reo_cmd_update_rx_queue`, `function ath12k_wifi7_hal_reo_cmd_send`, `function ath12k_wifi7_hal_rx_buf_addr_info_set`, `function ath12k_wifi7_hal_rx_buf_addr_info_get`, `function ath12k_wifi7_hal_rx_msdu_link_info_get`, `function ath12k_wifi7_hal_desc_reo_parse_err`, `function ath12k_wifi7_hal_wbm_desc_parse_err`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.