ath10k: fix idle power consumption
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>
Mon, 18 May 2015 09:38:17 +0000 (09:38 +0000)
committerKalle Valo <kvalo@qca.qualcomm.com>
Fri, 22 May 2015 10:39:21 +0000 (13:39 +0300)
mac80211 can update vif powersave state while
disconnected. Firmware doesn't behave nicely and
consumes more power than necessary if PS is
disabled on a non-started vdev. Hence
force-enable PS for non-running vdevs.

This reduces power drain on QCA61X4 from 88mA to
36mA when interface is up and not associated.
QCA988X wasn't measured.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/mac.c

index eaa0182e001dedcfe3b61aa9fc720a549efa1864..2cc0cbadd379597925f22687aa4ba92af68c0c68 100644 (file)
@@ -1738,7 +1738,14 @@ static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif)
                enable_ps = false;
        }
 
-       if (enable_ps) {
+       if (!arvif->is_started) {
+               /* mac80211 can update vif powersave state while disconnected.
+                * Firmware doesn't behave nicely and consumes more power than
+                * necessary if PS is disabled on a non-started vdev. Hence
+                * force-enable PS for non-running vdevs.
+                */
+               psmode = WMI_STA_PS_MODE_ENABLED;
+       } else if (enable_ps) {
                psmode = WMI_STA_PS_MODE_ENABLED;
                param = WMI_STA_PS_PARAM_INACTIVITY_TIME;