aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Bondar <alexander.bondar@intel.com>2013-03-05 07:01:27 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-04-03 16:49:16 -0400
commite16cf7ec6ffbcf96ef3c322b76ff90c2611254d9 (patch)
treea0b038df72154372cf42f301ccb3981c4ef31e35
parent9a6130485ec929a97eaef3f55aa40055a9c6b2b3 (diff)
iwlwifi: mvm: set keepalive period regardless of PM state
The firmware starts sending nulldata frames for keepalive immediately after association, regardless of power management state. The driver thus needs to configure keep alive period unconditionally. Signed-off-by: Alexander Bondar <alexander.bondar@intel.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/fw-api-power.h4
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/power.c10
2 files changed, 11 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
index 3440b56d6240..81fe45f46be7 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
@@ -93,7 +93,9 @@ enum iwl_power_flags {
93 * 93 *
94 * @flags: Power table command flags from POWER_FLAGS_* 94 * @flags: Power table command flags from POWER_FLAGS_*
95 * @keep_alive_seconds: Keep alive period in seconds. Default - 25 sec. 95 * @keep_alive_seconds: Keep alive period in seconds. Default - 25 sec.
96 * Minimum allowed:- 3 * DTIM 96 * Minimum allowed:- 3 * DTIM. Keep alive period must be
97 * set regardless of power scheme or current power state.
98 * FW use this value also when PM is disabled.
97 * @rx_data_timeout: Minimum time (usec) from last Rx packet for AM to 99 * @rx_data_timeout: Minimum time (usec) from last Rx packet for AM to
98 * PSM transition - legacy PM 100 * PSM transition - legacy PM
99 * @tx_data_timeout: Minimum time (usec) from last Tx packet for AM to 101 * @tx_data_timeout: Minimum time (usec) from last Tx packet for AM to
diff --git a/drivers/net/wireless/iwlwifi/mvm/power.c b/drivers/net/wireless/iwlwifi/mvm/power.c
index 0c0771361951..6e7e06a2b9c1 100644
--- a/drivers/net/wireless/iwlwifi/mvm/power.c
+++ b/drivers/net/wireless/iwlwifi/mvm/power.c
@@ -86,6 +86,13 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
86 int keep_alive; 86 int keep_alive;
87 bool radar_detect = false; 87 bool radar_detect = false;
88 88
89 /*
90 * Regardless of power management state the driver must set
91 * keep alive period. FW will use it for sending keep alive NDPs
92 * immediately after association.
93 */
94 cmd->keep_alive_seconds = POWER_KEEP_ALIVE_PERIOD_SEC;
95
89 if ((iwlmvm_mod_params.power_scheme == IWL_POWER_SCHEME_CAM) || 96 if ((iwlmvm_mod_params.power_scheme == IWL_POWER_SCHEME_CAM) ||
90 !iwlwifi_mod_params.power_save) 97 !iwlwifi_mod_params.power_save)
91 return; 98 return;
@@ -117,9 +124,8 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
117 /* Check that keep alive period is at least 3 * DTIM */ 124 /* Check that keep alive period is at least 3 * DTIM */
118 dtimper_msec = dtimper * vif->bss_conf.beacon_int; 125 dtimper_msec = dtimper * vif->bss_conf.beacon_int;
119 keep_alive = max_t(int, 3 * dtimper_msec, 126 keep_alive = max_t(int, 3 * dtimper_msec,
120 MSEC_PER_SEC * POWER_KEEP_ALIVE_PERIOD_SEC); 127 MSEC_PER_SEC * cmd->keep_alive_seconds);
121 keep_alive = DIV_ROUND_UP(keep_alive, MSEC_PER_SEC); 128 keep_alive = DIV_ROUND_UP(keep_alive, MSEC_PER_SEC);
122
123 cmd->keep_alive_seconds = keep_alive; 129 cmd->keep_alive_seconds = keep_alive;
124 130
125 if (iwlmvm_mod_params.power_scheme == IWL_POWER_SCHEME_LP) { 131 if (iwlmvm_mod_params.power_scheme == IWL_POWER_SCHEME_LP) {