mac80211: don't start the dynamic ps timer if not associated
authorLuciano Coelho <coelho@ti.com>
Tue, 3 May 2011 18:40:08 +0000 (21:40 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 10 May 2011 19:35:43 +0000 (15:35 -0400)
When we are disconnecting, we set PS off, but this happens before we
send the deauth/disassoc request.  When the deauth/disassoc frames are
sent, we trigger the dynamic ps timer, which then times out and turns
PS back on.  Thus, PS remains on after disconnecting, causing problems
when associating again.

This can be fixed by preventing the timer to start when we're not
associated anymore.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/tx.c

index ce4596ed1268ca9039298f7a05c280a9e3fca190..bd1224fd216aeb034278d6cc34f3c38287ac754c 100644 (file)
@@ -237,6 +237,10 @@ ieee80211_tx_h_dynamic_ps(struct ieee80211_tx_data *tx)
                                     &local->dynamic_ps_disable_work);
        }
 
+       /* Don't restart the timer if we're not disassociated */
+       if (!ifmgd->associated)
+               return TX_CONTINUE;
+
        mod_timer(&local->dynamic_ps_timer, jiffies +
                  msecs_to_jiffies(local->hw.conf.dynamic_ps_timeout));