net/mac80211/scan.c
Source file repositories/reference/linux-study-clean/net/mac80211/scan.c
File Facts
- System
- Linux kernel
- Corpus path
net/mac80211/scan.c- Extension
.c- Size
- 41059 bytes
- Lines
- 1483
- 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.
- 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/if_arp.hlinux/etherdevice.hlinux/rtnetlink.hnet/sch_generic.hlinux/slab.hlinux/export.hlinux/random.hnet/mac80211.hieee80211_i.hdriver-ops.hmesh.h
Detected Declarations
struct inform_bss_update_datafunction Copyrightfunction is_uapsd_supportedfunction ieee80211_inform_bssfunction ieee80211_bss_info_updatefunction ieee80211_have_rx_timestampfunction ieee80211_scan_accept_prespfunction ieee80211_scan_rxfunction ieee80211_prepare_scan_chandeffunction ieee80211_prep_hw_scanfunction __ieee80211_scan_completedfunction ieee80211_scan_completedfunction ieee80211_start_sw_scanfunction __ieee80211_can_leave_chfunction list_for_each_entryfunction ieee80211_can_scanfunction ieee80211_run_deferred_scanfunction ieee80211_send_scan_probe_reqfunction ieee80211_scan_state_send_probefunction __ieee80211_start_scanfunction ieee80211_scan_get_channel_timefunction ieee80211_scan_state_decisionfunction ieee80211_scan_state_set_channelfunction ieee80211_scan_state_suspendfunction ieee80211_scan_state_resumefunction ieee80211_scan_workfunction ieee80211_request_scanfunction ieee80211_request_ibss_scanfunction ieee80211_scan_cancelfunction test_bitfunction __ieee80211_request_sched_scan_startfunction ieee80211_request_sched_scan_startfunction ieee80211_request_sched_scan_stopfunction ieee80211_sched_scan_resultsfunction ieee80211_sched_scan_endfunction ieee80211_sched_scan_stopped_workfunction ieee80211_sched_scan_stoppedexport ieee80211_scan_completedexport ieee80211_sched_scan_resultsexport ieee80211_sched_scan_stopped
Annotated Snippet
struct inform_bss_update_data {
struct ieee80211_rx_status *rx_status;
bool beacon;
};
void ieee80211_inform_bss(struct wiphy *wiphy,
struct cfg80211_bss *cbss,
const struct cfg80211_bss_ies *ies,
void *data)
{
struct ieee80211_local *local = wiphy_priv(wiphy);
struct inform_bss_update_data *update_data = data;
struct ieee80211_bss *bss = (void *)cbss->priv;
struct ieee80211_rx_status *rx_status;
struct ieee802_11_elems *elems;
int clen, srlen;
/* This happens while joining an IBSS */
if (!update_data)
return;
elems = ieee802_11_parse_elems(ies->data, ies->len,
update_data->beacon ?
IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON :
IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_RESP,
NULL);
if (!elems)
return;
rx_status = update_data->rx_status;
if (update_data->beacon)
bss->device_ts_beacon = rx_status->device_timestamp;
else
bss->device_ts_presp = rx_status->device_timestamp;
if (elems->parse_error) {
if (update_data->beacon)
bss->corrupt_data |= IEEE80211_BSS_CORRUPT_BEACON;
else
bss->corrupt_data |= IEEE80211_BSS_CORRUPT_PROBE_RESP;
} else {
if (update_data->beacon)
bss->corrupt_data &= ~IEEE80211_BSS_CORRUPT_BEACON;
else
bss->corrupt_data &= ~IEEE80211_BSS_CORRUPT_PROBE_RESP;
}
/* save the ERP value so that it is available at association time */
if (elems->erp_info && (!elems->parse_error ||
!(bss->valid_data & IEEE80211_BSS_VALID_ERP))) {
bss->erp_value = elems->erp_info[0];
bss->has_erp_value = true;
if (!elems->parse_error)
bss->valid_data |= IEEE80211_BSS_VALID_ERP;
}
/* replace old supported rates if we get new values */
if (!elems->parse_error ||
!(bss->valid_data & IEEE80211_BSS_VALID_RATES)) {
srlen = 0;
if (elems->supp_rates) {
clen = IEEE80211_MAX_SUPP_RATES;
if (clen > elems->supp_rates_len)
clen = elems->supp_rates_len;
memcpy(bss->supp_rates, elems->supp_rates, clen);
srlen += clen;
}
if (elems->ext_supp_rates) {
clen = IEEE80211_MAX_SUPP_RATES - srlen;
if (clen > elems->ext_supp_rates_len)
clen = elems->ext_supp_rates_len;
memcpy(bss->supp_rates + srlen, elems->ext_supp_rates,
clen);
srlen += clen;
}
if (srlen) {
bss->supp_rates_len = srlen;
if (!elems->parse_error)
bss->valid_data |= IEEE80211_BSS_VALID_RATES;
}
}
if (!elems->parse_error ||
!(bss->valid_data & IEEE80211_BSS_VALID_WMM)) {
bss->wmm_used = elems->wmm_param || elems->wmm_info;
bss->uapsd_supported = is_uapsd_supported(elems);
if (!elems->parse_error)
bss->valid_data |= IEEE80211_BSS_VALID_WMM;
}
Annotation
- Immediate include surface: `linux/if_arp.h`, `linux/etherdevice.h`, `linux/rtnetlink.h`, `net/sch_generic.h`, `linux/slab.h`, `linux/export.h`, `linux/random.h`, `net/mac80211.h`.
- Detected declarations: `struct inform_bss_update_data`, `function Copyright`, `function is_uapsd_supported`, `function ieee80211_inform_bss`, `function ieee80211_bss_info_update`, `function ieee80211_have_rx_timestamp`, `function ieee80211_scan_accept_presp`, `function ieee80211_scan_rx`, `function ieee80211_prepare_scan_chandef`, `function ieee80211_prep_hw_scan`.
- 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.