kobil_sct.c 16 KB

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