[PATCH] zd1211rw: Added workqueue
authorUlrich Kunitz <kune@deine-taler.de>
Wed, 13 Sep 2006 01:42:12 +0000 (02:42 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 25 Sep 2006 20:52:17 +0000 (16:52 -0400)
For housekeeping and watchdog tasks a workqueue is created. The
central workqueue is not used to prevent crashes creates by bugs.
It might be changed, when the housekeeping is stabilized.

Signed-off-by: Ulrich Kunitz <kune@deine-taler.de>
Signed-off-by: Daniel Drake <dsd@gentoo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/zd1211rw/zd_usb.c
drivers/net/wireless/zd1211rw/zd_usb.h

index 31027e52b04b1f17b27f17c1272a0c1c7ee105ba..5c265ad0485af0c08a46e706dfc6b16b25f6b562 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/errno.h>
 #include <linux/skbuff.h>
 #include <linux/usb.h>
+#include <linux/workqueue.h>
 #include <net/ieee80211.h>
 
 #include "zd_def.h"
@@ -1112,12 +1113,20 @@ static struct usb_driver driver = {
        .disconnect     = disconnect,
 };
 
+struct workqueue_struct *zd_workqueue;
+
 static int __init usb_init(void)
 {
        int r;
 
        pr_debug("usb_init()\n");
 
+       zd_workqueue = create_singlethread_workqueue(driver.name);
+       if (zd_workqueue == NULL) {
+               printk(KERN_ERR "%s: couldn't create workqueue\n", driver.name);
+               return -ENOMEM;
+       }
+
        r = usb_register(&driver);
        if (r) {
                printk(KERN_ERR "usb_register() failed. Error number %d\n", r);
@@ -1132,6 +1141,7 @@ static void __exit usb_exit(void)
 {
        pr_debug("usb_exit()\n");
        usb_deregister(&driver);
+       destroy_workqueue(zd_workqueue);
 }
 
 module_init(usb_init);
index ded39de5f72de55d0815d68ccdf8328c90f19e4f..e81a2d3cfffd2ad4dd166f0084031565aac9f524 100644 (file)
@@ -238,4 +238,6 @@ int zd_usb_iowrite16v(struct zd_usb *usb, const struct zd_ioreq16 *ioreqs,
 
 int zd_usb_rfwrite(struct zd_usb *usb, u32 value, u8 bits);
 
+extern struct workqueue_struct *zd_workqueue;
+
 #endif /* _ZD_USB_H */