drivers/net/wireless/marvell/mwifiex/sta_event.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/marvell/mwifiex/sta_event.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/marvell/mwifiex/sta_event.c- Extension
.c- Size
- 32504 bytes
- Lines
- 1099
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
decl.hioctl.hutil.hfw.hmain.hwmm.h11n.h
Detected Declarations
function mwifiex_check_ibss_peer_capabilitiesfunction le16_to_cpufunction mwifiex_reset_connect_statefunction mwifiex_parse_tdls_eventfunction mwifiex_process_uap_tx_pausefunction mwifiex_process_sta_tx_pausefunction mwifiex_process_multi_chan_eventfunction mwifiex_process_tx_pause_eventfunction mwifiex_bt_coex_wlan_param_update_eventfunction mwifiex_fw_dump_info_eventfunction mwifiex_process_sta_event
Annotated Snippet
switch (ele_hdr->element_id) {
case WLAN_EID_HT_CAPABILITY:
sta_ptr->is_11n_enabled = true;
ht_cap = (void *)(ele_hdr + 2);
sta_ptr->max_amsdu = le16_to_cpu(ht_cap->cap_info) &
IEEE80211_HT_CAP_MAX_AMSDU ?
MWIFIEX_TX_DATA_BUF_SIZE_8K :
MWIFIEX_TX_DATA_BUF_SIZE_4K;
mwifiex_dbg(priv->adapter, INFO,
"11n enabled!, max_amsdu : %d\n",
sta_ptr->max_amsdu);
break;
case WLAN_EID_VHT_CAPABILITY:
sta_ptr->is_11ac_enabled = true;
vht_cap = (void *)(ele_hdr + 2);
/* check VHT MAXMPDU capability */
switch (le32_to_cpu(vht_cap->vht_cap_info) & 0x3) {
case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454:
sta_ptr->max_amsdu =
MWIFIEX_TX_DATA_BUF_SIZE_12K;
break;
case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991:
sta_ptr->max_amsdu =
MWIFIEX_TX_DATA_BUF_SIZE_8K;
break;
case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895:
sta_ptr->max_amsdu =
MWIFIEX_TX_DATA_BUF_SIZE_4K;
break;
default:
break;
}
mwifiex_dbg(priv->adapter, INFO,
"11ac enabled!, max_amsdu : %d\n",
sta_ptr->max_amsdu);
break;
default:
break;
}
curr += (ele_len + sizeof(*ele_hdr));
evt_len -= (ele_len + sizeof(*ele_hdr));
}
return 0;
}
/*
* This function resets the connection state.
*
* The function is invoked after receiving a disconnect event from firmware,
* and performs the following actions -
* - Set media status to disconnected
* - Clean up Tx and Rx packets
* - Resets SNR/NF/RSSI value in driver
* - Resets security configurations in driver
* - Enables auto data rate
* - Saves the previous SSID and BSSID so that they can
* be used for re-association, if required
* - Erases current SSID and BSSID information
* - Sends a disconnect event to upper layers/applications.
*/
void mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code,
bool from_ap)
{
struct mwifiex_adapter *adapter = priv->adapter;
if (!priv->media_connected)
return;
mwifiex_dbg(adapter, INFO,
"info: handles disconnect event\n");
priv->media_connected = false;
priv->auth_flag = 0;
priv->auth_alg = WLAN_AUTH_NONE;
priv->scan_block = false;
priv->port_open = false;
if ((GET_BSS_ROLE(priv) == MWIFIEX_BSS_ROLE_STA) &&
ISSUPP_TDLS_ENABLED(priv->adapter->fw_cap_info)) {
mwifiex_disable_all_tdls_links(priv);
if (priv->adapter->auto_tdls)
mwifiex_clean_auto_tdls(priv);
}
Annotation
- Immediate include surface: `decl.h`, `ioctl.h`, `util.h`, `fw.h`, `main.h`, `wmm.h`, `11n.h`.
- Detected declarations: `function mwifiex_check_ibss_peer_capabilities`, `function le16_to_cpu`, `function mwifiex_reset_connect_state`, `function mwifiex_parse_tdls_event`, `function mwifiex_process_uap_tx_pause`, `function mwifiex_process_sta_tx_pause`, `function mwifiex_process_multi_chan_event`, `function mwifiex_process_tx_pause_event`, `function mwifiex_bt_coex_wlan_param_update_event`, `function mwifiex_fw_dump_info_event`.
- 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.