drivers/net/wireless/ath/wil6210/txrx.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/wil6210/txrx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/wil6210/txrx.c- Extension
.c- Size
- 70701 bytes
- Lines
- 2590
- 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.hnet/ieee80211_radiotap.hlinux/if_arp.hlinux/moduleparam.hlinux/ip.hlinux/ipv6.hlinux/if_vlan.hnet/ipv6.hlinux/prefetch.hwil6210.hwmi.htxrx.htrace.htxrx_edma.h
Detected Declarations
struct wil6210_rtapfunction wil_rx_snaplenfunction wil_ring_wmark_lowfunction wil_ring_wmark_highfunction wil_ring_avail_lowfunction wil_ring_avail_highfunction wil_is_tx_idlefunction wil_vring_allocfunction wil_txdesc_unmapfunction wil_vring_freefunction wil_vring_alloc_skbfunction wil_rx_add_radiotap_headerfunction wil_is_rx_idlefunction wil_rx_get_cid_by_skbfunction retransmissionfunction wil_rx_refillfunction reverse_memcmpfunction wil_rx_crypto_checkfunction wil_rx_error_checkfunction wil_get_netif_rx_paramsfunction wil_skb_is_eap_3function wil_skb_is_eap_4function wil_enable_tx_key_workerfunction wil_tx_complete_handle_eapolfunction wil_rx_handle_eapolfunction contextfunction wil_netif_rx_anyfunction wil_rx_handlefunction wil_rx_buf_len_initfunction wil_rx_initfunction wil_rx_finifunction wil_tx_desc_mapfunction wil_tx_data_initfunction wil_vring_init_txfunction wil_tx_vring_modifyfunction wil_vring_init_bcastfunction wil_check_multicast_to_unicastfunction wil_set_da_for_vringfunction wil_tx_desc_set_nr_fragsfunction wil_tx_desc_offload_setup_tsofunction wil_tx_desc_offload_setupfunction wil_tx_last_descfunction wil_set_tx_desc_last_tsofunction __wil_tx_vring_tsofunction __wil_tx_ringfunction wil_tx_ringfunction descriptorsfunction wil_update_net_queues
Annotated Snippet
struct wil6210_rtap {
struct ieee80211_radiotap_header_fixed rthdr;
/* fields should be in the order of bits in rthdr.it_present */
/* flags */
u8 flags;
/* channel */
__le16 chnl_freq __aligned(2);
__le16 chnl_flags;
/* MCS */
u8 mcs_present;
u8 mcs_flags;
u8 mcs_index;
} __packed;
struct vring_rx_desc *d = wil_skb_rxdesc(skb);
struct wil6210_rtap *rtap;
int rtap_len = sizeof(struct wil6210_rtap);
struct ieee80211_channel *ch = wil->monitor_chandef.chan;
if (skb_headroom(skb) < rtap_len &&
pskb_expand_head(skb, rtap_len, 0, GFP_ATOMIC)) {
wil_err(wil, "Unable to expand headroom to %d\n", rtap_len);
return;
}
rtap = skb_push(skb, rtap_len);
memset(rtap, 0, rtap_len);
rtap->rthdr.it_version = PKTHDR_RADIOTAP_VERSION;
rtap->rthdr.it_len = cpu_to_le16(rtap_len);
rtap->rthdr.it_present = cpu_to_le32((1 << IEEE80211_RADIOTAP_FLAGS) |
(1 << IEEE80211_RADIOTAP_CHANNEL) |
(1 << IEEE80211_RADIOTAP_MCS));
if (d->dma.status & RX_DMA_STATUS_ERROR)
rtap->flags |= IEEE80211_RADIOTAP_F_BADFCS;
rtap->chnl_freq = cpu_to_le16(ch ? ch->center_freq : 58320);
rtap->chnl_flags = cpu_to_le16(0);
rtap->mcs_present = IEEE80211_RADIOTAP_MCS_HAVE_MCS;
rtap->mcs_flags = 0;
rtap->mcs_index = wil_rxdesc_mcs(d);
}
static bool wil_is_rx_idle(struct wil6210_priv *wil)
{
struct vring_rx_desc *_d;
struct wil_ring *ring = &wil->ring_rx;
_d = (struct vring_rx_desc *)&ring->va[ring->swhead].rx.legacy;
if (_d->dma.status & RX_DMA_STATUS_DU)
return false;
return true;
}
static int wil_rx_get_cid_by_skb(struct wil6210_priv *wil, struct sk_buff *skb)
{
struct vring_rx_desc *d = wil_skb_rxdesc(skb);
int mid = wil_rxdesc_mid(d);
struct wil6210_vif *vif = wil->vifs[mid];
/* cid from DMA descriptor is limited to 3 bits.
* In case of cid>=8, the value would be cid modulo 8 and we need to
* find real cid by locating the transmitter (ta) inside sta array
*/
int cid = wil_rxdesc_cid(d);
unsigned int snaplen = wil_rx_snaplen();
struct ieee80211_hdr_3addr *hdr;
int i;
unsigned char *ta;
u8 ftype;
/* in monitor mode there are no connections */
if (vif->wdev.iftype == NL80211_IFTYPE_MONITOR)
return cid;
ftype = wil_rxdesc_ftype(d) << 2;
if (likely(ftype == IEEE80211_FTYPE_DATA)) {
if (unlikely(skb->len < ETH_HLEN + snaplen)) {
wil_err_ratelimited(wil,
"Short data frame, len = %d\n",
skb->len);
return -ENOENT;
}
ta = wil_skb_get_sa(skb);
} else {
if (unlikely(skb->len < sizeof(struct ieee80211_hdr_3addr))) {
wil_err_ratelimited(wil, "Short frame, len = %d\n",
skb->len);
return -ENOENT;
}
Annotation
- Immediate include surface: `linux/etherdevice.h`, `net/ieee80211_radiotap.h`, `linux/if_arp.h`, `linux/moduleparam.h`, `linux/ip.h`, `linux/ipv6.h`, `linux/if_vlan.h`, `net/ipv6.h`.
- Detected declarations: `struct wil6210_rtap`, `function wil_rx_snaplen`, `function wil_ring_wmark_low`, `function wil_ring_wmark_high`, `function wil_ring_avail_low`, `function wil_ring_avail_high`, `function wil_is_tx_idle`, `function wil_vring_alloc`, `function wil_txdesc_unmap`, `function wil_vring_free`.
- 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.