From 9a6130485ec929a97eaef3f55aa40055a9c6b2b3 Mon Sep 17 00:00:00 2001 From: Alexander Bondar Date: Tue, 5 Mar 2013 12:54:00 +0200 Subject: [PATCH] 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: Alexander Bondar Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg --- drivers/net/wireless/iwlwifi/mvm/power.c | 26 +++++++++++------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/mvm/power.c b/drivers/net/wireless/iwlwifi/mvm/power.c index f66694c617e6..0c0771361951 100644 --- a/drivers/net/wireless/iwlwifi/mvm/power.c +++ b/drivers/net/wireless/iwlwifi/mvm/power.c @@ -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)); -- 2.30.2