diff options
Diffstat (limited to 'drivers/usb/serial/aircable.c')
| -rw-r--r-- | drivers/usb/serial/aircable.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/drivers/usb/serial/aircable.c b/drivers/usb/serial/aircable.c index 6d110a3bc7e..80a9845cd93 100644 --- a/drivers/usb/serial/aircable.c +++ b/drivers/usb/serial/aircable.c @@ -10,9 +10,9 @@ * * The device works as an standard CDC device, it has 2 interfaces, the first * one is for firmware access and the second is the serial one. - * The protocol is very simply, there are two posibilities reading or writing. + * The protocol is very simply, there are two possibilities reading or writing. * When writing the first urb must have a Header that starts with 0x20 0x29 the - * next two bytes must say how much data will be sended. + * next two bytes must say how much data will be sent. * When reading the process is almost equal except that the header starts with * 0x00 0x20. * @@ -31,15 +31,15 @@ * * The driver registers himself with the USB-serial core and the USB Core. I had * to implement a probe function against USB-serial, because other way, the - * driver was attaching himself to both interfaces. I have tryed with different + * driver was attaching himself to both interfaces. I have tried with different * configurations of usb_serial_driver with out exit, only the probe function * could handle this correctly. * * I have taken some info from a Greg Kroah-Hartman article: * http://www.linuxjournal.com/article/6573 * And from Linux Device Driver Kit CD, which is a great work, the authors taken - * the work to recompile lots of information an knowladge in drivers development - * and made it all avaible inside a cd. + * the work to recompile lots of information an knowledge in drivers development + * and made it all available inside a cd. * URL: http://kernel.org/pub/linux/kernel/people/gregkh/ddk/ * */ @@ -119,9 +119,8 @@ static int aircable_probe(struct usb_serial *serial, return 0; } -static int aircable_process_packet(struct tty_struct *tty, - struct usb_serial_port *port, int has_headers, - char *packet, int len) +static int aircable_process_packet(struct usb_serial_port *port, + int has_headers, char *packet, int len) { if (has_headers) { len -= HCI_HEADER_LENGTH; @@ -132,7 +131,7 @@ static int aircable_process_packet(struct tty_struct *tty, return 0; } - tty_insert_flip_string(tty, packet, len); + tty_insert_flip_string(&port->port, packet, len); return len; } @@ -141,28 +140,22 @@ static void aircable_process_read_urb(struct urb *urb) { struct usb_serial_port *port = urb->context; char *data = (char *)urb->transfer_buffer; - struct tty_struct *tty; int has_headers; int count; int len; int i; - tty = tty_port_tty_get(&port->port); - if (!tty) - return; - has_headers = (urb->actual_length > 2 && data[0] == RX_HEADER_0); count = 0; for (i = 0; i < urb->actual_length; i += HCI_COMPLETE_FRAME) { len = min_t(int, urb->actual_length - i, HCI_COMPLETE_FRAME); - count += aircable_process_packet(tty, port, has_headers, + count += aircable_process_packet(port, has_headers, &data[i], len); } if (count) - tty_flip_buffer_push(tty); - tty_kref_put(tty); + tty_flip_buffer_push(&port->port); } static struct usb_serial_driver aircable_device = { |
