1 // SPDX-License-Identifier: GPL-2.0+
3 * adutux - driver for ADU devices from Ontrak Control Systems
4 * This is an experimental driver. Use at your own risk.
5 * This driver is not supported by Ontrak Control Systems.
7 * Copyright (c) 2003 John Homppi (SCO, leave this notice here)
9 * derived from the Lego USB Tower driver 0.56:
10 * Copyright (c) 2003 David Glance <davidgsf@sourceforge.net>
11 * 2001 Juergen Stuber <stuber@loria.fr>
12 * that was derived from USB Skeleton driver - 0.5
13 * Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
17 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
19 #include <linux/kernel.h>
20 #include <linux/sched/signal.h>
21 #include <linux/errno.h>
22 #include <linux/slab.h>
23 #include <linux/module.h>
24 #include <linux/usb.h>
25 #include <linux/mutex.h>
26 #include <linux/uaccess.h>
28 #define DRIVER_AUTHOR "John Homppi"
29 #define DRIVER_DESC "adutux (see www.ontrak.net)"
31 /* Define these values to match your device */
32 #define ADU_VENDOR_ID 0x0a07
33 #define ADU_PRODUCT_ID 0x0064
35 /* table of devices that work with this driver */
36 static const struct usb_device_id device_table
[] = {
37 { USB_DEVICE(ADU_VENDOR_ID
, ADU_PRODUCT_ID
) }, /* ADU100 */
38 { USB_DEVICE(ADU_VENDOR_ID
, ADU_PRODUCT_ID
+20) }, /* ADU120 */
39 { USB_DEVICE(ADU_VENDOR_ID
, ADU_PRODUCT_ID
+30) }, /* ADU130 */
40 { USB_DEVICE(ADU_VENDOR_ID
, ADU_PRODUCT_ID
+100) }, /* ADU200 */
41 { USB_DEVICE(ADU_VENDOR_ID
, ADU_PRODUCT_ID
+108) }, /* ADU208 */
42 { USB_DEVICE(ADU_VENDOR_ID
, ADU_PRODUCT_ID
+118) }, /* ADU218 */
43 { } /* Terminating entry */
46 MODULE_DEVICE_TABLE(usb
, device_table
);
48 #ifdef CONFIG_USB_DYNAMIC_MINORS
49 #define ADU_MINOR_BASE 0
51 #define ADU_MINOR_BASE 67
54 /* we can have up to this number of device plugged in at once */
55 #define MAX_DEVICES 16
57 #define COMMAND_TIMEOUT (2*HZ) /* 60 second timeout for a command */
60 * The locking scheme is a vanilla 3-lock:
61 * adu_device.buflock: A spinlock, covers what IRQs touch.
62 * adutux_mutex: A Static lock to cover open_count. It would also cover
63 * any globals, but we don't have them in 2.6.
64 * adu_device.mtx: A mutex to hold across sleepers like copy_from_user.
65 * It covers all of adu_device, except the open_count
66 * and what .buflock covers.
69 /* Structure to hold all of our device specific stuff */
72 struct usb_device
*udev
; /* save off the usb device pointer */
73 struct usb_interface
*interface
;
74 unsigned int minor
; /* the starting minor number for this device */
75 char serial_number
[8];
77 int open_count
; /* number of times this port has been opened */
79 char *read_buffer_primary
;
80 int read_buffer_length
;
81 char *read_buffer_secondary
;
86 wait_queue_head_t read_wait
;
87 wait_queue_head_t write_wait
;
89 char *interrupt_in_buffer
;
90 struct usb_endpoint_descriptor
*interrupt_in_endpoint
;
91 struct urb
*interrupt_in_urb
;
92 int read_urb_finished
;
94 char *interrupt_out_buffer
;
95 struct usb_endpoint_descriptor
*interrupt_out_endpoint
;
96 struct urb
*interrupt_out_urb
;
100 static DEFINE_MUTEX(adutux_mutex
);
102 static struct usb_driver adu_driver
;
104 static inline void adu_debug_data(struct device
*dev
, const char *function
,
105 int size
, const unsigned char *data
)
107 dev_dbg(dev
, "%s - length = %d, data = %*ph\n",
108 function
, size
, size
, data
);
112 * adu_abort_transfers
113 * aborts transfers and frees associated data structures
115 static void adu_abort_transfers(struct adu_device
*dev
)
119 if (dev
->udev
== NULL
)
122 /* shutdown transfer */
124 /* XXX Anchor these instead */
125 spin_lock_irqsave(&dev
->buflock
, flags
);
126 if (!dev
->read_urb_finished
) {
127 spin_unlock_irqrestore(&dev
->buflock
, flags
);
128 usb_kill_urb(dev
->interrupt_in_urb
);
130 spin_unlock_irqrestore(&dev
->buflock
, flags
);
132 spin_lock_irqsave(&dev
->buflock
, flags
);
133 if (!dev
->out_urb_finished
) {
134 spin_unlock_irqrestore(&dev
->buflock
, flags
);
135 usb_kill_urb(dev
->interrupt_out_urb
);
137 spin_unlock_irqrestore(&dev
->buflock
, flags
);
140 static void adu_delete(struct adu_device
*dev
)
142 /* free data structures */
143 usb_free_urb(dev
->interrupt_in_urb
);
144 usb_free_urb(dev
->interrupt_out_urb
);
145 kfree(dev
->read_buffer_primary
);
146 kfree(dev
->read_buffer_secondary
);
147 kfree(dev
->interrupt_in_buffer
);
148 kfree(dev
->interrupt_out_buffer
);
152 static void adu_interrupt_in_callback(struct urb
*urb
)
154 struct adu_device
*dev
= urb
->context
;
155 int status
= urb
->status
;
157 adu_debug_data(&dev
->udev
->dev
, __func__
,
158 urb
->actual_length
, urb
->transfer_buffer
);
160 spin_lock(&dev
->buflock
);
163 if ((status
!= -ENOENT
) && (status
!= -ECONNRESET
) &&
164 (status
!= -ESHUTDOWN
)) {
165 dev_dbg(&dev
->udev
->dev
,
166 "%s : nonzero status received: %d\n",
172 if (urb
->actual_length
> 0 && dev
->interrupt_in_buffer
[0] != 0x00) {
173 if (dev
->read_buffer_length
<
174 (4 * usb_endpoint_maxp(dev
->interrupt_in_endpoint
)) -
175 (urb
->actual_length
)) {
176 memcpy (dev
->read_buffer_primary
+
177 dev
->read_buffer_length
,
178 dev
->interrupt_in_buffer
, urb
->actual_length
);
180 dev
->read_buffer_length
+= urb
->actual_length
;
181 dev_dbg(&dev
->udev
->dev
,"%s reading %d\n", __func__
,
184 dev_dbg(&dev
->udev
->dev
,"%s : read_buffer overflow\n",
190 dev
->read_urb_finished
= 1;
191 spin_unlock(&dev
->buflock
);
192 /* always wake up so we recover from errors */
193 wake_up_interruptible(&dev
->read_wait
);
196 static void adu_interrupt_out_callback(struct urb
*urb
)
198 struct adu_device
*dev
= urb
->context
;
199 int status
= urb
->status
;
201 adu_debug_data(&dev
->udev
->dev
, __func__
,
202 urb
->actual_length
, urb
->transfer_buffer
);
205 if ((status
!= -ENOENT
) &&
206 (status
!= -ECONNRESET
)) {
207 dev_dbg(&dev
->udev
->dev
,
208 "%s :nonzero status received: %d\n", __func__
,
214 spin_lock(&dev
->buflock
);
215 dev
->out_urb_finished
= 1;
216 wake_up(&dev
->write_wait
);
217 spin_unlock(&dev
->buflock
);
220 static int adu_open(struct inode
*inode
, struct file
*file
)
222 struct adu_device
*dev
= NULL
;
223 struct usb_interface
*interface
;
227 subminor
= iminor(inode
);
229 retval
= mutex_lock_interruptible(&adutux_mutex
);
233 interface
= usb_find_interface(&adu_driver
, subminor
);
235 pr_err("%s - error, can't find device for minor %d\n",
241 dev
= usb_get_intfdata(interface
);
242 if (!dev
|| !dev
->udev
) {
247 /* check that nobody else is using the device */
248 if (dev
->open_count
) {
254 dev_dbg(&dev
->udev
->dev
, "%s: open count %d\n", __func__
,
257 /* save device in the file's private structure */
258 file
->private_data
= dev
;
260 /* initialize in direction */
261 dev
->read_buffer_length
= 0;
263 /* fixup first read by having urb waiting for it */
264 usb_fill_int_urb(dev
->interrupt_in_urb
, dev
->udev
,
265 usb_rcvintpipe(dev
->udev
,
266 dev
->interrupt_in_endpoint
->bEndpointAddress
),
267 dev
->interrupt_in_buffer
,
268 usb_endpoint_maxp(dev
->interrupt_in_endpoint
),
269 adu_interrupt_in_callback
, dev
,
270 dev
->interrupt_in_endpoint
->bInterval
);
271 dev
->read_urb_finished
= 0;
272 if (usb_submit_urb(dev
->interrupt_in_urb
, GFP_KERNEL
))
273 dev
->read_urb_finished
= 1;
274 /* we ignore failure */
275 /* end of fixup for first read */
277 /* initialize out direction */
278 dev
->out_urb_finished
= 1;
283 mutex_unlock(&adutux_mutex
);
288 static void adu_release_internal(struct adu_device
*dev
)
290 /* decrement our usage count for the device */
292 dev_dbg(&dev
->udev
->dev
, "%s : open count %d\n", __func__
,
294 if (dev
->open_count
<= 0) {
295 adu_abort_transfers(dev
);
300 static int adu_release(struct inode
*inode
, struct file
*file
)
302 struct adu_device
*dev
;
310 dev
= file
->private_data
;
316 mutex_lock(&adutux_mutex
); /* not interruptible */
318 if (dev
->open_count
<= 0) {
319 dev_dbg(&dev
->udev
->dev
, "%s : device not opened\n", __func__
);
324 adu_release_internal(dev
);
325 if (dev
->udev
== NULL
) {
326 /* the device was unplugged before the file was released */
327 if (!dev
->open_count
) /* ... and we're the last user */
331 mutex_unlock(&adutux_mutex
);
336 static ssize_t
adu_read(struct file
*file
, __user
char *buffer
, size_t count
,
339 struct adu_device
*dev
;
340 size_t bytes_read
= 0;
341 size_t bytes_to_read
= count
;
345 int should_submit
= 0;
347 DECLARE_WAITQUEUE(wait
, current
);
349 dev
= file
->private_data
;
350 if (mutex_lock_interruptible(&dev
->mtx
))
353 /* verify that the device wasn't unplugged */
354 if (dev
->udev
== NULL
) {
356 pr_err("No device or device unplugged %d\n", retval
);
360 /* verify that some data was requested */
362 dev_dbg(&dev
->udev
->dev
, "%s : read request of 0 bytes\n",
367 timeout
= COMMAND_TIMEOUT
;
368 dev_dbg(&dev
->udev
->dev
, "%s : about to start looping\n", __func__
);
369 while (bytes_to_read
) {
370 int data_in_secondary
= dev
->secondary_tail
- dev
->secondary_head
;
371 dev_dbg(&dev
->udev
->dev
,
372 "%s : while, data_in_secondary=%d, status=%d\n",
373 __func__
, data_in_secondary
,
374 dev
->interrupt_in_urb
->status
);
376 if (data_in_secondary
) {
377 /* drain secondary buffer */
378 int amount
= bytes_to_read
< data_in_secondary
? bytes_to_read
: data_in_secondary
;
379 i
= copy_to_user(buffer
, dev
->read_buffer_secondary
+dev
->secondary_head
, amount
);
384 dev
->secondary_head
+= (amount
- i
);
385 bytes_read
+= (amount
- i
);
386 bytes_to_read
-= (amount
- i
);
388 /* we check the primary buffer */
389 spin_lock_irqsave (&dev
->buflock
, flags
);
390 if (dev
->read_buffer_length
) {
391 /* we secure access to the primary */
393 dev_dbg(&dev
->udev
->dev
,
394 "%s : swap, read_buffer_length = %d\n",
395 __func__
, dev
->read_buffer_length
);
396 tmp
= dev
->read_buffer_secondary
;
397 dev
->read_buffer_secondary
= dev
->read_buffer_primary
;
398 dev
->read_buffer_primary
= tmp
;
399 dev
->secondary_head
= 0;
400 dev
->secondary_tail
= dev
->read_buffer_length
;
401 dev
->read_buffer_length
= 0;
402 spin_unlock_irqrestore(&dev
->buflock
, flags
);
403 /* we have a free buffer so use it */
406 /* even the primary was empty - we may need to do IO */
407 if (!dev
->read_urb_finished
) {
408 /* somebody is doing IO */
409 spin_unlock_irqrestore(&dev
->buflock
, flags
);
410 dev_dbg(&dev
->udev
->dev
,
411 "%s : submitted already\n",
414 /* we must initiate input */
415 dev_dbg(&dev
->udev
->dev
,
416 "%s : initiate input\n",
418 dev
->read_urb_finished
= 0;
419 spin_unlock_irqrestore(&dev
->buflock
, flags
);
421 usb_fill_int_urb(dev
->interrupt_in_urb
, dev
->udev
,
422 usb_rcvintpipe(dev
->udev
,
423 dev
->interrupt_in_endpoint
->bEndpointAddress
),
424 dev
->interrupt_in_buffer
,
425 usb_endpoint_maxp(dev
->interrupt_in_endpoint
),
426 adu_interrupt_in_callback
,
428 dev
->interrupt_in_endpoint
->bInterval
);
429 retval
= usb_submit_urb(dev
->interrupt_in_urb
, GFP_KERNEL
);
431 dev
->read_urb_finished
= 1;
432 if (retval
== -ENOMEM
) {
433 retval
= bytes_read
? bytes_read
: -ENOMEM
;
435 dev_dbg(&dev
->udev
->dev
,
436 "%s : submit failed\n",
442 /* we wait for I/O to complete */
443 set_current_state(TASK_INTERRUPTIBLE
);
444 add_wait_queue(&dev
->read_wait
, &wait
);
445 spin_lock_irqsave(&dev
->buflock
, flags
);
446 if (!dev
->read_urb_finished
) {
447 spin_unlock_irqrestore(&dev
->buflock
, flags
);
448 timeout
= schedule_timeout(COMMAND_TIMEOUT
);
450 spin_unlock_irqrestore(&dev
->buflock
, flags
);
451 set_current_state(TASK_RUNNING
);
453 remove_wait_queue(&dev
->read_wait
, &wait
);
456 dev_dbg(&dev
->udev
->dev
,
457 "%s : timeout\n", __func__
);
458 retval
= bytes_read
? bytes_read
: -ETIMEDOUT
;
462 if (signal_pending(current
)) {
463 dev_dbg(&dev
->udev
->dev
,
464 "%s : signal pending\n",
466 retval
= bytes_read
? bytes_read
: -EINTR
;
474 /* if the primary buffer is empty then use it */
475 spin_lock_irqsave(&dev
->buflock
, flags
);
476 if (should_submit
&& dev
->read_urb_finished
) {
477 dev
->read_urb_finished
= 0;
478 spin_unlock_irqrestore(&dev
->buflock
, flags
);
479 usb_fill_int_urb(dev
->interrupt_in_urb
, dev
->udev
,
480 usb_rcvintpipe(dev
->udev
,
481 dev
->interrupt_in_endpoint
->bEndpointAddress
),
482 dev
->interrupt_in_buffer
,
483 usb_endpoint_maxp(dev
->interrupt_in_endpoint
),
484 adu_interrupt_in_callback
,
486 dev
->interrupt_in_endpoint
->bInterval
);
487 if (usb_submit_urb(dev
->interrupt_in_urb
, GFP_KERNEL
) != 0)
488 dev
->read_urb_finished
= 1;
489 /* we ignore failure */
491 spin_unlock_irqrestore(&dev
->buflock
, flags
);
495 /* unlock the device */
496 mutex_unlock(&dev
->mtx
);
501 static ssize_t
adu_write(struct file
*file
, const __user
char *buffer
,
502 size_t count
, loff_t
*ppos
)
504 DECLARE_WAITQUEUE(waita
, current
);
505 struct adu_device
*dev
;
506 size_t bytes_written
= 0;
507 size_t bytes_to_write
;
512 dev
= file
->private_data
;
514 retval
= mutex_lock_interruptible(&dev
->mtx
);
518 /* verify that the device wasn't unplugged */
519 if (dev
->udev
== NULL
) {
521 pr_err("No device or device unplugged %d\n", retval
);
525 /* verify that we actually have some data to write */
527 dev_dbg(&dev
->udev
->dev
, "%s : write request of 0 bytes\n",
533 add_wait_queue(&dev
->write_wait
, &waita
);
534 set_current_state(TASK_INTERRUPTIBLE
);
535 spin_lock_irqsave(&dev
->buflock
, flags
);
536 if (!dev
->out_urb_finished
) {
537 spin_unlock_irqrestore(&dev
->buflock
, flags
);
539 mutex_unlock(&dev
->mtx
);
540 if (signal_pending(current
)) {
541 dev_dbg(&dev
->udev
->dev
, "%s : interrupted\n",
543 set_current_state(TASK_RUNNING
);
547 if (schedule_timeout(COMMAND_TIMEOUT
) == 0) {
548 dev_dbg(&dev
->udev
->dev
,
549 "%s - command timed out.\n", __func__
);
553 remove_wait_queue(&dev
->write_wait
, &waita
);
554 retval
= mutex_lock_interruptible(&dev
->mtx
);
556 retval
= bytes_written
? bytes_written
: retval
;
560 dev_dbg(&dev
->udev
->dev
,
561 "%s : in progress, count = %zd\n",
564 spin_unlock_irqrestore(&dev
->buflock
, flags
);
565 set_current_state(TASK_RUNNING
);
566 remove_wait_queue(&dev
->write_wait
, &waita
);
567 dev_dbg(&dev
->udev
->dev
, "%s : sending, count = %zd\n",
570 /* write the data into interrupt_out_buffer from userspace */
571 buffer_size
= usb_endpoint_maxp(dev
->interrupt_out_endpoint
);
572 bytes_to_write
= count
> buffer_size
? buffer_size
: count
;
573 dev_dbg(&dev
->udev
->dev
,
574 "%s : buffer_size = %zd, count = %zd, bytes_to_write = %zd\n",
575 __func__
, buffer_size
, count
, bytes_to_write
);
577 if (copy_from_user(dev
->interrupt_out_buffer
, buffer
, bytes_to_write
) != 0) {
582 /* send off the urb */
584 dev
->interrupt_out_urb
,
586 usb_sndintpipe(dev
->udev
, dev
->interrupt_out_endpoint
->bEndpointAddress
),
587 dev
->interrupt_out_buffer
,
589 adu_interrupt_out_callback
,
591 dev
->interrupt_out_endpoint
->bInterval
);
592 dev
->interrupt_out_urb
->actual_length
= bytes_to_write
;
593 dev
->out_urb_finished
= 0;
594 retval
= usb_submit_urb(dev
->interrupt_out_urb
, GFP_KERNEL
);
596 dev
->out_urb_finished
= 1;
597 dev_err(&dev
->udev
->dev
, "Couldn't submit "
598 "interrupt_out_urb %d\n", retval
);
602 buffer
+= bytes_to_write
;
603 count
-= bytes_to_write
;
605 bytes_written
+= bytes_to_write
;
608 mutex_unlock(&dev
->mtx
);
609 return bytes_written
;
612 mutex_unlock(&dev
->mtx
);
617 remove_wait_queue(&dev
->write_wait
, &waita
);
621 /* file operations needed when we register this driver */
622 static const struct file_operations adu_fops
= {
623 .owner
= THIS_MODULE
,
627 .release
= adu_release
,
628 .llseek
= noop_llseek
,
632 * usb class driver info in order to get a minor number from the usb core,
633 * and to have the device registered with devfs and the driver core
635 static struct usb_class_driver adu_class
= {
636 .name
= "usb/adutux%d",
638 .minor_base
= ADU_MINOR_BASE
,
644 * Called by the usb core when a new device is connected that it thinks
645 * this driver might be interested in.
647 static int adu_probe(struct usb_interface
*interface
,
648 const struct usb_device_id
*id
)
650 struct usb_device
*udev
= interface_to_usbdev(interface
);
651 struct adu_device
*dev
= NULL
;
652 int retval
= -ENOMEM
;
657 /* allocate memory for our device state and initialize it */
658 dev
= kzalloc(sizeof(struct adu_device
), GFP_KERNEL
);
662 mutex_init(&dev
->mtx
);
663 spin_lock_init(&dev
->buflock
);
665 init_waitqueue_head(&dev
->read_wait
);
666 init_waitqueue_head(&dev
->write_wait
);
668 res
= usb_find_common_endpoints_reverse(&interface
->altsetting
[0],
670 &dev
->interrupt_in_endpoint
,
671 &dev
->interrupt_out_endpoint
);
673 dev_err(&interface
->dev
, "interrupt endpoints not found\n");
678 in_end_size
= usb_endpoint_maxp(dev
->interrupt_in_endpoint
);
679 out_end_size
= usb_endpoint_maxp(dev
->interrupt_out_endpoint
);
681 dev
->read_buffer_primary
= kmalloc((4 * in_end_size
), GFP_KERNEL
);
682 if (!dev
->read_buffer_primary
)
685 /* debug code prime the buffer */
686 memset(dev
->read_buffer_primary
, 'a', in_end_size
);
687 memset(dev
->read_buffer_primary
+ in_end_size
, 'b', in_end_size
);
688 memset(dev
->read_buffer_primary
+ (2 * in_end_size
), 'c', in_end_size
);
689 memset(dev
->read_buffer_primary
+ (3 * in_end_size
), 'd', in_end_size
);
691 dev
->read_buffer_secondary
= kmalloc((4 * in_end_size
), GFP_KERNEL
);
692 if (!dev
->read_buffer_secondary
)
695 /* debug code prime the buffer */
696 memset(dev
->read_buffer_secondary
, 'e', in_end_size
);
697 memset(dev
->read_buffer_secondary
+ in_end_size
, 'f', in_end_size
);
698 memset(dev
->read_buffer_secondary
+ (2 * in_end_size
), 'g', in_end_size
);
699 memset(dev
->read_buffer_secondary
+ (3 * in_end_size
), 'h', in_end_size
);
701 dev
->interrupt_in_buffer
= kmalloc(in_end_size
, GFP_KERNEL
);
702 if (!dev
->interrupt_in_buffer
)
705 /* debug code prime the buffer */
706 memset(dev
->interrupt_in_buffer
, 'i', in_end_size
);
708 dev
->interrupt_in_urb
= usb_alloc_urb(0, GFP_KERNEL
);
709 if (!dev
->interrupt_in_urb
)
711 dev
->interrupt_out_buffer
= kmalloc(out_end_size
, GFP_KERNEL
);
712 if (!dev
->interrupt_out_buffer
)
714 dev
->interrupt_out_urb
= usb_alloc_urb(0, GFP_KERNEL
);
715 if (!dev
->interrupt_out_urb
)
718 if (!usb_string(udev
, udev
->descriptor
.iSerialNumber
, dev
->serial_number
,
719 sizeof(dev
->serial_number
))) {
720 dev_err(&interface
->dev
, "Could not retrieve serial number\n");
724 dev_dbg(&interface
->dev
,"serial_number=%s", dev
->serial_number
);
726 /* we can register the device now, as it is ready */
727 usb_set_intfdata(interface
, dev
);
729 retval
= usb_register_dev(interface
, &adu_class
);
732 /* something prevented us from registering this driver */
733 dev_err(&interface
->dev
, "Not able to get a minor for this device.\n");
734 usb_set_intfdata(interface
, NULL
);
738 dev
->minor
= interface
->minor
;
740 /* let the user know what node this device is now attached to */
741 dev_info(&interface
->dev
, "ADU%d %s now attached to /dev/usb/adutux%d\n",
742 le16_to_cpu(udev
->descriptor
.idProduct
), dev
->serial_number
,
743 (dev
->minor
- ADU_MINOR_BASE
));
755 * Called by the usb core when the device is removed from the system.
757 static void adu_disconnect(struct usb_interface
*interface
)
759 struct adu_device
*dev
;
761 dev
= usb_get_intfdata(interface
);
763 mutex_lock(&dev
->mtx
); /* not interruptible */
764 dev
->udev
= NULL
; /* poison */
765 usb_deregister_dev(interface
, &adu_class
);
766 mutex_unlock(&dev
->mtx
);
768 mutex_lock(&adutux_mutex
);
769 usb_set_intfdata(interface
, NULL
);
771 /* if the device is not opened, then we clean up right now */
772 if (!dev
->open_count
)
775 mutex_unlock(&adutux_mutex
);
778 /* usb specific object needed to register this driver with the usb subsystem */
779 static struct usb_driver adu_driver
= {
782 .disconnect
= adu_disconnect
,
783 .id_table
= device_table
,
786 module_usb_driver(adu_driver
);
788 MODULE_AUTHOR(DRIVER_AUTHOR
);
789 MODULE_DESCRIPTION(DRIVER_DESC
);
790 MODULE_LICENSE("GPL");