drivers/net/wireless/intel/iwlwifi/mvm/utils.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mvm/utils.c- Extension
.c- Size
- 37707 bytes
- Lines
- 1424
- 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
net/mac80211.hiwl-debug.hiwl-io.hiwl-prph.hiwl-csr.hmvm.hfw/api/rs.hfw/img.h
Detected Declarations
struct iwl_mvm_diversity_iter_datastruct iwl_mvm_low_latency_iterstruct iwl_bss_iter_datastruct iwl_bss_find_iter_datastruct iwl_sta_iter_datafunction iwl_mvm_rate_idx_to_plcpfunction iwl_mvm_send_cmdfunction iwl_mvm_send_cmd_pdufunction iwl_mvm_send_cmd_statusfunction iwl_mvm_send_cmd_pdu_statusfunction iwl_mvm_legacy_hw_idx_to_mac80211_idxfunction iwl_mvm_legacy_rate_to_mac80211_idxfunction iwl_mvm_rate_idx_to_fw_idxfunction iwl_mvm_mac80211_ac_to_ucode_acfunction iwl_mvm_rx_fw_errorfunction first_antennafunction iwl_mvm_next_antennafunction iwl_mvm_send_lq_cmdfunction iwl_mvm_update_smpsfunction iwl_mvm_update_smps_on_active_linksfunction iwl_wait_stats_completefunction iwl_mvm_request_periodic_system_statisticsfunction iwl_mvm_request_system_statisticsfunction iwl_mvm_request_statisticsfunction iwl_mvm_accu_radio_statsfunction iwl_mvm_diversity_iterfunction for_each_mvm_vif_valid_linkfunction iwl_mvm_rx_diversity_allowedfunction iwl_mvm_send_low_latency_cmdfunction iwl_mvm_update_low_latencyfunction iwl_mvm_ll_iterfunction iwl_mvm_low_latencyfunction iwl_mvm_low_latency_bandfunction iwl_mvm_bss_iface_iteratorfunction iwl_mvm_bss_find_iface_iteratorfunction iwl_mvm_sta_iface_iteratorfunction iwl_mvm_is_vif_assocfunction iwl_mvm_get_wd_timeoutfunction iwl_mvm_connection_lossfunction iwl_mvm_event_frame_timeout_callbackfunction iwl_mvm_tcm_load_percentagefunction iwl_mvm_tcm_loadfunction iwl_mvm_tcm_iterfunction iwl_mvm_tcm_resultsfunction iwl_mvm_tcm_uapsd_nonagg_detected_wkfunction iwl_mvm_uapsd_agg_disconnectfunction iwl_mvm_check_uapsd_agg_expected_tptfunction iwl_mvm_tcm_iterator
Annotated Snippet
struct iwl_mvm_diversity_iter_data {
struct iwl_mvm_phy_ctxt *ctxt;
bool result;
};
static void iwl_mvm_diversity_iter(void *_data, u8 *mac,
struct ieee80211_vif *vif)
{
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct iwl_mvm_diversity_iter_data *data = _data;
int i, link_id;
for_each_mvm_vif_valid_link(mvmvif, link_id) {
struct iwl_mvm_vif_link_info *link_info = mvmvif->link[link_id];
if (link_info->phy_ctxt != data->ctxt)
continue;
for (i = 0; i < NUM_IWL_MVM_SMPS_REQ; i++) {
if (link_info->smps_requests[i] == IEEE80211_SMPS_STATIC ||
link_info->smps_requests[i] == IEEE80211_SMPS_DYNAMIC) {
data->result = false;
break;
}
}
}
}
bool iwl_mvm_rx_diversity_allowed(struct iwl_mvm *mvm,
struct iwl_mvm_phy_ctxt *ctxt)
{
struct iwl_mvm_diversity_iter_data data = {
.ctxt = ctxt,
.result = true,
};
lockdep_assert_held(&mvm->mutex);
if (iwlmvm_mod_params.power_scheme != IWL_POWER_SCHEME_CAM)
return false;
if (num_of_ant(iwl_mvm_get_valid_rx_ant(mvm)) == 1)
return false;
if (mvm->cfg->rx_with_siso_diversity)
return false;
ieee80211_iterate_active_interfaces_atomic(
mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
iwl_mvm_diversity_iter, &data);
return data.result;
}
void iwl_mvm_send_low_latency_cmd(struct iwl_mvm *mvm,
bool low_latency, u16 mac_id)
{
struct iwl_mac_low_latency_cmd cmd = {
.mac_id = cpu_to_le32(mac_id)
};
if (!fw_has_capa(&mvm->fw->ucode_capa,
IWL_UCODE_TLV_CAPA_DYNAMIC_QUOTA))
return;
if (low_latency) {
/* currently we don't care about the direction */
cmd.low_latency_rx = 1;
cmd.low_latency_tx = 1;
}
if (iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(MAC_CONF_GROUP, LOW_LATENCY_CMD),
0, sizeof(cmd), &cmd))
IWL_ERR(mvm, "Failed to send low latency command\n");
}
int iwl_mvm_update_low_latency(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
bool low_latency,
enum iwl_mvm_low_latency_cause cause)
{
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
int res;
bool prev;
lockdep_assert_held(&mvm->mutex);
prev = iwl_mvm_vif_low_latency(mvmvif);
iwl_mvm_vif_set_low_latency(mvmvif, low_latency, cause);
low_latency = iwl_mvm_vif_low_latency(mvmvif);
Annotation
- Immediate include surface: `net/mac80211.h`, `iwl-debug.h`, `iwl-io.h`, `iwl-prph.h`, `iwl-csr.h`, `mvm.h`, `fw/api/rs.h`, `fw/img.h`.
- Detected declarations: `struct iwl_mvm_diversity_iter_data`, `struct iwl_mvm_low_latency_iter`, `struct iwl_bss_iter_data`, `struct iwl_bss_find_iter_data`, `struct iwl_sta_iter_data`, `function iwl_mvm_rate_idx_to_plcp`, `function iwl_mvm_send_cmd`, `function iwl_mvm_send_cmd_pdu`, `function iwl_mvm_send_cmd_status`, `function iwl_mvm_send_cmd_pdu_status`.
- 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.