iwlwifi: mvm: Adjust some power management constants
authorAlexander Bondar <alexander.bondar@intel.com>
Sun, 18 Aug 2013 13:22:52 +0000 (16:22 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 2 Oct 2013 16:00:35 +0000 (18:00 +0200)
Adjust the following:

- RX/TX AP-to-PSM timeout in case of uAPSD and PBW snoozing
- PSM-to-AM TX/RX heavy traffic thresholds
- Beacon abort escape timer for D3/D0i3

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/constants.h
drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
drivers/net/wireless/iwlwifi/mvm/power.c

index 2bf29f7..4b6d670 100644 (file)
@@ -70,7 +70,9 @@
 #define IWL_MVM_UAPSD_RX_DATA_TIMEOUT          (50 * USEC_PER_MSEC)
 #define IWL_MVM_UAPSD_TX_DATA_TIMEOUT          (50 * USEC_PER_MSEC)
 #define IWL_MVM_PS_HEAVY_TX_THLD_PACKETS       20
-#define IWL_MVM_PS_HEAVY_RX_THLD_PACKETS       20
+#define IWL_MVM_PS_HEAVY_RX_THLD_PACKETS       8
+#define IWL_MVM_PS_SNOOZE_HEAVY_TX_THLD_PACKETS        30
+#define IWL_MVM_PS_SNOOZE_HEAVY_RX_THLD_PACKETS        20
 #define IWL_MVM_PS_HEAVY_TX_THLD_PERCENT       50
 #define IWL_MVM_PS_HEAVY_RX_THLD_PERCENT       50
 #define IWL_MVM_PS_SNOOZE_INTERVAL             25
index 8e7ab41..eac7a68 100644 (file)
@@ -290,7 +290,7 @@ struct iwl_beacon_filter_cmd {
 #define IWL_BF_ESCAPE_TIMER_MIN 0
 
 #define IWL_BA_ESCAPE_TIMER_DEFAULT 6
-#define IWL_BA_ESCAPE_TIMER_D3 6
+#define IWL_BA_ESCAPE_TIMER_D3 9
 #define IWL_BA_ESCAPE_TIMER_MAX 1024
 #define IWL_BA_ESCAPE_TIMER_MIN 0
 
index 21407a3..3752ddd 100644 (file)
@@ -297,11 +297,6 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
        }
 
        if (cmd->flags & cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK)) {
-               cmd->rx_data_timeout_uapsd =
-                       cpu_to_le32(IWL_MVM_UAPSD_RX_DATA_TIMEOUT);
-               cmd->tx_data_timeout_uapsd =
-                       cpu_to_le32(IWL_MVM_UAPSD_TX_DATA_TIMEOUT);
-
                if (cmd->uapsd_ac_flags == (BIT(IEEE80211_AC_VO) |
                                            BIT(IEEE80211_AC_VI) |
                                            BIT(IEEE80211_AC_BE) |
@@ -316,10 +311,31 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
                }
 
                cmd->uapsd_max_sp = IWL_UAPSD_MAX_SP;
-               cmd->heavy_tx_thld_packets =
-                       IWL_MVM_PS_HEAVY_TX_THLD_PACKETS;
-               cmd->heavy_rx_thld_packets =
-                       IWL_MVM_PS_HEAVY_RX_THLD_PACKETS;
+
+               if (mvm->cur_ucode == IWL_UCODE_WOWLAN || cmd->flags &
+                   cpu_to_le16(POWER_FLAGS_SNOOZE_ENA_MSK)) {
+                       cmd->rx_data_timeout_uapsd =
+                               cpu_to_le32(IWL_MVM_WOWLAN_PS_RX_DATA_TIMEOUT);
+                       cmd->tx_data_timeout_uapsd =
+                               cpu_to_le32(IWL_MVM_WOWLAN_PS_TX_DATA_TIMEOUT);
+               } else {
+                       cmd->rx_data_timeout_uapsd =
+                               cpu_to_le32(IWL_MVM_UAPSD_RX_DATA_TIMEOUT);
+                       cmd->tx_data_timeout_uapsd =
+                               cpu_to_le32(IWL_MVM_UAPSD_TX_DATA_TIMEOUT);
+               }
+
+               if (cmd->flags & cpu_to_le16(POWER_FLAGS_SNOOZE_ENA_MSK)) {
+                       cmd->heavy_tx_thld_packets =
+                               IWL_MVM_PS_SNOOZE_HEAVY_TX_THLD_PACKETS;
+                       cmd->heavy_rx_thld_packets =
+                               IWL_MVM_PS_SNOOZE_HEAVY_RX_THLD_PACKETS;
+               } else {
+                       cmd->heavy_tx_thld_packets =
+                               IWL_MVM_PS_HEAVY_TX_THLD_PACKETS;
+                       cmd->heavy_rx_thld_packets =
+                               IWL_MVM_PS_HEAVY_RX_THLD_PACKETS;
+               }
                cmd->heavy_tx_thld_percentage =
                        IWL_MVM_PS_HEAVY_TX_THLD_PERCENT;
                cmd->heavy_rx_thld_percentage =