drivers/net/wireless/marvell/mwifiex/11n.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/marvell/mwifiex/11n.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/marvell/mwifiex/11n.c- Extension
.c- Size
- 26338 bytes
- Lines
- 913
- 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.hwmm.h11n.h
Detected Declarations
function mwifiex_fill_cap_infofunction mwifiex_get_ba_statusfunction accordinglyfunction accordinglyfunction mwifiex_cmd_recfg_tx_buffunction mwifiex_cmd_amsdu_aggr_ctrlfunction mwifiex_cmd_11n_cfgfunction mwifiex_cmd_append_11n_tlvfunction mwifiex_is_tx_ba_stream_ptr_validfunction list_for_each_entryfunction mwifiex_11n_delete_tx_ba_stream_tbl_entryfunction mwifiex_11n_delete_all_tx_ba_stream_tblfunction mwifiex_get_ba_tblfunction mwifiex_create_ba_tblfunction mwifiex_send_addbafunction mwifiex_send_delbafunction mwifiex_11n_delbafunction mwifiex_11n_delete_ba_streamfunction mwifiex_get_rx_reorder_tblfunction mwifiex_get_tx_ba_stream_tblfunction mwifiex_del_tx_ba_stream_tbl_by_rafunction mwifiex_set_ba_paramsfunction mwifiex_get_sec_chan_offsetfunction mwifiex_send_delba_txbastream_tblfunction list_for_each_entryfunction mwifiex_update_ampdu_txwinsize
Annotated Snippet
if (tx_ba_tsr_tbl->ba_status == ba_status) {
spin_unlock_bh(&priv->tx_ba_stream_tbl_lock);
return tx_ba_tsr_tbl;
}
}
spin_unlock_bh(&priv->tx_ba_stream_tbl_lock);
return NULL;
}
/*
* This function handles the command response of delete a block
* ack request.
*
* The function checks the response success status and takes action
* accordingly (send an add BA request in case of success, or recreate
* the deleted stream in case of failure, if the add BA was also
* initiated by us).
*/
int mwifiex_ret_11n_delba(struct mwifiex_private *priv,
struct host_cmd_ds_command *resp)
{
int tid;
struct mwifiex_tx_ba_stream_tbl *tx_ba_tbl;
struct host_cmd_ds_11n_delba *del_ba = &resp->params.del_ba;
uint16_t del_ba_param_set = le16_to_cpu(del_ba->del_ba_param_set);
tid = del_ba_param_set >> DELBA_TID_POS;
if (del_ba->del_result == BA_RESULT_SUCCESS) {
mwifiex_del_ba_tbl(priv, tid, del_ba->peer_mac_addr,
TYPE_DELBA_SENT,
INITIATOR_BIT(del_ba_param_set));
tx_ba_tbl = mwifiex_get_ba_status(priv, BA_SETUP_INPROGRESS);
if (tx_ba_tbl)
mwifiex_send_addba(priv, tx_ba_tbl->tid,
tx_ba_tbl->ra);
} else { /*
* In case of failure, recreate the deleted stream in case
* we initiated the DELBA
*/
if (!INITIATOR_BIT(del_ba_param_set))
return 0;
mwifiex_create_ba_tbl(priv, del_ba->peer_mac_addr, tid,
BA_SETUP_INPROGRESS);
tx_ba_tbl = mwifiex_get_ba_status(priv, BA_SETUP_INPROGRESS);
if (tx_ba_tbl)
mwifiex_del_ba_tbl(priv, tx_ba_tbl->tid, tx_ba_tbl->ra,
TYPE_DELBA_SENT, true);
}
return 0;
}
/*
* This function handles the command response of add a block
* ack request.
*
* Handling includes changing the header fields to CPU formats, checking
* the response success status and taking actions accordingly (delete the
* BA stream table in case of failure).
*/
int mwifiex_ret_11n_addba_req(struct mwifiex_private *priv,
struct host_cmd_ds_command *resp)
{
int tid, tid_down;
struct host_cmd_ds_11n_addba_rsp *add_ba_rsp = &resp->params.add_ba_rsp;
struct mwifiex_tx_ba_stream_tbl *tx_ba_tbl;
struct mwifiex_ra_list_tbl *ra_list;
u16 block_ack_param_set = le16_to_cpu(add_ba_rsp->block_ack_param_set);
add_ba_rsp->ssn = cpu_to_le16((le16_to_cpu(add_ba_rsp->ssn))
& SSN_MASK);
tid = (block_ack_param_set & IEEE80211_ADDBA_PARAM_TID_MASK)
>> BLOCKACKPARAM_TID_POS;
tid_down = mwifiex_wmm_downgrade_tid(priv, tid);
ra_list = mwifiex_wmm_get_ralist_node(priv, tid_down, add_ba_rsp->
peer_mac_addr);
if (le16_to_cpu(add_ba_rsp->status_code) != BA_RESULT_SUCCESS) {
if (ra_list) {
ra_list->ba_status = BA_SETUP_NONE;
ra_list->amsdu_in_ampdu = false;
}
mwifiex_del_ba_tbl(priv, tid, add_ba_rsp->peer_mac_addr,
TYPE_DELBA_SENT, true);
if (add_ba_rsp->add_rsp_result != BA_RESULT_TIMEOUT)
Annotation
- Immediate include surface: `decl.h`, `ioctl.h`, `util.h`, `fw.h`, `main.h`, `wmm.h`, `11n.h`.
- Detected declarations: `function mwifiex_fill_cap_info`, `function mwifiex_get_ba_status`, `function accordingly`, `function accordingly`, `function mwifiex_cmd_recfg_tx_buf`, `function mwifiex_cmd_amsdu_aggr_ctrl`, `function mwifiex_cmd_11n_cfg`, `function mwifiex_cmd_append_11n_tlv`, `function mwifiex_is_tx_ba_stream_ptr_valid`, `function list_for_each_entry`.
- 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.