drivers/net/wireless/ath/wil6210/txrx_edma.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/wil6210/txrx_edma.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/wil6210/txrx_edma.c- Extension
.c- Size
- 43992 bytes
- Lines
- 1646
- 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.
- 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/etherdevice.hlinux/moduleparam.hlinux/prefetch.hlinux/types.hlinux/list.hlinux/ip.hlinux/ipv6.hwil6210.htxrx_edma.htxrx.htrace.h
Detected Declarations
function Copyrightfunction wil_find_free_sringfunction wil_sring_freefunction wil_sring_allocfunction wil_tx_init_edmafunction wil_ring_alloc_skb_edmafunction wil_get_next_rx_status_msgfunction wil_sring_advance_swheadfunction wil_rx_refill_edmafunction wil_move_all_rx_buff_to_free_listfunction wil_free_rx_buff_arrfunction wil_init_rx_buff_arrfunction wil_init_rx_sringfunction wil_ring_alloc_desc_ringfunction wil_ring_free_edmafunction wil_init_rx_desc_ringfunction wil_get_reorder_params_edmafunction wil_get_netif_rx_params_edmafunction wil_rx_crypto_check_edmafunction wil_is_rx_idle_edmafunction wil_rx_buf_len_init_edmafunction wil_rx_init_edmafunction wil_ring_init_tx_edmafunction wil_tx_ring_modify_edmafunction wil_check_barfunction wil_rx_error_check_edmafunction wil_rx_handle_edmafunction wil_tx_desc_map_edmafunction wil_get_next_tx_status_msgfunction wil_tx_sring_handlerfunction wil_tx_desc_offload_setup_tso_edmafunction wil_tx_tso_gen_descfunction __wil_tx_ring_tso_edmafunction wil_ring_init_bcast_edmafunction wil_tx_fini_edmafunction wil_rx_data_freefunction wil_rx_fini_edmafunction wil_init_txrx_ops_edma
Annotated Snippet
if (unlikely(rc)) {
if (rc == -EAGAIN)
wil_dbg_txrx(wil, "No free buffer ID found\n");
else
wil_err_ratelimited(wil,
"Error %d in refill desc[%d]\n",
rc, ring->swhead);
break;
}
}
/* make sure all writes to descriptors (shared memory) are done before
* committing them to HW
*/
wmb();
wil_w(wil, ring->hwtail, ring->swhead);
return rc;
}
static void wil_move_all_rx_buff_to_free_list(struct wil6210_priv *wil,
struct wil_ring *ring)
{
struct device *dev = wil_to_dev(wil);
struct list_head *active = &wil->rx_buff_mgmt.active;
dma_addr_t pa;
if (!wil->rx_buff_mgmt.buff_arr)
return;
while (!list_empty(active)) {
struct wil_rx_buff *rx_buff =
list_first_entry(active, struct wil_rx_buff, list);
struct sk_buff *skb = rx_buff->skb;
if (unlikely(!skb)) {
wil_err(wil, "No Rx skb at buff_id %d\n", rx_buff->id);
} else {
rx_buff->skb = NULL;
memcpy(&pa, skb->cb, sizeof(pa));
dma_unmap_single(dev, pa, wil->rx_buf_len,
DMA_FROM_DEVICE);
kfree_skb(skb);
}
/* Move the buffer from the active to the free list */
list_move(&rx_buff->list, &wil->rx_buff_mgmt.free);
}
}
static void wil_free_rx_buff_arr(struct wil6210_priv *wil)
{
struct wil_ring *ring = &wil->ring_rx;
if (!wil->rx_buff_mgmt.buff_arr)
return;
/* Move all the buffers to the free list in case active list is
* not empty in order to release all SKBs before deleting the array
*/
wil_move_all_rx_buff_to_free_list(wil, ring);
kfree(wil->rx_buff_mgmt.buff_arr);
wil->rx_buff_mgmt.buff_arr = NULL;
}
static int wil_init_rx_buff_arr(struct wil6210_priv *wil,
size_t size)
{
struct wil_rx_buff *buff_arr;
struct list_head *active = &wil->rx_buff_mgmt.active;
struct list_head *free = &wil->rx_buff_mgmt.free;
int i;
wil->rx_buff_mgmt.buff_arr = kzalloc_objs(struct wil_rx_buff, size + 1);
if (!wil->rx_buff_mgmt.buff_arr)
return -ENOMEM;
/* Set list heads */
INIT_LIST_HEAD(active);
INIT_LIST_HEAD(free);
/* Linkify the list.
* buffer id 0 should not be used (marks invalid id).
*/
buff_arr = wil->rx_buff_mgmt.buff_arr;
for (i = 1; i <= size; i++) {
list_add(&buff_arr[i].list, free);
buff_arr[i].id = i;
Annotation
- Immediate include surface: `linux/etherdevice.h`, `linux/moduleparam.h`, `linux/prefetch.h`, `linux/types.h`, `linux/list.h`, `linux/ip.h`, `linux/ipv6.h`, `wil6210.h`.
- Detected declarations: `function Copyright`, `function wil_find_free_sring`, `function wil_sring_free`, `function wil_sring_alloc`, `function wil_tx_init_edma`, `function wil_ring_alloc_skb_edma`, `function wil_get_next_rx_status_msg`, `function wil_sring_advance_swhead`, `function wil_rx_refill_edma`, `function wil_move_all_rx_buff_to_free_list`.
- 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.