drivers/net/wireless/marvell/mwifiex/cfg80211.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/marvell/mwifiex/cfg80211.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/marvell/mwifiex/cfg80211.c- Extension
.c- Size
- 138539 bytes
- Lines
- 4931
- 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
cfg80211.hmain.h11n.hwmm.h
Detected Declarations
enum mwifiex_tm_attrenum mwifiex_tm_commandfunction mwifiex_chan_type_to_sec_chan_offsetfunction mwifiex_get_chan_typefunction mwifiex_is_alg_wepfunction mwifiex_cfg80211_del_keyfunction mwifiex_form_mgmt_framefunction mwifiex_cfg80211_mgmt_txfunction ieee80211_is_probe_respfunction mwifiex_cfg80211_update_mgmt_frame_registrationsfunction mwifiex_cfg80211_remain_on_channelfunction mwifiex_cfg80211_cancel_remain_on_channelfunction mwifiex_cfg80211_set_tx_powerfunction mwifiex_cfg80211_get_tx_powerfunction mwifiex_cfg80211_set_power_mgmtfunction mwifiex_cfg80211_set_default_keyfunction mwifiex_cfg80211_add_keyfunction mwifiex_cfg80211_set_default_mgmt_keyfunction mwifiex_send_domain_info_cmd_fwfunction mwifiex_reg_apply_radar_flagsfunction mwifiex_reg_notifierfunction mwifiex_set_fragfunction mwifiex_set_rtsfunction mwifiex_cfg80211_set_wiphy_paramsfunction mwifiex_cfg80211_deinit_p2pfunction mwifiex_cfg80211_init_p2p_clientfunction mwifiex_cfg80211_init_p2p_gofunction mwifiex_deinit_priv_paramsfunction mwifiex_init_new_priv_paramsfunction is_vif_type_change_allowedfunction update_vif_type_counterfunction mwifiex_change_vif_to_p2pfunction mwifiex_change_vif_to_sta_adhocfunction mwifiex_change_vif_to_apfunction mwifiex_cfg80211_change_virtual_intffunction mwifiex_parse_htinfofunction mwifiex_dump_station_infofunction mwifiex_cfg80211_get_stationfunction mwifiex_cfg80211_dump_stationfunction list_for_each_entryfunction mwifiex_cfg80211_dump_surveyfunction mwifiex_cfg80211_set_bitrate_maskfunction mwifiex_cfg80211_set_cqm_rssi_configfunction mwifiex_cfg80211_change_beaconfunction mwifiex_cfg80211_del_stationfunction mwifiex_cfg80211_set_antennafunction mwifiex_cfg80211_get_antennafunction mwifiex_cfg80211_stop_ap
Annotated Snippet
switch (channel_band.band_config.chan_width) {
case CHAN_BW_20MHZ:
if (IS_11N_ENABLED(priv))
return NL80211_CHAN_HT20;
else
return NL80211_CHAN_NO_HT;
case CHAN_BW_40MHZ:
if (channel_band.band_config.chan2_offset ==
SEC_CHAN_ABOVE)
return NL80211_CHAN_HT40PLUS;
else
return NL80211_CHAN_HT40MINUS;
default:
return NL80211_CHAN_HT20;
}
}
return NL80211_CHAN_HT20;
}
/*
* This function checks whether WEP is set.
*/
static int
mwifiex_is_alg_wep(u32 cipher)
{
switch (cipher) {
case WLAN_CIPHER_SUITE_WEP40:
case WLAN_CIPHER_SUITE_WEP104:
return 1;
default:
break;
}
return 0;
}
/*
* This function retrieves the private structure from kernel wiphy structure.
*/
static void *mwifiex_cfg80211_get_adapter(struct wiphy *wiphy)
{
return (void *) (*(unsigned long *) wiphy_priv(wiphy));
}
/*
* CFG802.11 operation handler to delete a network key.
*/
static int
mwifiex_cfg80211_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
int link_id, u8 key_index, bool pairwise,
const u8 *mac_addr)
{
struct mwifiex_private *priv = mwifiex_netdev_get_priv(wdev->netdev);
static const u8 bc_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
const u8 *peer_mac = pairwise ? mac_addr : bc_mac;
if (mwifiex_set_encode(priv, NULL, NULL, 0, key_index, peer_mac, 1)) {
mwifiex_dbg(priv->adapter, ERROR, "deleting the crypto keys\n");
return -EFAULT;
}
mwifiex_dbg(priv->adapter, INFO, "info: crypto keys deleted\n");
return 0;
}
/*
* This function forms an skb for management frame.
*/
static int
mwifiex_form_mgmt_frame(struct sk_buff *skb, const u8 *buf, size_t len)
{
u8 addr[ETH_ALEN] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
u16 pkt_len;
u32 tx_control = 0, pkt_type = PKT_TYPE_MGMT;
pkt_len = len + ETH_ALEN;
skb_reserve(skb, MWIFIEX_MIN_DATA_HEADER_LEN +
MWIFIEX_MGMT_FRAME_HEADER_SIZE + sizeof(pkt_len));
memcpy(skb_push(skb, sizeof(pkt_len)), &pkt_len, sizeof(pkt_len));
memcpy(skb_push(skb, sizeof(tx_control)),
&tx_control, sizeof(tx_control));
memcpy(skb_push(skb, sizeof(pkt_type)), &pkt_type, sizeof(pkt_type));
/* Add packet data and address4 */
skb_put_data(skb, buf, sizeof(struct ieee80211_hdr_3addr));
skb_put_data(skb, addr, ETH_ALEN);
Annotation
- Immediate include surface: `cfg80211.h`, `main.h`, `11n.h`, `wmm.h`.
- Detected declarations: `enum mwifiex_tm_attr`, `enum mwifiex_tm_command`, `function mwifiex_chan_type_to_sec_chan_offset`, `function mwifiex_get_chan_type`, `function mwifiex_is_alg_wep`, `function mwifiex_cfg80211_del_key`, `function mwifiex_form_mgmt_frame`, `function mwifiex_cfg80211_mgmt_tx`, `function ieee80211_is_probe_resp`, `function mwifiex_cfg80211_update_mgmt_frame_registrations`.
- 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.