iwlwifi: mvm: set keepalive period regardless of PM state
authorAlexander Bondar <alexander.bondar@intel.com>
Tue, 5 Mar 2013 12:01:27 +0000 (14:01 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 3 Apr 2013 20:49:16 +0000 (22:49 +0200)
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>
drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
drivers/net/wireless/iwlwifi/mvm/power.c

index 3440b56d6240e143ae7e9878d27636ac4b911779..81fe45f46be7e97f1d346ada8c457d065b9a377e 100644 (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
index 0c0771361951e7aa92667e855e492afc48373f76..6e7e06a2b9c1c2954a2141cfeaec88b4205ef95a 100644 (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) {