blob: caa0746326fd52cd30734078938a9b7031b96746 [file] [log] [blame]
Greg Kroah-Hartman5fd54ac2017-11-03 11:28:30 +01001// SPDX-License-Identifier: GPL-2.0
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -08002/*
3 * Opticon USB barcode to serial driver
4 *
Johan Hovold7a6ee2b2012-11-18 13:23:36 +01005 * Copyright (C) 2011 - 2012 Johan Hovold <jhovold@gmail.com>
Martin Jansen309a0572011-02-24 14:50:16 +01006 * Copyright (C) 2011 Martin Jansen <martin.jansen@opticon.com>
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -08007 * Copyright (C) 2008 - 2009 Greg Kroah-Hartman <gregkh@suse.de>
8 * Copyright (C) 2008 - 2009 Novell Inc.
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -08009 */
10
11#include <linux/kernel.h>
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -080012#include <linux/tty.h>
13#include <linux/tty_driver.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090014#include <linux/slab.h>
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -080015#include <linux/tty_flip.h>
Greg Kroah-Hartmanfaac64a2009-02-06 18:31:46 -080016#include <linux/serial.h>
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -080017#include <linux/module.h>
18#include <linux/usb.h>
19#include <linux/usb/serial.h>
20#include <linux/uaccess.h>
21
Martin Jansen309a0572011-02-24 14:50:16 +010022#define CONTROL_RTS 0x02
23#define RESEND_CTS_STATE 0x03
24
25/* max number of write urbs in flight */
26#define URB_UPPER_LIMIT 8
27
28/* This driver works for the Opticon 1D barcode reader
29 * an examples of 1D barcode types are EAN, UPC, Code39, IATA etc.. */
30#define DRIVER_DESC "Opticon USB barcode to serial driver (1D)"
31
Németh Márton7d40d7e2010-01-10 15:34:24 +010032static const struct usb_device_id id_table[] = {
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -080033 { USB_DEVICE(0x065a, 0x0009) },
34 { },
35};
36MODULE_DEVICE_TABLE(usb, id_table);
37
38/* This structure holds all of the individual device information */
39struct opticon_private {
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -080040 spinlock_t lock; /* protects the following flags */
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -080041 bool rts;
Martin Jansen309a0572011-02-24 14:50:16 +010042 bool cts;
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -080043 int outstanding_urbs;
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -080044};
45
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -080046
Johan Hovold32802072012-11-18 13:23:35 +010047static void opticon_process_data_packet(struct usb_serial_port *port,
48 const unsigned char *buf, size_t len)
49{
Jiri Slaby05c7cd32013-01-03 15:53:04 +010050 tty_insert_flip_string(&port->port, buf, len);
Jiri Slaby2e124b42013-01-03 15:53:06 +010051 tty_flip_buffer_push(&port->port);
Johan Hovold32802072012-11-18 13:23:35 +010052}
53
54static void opticon_process_status_packet(struct usb_serial_port *port,
55 const unsigned char *buf, size_t len)
56{
57 struct opticon_private *priv = usb_get_serial_port_data(port);
58 unsigned long flags;
59
60 spin_lock_irqsave(&priv->lock, flags);
61 if (buf[0] == 0x00)
62 priv->cts = false;
63 else
64 priv->cts = true;
65 spin_unlock_irqrestore(&priv->lock, flags);
66}
67
68static void opticon_process_read_urb(struct urb *urb)
69{
70 struct usb_serial_port *port = urb->context;
71 const unsigned char *hdr = urb->transfer_buffer;
72 const unsigned char *data = hdr + 2;
73 size_t data_len = urb->actual_length - 2;
74
75 if (urb->actual_length <= 2) {
76 dev_dbg(&port->dev, "malformed packet received: %d bytes\n",
77 urb->actual_length);
78 return;
79 }
80 /*
81 * Data from the device comes with a 2 byte header:
82 *
83 * <0x00><0x00>data...
84 * This is real data to be sent to the tty layer
85 * <0x00><0x01>level
86 * This is a CTS level change, the third byte is the CTS
87 * value (0 for low, 1 for high).
88 */
89 if ((hdr[0] == 0x00) && (hdr[1] == 0x00)) {
90 opticon_process_data_packet(port, data, data_len);
91 } else if ((hdr[0] == 0x00) && (hdr[1] == 0x01)) {
92 opticon_process_status_packet(port, data, data_len);
93 } else {
94 dev_dbg(&port->dev, "unknown packet received: %02x %02x\n",
95 hdr[0], hdr[1]);
96 }
97}
Martin Jansen309a0572011-02-24 14:50:16 +010098
Martin Jansen309a0572011-02-24 14:50:16 +010099static int send_control_msg(struct usb_serial_port *port, u8 requesttype,
100 u8 val)
101{
102 struct usb_serial *serial = port->serial;
103 int retval;
Johan Hovoldea0dbeb2012-10-25 10:29:11 +0200104 u8 *buffer;
105
106 buffer = kzalloc(1, GFP_KERNEL);
107 if (!buffer)
108 return -ENOMEM;
Martin Jansen309a0572011-02-24 14:50:16 +0100109
110 buffer[0] = val;
111 /* Send the message to the vendor control endpoint
112 * of the connected device */
113 retval = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
114 requesttype,
115 USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE,
116 0, 0, buffer, 1, 0);
Johan Hovoldea0dbeb2012-10-25 10:29:11 +0200117 kfree(buffer);
Martin Jansen309a0572011-02-24 14:50:16 +0100118
Johan Hovold94c51dc2013-03-21 12:37:42 +0100119 if (retval < 0)
120 return retval;
121
122 return 0;
Martin Jansen309a0572011-02-24 14:50:16 +0100123}
124
Alan Coxa509a7e2009-09-19 13:13:26 -0700125static int opticon_open(struct tty_struct *tty, struct usb_serial_port *port)
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800126{
Johan Hovold70d25ee2012-11-18 13:23:30 +0100127 struct opticon_private *priv = usb_get_serial_port_data(port);
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800128 unsigned long flags;
Johan Hovold7a6ee2b2012-11-18 13:23:36 +0100129 int res;
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800130
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800131 spin_lock_irqsave(&priv->lock, flags);
Martin Jansen309a0572011-02-24 14:50:16 +0100132 priv->rts = false;
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800133 spin_unlock_irqrestore(&priv->lock, flags);
134
Martin Jansen309a0572011-02-24 14:50:16 +0100135 /* Clear RTS line */
136 send_control_msg(port, CONTROL_RTS, 0);
137
Rahul Bedarkarcd8c5052014-01-02 19:29:24 +0530138 /* clear the halt status of the endpoint */
Johan Hovold7a6ee2b2012-11-18 13:23:36 +0100139 usb_clear_halt(port->serial->dev, port->read_urb->pipe);
Martin Jansen309a0572011-02-24 14:50:16 +0100140
Johan Hovold7a6ee2b2012-11-18 13:23:36 +0100141 res = usb_serial_generic_open(tty, port);
Johan Hovold2eee0502017-01-13 13:21:08 +0100142 if (res)
Johan Hovold7a6ee2b2012-11-18 13:23:36 +0100143 return res;
144
Martin Jansen309a0572011-02-24 14:50:16 +0100145 /* Request CTS line state, sometimes during opening the current
146 * CTS state can be missed. */
147 send_control_msg(port, RESEND_CTS_STATE, 1);
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800148
Johan Hovold7a6ee2b2012-11-18 13:23:36 +0100149 return res;
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800150}
151
Martin Jansen309a0572011-02-24 14:50:16 +0100152static void opticon_write_control_callback(struct urb *urb)
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800153{
Johan Hovolde32d82b2012-11-18 13:23:32 +0100154 struct usb_serial_port *port = urb->context;
155 struct opticon_private *priv = usb_get_serial_port_data(port);
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800156 int status = urb->status;
157 unsigned long flags;
158
159 /* free up the transfer buffer, as usb_free_urb() does not do this */
160 kfree(urb->transfer_buffer);
161
Alon Ziv0d930e52010-10-10 08:32:19 +0200162 /* setup packet may be set if we're using it for writing */
163 kfree(urb->setup_packet);
164
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800165 if (status)
Johan Hovolde32d82b2012-11-18 13:23:32 +0100166 dev_dbg(&port->dev,
Johan Hovolde29a7732012-11-18 13:23:23 +0100167 "%s - non-zero urb status received: %d\n",
Greg Kroah-Hartmand44d9ab2012-09-13 17:18:19 -0700168 __func__, status);
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800169
170 spin_lock_irqsave(&priv->lock, flags);
171 --priv->outstanding_urbs;
172 spin_unlock_irqrestore(&priv->lock, flags);
173
Johan Hovolde32d82b2012-11-18 13:23:32 +0100174 usb_serial_port_softint(port);
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800175}
176
177static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port,
178 const unsigned char *buf, int count)
179{
Johan Hovold70d25ee2012-11-18 13:23:30 +0100180 struct opticon_private *priv = usb_get_serial_port_data(port);
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800181 struct usb_serial *serial = port->serial;
182 struct urb *urb;
183 unsigned char *buffer;
184 unsigned long flags;
185 int status;
Martin Jansen309a0572011-02-24 14:50:16 +0100186 struct usb_ctrlrequest *dr;
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800187
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800188 spin_lock_irqsave(&priv->lock, flags);
189 if (priv->outstanding_urbs > URB_UPPER_LIMIT) {
190 spin_unlock_irqrestore(&priv->lock, flags);
Greg Kroah-Hartmand44d9ab2012-09-13 17:18:19 -0700191 dev_dbg(&port->dev, "%s - write limit hit\n", __func__);
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800192 return 0;
193 }
194 priv->outstanding_urbs++;
195 spin_unlock_irqrestore(&priv->lock, flags);
196
197 buffer = kmalloc(count, GFP_ATOMIC);
198 if (!buffer) {
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800199 count = -ENOMEM;
200 goto error_no_buffer;
201 }
202
203 urb = usb_alloc_urb(0, GFP_ATOMIC);
204 if (!urb) {
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800205 count = -ENOMEM;
206 goto error_no_urb;
207 }
208
209 memcpy(buffer, buf, count);
210
Greg Kroah-Hartman59d33f22012-09-18 09:58:57 +0100211 usb_serial_debug_data(&port->dev, __func__, count, buffer);
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800212
Rahul Bedarkarcd8c5052014-01-02 19:29:24 +0530213 /* The connected devices do not have a bulk write endpoint,
Martin Jansen309a0572011-02-24 14:50:16 +0100214 * to transmit data to de barcode device the control endpoint is used */
Johan Hovolde6812862014-10-29 09:07:31 +0100215 dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC);
Julia Lawallb0795bb2011-05-13 17:30:46 +0200216 if (!dr) {
Julia Lawallb0795bb2011-05-13 17:30:46 +0200217 count = -ENOMEM;
Johan Hovoldacbf0e52012-10-25 10:29:12 +0200218 goto error_no_dr;
Julia Lawallb0795bb2011-05-13 17:30:46 +0200219 }
Alon Ziv0d930e52010-10-10 08:32:19 +0200220
Martin Jansen309a0572011-02-24 14:50:16 +0100221 dr->bRequestType = USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT;
222 dr->bRequest = 0x01;
223 dr->wValue = 0;
224 dr->wIndex = 0;
225 dr->wLength = cpu_to_le16(count);
Alon Ziv0d930e52010-10-10 08:32:19 +0200226
Martin Jansen309a0572011-02-24 14:50:16 +0100227 usb_fill_control_urb(urb, serial->dev,
228 usb_sndctrlpipe(serial->dev, 0),
229 (unsigned char *)dr, buffer, count,
Johan Hovolde32d82b2012-11-18 13:23:32 +0100230 opticon_write_control_callback, port);
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800231
232 /* send it down the pipe */
233 status = usb_submit_urb(urb, GFP_ATOMIC);
234 if (status) {
235 dev_err(&port->dev,
Martin Jansen309a0572011-02-24 14:50:16 +0100236 "%s - usb_submit_urb(write endpoint) failed status = %d\n",
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800237 __func__, status);
238 count = status;
239 goto error;
240 }
241
242 /* we are done with this urb, so let the host driver
243 * really free it when it is finished with it */
244 usb_free_urb(urb);
245
246 return count;
247error:
Johan Hovoldacbf0e52012-10-25 10:29:12 +0200248 kfree(dr);
249error_no_dr:
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800250 usb_free_urb(urb);
251error_no_urb:
252 kfree(buffer);
253error_no_buffer:
254 spin_lock_irqsave(&priv->lock, flags);
255 --priv->outstanding_urbs;
256 spin_unlock_irqrestore(&priv->lock, flags);
257 return count;
258}
259
260static int opticon_write_room(struct tty_struct *tty)
261{
262 struct usb_serial_port *port = tty->driver_data;
Johan Hovold70d25ee2012-11-18 13:23:30 +0100263 struct opticon_private *priv = usb_get_serial_port_data(port);
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800264 unsigned long flags;
265
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800266 /*
267 * We really can take almost anything the user throws at us
268 * but let's pick a nice big number to tell the tty
269 * layer that we have lots of free space, unless we don't.
270 */
271 spin_lock_irqsave(&priv->lock, flags);
272 if (priv->outstanding_urbs > URB_UPPER_LIMIT * 2 / 3) {
273 spin_unlock_irqrestore(&priv->lock, flags);
Greg Kroah-Hartmand44d9ab2012-09-13 17:18:19 -0700274 dev_dbg(&port->dev, "%s - write limit hit\n", __func__);
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800275 return 0;
276 }
277 spin_unlock_irqrestore(&priv->lock, flags);
278
279 return 2048;
280}
281
Alan Cox60b33c12011-02-14 16:26:14 +0000282static int opticon_tiocmget(struct tty_struct *tty)
Greg Kroah-Hartmanfaac64a2009-02-06 18:31:46 -0800283{
284 struct usb_serial_port *port = tty->driver_data;
Johan Hovold70d25ee2012-11-18 13:23:30 +0100285 struct opticon_private *priv = usb_get_serial_port_data(port);
Greg Kroah-Hartmanfaac64a2009-02-06 18:31:46 -0800286 unsigned long flags;
287 int result = 0;
288
Greg Kroah-Hartmanfaac64a2009-02-06 18:31:46 -0800289 spin_lock_irqsave(&priv->lock, flags);
290 if (priv->rts)
Martin Jansen309a0572011-02-24 14:50:16 +0100291 result |= TIOCM_RTS;
292 if (priv->cts)
293 result |= TIOCM_CTS;
Greg Kroah-Hartmanfaac64a2009-02-06 18:31:46 -0800294 spin_unlock_irqrestore(&priv->lock, flags);
295
Greg Kroah-Hartmand44d9ab2012-09-13 17:18:19 -0700296 dev_dbg(&port->dev, "%s - %x\n", __func__, result);
Greg Kroah-Hartmanfaac64a2009-02-06 18:31:46 -0800297 return result;
298}
299
Randy Dunlap4acfaf82011-04-03 11:42:00 -0700300static int opticon_tiocmset(struct tty_struct *tty,
Martin Jansen309a0572011-02-24 14:50:16 +0100301 unsigned int set, unsigned int clear)
302{
303 struct usb_serial_port *port = tty->driver_data;
Johan Hovold70d25ee2012-11-18 13:23:30 +0100304 struct opticon_private *priv = usb_get_serial_port_data(port);
Martin Jansen309a0572011-02-24 14:50:16 +0100305 unsigned long flags;
306 bool rts;
307 bool changed = false;
Johan Hovold81d5a672012-04-25 15:56:29 +0200308 int ret;
Martin Jansen309a0572011-02-24 14:50:16 +0100309
Martin Jansen309a0572011-02-24 14:50:16 +0100310 /* We only support RTS so we only handle that */
311 spin_lock_irqsave(&priv->lock, flags);
312
313 rts = priv->rts;
314 if (set & TIOCM_RTS)
315 priv->rts = true;
316 if (clear & TIOCM_RTS)
317 priv->rts = false;
318 changed = rts ^ priv->rts;
319 spin_unlock_irqrestore(&priv->lock, flags);
320
321 if (!changed)
322 return 0;
323
Johan Hovold94bcef62013-03-21 12:37:43 +0100324 ret = send_control_msg(port, CONTROL_RTS, !rts);
325 if (ret)
326 return usb_translate_errors(ret);
Johan Hovold81d5a672012-04-25 15:56:29 +0200327
Johan Hovold94bcef62013-03-21 12:37:43 +0100328 return 0;
Martin Jansen309a0572011-02-24 14:50:16 +0100329}
330
Johan Hovold56be1a12012-11-18 13:23:31 +0100331static int get_serial_info(struct usb_serial_port *port,
Greg Kroah-Hartmanfaac64a2009-02-06 18:31:46 -0800332 struct serial_struct __user *serial)
333{
334 struct serial_struct tmp;
335
Greg Kroah-Hartmanfaac64a2009-02-06 18:31:46 -0800336 memset(&tmp, 0x00, sizeof(tmp));
337
338 /* fake emulate a 16550 uart to make userspace code happy */
339 tmp.type = PORT_16550A;
Greg Kroah-Hartmane5b1e202013-06-07 11:04:28 -0700340 tmp.line = port->minor;
Greg Kroah-Hartmanfaac64a2009-02-06 18:31:46 -0800341 tmp.port = 0;
342 tmp.irq = 0;
Greg Kroah-Hartmanfaac64a2009-02-06 18:31:46 -0800343 tmp.xmit_fifo_size = 1024;
344 tmp.baud_base = 9600;
345 tmp.close_delay = 5*HZ;
346 tmp.closing_wait = 30*HZ;
347
348 if (copy_to_user(serial, &tmp, sizeof(*serial)))
349 return -EFAULT;
350 return 0;
351}
352
Alan Cox00a0d0d2011-02-14 16:27:06 +0000353static int opticon_ioctl(struct tty_struct *tty,
Greg Kroah-Hartmanfaac64a2009-02-06 18:31:46 -0800354 unsigned int cmd, unsigned long arg)
355{
356 struct usb_serial_port *port = tty->driver_data;
Greg Kroah-Hartmanfaac64a2009-02-06 18:31:46 -0800357
Greg Kroah-Hartmanfaac64a2009-02-06 18:31:46 -0800358 switch (cmd) {
359 case TIOCGSERIAL:
Johan Hovold56be1a12012-11-18 13:23:31 +0100360 return get_serial_info(port,
Greg Kroah-Hartmanfaac64a2009-02-06 18:31:46 -0800361 (struct serial_struct __user *)arg);
362 }
363
364 return -ENOIOCTLCMD;
365}
366
Johan Hovold70d25ee2012-11-18 13:23:30 +0100367static int opticon_port_probe(struct usb_serial_port *port)
368{
Johan Hovold70d25ee2012-11-18 13:23:30 +0100369 struct opticon_private *priv;
Johan Hovold70d25ee2012-11-18 13:23:30 +0100370
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800371 priv = kzalloc(sizeof(*priv), GFP_KERNEL);
Johan Hovold70d25ee2012-11-18 13:23:30 +0100372 if (!priv)
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800373 return -ENOMEM;
Johan Hovold70d25ee2012-11-18 13:23:30 +0100374
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800375 spin_lock_init(&priv->lock);
Johan Hovold0b8718a2012-11-18 13:23:22 +0100376
Johan Hovold70d25ee2012-11-18 13:23:30 +0100377 usb_set_serial_port_data(port, priv);
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800378
Johan Hovold70d25ee2012-11-18 13:23:30 +0100379 return 0;
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800380}
381
Johan Hovold70d25ee2012-11-18 13:23:30 +0100382static int opticon_port_remove(struct usb_serial_port *port)
Alan Sternf9c99bb2009-06-02 11:53:55 -0400383{
Johan Hovold70d25ee2012-11-18 13:23:30 +0100384 struct opticon_private *priv = usb_get_serial_port_data(port);
Alan Sternf9c99bb2009-06-02 11:53:55 -0400385
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800386 kfree(priv);
Johan Hovold70d25ee2012-11-18 13:23:30 +0100387
388 return 0;
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800389}
390
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800391static struct usb_serial_driver opticon_device = {
392 .driver = {
393 .owner = THIS_MODULE,
394 .name = "opticon",
395 },
396 .id_table = id_table,
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800397 .num_ports = 1,
Johan Hovold5e5b6442017-03-02 12:51:29 +0100398 .num_bulk_in = 1,
Johan Hovold333396f2012-11-18 13:23:33 +0100399 .bulk_in_size = 256,
Johan Hovold70d25ee2012-11-18 13:23:30 +0100400 .port_probe = opticon_port_probe,
401 .port_remove = opticon_port_remove,
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800402 .open = opticon_open,
Greg Kroah-Hartman648d4e12009-02-06 18:30:56 -0800403 .write = opticon_write,
404 .write_room = opticon_write_room,
Johan Hovold7a6ee2b2012-11-18 13:23:36 +0100405 .throttle = usb_serial_generic_throttle,
406 .unthrottle = usb_serial_generic_unthrottle,
Greg Kroah-Hartmanfaac64a2009-02-06 18:31:46 -0800407 .ioctl = opticon_ioctl,
408 .tiocmget = opticon_tiocmget,
Martin Jansen309a0572011-02-24 14:50:16 +0100409 .tiocmset = opticon_tiocmset,
Johan Hovold7a6ee2b2012-11-18 13:23:36 +0100410 .process_read_urb = opticon_process_read_urb,
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800411};
412
Alan Sternf667dda2012-02-23 14:57:18 -0500413static struct usb_serial_driver * const serial_drivers[] = {
414 &opticon_device, NULL
415};
416
Greg Kroah-Hartman68e24112012-05-08 15:46:14 -0700417module_usb_serial_driver(serial_drivers, id_table);
Greg Kroah-Hartman57262b82008-11-03 13:27:03 -0800418
Martin Jansen309a0572011-02-24 14:50:16 +0100419MODULE_DESCRIPTION(DRIVER_DESC);
Johan Hovold627cfa82017-11-03 18:12:08 +0100420MODULE_LICENSE("GPL v2");