Lines Matching +full:stand +full:- +full:alone
1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
3 * Copyright (C) 2012-2014, 2018-2019, 2021-2025 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()
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()
234 data->allow_uapsd = false; in iwl_mvm_allow_uapsd_iterator()
240 if (vif->cfg.assoc && other_mvmvif->deflink.phy_ctxt && in iwl_mvm_allow_uapsd_iterator()
241 curr_mvmvif->deflink.phy_ctxt && in iwl_mvm_allow_uapsd_iterator()
242 other_mvmvif->deflink.phy_ctxt->id != curr_mvmvif->deflink.phy_ctxt->id) in iwl_mvm_allow_uapsd_iterator()
243 data->allow_uapsd = false; in iwl_mvm_allow_uapsd_iterator()
260 if (ether_addr_equal(mvmvif->uapsd_misbehaving_ap_addr, in iwl_mvm_power_allow_uapsd()
261 vif->cfg.ap_addr)) in iwl_mvm_power_allow_uapsd()
268 if (vif->p2p && in iwl_mvm_power_allow_uapsd()
269 (vif->bss_conf.p2p_noa_attr.oppps_ctwindow & in iwl_mvm_power_allow_uapsd()
273 if (vif->p2p && !iwl_mvm_is_p2p_scm_uapsd_supported(mvm)) in iwl_mvm_power_allow_uapsd()
276 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()
294 return chanctx_conf->def.chan->flags & IEEE80211_CHAN_RADAR; in iwl_mvm_power_is_radar()
306 cmd->skip_dtim_periods = 0; in iwl_mvm_power_config_skip_dtim()
307 cmd->flags &= ~cpu_to_le16(POWER_FLAGS_SKIP_OVER_DTIM_MSK); in iwl_mvm_power_config_skip_dtim()
309 if (!test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) { in iwl_mvm_power_config_skip_dtim()
312 cmd->skip_dtim_periods = 2; 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()
319 unsigned int dtimper = link_conf->dtim_period ?: 1; in iwl_mvm_power_config_skip_dtim()
320 unsigned int dtimper_tu = dtimper * link_conf->beacon_int; in iwl_mvm_power_config_skip_dtim()
341 cmd->skip_dtim_periods = min_link_skip; in iwl_mvm_power_config_skip_dtim()
342 cmd->flags |= cpu_to_le16(POWER_FLAGS_SKIP_OVER_DTIM_MSK); in iwl_mvm_power_config_skip_dtim()
354 cmd->id_and_color = cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, in iwl_mvm_power_build_cmd()
355 mvmvif->color)); in iwl_mvm_power_build_cmd()
356 dtimper = vif->bss_conf.dtim_period; in iwl_mvm_power_build_cmd()
357 bi = vif->bss_conf.beacon_int; in iwl_mvm_power_build_cmd()
368 cmd->keep_alive_seconds = cpu_to_le16(keep_alive); in iwl_mvm_power_build_cmd()
370 if (mvm->ps_disabled) in iwl_mvm_power_build_cmd()
373 cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_SAVE_ENA_MSK); in iwl_mvm_power_build_cmd()
375 if (!vif->cfg.ps || !mvmvif->pm_enabled) in iwl_mvm_power_build_cmd()
378 if (iwl_fw_lookup_cmd_ver(mvm->fw, MAC_PM_POWER_TABLE, 0) >= 2) in iwl_mvm_power_build_cmd()
379 cmd->flags |= cpu_to_le16(POWER_FLAGS_ENABLE_SMPS_MSK); in iwl_mvm_power_build_cmd()
381 if (iwl_mvm_vif_low_latency(mvmvif) && vif->p2p && in iwl_mvm_power_build_cmd()
382 (!fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_power_build_cmd()
387 cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK); in iwl_mvm_power_build_cmd()
389 if (vif->bss_conf.beacon_rate && in iwl_mvm_power_build_cmd()
390 (vif->bss_conf.beacon_rate->bitrate == 10 || in iwl_mvm_power_build_cmd()
391 vif->bss_conf.beacon_rate->bitrate == 60)) { in iwl_mvm_power_build_cmd()
392 cmd->flags |= cpu_to_le16(POWER_FLAGS_LPRX_ENA_MSK); in iwl_mvm_power_build_cmd()
393 cmd->lprx_rssi_threshold = POWER_LPRX_RSSI_THRESHOLD; in iwl_mvm_power_build_cmd()
398 if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) { in iwl_mvm_power_build_cmd()
399 cmd->rx_data_timeout = in iwl_mvm_power_build_cmd()
401 cmd->tx_data_timeout = in iwl_mvm_power_build_cmd()
403 } else if (iwl_mvm_vif_low_latency(mvmvif) && vif->p2p && in iwl_mvm_power_build_cmd()
404 fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_power_build_cmd()
406 cmd->tx_data_timeout = in iwl_mvm_power_build_cmd()
408 cmd->rx_data_timeout = in iwl_mvm_power_build_cmd()
411 cmd->rx_data_timeout = in iwl_mvm_power_build_cmd()
413 cmd->tx_data_timeout = in iwl_mvm_power_build_cmd()
421 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_KEEP_ALIVE) in iwl_mvm_power_build_cmd()
422 cmd->keep_alive_seconds = in iwl_mvm_power_build_cmd()
423 cpu_to_le16(mvmvif->dbgfs_pm.keep_alive_seconds); in iwl_mvm_power_build_cmd()
424 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_SKIP_OVER_DTIM) { in iwl_mvm_power_build_cmd()
425 if (mvmvif->dbgfs_pm.skip_over_dtim) in iwl_mvm_power_build_cmd()
426 cmd->flags |= in iwl_mvm_power_build_cmd()
429 cmd->flags &= in iwl_mvm_power_build_cmd()
432 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_RX_DATA_TIMEOUT) in iwl_mvm_power_build_cmd()
433 cmd->rx_data_timeout = in iwl_mvm_power_build_cmd()
434 cpu_to_le32(mvmvif->dbgfs_pm.rx_data_timeout); in iwl_mvm_power_build_cmd()
435 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_TX_DATA_TIMEOUT) in iwl_mvm_power_build_cmd()
436 cmd->tx_data_timeout = in iwl_mvm_power_build_cmd()
437 cpu_to_le32(mvmvif->dbgfs_pm.tx_data_timeout); in iwl_mvm_power_build_cmd()
438 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_SKIP_DTIM_PERIODS) in iwl_mvm_power_build_cmd()
439 cmd->skip_dtim_periods = mvmvif->dbgfs_pm.skip_dtim_periods; in iwl_mvm_power_build_cmd()
440 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_LPRX_ENA) { in iwl_mvm_power_build_cmd()
441 if (mvmvif->dbgfs_pm.lprx_ena) in iwl_mvm_power_build_cmd()
442 cmd->flags |= cpu_to_le16(POWER_FLAGS_LPRX_ENA_MSK); in iwl_mvm_power_build_cmd()
444 cmd->flags &= cpu_to_le16(~POWER_FLAGS_LPRX_ENA_MSK); in iwl_mvm_power_build_cmd()
446 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_LPRX_RSSI_THRESHOLD) in iwl_mvm_power_build_cmd()
447 cmd->lprx_rssi_threshold = mvmvif->dbgfs_pm.lprx_rssi_threshold; in iwl_mvm_power_build_cmd()
448 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_SNOOZE_ENABLE) { in iwl_mvm_power_build_cmd()
449 if (mvmvif->dbgfs_pm.snooze_ena) in iwl_mvm_power_build_cmd()
450 cmd->flags |= in iwl_mvm_power_build_cmd()
453 cmd->flags &= in iwl_mvm_power_build_cmd()
456 if (mvmvif->dbgfs_pm.mask & MVM_DEBUGFS_PM_UAPSD_MISBEHAVING) { in iwl_mvm_power_build_cmd()
458 if (mvmvif->dbgfs_pm.uapsd_misbehaving) in iwl_mvm_power_build_cmd()
459 cmd->flags |= cpu_to_le16(flag); in iwl_mvm_power_build_cmd()
461 cmd->flags &= cpu_to_le16(flag); in iwl_mvm_power_build_cmd()
474 memcpy(&iwl_mvm_vif_from_mac80211(vif)->mac_pwr_cmd, &cmd, sizeof(cmd)); in iwl_mvm_power_send_cmd()
488 mvm->ps_disabled = true; in iwl_mvm_power_update_device()
490 if (!mvm->ps_disabled) in iwl_mvm_power_update_device()
494 if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status) ? in iwl_mvm_power_update_device()
495 mvm->disable_power_off_d3 : mvm->disable_power_off) in iwl_mvm_power_update_device()
499 if (mvm->ext_clock_valid) in iwl_mvm_power_update_device()
502 if (iwl_fw_lookup_cmd_ver(mvm->fw, POWER_TABLE_CMD, 0) >= 7 && in iwl_mvm_power_update_device()
503 test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) in iwl_mvm_power_update_device()
519 if (!ether_addr_equal(mvmvif->uapsd_misbehaving_ap_addr, in iwl_mvm_power_vif_assoc()
520 vif->cfg.ap_addr)) in iwl_mvm_power_vif_assoc()
521 eth_zero_addr(mvmvif->uapsd_misbehaving_ap_addr); in iwl_mvm_power_vif_assoc()
534 struct iwl_mvm_vif_link_info *link_info = mvmvif->link[link_id]; in iwl_mvm_power_uapsd_misbehav_ap_iterator()
539 if (link_info->ap_sta_id == *ap_sta_id) { in iwl_mvm_power_uapsd_misbehav_ap_iterator()
540 ether_addr_copy(mvmvif->uapsd_misbehaving_ap_addr, in iwl_mvm_power_uapsd_misbehav_ap_iterator()
541 vif->cfg.ap_addr); in iwl_mvm_power_uapsd_misbehav_ap_iterator()
552 struct iwl_uapsd_misbehaving_ap_notif *notif = (void *)pkt->data; in iwl_mvm_power_uapsd_misbehaving_ap_notif()
553 u8 ap_sta_id = le32_to_cpu(notif->sta_id); in iwl_mvm_power_uapsd_misbehaving_ap_notif()
556 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, in iwl_mvm_power_uapsd_misbehaving_ap_notif()
577 mvmvif->pm_enabled = false; in iwl_mvm_power_disable_pm_iterator()
587 *disable_ps |= mvmvif->ps_disabled; in iwl_mvm_power_ps_disabled_iterator()
597 if (!mvmvif->uploaded) in iwl_mvm_power_get_vifs_iterator()
609 WARN_ON(power_iterator->ap_vif); in iwl_mvm_power_get_vifs_iterator()
610 power_iterator->ap_vif = vif; in iwl_mvm_power_get_vifs_iterator()
612 power_iterator->ap_active = true; in iwl_mvm_power_get_vifs_iterator()
617 WARN_ON(power_iterator->monitor_vif); in iwl_mvm_power_get_vifs_iterator()
618 power_iterator->monitor_vif = vif; in iwl_mvm_power_get_vifs_iterator()
620 power_iterator->monitor_active = true; in iwl_mvm_power_get_vifs_iterator()
625 WARN_ON(power_iterator->p2p_vif); in iwl_mvm_power_get_vifs_iterator()
626 power_iterator->p2p_vif = vif; in iwl_mvm_power_get_vifs_iterator()
628 power_iterator->p2p_active = true; in iwl_mvm_power_get_vifs_iterator()
632 power_iterator->bss_vif = vif; in iwl_mvm_power_get_vifs_iterator()
634 power_iterator->bss_active = true; in iwl_mvm_power_get_vifs_iterator()
651 lockdep_assert_held(&mvm->mutex); in iwl_mvm_power_set_pm()
654 ieee80211_iterate_active_interfaces_atomic(mvm->hw, in iwl_mvm_power_set_pm()
659 if (vifs->bss_vif) in iwl_mvm_power_set_pm()
660 bss_mvmvif = iwl_mvm_vif_from_mac80211(vifs->bss_vif); in iwl_mvm_power_set_pm()
662 if (vifs->p2p_vif) in iwl_mvm_power_set_pm()
663 p2p_mvmvif = iwl_mvm_vif_from_mac80211(vifs->p2p_vif); in iwl_mvm_power_set_pm()
665 if (vifs->ap_vif) in iwl_mvm_power_set_pm()
666 ap_mvmvif = iwl_mvm_vif_from_mac80211(vifs->ap_vif); in iwl_mvm_power_set_pm()
672 /* enable PM on bss if bss stand alone */ in iwl_mvm_power_set_pm()
673 if (bss_mvmvif && vifs->bss_active && !vifs->p2p_active && in iwl_mvm_power_set_pm()
674 !vifs->ap_active) { in iwl_mvm_power_set_pm()
675 bss_mvmvif->pm_enabled = true; in iwl_mvm_power_set_pm()
679 /* enable PM on p2p if p2p stand alone */ in iwl_mvm_power_set_pm()
680 if (p2p_mvmvif && vifs->p2p_active && !vifs->bss_active && in iwl_mvm_power_set_pm()
681 !vifs->ap_active) { in iwl_mvm_power_set_pm()
682 p2p_mvmvif->pm_enabled = true; in iwl_mvm_power_set_pm()
686 if (p2p_mvmvif && bss_mvmvif && vifs->bss_active && vifs->p2p_active) in iwl_mvm_power_set_pm()
690 if (bss_mvmvif && ap_mvmvif && vifs->bss_active && vifs->ap_active) in iwl_mvm_power_set_pm()
694 /* clients are not stand alone: enable PM if DCM */ in iwl_mvm_power_set_pm()
696 if (bss_mvmvif && vifs->bss_active) in iwl_mvm_power_set_pm()
697 bss_mvmvif->pm_enabled = true; in iwl_mvm_power_set_pm()
698 if (p2p_mvmvif && vifs->p2p_active) in iwl_mvm_power_set_pm()
699 p2p_mvmvif->pm_enabled = true; in iwl_mvm_power_set_pm()
707 if (client_same_channel && !vifs->ap_active) { in iwl_mvm_power_set_pm()
709 bss_mvmvif->pm_enabled = true; in iwl_mvm_power_set_pm()
710 p2p_mvmvif->pm_enabled = true; in iwl_mvm_power_set_pm()
723 mutex_lock(&mvm->mutex); in iwl_mvm_power_mac_dbgfs_read()
724 memcpy(&cmd, &mvmvif->mac_pwr_cmd, sizeof(cmd)); in iwl_mvm_power_mac_dbgfs_read()
725 mutex_unlock(&mvm->mutex); in iwl_mvm_power_mac_dbgfs_read()
727 pos += scnprintf(buf+pos, bufsz-pos, "power_scheme = %d\n", in iwl_mvm_power_mac_dbgfs_read()
729 pos += scnprintf(buf+pos, bufsz-pos, "flags = 0x%x\n", in iwl_mvm_power_mac_dbgfs_read()
731 pos += scnprintf(buf+pos, bufsz-pos, "keep_alive = %d\n", in iwl_mvm_power_mac_dbgfs_read()
737 pos += scnprintf(buf+pos, bufsz-pos, "skip_over_dtim = %d\n", in iwl_mvm_power_mac_dbgfs_read()
740 pos += scnprintf(buf+pos, bufsz-pos, "skip_dtim_periods = %d\n", in iwl_mvm_power_mac_dbgfs_read()
743 pos += scnprintf(buf+pos, bufsz-pos, "rx_data_timeout = %d\n", in iwl_mvm_power_mac_dbgfs_read()
745 pos += scnprintf(buf+pos, bufsz-pos, "tx_data_timeout = %d\n", in iwl_mvm_power_mac_dbgfs_read()
749 pos += scnprintf(buf+pos, bufsz-pos, in iwl_mvm_power_mac_dbgfs_read()
756 pos += scnprintf(buf+pos, bufsz-pos, "rx_data_timeout_uapsd = %d\n", in iwl_mvm_power_mac_dbgfs_read()
758 pos += scnprintf(buf+pos, bufsz-pos, "tx_data_timeout_uapsd = %d\n", in iwl_mvm_power_mac_dbgfs_read()
760 pos += scnprintf(buf+pos, bufsz-pos, "qndp_tid = %d\n", cmd.qndp_tid); in iwl_mvm_power_mac_dbgfs_read()
761 pos += scnprintf(buf+pos, bufsz-pos, "uapsd_ac_flags = 0x%x\n", in iwl_mvm_power_mac_dbgfs_read()
763 pos += scnprintf(buf+pos, bufsz-pos, "uapsd_max_sp = %d\n", in iwl_mvm_power_mac_dbgfs_read()
765 pos += scnprintf(buf+pos, bufsz-pos, "heavy_tx_thld_packets = %d\n", in iwl_mvm_power_mac_dbgfs_read()
767 pos += scnprintf(buf+pos, bufsz-pos, "heavy_rx_thld_packets = %d\n", in iwl_mvm_power_mac_dbgfs_read()
769 pos += scnprintf(buf+pos, bufsz-pos, "heavy_tx_thld_percentage = %d\n", in iwl_mvm_power_mac_dbgfs_read()
771 pos += scnprintf(buf+pos, bufsz-pos, "heavy_rx_thld_percentage = %d\n", in iwl_mvm_power_mac_dbgfs_read()
773 pos += scnprintf(buf+pos, bufsz-pos, "uapsd_misbehaving_enable = %d\n", in iwl_mvm_power_mac_dbgfs_read()
781 pos += scnprintf(buf+pos, bufsz-pos, "snooze_interval = %d\n", in iwl_mvm_power_mac_dbgfs_read()
783 pos += scnprintf(buf+pos, bufsz-pos, "snooze_window = %d\n", in iwl_mvm_power_mac_dbgfs_read()
794 struct iwl_dbgfs_bf *dbgfs_bf = &mvmvif->dbgfs_bf; in iwl_mvm_beacon_filter_debugfs_parameters()
796 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_ENERGY_DELTA) in iwl_mvm_beacon_filter_debugfs_parameters()
797 cmd->bf_energy_delta = cpu_to_le32(dbgfs_bf->bf_energy_delta); in iwl_mvm_beacon_filter_debugfs_parameters()
798 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_ROAMING_ENERGY_DELTA) in iwl_mvm_beacon_filter_debugfs_parameters()
799 cmd->bf_roaming_energy_delta = in iwl_mvm_beacon_filter_debugfs_parameters()
800 cpu_to_le32(dbgfs_bf->bf_roaming_energy_delta); in iwl_mvm_beacon_filter_debugfs_parameters()
801 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_ROAMING_STATE) in iwl_mvm_beacon_filter_debugfs_parameters()
802 cmd->bf_roaming_state = cpu_to_le32(dbgfs_bf->bf_roaming_state); in iwl_mvm_beacon_filter_debugfs_parameters()
803 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_TEMP_THRESHOLD) in iwl_mvm_beacon_filter_debugfs_parameters()
804 cmd->bf_temp_threshold = in iwl_mvm_beacon_filter_debugfs_parameters()
805 cpu_to_le32(dbgfs_bf->bf_temp_threshold); in iwl_mvm_beacon_filter_debugfs_parameters()
806 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_TEMP_FAST_FILTER) in iwl_mvm_beacon_filter_debugfs_parameters()
807 cmd->bf_temp_fast_filter = in iwl_mvm_beacon_filter_debugfs_parameters()
808 cpu_to_le32(dbgfs_bf->bf_temp_fast_filter); in iwl_mvm_beacon_filter_debugfs_parameters()
809 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_TEMP_SLOW_FILTER) in iwl_mvm_beacon_filter_debugfs_parameters()
810 cmd->bf_temp_slow_filter = in iwl_mvm_beacon_filter_debugfs_parameters()
811 cpu_to_le32(dbgfs_bf->bf_temp_slow_filter); in iwl_mvm_beacon_filter_debugfs_parameters()
812 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_DEBUG_FLAG) in iwl_mvm_beacon_filter_debugfs_parameters()
813 cmd->bf_debug_flag = cpu_to_le32(dbgfs_bf->bf_debug_flag); in iwl_mvm_beacon_filter_debugfs_parameters()
814 if (dbgfs_bf->mask & MVM_DEBUGFS_BF_ESCAPE_TIMER) in iwl_mvm_beacon_filter_debugfs_parameters()
815 cmd->bf_escape_timer = cpu_to_le32(dbgfs_bf->bf_escape_timer); in iwl_mvm_beacon_filter_debugfs_parameters()
816 if (dbgfs_bf->mask & MVM_DEBUGFS_BA_ESCAPE_TIMER) in iwl_mvm_beacon_filter_debugfs_parameters()
817 cmd->ba_escape_timer = cpu_to_le32(dbgfs_bf->ba_escape_timer); in iwl_mvm_beacon_filter_debugfs_parameters()
818 if (dbgfs_bf->mask & MVM_DEBUGFS_BA_ENABLE_BEACON_ABORT) in iwl_mvm_beacon_filter_debugfs_parameters()
819 cmd->ba_enable_beacon_abort = in iwl_mvm_beacon_filter_debugfs_parameters()
820 cpu_to_le32(dbgfs_bf->ba_enable_beacon_abort); in iwl_mvm_beacon_filter_debugfs_parameters()
831 if (mvmvif != mvm->bf_allowed_vif || !vif->bss_conf.dtim_period || in _iwl_mvm_enable_beacon_filter()
832 vif->type != NL80211_IFTYPE_STATION || vif->p2p) in _iwl_mvm_enable_beacon_filter()
840 mvmvif->bf_enabled = true; in _iwl_mvm_enable_beacon_filter()
863 if (vif->type != NL80211_IFTYPE_STATION || vif->p2p) in _iwl_mvm_disable_beacon_filter()
869 mvmvif->bf_enabled = false; in _iwl_mvm_disable_beacon_filter()
888 ieee80211_iterate_active_interfaces_atomic(mvm->hw, in iwl_mvm_power_set_ps()
894 if (mvm->ps_disabled != disable_ps) { in iwl_mvm_power_set_ps()
895 bool old_ps_disabled = mvm->ps_disabled; in iwl_mvm_power_set_ps()
897 mvm->ps_disabled = disable_ps; in iwl_mvm_power_set_ps()
900 mvm->ps_disabled = old_ps_disabled; in iwl_mvm_power_set_ps()
917 if (!mvmvif->bf_enabled) in iwl_mvm_power_set_ba()
920 if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) in iwl_mvm_power_set_ba()
923 mvmvif->ba_enabled = !(!mvmvif->pm_enabled || in iwl_mvm_power_set_ba()
924 mvm->ps_disabled || in iwl_mvm_power_set_ba()
925 !vif->cfg.ps || in iwl_mvm_power_set_ba()
938 lockdep_assert_held(&mvm->mutex); in iwl_mvm_power_update_ps()
941 ieee80211_iterate_active_interfaces_atomic(mvm->hw, in iwl_mvm_power_update_ps()
962 lockdep_assert_held(&mvm->mutex); in iwl_mvm_power_update_mac()
965 ieee80211_iterate_active_interfaces_atomic(mvm->hw, in iwl_mvm_power_update_mac()