drivers/net/wireless/intel/ipw2x00/libipw_rx.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/ipw2x00/libipw_rx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/ipw2x00/libipw_rx.c- Extension
.c- Size
- 47782 bytes
- Lines
- 1644
- 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.
- 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
linux/compiler.hlinux/errno.hlinux/if_arp.hlinux/in6.hlinux/gfp.hlinux/in.hlinux/ip.hlinux/kernel.hlinux/module.hlinux/netdevice.hlinux/proc_fs.hlinux/skbuff.hlinux/tcp.hlinux/types.hlinux/wireless.hlinux/etherdevice.hlinux/uaccess.hlinux/ctype.hlibipw.h
Detected Declarations
function APfunction libipw_frag_cache_invalidatefunction libipw_rx_frame_mgmtfunction libipw_is_eapol_framefunction ether_addr_equalfunction libipw_rx_frame_decryptfunction libipw_rx_frame_decrypt_msdufunction taskletfunction datafunction memcmpfunction libipw_verify_qos_infofunction libipw_read_qos_param_elementfunction libipw_read_qos_info_elementfunction libipw_qos_convert_ac_to_parametersfunction libipw_parse_qos_info_param_IEfunction libipw_parse_info_paramfunction libipw_handle_assoc_respfunction libipw_network_initfunction is_same_networkfunction update_networkfunction is_beaconfunction libipw_process_probe_responsefunction list_for_each_entryfunction libipw_rx_mgtexport libipw_rx_mgtexport libipw_rx
Annotated Snippet
time_after(jiffies, entry->first_frag_time + 2 * HZ)) {
LIBIPW_DEBUG_FRAG("expiring fragment cache entry "
"seq=%u last_frag=%u\n",
entry->seq, entry->last_frag);
dev_kfree_skb_any(entry->skb);
entry->skb = NULL;
}
if (entry->skb != NULL && entry->seq == seq &&
(entry->last_frag + 1 == frag || frag == -1) &&
ether_addr_equal(entry->src_addr, src) &&
ether_addr_equal(entry->dst_addr, dst))
return entry;
}
return NULL;
}
/* Called only as a tasklet (software IRQ) */
static struct sk_buff *libipw_frag_cache_get(struct libipw_device *ieee,
struct libipw_hdr_4addr *hdr)
{
struct sk_buff *skb = NULL;
u16 sc;
unsigned int frag, seq;
struct libipw_frag_entry *entry;
sc = le16_to_cpu(hdr->seq_ctl);
frag = WLAN_GET_SEQ_FRAG(sc);
seq = WLAN_GET_SEQ_SEQ(sc);
if (frag == 0) {
/* Reserve enough space to fit maximum frame length */
skb = dev_alloc_skb(ieee->dev->mtu +
sizeof(struct libipw_hdr_4addr) +
8 /* LLC */ +
2 /* alignment */ +
8 /* WEP */ + ETH_ALEN /* WDS */ );
if (skb == NULL)
return NULL;
entry = &ieee->frag_cache[ieee->frag_next_idx];
ieee->frag_next_idx++;
if (ieee->frag_next_idx >= LIBIPW_FRAG_CACHE_LEN)
ieee->frag_next_idx = 0;
if (entry->skb != NULL)
dev_kfree_skb_any(entry->skb);
entry->first_frag_time = jiffies;
entry->seq = seq;
entry->last_frag = frag;
entry->skb = skb;
memcpy(entry->src_addr, hdr->addr2, ETH_ALEN);
memcpy(entry->dst_addr, hdr->addr1, ETH_ALEN);
} else {
/* received a fragment of a frame for which the head fragment
* should have already been received */
entry = libipw_frag_cache_find(ieee, seq, frag, hdr->addr2,
hdr->addr1);
if (entry != NULL) {
entry->last_frag = frag;
skb = entry->skb;
}
}
return skb;
}
/* Called only as a tasklet (software IRQ) */
static int libipw_frag_cache_invalidate(struct libipw_device *ieee,
struct libipw_hdr_4addr *hdr)
{
u16 sc;
unsigned int seq;
struct libipw_frag_entry *entry;
sc = le16_to_cpu(hdr->seq_ctl);
seq = WLAN_GET_SEQ_SEQ(sc);
entry = libipw_frag_cache_find(ieee, seq, -1, hdr->addr2,
hdr->addr1);
if (entry == NULL) {
LIBIPW_DEBUG_FRAG("could not invalidate fragment cache "
"entry (seq=%u)\n", seq);
return -1;
}
entry->skb = NULL;
Annotation
- Immediate include surface: `linux/compiler.h`, `linux/errno.h`, `linux/if_arp.h`, `linux/in6.h`, `linux/gfp.h`, `linux/in.h`, `linux/ip.h`, `linux/kernel.h`.
- Detected declarations: `function AP`, `function libipw_frag_cache_invalidate`, `function libipw_rx_frame_mgmt`, `function libipw_is_eapol_frame`, `function ether_addr_equal`, `function libipw_rx_frame_decrypt`, `function libipw_rx_frame_decrypt_msdu`, `function tasklet`, `function data`, `function memcmp`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.