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>
This commit is contained in:
Alexander Bondar 2013-03-05 14:01:27 +02:00 committed by Johannes Berg
parent 9a6130485e
commit e16cf7ec6f
2 changed files with 11 additions and 3 deletions

View File

@ -93,7 +93,9 @@ enum iwl_power_flags {
*
* @flags: Power table command flags from POWER_FLAGS_*
* @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
* PSM transition - legacy PM
* @tx_data_timeout: Minimum time (usec) from last Tx packet for AM to

View File

@ -86,6 +86,13 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
int keep_alive;
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) ||
!iwlwifi_mod_params.power_save)
return;
@ -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 */
dtimper_msec = dtimper * vif->bss_conf.beacon_int;
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);
cmd->keep_alive_seconds = keep_alive;
if (iwlmvm_mod_params.power_scheme == IWL_POWER_SCHEME_LP) {