drivers/net/wireless/marvell/mwifiex/sta_cmd.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/marvell/mwifiex/sta_cmd.c- Extension
.c- Size
- 78221 bytes
- Lines
- 2531
- 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.
- 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.h11ac.h
Detected Declarations
function mwifiex_cmd_802_11_rssi_infofunction mwifiex_cmd_mac_controlfunction mwifiex_cmd_802_11_snmp_mibfunction mwifiex_cmd_802_11_get_logfunction parametersfunction mwifiex_cmd_tx_power_cfgfunction mwifiex_cmd_rf_tx_powerfunction mwifiex_cmd_rf_antennafunction mwifiex_cmd_802_11_hs_cfgfunction mwifiex_cmd_802_11_mac_addressfunction mwifiex_cmd_mac_multicast_adrfunction mwifiex_cmd_802_11_deauthenticatefunction mwifiex_cmd_802_11_ad_hoc_stopfunction keyfunction mwifiex_set_aes_key_v2function encryptionfunction encryptionfunction mwifiex_cmd_802_11_key_materialfunction mwifiex_cmd_802_11d_domain_infofunction mwifiex_cmd_ibss_coalescing_statusfunction mwifiex_cmd_mem_accessfunction valuefunction mwifiex_cmd_pcie_host_specfunction mwifiex_cmd_802_11_subsc_evtfunction mwifiex_cmd_append_rpn_expressionfunction mwifiex_cmd_mef_cfgfunction mwifiex_parse_cal_cfgfunction mwifiex_dnld_dt_cfgdatafunction mwifiex_rgpower_table_advance_to_contentfunction mwifiex_send_rgpower_tablefunction mwifiex_cmd_cfg_datafunction mwifiex_cmd_set_mc_policyfunction mwifiex_cmd_robust_coexfunction mwifiex_cmd_gtk_rekey_offloadfunction mwifiex_cmd_chan_region_cfgfunction mwifiex_cmd_coalesce_cfgfunction mwifiex_cmd_tdls_configfunction mwifiex_cmd_tdls_operfunction mwifiex_cmd_sdio_rx_aggr_cfgfunction mwifiex_cmd_get_wakeup_reasonfunction mwifiex_cmd_get_chan_infofunction mwifiex_is_cmd_supportedfunction mwifiex_sta_prepare_cmdfunction mwifiex_sta_init_cmd
Annotated Snippet
if (txp->mode) {
pg_tlv = (struct mwifiex_types_power_group
*) ((unsigned long) txp +
sizeof(struct host_cmd_ds_txpwr_cfg));
memmove(cmd_txp_cfg, txp,
sizeof(struct host_cmd_ds_txpwr_cfg) +
sizeof(struct mwifiex_types_power_group) +
le16_to_cpu(pg_tlv->length));
pg_tlv = (struct mwifiex_types_power_group *) ((u8 *)
cmd_txp_cfg +
sizeof(struct host_cmd_ds_txpwr_cfg));
cmd->size = cpu_to_le16(le16_to_cpu(cmd->size) +
sizeof(struct mwifiex_types_power_group) +
le16_to_cpu(pg_tlv->length));
} else {
memmove(cmd_txp_cfg, txp, sizeof(*txp));
}
cmd_txp_cfg->action = cpu_to_le16(cmd_action);
break;
case HostCmd_ACT_GEN_GET:
cmd_txp_cfg->action = cpu_to_le16(cmd_action);
break;
}
return 0;
}
/*
* This function prepares command to get RF Tx power.
*/
static int mwifiex_cmd_rf_tx_power(struct mwifiex_private *priv,
struct host_cmd_ds_command *cmd,
u16 cmd_action, void *data_buf)
{
struct host_cmd_ds_rf_tx_pwr *txp = &cmd->params.txp;
cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_rf_tx_pwr)
+ S_DS_GEN);
cmd->command = cpu_to_le16(HostCmd_CMD_RF_TX_PWR);
txp->action = cpu_to_le16(cmd_action);
return 0;
}
/*
* This function prepares command to set rf antenna.
*/
static int mwifiex_cmd_rf_antenna(struct mwifiex_private *priv,
struct host_cmd_ds_command *cmd,
u16 cmd_action,
struct mwifiex_ds_ant_cfg *ant_cfg)
{
struct host_cmd_ds_rf_ant_mimo *ant_mimo = &cmd->params.ant_mimo;
struct host_cmd_ds_rf_ant_siso *ant_siso = &cmd->params.ant_siso;
cmd->command = cpu_to_le16(HostCmd_CMD_RF_ANTENNA);
switch (cmd_action) {
case HostCmd_ACT_GEN_SET:
if (priv->adapter->hw_dev_mcs_support == HT_STREAM_2X2) {
cmd->size = cpu_to_le16(sizeof(struct
host_cmd_ds_rf_ant_mimo)
+ S_DS_GEN);
ant_mimo->action_tx = cpu_to_le16(HostCmd_ACT_SET_TX);
ant_mimo->tx_ant_mode = cpu_to_le16((u16)ant_cfg->
tx_ant);
ant_mimo->action_rx = cpu_to_le16(HostCmd_ACT_SET_RX);
ant_mimo->rx_ant_mode = cpu_to_le16((u16)ant_cfg->
rx_ant);
} else {
cmd->size = cpu_to_le16(sizeof(struct
host_cmd_ds_rf_ant_siso) +
S_DS_GEN);
ant_siso->action = cpu_to_le16(HostCmd_ACT_SET_BOTH);
ant_siso->ant_mode = cpu_to_le16((u16)ant_cfg->tx_ant);
}
break;
case HostCmd_ACT_GEN_GET:
if (priv->adapter->hw_dev_mcs_support == HT_STREAM_2X2) {
cmd->size = cpu_to_le16(sizeof(struct
host_cmd_ds_rf_ant_mimo) +
S_DS_GEN);
ant_mimo->action_tx = cpu_to_le16(HostCmd_ACT_GET_TX);
ant_mimo->action_rx = cpu_to_le16(HostCmd_ACT_GET_RX);
} else {
cmd->size = cpu_to_le16(sizeof(struct
host_cmd_ds_rf_ant_siso) +
S_DS_GEN);
ant_siso->action = cpu_to_le16(HostCmd_ACT_GET_BOTH);
Annotation
- Immediate include surface: `decl.h`, `ioctl.h`, `util.h`, `fw.h`, `main.h`, `wmm.h`, `11n.h`, `11ac.h`.
- Detected declarations: `function mwifiex_cmd_802_11_rssi_info`, `function mwifiex_cmd_mac_control`, `function mwifiex_cmd_802_11_snmp_mib`, `function mwifiex_cmd_802_11_get_log`, `function parameters`, `function mwifiex_cmd_tx_power_cfg`, `function mwifiex_cmd_rf_tx_power`, `function mwifiex_cmd_rf_antenna`, `function mwifiex_cmd_802_11_hs_cfg`, `function mwifiex_cmd_802_11_mac_address`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.