drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/marvell/mwifiex/sta_ioctl.c- Extension
.c- Size
- 41547 bytes
- Lines
- 1551
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- 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
decl.hioctl.hutil.hfw.hmain.hwmm.h11n.hcfg80211.h
Detected Declarations
function mwifiex_copy_mcast_addrfunction mwifiex_wait_queue_completefunction mwifiex_request_set_multicast_listfunction mwifiex_fill_new_bss_descfunction mwifiex_dnld_dt_txpwr_tablefunction mwifiex_request_rgpower_tablefunction mwifiex_dnld_rgpower_tablefunction mwifiex_dnld_txpwr_tablefunction mwifiex_process_country_iefunction mwifiex_bss_startfunction mwifiex_set_hs_paramsfunction cpu_to_le32function mwifiex_cancel_hsfunction mwifiex_enable_hsfunction mwifiex_get_bss_infofunction mwifiex_disable_auto_dsfunction mwifiex_drv_get_data_ratefunction mwifiex_set_tx_powerfunction mwifiex_drv_set_powerfunction mwifiex_set_wpa_iefunction mwifiex_set_wapi_iefunction mwifiex_set_wps_iefunction mwifiex_sec_ioctl_set_wapi_keyfunction mwifiex_sec_ioctl_set_wep_keyfunction mwifiex_sec_ioctl_set_wpa_keyfunction mwifiex_sec_ioctl_encrypt_keyfunction mwifiex_drv_get_driver_versionfunction mwifiex_set_encodefunction mwifiex_get_ver_extfunction mwifiex_remain_on_chan_cfgfunction mwifiex_get_stats_infofunction mwifiex_reg_mem_ioctl_reg_rwfunction mwifiex_reg_writefunction mwifiex_reg_readfunction mwifiex_eeprom_readfunction mwifiex_set_gen_ie_helperfunction mwifiex_misc_ioctl_gen_iefunction mwifiex_set_gen_iefunction mwifiex_get_wakeup_reasonfunction mwifiex_get_chan_infoexport mwifiex_cancel_hsexport mwifiex_enable_hsexport mwifiex_disable_auto_ds
Annotated Snippet
if (mcast_list->mode == MWIFIEX_ALL_MULTI_MODE) {
mwifiex_dbg(priv->adapter, INFO,
"info: Enabling All Multicast!\n");
priv->curr_pkt_filter |=
HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE;
} else {
priv->curr_pkt_filter &=
~HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE;
mwifiex_dbg(priv->adapter, INFO,
"info: Set multicast list=%d\n",
mcast_list->num_multicast_addr);
/* Send multicast addresses to firmware */
ret = mwifiex_send_cmd(priv,
HostCmd_CMD_MAC_MULTICAST_ADR,
HostCmd_ACT_GEN_SET, 0,
mcast_list, false);
}
}
mwifiex_dbg(priv->adapter, INFO,
"info: old_pkt_filter=%#x, curr_pkt_filter=%#x\n",
old_pkt_filter, priv->curr_pkt_filter);
if (old_pkt_filter != priv->curr_pkt_filter) {
ret = mwifiex_send_cmd(priv, HostCmd_CMD_MAC_CONTROL,
HostCmd_ACT_GEN_SET,
0, &priv->curr_pkt_filter, false);
}
return ret;
}
/*
* This function fills bss descriptor structure using provided
* information.
* beacon_ie buffer is allocated in this function. It is caller's
* responsibility to free the memory.
*/
int mwifiex_fill_new_bss_desc(struct mwifiex_private *priv,
struct cfg80211_bss *bss,
struct mwifiex_bssdescriptor *bss_desc)
{
u8 *beacon_ie;
size_t beacon_ie_len;
struct mwifiex_bss_priv *bss_priv = (void *)bss->priv;
const struct cfg80211_bss_ies *ies;
rcu_read_lock();
ies = rcu_dereference(bss->ies);
beacon_ie = kmemdup(ies->data, ies->len, GFP_ATOMIC);
beacon_ie_len = ies->len;
bss_desc->timestamp = ies->tsf;
rcu_read_unlock();
if (!beacon_ie) {
mwifiex_dbg(priv->adapter, ERROR,
" failed to alloc beacon_ie\n");
return -ENOMEM;
}
memcpy(bss_desc->mac_address, bss->bssid, ETH_ALEN);
bss_desc->rssi = bss->signal;
/* The caller of this function will free beacon_ie */
bss_desc->beacon_buf = beacon_ie;
bss_desc->beacon_buf_size = beacon_ie_len;
bss_desc->beacon_period = bss->beacon_interval;
bss_desc->cap_info_bitmap = bss->capability;
bss_desc->bss_band = bss_priv->band;
bss_desc->fw_tsf = bss_priv->fw_tsf;
if (bss_desc->cap_info_bitmap & WLAN_CAPABILITY_PRIVACY) {
mwifiex_dbg(priv->adapter, INFO,
"info: InterpretIE: AP WEP enabled\n");
bss_desc->privacy = MWIFIEX_802_11_PRIV_FILTER_8021X_WEP;
} else {
bss_desc->privacy = MWIFIEX_802_11_PRIV_FILTER_ACCEPT_ALL;
}
if (bss_desc->cap_info_bitmap & WLAN_CAPABILITY_IBSS)
bss_desc->bss_mode = NL80211_IFTYPE_ADHOC;
else
bss_desc->bss_mode = NL80211_IFTYPE_STATION;
/* Disable 11ac by default. Enable it only where there
* exist VHT_CAP IE in AP beacon
*/
bss_desc->disable_11ac = true;
if (bss_desc->cap_info_bitmap & WLAN_CAPABILITY_SPECTRUM_MGMT)
bss_desc->sensed_11h = true;
return mwifiex_update_bss_desc_with_ie(priv->adapter, bss_desc);
}
Annotation
- Immediate include surface: `decl.h`, `ioctl.h`, `util.h`, `fw.h`, `main.h`, `wmm.h`, `11n.h`, `cfg80211.h`.
- Detected declarations: `function mwifiex_copy_mcast_addr`, `function mwifiex_wait_queue_complete`, `function mwifiex_request_set_multicast_list`, `function mwifiex_fill_new_bss_desc`, `function mwifiex_dnld_dt_txpwr_table`, `function mwifiex_request_rgpower_table`, `function mwifiex_dnld_rgpower_table`, `function mwifiex_dnld_txpwr_table`, `function mwifiex_process_country_ie`, `function mwifiex_bss_start`.
- Atlas domain: Driver Families / drivers/net.
- 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.