1 --- linux-2.4.22/drivers/usb/serial/pl2303.h.orig 2005-04-02 20:15:34.000000000 +0930
2 +++ linux-2.4.22/drivers/usb/serial/pl2303.h 2005-04-02 21:29:03.000000000 +0930
4 #define PL2303_PRODUCT_ID_RSAQ2 0x04bb
6 #define ATEN_VENDOR_ID 0x0557
7 +#define ATEN_VENDOR_ID2 0x0547
8 #define ATEN_PRODUCT_ID 0x2008
10 #define IODATA_VENDOR_ID 0x04bb
13 #define SITECOM_VENDOR_ID 0x6189
14 #define SITECOM_PRODUCT_ID 0x2068
16 +/* Alcatel OT535/735 USB cable */
17 +#define ALCATEL_VENDOR_ID 0x11f7
18 +#define ALCATEL_PRODUCT_ID 0x02df
20 +/* Samsung I330 phone cradle */
21 +#define SAMSUNG_VENDOR_ID 0x04e8
22 +#define SAMSUNG_PRODUCT_ID 0x8001
24 --- linux-2.4.22/drivers/usb/serial/pl2303.c.orig 2005-04-02 20:15:34.000000000 +0930
25 +++ linux-2.4.22/drivers/usb/serial/pl2303.c 2005-04-02 21:29:03.000000000 +0930
28 * Prolific PL2303 USB to serial adaptor driver
30 - * Copyright (C) 2001-2003 Greg Kroah-Hartman (greg@kroah.com)
31 + * Copyright (C) 2001-2004 Greg Kroah-Hartman (greg@kroah.com)
32 * Copyright (C) 2003 IBM Corp.
34 * Original driver for 2.2.x by anonymous
36 * (at your option) any later version.
38 * See Documentation/usb/usb-serial.txt for more information on using this driver
40 - * Added line error reporting support. Hopefully it is correct...
44 + * ported 2.6.8 pl2303.c to 2.4.20 format
45 + * (HX model works fine now, ID table should be brought up to date)
46 + * Gregor Schaffrath <gschaff@ran-dom.org>
49 + * allowed driver to work properly if there is no tty assigned to a port
50 + * (this happens for serial console devices.)
53 * Added RTS and DTR line control. Thanks to joe@bndlg.de for parts of it.
61 #include <linux/config.h>
62 #include <linux/kernel.h>
63 #include <linux/errno.h>
65 #include <linux/spinlock.h>
66 #include <asm/uaccess.h>
67 #include <linux/usb.h>
69 -#ifdef CONFIG_USB_SERIAL_DEBUG
70 - static int debug = 1;
75 #include "usb-serial.h"
81 -#define DRIVER_VERSION "v0.10"
82 +#define DRIVER_VERSION "v0.11"
83 #define DRIVER_DESC "Prolific PL2303 USB to serial adaptor driver"
87 static struct usb_device_id id_table [] = {
88 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID) },
89 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ2) },
91 { USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID) },
92 { USB_DEVICE(ITEGNO_VENDOR_ID, ITEGNO_PRODUCT_ID) },
93 { USB_DEVICE(MA620_VENDOR_ID, MA620_PRODUCT_ID) },
94 - { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID) },
95 - { USB_DEVICE(TRIPP_VENDOR_ID, TRIPP_PRODUCT_ID) },
96 - { USB_DEVICE(RADIOSHACK_VENDOR_ID, RADIOSHACK_PRODUCT_ID) },
97 - { USB_DEVICE(DCU10_VENDOR_ID, DCU10_PRODUCT_ID) },
98 - { USB_DEVICE(SITECOM_VENDOR_ID, SITECOM_PRODUCT_ID) },
99 + { USB_DEVICE(RATOC_VENDOR_ID, RATOC_PRODUCT_ID) },
100 + { USB_DEVICE(TRIPP_VENDOR_ID, TRIPP_PRODUCT_ID) },
101 + { USB_DEVICE(RADIOSHACK_VENDOR_ID, RADIOSHACK_PRODUCT_ID) },
102 + { USB_DEVICE(DCU10_VENDOR_ID, DCU10_PRODUCT_ID) },
103 + { USB_DEVICE(SITECOM_VENDOR_ID, SITECOM_PRODUCT_ID) },
104 + { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_ID) },
105 + { USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_PRODUCT_ID) },
106 { } /* Terminating entry */
109 MODULE_DEVICE_TABLE (usb, id_table);
112 +static struct usb_driver pl2303_driver = {
113 + .owner = THIS_MODULE,
115 + .probe = usb_serial_probe,
116 + .disconnect = usb_serial_disconnect,
117 + .id_table = id_table,
121 #define SET_LINE_REQUEST_TYPE 0x21
122 #define SET_LINE_REQUEST 0x20
124 #define VENDOR_READ_REQUEST 0x01
126 #define UART_STATE 0x08
127 +#define UART_STATE_TRANSIENT_MASK 0x74
128 #define UART_DCD 0x01
129 #define UART_DSR 0x02
130 #define UART_BREAK_ERROR 0x04
132 static int pl2303_write (struct usb_serial_port *port, int from_user,
133 const unsigned char *buf, int count);
134 static void pl2303_break_ctl(struct usb_serial_port *port,int break_state);
135 +static int pl2303_tiocmget (struct usb_serial_port *port, struct file *file);
136 +static int pl2303_tiocmset (struct usb_serial_port *port, struct file *file,
137 + unsigned int set, unsigned int clear);
138 static int pl2303_startup (struct usb_serial *serial);
139 static void pl2303_shutdown (struct usb_serial *serial);
141 @@ -147,33 +164,57 @@
142 .ioctl = pl2303_ioctl,
143 .break_ctl = pl2303_break_ctl,
144 .set_termios = pl2303_set_termios,
145 + //.tiocmget = pl2303_tiocmget,
146 + //.tiocmset = pl2303_tiocmset,
147 .read_bulk_callback = pl2303_read_bulk_callback,
148 .read_int_callback = pl2303_read_int_callback,
149 .write_bulk_callback = pl2303_write_bulk_callback,
150 + //.attach = pl2303_startup,
151 .startup = pl2303_startup,
152 .shutdown = pl2303_shutdown,
156 + type_0, /* don't know the difference between type 0 and */
157 + type_1, /* type 1, until someone from prolific tells us... */
158 + HX, /* HX version of the pl2303 chip */
161 struct pl2303_private {
163 + wait_queue_head_t delta_msr_wait;
166 u8 termios_initialized;
167 + enum pl2303_type type;
171 static int pl2303_startup (struct usb_serial *serial)
173 struct pl2303_private *priv;
174 + enum pl2303_type type = type_0;
177 + if (serial->dev->descriptor.bDeviceClass == 0x02)
179 + else if (serial->dev->descriptor.bMaxPacketSize0 == 0x40)
181 + else if (serial->dev->descriptor.bDeviceClass == 0x00)
183 + else if (serial->dev->descriptor.bDeviceClass == 0xFF)
185 + dbg("device type: %d", type);
187 for (i = 0; i < serial->num_ports; ++i) {
188 priv = kmalloc (sizeof (struct pl2303_private), GFP_KERNEL);
191 memset (priv, 0x00, sizeof (struct pl2303_private));
192 spin_lock_init(&priv->lock);
193 - usb_set_serial_port_data(&serial->port[i], priv);
194 + init_waitqueue_head(&priv->delta_msr_wait);
196 + serial->port[i].private = priv;
202 dbg("%s - port %d, %d bytes", __FUNCTION__, port->number, count);
207 if (port->write_urb->status == -EINPROGRESS) {
208 dbg("%s - already writing", __FUNCTION__);
210 @@ -208,13 +252,13 @@
211 memcpy (port->write_urb->transfer_buffer, buf, count);
214 - usb_serial_debug_data (__FILE__, __FUNCTION__, count, port->write_urb->transfer_buffer);
215 + usb_serial_debug_data(__FILE__, __FUNCTION__, count, port->write_urb->transfer_buffer);
217 port->write_urb->transfer_buffer_length = count;
218 port->write_urb->dev = port->serial->dev;
219 result = usb_submit_urb (port->write_urb);
221 - err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
222 + err("%s - failed submitting write urb, error %d\n", __FUNCTION__, result);
227 static void pl2303_set_termios (struct usb_serial_port *port, struct termios *old_termios)
229 struct usb_serial *serial = port->serial;
230 - struct pl2303_private *priv = usb_get_serial_port_data(port);
231 + struct pl2303_private *priv = port->private;
239 - dbg("%s - port %d, initialized = %d", __FUNCTION__, port->number,
240 - priv->termios_initialized);
241 + dbg("%s - port %d", __FUNCTION__, port->number);
243 if ((!port->tty) || (!port->tty->termios)) {
244 dbg("%s - no tty structures", __FUNCTION__);
247 buf = kmalloc (7, GFP_KERNEL);
249 - err("%s - out of memory.", __FUNCTION__);
250 + err("%s - out of memory.\n", __FUNCTION__);
253 memset (buf, 0x00, 0x07);
255 case B230400: baud = 230400; break;
256 case B460800: baud = 460800; break;
258 - err ("pl2303 driver does not support the baudrate requested (fix it)");
259 + err("pl2303 driver does not support the baudrate requested (fix it)\n");
262 dbg("%s - baud = %d", __FUNCTION__, baud);
263 @@ -373,31 +416,39 @@
264 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
266 if (cflag & CRTSCTS) {
267 - i = usb_control_msg (serial->dev, usb_sndctrlpipe (serial->dev, 0),
268 - VENDOR_WRITE_REQUEST, VENDOR_WRITE_REQUEST_TYPE,
269 - 0x0, 0x41, NULL, 0, 100);
270 - dbg ("0x40:0x1:0x0:0x41 %d", i);
272 + if (priv->type == HX)
276 + i = usb_control_msg(serial->dev,
277 + usb_sndctrlpipe(serial->dev, 0),
278 + VENDOR_WRITE_REQUEST,
279 + VENDOR_WRITE_REQUEST_TYPE,
280 + 0x0, index, NULL, 0, 100);
281 + dbg ("0x40:0x1:0x0:0x%x %d", index, i);
289 static int pl2303_open (struct usb_serial_port *port, struct file *filp)
291 struct termios tmp_termios;
292 struct usb_serial *serial = port->serial;
293 - unsigned char buf[10];
294 + struct pl2303_private *priv = port->private;
295 + unsigned char *buf;
298 - if (port_paranoia_check (port, __FUNCTION__))
301 dbg("%s - port %d", __FUNCTION__, port->number);
303 usb_clear_halt(serial->dev, port->write_urb->pipe);
304 usb_clear_halt(serial->dev, port->read_urb->pipe);
306 + buf = kmalloc(10, GFP_KERNEL);
310 #define FISH(a,b,c,d) \
311 result=usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev,0), \
312 b, a, c, d, buf, 1, 100); \
314 SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0x0404, 1);
315 FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8484, 0);
316 FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8383, 0);
317 + SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0, 1);
318 + SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 1, 0);
320 + if (priv->type == HX) {
322 + SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 2, 0x44);
323 + /* reset upstream data pipes */
324 + SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 8, 0);
325 + SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 9, 0);
327 + SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 2, 0x24);
335 port->read_urb->dev = serial->dev;
336 result = usb_submit_urb (port->read_urb);
338 - err("%s - failed submitting read urb, error %d", __FUNCTION__, result);
339 + err("%s - failed submitting read urb, error %d\n", __FUNCTION__, result);
340 pl2303_close (port, NULL);
344 port->interrupt_in_urb->dev = serial->dev;
345 result = usb_submit_urb (port->interrupt_in_urb);
347 - err("%s - failed submitting interrupt urb, error %d", __FUNCTION__, result);
348 + err("%s - failed submitting interrupt urb, error %d\n", __FUNCTION__, result);
349 pl2303_close (port, NULL);
352 @@ -447,119 +512,133 @@
354 static void pl2303_close (struct usb_serial_port *port, struct file *filp)
356 - struct usb_serial *serial;
357 struct pl2303_private *priv;
359 unsigned int c_cflag;
362 - if (port_paranoia_check (port, __FUNCTION__))
364 - serial = get_usb_serial (port, __FUNCTION__);
368 dbg("%s - port %d", __FUNCTION__, port->number);
372 - c_cflag = port->tty->termios->c_cflag;
373 - if (c_cflag & HUPCL) {
374 - /* drop DTR and RTS */
375 - priv = usb_get_serial_port_data(port);
376 - spin_lock_irqsave(&priv->lock, flags);
377 - priv->line_control = 0;
378 - spin_unlock_irqrestore (&priv->lock, flags);
379 - set_control_lines (port->serial->dev, 0);
382 + /* shutdown our urbs */
383 + dbg("%s - shutting down urbs", __FUNCTION__);
384 + result = usb_unlink_urb (port->write_urb);
386 + dbg("%s - usb_unlink_urb (write_urb)"
387 + " failed with reason: %d", __FUNCTION__,
390 - /* shutdown our urbs */
391 - dbg("%s - shutting down urbs", __FUNCTION__);
392 - result = usb_unlink_urb (port->write_urb);
394 - dbg("%s - usb_unlink_urb (write_urb)"
395 - " failed with reason: %d", __FUNCTION__,
397 + result = usb_unlink_urb (port->read_urb);
399 + dbg("%s - usb_unlink_urb (read_urb) "
400 + "failed with reason: %d", __FUNCTION__,
403 - result = usb_unlink_urb (port->read_urb);
405 - dbg("%s - usb_unlink_urb (read_urb) "
406 - "failed with reason: %d", __FUNCTION__,
408 + result = usb_unlink_urb (port->interrupt_in_urb);
410 + dbg("%s - usb_unlink_urb (interrupt_in_urb)"
411 + " failed with reason: %d", __FUNCTION__,
414 - result = usb_unlink_urb (port->interrupt_in_urb);
416 - dbg("%s - usb_unlink_urb (interrupt_in_urb)"
417 - " failed with reason: %d", __FUNCTION__,
420 + c_cflag = port->tty->termios->c_cflag;
421 + if (c_cflag & HUPCL) {
422 + /* drop DTR and RTS */
423 + priv = port->private;
424 + spin_lock_irqsave(&priv->lock, flags);
425 + priv->line_control = 0;
426 + spin_unlock_irqrestore (&priv->lock, flags);
427 + set_control_lines (port->serial->dev, 0);
433 +/* taken from 2.4.20 driver */
434 static int set_modem_info (struct usb_serial_port *port, unsigned int cmd, unsigned int *value)
436 - struct pl2303_private *priv = usb_get_serial_port_data(port);
437 - unsigned long flags;
441 - if (copy_from_user(&arg, value, sizeof(int)))
443 + struct pl2303_private *priv = port->private;
446 - spin_lock_irqsave (&priv->lock, flags);
449 - if (arg & TIOCM_RTS)
450 - priv->line_control |= CONTROL_RTS;
451 - if (arg & TIOCM_DTR)
452 - priv->line_control |= CONTROL_DTR;
456 - if (arg & TIOCM_RTS)
457 - priv->line_control &= ~CONTROL_RTS;
458 - if (arg & TIOCM_DTR)
459 - priv->line_control &= ~CONTROL_DTR;
463 - /* turn off RTS and DTR and then only turn
464 - on what was asked to */
465 - priv->line_control &= ~(CONTROL_RTS | CONTROL_DTR);
466 - priv->line_control |= ((arg & TIOCM_RTS) ? CONTROL_RTS : 0);
467 - priv->line_control |= ((arg & TIOCM_DTR) ? CONTROL_DTR : 0);
470 - control = priv->line_control;
471 - spin_unlock_irqrestore (&priv->lock, flags);
473 - return set_control_lines (port->serial->dev, control);
474 + if (copy_from_user(&arg, value, sizeof(int)))
479 + if (arg & TIOCM_RTS)
480 + priv->line_control |= CONTROL_RTS;
481 + if (arg & TIOCM_DTR)
482 + priv->line_control |= CONTROL_DTR;
486 + if (arg & TIOCM_RTS)
487 + priv->line_control &= ~CONTROL_RTS;
488 + if (arg & TIOCM_DTR)
489 + priv->line_control &= ~CONTROL_DTR;
493 + /* turn off RTS and DTR and then only turn
494 + on what was asked to */
495 + priv->line_control &= ~(CONTROL_RTS | CONTROL_DTR);
496 + priv->line_control |= ((arg & TIOCM_RTS) ? CONTROL_RTS : 0);
497 + priv->line_control |= ((arg & TIOCM_DTR) ? CONTROL_DTR : 0);
501 + return set_control_lines (port->serial->dev, priv->line_control);
504 static int get_modem_info (struct usb_serial_port *port, unsigned int *value)
506 - struct pl2303_private *priv = usb_get_serial_port_data(port);
507 + struct pl2303_private *priv = port->private;
508 + unsigned int mcr = priv->line_control;
509 + unsigned int result;
511 + result = ((mcr & CONTROL_DTR) ? TIOCM_DTR : 0)
512 + | ((mcr & CONTROL_RTS) ? TIOCM_RTS : 0);
514 + dbg("%s - result = %x", __FUNCTION__, result);
516 + if (copy_to_user(value, &result, sizeof(int)))
520 +/* end of 2.4.20 kernel part - grsch */
522 +static int wait_modem_info(struct usb_serial_port *port, unsigned int arg)
524 + struct pl2303_private *priv = port->private;
527 + unsigned int prevstatus;
529 - unsigned int result;
530 + unsigned int changed;
532 spin_lock_irqsave (&priv->lock, flags);
533 - mcr = priv->line_control;
534 - status = priv->line_status;
535 + prevstatus = priv->line_status;
536 spin_unlock_irqrestore (&priv->lock, flags);
538 - result = ((mcr & CONTROL_DTR) ? TIOCM_DTR : 0)
539 - | ((mcr & CONTROL_RTS) ? TIOCM_RTS : 0)
540 - | ((status & UART_CTS) ? TIOCM_CTS : 0)
541 - | ((status & UART_DSR) ? TIOCM_DSR : 0)
542 - | ((status & UART_RING) ? TIOCM_RI : 0)
543 - | ((status & UART_DCD) ? TIOCM_CD : 0);
545 - dbg("%s - result = %x", __FUNCTION__, result);
547 - if (copy_to_user(value, &result, sizeof(int)))
550 + interruptible_sleep_on(&priv->delta_msr_wait);
551 + /* see if a signal did it */
552 + if (signal_pending(current))
553 + return -ERESTARTSYS;
555 + spin_lock_irqsave (&priv->lock, flags);
556 + status = priv->line_status;
557 + spin_unlock_irqrestore (&priv->lock, flags);
559 + changed=prevstatus^status;
561 + if (((arg & TIOCM_RNG) && (changed & UART_RING)) ||
562 + ((arg & TIOCM_DSR) && (changed & UART_DSR)) ||
563 + ((arg & TIOCM_CD) && (changed & UART_DCD)) ||
564 + ((arg & TIOCM_CTS) && (changed & UART_CTS)) ) {
567 + prevstatus = status;
574 dbg("%s (%d) cmd = 0x%04x", __FUNCTION__, port->number, cmd);
579 - dbg("%s (%d) TIOCMGET", __FUNCTION__, port->number);
580 - return get_modem_info (port, (unsigned int *)arg);
585 - dbg("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__, port->number);
586 - return set_modem_info(port, cmd, (unsigned int *) arg);
588 + dbg("%s (%d) TIOCMIWAIT", __FUNCTION__, port->number);
589 + return wait_modem_info(port, arg);
592 dbg("%s not supported = 0x%04x", __FUNCTION__, cmd);
594 dbg("%s", __FUNCTION__);
596 for (i = 0; i < serial->num_ports; ++i) {
597 - kfree (usb_get_serial_port_data(&serial->port[i]));
598 - usb_set_serial_port_data(&serial->port[i], NULL);
599 + kfree (serial->port[i].private);
600 + serial->port[i].private = NULL;
604 @@ -625,15 +697,14 @@
605 static void pl2303_read_int_callback (struct urb *urb)
607 struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
608 - struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
609 - struct pl2303_private *priv = usb_get_serial_port_data(port);
610 + struct pl2303_private *priv = port->private;
611 unsigned char *data = urb->transfer_buffer;
616 dbg("%s (%d)", __FUNCTION__, port->number);
618 - /* ints auto restart... */
620 switch (urb->status) {
623 @@ -646,32 +717,34 @@
626 dbg("%s - nonzero urb status received: %d", __FUNCTION__, urb->status);
635 - usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
636 + usb_serial_debug_data(__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer);
638 if (urb->actual_length < UART_STATE)
642 /* Save off the uart status for others to look at */
643 + uart_state = data[UART_STATE];
644 spin_lock_irqsave(&priv->lock, flags);
645 - priv->line_status = data[UART_STATE];
646 + uart_state |= (priv->line_status & UART_STATE_TRANSIENT_MASK);
647 + priv->line_status = uart_state;
648 spin_unlock_irqrestore(&priv->lock, flags);
653 + status = usb_submit_urb (urb);
655 + err("%s - usb_submit_urb failed with result %d\n",
656 + __FUNCTION__, status);
660 static void pl2303_read_bulk_callback (struct urb *urb)
662 struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
663 - struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
664 - struct pl2303_private *priv = usb_get_serial_port_data(port);
665 + struct pl2303_private *priv = port->private;
666 struct tty_struct *tty;
667 unsigned char *data = urb->transfer_buffer;
673 - if (port_paranoia_check (port, __FUNCTION__))
676 dbg("%s - port %d", __FUNCTION__, port->number);
679 - dbg("%s - bad serial pointer, exiting", __FUNCTION__);
684 dbg("%s - urb->status = %d", __FUNCTION__, urb->status);
685 if (!port->open_count) {
686 @@ -700,24 +765,26 @@
687 /* PL2303 mysteriously fails with -EPROTO reschedule the read */
688 dbg("%s - caught -EPROTO, resubmitting the urb", __FUNCTION__);
690 - urb->dev = serial->dev;
691 + urb->dev = port->serial->dev;
692 result = usb_submit_urb(urb);
694 - err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
695 + err("%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);
698 dbg("%s - unable to handle the error, exiting.", __FUNCTION__);
702 - usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data);
703 + usb_serial_debug_data(__FILE__, __FUNCTION__, urb->actual_length, data);
705 /* get tty_flag from status */
706 tty_flag = TTY_NORMAL;
708 spin_lock_irqsave(&priv->lock, flags);
709 status = priv->line_status;
710 + priv->line_status &= ~UART_STATE_TRANSIENT_MASK;
711 spin_unlock_irqrestore(&priv->lock, flags);
712 + wake_up_interruptible (&priv->delta_msr_wait);
714 /* break takes precedence over parity, */
715 /* which takes precedence over framing errors */
716 @@ -746,10 +813,10 @@
718 /* Schedule the next read _if_ we are still open */
719 if (port->open_count) {
720 - urb->dev = serial->dev;
721 + urb->dev = port->serial->dev;
722 result = usb_submit_urb(urb);
724 - err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result);
725 + err("%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result);
729 @@ -762,44 +829,32 @@
730 struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
733 - if (port_paranoia_check (port, __FUNCTION__))
736 dbg("%s - port %d", __FUNCTION__, port->number);
739 /* error in the urb, so we have to resubmit it */
740 - if (serial_paranoia_check (port->serial, __FUNCTION__)) {
743 dbg("%s - Overflow in write", __FUNCTION__);
744 dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
745 port->write_urb->transfer_buffer_length = 1;
746 port->write_urb->dev = port->serial->dev;
747 result = usb_submit_urb (port->write_urb);
749 - err("%s - failed resubmitting write urb, error %d", __FUNCTION__, result);
750 + err("%s - failed resubmitting write urb, error %d\n", __FUNCTION__, result);
755 - queue_task(&port->tqueue, &tq_immediate);
756 - mark_bh(IMMEDIATE_BH);
759 + queue_task(&port->tqueue, &tq_immediate);
760 + mark_bh(IMMEDIATE_BH);
764 static int __init pl2303_init (void)
767 - retval = usb_serial_register(&pl2303_device);
769 - goto failed_usb_serial_register;
770 + usb_serial_register(&pl2303_device);
771 info(DRIVER_DESC " " DRIVER_VERSION);
773 -failed_usb_serial_register:
779 MODULE_PARM(debug, "i");
780 MODULE_PARM_DESC(debug, "Debug enabled or not");