drivers/net/wireless/intel/iwlwifi/mvm/power.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mvm/power.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mvm/power.c- Extension
.c- Size
- 29330 bytes
- Lines
- 992
- 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
linux/kernel.hlinux/module.hlinux/slab.hlinux/etherdevice.hnet/mac80211.hiwl-debug.hmvm.hiwl-modparams.hfw/api/power.h
Detected Declarations
struct iwl_allow_uapsd_iface_iterator_datastruct iwl_power_vifsfunction Copyrightfunction iwl_mvm_beacon_filter_set_cqm_paramsfunction iwl_mvm_power_logfunction iwl_mvm_power_configure_uapsdfunction iwl_mvm_allow_uapsd_iteratorfunction iwl_mvm_power_allow_uapsdfunction iwl_mvm_power_is_radarfunction iwl_mvm_power_config_skip_dtimfunction iwl_mvm_power_build_cmdfunction fw_has_capafunction iwl_mvm_power_send_cmdfunction iwl_mvm_power_update_devicefunction iwl_mvm_power_vif_assocfunction iwl_mvm_power_uapsd_misbehav_ap_iteratorfunction iwl_mvm_power_uapsd_misbehaving_ap_notiffunction iwl_mvm_power_disable_pm_iteratorfunction iwl_mvm_power_ps_disabled_iteratorfunction iwl_mvm_power_get_vifs_iteratorfunction iwl_mvm_power_set_pmfunction iwl_mvm_power_mac_dbgfs_readfunction iwl_mvm_beacon_filter_debugfs_parametersfunction _iwl_mvm_enable_beacon_filterfunction iwl_mvm_enable_beacon_filterfunction _iwl_mvm_disable_beacon_filterfunction iwl_mvm_disable_beacon_filterfunction iwl_mvm_power_set_psfunction iwl_mvm_power_set_bafunction iwl_mvm_power_update_psfunction iwl_mvm_power_update_mac
Annotated Snippet
struct iwl_allow_uapsd_iface_iterator_data {
struct ieee80211_vif *current_vif;
bool allow_uapsd;
};
static void iwl_mvm_allow_uapsd_iterator(void *_data, u8 *mac,
struct ieee80211_vif *vif)
{
struct iwl_allow_uapsd_iface_iterator_data *data = _data;
struct iwl_mvm_vif *other_mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct iwl_mvm_vif *curr_mvmvif =
iwl_mvm_vif_from_mac80211(data->current_vif);
/* exclude the given vif */
if (vif == data->current_vif)
return;
switch (vif->type) {
case NL80211_IFTYPE_AP:
case NL80211_IFTYPE_ADHOC:
data->allow_uapsd = false;
break;
case NL80211_IFTYPE_STATION:
/* allow UAPSD if P2P interface and BSS station interface share
* the same channel.
*/
if (vif->cfg.assoc && other_mvmvif->deflink.phy_ctxt &&
curr_mvmvif->deflink.phy_ctxt &&
other_mvmvif->deflink.phy_ctxt->id != curr_mvmvif->deflink.phy_ctxt->id)
data->allow_uapsd = false;
break;
default:
break;
}
}
static bool iwl_mvm_power_allow_uapsd(struct iwl_mvm *mvm,
struct ieee80211_vif *vif)
{
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
struct iwl_allow_uapsd_iface_iterator_data data = {
.current_vif = vif,
.allow_uapsd = true,
};
if (ether_addr_equal(mvmvif->uapsd_misbehaving_ap_addr,
vif->cfg.ap_addr))
return false;
/*
* Avoid using uAPSD if P2P client is associated to GO that uses
* opportunistic power save. This is due to current FW limitation.
*/
if (vif->p2p &&
(vif->bss_conf.p2p_noa_attr.oppps_ctwindow &
IEEE80211_P2P_OPPPS_ENABLE_BIT))
return false;
if (vif->p2p && !iwl_mvm_is_p2p_scm_uapsd_supported(mvm))
return false;
ieee80211_iterate_active_interfaces_atomic(mvm->hw,
IEEE80211_IFACE_ITER_NORMAL,
iwl_mvm_allow_uapsd_iterator,
&data);
return data.allow_uapsd;
}
static bool iwl_mvm_power_is_radar(struct ieee80211_bss_conf *link_conf)
{
struct ieee80211_chanctx_conf *chanctx_conf;
chanctx_conf = rcu_dereference(link_conf->chanctx_conf);
/* this happens on link switching, just ignore inactive ones */
if (!chanctx_conf)
return false;
return chanctx_conf->def.chan->flags & IEEE80211_CHAN_RADAR;
}
static void iwl_mvm_power_config_skip_dtim(struct iwl_mvm *mvm,
struct ieee80211_vif *vif,
struct iwl_mac_power_cmd_v2 *cmd)
{
struct ieee80211_bss_conf *link_conf;
unsigned int min_link_skip = ~0;
unsigned int link_id;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/slab.h`, `linux/etherdevice.h`, `net/mac80211.h`, `iwl-debug.h`, `mvm.h`, `iwl-modparams.h`.
- Detected declarations: `struct iwl_allow_uapsd_iface_iterator_data`, `struct iwl_power_vifs`, `function Copyright`, `function iwl_mvm_beacon_filter_set_cqm_params`, `function iwl_mvm_power_log`, `function iwl_mvm_power_configure_uapsd`, `function iwl_mvm_allow_uapsd_iterator`, `function iwl_mvm_power_allow_uapsd`, `function iwl_mvm_power_is_radar`, `function iwl_mvm_power_config_skip_dtim`.
- 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.