diff options
Diffstat (limited to 'drivers/usb/serial/omninet.c')
-rw-r--r-- | drivers/usb/serial/omninet.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c index 7b7422f49478..5a2d045562f0 100644 --- a/drivers/usb/serial/omninet.c +++ b/drivers/usb/serial/omninet.c @@ -61,12 +61,12 @@ static int debug; #define BT_IGNITIONPRO_ID 0x2000 /* This one seems to be a re-branded ZyXEL device */ /* function prototypes */ -static int omninet_open (struct usb_serial_port *port, struct file *filp); -static void omninet_close (struct usb_serial_port *port, struct file *filp); +static int omninet_open (struct tty_struct *tty, struct usb_serial_port *port, struct file *filp); +static void omninet_close (struct tty_struct *tty, struct usb_serial_port *port, struct file *filp); static void omninet_read_bulk_callback (struct urb *urb); static void omninet_write_bulk_callback (struct urb *urb); -static int omninet_write (struct usb_serial_port *port, const unsigned char *buf, int count); -static int omninet_write_room (struct usb_serial_port *port); +static int omninet_write (struct tty_struct *tty, struct usb_serial_port *port, const unsigned char *buf, int count); +static int omninet_write_room (struct tty_struct *tty); static void omninet_shutdown (struct usb_serial *serial); static int omninet_attach (struct usb_serial *serial); @@ -157,7 +157,8 @@ static int omninet_attach (struct usb_serial *serial) return 0; } -static int omninet_open (struct usb_serial_port *port, struct file *filp) +static int omninet_open(struct tty_struct *tty, + struct usb_serial_port *port, struct file *filp) { struct usb_serial *serial = port->serial; struct usb_serial_port *wport; @@ -166,7 +167,7 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp) dbg("%s - port %d", __func__, port->number); wport = serial->port[1]; - wport->tty = port->tty; + wport->port.tty = tty; /* FIXME */ /* Start reading from the device */ usb_fill_bulk_urb(port->read_urb, serial->dev, @@ -181,7 +182,8 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp) return result; } -static void omninet_close (struct usb_serial_port *port, struct file * filp) +static void omninet_close(struct tty_struct *tty, + struct usb_serial_port *port, struct file * filp) { dbg("%s - port %d", __func__, port->number); usb_kill_urb(port->read_urb); @@ -221,9 +223,9 @@ static void omninet_read_bulk_callback (struct urb *urb) if (urb->actual_length && header->oh_len) { for (i = 0; i < header->oh_len; i++) { - tty_insert_flip_char(port->tty, data[OMNINET_DATAOFFSET + i], 0); + tty_insert_flip_char(port->port.tty, data[OMNINET_DATAOFFSET + i], 0); } - tty_flip_buffer_push(port->tty); + tty_flip_buffer_push(port->port.tty); } /* Continue trying to always read */ @@ -238,7 +240,8 @@ static void omninet_read_bulk_callback (struct urb *urb) return; } -static int omninet_write (struct usb_serial_port *port, const unsigned char *buf, int count) +static int omninet_write(struct tty_struct *tty, struct usb_serial_port *port, + const unsigned char *buf, int count) { struct usb_serial *serial = port->serial; struct usb_serial_port *wport = serial->port[1]; @@ -290,8 +293,9 @@ static int omninet_write (struct usb_serial_port *port, const unsigned char *buf } -static int omninet_write_room (struct usb_serial_port *port) +static int omninet_write_room (struct tty_struct *tty) { + struct usb_serial_port *port = tty->driver_data; struct usb_serial *serial = port->serial; struct usb_serial_port *wport = serial->port[1]; |