net/mac80211/spectmgmt.c
Source file repositories/reference/linux-study-clean/net/mac80211/spectmgmt.c
File Facts
- System
- Linux kernel
- Corpus path
net/mac80211/spectmgmt.c- Extension
.c- Size
- 13992 bytes
- Lines
- 446
- 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
linux/ieee80211.hnet/cfg80211.hnet/mac80211.hieee80211_i.hsta_info.hwme.h
Detected Declarations
function Copyrightfunction validate_chandef_by_ht_vht_operfunction validate_chandef_by_6ghz_he_eht_operfunction ieee80211_parse_ch_switch_iefunction ieee80211_send_refuse_measurement_requestfunction ieee80211_process_measurement_req
Annotated Snippet
if (ccfs1) {
u8 diff = abs(ccfs0 - ccfs1);
if (diff == 8) {
chandef->width = NL80211_CHAN_WIDTH_160;
chandef->center_freq1 = cf1;
} else if (diff > 8) {
chandef->width = NL80211_CHAN_WIDTH_80P80;
chandef->center_freq2 = cf1;
}
}
break;
case IEEE80211_VHT_CHANWIDTH_USE_HT:
default:
/* If the WBCS Element is present, new channel bandwidth is
* at least 40 MHz.
*/
chandef->width = NL80211_CHAN_WIDTH_40;
chandef->center_freq1 = cf0;
break;
}
return cfg80211_chandef_valid(chandef);
}
static void
validate_chandef_by_ht_vht_oper(struct ieee80211_sub_if_data *sdata,
struct ieee80211_conn_settings *conn,
u32 vht_cap_info,
struct cfg80211_chan_def *chandef)
{
u32 control_freq, center_freq1, center_freq2;
enum nl80211_chan_width chan_width;
struct ieee80211_ht_operation ht_oper;
struct ieee80211_vht_operation vht_oper;
if (conn->mode < IEEE80211_CONN_MODE_HT ||
conn->bw_limit < IEEE80211_CONN_BW_LIMIT_40) {
chandef->chan = NULL;
return;
}
control_freq = chandef->chan->center_freq;
center_freq1 = chandef->center_freq1;
center_freq2 = chandef->center_freq2;
chan_width = chandef->width;
ht_oper.primary_chan = ieee80211_frequency_to_channel(control_freq);
if (control_freq != center_freq1)
ht_oper.ht_param = control_freq > center_freq1 ?
IEEE80211_HT_PARAM_CHA_SEC_BELOW :
IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
else
ht_oper.ht_param = IEEE80211_HT_PARAM_CHA_SEC_NONE;
ieee80211_chandef_ht_oper(&ht_oper, chandef);
if (conn->mode < IEEE80211_CONN_MODE_VHT)
return;
vht_oper.center_freq_seg0_idx =
ieee80211_frequency_to_channel(center_freq1);
vht_oper.center_freq_seg1_idx = center_freq2 ?
ieee80211_frequency_to_channel(center_freq2) : 0;
switch (chan_width) {
case NL80211_CHAN_WIDTH_320:
WARN_ON(1);
break;
case NL80211_CHAN_WIDTH_160:
vht_oper.chan_width = IEEE80211_VHT_CHANWIDTH_80MHZ;
vht_oper.center_freq_seg1_idx = vht_oper.center_freq_seg0_idx;
vht_oper.center_freq_seg0_idx +=
control_freq < center_freq1 ? -8 : 8;
break;
case NL80211_CHAN_WIDTH_80P80:
vht_oper.chan_width = IEEE80211_VHT_CHANWIDTH_80MHZ;
break;
case NL80211_CHAN_WIDTH_80:
vht_oper.chan_width = IEEE80211_VHT_CHANWIDTH_80MHZ;
break;
default:
vht_oper.chan_width = IEEE80211_VHT_CHANWIDTH_USE_HT;
break;
}
ht_oper.operation_mode =
le16_encode_bits(vht_oper.center_freq_seg1_idx,
IEEE80211_HT_OP_MODE_CCFS2_MASK);
Annotation
- Immediate include surface: `linux/ieee80211.h`, `net/cfg80211.h`, `net/mac80211.h`, `ieee80211_i.h`, `sta_info.h`, `wme.h`.
- Detected declarations: `function Copyright`, `function validate_chandef_by_ht_vht_oper`, `function validate_chandef_by_6ghz_he_eht_oper`, `function ieee80211_parse_ch_switch_ie`, `function ieee80211_send_refuse_measurement_request`, `function ieee80211_process_measurement_req`.
- 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.