aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rndis_wlan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rndis_wlan.c')
-rw-r--r--drivers/net/wireless/rndis_wlan.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index db91db77650..bebf735cd4b 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -2558,6 +2558,11 @@ static int rndis_wext_bind(struct usbnet *usbdev, struct usb_interface *intf)
2558 mutex_init(&priv->command_lock); 2558 mutex_init(&priv->command_lock);
2559 spin_lock_init(&priv->stats_lock); 2559 spin_lock_init(&priv->stats_lock);
2560 2560
2561 /* because rndis_command() sleeps we need to use workqueue */
2562 priv->workqueue = create_singlethread_workqueue("rndis_wlan");
2563 INIT_WORK(&priv->work, rndis_wext_worker);
2564 INIT_DELAYED_WORK(&priv->stats_work, rndis_update_wireless_stats);
2565
2561 /* try bind rndis_host */ 2566 /* try bind rndis_host */
2562 retval = generic_rndis_bind(usbdev, intf, FLAG_RNDIS_PHYM_WIRELESS); 2567 retval = generic_rndis_bind(usbdev, intf, FLAG_RNDIS_PHYM_WIRELESS);
2563 if (retval < 0) 2568 if (retval < 0)
@@ -2603,16 +2608,17 @@ static int rndis_wext_bind(struct usbnet *usbdev, struct usb_interface *intf)
2603 disassociate(usbdev, 1); 2608 disassociate(usbdev, 1);
2604 netif_carrier_off(usbdev->net); 2609 netif_carrier_off(usbdev->net);
2605 2610
2606 /* because rndis_command() sleeps we need to use workqueue */
2607 priv->workqueue = create_singlethread_workqueue("rndis_wlan");
2608 INIT_DELAYED_WORK(&priv->stats_work, rndis_update_wireless_stats);
2609 queue_delayed_work(priv->workqueue, &priv->stats_work, 2611 queue_delayed_work(priv->workqueue, &priv->stats_work,
2610 round_jiffies_relative(STATS_UPDATE_JIFFIES)); 2612 round_jiffies_relative(STATS_UPDATE_JIFFIES));
2611 INIT_WORK(&priv->work, rndis_wext_worker);
2612 2613
2613 return 0; 2614 return 0;
2614 2615
2615fail: 2616fail:
2617 cancel_delayed_work_sync(&priv->stats_work);
2618 cancel_work_sync(&priv->work);
2619 flush_workqueue(priv->workqueue);
2620 destroy_workqueue(priv->workqueue);
2621
2616 kfree(priv); 2622 kfree(priv);
2617 return retval; 2623 return retval;
2618} 2624}