drivers/net/wireless/marvell/mwifiex/scan.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/marvell/mwifiex/scan.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/marvell/mwifiex/scan.c- Extension
.c- Size
- 86943 bytes
- Lines
- 2964
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- 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
decl.hioctl.hutil.hfw.hmain.h11n.hcfg80211.h
Detected Declarations
enum cipher_suitefunction _dbg_security_flagsfunction has_ieee_hdrfunction has_vendor_hdrfunction mwifiex_search_oui_in_iefunction mwifiex_is_rsn_oui_presentfunction mwifiex_is_wpa_oui_presentfunction mwifiex_is_bss_wapifunction mwifiex_is_bss_no_secfunction mwifiex_is_bss_static_wepfunction mwifiex_is_bss_wpafunction mwifiex_is_bss_wpa2function mwifiex_is_bss_adhoc_aesfunction mwifiex_is_bss_dynamic_wepfunction WPAfunction mwifiex_scan_create_channel_listfunction mwifiex_bgscan_create_channel_listfunction mwifiex_append_rate_tlvfunction mwifiex_scan_channel_listfunction channelsfunction parametersfunction mwifiex_ret_802_11_scan_get_tlv_ptrsfunction mwifiex_update_bss_desc_with_iefunction mwifiex_radio_type_to_bandfunction mwifiex_scan_networksfunction mwifiex_cmd_802_11_scanfunction mwifiex_check_network_compatibilityfunction mwifiex_is_hidden_ssidfunction mwifiex_save_hidden_ssid_channelsfunction mwifiex_update_curr_bss_paramsfunction mwifiex_parse_single_response_buffunction mwifiex_complete_scanfunction mwifiex_active_scan_req_for_passive_chanfunction mwifiex_check_next_scan_commandfunction mwifiex_cancel_scanfunction mwifiex_ret_802_11_scanfunction mwifiex_cmd_802_11_scan_extfunction mwifiex_cmd_802_11_bg_scan_configfunction mwifiex_stop_bg_scanfunction mwifiex_update_chan_statisticsfunction mwifiex_ret_802_11_scan_extfunction list_for_each_entryfunction mwifiex_handle_event_ext_scan_reportfunction mwifiex_cmd_802_11_bg_scan_queryfunction mwifiex_queue_scan_cmdfunction mwifiex_scan_specific_ssidfunction mwifiex_request_scanfunction mwifiex_cmd_append_vsie_tlv
Annotated Snippet
has_ieee_hdr(bss_desc->bcn_rsn_ie, WLAN_EID_RSN)) {
/*
* Privacy bit may NOT be set in some APs like
* LinkSys WRT54G && bss_desc->privacy
*/
dbg_security_flags(INFO, "WAP2", priv, bss_desc);
return true;
}
return false;
}
/*
* This function checks if adhoc AES is enabled in driver and scanned network is
* compatible with it.
*/
static bool
mwifiex_is_bss_adhoc_aes(struct mwifiex_private *priv,
struct mwifiex_bssdescriptor *bss_desc)
{
if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled &&
!priv->sec_info.wpa2_enabled &&
!has_vendor_hdr(bss_desc->bcn_wpa_ie, WLAN_EID_VENDOR_SPECIFIC) &&
!has_ieee_hdr(bss_desc->bcn_rsn_ie, WLAN_EID_RSN) &&
!priv->sec_info.encryption_mode && bss_desc->privacy) {
return true;
}
return false;
}
/*
* This function checks if dynamic WEP is enabled in driver and scanned network
* is compatible with it.
*/
static bool
mwifiex_is_bss_dynamic_wep(struct mwifiex_private *priv,
struct mwifiex_bssdescriptor *bss_desc)
{
if (!priv->sec_info.wep_enabled && !priv->sec_info.wpa_enabled &&
!priv->sec_info.wpa2_enabled &&
!has_vendor_hdr(bss_desc->bcn_wpa_ie, WLAN_EID_VENDOR_SPECIFIC) &&
!has_ieee_hdr(bss_desc->bcn_rsn_ie, WLAN_EID_RSN) &&
priv->sec_info.encryption_mode && bss_desc->privacy) {
dbg_security_flags(INFO, "dynamic", priv, bss_desc);
return true;
}
return false;
}
/*
* This function checks if a scanned network is compatible with the driver
* settings.
*
* WEP WPA WPA2 ad-hoc encrypt Network
* enabled enabled enabled AES mode Privacy WPA WPA2 Compatible
* 0 0 0 0 NONE 0 0 0 yes No security
* 0 1 0 0 x 1x 1 x yes WPA (disable
* HT if no AES)
* 0 0 1 0 x 1x x 1 yes WPA2 (disable
* HT if no AES)
* 0 0 0 1 NONE 1 0 0 yes Ad-hoc AES
* 1 0 0 0 NONE 1 0 0 yes Static WEP
* (disable HT)
* 0 0 0 0 !=NONE 1 0 0 yes Dynamic WEP
*
* Compatibility is not matched while roaming, except for mode.
*/
static s32
mwifiex_is_network_compatible(struct mwifiex_private *priv,
struct mwifiex_bssdescriptor *bss_desc, u32 mode)
{
struct mwifiex_adapter *adapter = priv->adapter;
bss_desc->disable_11n = false;
/* Don't check for compatibility if roaming */
if (priv->media_connected &&
(priv->bss_mode == NL80211_IFTYPE_STATION) &&
(bss_desc->bss_mode == NL80211_IFTYPE_STATION))
return 0;
if (priv->wps.session_enable) {
mwifiex_dbg(adapter, IOCTL,
"info: return success directly in WPS period\n");
return 0;
}
if (bss_desc->chan_sw_ie_present) {
mwifiex_dbg(adapter, INFO,
"Don't connect to AP with WLAN_EID_CHANNEL_SWITCH\n");
return -1;
Annotation
- Immediate include surface: `decl.h`, `ioctl.h`, `util.h`, `fw.h`, `main.h`, `11n.h`, `cfg80211.h`.
- Detected declarations: `enum cipher_suite`, `function _dbg_security_flags`, `function has_ieee_hdr`, `function has_vendor_hdr`, `function mwifiex_search_oui_in_ie`, `function mwifiex_is_rsn_oui_present`, `function mwifiex_is_wpa_oui_present`, `function mwifiex_is_bss_wapi`, `function mwifiex_is_bss_no_sec`, `function mwifiex_is_bss_static_wep`.
- Atlas domain: Driver Families / drivers/net.
- 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.