Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a613048 authored by Alexander Bondar's avatar Alexander Bondar Committed by Johannes Berg
Browse files

iwlwifi: mvm: always send power table command



The driver distinguishes between power management and device's power
down enablement. Power management enablement depends both on driver's
module power parameters and mac80211 decision. The device's power down
depends only on driver's module power parameters. Change the driver to
always send Power Table command to enable or disable both power
management and device's power down.

Signed-off-by: default avatarAlexander Bondar <alexander.bondar@intel.com>
Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 7c1bf93f
Loading
Loading
Loading
Loading
+12 −14
Original line number Diff line number Diff line
@@ -86,12 +86,16 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
	int keep_alive;
	bool radar_detect = false;

	if ((!vif->bss_conf.ps) ||
	    (iwlmvm_mod_params.power_scheme == IWL_POWER_SCHEME_CAM))
	if ((iwlmvm_mod_params.power_scheme == IWL_POWER_SCHEME_CAM) ||
	    !iwlwifi_mod_params.power_save)
		return;

	cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK |
				  POWER_FLAGS_POWER_SAVE_ENA_MSK);
	cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_SAVE_ENA_MSK);

	if (!vif->bss_conf.ps)
		return;

	cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK);

	dtimper = hw->conf.ps_dtim_period ?: 1;

@@ -132,11 +136,6 @@ int iwl_mvm_power_update_mode(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
{
	struct iwl_powertable_cmd cmd = {};

	if (!iwlwifi_mod_params.power_save) {
		IWL_DEBUG_POWER(mvm, "Power management is not allowed\n");
		return 0;
	}

	if (vif->type != NL80211_IFTYPE_STATION || vif->p2p)
		return 0;

@@ -165,14 +164,13 @@ int iwl_mvm_power_disable(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
{
	struct iwl_powertable_cmd cmd = {};

	if (!iwlwifi_mod_params.power_save) {
		IWL_DEBUG_POWER(mvm, "Power management is not allowed\n");
		return 0;
	}

	if (vif->type != NL80211_IFTYPE_STATION || vif->p2p)
		return 0;

	if ((iwlmvm_mod_params.power_scheme != IWL_POWER_SCHEME_CAM) &&
	    iwlwifi_mod_params.power_save)
		cmd.flags |= cpu_to_le16(POWER_FLAGS_POWER_SAVE_ENA_MSK);

	IWL_DEBUG_POWER(mvm,
			"Sending power table command power level %d, flags = 0x%X\n",
			iwlmvm_mod_params.power_scheme, le16_to_cpu(cmd.flags));