]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/wireless/core.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6
[mv-sheeva.git] / net / wireless / core.c
index fe6f402a22af0b404a5b11fbaf689430f4c7753b..c2a2c563d21af2456aa261838285b4c6a49db786 100644 (file)
@@ -45,6 +45,9 @@ DEFINE_MUTEX(cfg80211_mutex);
 /* for debugfs */
 static struct dentry *ieee80211_debugfs_dir;
 
+/* for the cleanup, scan and event works */
+struct workqueue_struct *cfg80211_wq;
+
 /* requires cfg80211_mutex to be held! */
 struct cfg80211_registered_device *cfg80211_rdev_by_wiphy_idx(int wiphy_idx)
 {
@@ -727,7 +730,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
                break;
        case NETDEV_DOWN:
                dev_hold(dev);
-               schedule_work(&wdev->cleanup_work);
+               queue_work(cfg80211_wq, &wdev->cleanup_work);
                break;
        case NETDEV_UP:
                /*
@@ -845,8 +848,14 @@ static int __init cfg80211_init(void)
        if (err)
                goto out_fail_reg;
 
+       cfg80211_wq = create_singlethread_workqueue("cfg80211");
+       if (!cfg80211_wq)
+               goto out_fail_wq;
+
        return 0;
 
+out_fail_wq:
+       regulatory_exit();
 out_fail_reg:
        debugfs_remove(ieee80211_debugfs_dir);
 out_fail_nl80211:
@@ -868,5 +877,6 @@ static void cfg80211_exit(void)
        wiphy_sysfs_exit();
        regulatory_exit();
        unregister_pernet_device(&cfg80211_pernet_ops);
+       destroy_workqueue(cfg80211_wq);
 }
 module_exit(cfg80211_exit);