net/mac80211/eht.c
Source file repositories/reference/linux-study-clean/net/mac80211/eht.c
File Facts
- System
- Linux kernel
- Corpus path
net/mac80211/eht.c- Extension
.c- Size
- 2964 bytes
- Lines
- 103
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
driver-ops.hieee80211_i.h
Detected Declarations
function Copyright
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* EHT handling
*
* Copyright(c) 2021-2026 Intel Corporation
*/
#include "driver-ops.h"
#include "ieee80211_i.h"
void
ieee80211_eht_cap_ie_to_sta_eht_cap(struct ieee80211_sub_if_data *sdata,
struct ieee80211_supported_band *sband,
const u8 *he_cap_ie, u8 he_cap_len,
const struct ieee80211_eht_cap_elem *eht_cap_ie_elem,
u8 eht_cap_len,
struct link_sta_info *link_sta)
{
struct ieee80211_sta_eht_cap *eht_cap = &link_sta->pub->eht_cap;
struct ieee80211_he_cap_elem *he_cap_ie_elem = (void *)he_cap_ie;
u8 eht_ppe_size = 0;
u8 mcs_nss_size;
u8 eht_total_size = sizeof(eht_cap->eht_cap_elem);
u8 *pos = (u8 *)eht_cap_ie_elem;
memset(eht_cap, 0, sizeof(*eht_cap));
if (!eht_cap_ie_elem ||
!ieee80211_get_eht_iftype_cap_vif(sband, &sdata->vif))
return;
mcs_nss_size = ieee80211_eht_mcs_nss_size(he_cap_ie_elem,
&eht_cap_ie_elem->fixed,
sdata->vif.type ==
NL80211_IFTYPE_STATION);
eht_total_size += mcs_nss_size;
/* Calculate the PPE thresholds length only if the header is present */
if (eht_cap_ie_elem->fixed.phy_cap_info[5] &
IEEE80211_EHT_PHY_CAP5_PPE_THRESHOLD_PRESENT) {
u16 eht_ppe_hdr;
if (eht_cap_len < eht_total_size + sizeof(u16))
return;
eht_ppe_hdr = get_unaligned_le16(eht_cap_ie_elem->optional + mcs_nss_size);
eht_ppe_size =
ieee80211_eht_ppe_size(eht_ppe_hdr,
eht_cap_ie_elem->fixed.phy_cap_info);
eht_total_size += eht_ppe_size;
/* we calculate as if NSS > 8 are valid, but don't handle that */
if (eht_ppe_size > sizeof(eht_cap->eht_ppe_thres))
return;
}
if (eht_cap_len < eht_total_size)
return;
/* Copy the static portion of the EHT capabilities */
memcpy(&eht_cap->eht_cap_elem, pos, sizeof(eht_cap->eht_cap_elem));
pos += sizeof(eht_cap->eht_cap_elem);
/* Copy MCS/NSS which depends on the peer capabilities */
memset(&eht_cap->eht_mcs_nss_supp, 0,
sizeof(eht_cap->eht_mcs_nss_supp));
memcpy(&eht_cap->eht_mcs_nss_supp, pos, mcs_nss_size);
if (eht_ppe_size)
memcpy(eht_cap->eht_ppe_thres,
&eht_cap_ie_elem->optional[mcs_nss_size],
eht_ppe_size);
eht_cap->has_eht = true;
/*
* The MPDU length bits are reserved on all but 2.4 GHz and get set via
* VHT (5 GHz) or HE (6 GHz) capabilities.
*/
if (sband->band != NL80211_BAND_2GHZ)
return;
switch (u8_get_bits(eht_cap->eht_cap_elem.mac_cap_info[0],
IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_MASK)) {
case IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_11454:
link_sta->pub->agg.max_amsdu_len =
IEEE80211_MAX_MPDU_LEN_VHT_11454;
break;
case IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_7991:
Annotation
- Immediate include surface: `driver-ops.h`, `ieee80211_i.h`.
- Detected declarations: `function Copyright`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source 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.