From 3d861494729c70d9ebeb7d93caa107897925c355 Mon Sep 17 00:00:00 2001 From: Peter Moulder Date: Mon, 19 Jun 2006 22:47:49 +1000 Subject: [PATCH] USB: Addition of vendor/product id pair for pl2303 driver Text from the back of the box, for your information/amusement: USB DATA CABLE FOR K700 Series The USB Cable is an ideal link between your mobile phone and PC. Employing the user-friendiy [sic] USB standard,its capacity for rapid data transfer enables functions such as synchronization of phone book and calendar,as well as Internet browsing via a modem-enabled phone.Autual [sic] connection speed is dependent on phone capacity. MADE IN CHINA From: Peter Moulder Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/pl2303.c | 1 + drivers/usb/serial/pl2303.h | 1 + 2 files changed, 2 insertions(+) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index de93a2b909e..93d623a0d09 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -52,6 +52,7 @@ struct pl2303_buf { 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(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_DCU11) }, { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ3) }, { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_PHAROS) }, { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) }, diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h index 7f29e81d3e3..cb2abad3a37 100644 --- a/drivers/usb/serial/pl2303.h +++ b/drivers/usb/serial/pl2303.h @@ -10,6 +10,7 @@ #define PL2303_VENDOR_ID 0x067b #define PL2303_PRODUCT_ID 0x2303 #define PL2303_PRODUCT_ID_RSAQ2 0x04bb +#define PL2303_PRODUCT_ID_DCU11 0x1234 #define PL2303_PRODUCT_ID_PHAROS 0xaaa0 #define PL2303_PRODUCT_ID_RSAQ3 0xaaa2 -- cgit v1.2.3 From 48437486c69b4baf68ee98530d8119897148c602 Mon Sep 17 00:00:00 2001 From: "D. Peter Siddons" Date: Sat, 17 Jun 2006 18:09:15 -0400 Subject: [PATCH] USB: new device id for Thorlabs motor driver Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio.h | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 8a74b19f128..5facb022ced 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -500,6 +500,7 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) }, { }, /* Optional parameter entry */ { } /* Terminating entry */ }; diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index 6ab2ac845bd..45953922077 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h @@ -442,6 +442,11 @@ */ #define FTDI_YEI_SERVOCENTER31_PID 0xE050 /* YEI ServoCenter3.1 USB */ +/* + * ThorLabs USB motor drivers + */ +#define FTDI_THORLABS_PID 0xfaf0 /* ThorLabs USB motor drivers */ + /* Commands */ #define FTDI_SIO_RESET 0 /* Reset the port */ #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ -- cgit v1.2.3 From c0f8d56197f7d15f841e7d9d6f88909f4feba678 Mon Sep 17 00:00:00 2001 From: Christophe Mariac Date: Fri, 23 Jun 2006 17:36:21 +0200 Subject: [PATCH] USB: new device ids for ftdi_sio driver Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio.h | 3 +++ 2 files changed, 4 insertions(+) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 5facb022ced..9cf4069895c 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -313,6 +313,7 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index 45953922077..024e5512d60 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h @@ -36,6 +36,9 @@ #define FTDI_ACTZWAVE_PID 0xF2D0 +/* www.starting-point-systems.com µChameleon device */ +#define FTDI_MICRO_CHAMELEON_PID 0xCAA0 /* Product Id */ + /* www.irtrans.de device */ #define FTDI_IRTRANS_PID 0xFC60 /* Product Id */ -- cgit v1.2.3 From 34f8e761724ecbfe46246f3faa4c7dbfc3555c26 Mon Sep 17 00:00:00 2001 From: Pete Zaitcev Date: Wed, 21 Jun 2006 15:00:45 -0700 Subject: [PATCH] USB: fix usb-serial leaks, oopses on disconnect This fix addresses two issues: - Unattached port structures were not freed - My initial fix for crash when eventd runs a work in a freed port did not go far enough Signed-off-by: Pete Zaitcev Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/usb-serial.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index b59a0536ea5..5be79cf06fa 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -40,6 +40,8 @@ #define DRIVER_AUTHOR "Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux/" #define DRIVER_DESC "USB Serial Driver core" +static void port_free(struct usb_serial_port *port); + /* Driver structure we register with the USB core */ static struct usb_driver usb_serial_driver = { .name = "usbserial", @@ -146,23 +148,10 @@ static void destroy_serial(struct kref *kref) port = serial->port[i]; if (!port) continue; - usb_kill_urb(port->read_urb); - usb_free_urb(port->read_urb); - usb_kill_urb(port->write_urb); - usb_free_urb(port->write_urb); - usb_kill_urb(port->interrupt_in_urb); - usb_free_urb(port->interrupt_in_urb); - usb_kill_urb(port->interrupt_out_urb); - usb_free_urb(port->interrupt_out_urb); - kfree(port->bulk_in_buffer); - kfree(port->bulk_out_buffer); - kfree(port->interrupt_in_buffer); - kfree(port->interrupt_out_buffer); + port_free(port); } } - flush_scheduled_work(); /* port->work */ - usb_put_dev(serial->dev); /* free up any memory that we allocated */ @@ -564,6 +553,11 @@ static void port_release(struct device *dev) struct usb_serial_port *port = to_usb_serial_port(dev); dbg ("%s - %s", __FUNCTION__, dev->bus_id); + port_free(port); +} + +static void port_free(struct usb_serial_port *port) +{ usb_kill_urb(port->read_urb); usb_free_urb(port->read_urb); usb_kill_urb(port->write_urb); @@ -576,6 +570,7 @@ static void port_release(struct device *dev) kfree(port->bulk_out_buffer); kfree(port->interrupt_in_buffer); kfree(port->interrupt_out_buffer); + flush_scheduled_work(); /* port->work */ kfree(port); } -- cgit v1.2.3 From bd97c4f035b47c1a3ae5cc5ceccdda028b25e9d5 Mon Sep 17 00:00:00 2001 From: Pete Zaitcev Date: Wed, 21 Jun 2006 15:03:40 -0700 Subject: [PATCH] USB: fix visor leaks This patch fixes blatant leaks in visor driver and makes it report mode sensible things in ->write_room (this is only needed if your visor is a terminal though). It is made to fit into 80 columns with a temporary variable. Might even save a few instructions... Signed-off-by: Pete Zaitcev Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/visor.c | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index 95a2936e902..cbc21465f4f 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c @@ -435,13 +435,25 @@ static int visor_write (struct usb_serial_port *port, const unsigned char *buf, static int visor_write_room (struct usb_serial_port *port) { + struct visor_private *priv = usb_get_serial_port_data(port); + unsigned long flags; + dbg("%s - port %d", __FUNCTION__, port->number); /* * We really can take anything the user throws at us * but let's pick a nice big number to tell the tty - * layer that we have lots of free space + * layer that we have lots of free space, unless we don't. */ + + spin_lock_irqsave(&priv->lock, flags); + if (priv->outstanding_urbs > URB_UPPER_LIMIT * 2 / 3) { + spin_unlock_irqrestore(&priv->lock, flags); + dbg("%s - write limit hit\n", __FUNCTION__); + return 0; + } + spin_unlock_irqrestore(&priv->lock, flags); + return 2048; } @@ -758,15 +770,22 @@ static int visor_calc_num_ports (struct usb_serial *serial) static int generic_startup(struct usb_serial *serial) { + struct usb_serial_port **ports = serial->port; struct visor_private *priv; int i; for (i = 0; i < serial->num_ports; ++i) { priv = kzalloc (sizeof(*priv), GFP_KERNEL); - if (!priv) + if (!priv) { + while (i-- != 0) { + priv = usb_get_serial_port_data(ports[i]); + usb_set_serial_port_data(ports[i], NULL); + kfree(priv); + } return -ENOMEM; + } spin_lock_init(&priv->lock); - usb_set_serial_port_data(serial->port[i], priv); + usb_set_serial_port_data(ports[i], priv); } return 0; } @@ -876,7 +895,18 @@ static int clie_5_attach (struct usb_serial *serial) static void visor_shutdown (struct usb_serial *serial) { + struct visor_private *priv; + int i; + dbg("%s", __FUNCTION__); + + for (i = 0; i < serial->num_ports; i++) { + priv = usb_get_serial_port_data(serial->port[i]); + if (priv) { + usb_set_serial_port_data(serial->port[i], NULL); + kfree(priv); + } + } } static int visor_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg) -- cgit v1.2.3 From 3b92847425a98d26ad9d2b8682d3ce6020c90752 Mon Sep 17 00:00:00 2001 From: Matthew Meno Date: Wed, 21 Jun 2006 15:25:53 -0400 Subject: [PATCH] USB: Support for Susteen Datapilot Universal-2 cable in pl2303 The Susteen Datapilot cable (http://www.susteen.com/productdetail/71/producthl/Notempty) has an internal pl2303 to communicate with a set of dummy connector-ends that connect to a variety of cell phones. I've found that it works right out of the box by simply adding the product/vendor id to the pl2303 driver. Signed-off-by: Matt Meno Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/pl2303.c | 1 + drivers/usb/serial/pl2303.h | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 93d623a0d09..559330eb312 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -80,6 +80,7 @@ static struct usb_device_id id_table [] = { { USB_DEVICE(LEADTEK_VENDOR_ID, LEADTEK_9531_PRODUCT_ID) }, { USB_DEVICE(SPEEDDRAGON_VENDOR_ID, SPEEDDRAGON_PRODUCT_ID) }, { USB_DEVICE(OTI_VENDOR_ID, OTI_PRODUCT_ID) }, + { USB_DEVICE(DATAPILOT_U2_VENDOR_ID, DATAPILOT_U2_PRODUCT_ID) }, { } /* Terminating entry */ }; diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h index cb2abad3a37..d9c1e6e0b4b 100644 --- a/drivers/usb/serial/pl2303.h +++ b/drivers/usb/serial/pl2303.h @@ -85,3 +85,7 @@ /* Ours Technology Inc DKU-5 clone, chipset: Prolific Technology Inc */ #define OTI_VENDOR_ID 0x0ea0 #define OTI_PRODUCT_ID 0x6858 + +/* DATAPILOT Universal-2 Phone Cable */ +#define DATAPILOT_U2_VENDOR_ID 0x0731 +#define DATAPILOT_U2_PRODUCT_ID 0x2003 -- cgit v1.2.3 From 00d6058ac93048b525b86fa48b413dcb87ac2728 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Mon, 26 Jun 2006 11:44:22 +0100 Subject: [PATCH] USB serial visor: fix race in open/close The anti user-DoS mechanism in the USB serial 'visor' driver can fail in the following way: visor_open: priv->outstanding_urbs = 0 visor_write: ++priv->outstanding_urbs visor_close: visor_open: priv->outstanding_urbs = 0 visor_write_bulk_callback: --priv->outstanding_urbs So priv->outstanding_urbs ends up as (unsigned long)(-1). Not good! I haven't seen this happen with the visor driver as I don't have the hardware, but I have seen it while testing a patch to implement the same functionality in the ftdi_sio driver (patch not yet submitted). The fix is pretty simple: don't reinitialize outstanding_urbs in visor_open. (Again, I haven't tested the fix in visor, but I have tested it in ftdi_sio.) Signed-off-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/visor.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index cbc21465f4f..32c3c628898 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c @@ -302,7 +302,6 @@ static int visor_open (struct usb_serial_port *port, struct file *filp) spin_lock_irqsave(&priv->lock, flags); priv->bytes_in = 0; priv->bytes_out = 0; - priv->outstanding_urbs = 0; priv->throttled = 0; spin_unlock_irqrestore(&priv->lock, flags); -- cgit v1.2.3 From 224654004ca688af67cec44d9300e8c3f647577c Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Mon, 26 Jun 2006 12:59:17 +0100 Subject: [PATCH] USB serial ftdi_sio: Prevent userspace DoS This patch limits the amount of outstanding 'write' data that can be queued up for the ftdi_sio driver, to prevent userspace DoS attacks (or simple accidents) that use up all the system memory by writing lots of data to the serial port. The original patch was by Guillaume Autran, who in turn based it on the same mechanism implemented in the 'visor' driver. I (Ian Abbott) re-targeted the patch to the latest sources, fixed a couple of errors, renamed his new structure members, and updated the implementations of the 'write_room' and 'chars_in_buffer' methods to take account of the number of outstanding 'write' bytes. It seems to work fine, though at low baud rates it is still possible to queue up an amount of data that takes an age to shift (a job for another day!). Signed-off-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ftdi_sio.c | 103 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 90 insertions(+), 13 deletions(-) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 9cf4069895c..ff06c01a555 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -550,11 +550,17 @@ struct ftdi_private { spinlock_t rx_lock; /* spinlock for receive state */ struct work_struct rx_work; int rx_processed; + unsigned long rx_bytes; __u16 interface; /* FT2232C port interface (0 for FT232/245) */ int force_baud; /* if non-zero, force the baud rate to this value */ int force_rtscts; /* if non-zero, force RTS-CTS to always be enabled */ + + spinlock_t tx_lock; /* spinlock for transmit state */ + unsigned long tx_bytes; + unsigned long tx_outstanding_bytes; + unsigned long tx_outstanding_urbs; }; /* Used for TIOCMIWAIT */ @@ -628,6 +634,9 @@ static struct usb_serial_driver ftdi_sio_device = { #define HIGH 1 #define LOW 0 +/* number of outstanding urbs to prevent userspace DoS from happening */ +#define URB_UPPER_LIMIT 42 + /* * *************************************************************************** * Utlity functions @@ -1158,6 +1167,7 @@ static int ftdi_sio_attach (struct usb_serial *serial) } spin_lock_init(&priv->rx_lock); + spin_lock_init(&priv->tx_lock); init_waitqueue_head(&priv->delta_msr_wait); /* This will push the characters through immediately rather than queue a task to deliver them */ @@ -1272,6 +1282,13 @@ static int ftdi_open (struct usb_serial_port *port, struct file *filp) dbg("%s", __FUNCTION__); + spin_lock_irqsave(&priv->tx_lock, flags); + priv->tx_bytes = 0; + spin_unlock_irqrestore(&priv->tx_lock, flags); + spin_lock_irqsave(&priv->rx_lock, flags); + priv->rx_bytes = 0; + spin_unlock_irqrestore(&priv->rx_lock, flags); + if (port->tty) port->tty->low_latency = (priv->flags & ASYNC_LOW_LATENCY) ? 1 : 0; @@ -1374,6 +1391,7 @@ static int ftdi_write (struct usb_serial_port *port, int data_offset ; /* will be 1 for the SIO and 0 otherwise */ int status; int transfer_size; + unsigned long flags; dbg("%s port %d, %d bytes", __FUNCTION__, port->number, count); @@ -1381,6 +1399,13 @@ static int ftdi_write (struct usb_serial_port *port, dbg("write request of 0 bytes"); return 0; } + spin_lock_irqsave(&priv->tx_lock, flags); + if (priv->tx_outstanding_urbs > URB_UPPER_LIMIT) { + spin_unlock_irqrestore(&priv->tx_lock, flags); + dbg("%s - write limit hit\n", __FUNCTION__); + return 0; + } + spin_unlock_irqrestore(&priv->tx_lock, flags); data_offset = priv->write_offset; dbg("data_offset set to %d",data_offset); @@ -1447,6 +1472,12 @@ static int ftdi_write (struct usb_serial_port *port, err("%s - failed submitting write urb, error %d", __FUNCTION__, status); count = status; kfree (buffer); + } else { + spin_lock_irqsave(&priv->tx_lock, flags); + ++priv->tx_outstanding_urbs; + priv->tx_outstanding_bytes += count; + priv->tx_bytes += count; + spin_unlock_irqrestore(&priv->tx_lock, flags); } /* we are done with this urb, so let the host driver @@ -1462,7 +1493,11 @@ static int ftdi_write (struct usb_serial_port *port, static void ftdi_write_bulk_callback (struct urb *urb, struct pt_regs *regs) { + unsigned long flags; struct usb_serial_port *port = (struct usb_serial_port *)urb->context; + struct ftdi_private *priv; + int data_offset; /* will be 1 for the SIO and 0 otherwise */ + unsigned long countback; /* free up the transfer buffer, as usb_free_urb() does not do this */ kfree (urb->transfer_buffer); @@ -1474,34 +1509,67 @@ static void ftdi_write_bulk_callback (struct urb *urb, struct pt_regs *regs) return; } + priv = usb_get_serial_port_data(port); + if (!priv) { + dbg("%s - bad port private data pointer - exiting", __FUNCTION__); + return; + } + /* account for transferred data */ + countback = urb->actual_length; + data_offset = priv->write_offset; + if (data_offset > 0) { + /* Subtract the control bytes */ + countback -= (data_offset * ((countback + (PKTSZ - 1)) / PKTSZ)); + } + spin_lock_irqsave(&priv->tx_lock, flags); + --priv->tx_outstanding_urbs; + priv->tx_outstanding_bytes -= countback; + spin_unlock_irqrestore(&priv->tx_lock, flags); + usb_serial_port_softint(port); } /* ftdi_write_bulk_callback */ static int ftdi_write_room( struct usb_serial_port *port ) { + struct ftdi_private *priv = usb_get_serial_port_data(port); + int room; + unsigned long flags; + dbg("%s - port %d", __FUNCTION__, port->number); - /* - * We really can take anything the user throws at us - * but let's pick a nice big number to tell the tty - * layer that we have lots of free space - */ - return 2048; + spin_lock_irqsave(&priv->tx_lock, flags); + if (priv->tx_outstanding_urbs < URB_UPPER_LIMIT) { + /* + * We really can take anything the user throws at us + * but let's pick a nice big number to tell the tty + * layer that we have lots of free space + */ + room = 2048; + } else { + room = 0; + } + spin_unlock_irqrestore(&priv->tx_lock, flags); + return room; } /* ftdi_write_room */ static int ftdi_chars_in_buffer (struct usb_serial_port *port) { /* ftdi_chars_in_buffer */ + struct ftdi_private *priv = usb_get_serial_port_data(port); + int buffered; + unsigned long flags; + dbg("%s - port %d", __FUNCTION__, port->number); - /* - * We can't really account for how much data we - * have sent out, but hasn't made it through to the - * device, so just tell the tty layer that everything - * is flushed. - */ - return 0; + spin_lock_irqsave(&priv->tx_lock, flags); + buffered = (int)priv->tx_outstanding_bytes; + spin_unlock_irqrestore(&priv->tx_lock, flags); + if (buffered < 0) { + err("%s outstanding tx bytes is negative!", __FUNCTION__); + buffered = 0; + } + return buffered; } /* ftdi_chars_in_buffer */ @@ -1511,6 +1579,8 @@ static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs) struct usb_serial_port *port = (struct usb_serial_port *)urb->context; struct tty_struct *tty; struct ftdi_private *priv; + unsigned long countread; + unsigned long flags; if (urb->number_of_packets > 0) { err("%s transfer_buffer_length %d actual_length %d number of packets %d",__FUNCTION__, @@ -1545,6 +1615,13 @@ static void ftdi_read_bulk_callback (struct urb *urb, struct pt_regs *regs) return; } + /* count data bytes, but not status bytes */ + countread = urb->actual_length; + countread -= 2 * ((countread + (PKTSZ - 1)) / PKTSZ); + spin_lock_irqsave(&priv->rx_lock, flags); + priv->rx_bytes += countread; + spin_unlock_irqrestore(&priv->rx_lock, flags); + ftdi_process_read(port); } /* ftdi_read_bulk_callback */ -- cgit v1.2.3 From 69de51fdda3fd984541978313b66e4f2c44cc23e Mon Sep 17 00:00:00 2001 From: Kevin Lloyd Date: Fri, 30 Jun 2006 11:17:55 -0700 Subject: [PATCH] USB: add driver for non-composite Sierra Wireless devices This patch creates a new driver, sierra.c, that supports the new non-composite Sierra Wireless WWAN devices. The older Sierra Wireless and Airprime devices are supported in airprime.c. Signed-off-by: Kevin Lloyd Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/Kconfig | 11 +++++++ drivers/usb/serial/Makefile | 1 + drivers/usb/serial/sierra.c | 75 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 drivers/usb/serial/sierra.c (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig index 8bd44fda5ea..ac33bd47cfc 100644 --- a/drivers/usb/serial/Kconfig +++ b/drivers/usb/serial/Kconfig @@ -456,6 +456,17 @@ config USB_SERIAL_SAFE_PADDED bool "USB Secure Encapsulated Driver - Padded" depends on USB_SERIAL_SAFE +config USB_SERIAL_SIERRAWIRELESS + tristate "USB Sierra Wireless Driver" + depends on USB_SERIAL + help + Say M here if you want to use a Sierra Wireless device (if + using an PC 5220 or AC580 please use the Airprime driver + instead). + + To compile this driver as a module, choose M here: the + module will be called sierra. + config USB_SERIAL_TI tristate "USB TI 3410/5052 Serial Driver" depends on USB_SERIAL diff --git a/drivers/usb/serial/Makefile b/drivers/usb/serial/Makefile index 5a0960fc9d3..35d4acc7f1d 100644 --- a/drivers/usb/serial/Makefile +++ b/drivers/usb/serial/Makefile @@ -39,6 +39,7 @@ obj-$(CONFIG_USB_SERIAL_OMNINET) += omninet.o obj-$(CONFIG_USB_SERIAL_OPTION) += option.o obj-$(CONFIG_USB_SERIAL_PL2303) += pl2303.o obj-$(CONFIG_USB_SERIAL_SAFE) += safe_serial.o +obj-$(CONFIG_USB_SERIAL_SIERRAWIRELESS) += sierra.o obj-$(CONFIG_USB_SERIAL_TI) += ti_usb_3410_5052.o obj-$(CONFIG_USB_SERIAL_VISOR) += visor.o obj-$(CONFIG_USB_SERIAL_WHITEHEAT) += whiteheat.o diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c new file mode 100644 index 00000000000..8da056ae64d --- /dev/null +++ b/drivers/usb/serial/sierra.c @@ -0,0 +1,75 @@ +/* + * Sierra Wireless CDMA Wireless Serial USB driver + * + * Current Copy modified by: Kevin Lloyd + * Original Copyright (C) 2005-2006 Greg Kroah-Hartman + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License version + * 2 as published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include "usb-serial.h" + +static struct usb_device_id id_table [] = { + { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */ + { USB_DEVICE(0x1199, 0x0020) }, /* Sierra Wireless MC5725 */ + { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */ + { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */ + { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */ + { USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */ + { USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 */ + { USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */ + /* Following devices are supported in the airprime.c driver */ + /* { USB_DEVICE(0x1199, 0x0112) }, */ /* Sierra Wireless AirCard 580 */ + /* { USB_DEVICE(0x0F3D, 0x0112) }, */ /* AirPrime/Sierra PC 5220 */ + { } +}; +MODULE_DEVICE_TABLE(usb, id_table); + +static struct usb_driver sierra_driver = { + .name = "sierra_wireless", + .probe = usb_serial_probe, + .disconnect = usb_serial_disconnect, + .id_table = id_table, +}; + +static struct usb_serial_driver sierra_device = { + .driver = { + .owner = THIS_MODULE, + .name = "Sierra_Wireless", + }, + .id_table = id_table, + .num_interrupt_in = NUM_DONT_CARE, + .num_bulk_in = NUM_DONT_CARE, + .num_bulk_out = NUM_DONT_CARE, + .num_ports = 3, +}; + +static int __init sierra_init(void) +{ + int retval; + + retval = usb_serial_register(&sierra_device); + if (retval) + return retval; + retval = usb_register(&sierra_driver); + if (retval) + usb_serial_deregister(&sierra_device); + return retval; +} + +static void __exit sierra_exit(void) +{ + usb_deregister(&sierra_driver); + usb_serial_deregister(&sierra_device); +} + +module_init(sierra_init); +module_exit(sierra_exit); +MODULE_LICENSE("GPL"); -- cgit v1.2.3 From b512504e5671f83638be0ddb085c4b1832f623d3 Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Fri, 30 Jun 2006 02:34:44 -0700 Subject: [PATCH] USB: ipaq.c bugfixes This patch fixes several problems in the ipaq.c driver with connecting and disconnecting pocketpc devices: * The read urb stayed active if the connect failed, causing nullpointer dereferences later on. * If a write failed, the driver continued as if nothing happened. Now it handles that case the same way as other usb serial devices (fix by Luiz Fernando N. Capitulino ) Signed-off-by: Frank Gevaerts Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ipaq.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index dbcfe172a5c..c021905f063 100644 --- a/drivers/usb/serial/ipaq.c +++ b/drivers/usb/serial/ipaq.c @@ -651,11 +651,6 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, ipaq_read_bulk_callback, port); - result = usb_submit_urb(port->read_urb, GFP_KERNEL); - if (result) { - err("%s - failed submitting read urb, error %d", __FUNCTION__, result); - goto error; - } /* * Send out control message observed in win98 sniffs. Not sure what @@ -670,6 +665,11 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) usb_sndctrlpipe(serial->dev, 0), 0x22, 0x21, 0x1, 0, NULL, 0, 100); if (result == 0) { + result = usb_submit_urb(port->read_urb, GFP_KERNEL); + if (result) { + err("%s - failed submitting read urb, error %d", __FUNCTION__, result); + goto error; + } return 0; } } @@ -854,6 +854,7 @@ static void ipaq_write_bulk_callback(struct urb *urb, struct pt_regs *regs) if (urb->status) { dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status); + return; } spin_lock_irqsave(&write_list_lock, flags); -- cgit v1.2.3 From b33488eb5c27c13c3e88cdf29d344ccdcb0859f2 Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Fri, 30 Jun 2006 02:34:45 -0700 Subject: [PATCH] USB: ipaq.c timing parameters Adds configurable waiting periods to the ipaq connection code. These are not needed when the pocketpc device is running normally when plugged in, but they need extra delays if they are physically connected while rebooting. There are two parameters : * initial_wait : this is the delay before the driver attemts to start the connection. This is needed because the pocktpc device takes much longer to boot if the driver starts sending control packets too soon. * connect_retries : this is the number of times the control urb is retried before finally giving up. The patch also adds a 1 second delay between retries. I'm not sure if the cases where this patch is useful are general enough to include this in the kernel. Signed-off-by: Frank Gevaerts Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ipaq.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index c021905f063..65beea6e54d 100644 --- a/drivers/usb/serial/ipaq.c +++ b/drivers/usb/serial/ipaq.c @@ -70,6 +70,8 @@ static __u16 product, vendor; static int debug; +static int connect_retries = KP_RETRIES; +static int initial_wait; /* Function prototypes for an ipaq */ static int ipaq_open (struct usb_serial_port *port, struct file *filp); @@ -582,7 +584,7 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) struct ipaq_private *priv; struct ipaq_packet *pkt; int i, result = 0; - int retries = KP_RETRIES; + int retries = connect_retries; dbg("%s - port %d", __FUNCTION__, port->number); @@ -646,6 +648,7 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) port->read_urb->transfer_buffer_length = URBDATA_SIZE; port->bulk_out_size = port->write_urb->transfer_buffer_length = URBDATA_SIZE; + msleep(1000*initial_wait); /* Start reading from the device */ usb_fill_bulk_urb(port->read_urb, serial->dev, usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), @@ -672,6 +675,7 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) } return 0; } + msleep(1000); } err("%s - failed doing control urb, error %d", __FUNCTION__, result); goto error; @@ -967,3 +971,9 @@ MODULE_PARM_DESC(vendor, "User specified USB idVendor"); module_param(product, ushort, 0); MODULE_PARM_DESC(product, "User specified USB idProduct"); + +module_param(connect_retries, int, S_IRUGO|S_IWUSR); +MODULE_PARM_DESC(connect_retries, "Maximum number of connect retries (one second each)"); + +module_param(initial_wait, int, S_IRUGO|S_IWUSR); +MODULE_PARM_DESC(initial_wait, "Time to wait before attempting a connection (in seconds)"); -- cgit v1.2.3 From b2f1b0d4649a6597c7320bf359e71014653c630d Mon Sep 17 00:00:00 2001 From: Bart Oldeman Date: Sun, 2 Jul 2006 15:07:10 +1200 Subject: [PATCH] USB: ipw.c driver fix The below patch fixes the ipw module in kernel 2.6.17 for me; without this change it simply does not work at all (all but the first writes are refused because write_urb_busy is always 1). This problem was there in 2.6.15 as well, but at that point I used the (updated) ipw.c, version 0.4, from http://www.neology.co.za/products/opensource/ipwireless/ which no longer compiles with 2.6.17. It can be made to after a few changes but obviously it's easier if the built-in ipw driver works instead of having to download one from the neology site. From: Bart Oldeman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ipw.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c index a4a0bfeaab0..4d5275e4dea 100644 --- a/drivers/usb/serial/ipw.c +++ b/drivers/usb/serial/ipw.c @@ -373,6 +373,8 @@ static void ipw_write_bulk_callback(struct urb *urb, struct pt_regs *regs) dbg("%s", __FUNCTION__); + port->write_urb_busy = 0; + if (urb->status) dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status); -- cgit v1.2.3 From e37de9e0d6591706a76cff63582cbc721c317333 Mon Sep 17 00:00:00 2001 From: Matthias Urlichs Date: Thu, 6 Jul 2006 13:12:53 +0200 Subject: [PATCH] USB: Option driver: new product ID Yet another "same name, somewhat different hardware" product. Signed-Off-By: Matthias Urlichs Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/option.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 78ad4b3126a..96e641941e5 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -35,6 +35,7 @@ 2006-06-01 v0.6.2 add backwards-compatibility stuff 2006-06-01 v0.6.3 add Novatel Wireless 2006-06-01 v0.7 Option => GSM + 2006-06-01 v0.7.1 add COBRA2 Work sponsored by: Sigos GmbH, Germany @@ -53,7 +54,7 @@ device features. */ -#define DRIVER_VERSION "v0.7.0" +#define DRIVER_VERSION "v0.7.1" #define DRIVER_AUTHOR "Matthias Urlichs " #define DRIVER_DESC "USB Driver for GSM modems" @@ -102,6 +103,7 @@ static int option_send_setup(struct usb_serial_port *port); #define OPTION_PRODUCT_FUSION 0x6000 #define OPTION_PRODUCT_FUSION2 0x6300 #define OPTION_PRODUCT_COBRA 0x6500 +#define OPTION_PRODUCT_COBRA2 0x6600 #define HUAWEI_PRODUCT_E600 0x1001 #define AUDIOVOX_PRODUCT_AIRCARD 0x0112 #define SIERRAWIRELESS_PRODUCT_MC8755 0x6802 @@ -112,6 +114,7 @@ static struct usb_device_id option_ids[] = { { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) }, + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, { USB_DEVICE(SIERRAWIRELESS_VENDOR_ID, SIERRAWIRELESS_PRODUCT_MC8755) }, @@ -124,6 +127,7 @@ static struct usb_device_id option_ids1[] = { { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) }, + { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, -- cgit v1.2.3 From e1979fef347f534c3797eaa3e10825235ed72766 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Tue, 11 Jul 2006 11:36:43 +0200 Subject: [PATCH] USB: Add one VID/PID to ftdi_sio This patch adds the Testo USB interface to the list of devices recognized by the ftdi_sio module. This device is based on a FT232BL chip, and is used as an interface to get data from digital sensors (thermometer, etc). See http://www.testo.com/ Signed-off-by: Colin Leroy Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio.h | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index ff06c01a555..0b9baaf0da9 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -502,6 +502,7 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, { USB_DEVICE(FTDI_VID, FTDI_YEI_SERVOCENTER31_PID) }, { USB_DEVICE(FTDI_VID, FTDI_THORLABS_PID) }, + { USB_DEVICE(TESTO_VID, TESTO_USB_INTERFACE_PID) }, { }, /* Optional parameter entry */ { } /* Terminating entry */ }; diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index 024e5512d60..04ef90fcb87 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h @@ -450,6 +450,13 @@ */ #define FTDI_THORLABS_PID 0xfaf0 /* ThorLabs USB motor drivers */ +/* + * Testo products (http://www.testo.com/) + * Submitted by Colin Leroy + */ +#define TESTO_VID 0x128D +#define TESTO_USB_INTERFACE_PID 0x0001 + /* Commands */ #define FTDI_SIO_RESET 0 /* Reset the port */ #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ -- cgit v1.2.3 From 166ffccfd4556ac6a777982d193ae145bb0a21e0 Mon Sep 17 00:00:00 2001 From: "Luiz Fernando N. Capitulino" Date: Tue, 11 Jul 2006 14:19:25 -0300 Subject: [PATCH] USB: Anydata: Fixes wrong URB callback. Anydata is using usb_serial_generic_write_bulk_callback() for its read URB, but it should use usb_serial_generic_read_bulk_callback() instead (it's a read URB, isn't it?). Reported by Jon K Hellan . Signed-off-by: Luiz Fernando N. Capitulino Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/anydata.c | 2 +- drivers/usb/serial/generic.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/anydata.c b/drivers/usb/serial/anydata.c index 343f6f22822..dadf2838f94 100644 --- a/drivers/usb/serial/anydata.c +++ b/drivers/usb/serial/anydata.c @@ -71,7 +71,7 @@ static int anydata_open(struct usb_serial_port *port, struct file *filp) port->bulk_in_endpointAddress), port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, - usb_serial_generic_write_bulk_callback, port); + usb_serial_generic_read_bulk_callback, port); result = usb_submit_urb(port->read_urb, GFP_KERNEL); if (result) dev_err(&port->dev, diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 945b8bb38c9..99872e13ba2 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c @@ -285,6 +285,7 @@ void usb_serial_generic_read_bulk_callback (struct urb *urb, struct pt_regs *reg if (result) dev_err(&port->dev, "%s - failed resubmitting read urb, error %d\n", __FUNCTION__, result); } +EXPORT_SYMBOL_GPL(usb_serial_generic_read_bulk_callback); void usb_serial_generic_write_bulk_callback (struct urb *urb, struct pt_regs *regs) { -- cgit v1.2.3 From a969888ce91673c7f4b86520d851a6f0d5a5fa7d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 11 Jul 2006 21:22:58 -0700 Subject: [PATCH] USB: move usb-serial.h to include/linux/usb/ USB serial outside of the kernel tree can not build properly due to usb-serial.h being buried down in the source tree. This patch moves the location of the file to include/linux/usb and fixes up all of the usb serial drivers to handle the move properly. Cc: Sergei Organov Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/airprime.c | 2 +- drivers/usb/serial/anydata.c | 2 +- drivers/usb/serial/ark3116.c | 2 +- drivers/usb/serial/belkin_sa.c | 2 +- drivers/usb/serial/bus.c | 2 +- drivers/usb/serial/console.c | 3 +- drivers/usb/serial/cp2101.c | 2 +- drivers/usb/serial/cyberjack.c | 2 +- drivers/usb/serial/cypress_m8.c | 2 +- drivers/usb/serial/digi_acceleport.c | 2 +- drivers/usb/serial/empeg.c | 2 +- drivers/usb/serial/ezusb.c | 2 +- drivers/usb/serial/ftdi_sio.c | 2 +- drivers/usb/serial/funsoft.c | 2 +- drivers/usb/serial/garmin_gps.c | 3 +- drivers/usb/serial/generic.c | 2 +- drivers/usb/serial/hp4x.c | 2 +- drivers/usb/serial/io_edgeport.c | 2 +- drivers/usb/serial/io_ti.c | 2 +- drivers/usb/serial/ipaq.c | 2 +- drivers/usb/serial/ipw.c | 2 +- drivers/usb/serial/ir-usb.c | 2 +- drivers/usb/serial/keyspan.c | 2 +- drivers/usb/serial/keyspan_pda.c | 3 +- drivers/usb/serial/kl5kusb105.c | 2 +- drivers/usb/serial/kobil_sct.c | 2 +- drivers/usb/serial/mct_u232.c | 2 +- drivers/usb/serial/navman.c | 2 +- drivers/usb/serial/omninet.c | 2 +- drivers/usb/serial/option.c | 2 +- drivers/usb/serial/pl2303.c | 2 +- drivers/usb/serial/safe_serial.c | 2 +- drivers/usb/serial/sierra.c | 2 +- drivers/usb/serial/ti_usb_3410_5052.c | 2 +- drivers/usb/serial/usb-serial.c | 2 +- drivers/usb/serial/usb-serial.h | 300 ---------------------------------- drivers/usb/serial/visor.c | 2 +- drivers/usb/serial/whiteheat.c | 2 +- 38 files changed, 37 insertions(+), 340 deletions(-) delete mode 100644 drivers/usb/serial/usb-serial.h (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c index 94b9ba0ff87..62082532a8b 100644 --- a/drivers/usb/serial/airprime.c +++ b/drivers/usb/serial/airprime.c @@ -13,7 +13,7 @@ #include #include #include -#include "usb-serial.h" +#include static struct usb_device_id id_table [] = { { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */ diff --git a/drivers/usb/serial/anydata.c b/drivers/usb/serial/anydata.c index dadf2838f94..01843ef8c11 100644 --- a/drivers/usb/serial/anydata.c +++ b/drivers/usb/serial/anydata.c @@ -13,7 +13,7 @@ #include #include #include -#include "usb-serial.h" +#include static struct usb_device_id id_table [] = { { USB_DEVICE(0x16d5, 0x6501) }, /* AirData CDMA device */ diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c index 8dec796222a..970d9ef0a7a 100644 --- a/drivers/usb/serial/ark3116.c +++ b/drivers/usb/serial/ark3116.c @@ -21,7 +21,7 @@ #include #include #include -#include "usb-serial.h" +#include static int debug; diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c index 3faa7aa0111..70ece9e01ce 100644 --- a/drivers/usb/serial/belkin_sa.c +++ b/drivers/usb/serial/belkin_sa.c @@ -74,7 +74,7 @@ #include #include #include -#include "usb-serial.h" +#include #include "belkin_sa.h" static int debug; diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c index f2d993b70c1..6542f220468 100644 --- a/drivers/usb/serial/bus.c +++ b/drivers/usb/serial/bus.c @@ -13,7 +13,7 @@ #include #include #include -#include "usb-serial.h" +#include static int usb_serial_device_match (struct device *dev, struct device_driver *drv) { diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c index 3d456b32c31..3a9073dbfe6 100644 --- a/drivers/usb/serial/console.c +++ b/drivers/usb/serial/console.c @@ -17,11 +17,10 @@ #include #include #include +#include static int debug; -#include "usb-serial.h" - struct usbcons_info { int magic; int break_flag; diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c index df0a4f98b4a..486c7411b9a 100644 --- a/drivers/usb/serial/cp2101.c +++ b/drivers/usb/serial/cp2101.c @@ -26,7 +26,7 @@ #include #include #include -#include "usb-serial.h" +#include /* * Version Information diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c index 49b51ab0d4c..6286aba86fa 100644 --- a/drivers/usb/serial/cyberjack.c +++ b/drivers/usb/serial/cyberjack.c @@ -39,7 +39,7 @@ #include #include #include -#include "usb-serial.h" +#include #define CYBERJACK_LOCAL_BUF_SIZE 32 diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index 4ff2dfb299b..ee70fddcab6 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c @@ -59,11 +59,11 @@ #include #include #include +#include #include #include #include -#include "usb-serial.h" #include "cypress_m8.h" diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index 6953d3ef573..9b225183fc7 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c @@ -246,7 +246,7 @@ #include #include #include -#include "usb-serial.h" +#include /* Defines */ diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c index 1e2b31eeb49..daafe405d86 100644 --- a/drivers/usb/serial/empeg.c +++ b/drivers/usb/serial/empeg.c @@ -62,7 +62,7 @@ #include #include #include -#include "usb-serial.h" +#include static int debug; diff --git a/drivers/usb/serial/ezusb.c b/drivers/usb/serial/ezusb.c index debc3b0f966..5169c2d154a 100644 --- a/drivers/usb/serial/ezusb.c +++ b/drivers/usb/serial/ezusb.c @@ -15,7 +15,7 @@ #include #include #include -#include "usb-serial.h" +#include /* EZ-USB Control and Status Register. Bit 0 controls 8051 reset */ #define CPUCS_REG 0x7F92 diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 0b9baaf0da9..b458aedc5fb 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -257,7 +257,7 @@ #include #include #include -#include "usb-serial.h" +#include #include "ftdi_sio.h" /* diff --git a/drivers/usb/serial/funsoft.c b/drivers/usb/serial/funsoft.c index 803721b97e2..77b977206a8 100644 --- a/drivers/usb/serial/funsoft.c +++ b/drivers/usb/serial/funsoft.c @@ -13,7 +13,7 @@ #include #include #include -#include "usb-serial.h" +#include static struct usb_device_id id_table [] = { { USB_DEVICE(0x1404, 0xcddc) }, diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c index 1f5d1620baa..727852634be 100644 --- a/drivers/usb/serial/garmin_gps.c +++ b/drivers/usb/serial/garmin_gps.c @@ -35,6 +35,7 @@ #include #include #include +#include /* the mode to be set when the port ist opened */ static int initial_mode = 1; @@ -42,8 +43,6 @@ static int initial_mode = 1; /* debug flag */ static int debug = 0; -#include "usb-serial.h" - #define GARMIN_VENDOR_ID 0x091E /* diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 99872e13ba2..17271355639 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c @@ -17,8 +17,8 @@ #include #include #include +#include #include -#include "usb-serial.h" static int debug; diff --git a/drivers/usb/serial/hp4x.c b/drivers/usb/serial/hp4x.c index 7e06358b031..ebcac701b06 100644 --- a/drivers/usb/serial/hp4x.c +++ b/drivers/usb/serial/hp4x.c @@ -17,7 +17,7 @@ #include #include #include -#include "usb-serial.h" +#include /* * Version Information diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index bd2c05dac2a..c49976c3ad5 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c @@ -44,7 +44,7 @@ #include #include #include -#include "usb-serial.h" +#include #include "io_edgeport.h" #include "io_ionsp.h" /* info for the iosp messages */ #include "io_16654.h" /* 16654 UART defines */ diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 723a12ae87b..17c5b1d2311 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c @@ -39,8 +39,8 @@ #include #include #include +#include -#include "usb-serial.h" #include "io_16654.h" #include "io_usbvend.h" #include "io_ti.h" diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index 65beea6e54d..59c5d999009 100644 --- a/drivers/usb/serial/ipaq.c +++ b/drivers/usb/serial/ipaq.c @@ -55,7 +55,7 @@ #include #include #include -#include "usb-serial.h" +#include #include "ipaq.h" #define KP_RETRIES 100 diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c index 4d5275e4dea..87306cb6f9f 100644 --- a/drivers/usb/serial/ipw.c +++ b/drivers/usb/serial/ipw.c @@ -46,8 +46,8 @@ #include #include #include +#include #include -#include "usb-serial.h" /* * Version Information diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c index 2cf1fed3de4..1738b0b6a37 100644 --- a/drivers/usb/serial/ir-usb.c +++ b/drivers/usb/serial/ir-usb.c @@ -57,7 +57,7 @@ #include #include #include -#include "usb-serial.h" +#include /* * Version Information diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index d7c58f1bc96..015ad6cc1bb 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c @@ -107,7 +107,7 @@ #include #include #include -#include "usb-serial.h" +#include #include "keyspan.h" static int debug; diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c index 03ab3c0f3cc..49b8dc039d1 100644 --- a/drivers/usb/serial/keyspan_pda.c +++ b/drivers/usb/serial/keyspan_pda.c @@ -78,6 +78,7 @@ #include #include #include +#include static int debug; @@ -107,8 +108,6 @@ struct ezusb_hex_record { #include "xircom_pgs_fw.h" #endif -#include "usb-serial.h" - /* * Version Information */ diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c index b45ff3e7ab4..2a2f3e2da05 100644 --- a/drivers/usb/serial/kl5kusb105.c +++ b/drivers/usb/serial/kl5kusb105.c @@ -55,7 +55,7 @@ #include #include #include -#include "usb-serial.h" +#include #include "kl5kusb105.h" static int debug; diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c index 45773337477..d50dce03495 100644 --- a/drivers/usb/serial/kobil_sct.c +++ b/drivers/usb/serial/kobil_sct.c @@ -46,8 +46,8 @@ #include #include #include +#include #include -#include "usb-serial.h" #include "kobil_sct.h" static int debug; diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index ca05d3275f3..f4d4305c2c0 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c @@ -75,7 +75,7 @@ #include #include #include -#include "usb-serial.h" +#include #include "mct_u232.h" /* diff --git a/drivers/usb/serial/navman.c b/drivers/usb/serial/navman.c index 7f544081032..ac3f8b5d2c4 100644 --- a/drivers/usb/serial/navman.c +++ b/drivers/usb/serial/navman.c @@ -14,7 +14,7 @@ #include #include #include -#include "usb-serial.h" +#include static int debug; diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c index cfb711a21a4..e49f40913c2 100644 --- a/drivers/usb/serial/omninet.c +++ b/drivers/usb/serial/omninet.c @@ -46,7 +46,7 @@ #include #include #include -#include "usb-serial.h" +#include static int debug; diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 96e641941e5..f0530c1d7b7 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -65,7 +65,7 @@ #include #include #include -#include "usb-serial.h" +#include /* Function prototypes */ static int option_open(struct usb_serial_port *port, struct file *filp); diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 559330eb312..259db31b65c 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -27,7 +27,7 @@ #include #include #include -#include "usb-serial.h" +#include #include "pl2303.h" /* diff --git a/drivers/usb/serial/safe_serial.c b/drivers/usb/serial/safe_serial.c index 897d8447252..789771ecdb1 100644 --- a/drivers/usb/serial/safe_serial.c +++ b/drivers/usb/serial/safe_serial.c @@ -71,7 +71,7 @@ #include #include #include -#include "usb-serial.h" +#include #ifndef CONFIG_USB_SAFE_PADDED diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index 8da056ae64d..d29638daa98 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c @@ -14,7 +14,7 @@ #include #include #include -#include "usb-serial.h" +#include static struct usb_device_id id_table [] = { { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */ diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index a9afff31a92..ac9b8ee52d4 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c @@ -83,8 +83,8 @@ #include #include #include +#include -#include "usb-serial.h" #include "ti_usb_3410_5052.h" #include "ti_fw_3410.h" /* firmware image for 3410 */ #include "ti_fw_5052.h" /* firmware image for 5052 */ diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 5be79cf06fa..12c1694d322 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -31,7 +31,7 @@ #include #include #include -#include "usb-serial.h" +#include #include "pl2303.h" /* diff --git a/drivers/usb/serial/usb-serial.h b/drivers/usb/serial/usb-serial.h deleted file mode 100644 index 0f2802a6019..00000000000 --- a/drivers/usb/serial/usb-serial.h +++ /dev/null @@ -1,300 +0,0 @@ -/* - * USB Serial Converter driver - * - * Copyright (C) 1999 - 2005 - * Greg Kroah-Hartman (greg@kroah.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License. - * - */ - - -#ifndef __LINUX_USB_SERIAL_H -#define __LINUX_USB_SERIAL_H - -#include -#include - -#define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ -#define SERIAL_TTY_MINORS 255 /* loads of devices :) */ - -#define MAX_NUM_PORTS 8 /* The maximum number of ports one device can grab at once */ - -/* parity check flag */ -#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) - -/** - * usb_serial_port: structure for the specific ports of a device. - * @serial: pointer back to the struct usb_serial owner of this port. - * @tty: pointer to the corresponding tty for this port. - * @lock: spinlock to grab when updating portions of this structure. - * @mutex: mutex used to synchronize serial_open() and serial_close() - * access for this port. - * @number: the number of the port (the minor number). - * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. - * @interrupt_in_urb: pointer to the interrupt in struct urb for this port. - * @interrupt_in_endpointAddress: endpoint address for the interrupt in pipe - * for this port. - * @interrupt_out_buffer: pointer to the interrupt out buffer for this port. - * @interrupt_out_size: the size of the interrupt_out_buffer, in bytes. - * @interrupt_out_urb: pointer to the interrupt out struct urb for this port. - * @interrupt_out_endpointAddress: endpoint address for the interrupt out pipe - * for this port. - * @bulk_in_buffer: pointer to the bulk in buffer for this port. - * @read_urb: pointer to the bulk in struct urb for this port. - * @bulk_in_endpointAddress: endpoint address for the bulk in pipe for this - * port. - * @bulk_out_buffer: pointer to the bulk out buffer for this port. - * @bulk_out_size: the size of the bulk_out_buffer, in bytes. - * @write_urb: pointer to the bulk out struct urb for this port. - * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this - * port. - * @write_wait: a wait_queue_head_t used by the port. - * @work: work queue entry for the line discipline waking up. - * @open_count: number of times this port has been opened. - * - * This structure is used by the usb-serial core and drivers for the specific - * ports of a device. - */ -struct usb_serial_port { - struct usb_serial * serial; - struct tty_struct * tty; - spinlock_t lock; - struct mutex mutex; - unsigned char number; - - unsigned char * interrupt_in_buffer; - struct urb * interrupt_in_urb; - __u8 interrupt_in_endpointAddress; - - unsigned char * interrupt_out_buffer; - int interrupt_out_size; - struct urb * interrupt_out_urb; - __u8 interrupt_out_endpointAddress; - - unsigned char * bulk_in_buffer; - int bulk_in_size; - struct urb * read_urb; - __u8 bulk_in_endpointAddress; - - unsigned char * bulk_out_buffer; - int bulk_out_size; - struct urb * write_urb; - int write_urb_busy; - __u8 bulk_out_endpointAddress; - - wait_queue_head_t write_wait; - struct work_struct work; - int open_count; - struct device dev; -}; -#define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev) - -/* get and set the port private data pointer helper functions */ -static inline void *usb_get_serial_port_data (struct usb_serial_port *port) -{ - return dev_get_drvdata(&port->dev); -} - -static inline void usb_set_serial_port_data (struct usb_serial_port *port, void *data) -{ - dev_set_drvdata(&port->dev, data); -} - -/** - * usb_serial - structure used by the usb-serial core for a device - * @dev: pointer to the struct usb_device for this device - * @type: pointer to the struct usb_serial_driver for this device - * @interface: pointer to the struct usb_interface for this device - * @minor: the starting minor number for this device - * @num_ports: the number of ports this device has - * @num_interrupt_in: number of interrupt in endpoints we have - * @num_interrupt_out: number of interrupt out endpoints we have - * @num_bulk_in: number of bulk in endpoints we have - * @num_bulk_out: number of bulk out endpoints we have - * @port: array of struct usb_serial_port structures for the different ports. - * @private: place to put any driver specific information that is needed. The - * usb-serial driver is required to manage this data, the usb-serial core - * will not touch this. Use usb_get_serial_data() and - * usb_set_serial_data() to access this. - */ -struct usb_serial { - struct usb_device * dev; - struct usb_serial_driver * type; - struct usb_interface * interface; - unsigned char minor; - unsigned char num_ports; - unsigned char num_port_pointers; - char num_interrupt_in; - char num_interrupt_out; - char num_bulk_in; - char num_bulk_out; - struct usb_serial_port * port[MAX_NUM_PORTS]; - struct kref kref; - void * private; -}; -#define to_usb_serial(d) container_of(d, struct usb_serial, kref) - -#define NUM_DONT_CARE (-1) - -/* get and set the serial private data pointer helper functions */ -static inline void *usb_get_serial_data (struct usb_serial *serial) -{ - return serial->private; -} - -static inline void usb_set_serial_data (struct usb_serial *serial, void *data) -{ - serial->private = data; -} - -/** - * usb_serial_driver - describes a usb serial driver - * @description: pointer to a string that describes this driver. This string used - * in the syslog messages when a device is inserted or removed. - * @id_table: pointer to a list of usb_device_id structures that define all - * of the devices this structure can support. - * @num_interrupt_in: the number of interrupt in endpoints this device will - * have. - * @num_interrupt_out: the number of interrupt out endpoints this device will - * have. - * @num_bulk_in: the number of bulk in endpoints this device will have. - * @num_bulk_out: the number of bulk out endpoints this device will have. - * @num_ports: the number of different ports this device will have. - * @calc_num_ports: pointer to a function to determine how many ports this - * device has dynamically. It will be called after the probe() - * callback is called, but before attach() - * @probe: pointer to the driver's probe function. - * This will be called when the device is inserted into the system, - * but before the device has been fully initialized by the usb_serial - * subsystem. Use this function to download any firmware to the device, - * or any other early initialization that might be needed. - * Return 0 to continue on with the initialization sequence. Anything - * else will abort it. - * @attach: pointer to the driver's attach function. - * This will be called when the struct usb_serial structure is fully set - * set up. Do any local initialization of the device, or any private - * memory structure allocation at this point in time. - * @shutdown: pointer to the driver's shutdown function. This will be - * called when the device is removed from the system. - * - * This structure is defines a USB Serial driver. It provides all of - * the information that the USB serial core code needs. If the function - * pointers are defined, then the USB serial core code will call them when - * the corresponding tty port functions are called. If they are not - * called, the generic serial function will be used instead. - * - * The driver.owner field should be set to the module owner of this driver. - * The driver.name field should be set to the name of this driver (remember - * it will show up in sysfs, so it needs to be short and to the point. - * Useing the module name is a good idea.) - */ -struct usb_serial_driver { - const char *description; - const struct usb_device_id *id_table; - char num_interrupt_in; - char num_interrupt_out; - char num_bulk_in; - char num_bulk_out; - char num_ports; - - struct list_head driver_list; - struct device_driver driver; - - int (*probe) (struct usb_serial *serial, const struct usb_device_id *id); - int (*attach) (struct usb_serial *serial); - int (*calc_num_ports) (struct usb_serial *serial); - - void (*shutdown) (struct usb_serial *serial); - - int (*port_probe) (struct usb_serial_port *port); - int (*port_remove) (struct usb_serial_port *port); - - /* serial function calls */ - int (*open) (struct usb_serial_port *port, struct file * filp); - void (*close) (struct usb_serial_port *port, struct file * filp); - int (*write) (struct usb_serial_port *port, const unsigned char *buf, int count); - int (*write_room) (struct usb_serial_port *port); - int (*ioctl) (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); - void (*set_termios) (struct usb_serial_port *port, struct termios * old); - void (*break_ctl) (struct usb_serial_port *port, int break_state); - int (*chars_in_buffer) (struct usb_serial_port *port); - void (*throttle) (struct usb_serial_port *port); - void (*unthrottle) (struct usb_serial_port *port); - int (*tiocmget) (struct usb_serial_port *port, struct file *file); - int (*tiocmset) (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear); - - void (*read_int_callback)(struct urb *urb, struct pt_regs *regs); - void (*write_int_callback)(struct urb *urb, struct pt_regs *regs); - void (*read_bulk_callback)(struct urb *urb, struct pt_regs *regs); - void (*write_bulk_callback)(struct urb *urb, struct pt_regs *regs); -}; -#define to_usb_serial_driver(d) container_of(d, struct usb_serial_driver, driver) - -extern int usb_serial_register(struct usb_serial_driver *driver); -extern void usb_serial_deregister(struct usb_serial_driver *driver); -extern void usb_serial_port_softint(struct usb_serial_port *port); - -extern int usb_serial_probe(struct usb_interface *iface, const struct usb_device_id *id); -extern void usb_serial_disconnect(struct usb_interface *iface); - -extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest); -extern int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit); - -/* USB Serial console functions */ -#ifdef CONFIG_USB_SERIAL_CONSOLE -extern void usb_serial_console_init (int debug, int minor); -extern void usb_serial_console_exit (void); -extern void usb_serial_console_disconnect(struct usb_serial *serial); -#else -static inline void usb_serial_console_init (int debug, int minor) { } -static inline void usb_serial_console_exit (void) { } -static inline void usb_serial_console_disconnect(struct usb_serial *serial) {} -#endif - -/* Functions needed by other parts of the usbserial core */ -extern struct usb_serial *usb_serial_get_by_index (unsigned int minor); -extern void usb_serial_put(struct usb_serial *serial); -extern int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp); -extern int usb_serial_generic_write (struct usb_serial_port *port, const unsigned char *buf, int count); -extern void usb_serial_generic_close (struct usb_serial_port *port, struct file *filp); -extern int usb_serial_generic_write_room (struct usb_serial_port *port); -extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port); -extern void usb_serial_generic_read_bulk_callback (struct urb *urb, struct pt_regs *regs); -extern void usb_serial_generic_write_bulk_callback (struct urb *urb, struct pt_regs *regs); -extern void usb_serial_generic_shutdown (struct usb_serial *serial); -extern int usb_serial_generic_register (int debug); -extern void usb_serial_generic_deregister (void); - -extern int usb_serial_bus_register (struct usb_serial_driver *device); -extern void usb_serial_bus_deregister (struct usb_serial_driver *device); - -extern struct usb_serial_driver usb_serial_generic_device; -extern struct bus_type usb_serial_bus_type; -extern struct tty_driver *usb_serial_tty_driver; - -static inline void usb_serial_debug_data(int debug, - struct device *dev, - const char *function, int size, - const unsigned char *data) -{ - int i; - - if (debug) { - dev_printk(KERN_DEBUG, dev, "%s - length = %d, data = ", function, size); - for (i = 0; i < size; ++i) - printk ("%.2x ", data[i]); - printk ("\n"); - } -} - -/* Use our own dbg macro */ -#undef dbg -#define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , ## arg); } while (0) - - - -#endif /* ifdef __LINUX_USB_SERIAL_H */ - diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index 32c3c628898..88949f7884c 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c @@ -25,7 +25,7 @@ #include #include #include -#include "usb-serial.h" +#include #include "visor.h" /* diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c index 540438c3f38..6e6c7934be3 100644 --- a/drivers/usb/serial/whiteheat.c +++ b/drivers/usb/serial/whiteheat.c @@ -79,7 +79,7 @@ #include #include #include -#include "usb-serial.h" +#include #include "whiteheat_fw.h" /* firmware for the ConnectTech WhiteHEAT device */ #include "whiteheat.h" /* WhiteHEAT specific commands */ -- cgit v1.2.3 From b3fdab59b8f5d8e42fa339be74cd015dc1a3192f Mon Sep 17 00:00:00 2001 From: Matthias Urlichs Date: Wed, 2 Aug 2006 16:41:41 -0700 Subject: USB: Option driver: removed change history and linux/version.h include Signed-off-by: Matthias Urlichs Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/option.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index f0530c1d7b7..2a07945c423 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -9,33 +9,7 @@ Portions copied from the Keyspan driver by Hugh Blemings - History: - - 2005-05-19 v0.1 Initial version, based on incomplete docs - and analysis of misbehavior with the standard driver - 2005-05-20 v0.2 Extended the input buffer to avoid losing - random 64-byte chunks of data - 2005-05-21 v0.3 implemented chars_in_buffer() - turned on low_latency - simplified the code somewhat - 2005-05-24 v0.4 option_write() sometimes deadlocked under heavy load - removed some dead code - added sponsor notice - coding style clean-up - 2005-06-20 v0.4.1 add missing braces :-/ - killed end-of-line whitespace - 2005-07-15 v0.4.2 rename WLAN product to FUSION, add FUSION2 - 2005-09-10 v0.4.3 added HUAWEI E600 card and Audiovox AirCard - 2005-09-20 v0.4.4 increased recv buffer size: the card sometimes - wants to send >2000 bytes. - 2006-04-10 v0.5 fixed two array overrun errors :-/ - 2006-04-21 v0.5.1 added support for Sierra Wireless MC8755 - 2006-05-15 v0.6 re-enable multi-port support - 2006-06-01 v0.6.1 add COBRA - 2006-06-01 v0.6.2 add backwards-compatibility stuff - 2006-06-01 v0.6.3 add Novatel Wireless - 2006-06-01 v0.7 Option => GSM - 2006-06-01 v0.7.1 add COBRA2 + History: see the git log. Work sponsored by: Sigos GmbH, Germany -- cgit v1.2.3 From 02b2ac5b0370b1157a5a99f2fdf006644b9b86d5 Mon Sep 17 00:00:00 2001 From: Matthias Urlichs Date: Wed, 2 Aug 2006 16:41:41 -0700 Subject: USB: Option driver: Short driver names were identical The short driver names were not unique, which prevented the driver from actually loading. Also, one of the ioctl pointers was missing. Signed-Off-By: Matthias Urlichs Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/option.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 2a07945c423..283383df130 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -128,7 +128,7 @@ static struct usb_driver option_driver = { static struct usb_serial_driver option_3port_device = { .driver = { .owner = THIS_MODULE, - .name = "option", + .name = "option3", }, .description = "GSM modem (3-port)", .id_table = option_ids3, @@ -143,6 +143,7 @@ static struct usb_serial_driver option_3port_device = { .chars_in_buffer = option_chars_in_buffer, .throttle = option_rx_throttle, .unthrottle = option_rx_unthrottle, + .ioctl = option_ioctl, .set_termios = option_set_termios, .break_ctl = option_break_ctl, .tiocmget = option_tiocmget, @@ -155,7 +156,7 @@ static struct usb_serial_driver option_3port_device = { static struct usb_serial_driver option_1port_device = { .driver = { .owner = THIS_MODULE, - .name = "option", + .name = "option1", }, .description = "GSM modem (1-port)", .id_table = option_ids1, @@ -630,7 +631,6 @@ static void option_setup_urbs(struct usb_serial *serial) dbg("%s", __FUNCTION__); - for (i = 0; i < serial->num_ports; i++) { port = serial->port[i]; portdata = usb_get_serial_port_data(port); -- cgit v1.2.3 From 31fcbb733812bca52e8bee96d62ba56df0fc408b Mon Sep 17 00:00:00 2001 From: Matthias Urlichs Date: Wed, 12 Jul 2006 08:35:29 +0200 Subject: USB: Let option driver handle Anydata CDMA modems. Remove anydata driver. Signed-off-by: Jon K Hellan Signed-Off-By: Matthias Urlichs Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/Kconfig | 24 ++++----- drivers/usb/serial/Makefile | 1 - drivers/usb/serial/anydata.c | 123 ------------------------------------------- drivers/usb/serial/option.c | 4 ++ 4 files changed, 13 insertions(+), 139 deletions(-) delete mode 100644 drivers/usb/serial/anydata.c (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig index ac33bd47cfc..f5b9438c94f 100644 --- a/drivers/usb/serial/Kconfig +++ b/drivers/usb/serial/Kconfig @@ -62,15 +62,6 @@ config USB_SERIAL_AIRPRIME To compile this driver as a module, choose M here: the module will be called airprime. -config USB_SERIAL_ANYDATA - tristate "USB AnyData CDMA Wireless Driver" - depends on USB_SERIAL - help - Say Y here if you want to use a AnyData CDMA device. - - To compile this driver as a module, choose M here: the - module will be called anydata. - config USB_SERIAL_ARK3116 tristate "USB ARK Micro 3116 USB Serial Driver (EXPERIMENTAL)" depends on USB_SERIAL && EXPERIMENTAL @@ -502,15 +493,18 @@ config USB_SERIAL_XIRCOM module will be called keyspan_pda. config USB_SERIAL_OPTION - tristate "USB driver for GSM modems" + tristate "USB driver for GSM and CDMA modems" depends on USB_SERIAL help - Say Y here if you have an "Option" GSM PCMCIA card - (or an OEM version: branded Huawei, Audiovox, or Novatel). + Say Y here if you have a GSM or CDMA modem that's connected to USB. + + This driver also supports several PCMCIA cards which have a + built-in OHCI-USB adapter and an internally-connected GSM modem. + The USB bus on these cards is not accessible externally. - These cards feature a built-in OHCI-USB adapter and an - internally-connected GSM modem. The USB bus is not - accessible externally. + Supported devices include (some of?) those made by: + Option, Huawei, Audiovox, Sierra Wireless, Novatel Wireless, or + Anydata. To compile this driver as a module, choose M here: the module will be called option. diff --git a/drivers/usb/serial/Makefile b/drivers/usb/serial/Makefile index 35d4acc7f1d..8efed2ce1ba 100644 --- a/drivers/usb/serial/Makefile +++ b/drivers/usb/serial/Makefile @@ -12,7 +12,6 @@ usbserial-obj-$(CONFIG_USB_EZUSB) += ezusb.o usbserial-objs := usb-serial.o generic.o bus.o $(usbserial-obj-y) obj-$(CONFIG_USB_SERIAL_AIRPRIME) += airprime.o -obj-$(CONFIG_USB_SERIAL_ANYDATA) += anydata.o obj-$(CONFIG_USB_SERIAL_ARK3116) += ark3116.o obj-$(CONFIG_USB_SERIAL_BELKIN) += belkin_sa.o obj-$(CONFIG_USB_SERIAL_CP2101) += cp2101.o diff --git a/drivers/usb/serial/anydata.c b/drivers/usb/serial/anydata.c deleted file mode 100644 index 01843ef8c11..00000000000 --- a/drivers/usb/serial/anydata.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * AnyData CDMA Serial USB driver - * - * Copyright (C) 2005 Greg Kroah-Hartman - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License version - * 2 as published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include - -static struct usb_device_id id_table [] = { - { USB_DEVICE(0x16d5, 0x6501) }, /* AirData CDMA device */ - { }, -}; -MODULE_DEVICE_TABLE(usb, id_table); - -/* if overridden by the user, then use their value for the size of the - * read and write urbs */ -static int buffer_size; -static int debug; - -static struct usb_driver anydata_driver = { - .name = "anydata", - .probe = usb_serial_probe, - .disconnect = usb_serial_disconnect, - .id_table = id_table, - .no_dynamic_id = 1, -}; - -static int anydata_open(struct usb_serial_port *port, struct file *filp) -{ - char *buffer; - int result = 0; - - dbg("%s - port %d", __FUNCTION__, port->number); - - if (buffer_size) { - /* override the default buffer sizes */ - buffer = kmalloc(buffer_size, GFP_KERNEL); - if (!buffer) { - dev_err(&port->dev, "%s - out of memory.\n", - __FUNCTION__); - return -ENOMEM; - } - kfree (port->read_urb->transfer_buffer); - port->read_urb->transfer_buffer = buffer; - port->read_urb->transfer_buffer_length = buffer_size; - - buffer = kmalloc(buffer_size, GFP_KERNEL); - if (!buffer) { - dev_err(&port->dev, "%s - out of memory.\n", - __FUNCTION__); - return -ENOMEM; - } - kfree (port->write_urb->transfer_buffer); - port->write_urb->transfer_buffer = buffer; - port->write_urb->transfer_buffer_length = buffer_size; - port->bulk_out_size = buffer_size; - } - - /* Start reading from the device */ - usb_fill_bulk_urb(port->read_urb, port->serial->dev, - usb_rcvbulkpipe(port->serial->dev, - port->bulk_in_endpointAddress), - port->read_urb->transfer_buffer, - port->read_urb->transfer_buffer_length, - usb_serial_generic_read_bulk_callback, port); - result = usb_submit_urb(port->read_urb, GFP_KERNEL); - if (result) - dev_err(&port->dev, - "%s - failed submitting read urb, error %d\n", - __FUNCTION__, result); - - return result; -} - -static struct usb_serial_driver anydata_device = { - .driver = { - .owner = THIS_MODULE, - .name = "anydata", - }, - .id_table = id_table, - .num_interrupt_in = NUM_DONT_CARE, - .num_bulk_in = NUM_DONT_CARE, - .num_bulk_out = NUM_DONT_CARE, - .num_ports = 1, - .open = anydata_open, -}; - -static int __init anydata_init(void) -{ - int retval; - - retval = usb_serial_register(&anydata_device); - if (retval) - return retval; - retval = usb_register(&anydata_driver); - if (retval) - usb_serial_deregister(&anydata_device); - return retval; -} - -static void __exit anydata_exit(void) -{ - usb_deregister(&anydata_driver); - usb_serial_deregister(&anydata_device); -} - -module_init(anydata_init); -module_exit(anydata_exit); -MODULE_LICENSE("GPL"); - -module_param(debug, bool, S_IRUGO | S_IWUSR); -MODULE_PARM_DESC(debug, "Debug enabled or not"); -module_param(buffer_size, int, 0); -MODULE_PARM_DESC(buffer_size, "Size of the transfer buffers"); diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 283383df130..b020f13b95b 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -72,6 +72,7 @@ static int option_send_setup(struct usb_serial_port *port); #define AUDIOVOX_VENDOR_ID 0x0F3D #define SIERRAWIRELESS_VENDOR_ID 0x1199 #define NOVATELWIRELESS_VENDOR_ID 0x1410 +#define ANYDATA_VENDOR_ID 0x16d5 #define OPTION_PRODUCT_OLD 0x5000 #define OPTION_PRODUCT_FUSION 0x6000 @@ -82,6 +83,7 @@ static int option_send_setup(struct usb_serial_port *port); #define AUDIOVOX_PRODUCT_AIRCARD 0x0112 #define SIERRAWIRELESS_PRODUCT_MC8755 0x6802 #define NOVATELWIRELESS_PRODUCT_U740 0x1400 +#define ANYDATA_PRODUCT_ID 0x6501 static struct usb_device_id option_ids[] = { { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_OLD) }, @@ -93,6 +95,7 @@ static struct usb_device_id option_ids[] = { { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, { USB_DEVICE(SIERRAWIRELESS_VENDOR_ID, SIERRAWIRELESS_PRODUCT_MC8755) }, { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, + { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) }, { } /* Terminating entry */ }; @@ -105,6 +108,7 @@ static struct usb_device_id option_ids1[] = { { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, + { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) }, { } /* Terminating entry */ }; static struct usb_device_id option_ids3[] = { -- cgit v1.2.3 From 7c1c2f73e00b5d0413399a14b7ab9e80db94926f Mon Sep 17 00:00:00 2001 From: Matthias Urlichs Date: Thu, 20 Jul 2006 04:56:00 +0200 Subject: USB: Drop Sierra Wireless MC8755 from the Option driver This device is now supported by sierra.c. From: Matthias Urlichs Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/option.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index b020f13b95b..1df36cb5e05 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -16,7 +16,7 @@ This driver exists because the "normal" serial driver doesn't work too well with GSM modems. Issues: - data loss -- one single Receive URB is not nearly enough - - nonstandard flow (Option devices) and multiplex (Sierra) control + - nonstandard flow (Option devices) control - controlling the baud rate doesn't make sense This driver is named "option" because the most common device it's @@ -70,7 +70,6 @@ static int option_send_setup(struct usb_serial_port *port); #define OPTION_VENDOR_ID 0x0AF0 #define HUAWEI_VENDOR_ID 0x12D1 #define AUDIOVOX_VENDOR_ID 0x0F3D -#define SIERRAWIRELESS_VENDOR_ID 0x1199 #define NOVATELWIRELESS_VENDOR_ID 0x1410 #define ANYDATA_VENDOR_ID 0x16d5 @@ -81,7 +80,6 @@ static int option_send_setup(struct usb_serial_port *port); #define OPTION_PRODUCT_COBRA2 0x6600 #define HUAWEI_PRODUCT_E600 0x1001 #define AUDIOVOX_PRODUCT_AIRCARD 0x0112 -#define SIERRAWIRELESS_PRODUCT_MC8755 0x6802 #define NOVATELWIRELESS_PRODUCT_U740 0x1400 #define ANYDATA_PRODUCT_ID 0x6501 @@ -93,7 +91,6 @@ static struct usb_device_id option_ids[] = { { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, - { USB_DEVICE(SIERRAWIRELESS_VENDOR_ID, SIERRAWIRELESS_PRODUCT_MC8755) }, { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) }, { } /* Terminating entry */ @@ -112,7 +109,6 @@ static struct usb_device_id option_ids1[] = { { } /* Terminating entry */ }; static struct usb_device_id option_ids3[] = { - { USB_DEVICE(SIERRAWIRELESS_VENDOR_ID, SIERRAWIRELESS_PRODUCT_MC8755) }, { } /* Terminating entry */ }; -- cgit v1.2.3 From a01c452ee3a185a35140939c6dca08d77240b863 Mon Sep 17 00:00:00 2001 From: Matthias Urlichs Date: Thu, 20 Jul 2006 05:01:21 +0200 Subject: USB: Removed 3-port device handler from Option driver Dead code. From: Matthias Urlichs Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/option.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 1df36cb5e05..c856e6f40e2 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c @@ -108,9 +108,6 @@ static struct usb_device_id option_ids1[] = { { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) }, { } /* Terminating entry */ }; -static struct usb_device_id option_ids3[] = { - { } /* Terminating entry */ -}; MODULE_DEVICE_TABLE(usb, option_ids); @@ -125,33 +122,6 @@ static struct usb_driver option_driver = { /* The card has three separate interfaces, which the serial driver * recognizes separately, thus num_port=1. */ -static struct usb_serial_driver option_3port_device = { - .driver = { - .owner = THIS_MODULE, - .name = "option3", - }, - .description = "GSM modem (3-port)", - .id_table = option_ids3, - .num_interrupt_in = NUM_DONT_CARE, - .num_bulk_in = NUM_DONT_CARE, - .num_bulk_out = NUM_DONT_CARE, - .num_ports = 3, - .open = option_open, - .close = option_close, - .write = option_write, - .write_room = option_write_room, - .chars_in_buffer = option_chars_in_buffer, - .throttle = option_rx_throttle, - .unthrottle = option_rx_unthrottle, - .ioctl = option_ioctl, - .set_termios = option_set_termios, - .break_ctl = option_break_ctl, - .tiocmget = option_tiocmget, - .tiocmset = option_tiocmset, - .attach = option_startup, - .shutdown = option_shutdown, - .read_int_callback = option_instat_callback, -}; static struct usb_serial_driver option_1port_device = { .driver = { @@ -220,9 +190,6 @@ static int __init option_init(void) retval = usb_serial_register(&option_1port_device); if (retval) goto failed_1port_device_register; - retval = usb_serial_register(&option_3port_device); - if (retval) - goto failed_3port_device_register; retval = usb_register(&option_driver); if (retval) goto failed_driver_register; @@ -232,8 +199,6 @@ static int __init option_init(void) return 0; failed_driver_register: - usb_serial_deregister (&option_3port_device); -failed_3port_device_register: usb_serial_deregister (&option_1port_device); failed_1port_device_register: return retval; @@ -242,7 +207,6 @@ failed_1port_device_register: static void __exit option_exit(void) { usb_deregister (&option_driver); - usb_serial_deregister (&option_3port_device); usb_serial_deregister (&option_1port_device); } -- cgit v1.2.3 From aec0d50b8a86bf04ea8e5885fef4f498d5d3168c Mon Sep 17 00:00:00 2001 From: Norihiko Tomiyama Date: Thu, 13 Jul 2006 09:43:02 +0900 Subject: USB: adding support for SHARP WS003SH to ipaq.c This small patch enables a support of "SHARP WS003SH". "SHARP WS003SH" (usullary called "W-ZERO3") is most polular All-in-one handheld CellPhone-plus-WindowsMobile5.0 in Japan. "SHARP WS003SH" has two modes, "Modem" and "ActiveSync". But, "ActiveSync" mode uses NDIS connection. Therefore, ipaq.c can only support "Modem" mode. http://www.sharp.co.jp/ws/ (Japanese Site) http://greggman.com/edit/editheadlines/2005-12-24.htm From: Norihiko Tomiyama Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ipaq.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index 59c5d999009..7e1bd5d6dfa 100644 --- a/drivers/usb/serial/ipaq.c +++ b/drivers/usb/serial/ipaq.c @@ -250,6 +250,7 @@ static struct usb_device_id ipaq_id_table [] = { { USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */ { USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */ { USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */ + { USB_DEVICE(0x04DD, 0x9102) }, /* SHARP WS003SH USB Modem */ { USB_DEVICE(0x04E8, 0x5F00) }, /* Samsung NEXiO USB Sync */ { USB_DEVICE(0x04E8, 0x5F01) }, /* Samsung NEXiO USB Sync */ { USB_DEVICE(0x04E8, 0x5F02) }, /* Samsung NEXiO USB Sync */ -- cgit v1.2.3 From 274a4bbc9df34d83485e67ad5200a43bd3c69600 Mon Sep 17 00:00:00 2001 From: Dave Platt Date: Tue, 18 Jul 2006 21:26:54 -0700 Subject: USB: Additional PID for the ftdi_sio driver Here's a short patch which adds one PID to the set of devices supported by the ftdi_sio driver. The device in question is a DLP module used as part of a ham radio USB-to-packet adapter. From: Dave Platt Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ftdi_sio.c | 1 + drivers/usb/serial/ftdi_sio.h | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index b458aedc5fb..a20da8528a5 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -337,6 +337,7 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) }, { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) }, { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2101_PID) }, { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2102_PID) }, { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2103_PID) }, diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index 04ef90fcb87..9f7343a4542 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h @@ -182,6 +182,10 @@ /* http://home.earthlink.net/~jrhees/USBUIRT/index.htm */ #define FTDI_USB_UIRT_PID 0xF850 /* Product Id */ +/* TNC-X USB-to-packet-radio adapter, versions prior to 3.0 (DLP module) */ + +#define FTDI_TNC_X_PID 0xEBE0 + /* * ELV USB devices submitted by Christian Abt of ELV (www.elv.de). * All of these devices use FTDI's vendor ID (0x0403). -- cgit v1.2.3 From b7aa94b682dc6b6dcdc01d36f8e65cef5aae81e2 Mon Sep 17 00:00:00 2001 From: Kim Oldfield Date: Tue, 25 Jul 2006 15:54:59 +1000 Subject: USB: New USB ID for Belkin Serial Adapter Can you add the USB IDs for the Belkin USB Serial adapter (P/N F5U257) to the pl2303 driver in the Linux Kernel? Are you the appropriate person to approach for this? I recently purchased a Belkin USB Serial adapter (P/N F5U257) and found that it didn't work. After a bit of experimentation I found that it works with the pl2303 driver once the ID has been added. See attached patch to fix this. Also attached is the output from lsusb -v just in case you require any information from there. From: Kim Oldfield Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/pl2303.c | 1 + drivers/usb/serial/pl2303.h | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'drivers/usb/serial') diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index 259db31b65c..efbbc0adb89 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c @@ -81,6 +81,7 @@ static struct usb_device_id id_table [] = { { USB_DEVICE(SPEEDDRAGON_VENDOR_ID, SPEEDDRAGON_PRODUCT_ID) }, { USB_DEVICE(OTI_VENDOR_ID, OTI_PRODUCT_ID) }, { USB_DEVICE(DATAPILOT_U2_VENDOR_ID, DATAPILOT_U2_PRODUCT_ID) }, + { USB_DEVICE(BELKIN_VENDOR_ID, BELKIN_PRODUCT_ID) }, { } /* Terminating entry */ }; diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h index d9c1e6e0b4b..a692ac66ca6 100644 --- a/drivers/usb/serial/pl2303.h +++ b/drivers/usb/serial/pl2303.h @@ -89,3 +89,7 @@ /* DATAPILOT Universal-2 Phone Cable */ #define DATAPILOT_U2_VENDOR_ID 0x0731 #define DATAPILOT_U2_PRODUCT_ID 0x2003 + +/* Belkin "F5U257" Serial Adapter */ +#define BELKIN_VENDOR_ID 0x050d +#define BELKIN_PRODUCT_ID 0x0257 -- cgit v1.2.3