Adding support for MOXA ART SoC. Testing port of linux-2.6.32.60-moxart.
[linux-3.6.7-moxart.git] / drivers / usb / serial / kobil_sct.c
bloba579fdc2152e681214836fb1aa18e6db40d53340
1 /*
2 * KOBIL USB Smart Card Terminal Driver
4 * Copyright (C) 2002 KOBIL Systems GmbH
5 * Author: Thomas Wahrenbruch
7 * Contact: linuxusb@kobil.de
9 * This program is largely derived from work by the linux-usb group
10 * and associated source files. Please see the usb/serial files for
11 * individual credits and copyrights.
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * Thanks to Greg Kroah-Hartman (greg@kroah.com) for his help and
19 * patience.
21 * Supported readers: USB TWIN, KAAN Standard Plus and SecOVID Reader Plus
22 * (Adapter K), B1 Professional and KAAN Professional (Adapter B)
26 #include <linux/kernel.h>
27 #include <linux/errno.h>
28 #include <linux/init.h>
29 #include <linux/slab.h>
30 #include <linux/tty.h>
31 #include <linux/tty_driver.h>
32 #include <linux/tty_flip.h>
33 #include <linux/module.h>
34 #include <linux/spinlock.h>
35 #include <linux/uaccess.h>
36 #include <linux/usb.h>
37 #include <linux/usb/serial.h>
38 #include <linux/ioctl.h>
39 #include "kobil_sct.h"
41 static bool debug;
43 /* Version Information */
44 #define DRIVER_VERSION "21/05/2004"
45 #define DRIVER_AUTHOR "KOBIL Systems GmbH - http://www.kobil.com"
46 #define DRIVER_DESC "KOBIL USB Smart Card Terminal Driver (experimental)"
48 #define KOBIL_VENDOR_ID 0x0D46
49 #define KOBIL_ADAPTER_B_PRODUCT_ID 0x2011
50 #define KOBIL_ADAPTER_K_PRODUCT_ID 0x2012
51 #define KOBIL_USBTWIN_PRODUCT_ID 0x0078
52 #define KOBIL_KAAN_SIM_PRODUCT_ID 0x0081
54 #define KOBIL_TIMEOUT 500
55 #define KOBIL_BUF_LENGTH 300
58 /* Function prototypes */
59 static int kobil_port_probe(struct usb_serial_port *probe);
60 static int kobil_port_remove(struct usb_serial_port *probe);
61 static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port);
62 static void kobil_close(struct usb_serial_port *port);
63 static int kobil_write(struct tty_struct *tty, struct usb_serial_port *port,
64 const unsigned char *buf, int count);
65 static int kobil_write_room(struct tty_struct *tty);
66 static int kobil_ioctl(struct tty_struct *tty,
67 unsigned int cmd, unsigned long arg);
68 static int kobil_tiocmget(struct tty_struct *tty);
69 static int kobil_tiocmset(struct tty_struct *tty,
70 unsigned int set, unsigned int clear);
71 static void kobil_read_int_callback(struct urb *urb);
72 static void kobil_write_callback(struct urb *purb);
73 static void kobil_set_termios(struct tty_struct *tty,
74 struct usb_serial_port *port, struct ktermios *old);
75 static void kobil_init_termios(struct tty_struct *tty);
77 static const struct usb_device_id id_table[] = {
78 { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_ADAPTER_B_PRODUCT_ID) },
79 { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_ADAPTER_K_PRODUCT_ID) },
80 { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_USBTWIN_PRODUCT_ID) },
81 { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_KAAN_SIM_PRODUCT_ID) },
82 { } /* Terminating entry */
84 MODULE_DEVICE_TABLE(usb, id_table);
86 static struct usb_serial_driver kobil_device = {
87 .driver = {
88 .owner = THIS_MODULE,
89 .name = "kobil",
91 .description = "KOBIL USB smart card terminal",
92 .id_table = id_table,
93 .num_ports = 1,
94 .port_probe = kobil_port_probe,
95 .port_remove = kobil_port_remove,
96 .ioctl = kobil_ioctl,
97 .set_termios = kobil_set_termios,
98 .init_termios = kobil_init_termios,
99 .tiocmget = kobil_tiocmget,
100 .tiocmset = kobil_tiocmset,
101 .open = kobil_open,
102 .close = kobil_close,
103 .write = kobil_write,
104 .write_room = kobil_write_room,
105 .read_int_callback = kobil_read_int_callback,
108 static struct usb_serial_driver * const serial_drivers[] = {
109 &kobil_device, NULL
112 struct kobil_private {
113 int write_int_endpoint_address;
114 int read_int_endpoint_address;
115 unsigned char buf[KOBIL_BUF_LENGTH]; /* buffer for the APDU to send */
116 int filled; /* index of the last char in buf */
117 int cur_pos; /* index of the next char to send in buf */
118 __u16 device_type;
122 static int kobil_port_probe(struct usb_serial_port *port)
124 int i;
125 struct usb_serial *serial = port->serial;
126 struct kobil_private *priv;
127 struct usb_device *pdev;
128 struct usb_host_config *actconfig;
129 struct usb_interface *interface;
130 struct usb_host_interface *altsetting;
131 struct usb_host_endpoint *endpoint;
133 priv = kmalloc(sizeof(struct kobil_private), GFP_KERNEL);
134 if (!priv)
135 return -ENOMEM;
137 priv->filled = 0;
138 priv->cur_pos = 0;
139 priv->device_type = le16_to_cpu(serial->dev->descriptor.idProduct);
141 switch (priv->device_type) {
142 case KOBIL_ADAPTER_B_PRODUCT_ID:
143 printk(KERN_DEBUG "KOBIL B1 PRO / KAAN PRO detected\n");
144 break;
145 case KOBIL_ADAPTER_K_PRODUCT_ID:
146 printk(KERN_DEBUG
147 "KOBIL KAAN Standard Plus / SecOVID Reader Plus detected\n");
148 break;
149 case KOBIL_USBTWIN_PRODUCT_ID:
150 printk(KERN_DEBUG "KOBIL USBTWIN detected\n");
151 break;
152 case KOBIL_KAAN_SIM_PRODUCT_ID:
153 printk(KERN_DEBUG "KOBIL KAAN SIM detected\n");
154 break;
156 usb_set_serial_port_data(port, priv);
158 /* search for the necessary endpoints */
159 pdev = serial->dev;
160 actconfig = pdev->actconfig;
161 interface = actconfig->interface[0];
162 altsetting = interface->cur_altsetting;
163 endpoint = altsetting->endpoint;
165 for (i = 0; i < altsetting->desc.bNumEndpoints; i++) {
166 endpoint = &altsetting->endpoint[i];
167 if (usb_endpoint_is_int_out(&endpoint->desc)) {
168 dbg("%s Found interrupt out endpoint. Address: %d",
169 __func__, endpoint->desc.bEndpointAddress);
170 priv->write_int_endpoint_address =
171 endpoint->desc.bEndpointAddress;
173 if (usb_endpoint_is_int_in(&endpoint->desc)) {
174 dbg("%s Found interrupt in endpoint. Address: %d",
175 __func__, endpoint->desc.bEndpointAddress);
176 priv->read_int_endpoint_address =
177 endpoint->desc.bEndpointAddress;
180 return 0;
184 static int kobil_port_remove(struct usb_serial_port *port)
186 struct kobil_private *priv;
188 priv = usb_get_serial_port_data(port);
189 kfree(priv);
191 return 0;
194 static void kobil_init_termios(struct tty_struct *tty)
196 /* Default to echo off and other sane device settings */
197 tty->termios->c_lflag = 0;
198 tty->termios->c_lflag &= ~(ISIG | ICANON | ECHO | IEXTEN | XCASE);
199 tty->termios->c_iflag = IGNBRK | IGNPAR | IXOFF;
200 /* do NOT translate CR to CR-NL (0x0A -> 0x0A 0x0D) */
201 tty->termios->c_oflag &= ~ONLCR;
204 static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port)
206 int result = 0;
207 struct kobil_private *priv;
208 unsigned char *transfer_buffer;
209 int transfer_buffer_length = 8;
210 int write_urb_transfer_buffer_length = 8;
212 priv = usb_get_serial_port_data(port);
214 /* allocate memory for transfer buffer */
215 transfer_buffer = kzalloc(transfer_buffer_length, GFP_KERNEL);
216 if (!transfer_buffer)
217 return -ENOMEM;
219 /* allocate write_urb */
220 if (!port->write_urb) {
221 dbg("%s - port %d Allocating port->write_urb",
222 __func__, port->number);
223 port->write_urb = usb_alloc_urb(0, GFP_KERNEL);
224 if (!port->write_urb) {
225 dbg("%s - port %d usb_alloc_urb failed",
226 __func__, port->number);
227 kfree(transfer_buffer);
228 return -ENOMEM;
232 /* allocate memory for write_urb transfer buffer */
233 port->write_urb->transfer_buffer =
234 kmalloc(write_urb_transfer_buffer_length, GFP_KERNEL);
235 if (!port->write_urb->transfer_buffer) {
236 kfree(transfer_buffer);
237 usb_free_urb(port->write_urb);
238 port->write_urb = NULL;
239 return -ENOMEM;
242 /* get hardware version */
243 result = usb_control_msg(port->serial->dev,
244 usb_rcvctrlpipe(port->serial->dev, 0),
245 SUSBCRequest_GetMisc,
246 USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_IN,
247 SUSBCR_MSC_GetHWVersion,
249 transfer_buffer,
250 transfer_buffer_length,
251 KOBIL_TIMEOUT
253 dbg("%s - port %d Send get_HW_version URB returns: %i",
254 __func__, port->number, result);
255 dbg("Harware version: %i.%i.%i",
256 transfer_buffer[0], transfer_buffer[1], transfer_buffer[2]);
258 /* get firmware version */
259 result = usb_control_msg(port->serial->dev,
260 usb_rcvctrlpipe(port->serial->dev, 0),
261 SUSBCRequest_GetMisc,
262 USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_IN,
263 SUSBCR_MSC_GetFWVersion,
265 transfer_buffer,
266 transfer_buffer_length,
267 KOBIL_TIMEOUT
269 dbg("%s - port %d Send get_FW_version URB returns: %i",
270 __func__, port->number, result);
271 dbg("Firmware version: %i.%i.%i",
272 transfer_buffer[0], transfer_buffer[1], transfer_buffer[2]);
274 if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID ||
275 priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) {
276 /* Setting Baudrate, Parity and Stopbits */
277 result = usb_control_msg(port->serial->dev,
278 usb_rcvctrlpipe(port->serial->dev, 0),
279 SUSBCRequest_SetBaudRateParityAndStopBits,
280 USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
281 SUSBCR_SBR_9600 | SUSBCR_SPASB_EvenParity |
282 SUSBCR_SPASB_1StopBit,
284 transfer_buffer,
286 KOBIL_TIMEOUT
288 dbg("%s - port %d Send set_baudrate URB returns: %i",
289 __func__, port->number, result);
291 /* reset all queues */
292 result = usb_control_msg(port->serial->dev,
293 usb_rcvctrlpipe(port->serial->dev, 0),
294 SUSBCRequest_Misc,
295 USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
296 SUSBCR_MSC_ResetAllQueues,
298 transfer_buffer,
300 KOBIL_TIMEOUT
302 dbg("%s - port %d Send reset_all_queues URB returns: %i",
303 __func__, port->number, result);
305 if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID ||
306 priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID ||
307 priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) {
308 /* start reading (Adapter B 'cause PNP string) */
309 result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
310 dbg("%s - port %d Send read URB returns: %i",
311 __func__, port->number, result);
314 kfree(transfer_buffer);
315 return 0;
319 static void kobil_close(struct usb_serial_port *port)
321 /* FIXME: Add rts/dtr methods */
322 if (port->write_urb) {
323 usb_poison_urb(port->write_urb);
324 kfree(port->write_urb->transfer_buffer);
325 usb_free_urb(port->write_urb);
326 port->write_urb = NULL;
328 usb_kill_urb(port->interrupt_in_urb);
332 static void kobil_read_int_callback(struct urb *urb)
334 int result;
335 struct usb_serial_port *port = urb->context;
336 struct tty_struct *tty;
337 unsigned char *data = urb->transfer_buffer;
338 int status = urb->status;
339 /* char *dbg_data; */
341 if (status) {
342 dbg("%s - port %d Read int status not zero: %d",
343 __func__, port->number, status);
344 return;
347 tty = tty_port_tty_get(&port->port);
348 if (tty && urb->actual_length) {
350 /* BEGIN DEBUG */
352 dbg_data = kzalloc((3 * purb->actual_length + 10)
353 * sizeof(char), GFP_KERNEL);
354 if (! dbg_data) {
355 return;
357 for (i = 0; i < purb->actual_length; i++) {
358 sprintf(dbg_data +3*i, "%02X ", data[i]);
360 dbg(" <-- %s", dbg_data);
361 kfree(dbg_data);
363 /* END DEBUG */
365 tty_insert_flip_string(tty, data, urb->actual_length);
366 tty_flip_buffer_push(tty);
368 tty_kref_put(tty);
370 result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
371 dbg("%s - port %d Send read URB returns: %i",
372 __func__, port->number, result);
376 static void kobil_write_callback(struct urb *purb)
381 static int kobil_write(struct tty_struct *tty, struct usb_serial_port *port,
382 const unsigned char *buf, int count)
384 int length = 0;
385 int result = 0;
386 int todo = 0;
387 struct kobil_private *priv;
389 if (count == 0) {
390 dbg("%s - port %d write request of 0 bytes",
391 __func__, port->number);
392 return 0;
395 priv = usb_get_serial_port_data(port);
397 if (count > (KOBIL_BUF_LENGTH - priv->filled)) {
398 dbg("%s - port %d Error: write request bigger than buffer size", __func__, port->number);
399 return -ENOMEM;
402 /* Copy data to buffer */
403 memcpy(priv->buf + priv->filled, buf, count);
404 usb_serial_debug_data(debug, &port->dev, __func__, count,
405 priv->buf + priv->filled);
406 priv->filled = priv->filled + count;
408 /* only send complete block. TWIN, KAAN SIM and adapter K
409 use the same protocol. */
410 if (((priv->device_type != KOBIL_ADAPTER_B_PRODUCT_ID) && (priv->filled > 2) && (priv->filled >= (priv->buf[1] + 3))) ||
411 ((priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID) && (priv->filled > 3) && (priv->filled >= (priv->buf[2] + 4)))) {
412 /* stop reading (except TWIN and KAAN SIM) */
413 if ((priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID)
414 || (priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID))
415 usb_kill_urb(port->interrupt_in_urb);
417 todo = priv->filled - priv->cur_pos;
419 while (todo > 0) {
420 /* max 8 byte in one urb (endpoint size) */
421 length = (todo < 8) ? todo : 8;
422 /* copy data to transfer buffer */
423 memcpy(port->write_urb->transfer_buffer,
424 priv->buf + priv->cur_pos, length);
425 usb_fill_int_urb(port->write_urb,
426 port->serial->dev,
427 usb_sndintpipe(port->serial->dev,
428 priv->write_int_endpoint_address),
429 port->write_urb->transfer_buffer,
430 length,
431 kobil_write_callback,
432 port,
436 priv->cur_pos = priv->cur_pos + length;
437 result = usb_submit_urb(port->write_urb, GFP_NOIO);
438 dbg("%s - port %d Send write URB returns: %i",
439 __func__, port->number, result);
440 todo = priv->filled - priv->cur_pos;
442 if (todo > 0)
443 msleep(24);
446 priv->filled = 0;
447 priv->cur_pos = 0;
449 /* start reading (except TWIN and KAAN SIM) */
450 if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID ||
451 priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) {
452 result = usb_submit_urb(port->interrupt_in_urb,
453 GFP_NOIO);
454 dbg("%s - port %d Send read URB returns: %i",
455 __func__, port->number, result);
458 return count;
462 static int kobil_write_room(struct tty_struct *tty)
464 /* FIXME */
465 return 8;
469 static int kobil_tiocmget(struct tty_struct *tty)
471 struct usb_serial_port *port = tty->driver_data;
472 struct kobil_private *priv;
473 int result;
474 unsigned char *transfer_buffer;
475 int transfer_buffer_length = 8;
477 priv = usb_get_serial_port_data(port);
478 if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID
479 || priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) {
480 /* This device doesn't support ioctl calls */
481 return -EINVAL;
484 /* allocate memory for transfer buffer */
485 transfer_buffer = kzalloc(transfer_buffer_length, GFP_KERNEL);
486 if (!transfer_buffer)
487 return -ENOMEM;
489 result = usb_control_msg(port->serial->dev,
490 usb_rcvctrlpipe(port->serial->dev, 0),
491 SUSBCRequest_GetStatusLineState,
492 USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_IN,
495 transfer_buffer,
496 transfer_buffer_length,
497 KOBIL_TIMEOUT);
499 dbg("%s - port %d Send get_status_line_state URB returns: %i. Statusline: %02x",
500 __func__, port->number, result, transfer_buffer[0]);
502 result = 0;
503 if ((transfer_buffer[0] & SUSBCR_GSL_DSR) != 0)
504 result = TIOCM_DSR;
505 kfree(transfer_buffer);
506 return result;
509 static int kobil_tiocmset(struct tty_struct *tty,
510 unsigned int set, unsigned int clear)
512 struct usb_serial_port *port = tty->driver_data;
513 struct kobil_private *priv;
514 int result;
515 int dtr = 0;
516 int rts = 0;
517 unsigned char *transfer_buffer;
518 int transfer_buffer_length = 8;
520 /* FIXME: locking ? */
521 priv = usb_get_serial_port_data(port);
522 if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID
523 || priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) {
524 /* This device doesn't support ioctl calls */
525 return -EINVAL;
528 /* allocate memory for transfer buffer */
529 transfer_buffer = kzalloc(transfer_buffer_length, GFP_KERNEL);
530 if (!transfer_buffer)
531 return -ENOMEM;
533 if (set & TIOCM_RTS)
534 rts = 1;
535 if (set & TIOCM_DTR)
536 dtr = 1;
537 if (clear & TIOCM_RTS)
538 rts = 0;
539 if (clear & TIOCM_DTR)
540 dtr = 0;
542 if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID) {
543 if (dtr != 0)
544 dbg("%s - port %d Setting DTR",
545 __func__, port->number);
546 else
547 dbg("%s - port %d Clearing DTR",
548 __func__, port->number);
549 result = usb_control_msg(port->serial->dev,
550 usb_rcvctrlpipe(port->serial->dev, 0),
551 SUSBCRequest_SetStatusLinesOrQueues,
552 USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
553 ((dtr != 0) ? SUSBCR_SSL_SETDTR : SUSBCR_SSL_CLRDTR),
555 transfer_buffer,
557 KOBIL_TIMEOUT);
558 } else {
559 if (rts != 0)
560 dbg("%s - port %d Setting RTS",
561 __func__, port->number);
562 else
563 dbg("%s - port %d Clearing RTS",
564 __func__, port->number);
565 result = usb_control_msg(port->serial->dev,
566 usb_rcvctrlpipe(port->serial->dev, 0),
567 SUSBCRequest_SetStatusLinesOrQueues,
568 USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
569 ((rts != 0) ? SUSBCR_SSL_SETRTS : SUSBCR_SSL_CLRRTS),
571 transfer_buffer,
573 KOBIL_TIMEOUT);
575 dbg("%s - port %d Send set_status_line URB returns: %i",
576 __func__, port->number, result);
577 kfree(transfer_buffer);
578 return (result < 0) ? result : 0;
581 static void kobil_set_termios(struct tty_struct *tty,
582 struct usb_serial_port *port, struct ktermios *old)
584 struct kobil_private *priv;
585 int result;
586 unsigned short urb_val = 0;
587 int c_cflag = tty->termios->c_cflag;
588 speed_t speed;
590 priv = usb_get_serial_port_data(port);
591 if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID ||
592 priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) {
593 /* This device doesn't support ioctl calls */
594 *tty->termios = *old;
595 return;
598 speed = tty_get_baud_rate(tty);
599 switch (speed) {
600 case 1200:
601 urb_val = SUSBCR_SBR_1200;
602 break;
603 default:
604 speed = 9600;
605 case 9600:
606 urb_val = SUSBCR_SBR_9600;
607 break;
609 urb_val |= (c_cflag & CSTOPB) ? SUSBCR_SPASB_2StopBits :
610 SUSBCR_SPASB_1StopBit;
611 if (c_cflag & PARENB) {
612 if (c_cflag & PARODD)
613 urb_val |= SUSBCR_SPASB_OddParity;
614 else
615 urb_val |= SUSBCR_SPASB_EvenParity;
616 } else
617 urb_val |= SUSBCR_SPASB_NoParity;
618 tty->termios->c_cflag &= ~CMSPAR;
619 tty_encode_baud_rate(tty, speed, speed);
621 result = usb_control_msg(port->serial->dev,
622 usb_rcvctrlpipe(port->serial->dev, 0),
623 SUSBCRequest_SetBaudRateParityAndStopBits,
624 USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
625 urb_val,
627 NULL,
629 KOBIL_TIMEOUT
633 static int kobil_ioctl(struct tty_struct *tty,
634 unsigned int cmd, unsigned long arg)
636 struct usb_serial_port *port = tty->driver_data;
637 struct kobil_private *priv = usb_get_serial_port_data(port);
638 unsigned char *transfer_buffer;
639 int transfer_buffer_length = 8;
640 int result;
642 if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID ||
643 priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID)
644 /* This device doesn't support ioctl calls */
645 return -ENOIOCTLCMD;
647 switch (cmd) {
648 case TCFLSH:
649 transfer_buffer = kmalloc(transfer_buffer_length, GFP_KERNEL);
650 if (!transfer_buffer)
651 return -ENOBUFS;
653 result = usb_control_msg(port->serial->dev,
654 usb_rcvctrlpipe(port->serial->dev, 0),
655 SUSBCRequest_Misc,
656 USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
657 SUSBCR_MSC_ResetAllQueues,
659 NULL, /* transfer_buffer, */
661 KOBIL_TIMEOUT
664 dbg("%s - port %d Send reset_all_queues (FLUSH) URB returns: %i", __func__, port->number, result);
665 kfree(transfer_buffer);
666 return (result < 0) ? -EIO: 0;
667 default:
668 return -ENOIOCTLCMD;
672 module_usb_serial_driver(serial_drivers, id_table);
674 MODULE_AUTHOR(DRIVER_AUTHOR);
675 MODULE_DESCRIPTION(DRIVER_DESC);
676 MODULE_LICENSE("GPL");
678 module_param(debug, bool, S_IRUGO | S_IWUSR);
679 MODULE_PARM_DESC(debug, "Debug enabled or not");