net/mac80211/ibss.c
Source file repositories/reference/linux-study-clean/net/mac80211/ibss.c
File Facts
- System
- Linux kernel
- Corpus path
net/mac80211/ibss.c- Extension
.c- Size
- 50423 bytes
- Lines
- 1808
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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
linux/delay.hlinux/slab.hlinux/if_ether.hlinux/skbuff.hlinux/if_arp.hlinux/etherdevice.hlinux/rtnetlink.hnet/mac80211.hieee80211_i.hdriver-ops.hrate.h
Detected Declarations
function Copyrightfunction __ieee80211_sta_join_ibssfunction ieee80211_sta_join_ibssfunction ieee80211_ibss_csa_beaconfunction ieee80211_ibss_finish_csafunction ieee80211_ibss_stopfunction ieee80211_ibss_add_stafunction ieee80211_sta_active_ibssfunction list_for_each_entry_rcufunction ieee80211_ibss_disconnectfunction ieee80211_csa_connection_drop_workfunction ieee80211_ibss_csa_mark_radarfunction ieee80211_ibss_process_chanswitchfunction ieee80211_rx_mgmt_spectrum_mgmtfunction ieee80211_rx_mgmt_deauth_ibssfunction ieee80211_rx_mgmt_auth_ibssfunction ieee80211_update_sta_infofunction ieee80211_rx_bss_infofunction ieee80211_ibss_rx_no_stafunction ieee80211_ibss_sta_expirefunction list_for_each_entry_safefunction ieee80211_sta_merge_ibssfunction ieee80211_sta_create_ibssfunction ibss_setup_channelsfunction ieee80211_ibss_setup_scan_channelsfunction ieee80211_sta_find_ibssfunction ieee80211_rx_mgmt_probe_reqfunction memcmpfunction ieee80211_rx_mgmt_probe_beaconfunction ieee80211_ibss_rx_queued_mgmtfunction ieee80211_ibss_workfunction ieee80211_ibss_timerfunction ieee80211_ibss_setup_sdatafunction ieee80211_ibss_notify_scan_completedfunction list_for_each_entryfunction ieee80211_ibss_joinfunction ieee80211_ibss_leave
Annotated Snippet
if (++rates_added == 8) {
ri++; /* continue at next rate for EXT_SUPP_RATES */
break;
}
}
if (sband->band == NL80211_BAND_2GHZ) {
*pos++ = WLAN_EID_DS_PARAMS;
*pos++ = 1;
*pos++ = ieee80211_frequency_to_channel(
chandef->chan->center_freq);
}
*pos++ = WLAN_EID_IBSS_PARAMS;
*pos++ = 2;
/* FIX: set ATIM window based on scan results */
*pos++ = 0;
*pos++ = 0;
if (csa_settings) {
*pos++ = WLAN_EID_CHANNEL_SWITCH;
*pos++ = 3;
*pos++ = csa_settings->block_tx ? 1 : 0;
*pos++ = ieee80211_frequency_to_channel(
csa_settings->chandef.chan->center_freq);
presp->cntdwn_counter_offsets[0] = (pos - presp->head);
*pos++ = csa_settings->count;
presp->cntdwn_current_counter = csa_settings->count;
}
/* put the remaining rates in WLAN_EID_EXT_SUPP_RATES */
if (rates_n > 8) {
*pos++ = WLAN_EID_EXT_SUPP_RATES;
*pos++ = rates_n - 8;
for (; ri < sband->n_bitrates; ri++) {
int rate = DIV_ROUND_UP(sband->bitrates[ri].bitrate, 5);
u8 basic = 0;
if (!(rates & BIT(ri)))
continue;
if (basic_rates & BIT(ri))
basic = 0x80;
*pos++ = basic | (u8) rate;
}
}
if (ifibss->ie_len) {
memcpy(pos, ifibss->ie, ifibss->ie_len);
pos += ifibss->ie_len;
}
/* add HT capability and information IEs */
if (chandef->width != NL80211_CHAN_WIDTH_20_NOHT &&
sband->ht_cap.ht_supported) {
struct ieee80211_sta_ht_cap ht_cap;
memcpy(&ht_cap, &sband->ht_cap, sizeof(ht_cap));
ieee80211_apply_htcap_overrides(sdata, &ht_cap);
pos = ieee80211_ie_build_ht_cap(pos, &ht_cap, ht_cap.cap);
/*
* Note: According to 802.11n-2009 9.13.3.1, HT Protection
* field and RIFS Mode are reserved in IBSS mode, therefore
* keep them at 0
*/
pos = ieee80211_ie_build_ht_oper(pos, &sband->ht_cap,
chandef, 0, false);
/* add VHT capability and information IEs */
if (chandef->width != NL80211_CHAN_WIDTH_20 &&
chandef->width != NL80211_CHAN_WIDTH_40 &&
sband->vht_cap.vht_supported) {
pos = ieee80211_ie_build_vht_cap(pos, &sband->vht_cap,
sband->vht_cap.cap);
pos = ieee80211_ie_build_vht_oper(pos, &sband->vht_cap,
chandef);
}
}
if (local->hw.queues >= IEEE80211_NUM_ACS)
pos = ieee80211_add_wmm_info_ie(pos, 0); /* U-APSD not in use */
presp->head_len = pos - presp->head;
if (WARN_ON(presp->head_len > frame_len))
goto error;
return presp;
error:
kfree(presp);
return NULL;
Annotation
- Immediate include surface: `linux/delay.h`, `linux/slab.h`, `linux/if_ether.h`, `linux/skbuff.h`, `linux/if_arp.h`, `linux/etherdevice.h`, `linux/rtnetlink.h`, `net/mac80211.h`.
- Detected declarations: `function Copyright`, `function __ieee80211_sta_join_ibss`, `function ieee80211_sta_join_ibss`, `function ieee80211_ibss_csa_beacon`, `function ieee80211_ibss_finish_csa`, `function ieee80211_ibss_stop`, `function ieee80211_ibss_add_sta`, `function ieee80211_sta_active_ibss`, `function list_for_each_entry_rcu`, `function ieee80211_ibss_disconnect`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source 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.