Lines Matching +full:pm +full:- +full:alive
1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
3 * Copyright (C) 2012-2014, 2018-2019, 2021-2024 Intel Corporation
4 * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
5 * Copyright (C) 2015-2017 Intel Deutschland GmbH
14 #include "iwl-debug.h"
16 #include "iwl-modparams.h"
28 le32_to_cpu(cmd->ba_enable_beacon_abort)); in iwl_mvm_beacon_filter_send_cmd()
30 le32_to_cpu(cmd->ba_escape_timer)); in iwl_mvm_beacon_filter_send_cmd()
32 le32_to_cpu(cmd->bf_debug_flag)); in iwl_mvm_beacon_filter_send_cmd()
34 le32_to_cpu(cmd->bf_enable_beacon_filter)); in iwl_mvm_beacon_filter_send_cmd()
36 le32_to_cpu(cmd->bf_energy_delta)); in iwl_mvm_beacon_filter_send_cmd()
38 le32_to_cpu(cmd->bf_escape_timer)); in iwl_mvm_beacon_filter_send_cmd()
40 le32_to_cpu(cmd->bf_roaming_energy_delta)); in iwl_mvm_beacon_filter_send_cmd()
42 le32_to_cpu(cmd->bf_roaming_state)); in iwl_mvm_beacon_filter_send_cmd()
44 le32_to_cpu(cmd->bf_temp_threshold)); in iwl_mvm_beacon_filter_send_cmd()
46 le32_to_cpu(cmd->bf_temp_fast_filter)); in iwl_mvm_beacon_filter_send_cmd()
48 le32_to_cpu(cmd->bf_temp_slow_filter)); in iwl_mvm_beacon_filter_send_cmd()
50 le32_to_cpu(cmd->bf_threshold_absolute_low[0]), in iwl_mvm_beacon_filter_send_cmd()
51 le32_to_cpu(cmd->bf_threshold_absolute_low[1])); in iwl_mvm_beacon_filter_send_cmd()
54 le32_to_cpu(cmd->bf_threshold_absolute_high[0]), in iwl_mvm_beacon_filter_send_cmd()
55 le32_to_cpu(cmd->bf_threshold_absolute_high[1])); in iwl_mvm_beacon_filter_send_cmd()
57 if (fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_beacon_filter_send_cmd()
75 if (vif->bss_conf.cqm_rssi_thold) { in iwl_mvm_beacon_filter_set_cqm_params()
76 cmd->bf_energy_delta = in iwl_mvm_beacon_filter_set_cqm_params()
77 cpu_to_le32(vif->bss_conf.cqm_rssi_hyst); in iwl_mvm_beacon_filter_set_cqm_params()
79 cmd->bf_roaming_state = in iwl_mvm_beacon_filter_set_cqm_params()
80 cpu_to_le32(-vif->bss_conf.cqm_rssi_thold); in iwl_mvm_beacon_filter_set_cqm_params()
82 cmd->ba_enable_beacon_abort = cpu_to_le32(mvmvif->ba_enabled); in iwl_mvm_beacon_filter_set_cqm_params()
90 cmd->id_and_color, iwlmvm_mod_params.power_scheme, in iwl_mvm_power_log()
91 le16_to_cpu(cmd->flags)); in iwl_mvm_power_log()
92 IWL_DEBUG_POWER(mvm, "Keep alive = %u sec\n", in iwl_mvm_power_log()
93 le16_to_cpu(cmd->keep_alive_seconds)); in iwl_mvm_power_log()
95 if (!(cmd->flags & cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK))) { in iwl_mvm_power_log()
101 le32_to_cpu(cmd->rx_data_timeout)); in iwl_mvm_power_log()
103 le32_to_cpu(cmd->tx_data_timeout)); in iwl_mvm_power_log()
104 if (cmd->flags & cpu_to_le16(POWER_FLAGS_SKIP_OVER_DTIM_MSK)) in iwl_mvm_power_log()
106 cmd->skip_dtim_periods); in iwl_mvm_power_log()
107 if (cmd->flags & cpu_to_le16(POWER_FLAGS_LPRX_ENA_MSK)) in iwl_mvm_power_log()
109 cmd->lprx_rssi_threshold); in iwl_mvm_power_log()
110 if (cmd->flags & cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK)) { in iwl_mvm_power_log()
113 le32_to_cpu(cmd->rx_data_timeout_uapsd)); in iwl_mvm_power_log()
115 le32_to_cpu(cmd->tx_data_timeout_uapsd)); in iwl_mvm_power_log()
116 IWL_DEBUG_POWER(mvm, "QNDP TID = %d\n", cmd->qndp_tid); in iwl_mvm_power_log()
117 IWL_DEBUG_POWER(mvm, "ACs flags = 0x%x\n", cmd->uapsd_ac_flags); in iwl_mvm_power_log()
118 IWL_DEBUG_POWER(mvm, "Max SP = %d\n", cmd->uapsd_max_sp); in iwl_mvm_power_log()
130 if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status) || in iwl_mvm_power_configure_uapsd()
131 cmd->flags & cpu_to_le16(POWER_FLAGS_SNOOZE_ENA_MSK)) { in iwl_mvm_power_configure_uapsd()
132 cmd->rx_data_timeout_uapsd = in iwl_mvm_power_configure_uapsd()
134 cmd->tx_data_timeout_uapsd = in iwl_mvm_power_configure_uapsd()
137 cmd->rx_data_timeout_uapsd = in iwl_mvm_power_configure_uapsd()
139 cmd->tx_data_timeout_uapsd = in iwl_mvm_power_configure_uapsd()
144 /* set advanced pm flag with no uapsd ACs to enable ps-poll */ in iwl_mvm_power_configure_uapsd()
145 if (mvmvif->dbgfs_pm.use_ps_poll) { in iwl_mvm_power_configure_uapsd()
146 cmd->flags |= cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK); in iwl_mvm_power_configure_uapsd()
152 if (!mvmvif->deflink.queue_params[ac].uapsd) in iwl_mvm_power_configure_uapsd()
155 if (!test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) in iwl_mvm_power_configure_uapsd()
156 cmd->flags |= in iwl_mvm_power_configure_uapsd()
159 cmd->uapsd_ac_flags |= BIT(ac); in iwl_mvm_power_configure_uapsd()
161 /* QNDP TID - the highest TID with no admission control */ in iwl_mvm_power_configure_uapsd()
162 if (!tid_found && !mvmvif->deflink.queue_params[ac].acm) { in iwl_mvm_power_configure_uapsd()
166 cmd->qndp_tid = 6; in iwl_mvm_power_configure_uapsd()
169 cmd->qndp_tid = 5; in iwl_mvm_power_configure_uapsd()
172 cmd->qndp_tid = 0; in iwl_mvm_power_configure_uapsd()
175 cmd->qndp_tid = 1; in iwl_mvm_power_configure_uapsd()
181 cmd->flags |= cpu_to_le16(POWER_FLAGS_UAPSD_MISBEHAVING_ENA_MSK); in iwl_mvm_power_configure_uapsd()
183 if (cmd->uapsd_ac_flags == (BIT(IEEE80211_AC_VO) | in iwl_mvm_power_configure_uapsd()
187 cmd->flags |= cpu_to_le16(POWER_FLAGS_SNOOZE_ENA_MSK); in iwl_mvm_power_configure_uapsd()
188 cmd->snooze_interval = cpu_to_le16(IWL_MVM_PS_SNOOZE_INTERVAL); in iwl_mvm_power_configure_uapsd()
189 cmd->snooze_window = in iwl_mvm_power_configure_uapsd()
190 test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status) ? in iwl_mvm_power_configure_uapsd()
195 cmd->uapsd_max_sp = mvm->hw->uapsd_max_sp_len; in iwl_mvm_power_configure_uapsd()
197 if (cmd->flags & cpu_to_le16(POWER_FLAGS_SNOOZE_ENA_MSK)) { in iwl_mvm_power_configure_uapsd()
198 cmd->heavy_tx_thld_packets = in iwl_mvm_power_configure_uapsd()
200 cmd->heavy_rx_thld_packets = in iwl_mvm_power_configure_uapsd()
203 cmd->heavy_tx_thld_packets = in iwl_mvm_power_configure_uapsd()
205 cmd->heavy_rx_thld_packets = in iwl_mvm_power_configure_uapsd()
208 cmd->heavy_tx_thld_percentage = in iwl_mvm_power_configure_uapsd()
210 cmd->heavy_rx_thld_percentage = in iwl_mvm_power_configure_uapsd()
225 iwl_mvm_vif_from_mac80211(data->current_vif); in iwl_mvm_allow_uapsd_iterator()
228 if (vif == data->current_vif) in iwl_mvm_allow_uapsd_iterator()
231 switch (vif->type) { in iwl_mvm_allow_uapsd_iterator()
235 data->allow_uapsd = false; in iwl_mvm_allow_uapsd_iterator()
241 if (vif->cfg.assoc && other_mvmvif->deflink.phy_ctxt && in iwl_mvm_allow_uapsd_iterator()
242 curr_mvmvif->deflink.phy_ctxt && in iwl_mvm_allow_uapsd_iterator()
243 other_mvmvif->deflink.phy_ctxt->id != curr_mvmvif->deflink.phy_ctxt->id) in iwl_mvm_allow_uapsd_iterator()
244 data->allow_uapsd = false; in iwl_mvm_allow_uapsd_iterator()
261 if (ether_addr_equal(mvmvif->uapsd_misbehaving_ap_addr, in iwl_mvm_power_allow_uapsd()
262 vif->cfg.ap_addr)) in iwl_mvm_power_allow_uapsd()
269 if (vif->p2p && in iwl_mvm_power_allow_uapsd()
270 (vif->bss_conf.p2p_noa_attr.oppps_ctwindow & in iwl_mvm_power_allow_uapsd()
274 if (vif->p2p && !iwl_mvm_is_p2p_scm_uapsd_supported(mvm)) in iwl_mvm_power_allow_uapsd()
277 ieee80211_iterate_active_interfaces_atomic(mvm->hw, in iwl_mvm_power_allow_uapsd()
289 chanctx_conf = rcu_dereference(link_conf->chanctx_conf); in iwl_mvm_power_is_radar()
295 return chanctx_conf->def.chan->flags & IEEE80211_CHAN_RADAR; in iwl_mvm_power_is_radar()
307 cmd->skip_dtim_periods = 0; in iwl_mvm_power_config_skip_dtim()
308 cmd->flags &= ~cpu_to_le16(POWER_FLAGS_SKIP_OVER_DTIM_MSK); in iwl_mvm_power_config_skip_dtim()
310 if (!test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) { in iwl_mvm_power_config_skip_dtim()
313 cmd->skip_dtim_periods = 2; in iwl_mvm_power_config_skip_dtim()
314 cmd->flags |= cpu_to_le16(POWER_FLAGS_SKIP_OVER_DTIM_MSK); in iwl_mvm_power_config_skip_dtim()
320 unsigned int dtimper = link_conf->dtim_period ?: 1; in iwl_mvm_power_config_skip_dtim()
321 unsigned int dtimper_tu = dtimper * link_conf->beacon_int; in iwl_mvm_power_config_skip_dtim()
342 cmd->skip_dtim_periods = min_link_skip; in iwl_mvm_power_config_skip_dtim()
343 cmd->flags |= cpu_to_le16(POWER_FLAGS_SKIP_OVER_DTIM_MSK); in iwl_mvm_power_config_skip_dtim()
355 cmd->id_and_color = cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, in iwl_mvm_power_build_cmd()
356 mvmvif->color)); in iwl_mvm_power_build_cmd()
357 dtimper = vif->bss_conf.dtim_period; in iwl_mvm_power_build_cmd()
358 bi = vif->bss_conf.beacon_int; in iwl_mvm_power_build_cmd()
362 * keep alive period. FW will use it for sending keep alive NDPs in iwl_mvm_power_build_cmd()
363 * immediately after association. Check that keep alive period in iwl_mvm_power_build_cmd()
369 cmd->keep_alive_seconds = cpu_to_le16(keep_alive); in iwl_mvm_power_build_cmd()
371 if (mvm->ps_disabled) in iwl_mvm_power_build_cmd()
374 cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_SAVE_ENA_MSK); in iwl_mvm_power_build_cmd()
376 if (!vif->cfg.ps || !mvmvif->pm_enabled) in iwl_mvm_power_build_cmd()
379 if (iwl_mvm_vif_low_latency(mvmvif) && vif->p2p && in iwl_mvm_power_build_cmd()
380 (!fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_power_build_cmd()
385 cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK); in iwl_mvm_power_build_cmd()
387 if (vif->bss_conf.beacon_rate && in iwl_mvm_power_build_cmd()
388 (vif->bss_conf.beacon_rate->bitrate == 10 || in iwl_mvm_power_build_cmd()
389 vif->bss_conf.beacon_rate->bitrate == 60)) { in iwl_mvm_power_build_cmd()
390 cmd->flags |= cpu_to_le16(POWER_FLAGS_LPRX_ENA_MSK); in iwl_mvm_power_build_cmd()
391 cmd->lprx_rssi_threshold = POWER_LPRX_RSSI_THRESHOLD; in iwl_mvm_power_build_cmd()
396 if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) { in iwl_mvm_power_build_cmd()
397 cmd->rx_data_timeout = in iwl_mvm_power_build_cmd()
399 cmd->tx_data_timeout = in iwl_mvm_power_build_cmd()
401 } else if (iwl_mvm_vif_low_latency(mvmvif) && vif->p2p && in iwl_mvm_power_build_cmd()
402 fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_power_build_cmd()
404 cmd->tx_data_timeout = in iwl_mvm_power_build_cmd()
406 cmd->rx_data_timeout = in iwl_mvm_power_build_cmd()
409 cmd->rx_data_timeout = in iwl_mvm_power_build_cmd()
411 cmd->tx_data_timeout = in iwl_mvm_power_build_cmd()
419 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_KEEP_ALIVE) in iwl_mvm_power_build_cmd()
420 cmd->keep_alive_seconds = in iwl_mvm_power_build_cmd()
421 cpu_to_le16(mvmvif->dbgfs_pm.keep_alive_seconds); in iwl_mvm_power_build_cmd()
422 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_SKIP_OVER_DTIM) { in iwl_mvm_power_build_cmd()
423 if (mvmvif->dbgfs_pm.skip_over_dtim) in iwl_mvm_power_build_cmd()
424 cmd->flags |= in iwl_mvm_power_build_cmd()
427 cmd->flags &= in iwl_mvm_power_build_cmd()
430 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_RX_DATA_TIMEOUT) in iwl_mvm_power_build_cmd()
431 cmd->rx_data_timeout = in iwl_mvm_power_build_cmd()
432 cpu_to_le32(mvmvif->dbgfs_pm.rx_data_timeout); in iwl_mvm_power_build_cmd()
433 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_TX_DATA_TIMEOUT) in iwl_mvm_power_build_cmd()
434 cmd->tx_data_timeout = in iwl_mvm_power_build_cmd()
435 cpu_to_le32(mvmvif->dbgfs_pm.tx_data_timeout); in iwl_mvm_power_build_cmd()
436 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_SKIP_DTIM_PERIODS) in iwl_mvm_power_build_cmd()
437 cmd->skip_dtim_periods = mvmvif->dbgfs_pm.skip_dtim_periods; in iwl_mvm_power_build_cmd()
438 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_LPRX_ENA) { in iwl_mvm_power_build_cmd()
439 if (mvmvif->dbgfs_pm.lprx_ena) in iwl_mvm_power_build_cmd()
440 cmd->flags |= cpu_to_le16(POWER_FLAGS_LPRX_ENA_MSK); in iwl_mvm_power_build_cmd()
442 cmd->flags &= cpu_to_le16(~POWER_FLAGS_LPRX_ENA_MSK); in iwl_mvm_power_build_cmd()
444 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_LPRX_RSSI_THRESHOLD) in iwl_mvm_power_build_cmd()
445 cmd->lprx_rssi_threshold = mvmvif->dbgfs_pm.lprx_rssi_threshold; in iwl_mvm_power_build_cmd()
446 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_SNOOZE_ENABLE) { in iwl_mvm_power_build_cmd()
447 if (mvmvif->dbgfs_pm.snooze_ena) in iwl_mvm_power_build_cmd()
448 cmd->flags |= in iwl_mvm_power_build_cmd()
451 cmd->flags &= in iwl_mvm_power_build_cmd()
454 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_UAPSD_MISBEHAVING) { in iwl_mvm_power_build_cmd()
456 if (mvmvif->dbgfs_pm.uapsd_misbehaving) in iwl_mvm_power_build_cmd()
457 cmd->flags |= cpu_to_le16(flag); in iwl_mvm_power_build_cmd()
459 cmd->flags &= cpu_to_le16(flag); in iwl_mvm_power_build_cmd()
472 memcpy(&iwl_mvm_vif_from_mac80211(vif)->mac_pwr_cmd, &cmd, sizeof(cmd)); in iwl_mvm_power_send_cmd()
486 mvm->ps_disabled = true; in iwl_mvm_power_update_device()
488 if (!mvm->ps_disabled) in iwl_mvm_power_update_device()
492 if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status) ? in iwl_mvm_power_update_device()
493 mvm->disable_power_off_d3 : mvm->disable_power_off) in iwl_mvm_power_update_device()
497 if (mvm->ext_clock_valid) in iwl_mvm_power_update_device()
500 if (iwl_fw_lookup_cmd_ver(mvm->fw, POWER_TABLE_CMD, 0) >= 7 && in iwl_mvm_power_update_device()
501 test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) in iwl_mvm_power_update_device()
517 if (!ether_addr_equal(mvmvif->uapsd_misbehaving_ap_addr, in iwl_mvm_power_vif_assoc()
518 vif->cfg.ap_addr)) in iwl_mvm_power_vif_assoc()
519 eth_zero_addr(mvmvif->uapsd_misbehaving_ap_addr); in iwl_mvm_power_vif_assoc()
532 struct iwl_mvm_vif_link_info *link_info = mvmvif->link[link_id]; in iwl_mvm_power_uapsd_misbehav_ap_iterator()
537 if (link_info->ap_sta_id == *ap_sta_id) { in iwl_mvm_power_uapsd_misbehav_ap_iterator()
538 ether_addr_copy(mvmvif->uapsd_misbehaving_ap_addr, in iwl_mvm_power_uapsd_misbehav_ap_iterator()
539 vif->cfg.ap_addr); in iwl_mvm_power_uapsd_misbehav_ap_iterator()
550 struct iwl_uapsd_misbehaving_ap_notif *notif = (void *)pkt->data; in iwl_mvm_power_uapsd_misbehaving_ap_notif()
551 u8 ap_sta_id = le32_to_cpu(notif->sta_id); in iwl_mvm_power_uapsd_misbehaving_ap_notif()
554 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, in iwl_mvm_power_uapsd_misbehaving_ap_notif()
575 mvmvif->pm_enabled = false; in iwl_mvm_power_disable_pm_iterator()
585 *disable_ps |= mvmvif->ps_disabled; in iwl_mvm_power_ps_disabled_iterator()
595 if (!mvmvif->uploaded) in iwl_mvm_power_get_vifs_iterator()
607 WARN_ON(power_iterator->ap_vif); in iwl_mvm_power_get_vifs_iterator()
608 power_iterator->ap_vif = vif; in iwl_mvm_power_get_vifs_iterator()
610 power_iterator->ap_active = true; in iwl_mvm_power_get_vifs_iterator()
615 WARN_ON(power_iterator->monitor_vif); in iwl_mvm_power_get_vifs_iterator()
616 power_iterator->monitor_vif = vif; in iwl_mvm_power_get_vifs_iterator()
618 power_iterator->monitor_active = true; in iwl_mvm_power_get_vifs_iterator()
623 WARN_ON(power_iterator->p2p_vif); in iwl_mvm_power_get_vifs_iterator()
624 power_iterator->p2p_vif = vif; in iwl_mvm_power_get_vifs_iterator()
626 power_iterator->p2p_active = true; in iwl_mvm_power_get_vifs_iterator()
630 power_iterator->bss_vif = vif; in iwl_mvm_power_get_vifs_iterator()
632 power_iterator->bss_active = true; in iwl_mvm_power_get_vifs_iterator()
649 lockdep_assert_held(&mvm->mutex); in iwl_mvm_power_set_pm()
652 ieee80211_iterate_active_interfaces_atomic(mvm->hw, in iwl_mvm_power_set_pm()
657 if (vifs->bss_vif) in iwl_mvm_power_set_pm()
658 bss_mvmvif = iwl_mvm_vif_from_mac80211(vifs->bss_vif); in iwl_mvm_power_set_pm()
660 if (vifs->p2p_vif) in iwl_mvm_power_set_pm()
661 p2p_mvmvif = iwl_mvm_vif_from_mac80211(vifs->p2p_vif); in iwl_mvm_power_set_pm()
663 if (vifs->ap_vif) in iwl_mvm_power_set_pm()
664 ap_mvmvif = iwl_mvm_vif_from_mac80211(vifs->ap_vif); in iwl_mvm_power_set_pm()
666 /* don't allow PM if any TDLS stations exist */ in iwl_mvm_power_set_pm()
670 /* enable PM on bss if bss stand alone */ in iwl_mvm_power_set_pm()
671 if (bss_mvmvif && vifs->bss_active && !vifs->p2p_active && in iwl_mvm_power_set_pm()
672 !vifs->ap_active) { in iwl_mvm_power_set_pm()
673 bss_mvmvif->pm_enabled = true; in iwl_mvm_power_set_pm()
677 /* enable PM on p2p if p2p stand alone */ in iwl_mvm_power_set_pm()
678 if (p2p_mvmvif && vifs->p2p_active && !vifs->bss_active && in iwl_mvm_power_set_pm()
679 !vifs->ap_active) { in iwl_mvm_power_set_pm()
680 p2p_mvmvif->pm_enabled = true; in iwl_mvm_power_set_pm()
684 if (p2p_mvmvif && bss_mvmvif && vifs->bss_active && vifs->p2p_active) in iwl_mvm_power_set_pm()
688 if (bss_mvmvif && ap_mvmvif && vifs->bss_active && vifs->ap_active) in iwl_mvm_power_set_pm()
692 /* clients are not stand alone: enable PM if DCM */ in iwl_mvm_power_set_pm()
694 if (bss_mvmvif && vifs->bss_active) in iwl_mvm_power_set_pm()
695 bss_mvmvif->pm_enabled = true; in iwl_mvm_power_set_pm()
696 if (p2p_mvmvif && vifs->p2p_active) in iwl_mvm_power_set_pm()
697 p2p_mvmvif->pm_enabled = true; in iwl_mvm_power_set_pm()
705 if (client_same_channel && !vifs->ap_active) { in iwl_mvm_power_set_pm()
707 bss_mvmvif->pm_enabled = true; in iwl_mvm_power_set_pm()
708 p2p_mvmvif->pm_enabled = true; in iwl_mvm_power_set_pm()
721 mutex_lock(&mvm->mutex); in iwl_mvm_power_mac_dbgfs_read()
722 memcpy(&cmd, &mvmvif->mac_pwr_cmd, sizeof(cmd)); in iwl_mvm_power_mac_dbgfs_read()
723 mutex_unlock(&mvm->mutex); in iwl_mvm_power_mac_dbgfs_read()
725 pos += scnprintf(buf+pos, bufsz-pos, "power_scheme = %d\n", in iwl_mvm_power_mac_dbgfs_read()
727 pos += scnprintf(buf+pos, bufsz-pos, "flags = 0x%x\n", in iwl_mvm_power_mac_dbgfs_read()
729 pos += scnprintf(buf+pos, bufsz-pos, "keep_alive = %d\n", in iwl_mvm_power_mac_dbgfs_read()
735 pos += scnprintf(buf+pos, bufsz-pos, "skip_over_dtim = %d\n", in iwl_mvm_power_mac_dbgfs_read()
738 pos += scnprintf(buf+pos, bufsz-pos, "skip_dtim_periods = %d\n", in iwl_mvm_power_mac_dbgfs_read()
741 pos += scnprintf(buf+pos, bufsz-pos, "rx_data_timeout = %d\n", in iwl_mvm_power_mac_dbgfs_read()
743 pos += scnprintf(buf+pos, bufsz-pos, "tx_data_timeout = %d\n", in iwl_mvm_power_mac_dbgfs_read()
747 pos += scnprintf(buf+pos, bufsz-pos, in iwl_mvm_power_mac_dbgfs_read()
754 pos += scnprintf(buf+pos, bufsz-pos, "rx_data_timeout_uapsd = %d\n", in iwl_mvm_power_mac_dbgfs_read()
756 pos += scnprintf(buf+pos, bufsz-pos, "tx_data_timeout_uapsd = %d\n", in iwl_mvm_power_mac_dbgfs_read()
758 pos += scnprintf(buf+pos, bufsz-pos, "qndp_tid = %d\n", cmd.qndp_tid); in iwl_mvm_power_mac_dbgfs_read()
759 pos += scnprintf(buf+pos, bufsz-pos, "uapsd_ac_flags = 0x%x\n", in iwl_mvm_power_mac_dbgfs_read()
761 pos += scnprintf(buf+pos, bufsz-pos, "uapsd_max_sp = %d\n", in iwl_mvm_power_mac_dbgfs_read()
763 pos += scnprintf(buf+pos, bufsz-pos, "heavy_tx_thld_packets = %d\n", in iwl_mvm_power_mac_dbgfs_read()
765 pos += scnprintf(buf+pos, bufsz-pos, "heavy_rx_thld_packets = %d\n", in iwl_mvm_power_mac_dbgfs_read()
767 pos += scnprintf(buf+pos, bufsz-pos, "heavy_tx_thld_percentage = %d\n", in iwl_mvm_power_mac_dbgfs_read()
769 pos += scnprintf(buf+pos, bufsz-pos, "heavy_rx_thld_percentage = %d\n", in iwl_mvm_power_mac_dbgfs_read()
771 pos += scnprintf(buf+pos, bufsz-pos, "uapsd_misbehaving_enable = %d\n", in iwl_mvm_power_mac_dbgfs_read()
779 pos += scnprintf(buf+pos, bufsz-pos, "snooze_interval = %d\n", in iwl_mvm_power_mac_dbgfs_read()
781 pos += scnprintf(buf+pos, bufsz-pos, "snooze_window = %d\n", in iwl_mvm_power_mac_dbgfs_read()
792 struct iwl_dbgfs_bf *dbgfs_bf = &mvmvif->dbgfs_bf; in iwl_mvm_beacon_filter_debugfs_parameters()
794 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_ENERGY_DELTA) in iwl_mvm_beacon_filter_debugfs_parameters()
795 cmd->bf_energy_delta = cpu_to_le32(dbgfs_bf->bf_energy_delta); in iwl_mvm_beacon_filter_debugfs_parameters()
796 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_ROAMING_ENERGY_DELTA) in iwl_mvm_beacon_filter_debugfs_parameters()
797 cmd->bf_roaming_energy_delta = in iwl_mvm_beacon_filter_debugfs_parameters()
798 cpu_to_le32(dbgfs_bf->bf_roaming_energy_delta); in iwl_mvm_beacon_filter_debugfs_parameters()
799 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_ROAMING_STATE) in iwl_mvm_beacon_filter_debugfs_parameters()
800 cmd->bf_roaming_state = cpu_to_le32(dbgfs_bf->bf_roaming_state); in iwl_mvm_beacon_filter_debugfs_parameters()
801 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_TEMP_THRESHOLD) in iwl_mvm_beacon_filter_debugfs_parameters()
802 cmd->bf_temp_threshold = in iwl_mvm_beacon_filter_debugfs_parameters()
803 cpu_to_le32(dbgfs_bf->bf_temp_threshold); in iwl_mvm_beacon_filter_debugfs_parameters()
804 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_TEMP_FAST_FILTER) in iwl_mvm_beacon_filter_debugfs_parameters()
805 cmd->bf_temp_fast_filter = in iwl_mvm_beacon_filter_debugfs_parameters()
806 cpu_to_le32(dbgfs_bf->bf_temp_fast_filter); in iwl_mvm_beacon_filter_debugfs_parameters()
807 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_TEMP_SLOW_FILTER) in iwl_mvm_beacon_filter_debugfs_parameters()
808 cmd->bf_temp_slow_filter = in iwl_mvm_beacon_filter_debugfs_parameters()
809 cpu_to_le32(dbgfs_bf->bf_temp_slow_filter); in iwl_mvm_beacon_filter_debugfs_parameters()
810 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_DEBUG_FLAG) in iwl_mvm_beacon_filter_debugfs_parameters()
811 cmd->bf_debug_flag = cpu_to_le32(dbgfs_bf->bf_debug_flag); in iwl_mvm_beacon_filter_debugfs_parameters()
812 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_ESCAPE_TIMER) in iwl_mvm_beacon_filter_debugfs_parameters()
813 cmd->bf_escape_timer = cpu_to_le32(dbgfs_bf->bf_escape_timer); in iwl_mvm_beacon_filter_debugfs_parameters()
814 if (dbgfs_bf->mask & MVM_DEBUGFS_BA_ESCAPE_TIMER) in iwl_mvm_beacon_filter_debugfs_parameters()
815 cmd->ba_escape_timer = cpu_to_le32(dbgfs_bf->ba_escape_timer); in iwl_mvm_beacon_filter_debugfs_parameters()
816 if (dbgfs_bf->mask & MVM_DEBUGFS_BA_ENABLE_BEACON_ABORT) in iwl_mvm_beacon_filter_debugfs_parameters()
817 cmd->ba_enable_beacon_abort = in iwl_mvm_beacon_filter_debugfs_parameters()
818 cpu_to_le32(dbgfs_bf->ba_enable_beacon_abort); in iwl_mvm_beacon_filter_debugfs_parameters()
829 if (mvmvif != mvm->bf_allowed_vif || !vif->bss_conf.dtim_period || in _iwl_mvm_enable_beacon_filter()
830 vif->type != NL80211_IFTYPE_STATION || vif->p2p) in _iwl_mvm_enable_beacon_filter()
838 mvmvif->bf_enabled = true; in _iwl_mvm_enable_beacon_filter()
861 if (vif->type != NL80211_IFTYPE_STATION || vif->p2p) in _iwl_mvm_disable_beacon_filter()
867 mvmvif->bf_enabled = false; in _iwl_mvm_disable_beacon_filter()
886 ieee80211_iterate_active_interfaces_atomic(mvm->hw, in iwl_mvm_power_set_ps()
892 if (mvm->ps_disabled != disable_ps) { in iwl_mvm_power_set_ps()
893 bool old_ps_disabled = mvm->ps_disabled; in iwl_mvm_power_set_ps()
895 mvm->ps_disabled = disable_ps; in iwl_mvm_power_set_ps()
898 mvm->ps_disabled = old_ps_disabled; in iwl_mvm_power_set_ps()
915 if (!mvmvif->bf_enabled) in iwl_mvm_power_set_ba()
918 if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) in iwl_mvm_power_set_ba()
921 mvmvif->ba_enabled = !(!mvmvif->pm_enabled || in iwl_mvm_power_set_ba()
922 mvm->ps_disabled || in iwl_mvm_power_set_ba()
923 !vif->cfg.ps || in iwl_mvm_power_set_ba()
936 lockdep_assert_held(&mvm->mutex); in iwl_mvm_power_update_ps()
939 ieee80211_iterate_active_interfaces_atomic(mvm->hw, in iwl_mvm_power_update_ps()
960 lockdep_assert_held(&mvm->mutex); in iwl_mvm_power_update_mac()
963 ieee80211_iterate_active_interfaces_atomic(mvm->hw, in iwl_mvm_power_update_mac()