net/mac80211/parse.c
Source file repositories/reference/linux-study-clean/net/mac80211/parse.c
File Facts
- System
- Linux kernel
- Corpus path
net/mac80211/parse.c- Extension
.c- Size
- 33110 bytes
- Lines
- 1212
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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
net/mac80211.hlinux/netdevice.hlinux/export.hlinux/types.hlinux/slab.hlinux/skbuff.hlinux/etherdevice.hlinux/if_arp.hlinux/bitmap.hlinux/crc32.hnet/net_namespace.hnet/cfg80211.hnet/rtnetlink.hkunit/visibility.hieee80211_i.hdriver-ops.hrate.hmesh.hwme.hled.hwep.h
Detected Declarations
struct ieee80211_elem_defragstruct ieee80211_elems_parsefunction ieee80211_parse_extension_elementfunction ieee80211_parse_tpefunction _ieee802_11_parse_elems_fullfunction for_each_elementfunction tagfunction ieee802_11_find_bssid_profilefunction for_each_element_idfunction for_each_elementfunction ieee80211_mle_get_sta_proffunction for_each_mle_subelementfunction ieee80211_prep_mle_link_parsefunction for_each_element_extidfunction ieee80211_mle_defragfunction ieee802_11_parse_elems_fullfunction ieee80211_parse_bitrates
Annotated Snippet
struct ieee80211_elem_defrag {
const struct element *elem;
/* container start/len */
const u8 *start;
size_t len;
};
struct ieee80211_elems_parse {
/* must be first for kfree to work */
struct ieee802_11_elems elems;
struct ieee80211_elem_defrag ml_reconf, ml_epcs, ml_basic;
bool inside_multilink;
bool skip_vendor;
/*
* scratch buffer that can be used for various element parsing related
* tasks, e.g., element de-fragmentation etc.
*/
size_t scratch_len;
u8 *scratch_pos;
u8 scratch[] __counted_by(scratch_len);
};
static void
ieee80211_parse_extension_element(u32 *crc,
const struct element *elem,
struct ieee80211_elems_parse *elems_parse,
struct ieee80211_elems_parse_params *params)
{
struct ieee802_11_elems *elems = &elems_parse->elems;
const void *data = elem->data + 1;
bool calc_crc = false;
u8 len;
if (!elem->datalen)
return;
len = elem->datalen - 1;
switch (elem->data[0]) {
case WLAN_EID_EXT_HE_MU_EDCA:
if (params->mode < IEEE80211_CONN_MODE_HE)
break;
calc_crc = true;
if (len >= sizeof(*elems->mu_edca_param_set))
elems->mu_edca_param_set = data;
break;
case WLAN_EID_EXT_HE_CAPABILITY:
if (params->mode < IEEE80211_CONN_MODE_HE)
break;
if (ieee80211_he_capa_size_ok(data, len)) {
elems->he_cap = data;
elems->he_cap_len = len;
}
break;
case WLAN_EID_EXT_HE_OPERATION:
if (params->mode < IEEE80211_CONN_MODE_HE)
break;
calc_crc = true;
if (len >= sizeof(*elems->he_operation) &&
len >= ieee80211_he_oper_size(data) - 1)
elems->he_operation = data;
break;
case WLAN_EID_EXT_UORA:
if (params->mode < IEEE80211_CONN_MODE_HE)
break;
if (len >= 1)
elems->uora_element = data;
break;
case WLAN_EID_EXT_MAX_CHANNEL_SWITCH_TIME:
if (len == 3)
elems->max_channel_switch_time = data;
break;
case WLAN_EID_EXT_MULTIPLE_BSSID_CONFIGURATION:
if (len >= sizeof(*elems->mbssid_config_ie))
elems->mbssid_config_ie = data;
break;
case WLAN_EID_EXT_HE_SPR:
if (params->mode < IEEE80211_CONN_MODE_HE)
break;
if (len >= sizeof(*elems->he_spr) &&
len >= ieee80211_he_spr_size(data) - 1)
elems->he_spr = data;
break;
case WLAN_EID_EXT_HE_6GHZ_CAPA:
if (params->mode < IEEE80211_CONN_MODE_HE)
break;
if (len >= sizeof(*elems->he_6ghz_capa))
Annotation
- Immediate include surface: `net/mac80211.h`, `linux/netdevice.h`, `linux/export.h`, `linux/types.h`, `linux/slab.h`, `linux/skbuff.h`, `linux/etherdevice.h`, `linux/if_arp.h`.
- Detected declarations: `struct ieee80211_elem_defrag`, `struct ieee80211_elems_parse`, `function ieee80211_parse_extension_element`, `function ieee80211_parse_tpe`, `function _ieee802_11_parse_elems_full`, `function for_each_element`, `function tag`, `function ieee802_11_find_bssid_profile`, `function for_each_element_id`, `function for_each_element`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: integration implementation candidate.
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.