aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-09-10 01:27:33 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-10 01:27:33 -0400
commite548833df83c3554229eff0672900bfe958b45fd (patch)
tree85efc4a76dc356593d6d394776aeb845dc580fb6 /drivers/usb/serial
parentcbd9da7be869f676afc204e1a664163778c770bd (diff)
parent053d8f6622701f849fda2ca2c9ae596c13599ba9 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: net/mac80211/main.c
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/cp210x.c15
-rw-r--r--drivers/usb/serial/ftdi_sio.c15
-rw-r--r--drivers/usb/serial/ftdi_sio_ids.h21
-rw-r--r--drivers/usb/serial/generic.c11
-rw-r--r--drivers/usb/serial/io_ti.c4
-rw-r--r--drivers/usb/serial/mos7840.c32
-rw-r--r--drivers/usb/serial/navman.c1
-rw-r--r--drivers/usb/serial/option.c126
-rw-r--r--drivers/usb/serial/pl2303.c3
-rw-r--r--drivers/usb/serial/pl2303.h4
-rw-r--r--drivers/usb/serial/ssu100.c258
-rw-r--r--drivers/usb/serial/usb-serial.c23
12 files changed, 333 insertions, 180 deletions
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 2bef4415c19..4f1744c5871 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -56,6 +56,7 @@ static int debug;
56static const struct usb_device_id id_table[] = { 56static const struct usb_device_id id_table[] = {
57 { USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */ 57 { USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */
58 { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */ 58 { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */
59 { USB_DEVICE(0x0489, 0xE003) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */
59 { USB_DEVICE(0x0745, 0x1000) }, /* CipherLab USB CCD Barcode Scanner 1000 */ 60 { USB_DEVICE(0x0745, 0x1000) }, /* CipherLab USB CCD Barcode Scanner 1000 */
60 { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */ 61 { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */
61 { USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */ 62 { USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */
@@ -88,6 +89,7 @@ static const struct usb_device_id id_table[] = {
88 { USB_DEVICE(0x10C4, 0x8149) }, /* West Mountain Radio Computerized Battery Analyzer */ 89 { USB_DEVICE(0x10C4, 0x8149) }, /* West Mountain Radio Computerized Battery Analyzer */
89 { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */ 90 { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */
90 { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ 91 { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */
92 { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */
91 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ 93 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */
92 { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */ 94 { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */
93 { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */ 95 { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */
@@ -109,6 +111,7 @@ static const struct usb_device_id id_table[] = {
109 { USB_DEVICE(0x10C4, 0x83A8) }, /* Amber Wireless AMB2560 */ 111 { USB_DEVICE(0x10C4, 0x83A8) }, /* Amber Wireless AMB2560 */
110 { USB_DEVICE(0x10C4, 0x8411) }, /* Kyocera GPS Module */ 112 { USB_DEVICE(0x10C4, 0x8411) }, /* Kyocera GPS Module */
111 { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */ 113 { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */
114 { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */
112 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ 115 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
113 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ 116 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
114 { USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */ 117 { USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */
@@ -122,14 +125,14 @@ static const struct usb_device_id id_table[] = {
122 { USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */ 125 { USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */
123 { USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */ 126 { USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */
124 { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */ 127 { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */
125 { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
126 { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
127 { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
128 { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */
129 { USB_DEVICE(0x16DC, 0x0010) }, /* W-IE-NE-R Plein & Baus GmbH PL512 Power Supply */ 128 { USB_DEVICE(0x16DC, 0x0010) }, /* W-IE-NE-R Plein & Baus GmbH PL512 Power Supply */
130 { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */ 129 { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */
131 { USB_DEVICE(0x16DC, 0x0012) }, /* W-IE-NE-R Plein & Baus GmbH MPOD Multi Channel Power Supply */ 130 { USB_DEVICE(0x16DC, 0x0012) }, /* W-IE-NE-R Plein & Baus GmbH MPOD Multi Channel Power Supply */
132 { USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */ 131 { USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */
132 { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
133 { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
134 { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
135 { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */
133 { } /* Terminating Entry */ 136 { } /* Terminating Entry */
134}; 137};
135 138
@@ -222,8 +225,8 @@ static struct usb_serial_driver cp210x_device = {
222#define BITS_STOP_2 0x0002 225#define BITS_STOP_2 0x0002
223 226
224/* CP210X_SET_BREAK */ 227/* CP210X_SET_BREAK */
225#define BREAK_ON 0x0000 228#define BREAK_ON 0x0001
226#define BREAK_OFF 0x0001 229#define BREAK_OFF 0x0000
227 230
228/* CP210X_(SET_MHS|GET_MDMSTS) */ 231/* CP210X_(SET_MHS|GET_MDMSTS) */
229#define CONTROL_DTR 0x0001 232#define CONTROL_DTR 0x0001
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index eb12d9b096b..97cc87d654c 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -180,6 +180,7 @@ static struct usb_device_id id_table_combined [] = {
180 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, 180 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
181 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, 181 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
182 { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) }, 182 { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) },
183 { USB_DEVICE(FTDI_VID, FTDI_LENZ_LIUSB_PID) },
183 { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) }, 184 { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) },
184 { USB_DEVICE(FTDI_VID, FTDI_XF_634_PID) }, 185 { USB_DEVICE(FTDI_VID, FTDI_XF_634_PID) },
185 { USB_DEVICE(FTDI_VID, FTDI_XF_547_PID) }, 186 { USB_DEVICE(FTDI_VID, FTDI_XF_547_PID) },
@@ -750,6 +751,16 @@ static struct usb_device_id id_table_combined [] = {
750 { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID), 751 { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID),
751 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 752 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
752 { USB_DEVICE(FTDI_VID, SEGWAY_RMP200_PID) }, 753 { USB_DEVICE(FTDI_VID, SEGWAY_RMP200_PID) },
754 { USB_DEVICE(IONICS_VID, IONICS_PLUGCOMPUTER_PID),
755 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
756 { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_24_MASTER_WING_PID) },
757 { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_PC_WING_PID) },
758 { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_USB_DMX_PID) },
759 { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MIDI_TIMECODE_PID) },
760 { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MINI_WING_PID) },
761 { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MAXI_WING_PID) },
762 { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MEDIA_WING_PID) },
763 { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_WING_PID) },
753 { }, /* Optional parameter entry */ 764 { }, /* Optional parameter entry */
754 { } /* Terminating entry */ 765 { } /* Terminating entry */
755}; 766};
@@ -1376,7 +1387,7 @@ static void ftdi_set_max_packet_size(struct usb_serial_port *port)
1376 } 1387 }
1377 1388
1378 /* set max packet size based on descriptor */ 1389 /* set max packet size based on descriptor */
1379 priv->max_packet_size = ep_desc->wMaxPacketSize; 1390 priv->max_packet_size = le16_to_cpu(ep_desc->wMaxPacketSize);
1380 1391
1381 dev_info(&udev->dev, "Setting MaxPacketSize %d\n", priv->max_packet_size); 1392 dev_info(&udev->dev, "Setting MaxPacketSize %d\n", priv->max_packet_size);
1382} 1393}
@@ -1831,7 +1842,7 @@ static int ftdi_process_packet(struct tty_struct *tty,
1831 1842
1832 if (port->port.console && port->sysrq) { 1843 if (port->port.console && port->sysrq) {
1833 for (i = 0; i < len; i++, ch++) { 1844 for (i = 0; i < len; i++, ch++) {
1834 if (!usb_serial_handle_sysrq_char(tty, port, *ch)) 1845 if (!usb_serial_handle_sysrq_char(port, *ch))
1835 tty_insert_flip_char(tty, *ch, flag); 1846 tty_insert_flip_char(tty, *ch, flag);
1836 } 1847 }
1837 } else { 1848 } else {
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index 6e612c52e76..15a4583775a 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -110,6 +110,9 @@
110/* Propox devices */ 110/* Propox devices */
111#define FTDI_PROPOX_JTAGCABLEII_PID 0xD738 111#define FTDI_PROPOX_JTAGCABLEII_PID 0xD738
112 112
113/* Lenz LI-USB Computer Interface. */
114#define FTDI_LENZ_LIUSB_PID 0xD780
115
113/* 116/*
114 * Xsens Technologies BV products (http://www.xsens.com). 117 * Xsens Technologies BV products (http://www.xsens.com).
115 */ 118 */
@@ -132,6 +135,18 @@
132#define FTDI_NDI_AURORA_SCU_PID 0xDA74 /* NDI Aurora SCU */ 135#define FTDI_NDI_AURORA_SCU_PID 0xDA74 /* NDI Aurora SCU */
133 136
134/* 137/*
138 * ChamSys Limited (www.chamsys.co.uk) USB wing/interface product IDs
139 */
140#define FTDI_CHAMSYS_24_MASTER_WING_PID 0xDAF8
141#define FTDI_CHAMSYS_PC_WING_PID 0xDAF9
142#define FTDI_CHAMSYS_USB_DMX_PID 0xDAFA
143#define FTDI_CHAMSYS_MIDI_TIMECODE_PID 0xDAFB
144#define FTDI_CHAMSYS_MINI_WING_PID 0xDAFC
145#define FTDI_CHAMSYS_MAXI_WING_PID 0xDAFD
146#define FTDI_CHAMSYS_MEDIA_WING_PID 0xDAFE
147#define FTDI_CHAMSYS_WING_PID 0xDAFF
148
149/*
135 * Westrex International devices submitted by Cory Lee 150 * Westrex International devices submitted by Cory Lee
136 */ 151 */
137#define FTDI_WESTREX_MODEL_777_PID 0xDC00 /* Model 777 */ 152#define FTDI_WESTREX_MODEL_777_PID 0xDC00 /* Model 777 */
@@ -989,6 +1004,12 @@
989#define ALTI2_N3_PID 0x6001 /* Neptune 3 */ 1004#define ALTI2_N3_PID 0x6001 /* Neptune 3 */
990 1005
991/* 1006/*
1007 * Ionics PlugComputer
1008 */
1009#define IONICS_VID 0x1c0c
1010#define IONICS_PLUGCOMPUTER_PID 0x0102
1011
1012/*
992 * Dresden Elektronik Sensor Terminal Board 1013 * Dresden Elektronik Sensor Terminal Board
993 */ 1014 */
994#define DE_VID 0x1cf1 /* Vendor ID */ 1015#define DE_VID 0x1cf1 /* Vendor ID */
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index ca92f67747c..e6833e216fc 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -343,7 +343,7 @@ void usb_serial_generic_process_read_urb(struct urb *urb)
343 tty_insert_flip_string(tty, ch, urb->actual_length); 343 tty_insert_flip_string(tty, ch, urb->actual_length);
344 else { 344 else {
345 for (i = 0; i < urb->actual_length; i++, ch++) { 345 for (i = 0; i < urb->actual_length; i++, ch++) {
346 if (!usb_serial_handle_sysrq_char(tty, port, *ch)) 346 if (!usb_serial_handle_sysrq_char(port, *ch))
347 tty_insert_flip_char(tty, *ch, TTY_NORMAL); 347 tty_insert_flip_char(tty, *ch, TTY_NORMAL);
348 } 348 }
349 } 349 }
@@ -448,12 +448,11 @@ void usb_serial_generic_unthrottle(struct tty_struct *tty)
448EXPORT_SYMBOL_GPL(usb_serial_generic_unthrottle); 448EXPORT_SYMBOL_GPL(usb_serial_generic_unthrottle);
449 449
450#ifdef CONFIG_MAGIC_SYSRQ 450#ifdef CONFIG_MAGIC_SYSRQ
451int usb_serial_handle_sysrq_char(struct tty_struct *tty, 451int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch)
452 struct usb_serial_port *port, unsigned int ch)
453{ 452{
454 if (port->sysrq && port->port.console) { 453 if (port->sysrq && port->port.console) {
455 if (ch && time_before(jiffies, port->sysrq)) { 454 if (ch && time_before(jiffies, port->sysrq)) {
456 handle_sysrq(ch, tty); 455 handle_sysrq(ch);
457 port->sysrq = 0; 456 port->sysrq = 0;
458 return 1; 457 return 1;
459 } 458 }
@@ -462,8 +461,7 @@ int usb_serial_handle_sysrq_char(struct tty_struct *tty,
462 return 0; 461 return 0;
463} 462}
464#else 463#else
465int usb_serial_handle_sysrq_char(struct tty_struct *tty, 464int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch)
466 struct usb_serial_port *port, unsigned int ch)
467{ 465{
468 return 0; 466 return 0;
469} 467}
@@ -518,6 +516,7 @@ void usb_serial_generic_disconnect(struct usb_serial *serial)
518 for (i = 0; i < serial->num_ports; ++i) 516 for (i = 0; i < serial->num_ports; ++i)
519 generic_cleanup(serial->port[i]); 517 generic_cleanup(serial->port[i]);
520} 518}
519EXPORT_SYMBOL_GPL(usb_serial_generic_disconnect);
521 520
522void usb_serial_generic_release(struct usb_serial *serial) 521void usb_serial_generic_release(struct usb_serial *serial)
523{ 522{
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index dc47f986df5..a7cfc595293 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -1151,7 +1151,7 @@ static int download_fw(struct edgeport_serial *serial)
1151 1151
1152 /* Check if we have an old version in the I2C and 1152 /* Check if we have an old version in the I2C and
1153 update if necessary */ 1153 update if necessary */
1154 if (download_cur_ver != download_new_ver) { 1154 if (download_cur_ver < download_new_ver) {
1155 dbg("%s - Update I2C dld from %d.%d to %d.%d", 1155 dbg("%s - Update I2C dld from %d.%d to %d.%d",
1156 __func__, 1156 __func__,
1157 firmware_version->Ver_Major, 1157 firmware_version->Ver_Major,
@@ -1284,7 +1284,7 @@ static int download_fw(struct edgeport_serial *serial)
1284 kfree(header); 1284 kfree(header);
1285 kfree(rom_desc); 1285 kfree(rom_desc);
1286 kfree(ti_manuf_desc); 1286 kfree(ti_manuf_desc);
1287 return status; 1287 return -EINVAL;
1288 } 1288 }
1289 1289
1290 /* Update I2C with type 0xf2 record with correct 1290 /* Update I2C with type 0xf2 record with correct
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 585b7e66374..1c9b6e9b238 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -119,16 +119,20 @@
119 * by making a change here, in moschip_port_id_table, and in 119 * by making a change here, in moschip_port_id_table, and in
120 * moschip_id_table_combined 120 * moschip_id_table_combined
121 */ 121 */
122#define USB_VENDOR_ID_BANDB 0x0856 122#define USB_VENDOR_ID_BANDB 0x0856
123#define BANDB_DEVICE_ID_USO9ML2_2 0xAC22 123#define BANDB_DEVICE_ID_USO9ML2_2 0xAC22
124#define BANDB_DEVICE_ID_USO9ML2_4 0xAC24 124#define BANDB_DEVICE_ID_USO9ML2_2P 0xBC00
125#define BANDB_DEVICE_ID_US9ML2_2 0xAC29 125#define BANDB_DEVICE_ID_USO9ML2_4 0xAC24
126#define BANDB_DEVICE_ID_US9ML2_4 0xAC30 126#define BANDB_DEVICE_ID_USO9ML2_4P 0xBC01
127#define BANDB_DEVICE_ID_USPTL4_2 0xAC31 127#define BANDB_DEVICE_ID_US9ML2_2 0xAC29
128#define BANDB_DEVICE_ID_USPTL4_4 0xAC32 128#define BANDB_DEVICE_ID_US9ML2_4 0xAC30
129#define BANDB_DEVICE_ID_USOPTL4_2 0xAC42 129#define BANDB_DEVICE_ID_USPTL4_2 0xAC31
130#define BANDB_DEVICE_ID_USOPTL4_4 0xAC44 130#define BANDB_DEVICE_ID_USPTL4_4 0xAC32
131#define BANDB_DEVICE_ID_USOPTL2_4 0xAC24 131#define BANDB_DEVICE_ID_USOPTL4_2 0xAC42
132#define BANDB_DEVICE_ID_USOPTL4_2P 0xBC02
133#define BANDB_DEVICE_ID_USOPTL4_4 0xAC44
134#define BANDB_DEVICE_ID_USOPTL4_4P 0xBC03
135#define BANDB_DEVICE_ID_USOPTL2_4 0xAC24
132 136
133/* This driver also supports 137/* This driver also supports
134 * ATEN UC2324 device using Moschip MCS7840 138 * ATEN UC2324 device using Moschip MCS7840
@@ -184,13 +188,17 @@ static const struct usb_device_id moschip_port_id_table[] = {
184 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, 188 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)},
185 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, 189 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)},
186 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2)}, 190 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2)},
191 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2P)},
187 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4)}, 192 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4)},
193 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4P)},
188 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_2)}, 194 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_2)},
189 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_4)}, 195 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_4)},
190 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_2)}, 196 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_2)},
191 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_4)}, 197 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_4)},
192 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, 198 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)},
199 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2P)},
193 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, 200 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
201 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4P)},
194 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)}, 202 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)},
195 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, 203 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)},
196 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)}, 204 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)},
@@ -201,13 +209,17 @@ static const struct usb_device_id moschip_id_table_combined[] __devinitconst = {
201 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, 209 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)},
202 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, 210 {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)},
203 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2)}, 211 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2)},
212 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2P)},
204 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4)}, 213 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4)},
214 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4P)},
205 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_2)}, 215 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_2)},
206 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_4)}, 216 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_4)},
207 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_2)}, 217 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_2)},
208 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_4)}, 218 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_4)},
209 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, 219 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)},
220 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2P)},
210 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, 221 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)},
222 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4P)},
211 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)}, 223 {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)},
212 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, 224 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)},
213 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)}, 225 {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)},
diff --git a/drivers/usb/serial/navman.c b/drivers/usb/serial/navman.c
index a6b207c8491..1f00f243c26 100644
--- a/drivers/usb/serial/navman.c
+++ b/drivers/usb/serial/navman.c
@@ -25,6 +25,7 @@ static int debug;
25 25
26static const struct usb_device_id id_table[] = { 26static const struct usb_device_id id_table[] = {
27 { USB_DEVICE(0x0a99, 0x0001) }, /* Talon Technology device */ 27 { USB_DEVICE(0x0a99, 0x0001) }, /* Talon Technology device */
28 { USB_DEVICE(0x0df7, 0x0900) }, /* Mobile Action i-gotU */
28 { }, 29 { },
29}; 30};
30MODULE_DEVICE_TABLE(usb, id_table); 31MODULE_DEVICE_TABLE(usb, id_table);
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 9fc6ea2c681..c46911af282 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -164,6 +164,14 @@ static void option_instat_callback(struct urb *urb);
164#define YISO_VENDOR_ID 0x0EAB 164#define YISO_VENDOR_ID 0x0EAB
165#define YISO_PRODUCT_U893 0xC893 165#define YISO_PRODUCT_U893 0xC893
166 166
167/*
168 * NOVATEL WIRELESS PRODUCTS
169 *
170 * Note from Novatel Wireless:
171 * If your Novatel modem does not work on linux, don't
172 * change the option module, but check our website. If
173 * that does not help, contact ddeschepper@nvtl.com
174*/
167/* MERLIN EVDO PRODUCTS */ 175/* MERLIN EVDO PRODUCTS */
168#define NOVATELWIRELESS_PRODUCT_V640 0x1100 176#define NOVATELWIRELESS_PRODUCT_V640 0x1100
169#define NOVATELWIRELESS_PRODUCT_V620 0x1110 177#define NOVATELWIRELESS_PRODUCT_V620 0x1110
@@ -185,24 +193,39 @@ static void option_instat_callback(struct urb *urb);
185#define NOVATELWIRELESS_PRODUCT_EU730 0x2400 193#define NOVATELWIRELESS_PRODUCT_EU730 0x2400
186#define NOVATELWIRELESS_PRODUCT_EU740 0x2410 194#define NOVATELWIRELESS_PRODUCT_EU740 0x2410
187#define NOVATELWIRELESS_PRODUCT_EU870D 0x2420 195#define NOVATELWIRELESS_PRODUCT_EU870D 0x2420
188
189/* OVATION PRODUCTS */ 196/* OVATION PRODUCTS */
190#define NOVATELWIRELESS_PRODUCT_MC727 0x4100 197#define NOVATELWIRELESS_PRODUCT_MC727 0x4100
191#define NOVATELWIRELESS_PRODUCT_MC950D 0x4400 198#define NOVATELWIRELESS_PRODUCT_MC950D 0x4400
192#define NOVATELWIRELESS_PRODUCT_U727 0x5010 199/*
193#define NOVATELWIRELESS_PRODUCT_MC727_NEW 0x5100 200 * Note from Novatel Wireless:
194#define NOVATELWIRELESS_PRODUCT_MC760 0x6000 201 * All PID in the 5xxx range are currently reserved for
202 * auto-install CDROMs, and should not be added to this
203 * module.
204 *
205 * #define NOVATELWIRELESS_PRODUCT_U727 0x5010
206 * #define NOVATELWIRELESS_PRODUCT_MC727_NEW 0x5100
207*/
195#define NOVATELWIRELESS_PRODUCT_OVMC760 0x6002 208#define NOVATELWIRELESS_PRODUCT_OVMC760 0x6002
196 209#define NOVATELWIRELESS_PRODUCT_MC780 0x6010
197/* FUTURE NOVATEL PRODUCTS */ 210#define NOVATELWIRELESS_PRODUCT_EVDO_FULLSPEED 0x6000
198#define NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED 0X6001 211#define NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED 0x6001
199#define NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED 0X7000 212#define NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED 0x7000
200#define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED 0X7001 213#define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED 0x7001
201#define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED 0X8000 214#define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED3 0x7003
202#define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED 0X8001 215#define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED4 0x7004
203#define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED 0X9000 216#define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED5 0x7005
204#define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0X9001 217#define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED6 0x7006
205#define NOVATELWIRELESS_PRODUCT_GLOBAL 0XA001 218#define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED7 0x7007
219#define NOVATELWIRELESS_PRODUCT_MC996D 0x7030
220#define NOVATELWIRELESS_PRODUCT_MF3470 0x7041
221#define NOVATELWIRELESS_PRODUCT_MC547 0x7042
222#define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED 0x8000
223#define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED 0x8001
224#define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED 0x9000
225#define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0x9001
226#define NOVATELWIRELESS_PRODUCT_G1 0xA001
227#define NOVATELWIRELESS_PRODUCT_G1_M 0xA002
228#define NOVATELWIRELESS_PRODUCT_G2 0xA010
206 229
207/* AMOI PRODUCTS */ 230/* AMOI PRODUCTS */
208#define AMOI_VENDOR_ID 0x1614 231#define AMOI_VENDOR_ID 0x1614
@@ -365,6 +388,10 @@ static void option_instat_callback(struct urb *urb);
365#define OLIVETTI_VENDOR_ID 0x0b3c 388#define OLIVETTI_VENDOR_ID 0x0b3c
366#define OLIVETTI_PRODUCT_OLICARD100 0xc000 389#define OLIVETTI_PRODUCT_OLICARD100 0xc000
367 390
391/* Celot products */
392#define CELOT_VENDOR_ID 0x211f
393#define CELOT_PRODUCT_CT680M 0x6801
394
368/* some devices interfaces need special handling due to a number of reasons */ 395/* some devices interfaces need special handling due to a number of reasons */
369enum option_blacklist_reason { 396enum option_blacklist_reason {
370 OPTION_BLACKLIST_NONE = 0, 397 OPTION_BLACKLIST_NONE = 0,
@@ -486,36 +513,44 @@ static const struct usb_device_id option_ids[] = {
486 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff) }, 513 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff) },
487 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_ETS1220, 0xff, 0xff, 0xff) }, 514 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_ETS1220, 0xff, 0xff, 0xff) },
488 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E14AC) }, 515 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E14AC) },
489 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) }, /* Novatel Merlin V640/XV620 */ 516 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) },
490 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) }, /* Novatel Merlin V620/S620 */ 517 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) },
491 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V740) }, /* Novatel Merlin EX720/V740/X720 */ 518 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V740) },
492 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V720) }, /* Novatel Merlin V720/S720/PC720 */ 519 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V720) },
493 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U730) }, /* Novatel U730/U740 (VF version) */ 520 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U730) },
494 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U740) }, /* Novatel U740 */ 521 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U740) },
495 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U870) }, /* Novatel U870 */ 522 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U870) },
496 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_XU870) }, /* Novatel Merlin XU870 HSDPA/3G */ 523 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_XU870) },
497 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_X950D) }, /* Novatel X950D */ 524 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_X950D) },
498 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EV620) }, /* Novatel EV620/ES620 CDMA/EV-DO */ 525 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EV620) },
499 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_ES720) }, /* Novatel ES620/ES720/U720/USB720 */ 526 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_ES720) },
500 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E725) }, /* Novatel E725/E726 */ 527 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E725) },
501 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_ES620) }, /* Novatel Merlin ES620 SM Bus */ 528 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_ES620) },
502 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU730) }, /* Novatel EU730 and Vodafone EU740 */ 529 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU730) },
503 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU740) }, /* Novatel non-Vodafone EU740 */ 530 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU740) },
504 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU870D) }, /* Novatel EU850D/EU860D/EU870D */ 531 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU870D) },
505 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC950D) }, /* Novatel MC930D/MC950D */ 532 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC950D) },
506 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, /* Novatel MC727/U727/USB727 */ 533 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) },
507 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727_NEW) }, /* Novatel MC727/U727/USB727 refresh */ 534 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_OVMC760) },
508 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U727) }, /* Novatel MC727/U727/USB727 */ 535 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC780) },
509 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC760) }, /* Novatel MC760/U760/USB760 */ 536 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_FULLSPEED) },
510 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_OVMC760) }, /* Novatel Ovation MC760 */ 537 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED) },
511 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED) }, /* Novatel HSPA product */ 538 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) },
512 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) }, /* Novatel EVDO Embedded product */ 539 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) },
513 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) }, /* Novatel HSPA Embedded product */ 540 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED) },
514 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED) }, /* Novatel EVDO product */ 541 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED3) },
515 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED) }, /* Novatel HSPA product */ 542 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED4) },
516 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED) }, /* Novatel EVDO Embedded product */ 543 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED5) },
517 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED) }, /* Novatel HSPA Embedded product */ 544 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED6) },
518 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_GLOBAL) }, /* Novatel Global product */ 545 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED7) },
546 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC996D) },
547 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MF3470) },
548 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC547) },
549 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED) },
550 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED) },
551 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1) },
552 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1_M) },
553 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G2) },
519 554
520 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, 555 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) },
521 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, 556 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) },
@@ -887,10 +922,9 @@ static const struct usb_device_id option_ids[] = {
887 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100F) }, 922 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_100F) },
888 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)}, 923 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1011)},
889 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)}, 924 { USB_DEVICE(PIRELLI_VENDOR_ID, PIRELLI_PRODUCT_1012)},
890
891 { USB_DEVICE(CINTERION_VENDOR_ID, 0x0047) }, 925 { USB_DEVICE(CINTERION_VENDOR_ID, 0x0047) },
892
893 { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) }, 926 { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100) },
927 { USB_DEVICE(CELOT_VENDOR_ID, CELOT_PRODUCT_CT680M) }, /* CT-650 CDMA 450 1xEVDO modem */
894 { } /* Terminating entry */ 928 { } /* Terminating entry */
895}; 929};
896MODULE_DEVICE_TABLE(usb, option_ids); 930MODULE_DEVICE_TABLE(usb, option_ids);
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 6b600182227..8ae4c6cbc38 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -86,6 +86,7 @@ static const struct usb_device_id id_table[] = {
86 { USB_DEVICE(SUPERIAL_VENDOR_ID, SUPERIAL_PRODUCT_ID) }, 86 { USB_DEVICE(SUPERIAL_VENDOR_ID, SUPERIAL_PRODUCT_ID) },
87 { USB_DEVICE(HP_VENDOR_ID, HP_LD220_PRODUCT_ID) }, 87 { USB_DEVICE(HP_VENDOR_ID, HP_LD220_PRODUCT_ID) },
88 { USB_DEVICE(CRESSI_VENDOR_ID, CRESSI_EDY_PRODUCT_ID) }, 88 { USB_DEVICE(CRESSI_VENDOR_ID, CRESSI_EDY_PRODUCT_ID) },
89 { USB_DEVICE(ZEAGLE_VENDOR_ID, ZEAGLE_N2ITION3_PRODUCT_ID) },
89 { USB_DEVICE(SONY_VENDOR_ID, SONY_QN3USB_PRODUCT_ID) }, 90 { USB_DEVICE(SONY_VENDOR_ID, SONY_QN3USB_PRODUCT_ID) },
90 { USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) }, 91 { USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) },
91 { USB_DEVICE(ADLINK_VENDOR_ID, ADLINK_ND6530_PRODUCT_ID) }, 92 { USB_DEVICE(ADLINK_VENDOR_ID, ADLINK_ND6530_PRODUCT_ID) },
@@ -788,7 +789,7 @@ static void pl2303_process_read_urb(struct urb *urb)
788 789
789 if (port->port.console && port->sysrq) { 790 if (port->port.console && port->sysrq) {
790 for (i = 0; i < urb->actual_length; ++i) 791 for (i = 0; i < urb->actual_length; ++i)
791 if (!usb_serial_handle_sysrq_char(tty, port, data[i])) 792 if (!usb_serial_handle_sysrq_char(port, data[i]))
792 tty_insert_flip_char(tty, data[i], tty_flag); 793 tty_insert_flip_char(tty, data[i], tty_flag);
793 } else { 794 } else {
794 tty_insert_flip_string_fixed_flag(tty, data, tty_flag, 795 tty_insert_flip_string_fixed_flag(tty, data, tty_flag,
diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
index a871645389d..43eb9bdad42 100644
--- a/drivers/usb/serial/pl2303.h
+++ b/drivers/usb/serial/pl2303.h
@@ -128,6 +128,10 @@
128#define CRESSI_VENDOR_ID 0x04b8 128#define CRESSI_VENDOR_ID 0x04b8
129#define CRESSI_EDY_PRODUCT_ID 0x0521 129#define CRESSI_EDY_PRODUCT_ID 0x0521
130 130
131/* Zeagle dive computer interface */
132#define ZEAGLE_VENDOR_ID 0x04b8
133#define ZEAGLE_N2ITION3_PRODUCT_ID 0x0522
134
131/* Sony, USB data cable for CMD-Jxx mobile phones */ 135/* Sony, USB data cable for CMD-Jxx mobile phones */
132#define SONY_VENDOR_ID 0x054c 136#define SONY_VENDOR_ID 0x054c
133#define SONY_QN3USB_PRODUCT_ID 0x0437 137#define SONY_QN3USB_PRODUCT_ID 0x0437
diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c
index 6e82d4f54bc..e986002b384 100644
--- a/drivers/usb/serial/ssu100.c
+++ b/drivers/usb/serial/ssu100.c
@@ -15,6 +15,7 @@
15#include <linux/serial.h> 15#include <linux/serial.h>
16#include <linux/usb.h> 16#include <linux/usb.h>
17#include <linux/usb/serial.h> 17#include <linux/usb/serial.h>
18#include <linux/serial_reg.h>
18#include <linux/uaccess.h> 19#include <linux/uaccess.h>
19 20
20#define QT_OPEN_CLOSE_CHANNEL 0xca 21#define QT_OPEN_CLOSE_CHANNEL 0xca
@@ -27,36 +28,11 @@
27#define QT_HW_FLOW_CONTROL_MASK 0xc5 28#define QT_HW_FLOW_CONTROL_MASK 0xc5
28#define QT_SW_FLOW_CONTROL_MASK 0xc6 29#define QT_SW_FLOW_CONTROL_MASK 0xc6
29 30
30#define MODEM_CTL_REGISTER 0x04
31#define MODEM_STATUS_REGISTER 0x06
32
33
34#define SERIAL_LSR_OE 0x02
35#define SERIAL_LSR_PE 0x04
36#define SERIAL_LSR_FE 0x08
37#define SERIAL_LSR_BI 0x10
38
39#define SERIAL_LSR_TEMT 0x40
40
41#define SERIAL_MCR_DTR 0x01
42#define SERIAL_MCR_RTS 0x02
43#define SERIAL_MCR_LOOP 0x10
44
45#define SERIAL_MSR_CTS 0x10
46#define SERIAL_MSR_CD 0x80
47#define SERIAL_MSR_RI 0x40
48#define SERIAL_MSR_DSR 0x20
49#define SERIAL_MSR_MASK 0xf0 31#define SERIAL_MSR_MASK 0xf0
50 32
51#define SERIAL_CRTSCTS ((SERIAL_MCR_RTS << 8) | SERIAL_MSR_CTS) 33#define SERIAL_CRTSCTS ((UART_MCR_RTS << 8) | UART_MSR_CTS)
52 34
53#define SERIAL_8_DATA 0x03 35#define SERIAL_EVEN_PARITY (UART_LCR_PARITY | UART_LCR_EPAR)
54#define SERIAL_7_DATA 0x02
55#define SERIAL_6_DATA 0x01
56#define SERIAL_5_DATA 0x00
57
58#define SERIAL_ODD_PARITY 0X08
59#define SERIAL_EVEN_PARITY 0X18
60 36
61#define MAX_BAUD_RATE 460800 37#define MAX_BAUD_RATE 460800
62 38
@@ -70,7 +46,7 @@
70#define FULLPWRBIT 0x00000080 46#define FULLPWRBIT 0x00000080
71#define NEXT_BOARD_POWER_BIT 0x00000004 47#define NEXT_BOARD_POWER_BIT 0x00000004
72 48
73static int debug = 1; 49static int debug;
74 50
75/* Version Information */ 51/* Version Information */
76#define DRIVER_VERSION "v0.1" 52#define DRIVER_VERSION "v0.1"
@@ -99,10 +75,12 @@ static struct usb_driver ssu100_driver = {
99}; 75};
100 76
101struct ssu100_port_private { 77struct ssu100_port_private {
78 spinlock_t status_lock;
102 u8 shadowLSR; 79 u8 shadowLSR;
103 u8 shadowMSR; 80 u8 shadowMSR;
104 wait_queue_head_t delta_msr_wait; /* Used for TIOCMIWAIT */ 81 wait_queue_head_t delta_msr_wait; /* Used for TIOCMIWAIT */
105 unsigned short max_packet_size; 82 unsigned short max_packet_size;
83 struct async_icount icount;
106}; 84};
107 85
108static void ssu100_release(struct usb_serial *serial) 86static void ssu100_release(struct usb_serial *serial)
@@ -150,9 +128,10 @@ static inline int ssu100_getregister(struct usb_device *dev,
150 128
151static inline int ssu100_setregister(struct usb_device *dev, 129static inline int ssu100_setregister(struct usb_device *dev,
152 unsigned short uart, 130 unsigned short uart,
131 unsigned short reg,
153 u16 data) 132 u16 data)
154{ 133{
155 u16 value = (data << 8) | MODEM_CTL_REGISTER; 134 u16 value = (data << 8) | reg;
156 135
157 return usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 136 return usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
158 QT_SET_GET_REGISTER, 0x40, value, uart, 137 QT_SET_GET_REGISTER, 0x40, value, uart,
@@ -178,11 +157,11 @@ static inline int update_mctrl(struct usb_device *dev, unsigned int set,
178 clear &= ~set; /* 'set' takes precedence over 'clear' */ 157 clear &= ~set; /* 'set' takes precedence over 'clear' */
179 urb_value = 0; 158 urb_value = 0;
180 if (set & TIOCM_DTR) 159 if (set & TIOCM_DTR)
181 urb_value |= SERIAL_MCR_DTR; 160 urb_value |= UART_MCR_DTR;
182 if (set & TIOCM_RTS) 161 if (set & TIOCM_RTS)
183 urb_value |= SERIAL_MCR_RTS; 162 urb_value |= UART_MCR_RTS;
184 163
185 result = ssu100_setregister(dev, 0, urb_value); 164 result = ssu100_setregister(dev, 0, UART_MCR, urb_value);
186 if (result < 0) 165 if (result < 0)
187 dbg("%s Error from MODEM_CTRL urb", __func__); 166 dbg("%s Error from MODEM_CTRL urb", __func__);
188 167
@@ -264,24 +243,24 @@ static void ssu100_set_termios(struct tty_struct *tty,
264 243
265 if (cflag & PARENB) { 244 if (cflag & PARENB) {
266 if (cflag & PARODD) 245 if (cflag & PARODD)
267 urb_value |= SERIAL_ODD_PARITY; 246 urb_value |= UART_LCR_PARITY;
268 else 247 else
269 urb_value |= SERIAL_EVEN_PARITY; 248 urb_value |= SERIAL_EVEN_PARITY;
270 } 249 }
271 250
272 switch (cflag & CSIZE) { 251 switch (cflag & CSIZE) {
273 case CS5: 252 case CS5:
274 urb_value |= SERIAL_5_DATA; 253 urb_value |= UART_LCR_WLEN5;
275 break; 254 break;
276 case CS6: 255 case CS6:
277 urb_value |= SERIAL_6_DATA; 256 urb_value |= UART_LCR_WLEN6;
278 break; 257 break;
279 case CS7: 258 case CS7:
280 urb_value |= SERIAL_7_DATA; 259 urb_value |= UART_LCR_WLEN7;
281 break; 260 break;
282 default: 261 default:
283 case CS8: 262 case CS8:
284 urb_value |= SERIAL_8_DATA; 263 urb_value |= UART_LCR_WLEN8;
285 break; 264 break;
286 } 265 }
287 266
@@ -333,6 +312,7 @@ static int ssu100_open(struct tty_struct *tty, struct usb_serial_port *port)
333 struct ssu100_port_private *priv = usb_get_serial_port_data(port); 312 struct ssu100_port_private *priv = usb_get_serial_port_data(port);
334 u8 *data; 313 u8 *data;
335 int result; 314 int result;
315 unsigned long flags;
336 316
337 dbg("%s - port %d", __func__, port->number); 317 dbg("%s - port %d", __func__, port->number);
338 318
@@ -350,11 +330,10 @@ static int ssu100_open(struct tty_struct *tty, struct usb_serial_port *port)
350 return result; 330 return result;
351 } 331 }
352 332
353 priv->shadowLSR = data[0] & (SERIAL_LSR_OE | SERIAL_LSR_PE | 333 spin_lock_irqsave(&priv->status_lock, flags);
354 SERIAL_LSR_FE | SERIAL_LSR_BI); 334 priv->shadowLSR = data[0];
355 335 priv->shadowMSR = data[1];
356 priv->shadowMSR = data[1] & (SERIAL_MSR_CTS | SERIAL_MSR_DSR | 336 spin_unlock_irqrestore(&priv->status_lock, flags);
357 SERIAL_MSR_RI | SERIAL_MSR_CD);
358 337
359 kfree(data); 338 kfree(data);
360 339
@@ -398,11 +377,51 @@ static int get_serial_info(struct usb_serial_port *port,
398 return 0; 377 return 0;
399} 378}
400 379
380static int wait_modem_info(struct usb_serial_port *port, unsigned int arg)
381{
382 struct ssu100_port_private *priv = usb_get_serial_port_data(port);
383 struct async_icount prev, cur;
384 unsigned long flags;
385
386 spin_lock_irqsave(&priv->status_lock, flags);
387 prev = priv->icount;
388 spin_unlock_irqrestore(&priv->status_lock, flags);
389
390 while (1) {
391 wait_event_interruptible(priv->delta_msr_wait,
392 ((priv->icount.rng != prev.rng) ||
393 (priv->icount.dsr != prev.dsr) ||
394 (priv->icount.dcd != prev.dcd) ||
395 (priv->icount.cts != prev.cts)));
396
397 if (signal_pending(current))
398 return -ERESTARTSYS;
399
400 spin_lock_irqsave(&priv->status_lock, flags);
401 cur = priv->icount;
402 spin_unlock_irqrestore(&priv->status_lock, flags);
403
404 if ((prev.rng == cur.rng) &&
405 (prev.dsr == cur.dsr) &&
406 (prev.dcd == cur.dcd) &&
407 (prev.cts == cur.cts))
408 return -EIO;
409
410 if ((arg & TIOCM_RNG && (prev.rng != cur.rng)) ||
411 (arg & TIOCM_DSR && (prev.dsr != cur.dsr)) ||
412 (arg & TIOCM_CD && (prev.dcd != cur.dcd)) ||
413 (arg & TIOCM_CTS && (prev.cts != cur.cts)))
414 return 0;
415 }
416 return 0;
417}
418
401static int ssu100_ioctl(struct tty_struct *tty, struct file *file, 419static int ssu100_ioctl(struct tty_struct *tty, struct file *file,
402 unsigned int cmd, unsigned long arg) 420 unsigned int cmd, unsigned long arg)
403{ 421{
404 struct usb_serial_port *port = tty->driver_data; 422 struct usb_serial_port *port = tty->driver_data;
405 struct ssu100_port_private *priv = usb_get_serial_port_data(port); 423 struct ssu100_port_private *priv = usb_get_serial_port_data(port);
424 void __user *user_arg = (void __user *)arg;
406 425
407 dbg("%s cmd 0x%04x", __func__, cmd); 426 dbg("%s cmd 0x%04x", __func__, cmd);
408 427
@@ -412,28 +431,28 @@ static int ssu100_ioctl(struct tty_struct *tty, struct file *file,
412 (struct serial_struct __user *) arg); 431 (struct serial_struct __user *) arg);
413 432
414 case TIOCMIWAIT: 433 case TIOCMIWAIT:
415 while (priv != NULL) { 434 return wait_modem_info(port, arg);
416 u8 prevMSR = priv->shadowMSR & SERIAL_MSR_MASK; 435
417 interruptible_sleep_on(&priv->delta_msr_wait); 436 case TIOCGICOUNT:
418 /* see if a signal did it */ 437 {
419 if (signal_pending(current)) 438 struct serial_icounter_struct icount;
420 return -ERESTARTSYS; 439 struct async_icount cnow = priv->icount;
421 else { 440 memset(&icount, 0, sizeof(icount));
422 u8 diff = (priv->shadowMSR & SERIAL_MSR_MASK) ^ prevMSR; 441 icount.cts = cnow.cts;
423 if (!diff) 442 icount.dsr = cnow.dsr;
424 return -EIO; /* no change => error */ 443 icount.rng = cnow.rng;
425 444 icount.dcd = cnow.dcd;
426 /* Return 0 if caller wanted to know about 445 icount.rx = cnow.rx;
427 these bits */ 446 icount.tx = cnow.tx;
428 447 icount.frame = cnow.frame;
429 if (((arg & TIOCM_RNG) && (diff & SERIAL_MSR_RI)) || 448 icount.overrun = cnow.overrun;
430 ((arg & TIOCM_DSR) && (diff & SERIAL_MSR_DSR)) || 449 icount.parity = cnow.parity;
431 ((arg & TIOCM_CD) && (diff & SERIAL_MSR_CD)) || 450 icount.brk = cnow.brk;
432 ((arg & TIOCM_CTS) && (diff & SERIAL_MSR_CTS))) 451 icount.buf_overrun = cnow.buf_overrun;
433 return 0; 452 if (copy_to_user(user_arg, &icount, sizeof(icount)))
434 } 453 return -EFAULT;
435 }
436 return 0; 454 return 0;
455 }
437 456
438 default: 457 default:
439 break; 458 break;
@@ -455,6 +474,7 @@ static void ssu100_set_max_packet_size(struct usb_serial_port *port)
455 474
456 unsigned num_endpoints; 475 unsigned num_endpoints;
457 int i; 476 int i;
477 unsigned long flags;
458 478
459 num_endpoints = interface->cur_altsetting->desc.bNumEndpoints; 479 num_endpoints = interface->cur_altsetting->desc.bNumEndpoints;
460 dev_info(&udev->dev, "Number of endpoints %d\n", num_endpoints); 480 dev_info(&udev->dev, "Number of endpoints %d\n", num_endpoints);
@@ -466,7 +486,9 @@ static void ssu100_set_max_packet_size(struct usb_serial_port *port)
466 } 486 }
467 487
468 /* set max packet size based on descriptor */ 488 /* set max packet size based on descriptor */
489 spin_lock_irqsave(&priv->status_lock, flags);
469 priv->max_packet_size = ep_desc->wMaxPacketSize; 490 priv->max_packet_size = ep_desc->wMaxPacketSize;
491 spin_unlock_irqrestore(&priv->status_lock, flags);
470 492
471 dev_info(&udev->dev, "Setting MaxPacketSize %d\n", priv->max_packet_size); 493 dev_info(&udev->dev, "Setting MaxPacketSize %d\n", priv->max_packet_size);
472} 494}
@@ -485,9 +507,9 @@ static int ssu100_attach(struct usb_serial *serial)
485 return -ENOMEM; 507 return -ENOMEM;
486 } 508 }
487 509
510 spin_lock_init(&priv->status_lock);
488 init_waitqueue_head(&priv->delta_msr_wait); 511 init_waitqueue_head(&priv->delta_msr_wait);
489 usb_set_serial_port_data(port, priv); 512 usb_set_serial_port_data(port, priv);
490
491 ssu100_set_max_packet_size(port); 513 ssu100_set_max_packet_size(port);
492 514
493 return ssu100_initdevice(serial->dev); 515 return ssu100_initdevice(serial->dev);
@@ -506,20 +528,20 @@ static int ssu100_tiocmget(struct tty_struct *tty, struct file *file)
506 if (!d) 528 if (!d)
507 return -ENOMEM; 529 return -ENOMEM;
508 530
509 r = ssu100_getregister(dev, 0, MODEM_CTL_REGISTER, d); 531 r = ssu100_getregister(dev, 0, UART_MCR, d);
510 if (r < 0) 532 if (r < 0)
511 goto mget_out; 533 goto mget_out;
512 534
513 r = ssu100_getregister(dev, 0, MODEM_STATUS_REGISTER, d+1); 535 r = ssu100_getregister(dev, 0, UART_MSR, d+1);
514 if (r < 0) 536 if (r < 0)
515 goto mget_out; 537 goto mget_out;
516 538
517 r = (d[0] & SERIAL_MCR_DTR ? TIOCM_DTR : 0) | 539 r = (d[0] & UART_MCR_DTR ? TIOCM_DTR : 0) |
518 (d[0] & SERIAL_MCR_RTS ? TIOCM_RTS : 0) | 540 (d[0] & UART_MCR_RTS ? TIOCM_RTS : 0) |
519 (d[1] & SERIAL_MSR_CTS ? TIOCM_CTS : 0) | 541 (d[1] & UART_MSR_CTS ? TIOCM_CTS : 0) |
520 (d[1] & SERIAL_MSR_CD ? TIOCM_CAR : 0) | 542 (d[1] & UART_MSR_DCD ? TIOCM_CAR : 0) |
521 (d[1] & SERIAL_MSR_RI ? TIOCM_RI : 0) | 543 (d[1] & UART_MSR_RI ? TIOCM_RI : 0) |
522 (d[1] & SERIAL_MSR_DSR ? TIOCM_DSR : 0); 544 (d[1] & UART_MSR_DSR ? TIOCM_DSR : 0);
523 545
524mget_out: 546mget_out:
525 kfree(d); 547 kfree(d);
@@ -546,7 +568,7 @@ static void ssu100_dtr_rts(struct usb_serial_port *port, int on)
546 if (!port->serial->disconnected) { 568 if (!port->serial->disconnected) {
547 /* Disable flow control */ 569 /* Disable flow control */
548 if (!on && 570 if (!on &&
549 ssu100_setregister(dev, 0, 0) < 0) 571 ssu100_setregister(dev, 0, UART_MCR, 0) < 0)
550 dev_err(&port->dev, "error from flowcontrol urb\n"); 572 dev_err(&port->dev, "error from flowcontrol urb\n");
551 /* drop RTS and DTR */ 573 /* drop RTS and DTR */
552 if (on) 574 if (on)
@@ -557,34 +579,88 @@ static void ssu100_dtr_rts(struct usb_serial_port *port, int on)
557 mutex_unlock(&port->serial->disc_mutex); 579 mutex_unlock(&port->serial->disc_mutex);
558} 580}
559 581
582static void ssu100_update_msr(struct usb_serial_port *port, u8 msr)
583{
584 struct ssu100_port_private *priv = usb_get_serial_port_data(port);
585 unsigned long flags;
586
587 spin_lock_irqsave(&priv->status_lock, flags);
588 priv->shadowMSR = msr;
589 spin_unlock_irqrestore(&priv->status_lock, flags);
590
591 if (msr & UART_MSR_ANY_DELTA) {
592 /* update input line counters */
593 if (msr & UART_MSR_DCTS)
594 priv->icount.cts++;
595 if (msr & UART_MSR_DDSR)
596 priv->icount.dsr++;
597 if (msr & UART_MSR_DDCD)
598 priv->icount.dcd++;
599 if (msr & UART_MSR_TERI)
600 priv->icount.rng++;
601 wake_up_interruptible(&priv->delta_msr_wait);
602 }
603}
604
605static void ssu100_update_lsr(struct usb_serial_port *port, u8 lsr,
606 char *tty_flag)
607{
608 struct ssu100_port_private *priv = usb_get_serial_port_data(port);
609 unsigned long flags;
610
611 spin_lock_irqsave(&priv->status_lock, flags);
612 priv->shadowLSR = lsr;
613 spin_unlock_irqrestore(&priv->status_lock, flags);
614
615 *tty_flag = TTY_NORMAL;
616 if (lsr & UART_LSR_BRK_ERROR_BITS) {
617 /* we always want to update icount, but we only want to
618 * update tty_flag for one case */
619 if (lsr & UART_LSR_BI) {
620 priv->icount.brk++;
621 *tty_flag = TTY_BREAK;
622 usb_serial_handle_break(port);
623 }
624 if (lsr & UART_LSR_PE) {
625 priv->icount.parity++;
626 if (*tty_flag == TTY_NORMAL)
627 *tty_flag = TTY_PARITY;
628 }
629 if (lsr & UART_LSR_FE) {
630 priv->icount.frame++;
631 if (*tty_flag == TTY_NORMAL)
632 *tty_flag = TTY_FRAME;
633 }
634 if (lsr & UART_LSR_OE){
635 priv->icount.overrun++;
636 if (*tty_flag == TTY_NORMAL)
637 *tty_flag = TTY_OVERRUN;
638 }
639 }
640
641}
642
560static int ssu100_process_packet(struct tty_struct *tty, 643static int ssu100_process_packet(struct tty_struct *tty,
561 struct usb_serial_port *port, 644 struct usb_serial_port *port,
562 struct ssu100_port_private *priv, 645 struct ssu100_port_private *priv,
563 char *packet, int len) 646 char *packet, int len)
564{ 647{
565 int i; 648 int i;
566 char flag; 649 char flag = TTY_NORMAL;
567 char *ch; 650 char *ch;
568 651
569 dbg("%s - port %d", __func__, port->number); 652 dbg("%s - port %d", __func__, port->number);
570 653
571 if (len < 4) { 654 if ((len >= 4) &&
572 dbg("%s - malformed packet", __func__); 655 (packet[0] == 0x1b) && (packet[1] == 0x1b) &&
573 return 0;
574 }
575
576 if ((packet[0] == 0x1b) && (packet[1] == 0x1b) &&
577 ((packet[2] == 0x00) || (packet[2] == 0x01))) { 656 ((packet[2] == 0x00) || (packet[2] == 0x01))) {
578 if (packet[2] == 0x00) 657 if (packet[2] == 0x00) {
579 priv->shadowLSR = packet[3] & (SERIAL_LSR_OE | 658 ssu100_update_lsr(port, packet[3], &flag);
580 SERIAL_LSR_PE | 659 if (flag == TTY_OVERRUN)
581 SERIAL_LSR_FE | 660 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
582 SERIAL_LSR_BI);
583
584 if (packet[2] == 0x01) {
585 priv->shadowMSR = packet[3];
586 wake_up_interruptible(&priv->delta_msr_wait);
587 } 661 }
662 if (packet[2] == 0x01)
663 ssu100_update_msr(port, packet[3]);
588 664
589 len -= 4; 665 len -= 4;
590 ch = packet + 4; 666 ch = packet + 4;
@@ -596,7 +672,7 @@ static int ssu100_process_packet(struct tty_struct *tty,
596 672
597 if (port->port.console && port->sysrq) { 673 if (port->port.console && port->sysrq) {
598 for (i = 0; i < len; i++, ch++) { 674 for (i = 0; i < len; i++, ch++) {
599 if (!usb_serial_handle_sysrq_char(tty, port, *ch)) 675 if (!usb_serial_handle_sysrq_char(port, *ch))
600 tty_insert_flip_char(tty, *ch, flag); 676 tty_insert_flip_char(tty, *ch, flag);
601 } 677 }
602 } else 678 } else
@@ -631,7 +707,6 @@ static void ssu100_process_read_urb(struct urb *urb)
631 tty_kref_put(tty); 707 tty_kref_put(tty);
632} 708}
633 709
634
635static struct usb_serial_driver ssu100_device = { 710static struct usb_serial_driver ssu100_device = {
636 .driver = { 711 .driver = {
637 .owner = THIS_MODULE, 712 .owner = THIS_MODULE,
@@ -653,6 +728,7 @@ static struct usb_serial_driver ssu100_device = {
653 .tiocmset = ssu100_tiocmset, 728 .tiocmset = ssu100_tiocmset,
654 .ioctl = ssu100_ioctl, 729 .ioctl = ssu100_ioctl,
655 .set_termios = ssu100_set_termios, 730 .set_termios = ssu100_set_termios,
731 .disconnect = usb_serial_generic_disconnect,
656}; 732};
657 733
658static int __init ssu100_init(void) 734static int __init ssu100_init(void)
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 2a982e62963..7a2177c79bd 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -736,6 +736,7 @@ int usb_serial_probe(struct usb_interface *interface,
736 736
737 serial = create_serial(dev, interface, type); 737 serial = create_serial(dev, interface, type);
738 if (!serial) { 738 if (!serial) {
739 module_put(type->driver.owner);
739 dev_err(&interface->dev, "%s - out of memory\n", __func__); 740 dev_err(&interface->dev, "%s - out of memory\n", __func__);
740 return -ENOMEM; 741 return -ENOMEM;
741 } 742 }
@@ -746,11 +747,11 @@ int usb_serial_probe(struct usb_interface *interface,
746 747
747 id = get_iface_id(type, interface); 748 id = get_iface_id(type, interface);
748 retval = type->probe(serial, id); 749 retval = type->probe(serial, id);
749 module_put(type->driver.owner);
750 750
751 if (retval) { 751 if (retval) {
752 dbg("sub driver rejected device"); 752 dbg("sub driver rejected device");
753 kfree(serial); 753 kfree(serial);
754 module_put(type->driver.owner);
754 return retval; 755 return retval;
755 } 756 }
756 } 757 }
@@ -822,6 +823,7 @@ int usb_serial_probe(struct usb_interface *interface,
822 if (num_bulk_in == 0 || num_bulk_out == 0) { 823 if (num_bulk_in == 0 || num_bulk_out == 0) {
823 dev_info(&interface->dev, "PL-2303 hack: descriptors matched but endpoints did not\n"); 824 dev_info(&interface->dev, "PL-2303 hack: descriptors matched but endpoints did not\n");
824 kfree(serial); 825 kfree(serial);
826 module_put(type->driver.owner);
825 return -ENODEV; 827 return -ENODEV;
826 } 828 }
827 } 829 }
@@ -835,22 +837,15 @@ int usb_serial_probe(struct usb_interface *interface,
835 dev_err(&interface->dev, 837 dev_err(&interface->dev,
836 "Generic device with no bulk out, not allowed.\n"); 838 "Generic device with no bulk out, not allowed.\n");
837 kfree(serial); 839 kfree(serial);
840 module_put(type->driver.owner);
838 return -EIO; 841 return -EIO;
839 } 842 }
840 } 843 }
841#endif 844#endif
842 if (!num_ports) { 845 if (!num_ports) {
843 /* if this device type has a calc_num_ports function, call it */ 846 /* if this device type has a calc_num_ports function, call it */
844 if (type->calc_num_ports) { 847 if (type->calc_num_ports)
845 if (!try_module_get(type->driver.owner)) {
846 dev_err(&interface->dev,
847 "module get failed, exiting\n");
848 kfree(serial);
849 return -EIO;
850 }
851 num_ports = type->calc_num_ports(serial); 848 num_ports = type->calc_num_ports(serial);
852 module_put(type->driver.owner);
853 }
854 if (!num_ports) 849 if (!num_ports)
855 num_ports = type->num_ports; 850 num_ports = type->num_ports;
856 } 851 }
@@ -1039,13 +1034,7 @@ int usb_serial_probe(struct usb_interface *interface,
1039 1034
1040 /* if this device type has an attach function, call it */ 1035 /* if this device type has an attach function, call it */
1041 if (type->attach) { 1036 if (type->attach) {
1042 if (!try_module_get(type->driver.owner)) {
1043 dev_err(&interface->dev,
1044 "module get failed, exiting\n");
1045 goto probe_error;
1046 }
1047 retval = type->attach(serial); 1037 retval = type->attach(serial);
1048 module_put(type->driver.owner);
1049 if (retval < 0) 1038 if (retval < 0)
1050 goto probe_error; 1039 goto probe_error;
1051 serial->attached = 1; 1040 serial->attached = 1;
@@ -1088,10 +1077,12 @@ int usb_serial_probe(struct usb_interface *interface,
1088exit: 1077exit:
1089 /* success */ 1078 /* success */
1090 usb_set_intfdata(interface, serial); 1079 usb_set_intfdata(interface, serial);
1080 module_put(type->driver.owner);
1091 return 0; 1081 return 0;
1092 1082
1093probe_error: 1083probe_error:
1094 usb_serial_put(serial); 1084 usb_serial_put(serial);
1085 module_put(type->driver.owner);
1095 return -EIO; 1086 return -EIO;
1096} 1087}
1097EXPORT_SYMBOL_GPL(usb_serial_probe); 1088EXPORT_SYMBOL_GPL(usb_serial_probe);