drivers/net/wireless/ath/ath10k/snoc.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath10k/snoc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath10k/snoc.c- Extension
.c- Size
- 48006 bytes
- Lines
- 1946
- 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.
- 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/bits.hlinux/clk.hlinux/kernel.hlinux/module.hlinux/of.hlinux/of_device.hlinux/platform_device.hlinux/property.hlinux/pwrseq/consumer.hlinux/regulator/consumer.hlinux/remoteproc/qcom_rproc.hlinux/of_reserved_mem.hlinux/iommu.hce.hcoredump.hdebug.hhif.hhtc.hsnoc.h
Detected Declarations
function ath10k_snoc_write32function ath10k_snoc_read32function __ath10k_snoc_rx_post_buffunction ath10k_snoc_rx_post_pipefunction ath10k_snoc_rx_postfunction ath10k_snoc_process_rx_cbfunction ath10k_snoc_htc_rx_cbfunction ath10k_snoc_htt_htc_rx_cbfunction CEfunction ath10k_snoc_htt_rx_deliverfunction ath10k_snoc_htt_rx_cbfunction ath10k_snoc_rx_replenish_retryfunction ath10k_snoc_htc_tx_cbfunction ath10k_snoc_htt_tx_cbfunction ath10k_snoc_hif_tx_sgfunction ath10k_snoc_hif_get_target_infofunction ath10k_snoc_hif_get_free_queue_numberfunction ath10k_snoc_hif_send_complete_checkfunction ath10k_snoc_hif_map_service_to_pipefunction ath10k_snoc_hif_get_default_pipefunction ath10k_snoc_irq_disablefunction ath10k_snoc_irq_enablefunction ath10k_snoc_rx_pipe_cleanupfunction ath10k_snoc_tx_pipe_cleanupfunction ath10k_snoc_buffer_cleanupfunction ath10k_snoc_hif_stopfunction ath10k_snoc_hif_startfunction ath10k_snoc_init_pipesfunction ath10k_snoc_wlan_enablefunction ath10k_hw_power_onfunction ath10k_hw_power_offfunction ath10k_snoc_wlan_disablefunction ath10k_snoc_hif_power_downfunction ath10k_snoc_hif_power_upfunction ath10k_snoc_hif_set_target_log_modefunction ath10k_snoc_hif_suspendfunction ath10k_snoc_hif_resumefunction ath10k_snoc_get_ce_id_from_irqfunction ath10k_snoc_per_engine_handlerfunction ath10k_snoc_napi_pollfunction ath10k_snoc_init_napifunction ath10k_snoc_request_irqfunction ath10k_snoc_free_irqfunction ath10k_snoc_resource_initfunction ath10k_snoc_quirks_initfunction ath10k_snoc_fw_indicationfunction ath10k_snoc_setup_resourcefunction ath10k_snoc_release_resource
Annotated Snippet
if (ret) {
if (ret == -ENOSPC)
break;
ath10k_warn(ar, "failed to post rx buf: %d\n", ret);
mod_timer(&ar_snoc->rx_post_retry, jiffies +
ATH10K_SNOC_RX_POST_RETRY_MS);
break;
}
}
}
static void ath10k_snoc_rx_post(struct ath10k *ar)
{
struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar);
int i;
for (i = 0; i < CE_COUNT; i++)
ath10k_snoc_rx_post_pipe(&ar_snoc->pipe_info[i]);
}
static void ath10k_snoc_process_rx_cb(struct ath10k_ce_pipe *ce_state,
void (*callback)(struct ath10k *ar,
struct sk_buff *skb))
{
struct ath10k *ar = ce_state->ar;
struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar);
struct ath10k_snoc_pipe *pipe_info = &ar_snoc->pipe_info[ce_state->id];
struct sk_buff *skb;
struct sk_buff_head list;
void *transfer_context;
unsigned int nbytes, max_nbytes;
__skb_queue_head_init(&list);
while (ath10k_ce_completed_recv_next(ce_state, &transfer_context,
&nbytes) == 0) {
skb = transfer_context;
max_nbytes = skb->len + skb_tailroom(skb);
dma_unmap_single(ar->dev, ATH10K_SKB_RXCB(skb)->paddr,
max_nbytes, DMA_FROM_DEVICE);
if (unlikely(max_nbytes < nbytes)) {
ath10k_warn(ar, "rxed more than expected (nbytes %d, max %d)\n",
nbytes, max_nbytes);
dev_kfree_skb_any(skb);
continue;
}
skb_put(skb, nbytes);
__skb_queue_tail(&list, skb);
}
while ((skb = __skb_dequeue(&list))) {
ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc rx ce pipe %d len %d\n",
ce_state->id, skb->len);
callback(ar, skb);
}
ath10k_snoc_rx_post_pipe(pipe_info);
}
static void ath10k_snoc_htc_rx_cb(struct ath10k_ce_pipe *ce_state)
{
ath10k_snoc_process_rx_cb(ce_state, ath10k_htc_rx_completion_handler);
}
static void ath10k_snoc_htt_htc_rx_cb(struct ath10k_ce_pipe *ce_state)
{
/* CE4 polling needs to be done whenever CE pipe which transports
* HTT Rx (target->host) is processed.
*/
ath10k_ce_per_engine_service(ce_state->ar, CE_POLL_PIPE);
ath10k_snoc_process_rx_cb(ce_state, ath10k_htc_rx_completion_handler);
}
/* Called by lower (CE) layer when data is received from the Target.
* WCN3990 firmware uses separate CE(CE11) to transfer pktlog data.
*/
static void ath10k_snoc_pktlog_rx_cb(struct ath10k_ce_pipe *ce_state)
{
ath10k_snoc_process_rx_cb(ce_state, ath10k_htc_rx_completion_handler);
}
static void ath10k_snoc_htt_rx_deliver(struct ath10k *ar, struct sk_buff *skb)
{
skb_pull(skb, sizeof(struct ath10k_htc_hdr));
ath10k_htt_t2h_msg_handler(ar, skb);
}
Annotation
- Immediate include surface: `linux/bits.h`, `linux/clk.h`, `linux/kernel.h`, `linux/module.h`, `linux/of.h`, `linux/of_device.h`, `linux/platform_device.h`, `linux/property.h`.
- Detected declarations: `function ath10k_snoc_write32`, `function ath10k_snoc_read32`, `function __ath10k_snoc_rx_post_buf`, `function ath10k_snoc_rx_post_pipe`, `function ath10k_snoc_rx_post`, `function ath10k_snoc_process_rx_cb`, `function ath10k_snoc_htc_rx_cb`, `function ath10k_snoc_htt_htc_rx_cb`, `function CE`, `function ath10k_snoc_htt_rx_deliver`.
- 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.
- 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.