aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-11 17:48:20 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-11 17:48:20 -0500
commit414a6750e59b0b687034764c464e9ddecac0f7a6 (patch)
tree18a5ceb11359cd72fcb2d31b5eabf3e35328697f /drivers/usb/serial
parentc6bd5bcc4983f1a2d2f87a3769bf309482ee8c04 (diff)
parentfb37ef98015f864d22be223a0e0d93547cd1d4ef (diff)
Merge tag 'usb-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB patches from Greg Kroah-Hartman: "Here's the big set of USB patches for 3.8-rc1. Lots of USB host driver cleanups in here, and a bit of a reorg of the EHCI driver to make it easier for the different EHCI platform drivers to all work together nicer, which was a reduction in overall code. We also deleted some unused firmware files, and got rid of the very old file_storage usb gadget driver that had been broken for a long time. This means we ended up removing way more code than added, always a nice thing to see: 310 files changed, 3028 insertions(+), 10754 deletions(-) Other than that, the usual set of new device ids, driver fixes, gadget driver and controller updates and the like. All of these have been in the linux-next tree for a number of weeks. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" * tag 'usb-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (228 commits) USB: mark uas driver as BROKEN xhci: Add Lynx Point LP to list of Intel switchable hosts uwb: fix uwb_dev_unlock() missed at an error path in uwb_rc_cmd_async() USB: ftdi_sio: Add support for Newport AGILIS motor drivers MAINTAINERS: remove drivers/block/ub.c USB: chipidea: fix use after free bug ezusb: add dependency to USB usb: ftdi_sio: fixup BeagleBone A5+ quirk USB: cp210x: add Virtenio Preon32 device id usb: storage: remove redundant memset() in usb_probe_stor1() USB: option: blacklist network interface on Huawei E173 USB: OHCI: workaround for hardware bug: retired TDs not added to the Done Queue USB: add new zte 3g-dongle's pid to option.c USB: opticon: switch to generic read implementation USB: opticon: refactor reab-urb processing USB: opticon: use usb-serial bulk-in urb USB: opticon: increase bulk-in size USB: opticon: use port as urb context USB: opticon: pass port to get_serial_info USB: opticon: make private data port specific ...
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/aircable.c5
-rw-r--r--drivers/usb/serial/ark3116.c5
-rw-r--r--drivers/usb/serial/belkin_sa.c5
-rw-r--r--drivers/usb/serial/bus.c10
-rw-r--r--drivers/usb/serial/cp210x.c37
-rw-r--r--drivers/usb/serial/cyberjack.c5
-rw-r--r--drivers/usb/serial/cypress_m8.c5
-rw-r--r--drivers/usb/serial/digi_acceleport.c4
-rw-r--r--drivers/usb/serial/empeg.c4
-rw-r--r--drivers/usb/serial/ftdi_sio.c82
-rw-r--r--drivers/usb/serial/ftdi_sio_ids.h6
-rw-r--r--drivers/usb/serial/generic.c1
-rw-r--r--drivers/usb/serial/hp4x.c5
-rw-r--r--drivers/usb/serial/io_edgeport.c4
-rw-r--r--drivers/usb/serial/io_ti.c4
-rw-r--r--drivers/usb/serial/ipaq.c5
-rw-r--r--drivers/usb/serial/ipw.c4
-rw-r--r--drivers/usb/serial/iuu_phoenix.c8
-rw-r--r--drivers/usb/serial/keyspan.c4
-rw-r--r--drivers/usb/serial/keyspan_pda.c4
-rw-r--r--drivers/usb/serial/kl5kusb105.c4
-rw-r--r--drivers/usb/serial/kobil_sct.c2
-rw-r--r--drivers/usb/serial/mct_u232.c4
-rw-r--r--drivers/usb/serial/metro-usb.c2
-rw-r--r--drivers/usb/serial/mos7720.c4
-rw-r--r--drivers/usb/serial/mos7840.c4
-rw-r--r--drivers/usb/serial/omninet.c4
-rw-r--r--drivers/usb/serial/opticon.c351
-rw-r--r--drivers/usb/serial/option.c113
-rw-r--r--drivers/usb/serial/oti6858.c2
-rw-r--r--drivers/usb/serial/quatech2.c2
-rw-r--r--drivers/usb/serial/siemens_mpi.c2
-rw-r--r--drivers/usb/serial/sierra.c3
-rw-r--r--drivers/usb/serial/spcp8x5.c4
-rw-r--r--drivers/usb/serial/ssu100.c2
-rw-r--r--drivers/usb/serial/usb_wwan.c2
-rw-r--r--drivers/usb/serial/vivopay-serial.c3
37 files changed, 251 insertions, 464 deletions
diff --git a/drivers/usb/serial/aircable.c b/drivers/usb/serial/aircable.c
index 54e1bb6372e7..6d110a3bc7e7 100644
--- a/drivers/usb/serial/aircable.c
+++ b/drivers/usb/serial/aircable.c
@@ -68,10 +68,6 @@
68#define THROTTLED 0x01 68#define THROTTLED 0x01
69#define ACTUALLY_THROTTLED 0x02 69#define ACTUALLY_THROTTLED 0x02
70 70
71/*
72 * Version Information
73 */
74#define DRIVER_VERSION "v2.0"
75#define DRIVER_AUTHOR "Naranjo, Manuel Francisco <naranjo.manuel@gmail.com>, Johan Hovold <jhovold@gmail.com>" 71#define DRIVER_AUTHOR "Naranjo, Manuel Francisco <naranjo.manuel@gmail.com>, Johan Hovold <jhovold@gmail.com>"
76#define DRIVER_DESC "AIRcable USB Driver" 72#define DRIVER_DESC "AIRcable USB Driver"
77 73
@@ -192,5 +188,4 @@ module_usb_serial_driver(serial_drivers, id_table);
192 188
193MODULE_AUTHOR(DRIVER_AUTHOR); 189MODULE_AUTHOR(DRIVER_AUTHOR);
194MODULE_DESCRIPTION(DRIVER_DESC); 190MODULE_DESCRIPTION(DRIVER_DESC);
195MODULE_VERSION(DRIVER_VERSION);
196MODULE_LICENSE("GPL"); 191MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
index bd50a8a41a0f..a88882c0e237 100644
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -37,11 +37,6 @@
37#include <linux/mutex.h> 37#include <linux/mutex.h>
38#include <linux/spinlock.h> 38#include <linux/spinlock.h>
39 39
40/*
41 * Version information
42 */
43
44#define DRIVER_VERSION "v0.7"
45#define DRIVER_AUTHOR "Bart Hartgers <bart.hartgers+ark3116@gmail.com>" 40#define DRIVER_AUTHOR "Bart Hartgers <bart.hartgers+ark3116@gmail.com>"
46#define DRIVER_DESC "USB ARK3116 serial/IrDA driver" 41#define DRIVER_DESC "USB ARK3116 serial/IrDA driver"
47#define DRIVER_DEV_DESC "ARK3116 RS232/IrDA" 42#define DRIVER_DEV_DESC "ARK3116 RS232/IrDA"
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
index ea29556f0d72..b72a4c166705 100644
--- a/drivers/usb/serial/belkin_sa.c
+++ b/drivers/usb/serial/belkin_sa.c
@@ -37,10 +37,6 @@
37#include <linux/usb/serial.h> 37#include <linux/usb/serial.h>
38#include "belkin_sa.h" 38#include "belkin_sa.h"
39 39
40/*
41 * Version Information
42 */
43#define DRIVER_VERSION "v1.3"
44#define DRIVER_AUTHOR "William Greathouse <wgreathouse@smva.com>" 40#define DRIVER_AUTHOR "William Greathouse <wgreathouse@smva.com>"
45#define DRIVER_DESC "USB Belkin Serial converter driver" 41#define DRIVER_DESC "USB Belkin Serial converter driver"
46 42
@@ -509,5 +505,4 @@ module_usb_serial_driver(serial_drivers, id_table);
509 505
510MODULE_AUTHOR(DRIVER_AUTHOR); 506MODULE_AUTHOR(DRIVER_AUTHOR);
511MODULE_DESCRIPTION(DRIVER_DESC); 507MODULE_DESCRIPTION(DRIVER_DESC);
512MODULE_VERSION(DRIVER_VERSION);
513MODULE_LICENSE("GPL"); 508MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c
index c15f2e7cefc7..37decb13d7eb 100644
--- a/drivers/usb/serial/bus.c
+++ b/drivers/usb/serial/bus.c
@@ -121,7 +121,6 @@ static int usb_serial_device_remove(struct device *dev)
121 return retval; 121 return retval;
122} 122}
123 123
124#ifdef CONFIG_HOTPLUG
125static ssize_t store_new_id(struct device_driver *driver, 124static ssize_t store_new_id(struct device_driver *driver,
126 const char *buf, size_t count) 125 const char *buf, size_t count)
127{ 126{
@@ -159,15 +158,6 @@ static void free_dynids(struct usb_serial_driver *drv)
159 spin_unlock(&drv->dynids.lock); 158 spin_unlock(&drv->dynids.lock);
160} 159}
161 160
162#else
163static struct driver_attribute drv_attrs[] = {
164 __ATTR_NULL,
165};
166static inline void free_dynids(struct usb_serial_driver *drv)
167{
168}
169#endif
170
171struct bus_type usb_serial_bus_type = { 161struct bus_type usb_serial_bus_type = {
172 .name = "usb-serial", 162 .name = "usb-serial",
173 .match = usb_serial_device_match, 163 .match = usb_serial_device_match,
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index eb033fc92a15..f14736f647ff 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -24,10 +24,6 @@
24#include <linux/uaccess.h> 24#include <linux/uaccess.h>
25#include <linux/usb/serial.h> 25#include <linux/usb/serial.h>
26 26
27/*
28 * Version Information
29 */
30#define DRIVER_VERSION "v0.09"
31#define DRIVER_DESC "Silicon Labs CP210x RS232 serial adaptor driver" 27#define DRIVER_DESC "Silicon Labs CP210x RS232 serial adaptor driver"
32 28
33/* 29/*
@@ -35,8 +31,7 @@
35 */ 31 */
36static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *); 32static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *);
37static void cp210x_close(struct usb_serial_port *); 33static void cp210x_close(struct usb_serial_port *);
38static void cp210x_get_termios(struct tty_struct *, 34static void cp210x_get_termios(struct tty_struct *, struct usb_serial_port *);
39 struct usb_serial_port *port);
40static void cp210x_get_termios_port(struct usb_serial_port *port, 35static void cp210x_get_termios_port(struct usb_serial_port *port,
41 unsigned int *cflagp, unsigned int *baudp); 36 unsigned int *cflagp, unsigned int *baudp);
42static void cp210x_change_speed(struct tty_struct *, struct usb_serial_port *, 37static void cp210x_change_speed(struct tty_struct *, struct usb_serial_port *,
@@ -118,6 +113,7 @@ static const struct usb_device_id id_table[] = {
118 { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */ 113 { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */
119 { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */ 114 { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */
120 { USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */ 115 { USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */
116 { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
121 { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */ 117 { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
122 { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */ 118 { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */
123 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ 119 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
@@ -169,7 +165,7 @@ struct cp210x_serial_private {
169static struct usb_serial_driver cp210x_device = { 165static struct usb_serial_driver cp210x_device = {
170 .driver = { 166 .driver = {
171 .owner = THIS_MODULE, 167 .owner = THIS_MODULE,
172 .name = "cp210x", 168 .name = "cp210x",
173 }, 169 },
174 .id_table = id_table, 170 .id_table = id_table,
175 .num_ports = 1, 171 .num_ports = 1,
@@ -179,7 +175,7 @@ static struct usb_serial_driver cp210x_device = {
179 .close = cp210x_close, 175 .close = cp210x_close,
180 .break_ctl = cp210x_break_ctl, 176 .break_ctl = cp210x_break_ctl,
181 .set_termios = cp210x_set_termios, 177 .set_termios = cp210x_set_termios,
182 .tiocmget = cp210x_tiocmget, 178 .tiocmget = cp210x_tiocmget,
183 .tiocmset = cp210x_tiocmset, 179 .tiocmset = cp210x_tiocmset,
184 .attach = cp210x_startup, 180 .attach = cp210x_startup,
185 .release = cp210x_release, 181 .release = cp210x_release,
@@ -281,7 +277,7 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request,
281 int result, i, length; 277 int result, i, length;
282 278
283 /* Number of integers required to contain the array */ 279 /* Number of integers required to contain the array */
284 length = (((size - 1) | 3) + 1)/4; 280 length = (((size - 1) | 3) + 1) / 4;
285 281
286 buf = kcalloc(length, sizeof(__le32), GFP_KERNEL); 282 buf = kcalloc(length, sizeof(__le32), GFP_KERNEL);
287 if (!buf) { 283 if (!buf) {
@@ -328,12 +324,11 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request,
328 int result, i, length; 324 int result, i, length;
329 325
330 /* Number of integers required to contain the array */ 326 /* Number of integers required to contain the array */
331 length = (((size - 1) | 3) + 1)/4; 327 length = (((size - 1) | 3) + 1) / 4;
332 328
333 buf = kmalloc(length * sizeof(__le32), GFP_KERNEL); 329 buf = kmalloc(length * sizeof(__le32), GFP_KERNEL);
334 if (!buf) { 330 if (!buf) {
335 dev_err(&port->dev, "%s - out of memory.\n", 331 dev_err(&port->dev, "%s - out of memory.\n", __func__);
336 __func__);
337 return -ENOMEM; 332 return -ENOMEM;
338 } 333 }
339 334
@@ -384,7 +379,8 @@ static inline int cp210x_set_config_single(struct usb_serial_port *port,
384 * cp210x_quantise_baudrate 379 * cp210x_quantise_baudrate
385 * Quantises the baud rate as per AN205 Table 1 380 * Quantises the baud rate as per AN205 Table 1
386 */ 381 */
387static unsigned int cp210x_quantise_baudrate(unsigned int baud) { 382static unsigned int cp210x_quantise_baudrate(unsigned int baud)
383{
388 if (baud <= 300) 384 if (baud <= 300)
389 baud = 300; 385 baud = 300;
390 else if (baud <= 600) baud = 600; 386 else if (baud <= 600) baud = 600;
@@ -467,9 +463,7 @@ static void cp210x_get_termios(struct tty_struct *tty,
467 cp210x_get_termios_port(tty->driver_data, 463 cp210x_get_termios_port(tty->driver_data,
468 &tty->termios.c_cflag, &baud); 464 &tty->termios.c_cflag, &baud);
469 tty_encode_baud_rate(tty, baud, baud); 465 tty_encode_baud_rate(tty, baud, baud);
470 } 466 } else {
471
472 else {
473 unsigned int cflag; 467 unsigned int cflag;
474 cflag = 0; 468 cflag = 0;
475 cp210x_get_termios_port(port, &cflag, &baud); 469 cp210x_get_termios_port(port, &cflag, &baud);
@@ -693,8 +687,8 @@ static void cp210x_set_termios(struct tty_struct *tty,
693 break;*/ 687 break;*/
694 default: 688 default:
695 dev_dbg(dev, "cp210x driver does not support the number of bits requested, using 8 bit mode\n"); 689 dev_dbg(dev, "cp210x driver does not support the number of bits requested, using 8 bit mode\n");
696 bits |= BITS_DATA_8; 690 bits |= BITS_DATA_8;
697 break; 691 break;
698 } 692 }
699 if (cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2)) 693 if (cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2))
700 dev_dbg(dev, "Number of data bits requested not supported by device\n"); 694 dev_dbg(dev, "Number of data bits requested not supported by device\n");
@@ -767,7 +761,7 @@ static void cp210x_set_termios(struct tty_struct *tty,
767 761
768} 762}
769 763
770static int cp210x_tiocmset (struct tty_struct *tty, 764static int cp210x_tiocmset(struct tty_struct *tty,
771 unsigned int set, unsigned int clear) 765 unsigned int set, unsigned int clear)
772{ 766{
773 struct usb_serial_port *port = tty->driver_data; 767 struct usb_serial_port *port = tty->driver_data;
@@ -809,7 +803,7 @@ static void cp210x_dtr_rts(struct usb_serial_port *p, int on)
809 cp210x_tiocmset_port(p, 0, TIOCM_DTR|TIOCM_RTS); 803 cp210x_tiocmset_port(p, 0, TIOCM_DTR|TIOCM_RTS);
810} 804}
811 805
812static int cp210x_tiocmget (struct tty_struct *tty) 806static int cp210x_tiocmget(struct tty_struct *tty)
813{ 807{
814 struct usb_serial_port *port = tty->driver_data; 808 struct usb_serial_port *port = tty->driver_data;
815 unsigned int control; 809 unsigned int control;
@@ -829,7 +823,7 @@ static int cp210x_tiocmget (struct tty_struct *tty)
829 return result; 823 return result;
830} 824}
831 825
832static void cp210x_break_ctl (struct tty_struct *tty, int break_state) 826static void cp210x_break_ctl(struct tty_struct *tty, int break_state)
833{ 827{
834 struct usb_serial_port *port = tty->driver_data; 828 struct usb_serial_port *port = tty->driver_data;
835 unsigned int state; 829 unsigned int state;
@@ -874,5 +868,4 @@ static void cp210x_release(struct usb_serial *serial)
874module_usb_serial_driver(serial_drivers, id_table); 868module_usb_serial_driver(serial_drivers, id_table);
875 869
876MODULE_DESCRIPTION(DRIVER_DESC); 870MODULE_DESCRIPTION(DRIVER_DESC);
877MODULE_VERSION(DRIVER_VERSION);
878MODULE_LICENSE("GPL"); 871MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
index 4ee77dcbe690..69a4fa1cee25 100644
--- a/drivers/usb/serial/cyberjack.c
+++ b/drivers/usb/serial/cyberjack.c
@@ -43,10 +43,6 @@
43 43
44#define CYBERJACK_LOCAL_BUF_SIZE 32 44#define CYBERJACK_LOCAL_BUF_SIZE 32
45 45
46/*
47 * Version Information
48 */
49#define DRIVER_VERSION "v1.01"
50#define DRIVER_AUTHOR "Matthias Bruestle" 46#define DRIVER_AUTHOR "Matthias Bruestle"
51#define DRIVER_DESC "REINER SCT cyberJack pinpad/e-com USB Chipcard Reader Driver" 47#define DRIVER_DESC "REINER SCT cyberJack pinpad/e-com USB Chipcard Reader Driver"
52 48
@@ -441,5 +437,4 @@ module_usb_serial_driver(serial_drivers, id_table);
441 437
442MODULE_AUTHOR(DRIVER_AUTHOR); 438MODULE_AUTHOR(DRIVER_AUTHOR);
443MODULE_DESCRIPTION(DRIVER_DESC); 439MODULE_DESCRIPTION(DRIVER_DESC);
444MODULE_VERSION(DRIVER_VERSION);
445MODULE_LICENSE("GPL"); 440MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index f0da1279c114..fd8c35fd452e 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ b/drivers/usb/serial/cypress_m8.c
@@ -50,10 +50,6 @@ static bool stats;
50static int interval; 50static int interval;
51static bool unstable_bauds; 51static bool unstable_bauds;
52 52
53/*
54 * Version Information
55 */
56#define DRIVER_VERSION "v1.10"
57#define DRIVER_AUTHOR "Lonnie Mendez <dignome@gmail.com>, Neil Whelchel <koyama@firstlight.net>" 53#define DRIVER_AUTHOR "Lonnie Mendez <dignome@gmail.com>, Neil Whelchel <koyama@firstlight.net>"
58#define DRIVER_DESC "Cypress USB to Serial Driver" 54#define DRIVER_DESC "Cypress USB to Serial Driver"
59 55
@@ -1303,7 +1299,6 @@ module_usb_serial_driver(serial_drivers, id_table_combined);
1303 1299
1304MODULE_AUTHOR(DRIVER_AUTHOR); 1300MODULE_AUTHOR(DRIVER_AUTHOR);
1305MODULE_DESCRIPTION(DRIVER_DESC); 1301MODULE_DESCRIPTION(DRIVER_DESC);
1306MODULE_VERSION(DRIVER_VERSION);
1307MODULE_LICENSE("GPL"); 1302MODULE_LICENSE("GPL");
1308 1303
1309module_param(stats, bool, S_IRUGO | S_IWUSR); 1304module_param(stats, bool, S_IRUGO | S_IWUSR);
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index b50fa1c6d885..45d4af62967f 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -32,10 +32,6 @@
32 32
33/* Defines */ 33/* Defines */
34 34
35/*
36 * Version Information
37 */
38#define DRIVER_VERSION "v1.80.1.2"
39#define DRIVER_AUTHOR "Peter Berger <pberger@brimson.com>, Al Borchers <borchers@steinerpoint.com>" 35#define DRIVER_AUTHOR "Peter Berger <pberger@brimson.com>, Al Borchers <borchers@steinerpoint.com>"
40#define DRIVER_DESC "Digi AccelePort USB-2/USB-4 Serial Converter driver" 36#define DRIVER_DESC "Digi AccelePort USB-2/USB-4 Serial Converter driver"
41 37
diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c
index 43ede4a1e12c..0f658618db13 100644
--- a/drivers/usb/serial/empeg.c
+++ b/drivers/usb/serial/empeg.c
@@ -28,10 +28,6 @@
28#include <linux/usb.h> 28#include <linux/usb.h>
29#include <linux/usb/serial.h> 29#include <linux/usb/serial.h>
30 30
31/*
32 * Version Information
33 */
34#define DRIVER_VERSION "v1.3"
35#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>, Gary Brubaker <xavyer@ix.netcom.com>" 31#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>, Gary Brubaker <xavyer@ix.netcom.com>"
36#define DRIVER_DESC "USB Empeg Mark I/II Driver" 32#define DRIVER_DESC "USB Empeg Mark I/II Driver"
37 33
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index be845873e23d..0a373b3ae96a 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -73,7 +73,6 @@ struct ftdi_private {
73 char prev_status; /* Used for TIOCMIWAIT */ 73 char prev_status; /* Used for TIOCMIWAIT */
74 bool dev_gone; /* Used to abort TIOCMIWAIT */ 74 bool dev_gone; /* Used to abort TIOCMIWAIT */
75 char transmit_empty; /* If transmitter is empty or not */ 75 char transmit_empty; /* If transmitter is empty or not */
76 struct usb_serial_port *port;
77 __u16 interface; /* FT2232C, FT2232H or FT4232H port interface 76 __u16 interface; /* FT2232C, FT2232H or FT4232H port interface
78 (0 for FT232/245) */ 77 (0 for FT232/245) */
79 78
@@ -192,6 +191,7 @@ static struct usb_device_id id_table_combined [] = {
192 { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_THROTTLE_PID) }, 191 { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_THROTTLE_PID) },
193 { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GATEWAY_PID) }, 192 { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GATEWAY_PID) },
194 { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_PID) }, 193 { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_PID) },
194 { USB_DEVICE(NEWPORT_VID, NEWPORT_AGILIS_PID) },
195 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, 195 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
196 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, 196 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
197 { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) }, 197 { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) },
@@ -923,6 +923,9 @@ static int ftdi_get_icount(struct tty_struct *tty,
923static int ftdi_ioctl(struct tty_struct *tty, 923static int ftdi_ioctl(struct tty_struct *tty,
924 unsigned int cmd, unsigned long arg); 924 unsigned int cmd, unsigned long arg);
925static void ftdi_break_ctl(struct tty_struct *tty, int break_state); 925static void ftdi_break_ctl(struct tty_struct *tty, int break_state);
926static int ftdi_chars_in_buffer(struct tty_struct *tty);
927static int ftdi_get_modem_status(struct tty_struct *tty,
928 unsigned char status[2]);
926 929
927static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base); 930static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base);
928static unsigned short int ftdi_232am_baud_to_divisor(int baud); 931static unsigned short int ftdi_232am_baud_to_divisor(int baud);
@@ -957,6 +960,7 @@ static struct usb_serial_driver ftdi_sio_device = {
957 .ioctl = ftdi_ioctl, 960 .ioctl = ftdi_ioctl,
958 .set_termios = ftdi_set_termios, 961 .set_termios = ftdi_set_termios,
959 .break_ctl = ftdi_break_ctl, 962 .break_ctl = ftdi_break_ctl,
963 .chars_in_buffer = ftdi_chars_in_buffer,
960}; 964};
961 965
962static struct usb_serial_driver * const serial_drivers[] = { 966static struct usb_serial_driver * const serial_drivers[] = {
@@ -1090,6 +1094,7 @@ static int update_mctrl(struct usb_serial_port *port, unsigned int set,
1090 __func__, 1094 __func__,
1091 (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged", 1095 (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged",
1092 (set & TIOCM_RTS) ? "HIGH" : (clear & TIOCM_RTS) ? "LOW" : "unchanged"); 1096 (set & TIOCM_RTS) ? "HIGH" : (clear & TIOCM_RTS) ? "LOW" : "unchanged");
1097 rv = usb_translate_errors(rv);
1093 } else { 1098 } else {
1094 dev_dbg(dev, "%s - DTR %s, RTS %s\n", __func__, 1099 dev_dbg(dev, "%s - DTR %s, RTS %s\n", __func__,
1095 (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged", 1100 (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged",
@@ -1682,7 +1687,6 @@ static int ftdi_sio_port_probe(struct usb_serial_port *port)
1682 1687
1683 kref_init(&priv->kref); 1688 kref_init(&priv->kref);
1684 mutex_init(&priv->cfg_lock); 1689 mutex_init(&priv->cfg_lock);
1685 memset(&priv->icount, 0x00, sizeof(priv->icount));
1686 init_waitqueue_head(&priv->delta_msr_wait); 1690 init_waitqueue_head(&priv->delta_msr_wait);
1687 1691
1688 priv->flags = ASYNC_LOW_LATENCY; 1692 priv->flags = ASYNC_LOW_LATENCY;
@@ -1691,7 +1695,6 @@ static int ftdi_sio_port_probe(struct usb_serial_port *port)
1691 if (quirk && quirk->port_probe) 1695 if (quirk && quirk->port_probe)
1692 quirk->port_probe(priv); 1696 quirk->port_probe(priv);
1693 1697
1694 priv->port = port;
1695 usb_set_serial_port_data(port, priv); 1698 usb_set_serial_port_data(port, priv);
1696 1699
1697 ftdi_determine_type(port); 1700 ftdi_determine_type(port);
@@ -1781,7 +1784,7 @@ static int ftdi_8u2232c_probe(struct usb_serial *serial)
1781 struct usb_device *udev = serial->dev; 1784 struct usb_device *udev = serial->dev;
1782 1785
1783 if ((udev->manufacturer && !strcmp(udev->manufacturer, "CALAO Systems")) || 1786 if ((udev->manufacturer && !strcmp(udev->manufacturer, "CALAO Systems")) ||
1784 (udev->product && !strcmp(udev->product, "BeagleBone/XDS100"))) 1787 (udev->product && !strcmp(udev->product, "BeagleBone/XDS100V2")))
1785 return ftdi_jtag_probe(serial); 1788 return ftdi_jtag_probe(serial);
1786 1789
1787 return 0; 1790 return 0;
@@ -2089,6 +2092,29 @@ static void ftdi_break_ctl(struct tty_struct *tty, int break_state)
2089 2092
2090} 2093}
2091 2094
2095static int ftdi_chars_in_buffer(struct tty_struct *tty)
2096{
2097 struct usb_serial_port *port = tty->driver_data;
2098 int chars;
2099 unsigned char buf[2];
2100 int ret;
2101
2102 chars = usb_serial_generic_chars_in_buffer(tty);
2103 if (chars)
2104 goto out;
2105
2106 /* Check if hardware buffer is empty. */
2107 ret = ftdi_get_modem_status(tty, buf);
2108 if (ret == 2) {
2109 if (!(buf[1] & FTDI_RS_TEMT))
2110 chars = 1;
2111 }
2112out:
2113 dev_dbg(&port->dev, "%s - %d\n", __func__, chars);
2114
2115 return chars;
2116}
2117
2092/* old_termios contains the original termios settings and tty->termios contains 2118/* old_termios contains the original termios settings and tty->termios contains
2093 * the new setting to be used 2119 * the new setting to be used
2094 * WARNING: set_termios calls this with old_termios in kernel space 2120 * WARNING: set_termios calls this with old_termios in kernel space
@@ -2272,7 +2298,14 @@ no_c_cflag_changes:
2272 } 2298 }
2273} 2299}
2274 2300
2275static int ftdi_tiocmget(struct tty_struct *tty) 2301/*
2302 * Get modem-control status.
2303 *
2304 * Returns the number of status bytes retrieved (device dependant), or
2305 * negative error code.
2306 */
2307static int ftdi_get_modem_status(struct tty_struct *tty,
2308 unsigned char status[2])
2276{ 2309{
2277 struct usb_serial_port *port = tty->driver_data; 2310 struct usb_serial_port *port = tty->driver_data;
2278 struct ftdi_private *priv = usb_get_serial_port_data(port); 2311 struct ftdi_private *priv = usb_get_serial_port_data(port);
@@ -2312,16 +2345,43 @@ static int ftdi_tiocmget(struct tty_struct *tty)
2312 FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE, 2345 FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE,
2313 0, priv->interface, 2346 0, priv->interface,
2314 buf, len, WDR_TIMEOUT); 2347 buf, len, WDR_TIMEOUT);
2315 if (ret < 0) 2348 if (ret < 0) {
2349 dev_err(&port->dev, "failed to get modem status: %d\n", ret);
2350 ret = usb_translate_errors(ret);
2316 goto out; 2351 goto out;
2352 }
2317 2353
2318 ret = (buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) | 2354 status[0] = buf[0];
2319 (buf[0] & FTDI_SIO_CTS_MASK ? TIOCM_CTS : 0) | 2355 if (ret > 1)
2320 (buf[0] & FTDI_SIO_RI_MASK ? TIOCM_RI : 0) | 2356 status[1] = buf[1];
2321 (buf[0] & FTDI_SIO_RLSD_MASK ? TIOCM_CD : 0) | 2357 else
2322 priv->last_dtr_rts; 2358 status[1] = 0;
2359
2360 dev_dbg(&port->dev, "%s - 0x%02x%02x\n", __func__, status[0],
2361 status[1]);
2323out: 2362out:
2324 kfree(buf); 2363 kfree(buf);
2364
2365 return ret;
2366}
2367
2368static int ftdi_tiocmget(struct tty_struct *tty)
2369{
2370 struct usb_serial_port *port = tty->driver_data;
2371 struct ftdi_private *priv = usb_get_serial_port_data(port);
2372 unsigned char buf[2];
2373 int ret;
2374
2375 ret = ftdi_get_modem_status(tty, buf);
2376 if (ret < 0)
2377 return ret;
2378
2379 ret = (buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) |
2380 (buf[0] & FTDI_SIO_CTS_MASK ? TIOCM_CTS : 0) |
2381 (buf[0] & FTDI_SIO_RI_MASK ? TIOCM_RI : 0) |
2382 (buf[0] & FTDI_SIO_RLSD_MASK ? TIOCM_CD : 0) |
2383 priv->last_dtr_rts;
2384
2325 return ret; 2385 return ret;
2326} 2386}
2327 2387
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index 57c12ef6625e..049b6e715fa4 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -752,6 +752,12 @@
752#define TTI_VID 0x103E /* Vendor Id */ 752#define TTI_VID 0x103E /* Vendor Id */
753#define TTI_QL355P_PID 0x03E8 /* TTi QL355P power supply */ 753#define TTI_QL355P_PID 0x03E8 /* TTi QL355P power supply */
754 754
755/*
756 * Newport Cooperation (www.newport.com)
757 */
758#define NEWPORT_VID 0x104D
759#define NEWPORT_AGILIS_PID 0x3000
760
755/* Interbiometrics USB I/O Board */ 761/* Interbiometrics USB I/O Board */
756/* Developed for Interbiometrics by Rudolf Gugler */ 762/* Developed for Interbiometrics by Rudolf Gugler */
757#define INTERBIOMETRICS_VID 0x1209 763#define INTERBIOMETRICS_VID 0x1209
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 296612153ea2..2ea70a631996 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -262,6 +262,7 @@ int usb_serial_generic_chars_in_buffer(struct tty_struct *tty)
262 dev_dbg(&port->dev, "%s - returns %d\n", __func__, chars); 262 dev_dbg(&port->dev, "%s - returns %d\n", __func__, chars);
263 return chars; 263 return chars;
264} 264}
265EXPORT_SYMBOL_GPL(usb_serial_generic_chars_in_buffer);
265 266
266static int usb_serial_generic_submit_read_urb(struct usb_serial_port *port, 267static int usb_serial_generic_submit_read_urb(struct usb_serial_port *port,
267 int index, gfp_t mem_flags) 268 int index, gfp_t mem_flags)
diff --git a/drivers/usb/serial/hp4x.c b/drivers/usb/serial/hp4x.c
index 0bbaf21a9d1e..2cba60d90c79 100644
--- a/drivers/usb/serial/hp4x.c
+++ b/drivers/usb/serial/hp4x.c
@@ -20,10 +20,6 @@
20#include <linux/usb.h> 20#include <linux/usb.h>
21#include <linux/usb/serial.h> 21#include <linux/usb/serial.h>
22 22
23/*
24 * Version Information
25 */
26#define DRIVER_VERSION "v1.00"
27#define DRIVER_DESC "HP4x (48/49) Generic Serial driver" 23#define DRIVER_DESC "HP4x (48/49) Generic Serial driver"
28 24
29#define HP_VENDOR_ID 0x03f0 25#define HP_VENDOR_ID 0x03f0
@@ -52,5 +48,4 @@ static struct usb_serial_driver * const serial_drivers[] = {
52module_usb_serial_driver(serial_drivers, id_table); 48module_usb_serial_driver(serial_drivers, id_table);
53 49
54MODULE_DESCRIPTION(DRIVER_DESC); 50MODULE_DESCRIPTION(DRIVER_DESC);
55MODULE_VERSION(DRIVER_VERSION);
56MODULE_LICENSE("GPL"); 51MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index 5acc0d13864a..7b770c7f8b11 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -51,10 +51,6 @@
51#include "io_ionsp.h" /* info for the iosp messages */ 51#include "io_ionsp.h" /* info for the iosp messages */
52#include "io_16654.h" /* 16654 UART defines */ 52#include "io_16654.h" /* 16654 UART defines */
53 53
54/*
55 * Version Information
56 */
57#define DRIVER_VERSION "v2.7"
58#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com> and David Iacovelli" 54#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com> and David Iacovelli"
59#define DRIVER_DESC "Edgeport USB Serial Driver" 55#define DRIVER_DESC "Edgeport USB Serial Driver"
60 56
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 60023c2d2a31..58184f3de686 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -40,10 +40,6 @@
40#include "io_usbvend.h" 40#include "io_usbvend.h"
41#include "io_ti.h" 41#include "io_ti.h"
42 42
43/*
44 * Version Information
45 */
46#define DRIVER_VERSION "v0.7mode043006"
47#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com> and David Iacovelli" 43#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com> and David Iacovelli"
48#define DRIVER_DESC "Edgeport USB Serial Driver" 44#define DRIVER_DESC "Edgeport USB Serial Driver"
49 45
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index 1068bf22e27e..76c9a847da5d 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -25,11 +25,6 @@
25 25
26#define KP_RETRIES 100 26#define KP_RETRIES 100
27 27
28/*
29 * Version Information
30 */
31
32#define DRIVER_VERSION "v1.0"
33#define DRIVER_AUTHOR "Ganesh Varadarajan <ganesh@veritas.com>" 28#define DRIVER_AUTHOR "Ganesh Varadarajan <ganesh@veritas.com>"
34#define DRIVER_DESC "USB PocketPC PDA driver" 29#define DRIVER_DESC "USB PocketPC PDA driver"
35 30
diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c
index 4264821a3b34..155eab14b30e 100644
--- a/drivers/usb/serial/ipw.c
+++ b/drivers/usb/serial/ipw.c
@@ -49,10 +49,6 @@
49#include <linux/uaccess.h> 49#include <linux/uaccess.h>
50#include "usb-wwan.h" 50#include "usb-wwan.h"
51 51
52/*
53 * Version Information
54 */
55#define DRIVER_VERSION "v0.4"
56#define DRIVER_AUTHOR "Roelf Diedericks" 52#define DRIVER_AUTHOR "Roelf Diedericks"
57#define DRIVER_DESC "IPWireless tty driver" 53#define DRIVER_DESC "IPWireless tty driver"
58 54
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c
index cd5533e81de7..1e1fbed65ef2 100644
--- a/drivers/usb/serial/iuu_phoenix.c
+++ b/drivers/usb/serial/iuu_phoenix.c
@@ -32,10 +32,6 @@
32#include "iuu_phoenix.h" 32#include "iuu_phoenix.h"
33#include <linux/random.h> 33#include <linux/random.h>
34 34
35/*
36 * Version Information
37 */
38#define DRIVER_VERSION "v0.12"
39#define DRIVER_DESC "Infinity USB Unlimited Phoenix driver" 35#define DRIVER_DESC "Infinity USB Unlimited Phoenix driver"
40 36
41static const struct usb_device_id id_table[] = { 37static const struct usb_device_id id_table[] = {
@@ -1164,7 +1160,7 @@ static ssize_t store_vcc_mode(struct device *dev,
1164 struct iuu_private *priv = usb_get_serial_port_data(port); 1160 struct iuu_private *priv = usb_get_serial_port_data(port);
1165 unsigned long v; 1161 unsigned long v;
1166 1162
1167 if (strict_strtoul(buf, 10, &v)) { 1163 if (kstrtoul(buf, 10, &v)) {
1168 dev_err(dev, "%s - vcc_mode: %s is not a unsigned long\n", 1164 dev_err(dev, "%s - vcc_mode: %s is not a unsigned long\n",
1169 __func__, buf); 1165 __func__, buf);
1170 goto fail_store_vcc_mode; 1166 goto fail_store_vcc_mode;
@@ -1232,8 +1228,6 @@ MODULE_AUTHOR("Alain Degreffe eczema@ecze.com");
1232MODULE_DESCRIPTION(DRIVER_DESC); 1228MODULE_DESCRIPTION(DRIVER_DESC);
1233MODULE_LICENSE("GPL"); 1229MODULE_LICENSE("GPL");
1234 1230
1235MODULE_VERSION(DRIVER_VERSION);
1236
1237module_param(xmas, bool, S_IRUGO | S_IWUSR); 1231module_param(xmas, bool, S_IRUGO | S_IWUSR);
1238MODULE_PARM_DESC(xmas, "Xmas colors enabled or not"); 1232MODULE_PARM_DESC(xmas, "Xmas colors enabled or not");
1239 1233
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
index cff8dd5b462d..97bc49f68efd 100644
--- a/drivers/usb/serial/keyspan.c
+++ b/drivers/usb/serial/keyspan.c
@@ -44,10 +44,6 @@
44#include <linux/usb/ezusb.h> 44#include <linux/usb/ezusb.h>
45#include "keyspan.h" 45#include "keyspan.h"
46 46
47/*
48 * Version Information
49 */
50#define DRIVER_VERSION "v1.1.5"
51#define DRIVER_AUTHOR "Hugh Blemings <hugh@misc.nu" 47#define DRIVER_AUTHOR "Hugh Blemings <hugh@misc.nu"
52#define DRIVER_DESC "Keyspan USB to Serial Converter Driver" 48#define DRIVER_DESC "Keyspan USB to Serial Converter Driver"
53 49
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c
index bb87e29c4ac2..41b01092af07 100644
--- a/drivers/usb/serial/keyspan_pda.c
+++ b/drivers/usb/serial/keyspan_pda.c
@@ -42,10 +42,6 @@
42 #undef XIRCOM 42 #undef XIRCOM
43#endif 43#endif
44 44
45/*
46 * Version Information
47 */
48#define DRIVER_VERSION "v1.1"
49#define DRIVER_AUTHOR "Brian Warner <warner@lothar.com>" 45#define DRIVER_AUTHOR "Brian Warner <warner@lothar.com>"
50#define DRIVER_DESC "USB Keyspan PDA Converter driver" 46#define DRIVER_DESC "USB Keyspan PDA Converter driver"
51 47
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c
index 1f4517864cd2..fc9e14a1e9b3 100644
--- a/drivers/usb/serial/kl5kusb105.c
+++ b/drivers/usb/serial/kl5kusb105.c
@@ -49,10 +49,6 @@
49#include <linux/usb/serial.h> 49#include <linux/usb/serial.h>
50#include "kl5kusb105.h" 50#include "kl5kusb105.h"
51 51
52/*
53 * Version Information
54 */
55#define DRIVER_VERSION "v0.4"
56#define DRIVER_AUTHOR "Utz-Uwe Haus <haus@uuhaus.de>, Johan Hovold <jhovold@gmail.com>" 52#define DRIVER_AUTHOR "Utz-Uwe Haus <haus@uuhaus.de>, Johan Hovold <jhovold@gmail.com>"
57#define DRIVER_DESC "KLSI KL5KUSB105 chipset USB->Serial Converter driver" 53#define DRIVER_DESC "KLSI KL5KUSB105 chipset USB->Serial Converter driver"
58 54
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c
index c9ca7a5b12e0..b747ba615d0b 100644
--- a/drivers/usb/serial/kobil_sct.c
+++ b/drivers/usb/serial/kobil_sct.c
@@ -38,8 +38,6 @@
38#include <linux/ioctl.h> 38#include <linux/ioctl.h>
39#include "kobil_sct.h" 39#include "kobil_sct.h"
40 40
41/* Version Information */
42#define DRIVER_VERSION "21/05/2004"
43#define DRIVER_AUTHOR "KOBIL Systems GmbH - http://www.kobil.com" 41#define DRIVER_AUTHOR "KOBIL Systems GmbH - http://www.kobil.com"
44#define DRIVER_DESC "KOBIL USB Smart Card Terminal Driver (experimental)" 42#define DRIVER_DESC "KOBIL USB Smart Card Terminal Driver (experimental)"
45 43
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
index 8a2081004107..b6911757c855 100644
--- a/drivers/usb/serial/mct_u232.c
+++ b/drivers/usb/serial/mct_u232.c
@@ -38,10 +38,6 @@
38#include <linux/ioctl.h> 38#include <linux/ioctl.h>
39#include "mct_u232.h" 39#include "mct_u232.h"
40 40
41/*
42 * Version Information
43 */
44#define DRIVER_VERSION "z2.1" /* Linux in-kernel version */
45#define DRIVER_AUTHOR "Wolfgang Grandegger <wolfgang@ces.ch>" 41#define DRIVER_AUTHOR "Wolfgang Grandegger <wolfgang@ces.ch>"
46#define DRIVER_DESC "Magic Control Technology USB-RS232 converter driver" 42#define DRIVER_DESC "Magic Control Technology USB-RS232 converter driver"
47 43
diff --git a/drivers/usb/serial/metro-usb.c b/drivers/usb/serial/metro-usb.c
index 6f29c74eb769..3d258448c29a 100644
--- a/drivers/usb/serial/metro-usb.c
+++ b/drivers/usb/serial/metro-usb.c
@@ -20,8 +20,6 @@
20#include <linux/uaccess.h> 20#include <linux/uaccess.h>
21#include <linux/usb/serial.h> 21#include <linux/usb/serial.h>
22 22
23/* Version Information */
24#define DRIVER_VERSION "v1.2.0.0"
25#define DRIVER_DESC "Metrologic Instruments Inc. - USB-POS driver" 23#define DRIVER_DESC "Metrologic Instruments Inc. - USB-POS driver"
26 24
27/* Product information. */ 25/* Product information. */
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c
index 75267421aad8..f57a6b1fe787 100644
--- a/drivers/usb/serial/mos7720.c
+++ b/drivers/usb/serial/mos7720.c
@@ -36,10 +36,6 @@
36#include <linux/uaccess.h> 36#include <linux/uaccess.h>
37#include <linux/parport.h> 37#include <linux/parport.h>
38 38
39/*
40 * Version Information
41 */
42#define DRIVER_VERSION "2.1"
43#define DRIVER_AUTHOR "Aspire Communications pvt Ltd." 39#define DRIVER_AUTHOR "Aspire Communications pvt Ltd."
44#define DRIVER_DESC "Moschip USB Serial Driver" 40#define DRIVER_DESC "Moschip USB Serial Driver"
45 41
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 1cf3375ec1af..66d9e088d9d9 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -35,10 +35,6 @@
35#include <linux/usb/serial.h> 35#include <linux/usb/serial.h>
36#include <linux/uaccess.h> 36#include <linux/uaccess.h>
37 37
38/*
39 * Version Information
40 */
41#define DRIVER_VERSION "1.3.2"
42#define DRIVER_DESC "Moschip 7840/7820 USB Serial Driver" 38#define DRIVER_DESC "Moschip 7840/7820 USB Serial Driver"
43 39
44/* 40/*
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
index 9ab73d295774..7818af931a48 100644
--- a/drivers/usb/serial/omninet.c
+++ b/drivers/usb/serial/omninet.c
@@ -23,10 +23,6 @@
23#include <linux/usb.h> 23#include <linux/usb.h>
24#include <linux/usb/serial.h> 24#include <linux/usb/serial.h>
25 25
26/*
27 * Version Information
28 */
29#define DRIVER_VERSION "v1.1"
30#define DRIVER_AUTHOR "Alessandro Zummo" 26#define DRIVER_AUTHOR "Alessandro Zummo"
31#define DRIVER_DESC "USB ZyXEL omni.net LCD PLUS Driver" 27#define DRIVER_DESC "USB ZyXEL omni.net LCD PLUS Driver"
32 28
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
index 6aba731d4864..c6bfb83efb1e 100644
--- a/drivers/usb/serial/opticon.c
+++ b/drivers/usb/serial/opticon.c
@@ -1,6 +1,7 @@
1/* 1/*
2 * Opticon USB barcode to serial driver 2 * Opticon USB barcode to serial driver
3 * 3 *
4 * Copyright (C) 2011 - 2012 Johan Hovold <jhovold@gmail.com>
4 * Copyright (C) 2011 Martin Jansen <martin.jansen@opticon.com> 5 * Copyright (C) 2011 Martin Jansen <martin.jansen@opticon.com>
5 * Copyright (C) 2008 - 2009 Greg Kroah-Hartman <gregkh@suse.de> 6 * Copyright (C) 2008 - 2009 Greg Kroah-Hartman <gregkh@suse.de>
6 * Copyright (C) 2008 - 2009 Novell Inc. 7 * Copyright (C) 2008 - 2009 Novell Inc.
@@ -40,114 +41,70 @@ MODULE_DEVICE_TABLE(usb, id_table);
40 41
41/* This structure holds all of the individual device information */ 42/* This structure holds all of the individual device information */
42struct opticon_private { 43struct opticon_private {
43 struct usb_device *udev;
44 struct usb_serial *serial;
45 struct usb_serial_port *port;
46 unsigned char *bulk_in_buffer;
47 struct urb *bulk_read_urb;
48 int buffer_size;
49 u8 bulk_address;
50 spinlock_t lock; /* protects the following flags */ 44 spinlock_t lock; /* protects the following flags */
51 bool throttled;
52 bool actually_throttled;
53 bool rts; 45 bool rts;
54 bool cts; 46 bool cts;
55 int outstanding_urbs; 47 int outstanding_urbs;
56}; 48};
57 49
58 50
59 51static void opticon_process_data_packet(struct usb_serial_port *port,
60static void opticon_read_bulk_callback(struct urb *urb) 52 const unsigned char *buf, size_t len)
61{ 53{
62 struct opticon_private *priv = urb->context;
63 unsigned char *data = urb->transfer_buffer;
64 struct usb_serial_port *port = priv->port;
65 int status = urb->status;
66 struct tty_struct *tty; 54 struct tty_struct *tty;
67 int result; 55
68 int data_length; 56 tty = tty_port_tty_get(&port->port);
57 if (!tty)
58 return;
59
60 tty_insert_flip_string(tty, buf, len);
61 tty_flip_buffer_push(tty);
62 tty_kref_put(tty);
63}
64
65static void opticon_process_status_packet(struct usb_serial_port *port,
66 const unsigned char *buf, size_t len)
67{
68 struct opticon_private *priv = usb_get_serial_port_data(port);
69 unsigned long flags; 69 unsigned long flags;
70 70
71 switch (status) { 71 spin_lock_irqsave(&priv->lock, flags);
72 case 0: 72 if (buf[0] == 0x00)
73 /* success */ 73 priv->cts = false;
74 break; 74 else
75 case -ECONNRESET: 75 priv->cts = true;
76 case -ENOENT: 76 spin_unlock_irqrestore(&priv->lock, flags);
77 case -ESHUTDOWN: 77}
78 /* this urb is terminated, clean up */ 78
79 dev_dbg(&priv->udev->dev, "%s - urb shutting down with status: %d\n", 79static void opticon_process_read_urb(struct urb *urb)
80 __func__, status); 80{
81 struct usb_serial_port *port = urb->context;
82 const unsigned char *hdr = urb->transfer_buffer;
83 const unsigned char *data = hdr + 2;
84 size_t data_len = urb->actual_length - 2;
85
86 if (urb->actual_length <= 2) {
87 dev_dbg(&port->dev, "malformed packet received: %d bytes\n",
88 urb->actual_length);
81 return; 89 return;
82 default:
83 dev_dbg(&priv->udev->dev, "%s - nonzero urb status received: %d\n",
84 __func__, status);
85 goto exit;
86 } 90 }
87 91 /*
88 usb_serial_debug_data(&port->dev, __func__, urb->actual_length, data); 92 * Data from the device comes with a 2 byte header:
89 93 *
90 if (urb->actual_length > 2) { 94 * <0x00><0x00>data...
91 data_length = urb->actual_length - 2; 95 * This is real data to be sent to the tty layer
92 96 * <0x00><0x01>level
93 /* 97 * This is a CTS level change, the third byte is the CTS
94 * Data from the device comes with a 2 byte header: 98 * value (0 for low, 1 for high).
95 * 99 */
96 * <0x00><0x00>data... 100 if ((hdr[0] == 0x00) && (hdr[1] == 0x00)) {
97 * This is real data to be sent to the tty layer 101 opticon_process_data_packet(port, data, data_len);
98 * <0x00><0x01)level 102 } else if ((hdr[0] == 0x00) && (hdr[1] == 0x01)) {
99 * This is a CTS level change, the third byte is the CTS 103 opticon_process_status_packet(port, data, data_len);
100 * value (0 for low, 1 for high).
101 */
102 if ((data[0] == 0x00) && (data[1] == 0x00)) {
103 /* real data, send it to the tty layer */
104 tty = tty_port_tty_get(&port->port);
105 if (tty) {
106 tty_insert_flip_string(tty, data + 2,
107 data_length);
108 tty_flip_buffer_push(tty);
109 tty_kref_put(tty);
110 }
111 } else {
112 if ((data[0] == 0x00) && (data[1] == 0x01)) {
113 spin_lock_irqsave(&priv->lock, flags);
114 /* CTS status information package */
115 if (data[2] == 0x00)
116 priv->cts = false;
117 else
118 priv->cts = true;
119 spin_unlock_irqrestore(&priv->lock, flags);
120 } else {
121 dev_dbg(&priv->udev->dev,
122 "Unknown data packet received from the device:"
123 " %2x %2x\n",
124 data[0], data[1]);
125 }
126 }
127 } else { 104 } else {
128 dev_dbg(&priv->udev->dev, 105 dev_dbg(&port->dev, "unknown packet received: %02x %02x\n",
129 "Improper amount of data received from the device, " 106 hdr[0], hdr[1]);
130 "%d bytes", urb->actual_length);
131 } 107 }
132
133exit:
134 spin_lock(&priv->lock);
135
136 /* Continue trying to always read if we should */
137 if (!priv->throttled) {
138 usb_fill_bulk_urb(priv->bulk_read_urb, priv->udev,
139 usb_rcvbulkpipe(priv->udev,
140 priv->bulk_address),
141 priv->bulk_in_buffer, priv->buffer_size,
142 opticon_read_bulk_callback, priv);
143 result = usb_submit_urb(priv->bulk_read_urb, GFP_ATOMIC);
144 if (result)
145 dev_err(&port->dev,
146 "%s - failed resubmitting read urb, error %d\n",
147 __func__, result);
148 } else
149 priv->actually_throttled = true;
150 spin_unlock(&priv->lock);
151} 108}
152 109
153static int send_control_msg(struct usb_serial_port *port, u8 requesttype, 110static int send_control_msg(struct usb_serial_port *port, u8 requesttype,
@@ -175,52 +132,35 @@ static int send_control_msg(struct usb_serial_port *port, u8 requesttype,
175 132
176static int opticon_open(struct tty_struct *tty, struct usb_serial_port *port) 133static int opticon_open(struct tty_struct *tty, struct usb_serial_port *port)
177{ 134{
178 struct opticon_private *priv = usb_get_serial_data(port->serial); 135 struct opticon_private *priv = usb_get_serial_port_data(port);
179 unsigned long flags; 136 unsigned long flags;
180 int result = 0; 137 int res;
181 138
182 spin_lock_irqsave(&priv->lock, flags); 139 spin_lock_irqsave(&priv->lock, flags);
183 priv->throttled = false;
184 priv->actually_throttled = false;
185 priv->port = port;
186 priv->rts = false; 140 priv->rts = false;
187 spin_unlock_irqrestore(&priv->lock, flags); 141 spin_unlock_irqrestore(&priv->lock, flags);
188 142
189 /* Clear RTS line */ 143 /* Clear RTS line */
190 send_control_msg(port, CONTROL_RTS, 0); 144 send_control_msg(port, CONTROL_RTS, 0);
191 145
192 /* Setup the read URB and start reading from the device */
193 usb_fill_bulk_urb(priv->bulk_read_urb, priv->udev,
194 usb_rcvbulkpipe(priv->udev,
195 priv->bulk_address),
196 priv->bulk_in_buffer, priv->buffer_size,
197 opticon_read_bulk_callback, priv);
198
199 /* clear the halt status of the enpoint */ 146 /* clear the halt status of the enpoint */
200 usb_clear_halt(priv->udev, priv->bulk_read_urb->pipe); 147 usb_clear_halt(port->serial->dev, port->read_urb->pipe);
148
149 res = usb_serial_generic_open(tty, port);
150 if (!res)
151 return res;
201 152
202 result = usb_submit_urb(priv->bulk_read_urb, GFP_KERNEL);
203 if (result)
204 dev_err(&port->dev,
205 "%s - failed resubmitting read urb, error %d\n",
206 __func__, result);
207 /* Request CTS line state, sometimes during opening the current 153 /* Request CTS line state, sometimes during opening the current
208 * CTS state can be missed. */ 154 * CTS state can be missed. */
209 send_control_msg(port, RESEND_CTS_STATE, 1); 155 send_control_msg(port, RESEND_CTS_STATE, 1);
210 return result;
211}
212
213static void opticon_close(struct usb_serial_port *port)
214{
215 struct opticon_private *priv = usb_get_serial_data(port->serial);
216 156
217 /* shutdown our urbs */ 157 return res;
218 usb_kill_urb(priv->bulk_read_urb);
219} 158}
220 159
221static void opticon_write_control_callback(struct urb *urb) 160static void opticon_write_control_callback(struct urb *urb)
222{ 161{
223 struct opticon_private *priv = urb->context; 162 struct usb_serial_port *port = urb->context;
163 struct opticon_private *priv = usb_get_serial_port_data(port);
224 int status = urb->status; 164 int status = urb->status;
225 unsigned long flags; 165 unsigned long flags;
226 166
@@ -231,20 +171,21 @@ static void opticon_write_control_callback(struct urb *urb)
231 kfree(urb->setup_packet); 171 kfree(urb->setup_packet);
232 172
233 if (status) 173 if (status)
234 dev_dbg(&priv->udev->dev, "%s - nonzero write bulk status received: %d\n", 174 dev_dbg(&port->dev,
175 "%s - non-zero urb status received: %d\n",
235 __func__, status); 176 __func__, status);
236 177
237 spin_lock_irqsave(&priv->lock, flags); 178 spin_lock_irqsave(&priv->lock, flags);
238 --priv->outstanding_urbs; 179 --priv->outstanding_urbs;
239 spin_unlock_irqrestore(&priv->lock, flags); 180 spin_unlock_irqrestore(&priv->lock, flags);
240 181
241 usb_serial_port_softint(priv->port); 182 usb_serial_port_softint(port);
242} 183}
243 184
244static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port, 185static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port,
245 const unsigned char *buf, int count) 186 const unsigned char *buf, int count)
246{ 187{
247 struct opticon_private *priv = usb_get_serial_data(port->serial); 188 struct opticon_private *priv = usb_get_serial_port_data(port);
248 struct usb_serial *serial = port->serial; 189 struct usb_serial *serial = port->serial;
249 struct urb *urb; 190 struct urb *urb;
250 unsigned char *buffer; 191 unsigned char *buffer;
@@ -298,7 +239,7 @@ static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port,
298 usb_fill_control_urb(urb, serial->dev, 239 usb_fill_control_urb(urb, serial->dev,
299 usb_sndctrlpipe(serial->dev, 0), 240 usb_sndctrlpipe(serial->dev, 0),
300 (unsigned char *)dr, buffer, count, 241 (unsigned char *)dr, buffer, count,
301 opticon_write_control_callback, priv); 242 opticon_write_control_callback, port);
302 243
303 /* send it down the pipe */ 244 /* send it down the pipe */
304 status = usb_submit_urb(urb, GFP_ATOMIC); 245 status = usb_submit_urb(urb, GFP_ATOMIC);
@@ -331,7 +272,7 @@ error_no_buffer:
331static int opticon_write_room(struct tty_struct *tty) 272static int opticon_write_room(struct tty_struct *tty)
332{ 273{
333 struct usb_serial_port *port = tty->driver_data; 274 struct usb_serial_port *port = tty->driver_data;
334 struct opticon_private *priv = usb_get_serial_data(port->serial); 275 struct opticon_private *priv = usb_get_serial_port_data(port);
335 unsigned long flags; 276 unsigned long flags;
336 277
337 /* 278 /*
@@ -350,44 +291,10 @@ static int opticon_write_room(struct tty_struct *tty)
350 return 2048; 291 return 2048;
351} 292}
352 293
353static void opticon_throttle(struct tty_struct *tty)
354{
355 struct usb_serial_port *port = tty->driver_data;
356 struct opticon_private *priv = usb_get_serial_data(port->serial);
357 unsigned long flags;
358
359 spin_lock_irqsave(&priv->lock, flags);
360 priv->throttled = true;
361 spin_unlock_irqrestore(&priv->lock, flags);
362}
363
364
365static void opticon_unthrottle(struct tty_struct *tty)
366{
367 struct usb_serial_port *port = tty->driver_data;
368 struct opticon_private *priv = usb_get_serial_data(port->serial);
369 unsigned long flags;
370 int result, was_throttled;
371
372 spin_lock_irqsave(&priv->lock, flags);
373 priv->throttled = false;
374 was_throttled = priv->actually_throttled;
375 priv->actually_throttled = false;
376 spin_unlock_irqrestore(&priv->lock, flags);
377
378 if (was_throttled) {
379 result = usb_submit_urb(priv->bulk_read_urb, GFP_ATOMIC);
380 if (result)
381 dev_err(&port->dev,
382 "%s - failed submitting read urb, error %d\n",
383 __func__, result);
384 }
385}
386
387static int opticon_tiocmget(struct tty_struct *tty) 294static int opticon_tiocmget(struct tty_struct *tty)
388{ 295{
389 struct usb_serial_port *port = tty->driver_data; 296 struct usb_serial_port *port = tty->driver_data;
390 struct opticon_private *priv = usb_get_serial_data(port->serial); 297 struct opticon_private *priv = usb_get_serial_port_data(port);
391 unsigned long flags; 298 unsigned long flags;
392 int result = 0; 299 int result = 0;
393 300
@@ -407,7 +314,7 @@ static int opticon_tiocmset(struct tty_struct *tty,
407{ 314{
408 struct usb_serial_port *port = tty->driver_data; 315 struct usb_serial_port *port = tty->driver_data;
409 struct usb_serial *serial = port->serial; 316 struct usb_serial *serial = port->serial;
410 struct opticon_private *priv = usb_get_serial_data(port->serial); 317 struct opticon_private *priv = usb_get_serial_port_data(port);
411 unsigned long flags; 318 unsigned long flags;
412 bool rts; 319 bool rts;
413 bool changed = false; 320 bool changed = false;
@@ -438,7 +345,7 @@ static int opticon_tiocmset(struct tty_struct *tty,
438 return ret; 345 return ret;
439} 346}
440 347
441static int get_serial_info(struct opticon_private *priv, 348static int get_serial_info(struct usb_serial_port *port,
442 struct serial_struct __user *serial) 349 struct serial_struct __user *serial)
443{ 350{
444 struct serial_struct tmp; 351 struct serial_struct tmp;
@@ -450,7 +357,7 @@ static int get_serial_info(struct opticon_private *priv,
450 357
451 /* fake emulate a 16550 uart to make userspace code happy */ 358 /* fake emulate a 16550 uart to make userspace code happy */
452 tmp.type = PORT_16550A; 359 tmp.type = PORT_16550A;
453 tmp.line = priv->serial->minor; 360 tmp.line = port->serial->minor;
454 tmp.port = 0; 361 tmp.port = 0;
455 tmp.irq = 0; 362 tmp.irq = 0;
456 tmp.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ; 363 tmp.flags = ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ;
@@ -468,13 +375,12 @@ static int opticon_ioctl(struct tty_struct *tty,
468 unsigned int cmd, unsigned long arg) 375 unsigned int cmd, unsigned long arg)
469{ 376{
470 struct usb_serial_port *port = tty->driver_data; 377 struct usb_serial_port *port = tty->driver_data;
471 struct opticon_private *priv = usb_get_serial_data(port->serial);
472 378
473 dev_dbg(&port->dev, "%s - port %d, cmd = 0x%x\n", __func__, port->number, cmd); 379 dev_dbg(&port->dev, "%s - port %d, cmd = 0x%x\n", __func__, port->number, cmd);
474 380
475 switch (cmd) { 381 switch (cmd) {
476 case TIOCGSERIAL: 382 case TIOCGSERIAL:
477 return get_serial_info(priv, 383 return get_serial_info(port,
478 (struct serial_struct __user *)arg); 384 (struct serial_struct __user *)arg);
479 } 385 }
480 386
@@ -483,106 +389,36 @@ static int opticon_ioctl(struct tty_struct *tty,
483 389
484static int opticon_startup(struct usb_serial *serial) 390static int opticon_startup(struct usb_serial *serial)
485{ 391{
486 struct opticon_private *priv; 392 if (!serial->num_bulk_in) {
487 struct usb_host_interface *intf; 393 dev_err(&serial->dev->dev, "no bulk in endpoint\n");
488 int i; 394 return -ENODEV;
489 int retval = -ENOMEM;
490 bool bulk_in_found = false;
491
492 /* create our private serial structure */
493 priv = kzalloc(sizeof(*priv), GFP_KERNEL);
494 if (priv == NULL) {
495 dev_err(&serial->dev->dev, "%s - Out of memory\n", __func__);
496 return -ENOMEM;
497 }
498 spin_lock_init(&priv->lock);
499 priv->serial = serial;
500 priv->port = serial->port[0];
501 priv->udev = serial->dev;
502 priv->outstanding_urbs = 0; /* Init the outstanding urbs */
503
504 /* find our bulk endpoint */
505 intf = serial->interface->altsetting;
506 for (i = 0; i < intf->desc.bNumEndpoints; ++i) {
507 struct usb_endpoint_descriptor *endpoint;
508
509 endpoint = &intf->endpoint[i].desc;
510 if (!usb_endpoint_is_bulk_in(endpoint))
511 continue;
512
513 priv->bulk_read_urb = usb_alloc_urb(0, GFP_KERNEL);
514 if (!priv->bulk_read_urb) {
515 dev_err(&priv->udev->dev, "out of memory\n");
516 goto error;
517 }
518
519 priv->buffer_size = usb_endpoint_maxp(endpoint) * 2;
520 priv->bulk_in_buffer = kmalloc(priv->buffer_size, GFP_KERNEL);
521 if (!priv->bulk_in_buffer) {
522 dev_err(&priv->udev->dev, "out of memory\n");
523 goto error;
524 }
525
526 priv->bulk_address = endpoint->bEndpointAddress;
527
528 bulk_in_found = true;
529 break;
530 }
531
532 if (!bulk_in_found) {
533 dev_err(&priv->udev->dev,
534 "Error - the proper endpoints were not found!\n");
535 goto error;
536 } 395 }
537 396
538 usb_set_serial_data(serial, priv);
539 return 0; 397 return 0;
540
541error:
542 usb_free_urb(priv->bulk_read_urb);
543 kfree(priv->bulk_in_buffer);
544 kfree(priv);
545 return retval;
546} 398}
547 399
548static void opticon_disconnect(struct usb_serial *serial) 400static int opticon_port_probe(struct usb_serial_port *port)
549{ 401{
550 struct opticon_private *priv = usb_get_serial_data(serial); 402 struct opticon_private *priv;
551
552 usb_kill_urb(priv->bulk_read_urb);
553 usb_free_urb(priv->bulk_read_urb);
554}
555 403
556static void opticon_release(struct usb_serial *serial) 404 priv = kzalloc(sizeof(*priv), GFP_KERNEL);
557{ 405 if (!priv)
558 struct opticon_private *priv = usb_get_serial_data(serial); 406 return -ENOMEM;
559 407
560 kfree(priv->bulk_in_buffer); 408 spin_lock_init(&priv->lock);
561 kfree(priv);
562}
563 409
564static int opticon_suspend(struct usb_serial *serial, pm_message_t message) 410 usb_set_serial_port_data(port, priv);
565{
566 struct opticon_private *priv = usb_get_serial_data(serial);
567 411
568 usb_kill_urb(priv->bulk_read_urb);
569 return 0; 412 return 0;
570} 413}
571 414
572static int opticon_resume(struct usb_serial *serial) 415static int opticon_port_remove(struct usb_serial_port *port)
573{ 416{
574 struct opticon_private *priv = usb_get_serial_data(serial); 417 struct opticon_private *priv = usb_get_serial_port_data(port);
575 struct usb_serial_port *port = serial->port[0]; 418
576 int result; 419 kfree(priv);
577 420
578 mutex_lock(&port->port.mutex); 421 return 0;
579 /* This is protected by the port mutex against close/open */
580 if (test_bit(ASYNCB_INITIALIZED, &port->port.flags))
581 result = usb_submit_urb(priv->bulk_read_urb, GFP_NOIO);
582 else
583 result = 0;
584 mutex_unlock(&port->port.mutex);
585 return result;
586} 422}
587 423
588static struct usb_serial_driver opticon_device = { 424static struct usb_serial_driver opticon_device = {
@@ -592,20 +428,19 @@ static struct usb_serial_driver opticon_device = {
592 }, 428 },
593 .id_table = id_table, 429 .id_table = id_table,
594 .num_ports = 1, 430 .num_ports = 1,
431 .bulk_in_size = 256,
595 .attach = opticon_startup, 432 .attach = opticon_startup,
433 .port_probe = opticon_port_probe,
434 .port_remove = opticon_port_remove,
596 .open = opticon_open, 435 .open = opticon_open,
597 .close = opticon_close,
598 .write = opticon_write, 436 .write = opticon_write,
599 .write_room = opticon_write_room, 437 .write_room = opticon_write_room,
600 .disconnect = opticon_disconnect, 438 .throttle = usb_serial_generic_throttle,
601 .release = opticon_release, 439 .unthrottle = usb_serial_generic_unthrottle,
602 .throttle = opticon_throttle,
603 .unthrottle = opticon_unthrottle,
604 .ioctl = opticon_ioctl, 440 .ioctl = opticon_ioctl,
605 .tiocmget = opticon_tiocmget, 441 .tiocmget = opticon_tiocmget,
606 .tiocmset = opticon_tiocmset, 442 .tiocmset = opticon_tiocmset,
607 .suspend = opticon_suspend, 443 .process_read_urb = opticon_process_read_urb,
608 .resume = opticon_resume,
609}; 444};
610 445
611static struct usb_serial_driver * const serial_drivers[] = { 446static struct usb_serial_driver * const serial_drivers[] = {
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index edc64bb6f457..e6f87b76c715 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -28,7 +28,6 @@
28 device features. 28 device features.
29*/ 29*/
30 30
31#define DRIVER_VERSION "v0.7.2"
32#define DRIVER_AUTHOR "Matthias Urlichs <smurf@smurf.noris.de>" 31#define DRIVER_AUTHOR "Matthias Urlichs <smurf@smurf.noris.de>"
33#define DRIVER_DESC "USB Driver for GSM modems" 32#define DRIVER_DESC "USB Driver for GSM modems"
34 33
@@ -81,6 +80,7 @@ static void option_instat_callback(struct urb *urb);
81#define OPTION_PRODUCT_GTM380_MODEM 0x7201 80#define OPTION_PRODUCT_GTM380_MODEM 0x7201
82 81
83#define HUAWEI_VENDOR_ID 0x12D1 82#define HUAWEI_VENDOR_ID 0x12D1
83#define HUAWEI_PRODUCT_E173 0x140C
84#define HUAWEI_PRODUCT_K4505 0x1464 84#define HUAWEI_PRODUCT_K4505 0x1464
85#define HUAWEI_PRODUCT_K3765 0x1465 85#define HUAWEI_PRODUCT_K3765 0x1465
86#define HUAWEI_PRODUCT_K4605 0x14C6 86#define HUAWEI_PRODUCT_K4605 0x14C6
@@ -553,6 +553,8 @@ static const struct usb_device_id option_ids[] = {
553 { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLX) }, 553 { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLX) },
554 { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GKE) }, 554 { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GKE) },
555 { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLE) }, 555 { USB_DEVICE(QUANTA_VENDOR_ID, QUANTA_PRODUCT_GLE) },
556 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E173, 0xff, 0xff, 0xff),
557 .driver_info = (kernel_ulong_t) &net_intf1_blacklist },
556 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4505, 0xff, 0xff, 0xff), 558 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4505, 0xff, 0xff, 0xff),
557 .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, 559 .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist },
558 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff), 560 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff),
@@ -741,23 +743,23 @@ static const struct usb_device_id option_ids[] = {
741 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) }, 743 { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) },
742 { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) }, 744 { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) },
743 { USB_DEVICE(YISO_VENDOR_ID, YISO_PRODUCT_U893) }, 745 { USB_DEVICE(YISO_VENDOR_ID, YISO_PRODUCT_U893) },
744 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, 746 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1, 0xff) },
745 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, 747 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2, 0xff) },
746 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1004) }, 748 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1004, 0xff) },
747 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1005) }, 749 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1005, 0xff) },
748 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1006) }, 750 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1006, 0xff) },
749 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1007) }, 751 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1007, 0xff) },
750 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1008) }, 752 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1008, 0xff) },
751 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1009) }, 753 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1009, 0xff) },
752 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_100A) }, 754 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_100A, 0xff) },
753 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_100B) }, 755 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_100B, 0xff) },
754 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_100C) }, 756 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_100C, 0xff) },
755 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_100D) }, 757 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_100D, 0xff) },
756 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_100E) }, 758 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_100E, 0xff) },
757 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_100F) }, 759 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_100F, 0xff) },
758 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1010) }, 760 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1010, 0xff) },
759 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1011) }, 761 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1011, 0xff) },
760 { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1012) }, 762 { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1012, 0xff) },
761 { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) }, 763 { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) },
762 { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, 764 { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) },
763 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */ 765 { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */
@@ -884,6 +886,10 @@ static const struct usb_device_id option_ids[] = {
884 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0126, 0xff, 0xff, 0xff), 886 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0126, 0xff, 0xff, 0xff),
885 .driver_info = (kernel_ulong_t)&net_intf5_blacklist }, 887 .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
886 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0128, 0xff, 0xff, 0xff) }, 888 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0128, 0xff, 0xff, 0xff) },
889 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0135, 0xff, 0xff, 0xff) },
890 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0136, 0xff, 0xff, 0xff) },
891 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0137, 0xff, 0xff, 0xff) },
892 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0139, 0xff, 0xff, 0xff) },
887 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0142, 0xff, 0xff, 0xff) }, 893 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0142, 0xff, 0xff, 0xff) },
888 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0143, 0xff, 0xff, 0xff) }, 894 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0143, 0xff, 0xff, 0xff) },
889 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0144, 0xff, 0xff, 0xff) }, 895 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0144, 0xff, 0xff, 0xff) },
@@ -904,20 +910,34 @@ static const struct usb_device_id option_ids[] = {
904 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) }, 910 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) },
905 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0167, 0xff, 0xff, 0xff), 911 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0167, 0xff, 0xff, 0xff),
906 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 912 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
913 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0189, 0xff, 0xff, 0xff) },
907 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0191, 0xff, 0xff, 0xff), /* ZTE EuFi890 */ 914 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0191, 0xff, 0xff, 0xff), /* ZTE EuFi890 */
908 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 915 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
916 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0196, 0xff, 0xff, 0xff) },
917 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0197, 0xff, 0xff, 0xff) },
909 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0199, 0xff, 0xff, 0xff), /* ZTE MF820S */ 918 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0199, 0xff, 0xff, 0xff), /* ZTE MF820S */
910 .driver_info = (kernel_ulong_t)&net_intf1_blacklist }, 919 .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
920 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0200, 0xff, 0xff, 0xff) },
921 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0201, 0xff, 0xff, 0xff) },
922 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0254, 0xff, 0xff, 0xff) },
911 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0257, 0xff, 0xff, 0xff), /* ZTE MF821 */ 923 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0257, 0xff, 0xff, 0xff), /* ZTE MF821 */
912 .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, 924 .driver_info = (kernel_ulong_t)&net_intf3_blacklist },
925 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0265, 0xff, 0xff, 0xff) },
926 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0284, 0xff, 0xff, 0xff) },
927 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0317, 0xff, 0xff, 0xff) },
913 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0326, 0xff, 0xff, 0xff), 928 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0326, 0xff, 0xff, 0xff),
914 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 929 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
930 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0330, 0xff, 0xff, 0xff) },
931 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0395, 0xff, 0xff, 0xff) },
932 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0414, 0xff, 0xff, 0xff) },
933 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0417, 0xff, 0xff, 0xff) },
915 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff), 934 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff),
916 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 935 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
917 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff), 936 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff),
918 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 937 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
919 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff), 938 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff),
920 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 939 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
940 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1018, 0xff, 0xff, 0xff) },
921 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1021, 0xff, 0xff, 0xff), 941 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1021, 0xff, 0xff, 0xff),
922 .driver_info = (kernel_ulong_t)&net_intf2_blacklist }, 942 .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
923 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1057, 0xff, 0xff, 0xff) }, 943 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1057, 0xff, 0xff, 0xff) },
@@ -1097,6 +1117,10 @@ static const struct usb_device_id option_ids[] = {
1097 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) }, 1117 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) },
1098 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) }, 1118 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) },
1099 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) }, 1119 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) },
1120 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1301, 0xff, 0xff, 0xff) },
1121 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1302, 0xff, 0xff, 0xff) },
1122 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1303, 0xff, 0xff, 0xff) },
1123 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1333, 0xff, 0xff, 0xff) },
1100 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1401, 0xff, 0xff, 0xff), 1124 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1401, 0xff, 0xff, 0xff),
1101 .driver_info = (kernel_ulong_t)&net_intf2_blacklist }, 1125 .driver_info = (kernel_ulong_t)&net_intf2_blacklist },
1102 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1402, 0xff, 0xff, 0xff), 1126 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1402, 0xff, 0xff, 0xff),
@@ -1174,22 +1198,22 @@ static const struct usb_device_id option_ids[] = {
1174 { USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) }, 1198 { USB_DEVICE(LONGCHEER_VENDOR_ID, ZOOM_PRODUCT_4597) },
1175 { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) }, 1199 { USB_DEVICE(HAIER_VENDOR_ID, HAIER_PRODUCT_CE100) },
1176 /* Pirelli */ 1200 /* Pirelli */
1177 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_1)}, 1201 { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_1, 0xff) },
1178 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_2)}, 1202 { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_C100_2, 0xff) },
1179 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1004)}, 1203 { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1004, 0xff) },
1180 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1005)}, 1204 { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1005, 0xff) },
1181 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1006)}, 1205 { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1006, 0xff) },
1182 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1007)}, 1206 { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1007, 0xff) },
1183 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1008)}, 1207 { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1008, 0xff) },
1184 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1009)}, 1208 { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1009, 0xff) },
1185 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100A)}, 1209 { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100A, 0xff) },
1186 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100B) }, 1210 { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100B, 0xff) },
1187 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100C) }, 1211 { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100C, 0xff) },
1188 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100D) }, 1212 { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100D, 0xff) },
1189 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100E) }, 1213 { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100E, 0xff) },
1190 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100F) }, 1214 { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100F, 0xff) },
1191 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)}, 1215 { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011, 0xff) },
1192 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)}, 1216 { USB_DEVICE_INTERFACE_CLASS(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012, 0xff) },
1193 /* Cinterion */ 1217 /* Cinterion */
1194 { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_E) }, 1218 { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_E) },
1195 { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) }, 1219 { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) },
@@ -1350,20 +1374,10 @@ static int option_probe(struct usb_serial *serial,
1350 &serial->interface->cur_altsetting->desc; 1374 &serial->interface->cur_altsetting->desc;
1351 struct usb_device_descriptor *dev_desc = &serial->dev->descriptor; 1375 struct usb_device_descriptor *dev_desc = &serial->dev->descriptor;
1352 1376
1353 /* 1377 /* Never bind to the CD-Rom emulation interface */
1354 * D-Link DWM 652 still exposes CD-Rom emulation interface in modem 1378 if (iface_desc->bInterfaceClass == 0x08)
1355 * mode.
1356 */
1357 if (dev_desc->idVendor == DLINK_VENDOR_ID &&
1358 dev_desc->idProduct == DLINK_PRODUCT_DWM_652 &&
1359 iface_desc->bInterfaceClass == 0x08)
1360 return -ENODEV; 1379 return -ENODEV;
1361 1380
1362 /* Bandrich modem and AT command interface is 0xff */
1363 if ((dev_desc->idVendor == BANDRICH_VENDOR_ID ||
1364 dev_desc->idVendor == PIRELLI_VENDOR_ID) &&
1365 iface_desc->bInterfaceClass != 0xff)
1366 return -ENODEV;
1367 /* 1381 /*
1368 * Don't bind reserved interfaces (like network ones) which often have 1382 * Don't bind reserved interfaces (like network ones) which often have
1369 * the same class/subclass/protocol as the serial interfaces. Look at 1383 * the same class/subclass/protocol as the serial interfaces. Look at
@@ -1378,9 +1392,9 @@ static int option_probe(struct usb_serial *serial,
1378 * Don't bind network interface on Samsung GT-B3730, it is handled by 1392 * Don't bind network interface on Samsung GT-B3730, it is handled by
1379 * a separate module. 1393 * a separate module.
1380 */ 1394 */
1381 if (dev_desc->idVendor == SAMSUNG_VENDOR_ID && 1395 if (dev_desc->idVendor == cpu_to_le16(SAMSUNG_VENDOR_ID) &&
1382 dev_desc->idProduct == SAMSUNG_PRODUCT_GT_B3730 && 1396 dev_desc->idProduct == cpu_to_le16(SAMSUNG_PRODUCT_GT_B3730) &&
1383 iface_desc->bInterfaceClass != USB_CLASS_CDC_DATA) 1397 iface_desc->bInterfaceClass != USB_CLASS_CDC_DATA)
1384 return -ENODEV; 1398 return -ENODEV;
1385 1399
1386 /* Store device id so we can use it during attach. */ 1400 /* Store device id so we can use it during attach. */
@@ -1518,5 +1532,4 @@ static int option_send_setup(struct usb_serial_port *port)
1518 1532
1519MODULE_AUTHOR(DRIVER_AUTHOR); 1533MODULE_AUTHOR(DRIVER_AUTHOR);
1520MODULE_DESCRIPTION(DRIVER_DESC); 1534MODULE_DESCRIPTION(DRIVER_DESC);
1521MODULE_VERSION(DRIVER_VERSION);
1522MODULE_LICENSE("GPL"); 1535MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c
index cee9a52ca891..d217fd6ee43f 100644
--- a/drivers/usb/serial/oti6858.c
+++ b/drivers/usb/serial/oti6858.c
@@ -57,7 +57,6 @@
57#define OTI6858_DESCRIPTION \ 57#define OTI6858_DESCRIPTION \
58 "Ours Technology Inc. OTi-6858 USB to serial adapter driver" 58 "Ours Technology Inc. OTi-6858 USB to serial adapter driver"
59#define OTI6858_AUTHOR "Tomasz Michal Lukaszewski <FIXME@FIXME>" 59#define OTI6858_AUTHOR "Tomasz Michal Lukaszewski <FIXME@FIXME>"
60#define OTI6858_VERSION "0.2"
61 60
62static const struct usb_device_id id_table[] = { 61static const struct usb_device_id id_table[] = {
63 { USB_DEVICE(OTI6858_VENDOR_ID, OTI6858_PRODUCT_ID) }, 62 { USB_DEVICE(OTI6858_VENDOR_ID, OTI6858_PRODUCT_ID) },
@@ -899,5 +898,4 @@ module_usb_serial_driver(serial_drivers, id_table);
899 898
900MODULE_DESCRIPTION(OTI6858_DESCRIPTION); 899MODULE_DESCRIPTION(OTI6858_DESCRIPTION);
901MODULE_AUTHOR(OTI6858_AUTHOR); 900MODULE_AUTHOR(OTI6858_AUTHOR);
902MODULE_VERSION(OTI6858_VERSION);
903MODULE_LICENSE("GPL"); 901MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c
index ffcfc962ab10..d152be97d041 100644
--- a/drivers/usb/serial/quatech2.c
+++ b/drivers/usb/serial/quatech2.c
@@ -65,8 +65,6 @@
65#define QT2_WRITE_BUFFER_SIZE 512 /* size of write buffer */ 65#define QT2_WRITE_BUFFER_SIZE 512 /* size of write buffer */
66#define QT2_WRITE_CONTROL_SIZE 5 /* control bytes used for a write */ 66#define QT2_WRITE_CONTROL_SIZE 5 /* control bytes used for a write */
67 67
68/* Version Information */
69#define DRIVER_VERSION "v0.1"
70#define DRIVER_DESC "Quatech 2nd gen USB to Serial Driver" 68#define DRIVER_DESC "Quatech 2nd gen USB to Serial Driver"
71 69
72#define USB_VENDOR_ID_QUATECH 0x061d 70#define USB_VENDOR_ID_QUATECH 0x061d
diff --git a/drivers/usb/serial/siemens_mpi.c b/drivers/usb/serial/siemens_mpi.c
index e4a1787cdbac..a76b1ae54a2a 100644
--- a/drivers/usb/serial/siemens_mpi.c
+++ b/drivers/usb/serial/siemens_mpi.c
@@ -16,8 +16,6 @@
16#include <linux/usb.h> 16#include <linux/usb.h>
17#include <linux/usb/serial.h> 17#include <linux/usb/serial.h>
18 18
19/* Version Information */
20#define DRIVER_VERSION "Version 0.1 09/26/2005"
21#define DRIVER_AUTHOR "Thomas Hergenhahn@web.de http://libnodave.sf.net" 19#define DRIVER_AUTHOR "Thomas Hergenhahn@web.de http://libnodave.sf.net"
22#define DRIVER_DESC "Driver for Siemens USB/MPI adapter" 20#define DRIVER_DESC "Driver for Siemens USB/MPI adapter"
23 21
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index 270860f6bb2a..af06f2f5f38b 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -18,7 +18,7 @@
18*/ 18*/
19/* Uncomment to log function calls */ 19/* Uncomment to log function calls */
20/* #define DEBUG */ 20/* #define DEBUG */
21#define DRIVER_VERSION "v.1.7.16" 21
22#define DRIVER_AUTHOR "Kevin Lloyd, Elina Pasheva, Matthew Safar, Rory Filer" 22#define DRIVER_AUTHOR "Kevin Lloyd, Elina Pasheva, Matthew Safar, Rory Filer"
23#define DRIVER_DESC "USB Driver for Sierra Wireless USB modems" 23#define DRIVER_DESC "USB Driver for Sierra Wireless USB modems"
24 24
@@ -1078,7 +1078,6 @@ module_usb_serial_driver(serial_drivers, id_table);
1078 1078
1079MODULE_AUTHOR(DRIVER_AUTHOR); 1079MODULE_AUTHOR(DRIVER_AUTHOR);
1080MODULE_DESCRIPTION(DRIVER_DESC); 1080MODULE_DESCRIPTION(DRIVER_DESC);
1081MODULE_VERSION(DRIVER_VERSION);
1082MODULE_LICENSE("GPL"); 1081MODULE_LICENSE("GPL");
1083 1082
1084module_param(nmea, bool, S_IRUGO | S_IWUSR); 1083module_param(nmea, bool, S_IRUGO | S_IWUSR);
diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c
index 769c137f8975..a42536af1256 100644
--- a/drivers/usb/serial/spcp8x5.c
+++ b/drivers/usb/serial/spcp8x5.c
@@ -28,9 +28,6 @@
28#include <linux/usb.h> 28#include <linux/usb.h>
29#include <linux/usb/serial.h> 29#include <linux/usb/serial.h>
30 30
31
32/* Version Information */
33#define DRIVER_VERSION "v0.10"
34#define DRIVER_DESC "SPCP8x5 USB to serial adaptor driver" 31#define DRIVER_DESC "SPCP8x5 USB to serial adaptor driver"
35 32
36#define SPCP8x5_007_VID 0x04FC 33#define SPCP8x5_007_VID 0x04FC
@@ -651,5 +648,4 @@ static struct usb_serial_driver * const serial_drivers[] = {
651module_usb_serial_driver(serial_drivers, id_table); 648module_usb_serial_driver(serial_drivers, id_table);
652 649
653MODULE_DESCRIPTION(DRIVER_DESC); 650MODULE_DESCRIPTION(DRIVER_DESC);
654MODULE_VERSION(DRIVER_VERSION);
655MODULE_LICENSE("GPL"); 651MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c
index 868d1e6852e2..4543ea350229 100644
--- a/drivers/usb/serial/ssu100.c
+++ b/drivers/usb/serial/ssu100.c
@@ -46,8 +46,6 @@
46#define FULLPWRBIT 0x00000080 46#define FULLPWRBIT 0x00000080
47#define NEXT_BOARD_POWER_BIT 0x00000004 47#define NEXT_BOARD_POWER_BIT 0x00000004
48 48
49/* Version Information */
50#define DRIVER_VERSION "v0.1"
51#define DRIVER_DESC "Quatech SSU-100 USB to Serial Driver" 49#define DRIVER_DESC "Quatech SSU-100 USB to Serial Driver"
52 50
53#define USB_VENDOR_ID_QUATECH 0x061d /* Quatech VID */ 51#define USB_VENDOR_ID_QUATECH 0x061d /* Quatech VID */
diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
index a3e9c095f0d8..01c94aada56c 100644
--- a/drivers/usb/serial/usb_wwan.c
+++ b/drivers/usb/serial/usb_wwan.c
@@ -19,7 +19,6 @@
19 - controlling the baud rate doesn't make sense 19 - controlling the baud rate doesn't make sense
20*/ 20*/
21 21
22#define DRIVER_VERSION "v0.7.2"
23#define DRIVER_AUTHOR "Matthias Urlichs <smurf@smurf.noris.de>" 22#define DRIVER_AUTHOR "Matthias Urlichs <smurf@smurf.noris.de>"
24#define DRIVER_DESC "USB Driver for GSM modems" 23#define DRIVER_DESC "USB Driver for GSM modems"
25 24
@@ -710,5 +709,4 @@ EXPORT_SYMBOL(usb_wwan_resume);
710 709
711MODULE_AUTHOR(DRIVER_AUTHOR); 710MODULE_AUTHOR(DRIVER_AUTHOR);
712MODULE_DESCRIPTION(DRIVER_DESC); 711MODULE_DESCRIPTION(DRIVER_DESC);
713MODULE_VERSION(DRIVER_VERSION);
714MODULE_LICENSE("GPL"); 712MODULE_LICENSE("GPL");
diff --git a/drivers/usb/serial/vivopay-serial.c b/drivers/usb/serial/vivopay-serial.c
index 0c0aa876c209..6299526ff8c3 100644
--- a/drivers/usb/serial/vivopay-serial.c
+++ b/drivers/usb/serial/vivopay-serial.c
@@ -10,8 +10,6 @@
10#include <linux/usb.h> 10#include <linux/usb.h>
11#include <linux/usb/serial.h> 11#include <linux/usb/serial.h>
12 12
13
14#define DRIVER_VERSION "v1.0"
15#define DRIVER_DESC "ViVOpay USB Serial Driver" 13#define DRIVER_DESC "ViVOpay USB Serial Driver"
16 14
17#define VIVOPAY_VENDOR_ID 0x1d5f 15#define VIVOPAY_VENDOR_ID 0x1d5f
@@ -42,5 +40,4 @@ module_usb_serial_driver(serial_drivers, id_table);
42 40
43MODULE_AUTHOR("Forest Bond <forest.bond@outpostembedded.com>"); 41MODULE_AUTHOR("Forest Bond <forest.bond@outpostembedded.com>");
44MODULE_DESCRIPTION(DRIVER_DESC); 42MODULE_DESCRIPTION(DRIVER_DESC);
45MODULE_VERSION(DRIVER_VERSION);
46MODULE_LICENSE("GPL"); 43MODULE_LICENSE("GPL");