Commit e16cf7ec authored by Alexander Bondar's avatar Alexander Bondar Committed by Johannes Berg

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: 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 9a613048
...@@ -93,7 +93,9 @@ enum iwl_power_flags { ...@@ -93,7 +93,9 @@ enum iwl_power_flags {
* *
* @flags: Power table command flags from POWER_FLAGS_* * @flags: Power table command flags from POWER_FLAGS_*
* @keep_alive_seconds: Keep alive period in seconds. Default - 25 sec. * @keep_alive_seconds: Keep alive period in seconds. Default - 25 sec.
* Minimum allowed:- 3 * DTIM * Minimum allowed:- 3 * DTIM. Keep alive period must be
* set regardless of power scheme or current power state.
* FW use this value also when PM is disabled.
* @rx_data_timeout: Minimum time (usec) from last Rx packet for AM to * @rx_data_timeout: Minimum time (usec) from last Rx packet for AM to
* PSM transition - legacy PM * PSM transition - legacy PM
* @tx_data_timeout: Minimum time (usec) from last Tx packet for AM to * @tx_data_timeout: Minimum time (usec) from last Tx packet for AM to
......
...@@ -86,6 +86,13 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, ...@@ -86,6 +86,13 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
int keep_alive; int keep_alive;
bool radar_detect = false; bool radar_detect = false;
/*
* Regardless of power management state the driver must set
* keep alive period. FW will use it for sending keep alive NDPs
* immediately after association.
*/
cmd->keep_alive_seconds = POWER_KEEP_ALIVE_PERIOD_SEC;
if ((iwlmvm_mod_params.power_scheme == IWL_POWER_SCHEME_CAM) || if ((iwlmvm_mod_params.power_scheme == IWL_POWER_SCHEME_CAM) ||
!iwlwifi_mod_params.power_save) !iwlwifi_mod_params.power_save)
return; return;
...@@ -117,9 +124,8 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, ...@@ -117,9 +124,8 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
/* Check that keep alive period is at least 3 * DTIM */ /* Check that keep alive period is at least 3 * DTIM */
dtimper_msec = dtimper * vif->bss_conf.beacon_int; dtimper_msec = dtimper * vif->bss_conf.beacon_int;
keep_alive = max_t(int, 3 * dtimper_msec, keep_alive = max_t(int, 3 * dtimper_msec,
MSEC_PER_SEC * POWER_KEEP_ALIVE_PERIOD_SEC); MSEC_PER_SEC * cmd->keep_alive_seconds);
keep_alive = DIV_ROUND_UP(keep_alive, MSEC_PER_SEC); keep_alive = DIV_ROUND_UP(keep_alive, MSEC_PER_SEC);
cmd->keep_alive_seconds = keep_alive; cmd->keep_alive_seconds = keep_alive;
if (iwlmvm_mod_params.power_scheme == IWL_POWER_SCHEME_LP) { if (iwlmvm_mod_params.power_scheme == IWL_POWER_SCHEME_LP) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment