kobil_sct.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * KOBIL USB Smart Card Terminal Driver
  4. *
  5. * Copyright (C) 2002 KOBIL Systems GmbH
  6. * Author: Thomas Wahrenbruch
  7. *
  8. * Contact: [email protected]
  9. *
  10. * This program is largely derived from work by the linux-usb group
  11. * and associated source files. Please see the usb/serial files for
  12. * individual credits and copyrights.
  13. *
  14. * Thanks to Greg Kroah-Hartman ([email protected]) for his help and
  15. * patience.
  16. *
  17. * Supported readers: USB TWIN, KAAN Standard Plus and SecOVID Reader Plus
  18. * (Adapter K), B1 Professional and KAAN Professional (Adapter B)
  19. */
  20. #include <linux/kernel.h>
  21. #include <linux/errno.h>
  22. #include <linux/slab.h>
  23. #include <linux/tty.h>
  24. #include <linux/tty_driver.h>
  25. #include <linux/tty_flip.h>
  26. #include <linux/module.h>
  27. #include <linux/spinlock.h>
  28. #include <linux/uaccess.h>
  29. #include <linux/usb.h>
  30. #include <linux/usb/serial.h>
  31. #include <linux/ioctl.h>
  32. #include "kobil_sct.h"
  33. #define DRIVER_AUTHOR "KOBIL Systems GmbH - http://www.kobil.com"
  34. #define DRIVER_DESC "KOBIL USB Smart Card Terminal Driver (experimental)"
  35. #define KOBIL_VENDOR_ID 0x0D46
  36. #define KOBIL_ADAPTER_B_PRODUCT_ID 0x2011
  37. #define KOBIL_ADAPTER_K_PRODUCT_ID 0x2012
  38. #define KOBIL_USBTWIN_PRODUCT_ID 0x0078
  39. #define KOBIL_KAAN_SIM_PRODUCT_ID 0x0081
  40. #define KOBIL_TIMEOUT 500
  41. #define KOBIL_BUF_LENGTH 300
  42. /* Function prototypes */
  43. static int kobil_port_probe(struct usb_serial_port *probe);
  44. static void kobil_port_remove(struct usb_serial_port *probe);
  45. static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port);
  46. static void kobil_close(struct usb_serial_port *port);
  47. static int kobil_write(struct tty_struct *tty, struct usb_serial_port *port,
  48. const unsigned char *buf, int count);
  49. static unsigned int kobil_write_room(struct tty_struct *tty);
  50. static int kobil_ioctl(struct tty_struct *tty,
  51. unsigned int cmd, unsigned long arg);
  52. static int kobil_tiocmget(struct tty_struct *tty);
  53. static int kobil_tiocmset(struct tty_struct *tty,
  54. unsigned int set, unsigned int clear);
  55. static void kobil_read_int_callback(struct urb *urb);
  56. static void kobil_write_int_callback(struct urb *urb);
  57. static void kobil_set_termios(struct tty_struct *tty,
  58. struct usb_serial_port *port,
  59. const struct ktermios *old);
  60. static void kobil_init_termios(struct tty_struct *tty);
  61. static const struct usb_device_id id_table[] = {
  62. { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_ADAPTER_B_PRODUCT_ID) },
  63. { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_ADAPTER_K_PRODUCT_ID) },
  64. { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_USBTWIN_PRODUCT_ID) },
  65. { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_KAAN_SIM_PRODUCT_ID) },
  66. { } /* Terminating entry */
  67. };
  68. MODULE_DEVICE_TABLE(usb, id_table);
  69. static struct usb_serial_driver kobil_device = {
  70. .driver = {
  71. .owner = THIS_MODULE,
  72. .name = "kobil",
  73. },
  74. .description = "KOBIL USB smart card terminal",
  75. .id_table = id_table,
  76. .num_ports = 1,
  77. .num_interrupt_out = 1,
  78. .port_probe = kobil_port_probe,
  79. .port_remove = kobil_port_remove,
  80. .ioctl = kobil_ioctl,
  81. .set_termios = kobil_set_termios,
  82. .init_termios = kobil_init_termios,
  83. .tiocmget = kobil_tiocmget,
  84. .tiocmset = kobil_tiocmset,
  85. .open = kobil_open,
  86. .close = kobil_close,
  87. .write = kobil_write,
  88. .write_room = kobil_write_room,
  89. .read_int_callback = kobil_read_int_callback,
  90. .write_int_callback = kobil_write_int_callback,
  91. };
  92. static struct usb_serial_driver * const serial_drivers[] = {
  93. &kobil_device, NULL
  94. };
  95. struct kobil_private {
  96. unsigned char buf[KOBIL_BUF_LENGTH]; /* buffer for the APDU to send */
  97. int filled; /* index of the last char in buf */
  98. int cur_pos; /* index of the next char to send in buf */
  99. __u16 device_type;
  100. };
  101. static int kobil_port_probe(struct usb_serial_port *port)
  102. {
  103. struct usb_serial *serial = port->serial;
  104. struct kobil_private *priv;
  105. priv = kmalloc(sizeof(struct kobil_private), GFP_KERNEL);
  106. if (!priv)
  107. return -ENOMEM;
  108. priv->filled = 0;
  109. priv->cur_pos = 0;
  110. priv->device_type = le16_to_cpu(serial->dev->descriptor.idProduct);
  111. switch (priv->device_type) {
  112. case KOBIL_ADAPTER_B_PRODUCT_ID:
  113. dev_dbg(&serial->dev->dev, "KOBIL B1 PRO / KAAN PRO detected\n");
  114. break;
  115. case KOBIL_ADAPTER_K_PRODUCT_ID:
  116. dev_dbg(&serial->dev->dev, "KOBIL KAAN Standard Plus / SecOVID Reader Plus detected\n");
  117. break;
  118. case KOBIL_USBTWIN_PRODUCT_ID:
  119. dev_dbg(&serial->dev->dev, "KOBIL USBTWIN detected\n");
  120. break;
  121. case KOBIL_KAAN_SIM_PRODUCT_ID:
  122. dev_dbg(&serial->dev->dev, "KOBIL KAAN SIM detected\n");
  123. break;
  124. }
  125. usb_set_serial_port_data(port, priv);
  126. return 0;
  127. }
  128. static void kobil_port_remove(struct usb_serial_port *port)
  129. {
  130. struct kobil_private *priv;
  131. priv = usb_get_serial_port_data(port);
  132. kfree(priv);
  133. }
  134. static void kobil_init_termios(struct tty_struct *tty)
  135. {
  136. /* Default to echo off and other sane device settings */
  137. tty->termios.c_lflag = 0;
  138. tty->termios.c_iflag &= ~(ISIG | ICANON | ECHO | IEXTEN | XCASE);
  139. tty->termios.c_iflag |= IGNBRK | IGNPAR | IXOFF;
  140. /* do NOT translate CR to CR-NL (0x0A -> 0x0A 0x0D) */
  141. tty->termios.c_oflag &= ~ONLCR;
  142. }
  143. static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port)
  144. {
  145. struct device *dev = &port->dev;
  146. int result = 0;
  147. struct kobil_private *priv;
  148. unsigned char *transfer_buffer;
  149. int transfer_buffer_length = 8;
  150. priv = usb_get_serial_port_data(port);
  151. /* allocate memory for transfer buffer */
  152. transfer_buffer = kzalloc(transfer_buffer_length, GFP_KERNEL);
  153. if (!transfer_buffer)
  154. return -ENOMEM;
  155. /* get hardware version */
  156. result = usb_control_msg(port->serial->dev,
  157. usb_rcvctrlpipe(port->serial->dev, 0),
  158. SUSBCRequest_GetMisc,
  159. USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_IN,
  160. SUSBCR_MSC_GetHWVersion,
  161. 0,
  162. transfer_buffer,
  163. transfer_buffer_length,
  164. KOBIL_TIMEOUT
  165. );
  166. dev_dbg(dev, "%s - Send get_HW_version URB returns: %i\n", __func__, result);
  167. if (result >= 3) {
  168. dev_dbg(dev, "Hardware version: %i.%i.%i\n", transfer_buffer[0],
  169. transfer_buffer[1], transfer_buffer[2]);
  170. }
  171. /* get firmware version */
  172. result = usb_control_msg(port->serial->dev,
  173. usb_rcvctrlpipe(port->serial->dev, 0),
  174. SUSBCRequest_GetMisc,
  175. USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_IN,
  176. SUSBCR_MSC_GetFWVersion,
  177. 0,
  178. transfer_buffer,
  179. transfer_buffer_length,
  180. KOBIL_TIMEOUT
  181. );
  182. dev_dbg(dev, "%s - Send get_FW_version URB returns: %i\n", __func__, result);
  183. if (result >= 3) {
  184. dev_dbg(dev, "Firmware version: %i.%i.%i\n", transfer_buffer[0],
  185. transfer_buffer[1], transfer_buffer[2]);
  186. }
  187. if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID ||
  188. priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) {
  189. /* Setting Baudrate, Parity and Stopbits */
  190. result = usb_control_msg(port->serial->dev,
  191. usb_sndctrlpipe(port->serial->dev, 0),
  192. SUSBCRequest_SetBaudRateParityAndStopBits,
  193. USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
  194. SUSBCR_SBR_9600 | SUSBCR_SPASB_EvenParity |
  195. SUSBCR_SPASB_1StopBit,
  196. 0,
  197. NULL,
  198. 0,
  199. KOBIL_TIMEOUT
  200. );
  201. dev_dbg(dev, "%s - Send set_baudrate URB returns: %i\n", __func__, result);
  202. /* reset all queues */
  203. result = usb_control_msg(port->serial->dev,
  204. usb_sndctrlpipe(port->serial->dev, 0),
  205. SUSBCRequest_Misc,
  206. USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
  207. SUSBCR_MSC_ResetAllQueues,
  208. 0,
  209. NULL,
  210. 0,
  211. KOBIL_TIMEOUT
  212. );
  213. dev_dbg(dev, "%s - Send reset_all_queues URB returns: %i\n", __func__, result);
  214. }
  215. if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID ||
  216. priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID ||
  217. priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) {
  218. /* start reading (Adapter B 'cause PNP string) */
  219. result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
  220. dev_dbg(dev, "%s - Send read URB returns: %i\n", __func__, result);
  221. }
  222. kfree(transfer_buffer);
  223. return 0;
  224. }
  225. static void kobil_close(struct usb_serial_port *port)
  226. {
  227. /* FIXME: Add rts/dtr methods */
  228. usb_kill_urb(port->interrupt_out_urb);
  229. usb_kill_urb(port->interrupt_in_urb);
  230. }
  231. static void kobil_read_int_callback(struct urb *urb)
  232. {
  233. int result;
  234. struct usb_serial_port *port = urb->context;
  235. unsigned char *data = urb->transfer_buffer;
  236. int status = urb->status;
  237. if (status) {
  238. dev_dbg(&port->dev, "%s - Read int status not zero: %d\n", __func__, status);
  239. return;
  240. }
  241. if (urb->actual_length) {
  242. usb_serial_debug_data(&port->dev, __func__, urb->actual_length,
  243. data);
  244. tty_insert_flip_string(&port->port, data, urb->actual_length);
  245. tty_flip_buffer_push(&port->port);
  246. }
  247. result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
  248. dev_dbg(&port->dev, "%s - Send read URB returns: %i\n", __func__, result);
  249. }
  250. static void kobil_write_int_callback(struct urb *urb)
  251. {
  252. }
  253. static int kobil_write(struct tty_struct *tty, struct usb_serial_port *port,
  254. const unsigned char *buf, int count)
  255. {
  256. int length = 0;
  257. int result = 0;
  258. int todo = 0;
  259. struct kobil_private *priv;
  260. if (count == 0) {
  261. dev_dbg(&port->dev, "%s - write request of 0 bytes\n", __func__);
  262. return 0;
  263. }
  264. priv = usb_get_serial_port_data(port);
  265. if (count > (KOBIL_BUF_LENGTH - priv->filled)) {
  266. dev_dbg(&port->dev, "%s - Error: write request bigger than buffer size\n", __func__);
  267. return -ENOMEM;
  268. }
  269. /* Copy data to buffer */
  270. memcpy(priv->buf + priv->filled, buf, count);
  271. usb_serial_debug_data(&port->dev, __func__, count, priv->buf + priv->filled);
  272. priv->filled = priv->filled + count;
  273. /* only send complete block. TWIN, KAAN SIM and adapter K
  274. use the same protocol. */
  275. if (((priv->device_type != KOBIL_ADAPTER_B_PRODUCT_ID) && (priv->filled > 2) && (priv->filled >= (priv->buf[1] + 3))) ||
  276. ((priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID) && (priv->filled > 3) && (priv->filled >= (priv->buf[2] + 4)))) {
  277. /* stop reading (except TWIN and KAAN SIM) */
  278. if ((priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID)
  279. || (priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID))
  280. usb_kill_urb(port->interrupt_in_urb);
  281. todo = priv->filled - priv->cur_pos;
  282. while (todo > 0) {
  283. /* max 8 byte in one urb (endpoint size) */
  284. length = min(todo, port->interrupt_out_size);
  285. /* copy data to transfer buffer */
  286. memcpy(port->interrupt_out_buffer,
  287. priv->buf + priv->cur_pos, length);
  288. port->interrupt_out_urb->transfer_buffer_length = length;
  289. priv->cur_pos = priv->cur_pos + length;
  290. result = usb_submit_urb(port->interrupt_out_urb,
  291. GFP_ATOMIC);
  292. dev_dbg(&port->dev, "%s - Send write URB returns: %i\n", __func__, result);
  293. todo = priv->filled - priv->cur_pos;
  294. if (todo > 0)
  295. msleep(24);
  296. }
  297. priv->filled = 0;
  298. priv->cur_pos = 0;
  299. /* start reading (except TWIN and KAAN SIM) */
  300. if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID ||
  301. priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) {
  302. result = usb_submit_urb(port->interrupt_in_urb,
  303. GFP_ATOMIC);
  304. dev_dbg(&port->dev, "%s - Send read URB returns: %i\n", __func__, result);
  305. }
  306. }
  307. return count;
  308. }
  309. static unsigned int kobil_write_room(struct tty_struct *tty)
  310. {
  311. /* FIXME */
  312. return 8;
  313. }
  314. static int kobil_tiocmget(struct tty_struct *tty)
  315. {
  316. struct usb_serial_port *port = tty->driver_data;
  317. struct kobil_private *priv;
  318. int result;
  319. unsigned char *transfer_buffer;
  320. int transfer_buffer_length = 8;
  321. priv = usb_get_serial_port_data(port);
  322. if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID
  323. || priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) {
  324. /* This device doesn't support ioctl calls */
  325. return -EINVAL;
  326. }
  327. /* allocate memory for transfer buffer */
  328. transfer_buffer = kzalloc(transfer_buffer_length, GFP_KERNEL);
  329. if (!transfer_buffer)
  330. return -ENOMEM;
  331. result = usb_control_msg(port->serial->dev,
  332. usb_rcvctrlpipe(port->serial->dev, 0),
  333. SUSBCRequest_GetStatusLineState,
  334. USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_IN,
  335. 0,
  336. 0,
  337. transfer_buffer,
  338. transfer_buffer_length,
  339. KOBIL_TIMEOUT);
  340. dev_dbg(&port->dev, "Send get_status_line_state URB returns: %i\n",
  341. result);
  342. if (result < 1) {
  343. if (result >= 0)
  344. result = -EIO;
  345. goto out_free;
  346. }
  347. dev_dbg(&port->dev, "Statusline: %02x\n", transfer_buffer[0]);
  348. result = 0;
  349. if ((transfer_buffer[0] & SUSBCR_GSL_DSR) != 0)
  350. result = TIOCM_DSR;
  351. out_free:
  352. kfree(transfer_buffer);
  353. return result;
  354. }
  355. static int kobil_tiocmset(struct tty_struct *tty,
  356. unsigned int set, unsigned int clear)
  357. {
  358. struct usb_serial_port *port = tty->driver_data;
  359. struct device *dev = &port->dev;
  360. struct kobil_private *priv;
  361. int result;
  362. int dtr = 0;
  363. int rts = 0;
  364. /* FIXME: locking ? */
  365. priv = usb_get_serial_port_data(port);
  366. if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID
  367. || priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) {
  368. /* This device doesn't support ioctl calls */
  369. return -EINVAL;
  370. }
  371. if (set & TIOCM_RTS)
  372. rts = 1;
  373. if (set & TIOCM_DTR)
  374. dtr = 1;
  375. if (clear & TIOCM_RTS)
  376. rts = 0;
  377. if (clear & TIOCM_DTR)
  378. dtr = 0;
  379. if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID) {
  380. if (dtr != 0)
  381. dev_dbg(dev, "%s - Setting DTR\n", __func__);
  382. else
  383. dev_dbg(dev, "%s - Clearing DTR\n", __func__);
  384. result = usb_control_msg(port->serial->dev,
  385. usb_sndctrlpipe(port->serial->dev, 0),
  386. SUSBCRequest_SetStatusLinesOrQueues,
  387. USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
  388. ((dtr != 0) ? SUSBCR_SSL_SETDTR : SUSBCR_SSL_CLRDTR),
  389. 0,
  390. NULL,
  391. 0,
  392. KOBIL_TIMEOUT);
  393. } else {
  394. if (rts != 0)
  395. dev_dbg(dev, "%s - Setting RTS\n", __func__);
  396. else
  397. dev_dbg(dev, "%s - Clearing RTS\n", __func__);
  398. result = usb_control_msg(port->serial->dev,
  399. usb_sndctrlpipe(port->serial->dev, 0),
  400. SUSBCRequest_SetStatusLinesOrQueues,
  401. USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
  402. ((rts != 0) ? SUSBCR_SSL_SETRTS : SUSBCR_SSL_CLRRTS),
  403. 0,
  404. NULL,
  405. 0,
  406. KOBIL_TIMEOUT);
  407. }
  408. dev_dbg(dev, "%s - Send set_status_line URB returns: %i\n", __func__, result);
  409. return (result < 0) ? result : 0;
  410. }
  411. static void kobil_set_termios(struct tty_struct *tty,
  412. struct usb_serial_port *port,
  413. const struct ktermios *old)
  414. {
  415. struct kobil_private *priv;
  416. int result;
  417. unsigned short urb_val = 0;
  418. int c_cflag = tty->termios.c_cflag;
  419. speed_t speed;
  420. priv = usb_get_serial_port_data(port);
  421. if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID ||
  422. priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID) {
  423. /* This device doesn't support ioctl calls */
  424. tty_termios_copy_hw(&tty->termios, old);
  425. return;
  426. }
  427. speed = tty_get_baud_rate(tty);
  428. switch (speed) {
  429. case 1200:
  430. urb_val = SUSBCR_SBR_1200;
  431. break;
  432. default:
  433. speed = 9600;
  434. fallthrough;
  435. case 9600:
  436. urb_val = SUSBCR_SBR_9600;
  437. break;
  438. }
  439. urb_val |= (c_cflag & CSTOPB) ? SUSBCR_SPASB_2StopBits :
  440. SUSBCR_SPASB_1StopBit;
  441. if (c_cflag & PARENB) {
  442. if (c_cflag & PARODD)
  443. urb_val |= SUSBCR_SPASB_OddParity;
  444. else
  445. urb_val |= SUSBCR_SPASB_EvenParity;
  446. } else
  447. urb_val |= SUSBCR_SPASB_NoParity;
  448. tty->termios.c_cflag &= ~CMSPAR;
  449. tty_encode_baud_rate(tty, speed, speed);
  450. result = usb_control_msg(port->serial->dev,
  451. usb_sndctrlpipe(port->serial->dev, 0),
  452. SUSBCRequest_SetBaudRateParityAndStopBits,
  453. USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
  454. urb_val,
  455. 0,
  456. NULL,
  457. 0,
  458. KOBIL_TIMEOUT
  459. );
  460. if (result) {
  461. dev_err(&port->dev, "failed to update line settings: %d\n",
  462. result);
  463. }
  464. }
  465. static int kobil_ioctl(struct tty_struct *tty,
  466. unsigned int cmd, unsigned long arg)
  467. {
  468. struct usb_serial_port *port = tty->driver_data;
  469. struct kobil_private *priv = usb_get_serial_port_data(port);
  470. int result;
  471. if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID ||
  472. priv->device_type == KOBIL_KAAN_SIM_PRODUCT_ID)
  473. /* This device doesn't support ioctl calls */
  474. return -ENOIOCTLCMD;
  475. switch (cmd) {
  476. case TCFLSH:
  477. result = usb_control_msg(port->serial->dev,
  478. usb_sndctrlpipe(port->serial->dev, 0),
  479. SUSBCRequest_Misc,
  480. USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT,
  481. SUSBCR_MSC_ResetAllQueues,
  482. 0,
  483. NULL,
  484. 0,
  485. KOBIL_TIMEOUT
  486. );
  487. dev_dbg(&port->dev,
  488. "%s - Send reset_all_queues (FLUSH) URB returns: %i\n",
  489. __func__, result);
  490. return (result < 0) ? -EIO: 0;
  491. default:
  492. return -ENOIOCTLCMD;
  493. }
  494. }
  495. module_usb_serial_driver(serial_drivers, id_table);
  496. MODULE_AUTHOR(DRIVER_AUTHOR);
  497. MODULE_DESCRIPTION(DRIVER_DESC);
  498. MODULE_LICENSE("GPL");