# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.845 -> 1.846 # drivers/usb/serial/pl2303.c 1.8 -> 1.9 # drivers/usb/serial/pl2303.h 1.3 -> 1.4 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/08/14 greg@kroah.com 1.846 # USB: pl2303 driver update # # added new device. # __devinitdata update # __FUNCTION__ fixes for gcc 3 # -------------------------------------------- # diff -Nru a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c --- a/drivers/usb/serial/pl2303.c Wed Aug 14 23:17:54 2002 +++ b/drivers/usb/serial/pl2303.c Wed Aug 14 23:17:54 2002 @@ -64,12 +64,13 @@ -static __devinitdata struct usb_device_id id_table [] = { +static struct usb_device_id id_table [] = { { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID) }, { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ2) }, { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, { USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID) }, + { USB_DEVICE(ITEGNO_VENDOR_ID, ITEGNO_PRODUCT_ID) }, { } /* Terminating entry */ }; @@ -167,7 +168,7 @@ retval = usb_control_msg (dev, usb_sndctrlpipe (dev, 0), SET_CONTROL_REQUEST, SET_CONTROL_REQUEST_TYPE, value, 0, NULL, 0, 100); - dbg (__FUNCTION__" - value = %d, retval = %d", value, retval); + dbg("%s - value = %d, retval = %d", __FUNCTION__, value, retval); return retval; } @@ -175,15 +176,15 @@ { int result; - dbg (__FUNCTION__ " - port %d, %d bytes", port->number, count); + dbg("%s - port %d, %d bytes", __FUNCTION__, port->number, count); if (!port->tty) { - err (__FUNCTION__ " - no tty???"); + err("%s - no tty???", __FUNCTION__); return 0; } if (port->write_urb->status == -EINPROGRESS) { - dbg (__FUNCTION__ " - already writing"); + dbg("%s - already writing", __FUNCTION__); return 0; } @@ -201,7 +202,7 @@ port->write_urb->dev = port->serial->dev; result = usb_submit_urb (port->write_urb); if (result) - err(__FUNCTION__ " - failed submitting write urb, error %d", result); + err("%s - failed submitting write urb, error %d", __FUNCTION__, result); else result = count; @@ -219,11 +220,11 @@ int baud; int i; - dbg (__FUNCTION__ " - port %d, initialized = %d", port->number, + dbg("%s - port %d, initialized = %d", __FUNCTION__, port->number, ((struct pl2303_private *) port->private)->termios_initialized); if ((!port->tty) || (!port->tty->termios)) { - dbg(__FUNCTION__" - no tty structures"); + dbg("%s - no tty structures", __FUNCTION__); return; } @@ -237,14 +238,14 @@ if (old_termios) { if ((cflag == old_termios->c_cflag) && (RELEVANT_IFLAG(port->tty->termios->c_iflag) == RELEVANT_IFLAG(old_termios->c_iflag))) { - dbg(__FUNCTION__ " - nothing to change..."); + dbg("%s - nothing to change...", __FUNCTION__); return; } } buf = kmalloc (7, GFP_KERNEL); if (!buf) { - err(__FUNCTION__ " - out of memory."); + err("%s - out of memory.", __FUNCTION__); return; } memset (buf, 0x00, 0x07); @@ -270,7 +271,7 @@ default: case CS8: buf[6] = 8; break; } - dbg (__FUNCTION__ " - data bits = %d", buf[6]); + dbg("%s - data bits = %d", __FUNCTION__, buf[6]); } baud = 0; @@ -295,7 +296,7 @@ err ("pl2303 driver does not support the baudrate requested (fix it)"); break; } - dbg (__FUNCTION__ " - baud = %d", baud); + dbg("%s - baud = %d", __FUNCTION__, baud); if (baud) { buf[0] = baud & 0xff; buf[1] = (baud >> 8) & 0xff; @@ -308,10 +309,10 @@ /* For reference buf[4]=2 is 2 stop bits */ if (cflag & CSTOPB) { buf[4] = 2; - dbg(__FUNCTION__ " - stop bits = 2"); + dbg("%s - stop bits = 2", __FUNCTION__); } else { buf[4] = 0; - dbg(__FUNCTION__ " - stop bits = 1"); + dbg("%s - stop bits = 1", __FUNCTION__); } if (cflag & PARENB) { @@ -322,14 +323,14 @@ /* For reference buf[5]=4 is space parity */ if (cflag & PARODD) { buf[5] = 1; - dbg(__FUNCTION__ " - parity = odd"); + dbg("%s - parity = odd", __FUNCTION__); } else { buf[5] = 2; - dbg(__FUNCTION__ " - parity = even"); + dbg("%s - parity = even", __FUNCTION__); } } else { buf[5] = 0; - dbg(__FUNCTION__ " - parity = none"); + dbg("%s - parity = none", __FUNCTION__); } i = usb_control_msg (serial->dev, usb_sndctrlpipe (serial->dev, 0), @@ -375,7 +376,7 @@ if (port_paranoia_check (port, __FUNCTION__)) return -ENODEV; - dbg (__FUNCTION__ " - port %d", port->number); + dbg("%s - port %d", __FUNCTION__, port->number); down (&port->sem); @@ -412,21 +413,21 @@ //FIXME: need to assert RTS and DTR if CRTSCTS off - dbg (__FUNCTION__ " - submitting read urb"); + dbg("%s - submitting read urb", __FUNCTION__); port->read_urb->dev = serial->dev; result = usb_submit_urb (port->read_urb); if (result) { - err(__FUNCTION__ " - failed submitting read urb, error %d", result); + err("%s - failed submitting read urb, error %d", __FUNCTION__, result); up (&port->sem); pl2303_close (port, NULL); return -EPROTO; } - dbg (__FUNCTION__ " - submitting interrupt urb"); + dbg("%s - submitting interrupt urb", __FUNCTION__); port->interrupt_in_urb->dev = serial->dev; result = usb_submit_urb (port->interrupt_in_urb); if (result) { - err(__FUNCTION__ " - failed submitting interrupt urb, error %d", result); + err("%s - failed submitting interrupt urb, error %d", __FUNCTION__, result); up (&port->sem); pl2303_close (port, NULL); return -EPROTO; @@ -450,7 +451,7 @@ if (!serial) return; - dbg (__FUNCTION__ " - port %d", port->number); + dbg("%s - port %d", __FUNCTION__, port->number); down (&port->sem); @@ -467,23 +468,23 @@ } /* shutdown our urbs */ - dbg (__FUNCTION__ " - shutting down urbs"); + dbg("%s - shutting down urbs", __FUNCTION__); result = usb_unlink_urb (port->write_urb); if (result) - dbg (__FUNCTION__ " - usb_unlink_urb " - "(write_urb) failed with reason: %d", + dbg("%s - usb_unlink_urb (write_urb)" + " failed with reason: %d", __FUNCTION__, result); result = usb_unlink_urb (port->read_urb); if (result) - dbg (__FUNCTION__ " - usb_unlink_urb " - "(read_urb) failed with reason: %d", + dbg("%s - usb_unlink_urb (read_urb) " + "failed with reason: %d", __FUNCTION__, result); result = usb_unlink_urb (port->interrupt_in_urb); if (result) - dbg (__FUNCTION__ " - usb_unlink_urb " - "(interrupt_in_urb) failed with reason: %d", + dbg("%s - usb_unlink_urb (interrupt_in_urb)" + " failed with reason: %d", __FUNCTION__, result); } @@ -539,7 +540,7 @@ result = ((mcr & CONTROL_DTR) ? TIOCM_DTR : 0) | ((mcr & CONTROL_RTS) ? TIOCM_RTS : 0); - dbg (__FUNCTION__ " - result = %x", result); + dbg("%s - result = %x", __FUNCTION__, result); if (copy_to_user(value, &result, sizeof(int))) return -EFAULT; @@ -548,22 +549,22 @@ static int pl2303_ioctl (struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg) { - dbg (__FUNCTION__" (%d) cmd = 0x%04x", port->number, cmd); + dbg("%s (%d) cmd = 0x%04x", __FUNCTION__, port->number, cmd); switch (cmd) { case TIOCMGET: - dbg (__FUNCTION__" (%d) TIOCMGET", port->number); + dbg("%s (%d) TIOCMGET", __FUNCTION__, port->number); return get_modem_info (port, (unsigned int *)arg); case TIOCMBIS: case TIOCMBIC: case TIOCMSET: - dbg(__FUNCTION__" (%d) TIOCMSET/TIOCMBIC/TIOCMSET", port->number); + dbg("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__, port->number); return set_modem_info(port, cmd, (unsigned int *) arg); default: - dbg (__FUNCTION__" not supported = 0x%04x", cmd); + dbg("%s not supported = 0x%04x", __FUNCTION__, cmd); break; } @@ -577,19 +578,19 @@ u16 state; int result; - dbg (__FUNCTION__ " - port %d", port->number); + dbg("%s - port %d", __FUNCTION__, port->number); if (break_state == 0) state = BREAK_OFF; else state = BREAK_ON; - dbg (__FUNCTION__" - turning break %s", state==BREAK_OFF ? "off" : "on"); + dbg("%s - turning break %s", state==BREAK_OFF ? "off" : "on", __FUNCTION__); result = usb_control_msg (serial->dev, usb_rcvctrlpipe (serial->dev, 0), BREAK_REQUEST, BREAK_REQUEST_TYPE, state, 0, NULL, 0, 100); if (result) - dbg (__FUNCTION__" - error sending break = %d", result); + dbg("%s - error sending break = %d", __FUNCTION__, result); } @@ -597,7 +598,7 @@ { int i; - dbg (__FUNCTION__); + dbg("%s", __FUNCTION__); /* stop everything on all ports */ for (i = 0; i < serial->num_ports; ++i) @@ -647,30 +648,30 @@ if (port_paranoia_check (port, __FUNCTION__)) return; - dbg(__FUNCTION__ " - port %d", port->number); + dbg("%s - port %d", __FUNCTION__, port->number); if (!serial) { - dbg(__FUNCTION__ " - bad serial pointer, exiting"); + dbg("%s - bad serial pointer, exiting", __FUNCTION__); return; } if (urb->status) { - dbg (__FUNCTION__ " - urb->status = %d", urb->status); + dbg("%s - urb->status = %d", __FUNCTION__, urb->status); if (!port->active) { - dbg (__FUNCTION__ " - port is closed, exiting."); + dbg("%s - port is closed, exiting.", __FUNCTION__); return; } if (urb->status == -EPROTO) { /* PL2303 mysteriously fails with -EPROTO reschedule the read */ - dbg (__FUNCTION__ " - caught -EPROTO, resubmitting the urb"); + dbg("%s - caught -EPROTO, resubmitting the urb", __FUNCTION__); urb->status = 0; urb->dev = serial->dev; result = usb_submit_urb(urb); if (result) - err(__FUNCTION__ " - failed resubmitting read urb, error %d", result); + err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result); return; } - dbg (__FUNCTION__ " - unable to handle the error, exiting."); + dbg("%s - unable to handle the error, exiting.", __FUNCTION__); return; } @@ -692,7 +693,7 @@ urb->dev = serial->dev; result = usb_submit_urb(urb); if (result) - err(__FUNCTION__ " - failed resubmitting read urb, error %d", result); + err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result); } return; @@ -708,20 +709,20 @@ if (port_paranoia_check (port, __FUNCTION__)) return; - dbg(__FUNCTION__ " - port %d", port->number); + dbg("%s - port %d", __FUNCTION__, port->number); if (urb->status) { /* error in the urb, so we have to resubmit it */ if (serial_paranoia_check (port->serial, __FUNCTION__)) { return; } - dbg (__FUNCTION__ " - Overflow in write"); - dbg (__FUNCTION__ " - nonzero write bulk status received: %d", urb->status); + dbg("%s - Overflow in write", __FUNCTION__); + dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status); port->write_urb->transfer_buffer_length = 1; port->write_urb->dev = port->serial->dev; result = usb_submit_urb (port->write_urb); if (result) - err(__FUNCTION__ " - failed resubmitting write urb, error %d", result); + err("%s - failed resubmitting write urb, error %d", __FUNCTION__, result); return; } diff -Nru a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h --- a/drivers/usb/serial/pl2303.h Wed Aug 14 23:17:54 2002 +++ b/drivers/usb/serial/pl2303.h Wed Aug 14 23:17:54 2002 @@ -19,3 +19,6 @@ #define ELCOM_VENDOR_ID 0x056e #define ELCOM_PRODUCT_ID 0x5003 + +#define ITEGNO_VENDOR_ID 0x0eba +#define ITEGNO_PRODUCT_ID 0x1080