mac80211: Cancel the dynamic ps timer in ioctl_siwpower.
authorVivek Natarajan <vivek.natraj@gmail.com>
Tue, 27 Jan 2009 13:56:28 +0000 (19:26 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 30 Jan 2009 18:38:28 +0000 (13:38 -0500)
If the dynamic power save timer has been started before the power save
is disabled using iwconfig, we fail to cancel the timer. Hence cancel it
while disabling power save.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/wext.c

index 70a29b657b61dab22b0ee203747d19dbadd48f4d..5c88b8246bbb0e0902052bb78baa80fed8cf9709 100644 (file)
@@ -906,6 +906,8 @@ static int ieee80211_ioctl_siwpower(struct net_device *dev,
                                        IEEE80211_CONF_CHANGE_PS);
                        if (local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK)
                                ieee80211_send_nullfunc(local, sdata, 0);
+                       del_timer_sync(&local->dynamic_ps_timer);
+                       cancel_work_sync(&local->dynamic_ps_enable_work);
                }
        }