rndis_wlan: stop workers on rndis_wlan_stop() and restore on rndis_wlan_reset()
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>
Thu, 30 Jul 2009 16:41:26 +0000 (19:41 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 4 Aug 2009 20:44:15 +0000 (16:44 -0400)
Driver doesn't need to poll statistics/link status when stopped.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rndis_wlan.c

index 76c5ec6bbbc5c86b24928d40f383d45843ca25a3..3c7c620c4f078fa9f457f777878ad83c7ddf97bf 100644 (file)
@@ -2457,9 +2457,6 @@ static int rndis_wlan_bind(struct usbnet *usbdev, struct usb_interface *intf)
        disassociate(usbdev, 1);
        netif_carrier_off(usbdev->net);
 
-       queue_delayed_work(priv->workqueue, &priv->stats_work,
-               round_jiffies_relative(STATS_UPDATE_JIFFIES));
-
        return 0;
 
 fail:
@@ -2499,15 +2496,33 @@ static void rndis_wlan_unbind(struct usbnet *usbdev, struct usb_interface *intf)
 
 static int rndis_wlan_reset(struct usbnet *usbdev)
 {
+       struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
+
        devdbg(usbdev, "rndis_wlan_reset");
+
+       queue_delayed_work(priv->workqueue, &priv->stats_work,
+               round_jiffies_relative(STATS_UPDATE_JIFFIES));
+
        return deauthenticate(usbdev);
 }
 
 
 static int rndis_wlan_stop(struct usbnet *usbdev)
 {
+       struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
+       int retval;
+
        devdbg(usbdev, "rndis_wlan_stop");
-       return disassociate(usbdev, 0);
+
+       retval = disassociate(usbdev, 0);
+
+       priv->work_pending = 0;
+       cancel_delayed_work_sync(&priv->stats_work);
+       cancel_delayed_work_sync(&priv->scan_work);
+       cancel_work_sync(&priv->work);
+       flush_workqueue(priv->workqueue);
+
+       return retval;
 }