These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / staging / vt6655 / power.c
index be3c4e9..06e6b9d 100644 (file)
@@ -157,10 +157,18 @@ PSbIsNextTBTTWakeUp(
        struct ieee80211_conf *conf = &hw->conf;
        bool bWakeUp = false;
 
-       if (conf->listen_interval == 1) {
-               /* Turn on wake up to listen next beacon */
-               MACvRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_LNBCN);
-               bWakeUp = true;
+       if (conf->listen_interval > 1) {
+               if (!pDevice->wake_up_count)
+                       pDevice->wake_up_count = conf->listen_interval;
+
+               --pDevice->wake_up_count;
+
+               if (pDevice->wake_up_count == 1) {
+                       /* Turn on wake up to listen next beacon */
+                       MACvRegBitsOn(pDevice->PortOffset,
+                                     MAC_REG_PSCTL, PSCTL_LNBCN);
+                       bWakeUp = true;
+               }
        }
 
        return bWakeUp;