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-2023 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"
29 le32_to_cpu(cmd->ba_enable_beacon_abort)); in iwl_mvm_beacon_filter_send_cmd()
31 le32_to_cpu(cmd->ba_escape_timer)); in iwl_mvm_beacon_filter_send_cmd()
33 le32_to_cpu(cmd->bf_debug_flag)); in iwl_mvm_beacon_filter_send_cmd()
35 le32_to_cpu(cmd->bf_enable_beacon_filter)); in iwl_mvm_beacon_filter_send_cmd()
37 le32_to_cpu(cmd->bf_energy_delta)); in iwl_mvm_beacon_filter_send_cmd()
39 le32_to_cpu(cmd->bf_escape_timer)); in iwl_mvm_beacon_filter_send_cmd()
41 le32_to_cpu(cmd->bf_roaming_energy_delta)); in iwl_mvm_beacon_filter_send_cmd()
43 le32_to_cpu(cmd->bf_roaming_state)); in iwl_mvm_beacon_filter_send_cmd()
45 le32_to_cpu(cmd->bf_temp_threshold)); in iwl_mvm_beacon_filter_send_cmd()
47 le32_to_cpu(cmd->bf_temp_fast_filter)); in iwl_mvm_beacon_filter_send_cmd()
49 le32_to_cpu(cmd->bf_temp_slow_filter)); in iwl_mvm_beacon_filter_send_cmd()
51 le32_to_cpu(cmd->bf_threshold_absolute_low[0]), in iwl_mvm_beacon_filter_send_cmd()
52 le32_to_cpu(cmd->bf_threshold_absolute_low[1])); in iwl_mvm_beacon_filter_send_cmd()
55 le32_to_cpu(cmd->bf_threshold_absolute_high[0]), in iwl_mvm_beacon_filter_send_cmd()
56 le32_to_cpu(cmd->bf_threshold_absolute_high[1])); in iwl_mvm_beacon_filter_send_cmd()
58 if (fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_beacon_filter_send_cmd()
76 if (vif->bss_conf.cqm_rssi_thold) { in iwl_mvm_beacon_filter_set_cqm_params()
77 cmd->bf_energy_delta = in iwl_mvm_beacon_filter_set_cqm_params()
78 cpu_to_le32(vif->bss_conf.cqm_rssi_hyst); in iwl_mvm_beacon_filter_set_cqm_params()
80 cmd->bf_roaming_state = in iwl_mvm_beacon_filter_set_cqm_params()
81 cpu_to_le32(-vif->bss_conf.cqm_rssi_thold); in iwl_mvm_beacon_filter_set_cqm_params()
83 cmd->ba_enable_beacon_abort = cpu_to_le32(mvmvif->bf_data.ba_enabled); in iwl_mvm_beacon_filter_set_cqm_params()
91 cmd->id_and_color, iwlmvm_mod_params.power_scheme, in iwl_mvm_power_log()
92 le16_to_cpu(cmd->flags)); in iwl_mvm_power_log()
93 IWL_DEBUG_POWER(mvm, "Keep alive = %u sec\n", in iwl_mvm_power_log()
94 le16_to_cpu(cmd->keep_alive_seconds)); in iwl_mvm_power_log()
96 if (!(cmd->flags & cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK))) { in iwl_mvm_power_log()
102 le32_to_cpu(cmd->rx_data_timeout)); in iwl_mvm_power_log()
104 le32_to_cpu(cmd->tx_data_timeout)); in iwl_mvm_power_log()
105 if (cmd->flags & cpu_to_le16(POWER_FLAGS_SKIP_OVER_DTIM_MSK)) in iwl_mvm_power_log()
107 cmd->skip_dtim_periods); in iwl_mvm_power_log()
108 if (cmd->flags & cpu_to_le16(POWER_FLAGS_LPRX_ENA_MSK)) in iwl_mvm_power_log()
110 cmd->lprx_rssi_threshold); in iwl_mvm_power_log()
111 if (cmd->flags & cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK)) { in iwl_mvm_power_log()
114 le32_to_cpu(cmd->rx_data_timeout_uapsd)); in iwl_mvm_power_log()
116 le32_to_cpu(cmd->tx_data_timeout_uapsd)); in iwl_mvm_power_log()
117 IWL_DEBUG_POWER(mvm, "QNDP TID = %d\n", cmd->qndp_tid); in iwl_mvm_power_log()
118 IWL_DEBUG_POWER(mvm, "ACs flags = 0x%x\n", cmd->uapsd_ac_flags); in iwl_mvm_power_log()
119 IWL_DEBUG_POWER(mvm, "Max SP = %d\n", cmd->uapsd_max_sp); in iwl_mvm_power_log()
131 if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status) || in iwl_mvm_power_configure_uapsd()
132 cmd->flags & cpu_to_le16(POWER_FLAGS_SNOOZE_ENA_MSK)) { in iwl_mvm_power_configure_uapsd()
133 cmd->rx_data_timeout_uapsd = in iwl_mvm_power_configure_uapsd()
135 cmd->tx_data_timeout_uapsd = in iwl_mvm_power_configure_uapsd()
138 cmd->rx_data_timeout_uapsd = in iwl_mvm_power_configure_uapsd()
140 cmd->tx_data_timeout_uapsd = in iwl_mvm_power_configure_uapsd()
145 /* set advanced pm flag with no uapsd ACs to enable ps-poll */ in iwl_mvm_power_configure_uapsd()
146 if (mvmvif->dbgfs_pm.use_ps_poll) { in iwl_mvm_power_configure_uapsd()
147 cmd->flags |= cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK); in iwl_mvm_power_configure_uapsd()
153 if (!mvmvif->deflink.queue_params[ac].uapsd) in iwl_mvm_power_configure_uapsd()
156 if (!test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) in iwl_mvm_power_configure_uapsd()
157 cmd->flags |= in iwl_mvm_power_configure_uapsd()
160 cmd->uapsd_ac_flags |= BIT(ac); in iwl_mvm_power_configure_uapsd()
162 /* QNDP TID - the highest TID with no admission control */ in iwl_mvm_power_configure_uapsd()
163 if (!tid_found && !mvmvif->deflink.queue_params[ac].acm) { in iwl_mvm_power_configure_uapsd()
167 cmd->qndp_tid = 6; in iwl_mvm_power_configure_uapsd()
170 cmd->qndp_tid = 5; in iwl_mvm_power_configure_uapsd()
173 cmd->qndp_tid = 0; in iwl_mvm_power_configure_uapsd()
176 cmd->qndp_tid = 1; in iwl_mvm_power_configure_uapsd()
182 cmd->flags |= cpu_to_le16(POWER_FLAGS_UAPSD_MISBEHAVING_ENA_MSK); in iwl_mvm_power_configure_uapsd()
184 if (cmd->uapsd_ac_flags == (BIT(IEEE80211_AC_VO) | in iwl_mvm_power_configure_uapsd()
188 cmd->flags |= cpu_to_le16(POWER_FLAGS_SNOOZE_ENA_MSK); in iwl_mvm_power_configure_uapsd()
189 cmd->snooze_interval = cpu_to_le16(IWL_MVM_PS_SNOOZE_INTERVAL); in iwl_mvm_power_configure_uapsd()
190 cmd->snooze_window = in iwl_mvm_power_configure_uapsd()
191 test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status) ? in iwl_mvm_power_configure_uapsd()
196 cmd->uapsd_max_sp = mvm->hw->uapsd_max_sp_len; in iwl_mvm_power_configure_uapsd()
198 if (cmd->flags & cpu_to_le16(POWER_FLAGS_SNOOZE_ENA_MSK)) { in iwl_mvm_power_configure_uapsd()
199 cmd->heavy_tx_thld_packets = in iwl_mvm_power_configure_uapsd()
201 cmd->heavy_rx_thld_packets = in iwl_mvm_power_configure_uapsd()
204 cmd->heavy_tx_thld_packets = in iwl_mvm_power_configure_uapsd()
206 cmd->heavy_rx_thld_packets = in iwl_mvm_power_configure_uapsd()
209 cmd->heavy_tx_thld_percentage = in iwl_mvm_power_configure_uapsd()
211 cmd->heavy_rx_thld_percentage = in iwl_mvm_power_configure_uapsd()
226 if (vif->cfg.assoc) in iwl_mvm_p2p_standalone_iterator()
240 if (ether_addr_equal(mvmvif->uapsd_misbehaving_ap_addr, in iwl_mvm_power_allow_uapsd()
241 vif->cfg.ap_addr)) in iwl_mvm_power_allow_uapsd()
248 if (vif->p2p && in iwl_mvm_power_allow_uapsd()
249 (vif->bss_conf.p2p_noa_attr.oppps_ctwindow & in iwl_mvm_power_allow_uapsd()
254 * Avoid using uAPSD if client is in DCM - in iwl_mvm_power_allow_uapsd()
260 if (vif->p2p) { in iwl_mvm_power_allow_uapsd()
261 /* Allow U-APSD only if p2p is stand alone */ in iwl_mvm_power_allow_uapsd()
267 ieee80211_iterate_active_interfaces_atomic(mvm->hw, in iwl_mvm_power_allow_uapsd()
288 chanctx_conf = rcu_dereference(link_conf->chanctx_conf); in iwl_mvm_power_is_radar()
293 radar_detect = !!(chanctx_conf->def.chan->flags & in iwl_mvm_power_is_radar()
308 int dtimper = vif->bss_conf.dtim_period ?: 1; in iwl_mvm_power_config_skip_dtim()
312 cmd->skip_dtim_periods = 0; in iwl_mvm_power_config_skip_dtim()
313 cmd->flags &= ~cpu_to_le16(POWER_FLAGS_SKIP_OVER_DTIM_MSK); in iwl_mvm_power_config_skip_dtim()
321 if (!test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) { in iwl_mvm_power_config_skip_dtim()
326 int dtimper_tu = dtimper * vif->bss_conf.beacon_int; in iwl_mvm_power_config_skip_dtim()
334 cmd->skip_dtim_periods = skip; in iwl_mvm_power_config_skip_dtim()
335 cmd->flags |= cpu_to_le16(POWER_FLAGS_SKIP_OVER_DTIM_MSK); in iwl_mvm_power_config_skip_dtim()
347 cmd->id_and_color = cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, in iwl_mvm_power_build_cmd()
348 mvmvif->color)); in iwl_mvm_power_build_cmd()
349 dtimper = vif->bss_conf.dtim_period; in iwl_mvm_power_build_cmd()
350 bi = vif->bss_conf.beacon_int; in iwl_mvm_power_build_cmd()
354 * keep alive period. FW will use it for sending keep alive NDPs in iwl_mvm_power_build_cmd()
355 * immediately after association. Check that keep alive period in iwl_mvm_power_build_cmd()
361 cmd->keep_alive_seconds = cpu_to_le16(keep_alive); in iwl_mvm_power_build_cmd()
363 if (mvm->ps_disabled) in iwl_mvm_power_build_cmd()
366 cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_SAVE_ENA_MSK); in iwl_mvm_power_build_cmd()
368 if (!vif->cfg.ps || !mvmvif->pm_enabled) in iwl_mvm_power_build_cmd()
371 if (iwl_mvm_vif_low_latency(mvmvif) && vif->p2p && in iwl_mvm_power_build_cmd()
372 (!fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_power_build_cmd()
377 cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK); in iwl_mvm_power_build_cmd()
379 if (vif->bss_conf.beacon_rate && in iwl_mvm_power_build_cmd()
380 (vif->bss_conf.beacon_rate->bitrate == 10 || in iwl_mvm_power_build_cmd()
381 vif->bss_conf.beacon_rate->bitrate == 60)) { in iwl_mvm_power_build_cmd()
382 cmd->flags |= cpu_to_le16(POWER_FLAGS_LPRX_ENA_MSK); in iwl_mvm_power_build_cmd()
383 cmd->lprx_rssi_threshold = POWER_LPRX_RSSI_THRESHOLD; in iwl_mvm_power_build_cmd()
388 if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) { in iwl_mvm_power_build_cmd()
389 cmd->rx_data_timeout = in iwl_mvm_power_build_cmd()
391 cmd->tx_data_timeout = in iwl_mvm_power_build_cmd()
393 } else if (iwl_mvm_vif_low_latency(mvmvif) && vif->p2p && in iwl_mvm_power_build_cmd()
394 fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_power_build_cmd()
396 cmd->tx_data_timeout = in iwl_mvm_power_build_cmd()
398 cmd->rx_data_timeout = in iwl_mvm_power_build_cmd()
401 cmd->rx_data_timeout = in iwl_mvm_power_build_cmd()
403 cmd->tx_data_timeout = in iwl_mvm_power_build_cmd()
411 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_KEEP_ALIVE) in iwl_mvm_power_build_cmd()
412 cmd->keep_alive_seconds = in iwl_mvm_power_build_cmd()
413 cpu_to_le16(mvmvif->dbgfs_pm.keep_alive_seconds); in iwl_mvm_power_build_cmd()
414 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_SKIP_OVER_DTIM) { in iwl_mvm_power_build_cmd()
415 if (mvmvif->dbgfs_pm.skip_over_dtim) in iwl_mvm_power_build_cmd()
416 cmd->flags |= in iwl_mvm_power_build_cmd()
419 cmd->flags &= in iwl_mvm_power_build_cmd()
422 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_RX_DATA_TIMEOUT) in iwl_mvm_power_build_cmd()
423 cmd->rx_data_timeout = in iwl_mvm_power_build_cmd()
424 cpu_to_le32(mvmvif->dbgfs_pm.rx_data_timeout); in iwl_mvm_power_build_cmd()
425 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_TX_DATA_TIMEOUT) in iwl_mvm_power_build_cmd()
426 cmd->tx_data_timeout = in iwl_mvm_power_build_cmd()
427 cpu_to_le32(mvmvif->dbgfs_pm.tx_data_timeout); in iwl_mvm_power_build_cmd()
428 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_SKIP_DTIM_PERIODS) in iwl_mvm_power_build_cmd()
429 cmd->skip_dtim_periods = mvmvif->dbgfs_pm.skip_dtim_periods; in iwl_mvm_power_build_cmd()
430 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_LPRX_ENA) { in iwl_mvm_power_build_cmd()
431 if (mvmvif->dbgfs_pm.lprx_ena) in iwl_mvm_power_build_cmd()
432 cmd->flags |= cpu_to_le16(POWER_FLAGS_LPRX_ENA_MSK); in iwl_mvm_power_build_cmd()
434 cmd->flags &= cpu_to_le16(~POWER_FLAGS_LPRX_ENA_MSK); in iwl_mvm_power_build_cmd()
436 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_LPRX_RSSI_THRESHOLD) in iwl_mvm_power_build_cmd()
437 cmd->lprx_rssi_threshold = mvmvif->dbgfs_pm.lprx_rssi_threshold; in iwl_mvm_power_build_cmd()
438 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_SNOOZE_ENABLE) { in iwl_mvm_power_build_cmd()
439 if (mvmvif->dbgfs_pm.snooze_ena) in iwl_mvm_power_build_cmd()
440 cmd->flags |= in iwl_mvm_power_build_cmd()
443 cmd->flags &= in iwl_mvm_power_build_cmd()
446 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_UAPSD_MISBEHAVING) { in iwl_mvm_power_build_cmd()
448 if (mvmvif->dbgfs_pm.uapsd_misbehaving) in iwl_mvm_power_build_cmd()
449 cmd->flags |= cpu_to_le16(flag); in iwl_mvm_power_build_cmd()
451 cmd->flags &= cpu_to_le16(flag); in iwl_mvm_power_build_cmd()
464 memcpy(&iwl_mvm_vif_from_mac80211(vif)->mac_pwr_cmd, &cmd, sizeof(cmd)); in iwl_mvm_power_send_cmd()
478 mvm->ps_disabled = true; in iwl_mvm_power_update_device()
480 if (!mvm->ps_disabled) in iwl_mvm_power_update_device()
484 if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status) ? in iwl_mvm_power_update_device()
485 mvm->disable_power_off_d3 : mvm->disable_power_off) in iwl_mvm_power_update_device()
489 if (mvm->ext_clock_valid) in iwl_mvm_power_update_device()
492 if (iwl_fw_lookup_cmd_ver(mvm->fw, POWER_TABLE_CMD, 0) >= 7 && in iwl_mvm_power_update_device()
493 test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) in iwl_mvm_power_update_device()
509 if (!ether_addr_equal(mvmvif->uapsd_misbehaving_ap_addr, in iwl_mvm_power_vif_assoc()
510 vif->cfg.ap_addr)) in iwl_mvm_power_vif_assoc()
511 eth_zero_addr(mvmvif->uapsd_misbehaving_ap_addr); in iwl_mvm_power_vif_assoc()
524 struct iwl_mvm_vif_link_info *link_info = mvmvif->link[link_id]; in iwl_mvm_power_uapsd_misbehav_ap_iterator()
529 if (link_info->ap_sta_id == *ap_sta_id) { in iwl_mvm_power_uapsd_misbehav_ap_iterator()
530 ether_addr_copy(mvmvif->uapsd_misbehaving_ap_addr, in iwl_mvm_power_uapsd_misbehav_ap_iterator()
531 vif->cfg.ap_addr); in iwl_mvm_power_uapsd_misbehav_ap_iterator()
542 struct iwl_uapsd_misbehaving_ap_notif *notif = (void *)pkt->data; in iwl_mvm_power_uapsd_misbehaving_ap_notif()
543 u8 ap_sta_id = le32_to_cpu(notif->sta_id); in iwl_mvm_power_uapsd_misbehaving_ap_notif()
546 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, in iwl_mvm_power_uapsd_misbehaving_ap_notif()
567 mvmvif->pm_enabled = false; in iwl_mvm_power_disable_pm_iterator()
577 *disable_ps |= mvmvif->ps_disabled; in iwl_mvm_power_ps_disabled_iterator()
587 if (!mvmvif->uploaded) in iwl_mvm_power_get_vifs_iterator()
599 WARN_ON(power_iterator->ap_vif); in iwl_mvm_power_get_vifs_iterator()
600 power_iterator->ap_vif = vif; in iwl_mvm_power_get_vifs_iterator()
602 power_iterator->ap_active = true; in iwl_mvm_power_get_vifs_iterator()
607 WARN_ON(power_iterator->monitor_vif); in iwl_mvm_power_get_vifs_iterator()
608 power_iterator->monitor_vif = vif; in iwl_mvm_power_get_vifs_iterator()
610 power_iterator->monitor_active = true; in iwl_mvm_power_get_vifs_iterator()
615 WARN_ON(power_iterator->p2p_vif); in iwl_mvm_power_get_vifs_iterator()
616 power_iterator->p2p_vif = vif; in iwl_mvm_power_get_vifs_iterator()
618 power_iterator->p2p_active = true; in iwl_mvm_power_get_vifs_iterator()
622 power_iterator->bss_vif = vif; in iwl_mvm_power_get_vifs_iterator()
624 power_iterator->bss_active = true; in iwl_mvm_power_get_vifs_iterator()
641 lockdep_assert_held(&mvm->mutex); in iwl_mvm_power_set_pm()
644 ieee80211_iterate_active_interfaces_atomic(mvm->hw, in iwl_mvm_power_set_pm()
649 if (vifs->bss_vif) in iwl_mvm_power_set_pm()
650 bss_mvmvif = iwl_mvm_vif_from_mac80211(vifs->bss_vif); in iwl_mvm_power_set_pm()
652 if (vifs->p2p_vif) in iwl_mvm_power_set_pm()
653 p2p_mvmvif = iwl_mvm_vif_from_mac80211(vifs->p2p_vif); in iwl_mvm_power_set_pm()
655 if (vifs->ap_vif) in iwl_mvm_power_set_pm()
656 ap_mvmvif = iwl_mvm_vif_from_mac80211(vifs->ap_vif); in iwl_mvm_power_set_pm()
658 /* don't allow PM if any TDLS stations exist */ in iwl_mvm_power_set_pm()
662 /* enable PM on bss if bss stand alone */ in iwl_mvm_power_set_pm()
663 if (bss_mvmvif && vifs->bss_active && !vifs->p2p_active && in iwl_mvm_power_set_pm()
664 !vifs->ap_active) { in iwl_mvm_power_set_pm()
665 bss_mvmvif->pm_enabled = true; in iwl_mvm_power_set_pm()
669 /* enable PM on p2p if p2p stand alone */ in iwl_mvm_power_set_pm()
670 if (p2p_mvmvif && vifs->p2p_active && !vifs->bss_active && in iwl_mvm_power_set_pm()
671 !vifs->ap_active) { in iwl_mvm_power_set_pm()
672 p2p_mvmvif->pm_enabled = true; in iwl_mvm_power_set_pm()
676 if (p2p_mvmvif && bss_mvmvif && vifs->bss_active && vifs->p2p_active) in iwl_mvm_power_set_pm()
680 if (bss_mvmvif && ap_mvmvif && vifs->bss_active && vifs->ap_active) in iwl_mvm_power_set_pm()
684 /* clients are not stand alone: enable PM if DCM */ in iwl_mvm_power_set_pm()
686 if (bss_mvmvif && vifs->bss_active) in iwl_mvm_power_set_pm()
687 bss_mvmvif->pm_enabled = true; in iwl_mvm_power_set_pm()
688 if (p2p_mvmvif && vifs->p2p_active) in iwl_mvm_power_set_pm()
689 p2p_mvmvif->pm_enabled = true; in iwl_mvm_power_set_pm()
697 if (client_same_channel && !vifs->ap_active) { in iwl_mvm_power_set_pm()
699 bss_mvmvif->pm_enabled = true; in iwl_mvm_power_set_pm()
700 p2p_mvmvif->pm_enabled = true; in iwl_mvm_power_set_pm()
713 mutex_lock(&mvm->mutex); in iwl_mvm_power_mac_dbgfs_read()
714 memcpy(&cmd, &mvmvif->mac_pwr_cmd, sizeof(cmd)); in iwl_mvm_power_mac_dbgfs_read()
715 mutex_unlock(&mvm->mutex); in iwl_mvm_power_mac_dbgfs_read()
717 pos += scnprintf(buf+pos, bufsz-pos, "power_scheme = %d\n", in iwl_mvm_power_mac_dbgfs_read()
719 pos += scnprintf(buf+pos, bufsz-pos, "flags = 0x%x\n", in iwl_mvm_power_mac_dbgfs_read()
721 pos += scnprintf(buf+pos, bufsz-pos, "keep_alive = %d\n", in iwl_mvm_power_mac_dbgfs_read()
727 pos += scnprintf(buf+pos, bufsz-pos, "skip_over_dtim = %d\n", in iwl_mvm_power_mac_dbgfs_read()
730 pos += scnprintf(buf+pos, bufsz-pos, "skip_dtim_periods = %d\n", in iwl_mvm_power_mac_dbgfs_read()
733 pos += scnprintf(buf+pos, bufsz-pos, "rx_data_timeout = %d\n", in iwl_mvm_power_mac_dbgfs_read()
735 pos += scnprintf(buf+pos, bufsz-pos, "tx_data_timeout = %d\n", in iwl_mvm_power_mac_dbgfs_read()
739 pos += scnprintf(buf+pos, bufsz-pos, in iwl_mvm_power_mac_dbgfs_read()
746 pos += scnprintf(buf+pos, bufsz-pos, "rx_data_timeout_uapsd = %d\n", in iwl_mvm_power_mac_dbgfs_read()
748 pos += scnprintf(buf+pos, bufsz-pos, "tx_data_timeout_uapsd = %d\n", in iwl_mvm_power_mac_dbgfs_read()
750 pos += scnprintf(buf+pos, bufsz-pos, "qndp_tid = %d\n", cmd.qndp_tid); in iwl_mvm_power_mac_dbgfs_read()
751 pos += scnprintf(buf+pos, bufsz-pos, "uapsd_ac_flags = 0x%x\n", in iwl_mvm_power_mac_dbgfs_read()
753 pos += scnprintf(buf+pos, bufsz-pos, "uapsd_max_sp = %d\n", in iwl_mvm_power_mac_dbgfs_read()
755 pos += scnprintf(buf+pos, bufsz-pos, "heavy_tx_thld_packets = %d\n", in iwl_mvm_power_mac_dbgfs_read()
757 pos += scnprintf(buf+pos, bufsz-pos, "heavy_rx_thld_packets = %d\n", in iwl_mvm_power_mac_dbgfs_read()
759 pos += scnprintf(buf+pos, bufsz-pos, "heavy_tx_thld_percentage = %d\n", in iwl_mvm_power_mac_dbgfs_read()
761 pos += scnprintf(buf+pos, bufsz-pos, "heavy_rx_thld_percentage = %d\n", in iwl_mvm_power_mac_dbgfs_read()
763 pos += scnprintf(buf+pos, bufsz-pos, "uapsd_misbehaving_enable = %d\n", in iwl_mvm_power_mac_dbgfs_read()
771 pos += scnprintf(buf+pos, bufsz-pos, "snooze_interval = %d\n", in iwl_mvm_power_mac_dbgfs_read()
773 pos += scnprintf(buf+pos, bufsz-pos, "snooze_window = %d\n", in iwl_mvm_power_mac_dbgfs_read()
784 struct iwl_dbgfs_bf *dbgfs_bf = &mvmvif->dbgfs_bf; in iwl_mvm_beacon_filter_debugfs_parameters()
786 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_ENERGY_DELTA) in iwl_mvm_beacon_filter_debugfs_parameters()
787 cmd->bf_energy_delta = cpu_to_le32(dbgfs_bf->bf_energy_delta); in iwl_mvm_beacon_filter_debugfs_parameters()
788 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_ROAMING_ENERGY_DELTA) in iwl_mvm_beacon_filter_debugfs_parameters()
789 cmd->bf_roaming_energy_delta = in iwl_mvm_beacon_filter_debugfs_parameters()
790 cpu_to_le32(dbgfs_bf->bf_roaming_energy_delta); in iwl_mvm_beacon_filter_debugfs_parameters()
791 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_ROAMING_STATE) in iwl_mvm_beacon_filter_debugfs_parameters()
792 cmd->bf_roaming_state = cpu_to_le32(dbgfs_bf->bf_roaming_state); in iwl_mvm_beacon_filter_debugfs_parameters()
793 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_TEMP_THRESHOLD) in iwl_mvm_beacon_filter_debugfs_parameters()
794 cmd->bf_temp_threshold = in iwl_mvm_beacon_filter_debugfs_parameters()
795 cpu_to_le32(dbgfs_bf->bf_temp_threshold); in iwl_mvm_beacon_filter_debugfs_parameters()
796 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_TEMP_FAST_FILTER) in iwl_mvm_beacon_filter_debugfs_parameters()
797 cmd->bf_temp_fast_filter = in iwl_mvm_beacon_filter_debugfs_parameters()
798 cpu_to_le32(dbgfs_bf->bf_temp_fast_filter); in iwl_mvm_beacon_filter_debugfs_parameters()
799 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_TEMP_SLOW_FILTER) in iwl_mvm_beacon_filter_debugfs_parameters()
800 cmd->bf_temp_slow_filter = in iwl_mvm_beacon_filter_debugfs_parameters()
801 cpu_to_le32(dbgfs_bf->bf_temp_slow_filter); in iwl_mvm_beacon_filter_debugfs_parameters()
802 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_DEBUG_FLAG) in iwl_mvm_beacon_filter_debugfs_parameters()
803 cmd->bf_debug_flag = cpu_to_le32(dbgfs_bf->bf_debug_flag); in iwl_mvm_beacon_filter_debugfs_parameters()
804 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_ESCAPE_TIMER) in iwl_mvm_beacon_filter_debugfs_parameters()
805 cmd->bf_escape_timer = cpu_to_le32(dbgfs_bf->bf_escape_timer); in iwl_mvm_beacon_filter_debugfs_parameters()
806 if (dbgfs_bf->mask & MVM_DEBUGFS_BA_ESCAPE_TIMER) in iwl_mvm_beacon_filter_debugfs_parameters()
807 cmd->ba_escape_timer = cpu_to_le32(dbgfs_bf->ba_escape_timer); in iwl_mvm_beacon_filter_debugfs_parameters()
808 if (dbgfs_bf->mask & MVM_DEBUGFS_BA_ENABLE_BEACON_ABORT) in iwl_mvm_beacon_filter_debugfs_parameters()
809 cmd->ba_enable_beacon_abort = in iwl_mvm_beacon_filter_debugfs_parameters()
810 cpu_to_le32(dbgfs_bf->ba_enable_beacon_abort); in iwl_mvm_beacon_filter_debugfs_parameters()
822 if (mvmvif != mvm->bf_allowed_vif || !vif->bss_conf.dtim_period || in _iwl_mvm_enable_beacon_filter()
823 vif->type != NL80211_IFTYPE_STATION || vif->p2p) in _iwl_mvm_enable_beacon_filter()
831 mvmvif->bf_data.bf_enabled = true; in _iwl_mvm_enable_beacon_filter()
856 if (vif->type != NL80211_IFTYPE_STATION || vif->p2p) in _iwl_mvm_disable_beacon_filter()
862 mvmvif->bf_data.bf_enabled = false; in _iwl_mvm_disable_beacon_filter()
882 ieee80211_iterate_active_interfaces_atomic(mvm->hw, in iwl_mvm_power_set_ps()
888 if (mvm->ps_disabled != disable_ps) { in iwl_mvm_power_set_ps()
889 bool old_ps_disabled = mvm->ps_disabled; in iwl_mvm_power_set_ps()
891 mvm->ps_disabled = disable_ps; in iwl_mvm_power_set_ps()
894 mvm->ps_disabled = old_ps_disabled; in iwl_mvm_power_set_ps()
911 if (!mvmvif->bf_data.bf_enabled) in iwl_mvm_power_set_ba()
914 if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) in iwl_mvm_power_set_ba()
917 mvmvif->bf_data.ba_enabled = !(!mvmvif->pm_enabled || in iwl_mvm_power_set_ba()
918 mvm->ps_disabled || in iwl_mvm_power_set_ba()
919 !vif->cfg.ps || in iwl_mvm_power_set_ba()
932 lockdep_assert_held(&mvm->mutex); in iwl_mvm_power_update_ps()
935 ieee80211_iterate_active_interfaces_atomic(mvm->hw, in iwl_mvm_power_update_ps()
956 lockdep_assert_held(&mvm->mutex); in iwl_mvm_power_update_mac()
959 ieee80211_iterate_active_interfaces_atomic(mvm->hw, in iwl_mvm_power_update_mac()