net/mac80211/tdls.c
Source file repositories/reference/linux-study-clean/net/mac80211/tdls.c
File Facts
- System
- Linux kernel
- Corpus path
net/mac80211/tdls.c- Extension
.c- Size
- 59312 bytes
- Lines
- 2083
- 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.
- 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/ieee80211.hlinux/log2.hnet/cfg80211.hlinux/rtnetlink.hieee80211_i.hdriver-ops.hrate.hwme.h
Detected Declarations
function Copyrightfunction ieee80211_tdls_add_ext_capabfunction ieee80211_tdls_add_subbandfunction ieee80211_tdls_add_supp_channelsfunction ieee80211_tdls_add_oper_classesfunction ieee80211_tdls_add_bss_coex_iefunction ieee80211_get_tdls_sta_capabfunction ieee80211_tdls_add_link_iefunction ieee80211_tdls_add_aidfunction ieee80211_ac_from_wmmfunction ieee80211_wmm_aci_aifsnfunction ieee80211_wmm_ecwfunction ieee80211_tdls_add_wmm_param_iefunction ieee80211_tdls_chandef_vht_upgradefunction ieee80211_tdls_add_setup_start_iesfunction ieee80211_tdls_add_setup_cfm_iesfunction ieee80211_tdls_add_chan_switch_req_iesfunction ieee80211_tdls_add_chan_switch_resp_iesfunction ieee80211_tdls_add_iesfunction ieee80211_prep_tdls_encap_datafunction ieee80211_prep_tdls_directfunction ieee80211_tdls_build_mgmt_packet_datafunction ieee80211_tdls_prep_mgmt_packetfunction ieee80211_hw_checkfunction ieee80211_tdls_mgmt_setupfunction ieee80211_tdls_mgmt_teardownfunction ieee80211_tdls_mgmtfunction iee80211_tdls_recalc_chanctxfunction iee80211_tdls_have_ht_peersfunction iee80211_tdls_recalc_ht_protectionfunction ieee80211_tdls_operfunction ieee80211_tdls_oper_requestfunction iee80211_tdls_add_ch_switch_timingfunction ieee80211_tdls_ch_sw_tmpl_getfunction ieee80211_tdls_channel_switchfunction ieee80211_tdls_cancel_channel_switchfunction ieee80211_tdls_ch_sw_resp_tmpl_getfunction ieee80211_process_tdls_channel_switch_respfunction ieee80211_process_tdls_channel_switch_reqfunction ieee80211_process_tdls_channel_switchfunction ieee80211_teardown_tdls_peersfunction ieee80211_tdls_handle_disconnectexport ieee80211_tdls_oper_request
Annotated Snippet
if (ch) {
/* we will be active on the channel */
cfg80211_chandef_create(&chandef, ch,
NL80211_CHAN_NO_HT);
if (cfg80211_reg_can_beacon_relax(wiphy, &chandef,
sdata->wdev.iftype)) {
ch_cnt++;
/*
* check if the next channel is also part of
* this allowed range
*/
continue;
}
}
/*
* we've reached the end of a range, with allowed channels
* found
*/
if (ch_cnt) {
u8 *pos = skb_put(skb, 2);
*pos++ = ieee80211_frequency_to_channel(subband_start);
*pos++ = ch_cnt;
subband_cnt++;
ch_cnt = 0;
}
}
/* all channels in the requested range are allowed - add them here */
if (ch_cnt) {
u8 *pos = skb_put(skb, 2);
*pos++ = ieee80211_frequency_to_channel(subband_start);
*pos++ = ch_cnt;
subband_cnt++;
}
return subband_cnt;
}
static void
ieee80211_tdls_add_supp_channels(struct ieee80211_sub_if_data *sdata,
struct sk_buff *skb)
{
/*
* Add possible channels for TDLS. These are channels that are allowed
* to be active.
*/
u8 subband_cnt;
u8 *pos = skb_put(skb, 2);
*pos++ = WLAN_EID_SUPPORTED_CHANNELS;
/*
* 5GHz and 2GHz channels numbers can overlap. Ignore this for now, as
* this doesn't happen in real world scenarios.
*/
/* 2GHz, with 5MHz spacing */
subband_cnt = ieee80211_tdls_add_subband(sdata, skb, 2412, 2472, 5);
/* 5GHz, with 20MHz spacing */
subband_cnt += ieee80211_tdls_add_subband(sdata, skb, 5000, 5825, 20);
/* length */
*pos = 2 * subband_cnt;
}
static void ieee80211_tdls_add_oper_classes(struct ieee80211_link_data *link,
struct sk_buff *skb)
{
u8 *pos;
u8 op_class;
if (!ieee80211_chandef_to_operating_class(&link->conf->chanreq.oper,
&op_class))
return;
pos = skb_put(skb, 4);
*pos++ = WLAN_EID_SUPPORTED_REGULATORY_CLASSES;
*pos++ = 2; /* len */
*pos++ = op_class;
*pos++ = op_class; /* give current operating class as alternate too */
}
static void ieee80211_tdls_add_bss_coex_ie(struct sk_buff *skb)
{
u8 *pos = skb_put(skb, 3);
Annotation
- Immediate include surface: `linux/ieee80211.h`, `linux/log2.h`, `net/cfg80211.h`, `linux/rtnetlink.h`, `ieee80211_i.h`, `driver-ops.h`, `rate.h`, `wme.h`.
- Detected declarations: `function Copyright`, `function ieee80211_tdls_add_ext_capab`, `function ieee80211_tdls_add_subband`, `function ieee80211_tdls_add_supp_channels`, `function ieee80211_tdls_add_oper_classes`, `function ieee80211_tdls_add_bss_coex_ie`, `function ieee80211_get_tdls_sta_capab`, `function ieee80211_tdls_add_link_ie`, `function ieee80211_tdls_add_aid`, `function ieee80211_ac_from_wmm`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- 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.