drivers/net/wireless/intel/iwlwifi/mvm/fw.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mvm/fw.c- Extension
.c- Size
- 55255 bytes
- Lines
- 1980
- 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
net/mac80211.hlinux/netdevice.hlinux/dmi.hiwl-trans.hiwl-op-mode.hfw/img.hiwl-debug.hiwl-prph.hfw/acpi.hfw/pnvm.hfw/uefi.hfw/regulatory.hmvm.hfw/dbg.hiwl-phy-db.hiwl-modparams.hiwl-nvm-parse.htime-sync.h
Detected Declarations
struct iwl_mvm_alive_datafunction iwl_send_tx_ant_cfgfunction iwl_send_rss_cfg_cmdfunction iwl_mvm_send_dqa_cmdfunction iwl_mvm_mfu_assert_dump_notiffunction iwl_alive_fnfunction iwl_wait_init_completefunction iwl_wait_phy_db_entryfunction iwl_mvm_print_pd_notificationfunction iwl_mvm_load_ucode_wait_alivefunction iwl_mvm_phy_filter_initfunction iwl_mvm_uats_initfunction iwl_mvm_sgom_initfunction iwl_send_phy_cfg_cmdfunction iwl_run_unified_mvm_ucodefunction iwl_run_init_mvm_ucodefunction iwl_mvm_config_ltrfunction iwl_mvm_sar_select_profilefunction iwl_mvm_get_sar_geo_profilefunction iwl_mvm_sar_geo_initfunction iwl_mvm_ppag_value_validfunction iwl_mvm_fill_ppag_tablefunction iwl_mvm_ppag_send_cmdfunction iwl_mvm_ppag_initfunction iwl_mvm_tas_initfunction iwl_mvm_get_lari_config_bitmapfunction iwl_mvm_get_lari_config_cmd_sizefunction iwl_mvm_fill_lari_configfunction iwl_mvm_lari_cfgfunction iwl_mvm_get_bios_tablesfunction iwl_mvm_disconnect_iteratorfunction iwl_mvm_send_recovery_cmdfunction iwl_mvm_sar_initfunction iwl_mvm_load_rt_fwfunction iwl_mvm_upfunction iwl_mvm_load_d3_fwfunction iwl_mvm_rx_mfuart_notif
Annotated Snippet
struct iwl_mvm_alive_data {
__le32 sku_id[3];
bool valid;
};
static int iwl_send_tx_ant_cfg(struct iwl_mvm *mvm, u8 valid_tx_ant)
{
struct iwl_tx_ant_cfg_cmd tx_ant_cmd = {
.valid = cpu_to_le32(valid_tx_ant),
};
IWL_DEBUG_FW(mvm, "select valid tx ant: %u\n", valid_tx_ant);
return iwl_mvm_send_cmd_pdu(mvm, TX_ANT_CONFIGURATION_CMD, 0,
sizeof(tx_ant_cmd), &tx_ant_cmd);
}
static int iwl_send_rss_cfg_cmd(struct iwl_mvm *mvm)
{
int i;
struct iwl_rss_config_cmd cmd = {
.flags = cpu_to_le32(IWL_RSS_ENABLE),
.hash_mask = BIT(IWL_RSS_HASH_TYPE_IPV4_TCP) |
BIT(IWL_RSS_HASH_TYPE_IPV4_UDP) |
BIT(IWL_RSS_HASH_TYPE_IPV4_PAYLOAD) |
BIT(IWL_RSS_HASH_TYPE_IPV6_TCP) |
BIT(IWL_RSS_HASH_TYPE_IPV6_UDP) |
BIT(IWL_RSS_HASH_TYPE_IPV6_PAYLOAD),
};
if (mvm->trans->info.num_rxqs == 1)
return 0;
/* Do not direct RSS traffic to Q 0 which is our fallback queue */
for (i = 0; i < ARRAY_SIZE(cmd.indirection_table); i++)
cmd.indirection_table[i] =
1 + (i % (mvm->trans->info.num_rxqs - 1));
netdev_rss_key_fill(cmd.secret_key, sizeof(cmd.secret_key));
return iwl_mvm_send_cmd_pdu(mvm, RSS_CONFIG_CMD, 0, sizeof(cmd), &cmd);
}
static int iwl_mvm_send_dqa_cmd(struct iwl_mvm *mvm)
{
struct iwl_dqa_enable_cmd dqa_cmd = {
.cmd_queue = cpu_to_le32(IWL_MVM_DQA_CMD_QUEUE),
};
u32 cmd_id = WIDE_ID(DATA_PATH_GROUP, DQA_ENABLE_CMD);
int ret;
ret = iwl_mvm_send_cmd_pdu(mvm, cmd_id, 0, sizeof(dqa_cmd), &dqa_cmd);
if (ret)
IWL_ERR(mvm, "Failed to send DQA enabling command: %d\n", ret);
else
IWL_DEBUG_FW(mvm, "Working in DQA mode\n");
return ret;
}
void iwl_mvm_mfu_assert_dump_notif(struct iwl_mvm *mvm,
struct iwl_rx_cmd_buffer *rxb)
{
struct iwl_rx_packet *pkt = rxb_addr(rxb);
struct iwl_mfu_assert_dump_notif *mfu_dump_notif = (void *)pkt->data;
if (mfu_dump_notif->index_num == 0)
IWL_INFO(mvm, "MFUART assert id 0x%x occurred\n",
le32_to_cpu(mfu_dump_notif->assert_id));
}
static bool iwl_alive_fn(struct iwl_notif_wait_data *notif_wait,
struct iwl_rx_packet *pkt, void *data)
{
unsigned int pkt_len = iwl_rx_packet_payload_len(pkt);
struct iwl_mvm *mvm =
container_of(notif_wait, struct iwl_mvm, notif_wait);
struct iwl_mvm_alive_data *alive_data = data;
struct iwl_umac_alive *umac;
struct iwl_lmac_alive *lmac1;
struct iwl_lmac_alive *lmac2 = NULL;
u16 status;
u32 lmac_error_event_table, umac_error_table;
u32 version = iwl_fw_lookup_notif_ver(mvm->fw, LEGACY_GROUP,
UCODE_ALIVE_NTFY, 0);
u32 i;
if (version >= 6) {
struct iwl_alive_ntf_v7 *palive;
if (pkt_len < sizeof(*palive))
Annotation
- Immediate include surface: `net/mac80211.h`, `linux/netdevice.h`, `linux/dmi.h`, `iwl-trans.h`, `iwl-op-mode.h`, `fw/img.h`, `iwl-debug.h`, `iwl-prph.h`.
- Detected declarations: `struct iwl_mvm_alive_data`, `function iwl_send_tx_ant_cfg`, `function iwl_send_rss_cfg_cmd`, `function iwl_mvm_send_dqa_cmd`, `function iwl_mvm_mfu_assert_dump_notif`, `function iwl_alive_fn`, `function iwl_wait_init_complete`, `function iwl_wait_phy_db_entry`, `function iwl_mvm_print_pd_notification`, `function iwl_mvm_load_ucode_wait_alive`.
- 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.