Lines Matching defs:mvm

15 #include "mvm.h"
22 int iwl_mvm_beacon_filter_send_cmd(struct iwl_mvm *mvm,
27 IWL_DEBUG_POWER(mvm, "ba_enable_beacon_abort is: %d\n",
29 IWL_DEBUG_POWER(mvm, "ba_escape_timer is: %d\n",
31 IWL_DEBUG_POWER(mvm, "bf_debug_flag is: %d\n",
33 IWL_DEBUG_POWER(mvm, "bf_enable_beacon_filter is: %d\n",
35 IWL_DEBUG_POWER(mvm, "bf_energy_delta is: %d\n",
37 IWL_DEBUG_POWER(mvm, "bf_escape_timer is: %d\n",
39 IWL_DEBUG_POWER(mvm, "bf_roaming_energy_delta is: %d\n",
41 IWL_DEBUG_POWER(mvm, "bf_roaming_state is: %d\n",
43 IWL_DEBUG_POWER(mvm, "bf_temp_threshold is: %d\n",
45 IWL_DEBUG_POWER(mvm, "bf_temp_fast_filter is: %d\n",
47 IWL_DEBUG_POWER(mvm, "bf_temp_slow_filter is: %d\n",
49 IWL_DEBUG_POWER(mvm, "bf_threshold_absolute_low is: %d, %d\n",
53 IWL_DEBUG_POWER(mvm, "bf_threshold_absolute_high is: %d, %d\n",
57 if (fw_has_api(&mvm->fw->ucode_capa,
64 return iwl_mvm_send_cmd_pdu(mvm, REPLY_BEACON_FILTERING_CMD, 0,
69 void iwl_mvm_beacon_filter_set_cqm_params(struct iwl_mvm *mvm,
85 static void iwl_mvm_power_log(struct iwl_mvm *mvm,
88 IWL_DEBUG_POWER(mvm,
92 IWL_DEBUG_POWER(mvm, "Keep alive = %u sec\n",
96 IWL_DEBUG_POWER(mvm, "Disable power management\n");
100 IWL_DEBUG_POWER(mvm, "Rx timeout = %u usec\n",
102 IWL_DEBUG_POWER(mvm, "Tx timeout = %u usec\n",
105 IWL_DEBUG_POWER(mvm, "DTIM periods to skip = %u\n",
108 IWL_DEBUG_POWER(mvm, "LP RX RSSI threshold = %u\n",
111 IWL_DEBUG_POWER(mvm, "uAPSD enabled\n");
112 IWL_DEBUG_POWER(mvm, "Rx timeout (uAPSD) = %u usec\n",
114 IWL_DEBUG_POWER(mvm, "Tx timeout (uAPSD) = %u usec\n",
116 IWL_DEBUG_POWER(mvm, "QNDP TID = %d\n", cmd->qndp_tid);
117 IWL_DEBUG_POWER(mvm, "ACs flags = 0x%x\n", cmd->uapsd_ac_flags);
118 IWL_DEBUG_POWER(mvm, "Max SP = %d\n", cmd->uapsd_max_sp);
122 static void iwl_mvm_power_configure_uapsd(struct iwl_mvm *mvm,
130 if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status) ||
155 if (!test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status))
190 test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status) ?
195 cmd->uapsd_max_sp = mvm->hw->uapsd_max_sp_len;
234 static bool iwl_mvm_power_allow_uapsd(struct iwl_mvm *mvm,
256 if (iwl_mvm_phy_ctx_count(mvm) >= 2)
263 if (!iwl_mvm_is_p2p_scm_uapsd_supported(mvm))
266 ieee80211_iterate_active_interfaces_atomic(mvm->hw,
303 static void iwl_mvm_power_config_skip_dtim(struct iwl_mvm *mvm,
320 if (!test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) {
337 static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
362 if (mvm->ps_disabled)
371 (!fw_has_capa(&mvm->fw->ucode_capa,
385 iwl_mvm_power_config_skip_dtim(mvm, vif, cmd);
387 if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status)) {
393 fw_has_capa(&mvm->fw->ucode_capa,
406 if (iwl_mvm_power_allow_uapsd(mvm, vif))
407 iwl_mvm_power_configure_uapsd(mvm, vif, cmd);
455 static int iwl_mvm_power_send_cmd(struct iwl_mvm *mvm,
460 iwl_mvm_power_build_cmd(mvm, vif, &cmd);
461 iwl_mvm_power_log(mvm, &cmd);
466 return iwl_mvm_send_cmd_pdu(mvm, MAC_PM_POWER_TABLE, 0,
470 int iwl_mvm_power_update_device(struct iwl_mvm *mvm)
477 mvm->ps_disabled = true;
479 if (!mvm->ps_disabled)
483 if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status) ?
484 mvm->disable_power_off_d3 : mvm->disable_power_off)
488 if (mvm->ext_clock_valid)
491 if (iwl_fw_lookup_cmd_ver(mvm->fw, POWER_TABLE_CMD, 0) >= 7 &&
492 test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status))
496 IWL_DEBUG_POWER(mvm,
500 return iwl_mvm_send_cmd_pdu(mvm, POWER_TABLE_CMD, 0, sizeof(cmd),
504 void iwl_mvm_power_vif_assoc(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
537 void iwl_mvm_power_uapsd_misbehaving_ap_notif(struct iwl_mvm *mvm,
545 mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
550 struct iwl_mvm *mvm;
631 static void iwl_mvm_power_set_pm(struct iwl_mvm *mvm,
640 lockdep_assert_held(&mvm->mutex);
643 ieee80211_iterate_active_interfaces_atomic(mvm->hw,
658 if (iwl_mvm_tdls_sta_count(mvm, NULL))
704 int iwl_mvm_power_mac_dbgfs_read(struct iwl_mvm *mvm,
712 mutex_lock(&mvm->mutex);
714 mutex_unlock(&mvm->mutex);
813 static int _iwl_mvm_enable_beacon_filter(struct iwl_mvm *mvm,
820 if (mvmvif != mvm->bf_allowed_vif || !vif->bss_conf.dtim_period ||
824 iwl_mvm_beacon_filter_set_cqm_params(mvm, vif, cmd);
826 ret = iwl_mvm_beacon_filter_send_cmd(mvm, cmd);
834 int iwl_mvm_enable_beacon_filter(struct iwl_mvm *mvm,
842 return _iwl_mvm_enable_beacon_filter(mvm, vif, &cmd);
845 static int _iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm,
855 ret = iwl_mvm_beacon_filter_send_cmd(mvm, &cmd);
863 int iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm,
866 return _iwl_mvm_disable_beacon_filter(mvm, vif);
869 static int iwl_mvm_power_set_ps(struct iwl_mvm *mvm)
877 ieee80211_iterate_active_interfaces_atomic(mvm->hw,
883 if (mvm->ps_disabled != disable_ps) {
884 bool old_ps_disabled = mvm->ps_disabled;
886 mvm->ps_disabled = disable_ps;
887 ret = iwl_mvm_power_update_device(mvm);
889 mvm->ps_disabled = old_ps_disabled;
897 static int iwl_mvm_power_set_ba(struct iwl_mvm *mvm,
909 if (test_bit(IWL_MVM_STATUS_IN_D3, &mvm->status))
913 mvm->ps_disabled ||
917 return _iwl_mvm_enable_beacon_filter(mvm, vif, &cmd);
920 int iwl_mvm_power_update_ps(struct iwl_mvm *mvm)
923 .mvm = mvm,
927 lockdep_assert_held(&mvm->mutex);
930 ieee80211_iterate_active_interfaces_atomic(mvm->hw,
934 ret = iwl_mvm_power_set_ps(mvm);
939 return iwl_mvm_power_set_ba(mvm, vifs.bss_vif);
944 int iwl_mvm_power_update_mac(struct iwl_mvm *mvm)
947 .mvm = mvm,
951 lockdep_assert_held(&mvm->mutex);
954 ieee80211_iterate_active_interfaces_atomic(mvm->hw,
958 iwl_mvm_power_set_pm(mvm, &vifs);
960 ret = iwl_mvm_power_set_ps(mvm);
965 ret = iwl_mvm_power_send_cmd(mvm, vifs.bss_vif);
971 ret = iwl_mvm_power_send_cmd(mvm, vifs.p2p_vif);
977 return iwl_mvm_power_set_ba(mvm, vifs.bss_vif);