14 #include <linux/kernel.h>
15 #include <linux/errno.h>
17 #include <linux/slab.h>
18 #include <linux/tty.h>
21 #include <linux/module.h>
29 #define DRIVER_VERSION "v1.1"
30 #define DRIVER_AUTHOR "Alessandro Zummo"
31 #define DRIVER_DESC "USB ZyXEL omni.net LCD PLUS Driver"
33 #define ZYXEL_VENDOR_ID 0x0586
34 #define ZYXEL_OMNINET_ID 0x1000
36 #define BT_IGNITIONPRO_ID 0x2000
41 static void omninet_read_bulk_callback(
struct urb *
urb);
42 static void omninet_write_bulk_callback(
struct urb *
urb);
44 const unsigned char *
buf,
int count);
45 static int omninet_write_room(
struct tty_struct *tty);
62 .description =
"ZyXEL - omni.net lcd plus usb",
65 .port_probe = omninet_port_probe,
66 .port_remove = omninet_port_remove,
68 .close = omninet_close,
69 .write = omninet_write,
70 .write_room = omninet_write_room,
71 .read_bulk_callback = omninet_read_bulk_callback,
72 .write_bulk_callback = omninet_write_bulk_callback,
73 .disconnect = omninet_disconnect,
77 &zyxel_omninet_device,
NULL
123 usb_set_serial_port_data(port, od);
132 od = usb_get_serial_port_data(port);
144 wport = serial->
port[1];
151 "%s - failed submitting read urb, error %d\n",
162 #define OMNINET_DATAOFFSET 0x04
163 #define OMNINET_HEADERLEN sizeof(struct omninet_header)
164 #define OMNINET_BULKOUTSIZE (64 - OMNINET_HEADERLEN)
166 static void omninet_read_bulk_callback(
struct urb *
urb)
169 unsigned char *
data = urb->transfer_buffer;
175 dev_dbg(&port->
dev,
"%s - nonzero read bulk status received: %d\n",
180 if (urb->actual_length && header->
oh_len) {
194 "%s - failed resubmitting read urb, error %d\n",
199 const unsigned char *
buf,
int count)
204 struct omninet_data *od = usb_get_serial_port_data(port);
211 dev_dbg(&port->
dev,
"%s - write request of 0 bytes\n", __func__);
216 dev_dbg(&port->
dev,
"%s - already writing\n", __func__);
225 usb_serial_debug_data(&port->
dev, __func__, count,
234 wport->
write_urb->transfer_buffer_length = 64;
240 "%s - failed submitting write urb, error %d\n",
249 static int omninet_write_room(
struct tty_struct *tty)
260 dev_dbg(&port->
dev,
"%s - returns %d\n", __func__, room);
265 static void omninet_write_bulk_callback(
struct urb *
urb)
274 dev_dbg(&port->
dev,
"%s - nonzero write bulk status received: %d\n",
283 static void omninet_disconnect(
struct usb_serial *serial)