diff options
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/cyberjack.c | 7 | ||||
-rw-r--r-- | drivers/usb/serial/cypress_m8.c | 4 | ||||
-rw-r--r-- | drivers/usb/serial/empeg.c | 6 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 1 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio.h | 7 | ||||
-rw-r--r-- | drivers/usb/serial/garmin_gps.c | 8 | ||||
-rw-r--r-- | drivers/usb/serial/generic.c | 6 | ||||
-rw-r--r-- | drivers/usb/serial/io_edgeport.c | 8 | ||||
-rw-r--r-- | drivers/usb/serial/io_ti.c | 8 | ||||
-rw-r--r-- | drivers/usb/serial/ipaq.c | 6 | ||||
-rw-r--r-- | drivers/usb/serial/ipw.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/iuu_phoenix.c | 1 | ||||
-rw-r--r-- | drivers/usb/serial/kobil_sct.c | 6 | ||||
-rw-r--r-- | drivers/usb/serial/mos7720.c | 7 | ||||
-rw-r--r-- | drivers/usb/serial/mos7840.c | 43 | ||||
-rw-r--r-- | drivers/usb/serial/moto_modem.c | 1 | ||||
-rw-r--r-- | drivers/usb/serial/opticon.c | 8 | ||||
-rw-r--r-- | drivers/usb/serial/option.c | 8 | ||||
-rw-r--r-- | drivers/usb/serial/qcserial.c | 21 | ||||
-rw-r--r-- | drivers/usb/serial/sierra.c | 24 | ||||
-rw-r--r-- | drivers/usb/serial/ti_usb_3410_5052.c | 40 | ||||
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 104 | ||||
-rw-r--r-- | drivers/usb/serial/visor.c | 8 |
23 files changed, 161 insertions, 174 deletions
diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c index 858bdd038fbc..dd501bb63ed6 100644 --- a/drivers/usb/serial/cyberjack.c +++ b/drivers/usb/serial/cyberjack.c | |||
@@ -175,13 +175,6 @@ static int cyberjack_open(struct tty_struct *tty, | |||
175 | dbg("%s - usb_clear_halt", __func__); | 175 | dbg("%s - usb_clear_halt", __func__); |
176 | usb_clear_halt(port->serial->dev, port->write_urb->pipe); | 176 | usb_clear_halt(port->serial->dev, port->write_urb->pipe); |
177 | 177 | ||
178 | /* force low_latency on so that our tty_push actually forces | ||
179 | * the data through, otherwise it is scheduled, and with high | ||
180 | * data rates (like with OHCI) data can get lost. | ||
181 | */ | ||
182 | if (tty) | ||
183 | tty->low_latency = 1; | ||
184 | |||
185 | priv = usb_get_serial_port_data(port); | 178 | priv = usb_get_serial_port_data(port); |
186 | spin_lock_irqsave(&priv->lock, flags); | 179 | spin_lock_irqsave(&priv->lock, flags); |
187 | priv->rdtodo = 0; | 180 | priv->rdtodo = 0; |
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index eae4740d448c..e568710b263f 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c | |||
@@ -656,10 +656,6 @@ static int cypress_open(struct tty_struct *tty, | |||
656 | priv->rx_flags = 0; | 656 | priv->rx_flags = 0; |
657 | spin_unlock_irqrestore(&priv->lock, flags); | 657 | spin_unlock_irqrestore(&priv->lock, flags); |
658 | 658 | ||
659 | /* setting to zero could cause data loss */ | ||
660 | if (tty) | ||
661 | tty->low_latency = 1; | ||
662 | |||
663 | /* raise both lines and set termios */ | 659 | /* raise both lines and set termios */ |
664 | spin_lock_irqsave(&priv->lock, flags); | 660 | spin_lock_irqsave(&priv->lock, flags); |
665 | priv->line_control = CONTROL_DTR | CONTROL_RTS; | 661 | priv->line_control = CONTROL_DTR | CONTROL_RTS; |
diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c index 8a69cce40b6d..c709ec474a80 100644 --- a/drivers/usb/serial/empeg.c +++ b/drivers/usb/serial/empeg.c | |||
@@ -478,12 +478,6 @@ static void empeg_set_termios(struct tty_struct *tty, | |||
478 | termios->c_cflag | 478 | termios->c_cflag |
479 | |= CS8; /* character size 8 bits */ | 479 | |= CS8; /* character size 8 bits */ |
480 | 480 | ||
481 | /* | ||
482 | * Force low_latency on; otherwise the pushes are scheduled; | ||
483 | * this is bad as it opens up the possibility of dropping bytes | ||
484 | * on the floor. We don't want to drop bytes on the floor. :) | ||
485 | */ | ||
486 | tty->low_latency = 1; | ||
487 | tty_encode_baud_rate(tty, 115200, 115200); | 481 | tty_encode_baud_rate(tty, 115200, 115200); |
488 | } | 482 | } |
489 | 483 | ||
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index dcc87aaa8628..8100f1d25904 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -668,6 +668,7 @@ static struct usb_device_id id_table_combined [] = { | |||
668 | { USB_DEVICE(DE_VID, WHT_PID) }, | 668 | { USB_DEVICE(DE_VID, WHT_PID) }, |
669 | { USB_DEVICE(ADI_VID, ADI_GNICE_PID), | 669 | { USB_DEVICE(ADI_VID, ADI_GNICE_PID), |
670 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | 670 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, |
671 | { USB_DEVICE(JETI_VID, JETI_SPC1201_PID) }, | ||
671 | { }, /* Optional parameter entry */ | 672 | { }, /* Optional parameter entry */ |
672 | { } /* Terminating entry */ | 673 | { } /* Terminating entry */ |
673 | }; | 674 | }; |
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index daaf63db0b50..c09f658a448b 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h | |||
@@ -913,6 +913,13 @@ | |||
913 | #define ADI_GNICE_PID 0xF000 | 913 | #define ADI_GNICE_PID 0xF000 |
914 | 914 | ||
915 | /* | 915 | /* |
916 | * JETI SPECTROMETER SPECBOS 1201 | ||
917 | * http://www.jeti.com/products/sys/scb/scb1201.php | ||
918 | */ | ||
919 | #define JETI_VID 0x0c6c | ||
920 | #define JETI_SPC1201_PID 0x04b2 | ||
921 | |||
922 | /* | ||
916 | * BmRequestType: 1100 0000b | 923 | * BmRequestType: 1100 0000b |
917 | * bRequest: FTDI_E2_READ | 924 | * bRequest: FTDI_E2_READ |
918 | * wValue: 0 | 925 | * wValue: 0 |
diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c index a26a0e2cdb4a..586d30ff450b 100644 --- a/drivers/usb/serial/garmin_gps.c +++ b/drivers/usb/serial/garmin_gps.c | |||
@@ -973,14 +973,6 @@ static int garmin_open(struct tty_struct *tty, | |||
973 | 973 | ||
974 | dbg("%s - port %d", __func__, port->number); | 974 | dbg("%s - port %d", __func__, port->number); |
975 | 975 | ||
976 | /* | ||
977 | * Force low_latency on so that our tty_push actually forces the data | ||
978 | * through, otherwise it is scheduled, and with high data rates (like | ||
979 | * with OHCI) data can get lost. | ||
980 | */ | ||
981 | if (tty) | ||
982 | tty->low_latency = 1; | ||
983 | |||
984 | spin_lock_irqsave(&garmin_data_p->lock, flags); | 976 | spin_lock_irqsave(&garmin_data_p->lock, flags); |
985 | garmin_data_p->mode = initial_mode; | 977 | garmin_data_p->mode = initial_mode; |
986 | garmin_data_p->count = 0; | 978 | garmin_data_p->count = 0; |
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 9d57cace3731..4cec9906ccf3 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c | |||
@@ -122,12 +122,6 @@ int usb_serial_generic_open(struct tty_struct *tty, | |||
122 | 122 | ||
123 | dbg("%s - port %d", __func__, port->number); | 123 | dbg("%s - port %d", __func__, port->number); |
124 | 124 | ||
125 | /* force low_latency on so that our tty_push actually forces the data | ||
126 | through, otherwise it is scheduled, and with high data rates (like | ||
127 | with OHCI) data can get lost. */ | ||
128 | if (tty) | ||
129 | tty->low_latency = 1; | ||
130 | |||
131 | /* clear the throttle flags */ | 125 | /* clear the throttle flags */ |
132 | spin_lock_irqsave(&port->lock, flags); | 126 | spin_lock_irqsave(&port->lock, flags); |
133 | port->throttled = 0; | 127 | port->throttled = 0; |
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index e85c8c0d1ad9..fb4a73d090f6 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c | |||
@@ -193,8 +193,6 @@ static const struct divisor_table_entry divisor_table[] = { | |||
193 | /* local variables */ | 193 | /* local variables */ |
194 | static int debug; | 194 | static int debug; |
195 | 195 | ||
196 | static int low_latency = 1; /* tty low latency flag, on by default */ | ||
197 | |||
198 | static atomic_t CmdUrbs; /* Number of outstanding Command Write Urbs */ | 196 | static atomic_t CmdUrbs; /* Number of outstanding Command Write Urbs */ |
199 | 197 | ||
200 | 198 | ||
@@ -867,9 +865,6 @@ static int edge_open(struct tty_struct *tty, | |||
867 | if (edge_port == NULL) | 865 | if (edge_port == NULL) |
868 | return -ENODEV; | 866 | return -ENODEV; |
869 | 867 | ||
870 | if (tty) | ||
871 | tty->low_latency = low_latency; | ||
872 | |||
873 | /* see if we've set up our endpoint info yet (can't set it up | 868 | /* see if we've set up our endpoint info yet (can't set it up |
874 | in edge_startup as the structures were not set up at that time.) */ | 869 | in edge_startup as the structures were not set up at that time.) */ |
875 | serial = port->serial; | 870 | serial = port->serial; |
@@ -3299,6 +3294,3 @@ MODULE_FIRMWARE("edgeport/down2.fw"); | |||
3299 | 3294 | ||
3300 | module_param(debug, bool, S_IRUGO | S_IWUSR); | 3295 | module_param(debug, bool, S_IRUGO | S_IWUSR); |
3301 | MODULE_PARM_DESC(debug, "Debug enabled or not"); | 3296 | MODULE_PARM_DESC(debug, "Debug enabled or not"); |
3302 | |||
3303 | module_param(low_latency, bool, S_IRUGO | S_IWUSR); | ||
3304 | MODULE_PARM_DESC(low_latency, "Low latency enabled or not"); | ||
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index c3cdd00ddc41..513b25e044c1 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c | |||
@@ -76,7 +76,6 @@ struct edgeport_uart_buf_desc { | |||
76 | #define EDGE_READ_URB_STOPPING 1 | 76 | #define EDGE_READ_URB_STOPPING 1 |
77 | #define EDGE_READ_URB_STOPPED 2 | 77 | #define EDGE_READ_URB_STOPPED 2 |
78 | 78 | ||
79 | #define EDGE_LOW_LATENCY 1 | ||
80 | #define EDGE_CLOSING_WAIT 4000 /* in .01 sec */ | 79 | #define EDGE_CLOSING_WAIT 4000 /* in .01 sec */ |
81 | 80 | ||
82 | #define EDGE_OUT_BUF_SIZE 1024 | 81 | #define EDGE_OUT_BUF_SIZE 1024 |
@@ -232,7 +231,6 @@ static unsigned short OperationalBuildNumber; | |||
232 | 231 | ||
233 | static int debug; | 232 | static int debug; |
234 | 233 | ||
235 | static int low_latency = EDGE_LOW_LATENCY; | ||
236 | static int closing_wait = EDGE_CLOSING_WAIT; | 234 | static int closing_wait = EDGE_CLOSING_WAIT; |
237 | static int ignore_cpu_rev; | 235 | static int ignore_cpu_rev; |
238 | static int default_uart_mode; /* RS232 */ | 236 | static int default_uart_mode; /* RS232 */ |
@@ -1850,9 +1848,6 @@ static int edge_open(struct tty_struct *tty, | |||
1850 | if (edge_port == NULL) | 1848 | if (edge_port == NULL) |
1851 | return -ENODEV; | 1849 | return -ENODEV; |
1852 | 1850 | ||
1853 | if (tty) | ||
1854 | tty->low_latency = low_latency; | ||
1855 | |||
1856 | port_number = port->number - port->serial->minor; | 1851 | port_number = port->number - port->serial->minor; |
1857 | switch (port_number) { | 1852 | switch (port_number) { |
1858 | case 0: | 1853 | case 0: |
@@ -3008,9 +3003,6 @@ MODULE_FIRMWARE("edgeport/down3.bin"); | |||
3008 | module_param(debug, bool, S_IRUGO | S_IWUSR); | 3003 | module_param(debug, bool, S_IRUGO | S_IWUSR); |
3009 | MODULE_PARM_DESC(debug, "Debug enabled or not"); | 3004 | MODULE_PARM_DESC(debug, "Debug enabled or not"); |
3010 | 3005 | ||
3011 | module_param(low_latency, bool, S_IRUGO | S_IWUSR); | ||
3012 | MODULE_PARM_DESC(low_latency, "Low latency enabled or not"); | ||
3013 | |||
3014 | module_param(closing_wait, int, S_IRUGO | S_IWUSR); | 3006 | module_param(closing_wait, int, S_IRUGO | S_IWUSR); |
3015 | MODULE_PARM_DESC(closing_wait, "Maximum wait for data to drain, in .01 secs"); | 3007 | MODULE_PARM_DESC(closing_wait, "Maximum wait for data to drain, in .01 secs"); |
3016 | 3008 | ||
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index ef92095b0732..cd62825a9ac3 100644 --- a/drivers/usb/serial/ipaq.c +++ b/drivers/usb/serial/ipaq.c | |||
@@ -631,13 +631,7 @@ static int ipaq_open(struct tty_struct *tty, | |||
631 | priv->free_len += PACKET_SIZE; | 631 | priv->free_len += PACKET_SIZE; |
632 | } | 632 | } |
633 | 633 | ||
634 | /* | ||
635 | * Force low latency on. This will immediately push data to the line | ||
636 | * discipline instead of queueing. | ||
637 | */ | ||
638 | |||
639 | if (tty) { | 634 | if (tty) { |
640 | tty->low_latency = 1; | ||
641 | /* FIXME: These two are bogus */ | 635 | /* FIXME: These two are bogus */ |
642 | tty->raw = 1; | 636 | tty->raw = 1; |
643 | tty->real_raw = 1; | 637 | tty->real_raw = 1; |
diff --git a/drivers/usb/serial/ipw.c b/drivers/usb/serial/ipw.c index f530032ed93d..da2a2b46644a 100644 --- a/drivers/usb/serial/ipw.c +++ b/drivers/usb/serial/ipw.c | |||
@@ -207,9 +207,6 @@ static int ipw_open(struct tty_struct *tty, | |||
207 | if (!buf_flow_init) | 207 | if (!buf_flow_init) |
208 | return -ENOMEM; | 208 | return -ENOMEM; |
209 | 209 | ||
210 | if (tty) | ||
211 | tty->low_latency = 1; | ||
212 | |||
213 | /* --1: Tell the modem to initialize (we think) From sniffs this is | 210 | /* --1: Tell the modem to initialize (we think) From sniffs this is |
214 | * always the first thing that gets sent to the modem during | 211 | * always the first thing that gets sent to the modem during |
215 | * opening of the device */ | 212 | * opening of the device */ |
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c index 2314c6ae4fc2..4473d442b2aa 100644 --- a/drivers/usb/serial/iuu_phoenix.c +++ b/drivers/usb/serial/iuu_phoenix.c | |||
@@ -1051,7 +1051,6 @@ static int iuu_open(struct tty_struct *tty, | |||
1051 | tty->termios->c_oflag = 0; | 1051 | tty->termios->c_oflag = 0; |
1052 | tty->termios->c_iflag = 0; | 1052 | tty->termios->c_iflag = 0; |
1053 | priv->termios_initialized = 1; | 1053 | priv->termios_initialized = 1; |
1054 | tty->low_latency = 1; | ||
1055 | priv->poll = 0; | 1054 | priv->poll = 0; |
1056 | } | 1055 | } |
1057 | spin_unlock_irqrestore(&priv->lock, flags); | 1056 | spin_unlock_irqrestore(&priv->lock, flags); |
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c index 6286baad9392..c148544953b3 100644 --- a/drivers/usb/serial/kobil_sct.c +++ b/drivers/usb/serial/kobil_sct.c | |||
@@ -231,13 +231,7 @@ static int kobil_open(struct tty_struct *tty, | |||
231 | /* someone sets the dev to 0 if the close method has been called */ | 231 | /* someone sets the dev to 0 if the close method has been called */ |
232 | port->interrupt_in_urb->dev = port->serial->dev; | 232 | port->interrupt_in_urb->dev = port->serial->dev; |
233 | 233 | ||
234 | |||
235 | /* force low_latency on so that our tty_push actually forces | ||
236 | * the data through, otherwise it is scheduled, and with high | ||
237 | * data rates (like with OHCI) data can get lost. | ||
238 | */ | ||
239 | if (tty) { | 234 | if (tty) { |
240 | tty->low_latency = 1; | ||
241 | 235 | ||
242 | /* Default to echo off and other sane device settings */ | 236 | /* Default to echo off and other sane device settings */ |
243 | tty->termios->c_lflag = 0; | 237 | tty->termios->c_lflag = 0; |
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index e772cc0a97fd..24e3b5d4b4d4 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c | |||
@@ -446,13 +446,6 @@ static int mos7720_open(struct tty_struct *tty, | |||
446 | data = 0x0c; | 446 | data = 0x0c; |
447 | send_mos_cmd(serial, MOS_WRITE, port_number, 0x01, &data); | 447 | send_mos_cmd(serial, MOS_WRITE, port_number, 0x01, &data); |
448 | 448 | ||
449 | /* force low_latency on so that our tty_push actually forces * | ||
450 | * the data through,otherwise it is scheduled, and with * | ||
451 | * high data rates (like with OHCI) data can get lost. */ | ||
452 | |||
453 | if (tty) | ||
454 | tty->low_latency = 1; | ||
455 | |||
456 | /* see if we've set up our endpoint info yet * | 449 | /* see if we've set up our endpoint info yet * |
457 | * (can't set it up in mos7720_startup as the * | 450 | * (can't set it up in mos7720_startup as the * |
458 | * structures were not set up at that time.) */ | 451 | * structures were not set up at that time.) */ |
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 2c20e88a91b3..84fb1dcd30dc 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
@@ -38,7 +38,7 @@ | |||
38 | /* | 38 | /* |
39 | * Version Information | 39 | * Version Information |
40 | */ | 40 | */ |
41 | #define DRIVER_VERSION "1.3.1" | 41 | #define DRIVER_VERSION "1.3.2" |
42 | #define DRIVER_DESC "Moschip 7840/7820 USB Serial Driver" | 42 | #define DRIVER_DESC "Moschip 7840/7820 USB Serial Driver" |
43 | 43 | ||
44 | /* | 44 | /* |
@@ -123,6 +123,11 @@ | |||
123 | #define BANDB_DEVICE_ID_USOPTL4_4 0xAC44 | 123 | #define BANDB_DEVICE_ID_USOPTL4_4 0xAC44 |
124 | #define BANDB_DEVICE_ID_USOPTL4_2 0xAC42 | 124 | #define BANDB_DEVICE_ID_USOPTL4_2 0xAC42 |
125 | 125 | ||
126 | /* This driver also supports the ATEN UC2324 device since it is mos7840 based | ||
127 | * - if I knew the device id it would also support the ATEN UC2322 */ | ||
128 | #define USB_VENDOR_ID_ATENINTL 0x0557 | ||
129 | #define ATENINTL_DEVICE_ID_UC2324 0x2011 | ||
130 | |||
126 | /* Interrupt Routine Defines */ | 131 | /* Interrupt Routine Defines */ |
127 | 132 | ||
128 | #define SERIAL_IIR_RLS 0x06 | 133 | #define SERIAL_IIR_RLS 0x06 |
@@ -170,6 +175,7 @@ static struct usb_device_id moschip_port_id_table[] = { | |||
170 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, | 175 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, |
171 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, | 176 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, |
172 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, | 177 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, |
178 | {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, | ||
173 | {} /* terminating entry */ | 179 | {} /* terminating entry */ |
174 | }; | 180 | }; |
175 | 181 | ||
@@ -178,6 +184,7 @@ static __devinitdata struct usb_device_id moschip_id_table_combined[] = { | |||
178 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, | 184 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, |
179 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, | 185 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, |
180 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, | 186 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, |
187 | {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, | ||
181 | {} /* terminating entry */ | 188 | {} /* terminating entry */ |
182 | }; | 189 | }; |
183 | 190 | ||
@@ -1000,12 +1007,6 @@ static int mos7840_open(struct tty_struct *tty, | |||
1000 | status = mos7840_set_reg_sync(port, mos7840_port->ControlRegOffset, | 1007 | status = mos7840_set_reg_sync(port, mos7840_port->ControlRegOffset, |
1001 | Data); | 1008 | Data); |
1002 | 1009 | ||
1003 | /* force low_latency on so that our tty_push actually forces * | ||
1004 | * the data through,otherwise it is scheduled, and with * | ||
1005 | * high data rates (like with OHCI) data can get lost. */ | ||
1006 | if (tty) | ||
1007 | tty->low_latency = 1; | ||
1008 | |||
1009 | /* Check to see if we've set up our endpoint info yet * | 1010 | /* Check to see if we've set up our endpoint info yet * |
1010 | * (can't set it up in mos7840_startup as the structures * | 1011 | * (can't set it up in mos7840_startup as the structures * |
1011 | * were not set up at that time.) */ | 1012 | * were not set up at that time.) */ |
@@ -2477,9 +2478,14 @@ static int mos7840_startup(struct usb_serial *serial) | |||
2477 | mos7840_set_port_private(serial->port[i], mos7840_port); | 2478 | mos7840_set_port_private(serial->port[i], mos7840_port); |
2478 | spin_lock_init(&mos7840_port->pool_lock); | 2479 | spin_lock_init(&mos7840_port->pool_lock); |
2479 | 2480 | ||
2480 | mos7840_port->port_num = ((serial->port[i]->number - | 2481 | /* minor is not initialised until later by |
2481 | (serial->port[i]->serial->minor)) + | 2482 | * usb-serial.c:get_free_serial() and cannot therefore be used |
2482 | 1); | 2483 | * to index device instances */ |
2484 | mos7840_port->port_num = i + 1; | ||
2485 | dbg ("serial->port[i]->number = %d", serial->port[i]->number); | ||
2486 | dbg ("serial->port[i]->serial->minor = %d", serial->port[i]->serial->minor); | ||
2487 | dbg ("mos7840_port->port_num = %d", mos7840_port->port_num); | ||
2488 | dbg ("serial->minor = %d", serial->minor); | ||
2483 | 2489 | ||
2484 | if (mos7840_port->port_num == 1) { | 2490 | if (mos7840_port->port_num == 1) { |
2485 | mos7840_port->SpRegOffset = 0x0; | 2491 | mos7840_port->SpRegOffset = 0x0; |
@@ -2690,13 +2696,16 @@ static void mos7840_shutdown(struct usb_serial *serial) | |||
2690 | 2696 | ||
2691 | for (i = 0; i < serial->num_ports; ++i) { | 2697 | for (i = 0; i < serial->num_ports; ++i) { |
2692 | mos7840_port = mos7840_get_port_private(serial->port[i]); | 2698 | mos7840_port = mos7840_get_port_private(serial->port[i]); |
2693 | spin_lock_irqsave(&mos7840_port->pool_lock, flags); | 2699 | dbg ("mos7840_port %d = %p", i, mos7840_port); |
2694 | mos7840_port->zombie = 1; | 2700 | if (mos7840_port) { |
2695 | spin_unlock_irqrestore(&mos7840_port->pool_lock, flags); | 2701 | spin_lock_irqsave(&mos7840_port->pool_lock, flags); |
2696 | usb_kill_urb(mos7840_port->control_urb); | 2702 | mos7840_port->zombie = 1; |
2697 | kfree(mos7840_port->ctrl_buf); | 2703 | spin_unlock_irqrestore(&mos7840_port->pool_lock, flags); |
2698 | kfree(mos7840_port->dr); | 2704 | usb_kill_urb(mos7840_port->control_urb); |
2699 | kfree(mos7840_port); | 2705 | kfree(mos7840_port->ctrl_buf); |
2706 | kfree(mos7840_port->dr); | ||
2707 | kfree(mos7840_port); | ||
2708 | } | ||
2700 | mos7840_set_port_private(serial->port[i], NULL); | 2709 | mos7840_set_port_private(serial->port[i], NULL); |
2701 | } | 2710 | } |
2702 | 2711 | ||
diff --git a/drivers/usb/serial/moto_modem.c b/drivers/usb/serial/moto_modem.c index 2e8e05462ef7..b66b71ccd12b 100644 --- a/drivers/usb/serial/moto_modem.c +++ b/drivers/usb/serial/moto_modem.c | |||
@@ -25,6 +25,7 @@ static struct usb_device_id id_table [] = { | |||
25 | { USB_DEVICE(0x05c6, 0x3197) }, /* unknown Motorola phone */ | 25 | { USB_DEVICE(0x05c6, 0x3197) }, /* unknown Motorola phone */ |
26 | { USB_DEVICE(0x0c44, 0x0022) }, /* unknown Mororola phone */ | 26 | { USB_DEVICE(0x0c44, 0x0022) }, /* unknown Mororola phone */ |
27 | { USB_DEVICE(0x22b8, 0x2a64) }, /* Motorola KRZR K1m */ | 27 | { USB_DEVICE(0x22b8, 0x2a64) }, /* Motorola KRZR K1m */ |
28 | { USB_DEVICE(0x22b8, 0x2c64) }, /* Motorola V950 phone */ | ||
28 | { }, | 29 | { }, |
29 | }; | 30 | }; |
30 | MODULE_DEVICE_TABLE(usb, id_table); | 31 | MODULE_DEVICE_TABLE(usb, id_table); |
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c index 839583dc8b6a..b500ad10b758 100644 --- a/drivers/usb/serial/opticon.c +++ b/drivers/usb/serial/opticon.c | |||
@@ -159,14 +159,6 @@ static int opticon_open(struct tty_struct *tty, struct usb_serial_port *port, | |||
159 | priv->port = port; | 159 | priv->port = port; |
160 | spin_unlock_irqrestore(&priv->lock, flags); | 160 | spin_unlock_irqrestore(&priv->lock, flags); |
161 | 161 | ||
162 | /* | ||
163 | * Force low_latency on so that our tty_push actually forces the data | ||
164 | * through, otherwise it is scheduled, and with high data rates (like | ||
165 | * with OHCI) data can get lost. | ||
166 | */ | ||
167 | if (tty) | ||
168 | tty->low_latency = 1; | ||
169 | |||
170 | /* Start reading from the device */ | 162 | /* Start reading from the device */ |
171 | usb_fill_bulk_urb(priv->bulk_read_urb, priv->udev, | 163 | usb_fill_bulk_urb(priv->bulk_read_urb, priv->udev, |
172 | usb_rcvbulkpipe(priv->udev, | 164 | usb_rcvbulkpipe(priv->udev, |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index d560c0b54e6e..7817b82889ca 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -300,6 +300,10 @@ static int option_resume(struct usb_serial *serial); | |||
300 | #define BENQ_VENDOR_ID 0x04a5 | 300 | #define BENQ_VENDOR_ID 0x04a5 |
301 | #define BENQ_PRODUCT_H10 0x4068 | 301 | #define BENQ_PRODUCT_H10 0x4068 |
302 | 302 | ||
303 | #define DLINK_VENDOR_ID 0x1186 | ||
304 | #define DLINK_PRODUCT_DWM_652 0x3e04 | ||
305 | |||
306 | |||
303 | static struct usb_device_id option_ids[] = { | 307 | static struct usb_device_id option_ids[] = { |
304 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, | 308 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, |
305 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, | 309 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, |
@@ -516,6 +520,7 @@ static struct usb_device_id option_ids[] = { | |||
516 | { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628) }, | 520 | { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628) }, |
517 | { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH) }, | 521 | { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH) }, |
518 | { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, | 522 | { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, |
523 | { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) }, | ||
519 | { USB_DEVICE(0x1da5, 0x4515) }, /* BenQ H20 */ | 524 | { USB_DEVICE(0x1da5, 0x4515) }, /* BenQ H20 */ |
520 | { } /* Terminating entry */ | 525 | { } /* Terminating entry */ |
521 | }; | 526 | }; |
@@ -931,9 +936,6 @@ static int option_open(struct tty_struct *tty, | |||
931 | usb_pipeout(urb->pipe), 0); */ | 936 | usb_pipeout(urb->pipe), 0); */ |
932 | } | 937 | } |
933 | 938 | ||
934 | if (tty) | ||
935 | tty->low_latency = 1; | ||
936 | |||
937 | option_send_setup(tty, port); | 939 | option_send_setup(tty, port); |
938 | 940 | ||
939 | return 0; | 941 | return 0; |
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index e6d6b0c17fd9..7528b8d57f1c 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
@@ -26,6 +26,27 @@ static struct usb_device_id id_table[] = { | |||
26 | {USB_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ | 26 | {USB_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ |
27 | {USB_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ | 27 | {USB_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */ |
28 | {USB_DEVICE(0x03f0, 0x201d)}, /* HP un2400 Gobi QDL Device */ | 28 | {USB_DEVICE(0x03f0, 0x201d)}, /* HP un2400 Gobi QDL Device */ |
29 | {USB_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */ | ||
30 | {USB_DEVICE(0x04da, 0x250c)}, /* Panasonic Gobi QDL device */ | ||
31 | {USB_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */ | ||
32 | {USB_DEVICE(0x413c, 0x8171)}, /* Dell Gobi QDL device */ | ||
33 | {USB_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */ | ||
34 | {USB_DEVICE(0x1410, 0xa008)}, /* Novatel Gobi QDL device */ | ||
35 | {USB_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */ | ||
36 | {USB_DEVICE(0x0b05, 0x1774)}, /* Asus Gobi QDL device */ | ||
37 | {USB_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */ | ||
38 | {USB_DEVICE(0x19d2, 0xfff2)}, /* ONDA Gobi QDL device */ | ||
39 | {USB_DEVICE(0x1557, 0x0a80)}, /* OQO Gobi QDL device */ | ||
40 | {USB_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */ | ||
41 | {USB_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */ | ||
42 | {USB_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */ | ||
43 | {USB_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */ | ||
44 | {USB_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */ | ||
45 | {USB_DEVICE(0x05c6, 0x9008)}, /* Generic Gobi QDL device */ | ||
46 | {USB_DEVICE(0x05c6, 0x9201)}, /* Generic Gobi QDL device */ | ||
47 | {USB_DEVICE(0x05c6, 0x9221)}, /* Generic Gobi QDL device */ | ||
48 | {USB_DEVICE(0x05c6, 0x9231)}, /* Generic Gobi QDL device */ | ||
49 | {USB_DEVICE(0x1f45, 0x0001)}, /* Unknown Gobi QDL device */ | ||
29 | { } /* Terminating entry */ | 50 | { } /* Terminating entry */ |
30 | }; | 51 | }; |
31 | MODULE_DEVICE_TABLE(usb, id_table); | 52 | MODULE_DEVICE_TABLE(usb, id_table); |
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index d9bf9a5c20ec..913225c61610 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c | |||
@@ -14,7 +14,7 @@ | |||
14 | Whom based his on the Keyspan driver by Hugh Blemings <hugh@blemings.org> | 14 | Whom based his on the Keyspan driver by Hugh Blemings <hugh@blemings.org> |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #define DRIVER_VERSION "v.1.3.2" | 17 | #define DRIVER_VERSION "v.1.3.3" |
18 | #define DRIVER_AUTHOR "Kevin Lloyd <klloyd@sierrawireless.com>" | 18 | #define DRIVER_AUTHOR "Kevin Lloyd <klloyd@sierrawireless.com>" |
19 | #define DRIVER_DESC "USB Driver for Sierra Wireless USB modems" | 19 | #define DRIVER_DESC "USB Driver for Sierra Wireless USB modems" |
20 | 20 | ||
@@ -259,9 +259,21 @@ static int sierra_send_setup(struct tty_struct *tty, | |||
259 | val |= 0x02; | 259 | val |= 0x02; |
260 | 260 | ||
261 | /* If composite device then properly report interface */ | 261 | /* If composite device then properly report interface */ |
262 | if (serial->num_ports == 1) | 262 | if (serial->num_ports == 1) { |
263 | interface = sierra_calc_interface(serial); | 263 | interface = sierra_calc_interface(serial); |
264 | 264 | ||
265 | /* Control message is sent only to interfaces with | ||
266 | * interrupt_in endpoints | ||
267 | */ | ||
268 | if (port->interrupt_in_urb) { | ||
269 | /* send control message */ | ||
270 | return usb_control_msg(serial->dev, | ||
271 | usb_rcvctrlpipe(serial->dev, 0), | ||
272 | 0x22, 0x21, val, interface, | ||
273 | NULL, 0, USB_CTRL_SET_TIMEOUT); | ||
274 | } | ||
275 | } | ||
276 | |||
265 | /* Otherwise the need to do non-composite mapping */ | 277 | /* Otherwise the need to do non-composite mapping */ |
266 | else { | 278 | else { |
267 | if (port->bulk_out_endpointAddress == 2) | 279 | if (port->bulk_out_endpointAddress == 2) |
@@ -270,12 +282,13 @@ static int sierra_send_setup(struct tty_struct *tty, | |||
270 | interface = 1; | 282 | interface = 1; |
271 | else if (port->bulk_out_endpointAddress == 5) | 283 | else if (port->bulk_out_endpointAddress == 5) |
272 | interface = 2; | 284 | interface = 2; |
273 | } | ||
274 | 285 | ||
275 | return usb_control_msg(serial->dev, | 286 | return usb_control_msg(serial->dev, |
276 | usb_rcvctrlpipe(serial->dev, 0), | 287 | usb_rcvctrlpipe(serial->dev, 0), |
277 | 0x22, 0x21, val, interface, | 288 | 0x22, 0x21, val, interface, |
278 | NULL, 0, USB_CTRL_SET_TIMEOUT); | 289 | NULL, 0, USB_CTRL_SET_TIMEOUT); |
290 | |||
291 | } | ||
279 | } | 292 | } |
280 | 293 | ||
281 | return 0; | 294 | return 0; |
@@ -585,9 +598,6 @@ static int sierra_open(struct tty_struct *tty, | |||
585 | } | 598 | } |
586 | } | 599 | } |
587 | 600 | ||
588 | if (tty) | ||
589 | tty->low_latency = 1; | ||
590 | |||
591 | sierra_send_setup(tty, port); | 601 | sierra_send_setup(tty, port); |
592 | 602 | ||
593 | /* start up the interrupt endpoint if we have one */ | 603 | /* start up the interrupt endpoint if we have one */ |
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 2620bf6fe5e1..0a64bac306ee 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c | |||
@@ -50,11 +50,10 @@ | |||
50 | 50 | ||
51 | #define TI_TRANSFER_TIMEOUT 2 | 51 | #define TI_TRANSFER_TIMEOUT 2 |
52 | 52 | ||
53 | #define TI_DEFAULT_LOW_LATENCY 0 | ||
54 | #define TI_DEFAULT_CLOSING_WAIT 4000 /* in .01 secs */ | 53 | #define TI_DEFAULT_CLOSING_WAIT 4000 /* in .01 secs */ |
55 | 54 | ||
56 | /* supported setserial flags */ | 55 | /* supported setserial flags */ |
57 | #define TI_SET_SERIAL_FLAGS (ASYNC_LOW_LATENCY) | 56 | #define TI_SET_SERIAL_FLAGS 0 |
58 | 57 | ||
59 | /* read urb states */ | 58 | /* read urb states */ |
60 | #define TI_READ_URB_RUNNING 0 | 59 | #define TI_READ_URB_RUNNING 0 |
@@ -161,7 +160,6 @@ static int ti_buf_get(struct circ_buf *cb, char *buf, int count); | |||
161 | 160 | ||
162 | /* module parameters */ | 161 | /* module parameters */ |
163 | static int debug; | 162 | static int debug; |
164 | static int low_latency = TI_DEFAULT_LOW_LATENCY; | ||
165 | static int closing_wait = TI_DEFAULT_CLOSING_WAIT; | 163 | static int closing_wait = TI_DEFAULT_CLOSING_WAIT; |
166 | static ushort vendor_3410[TI_EXTRA_VID_PID_COUNT]; | 164 | static ushort vendor_3410[TI_EXTRA_VID_PID_COUNT]; |
167 | static unsigned int vendor_3410_count; | 165 | static unsigned int vendor_3410_count; |
@@ -296,10 +294,6 @@ MODULE_FIRMWARE("mts_edge.fw"); | |||
296 | module_param(debug, bool, S_IRUGO | S_IWUSR); | 294 | module_param(debug, bool, S_IRUGO | S_IWUSR); |
297 | MODULE_PARM_DESC(debug, "Enable debugging, 0=no, 1=yes"); | 295 | MODULE_PARM_DESC(debug, "Enable debugging, 0=no, 1=yes"); |
298 | 296 | ||
299 | module_param(low_latency, bool, S_IRUGO | S_IWUSR); | ||
300 | MODULE_PARM_DESC(low_latency, | ||
301 | "TTY low_latency flag, 0=off, 1=on, default is off"); | ||
302 | |||
303 | module_param(closing_wait, int, S_IRUGO | S_IWUSR); | 297 | module_param(closing_wait, int, S_IRUGO | S_IWUSR); |
304 | MODULE_PARM_DESC(closing_wait, | 298 | MODULE_PARM_DESC(closing_wait, |
305 | "Maximum wait for data to drain in close, in .01 secs, default is 4000"); | 299 | "Maximum wait for data to drain in close, in .01 secs, default is 4000"); |
@@ -448,7 +442,6 @@ static int ti_startup(struct usb_serial *serial) | |||
448 | spin_lock_init(&tport->tp_lock); | 442 | spin_lock_init(&tport->tp_lock); |
449 | tport->tp_uart_base_addr = (i == 0 ? | 443 | tport->tp_uart_base_addr = (i == 0 ? |
450 | TI_UART1_BASE_ADDR : TI_UART2_BASE_ADDR); | 444 | TI_UART1_BASE_ADDR : TI_UART2_BASE_ADDR); |
451 | tport->tp_flags = low_latency ? ASYNC_LOW_LATENCY : 0; | ||
452 | tport->tp_closing_wait = closing_wait; | 445 | tport->tp_closing_wait = closing_wait; |
453 | init_waitqueue_head(&tport->tp_msr_wait); | 446 | init_waitqueue_head(&tport->tp_msr_wait); |
454 | init_waitqueue_head(&tport->tp_write_wait); | 447 | init_waitqueue_head(&tport->tp_write_wait); |
@@ -528,10 +521,6 @@ static int ti_open(struct tty_struct *tty, | |||
528 | if (mutex_lock_interruptible(&tdev->td_open_close_lock)) | 521 | if (mutex_lock_interruptible(&tdev->td_open_close_lock)) |
529 | return -ERESTARTSYS; | 522 | return -ERESTARTSYS; |
530 | 523 | ||
531 | if (tty) | ||
532 | tty->low_latency = | ||
533 | (tport->tp_flags & ASYNC_LOW_LATENCY) ? 1 : 0; | ||
534 | |||
535 | port_number = port->number - port->serial->minor; | 524 | port_number = port->number - port->serial->minor; |
536 | 525 | ||
537 | memset(&(tport->tp_icount), 0x00, sizeof(tport->tp_icount)); | 526 | memset(&(tport->tp_icount), 0x00, sizeof(tport->tp_icount)); |
@@ -1215,20 +1204,22 @@ static void ti_bulk_in_callback(struct urb *urb) | |||
1215 | } | 1204 | } |
1216 | 1205 | ||
1217 | tty = tty_port_tty_get(&port->port); | 1206 | tty = tty_port_tty_get(&port->port); |
1218 | if (tty && urb->actual_length) { | 1207 | if (tty) { |
1219 | usb_serial_debug_data(debug, dev, __func__, | 1208 | if (urb->actual_length) { |
1220 | urb->actual_length, urb->transfer_buffer); | 1209 | usb_serial_debug_data(debug, dev, __func__, |
1221 | 1210 | urb->actual_length, urb->transfer_buffer); | |
1222 | if (!tport->tp_is_open) | 1211 | |
1223 | dbg("%s - port closed, dropping data", __func__); | 1212 | if (!tport->tp_is_open) |
1224 | else | 1213 | dbg("%s - port closed, dropping data", |
1225 | ti_recv(&urb->dev->dev, tty, | 1214 | __func__); |
1215 | else | ||
1216 | ti_recv(&urb->dev->dev, tty, | ||
1226 | urb->transfer_buffer, | 1217 | urb->transfer_buffer, |
1227 | urb->actual_length); | 1218 | urb->actual_length); |
1228 | 1219 | spin_lock(&tport->tp_lock); | |
1229 | spin_lock(&tport->tp_lock); | 1220 | tport->tp_icount.rx += urb->actual_length; |
1230 | tport->tp_icount.rx += urb->actual_length; | 1221 | spin_unlock(&tport->tp_lock); |
1231 | spin_unlock(&tport->tp_lock); | 1222 | } |
1232 | tty_kref_put(tty); | 1223 | tty_kref_put(tty); |
1233 | } | 1224 | } |
1234 | 1225 | ||
@@ -1452,7 +1443,6 @@ static int ti_set_serial_info(struct tty_struct *tty, struct ti_port *tport, | |||
1452 | return -EFAULT; | 1443 | return -EFAULT; |
1453 | 1444 | ||
1454 | tport->tp_flags = new_serial.flags & TI_SET_SERIAL_FLAGS; | 1445 | tport->tp_flags = new_serial.flags & TI_SET_SERIAL_FLAGS; |
1455 | tty->low_latency = (tport->tp_flags & ASYNC_LOW_LATENCY) ? 1 : 0; | ||
1456 | tport->tp_closing_wait = new_serial.closing_wait; | 1446 | tport->tp_closing_wait = new_serial.closing_wait; |
1457 | 1447 | ||
1458 | return 0; | 1448 | return 0; |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 2a70563bbee1..0a566eea49c0 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -137,22 +137,10 @@ static void destroy_serial(struct kref *kref) | |||
137 | 137 | ||
138 | dbg("%s - %s", __func__, serial->type->description); | 138 | dbg("%s - %s", __func__, serial->type->description); |
139 | 139 | ||
140 | serial->type->shutdown(serial); | ||
141 | |||
142 | /* return the minor range that this device had */ | 140 | /* return the minor range that this device had */ |
143 | if (serial->minor != SERIAL_TTY_NO_MINOR) | 141 | if (serial->minor != SERIAL_TTY_NO_MINOR) |
144 | return_serial(serial); | 142 | return_serial(serial); |
145 | 143 | ||
146 | for (i = 0; i < serial->num_ports; ++i) | ||
147 | serial->port[i]->port.count = 0; | ||
148 | |||
149 | /* the ports are cleaned up and released in port_release() */ | ||
150 | for (i = 0; i < serial->num_ports; ++i) | ||
151 | if (serial->port[i]->dev.parent != NULL) { | ||
152 | device_unregister(&serial->port[i]->dev); | ||
153 | serial->port[i] = NULL; | ||
154 | } | ||
155 | |||
156 | /* If this is a "fake" port, we have to clean it up here, as it will | 144 | /* If this is a "fake" port, we have to clean it up here, as it will |
157 | * not get cleaned up in port_release() as it was never registered with | 145 | * not get cleaned up in port_release() as it was never registered with |
158 | * the driver core */ | 146 | * the driver core */ |
@@ -187,7 +175,7 @@ static int serial_open (struct tty_struct *tty, struct file *filp) | |||
187 | struct usb_serial *serial; | 175 | struct usb_serial *serial; |
188 | struct usb_serial_port *port; | 176 | struct usb_serial_port *port; |
189 | unsigned int portNumber; | 177 | unsigned int portNumber; |
190 | int retval; | 178 | int retval = 0; |
191 | 179 | ||
192 | dbg("%s", __func__); | 180 | dbg("%s", __func__); |
193 | 181 | ||
@@ -198,21 +186,24 @@ static int serial_open (struct tty_struct *tty, struct file *filp) | |||
198 | return -ENODEV; | 186 | return -ENODEV; |
199 | } | 187 | } |
200 | 188 | ||
189 | mutex_lock(&serial->disc_mutex); | ||
201 | portNumber = tty->index - serial->minor; | 190 | portNumber = tty->index - serial->minor; |
202 | port = serial->port[portNumber]; | 191 | port = serial->port[portNumber]; |
203 | if (!port) { | 192 | if (!port || serial->disconnected) |
204 | retval = -ENODEV; | ||
205 | goto bailout_kref_put; | ||
206 | } | ||
207 | |||
208 | if (port->serial->disconnected) { | ||
209 | retval = -ENODEV; | 193 | retval = -ENODEV; |
210 | goto bailout_kref_put; | 194 | else |
211 | } | 195 | get_device(&port->dev); |
196 | /* | ||
197 | * Note: Our locking order requirement does not allow port->mutex | ||
198 | * to be acquired while serial->disc_mutex is held. | ||
199 | */ | ||
200 | mutex_unlock(&serial->disc_mutex); | ||
201 | if (retval) | ||
202 | goto bailout_serial_put; | ||
212 | 203 | ||
213 | if (mutex_lock_interruptible(&port->mutex)) { | 204 | if (mutex_lock_interruptible(&port->mutex)) { |
214 | retval = -ERESTARTSYS; | 205 | retval = -ERESTARTSYS; |
215 | goto bailout_kref_put; | 206 | goto bailout_port_put; |
216 | } | 207 | } |
217 | 208 | ||
218 | ++port->port.count; | 209 | ++port->port.count; |
@@ -232,14 +223,20 @@ static int serial_open (struct tty_struct *tty, struct file *filp) | |||
232 | goto bailout_mutex_unlock; | 223 | goto bailout_mutex_unlock; |
233 | } | 224 | } |
234 | 225 | ||
235 | retval = usb_autopm_get_interface(serial->interface); | 226 | mutex_lock(&serial->disc_mutex); |
227 | if (serial->disconnected) | ||
228 | retval = -ENODEV; | ||
229 | else | ||
230 | retval = usb_autopm_get_interface(serial->interface); | ||
236 | if (retval) | 231 | if (retval) |
237 | goto bailout_module_put; | 232 | goto bailout_module_put; |
233 | |||
238 | /* only call the device specific open if this | 234 | /* only call the device specific open if this |
239 | * is the first time the port is opened */ | 235 | * is the first time the port is opened */ |
240 | retval = serial->type->open(tty, port, filp); | 236 | retval = serial->type->open(tty, port, filp); |
241 | if (retval) | 237 | if (retval) |
242 | goto bailout_interface_put; | 238 | goto bailout_interface_put; |
239 | mutex_unlock(&serial->disc_mutex); | ||
243 | } | 240 | } |
244 | 241 | ||
245 | mutex_unlock(&port->mutex); | 242 | mutex_unlock(&port->mutex); |
@@ -248,13 +245,16 @@ static int serial_open (struct tty_struct *tty, struct file *filp) | |||
248 | bailout_interface_put: | 245 | bailout_interface_put: |
249 | usb_autopm_put_interface(serial->interface); | 246 | usb_autopm_put_interface(serial->interface); |
250 | bailout_module_put: | 247 | bailout_module_put: |
248 | mutex_unlock(&serial->disc_mutex); | ||
251 | module_put(serial->type->driver.owner); | 249 | module_put(serial->type->driver.owner); |
252 | bailout_mutex_unlock: | 250 | bailout_mutex_unlock: |
253 | port->port.count = 0; | 251 | port->port.count = 0; |
254 | tty->driver_data = NULL; | 252 | tty->driver_data = NULL; |
255 | tty_port_tty_set(&port->port, NULL); | 253 | tty_port_tty_set(&port->port, NULL); |
256 | mutex_unlock(&port->mutex); | 254 | mutex_unlock(&port->mutex); |
257 | bailout_kref_put: | 255 | bailout_port_put: |
256 | put_device(&port->dev); | ||
257 | bailout_serial_put: | ||
258 | usb_serial_put(serial); | 258 | usb_serial_put(serial); |
259 | return retval; | 259 | return retval; |
260 | } | 260 | } |
@@ -262,6 +262,9 @@ bailout_kref_put: | |||
262 | static void serial_close(struct tty_struct *tty, struct file *filp) | 262 | static void serial_close(struct tty_struct *tty, struct file *filp) |
263 | { | 263 | { |
264 | struct usb_serial_port *port = tty->driver_data; | 264 | struct usb_serial_port *port = tty->driver_data; |
265 | struct usb_serial *serial; | ||
266 | struct module *owner; | ||
267 | int count; | ||
265 | 268 | ||
266 | if (!port) | 269 | if (!port) |
267 | return; | 270 | return; |
@@ -269,6 +272,8 @@ static void serial_close(struct tty_struct *tty, struct file *filp) | |||
269 | dbg("%s - port %d", __func__, port->number); | 272 | dbg("%s - port %d", __func__, port->number); |
270 | 273 | ||
271 | mutex_lock(&port->mutex); | 274 | mutex_lock(&port->mutex); |
275 | serial = port->serial; | ||
276 | owner = serial->type->driver.owner; | ||
272 | 277 | ||
273 | if (port->port.count == 0) { | 278 | if (port->port.count == 0) { |
274 | mutex_unlock(&port->mutex); | 279 | mutex_unlock(&port->mutex); |
@@ -281,7 +286,7 @@ static void serial_close(struct tty_struct *tty, struct file *filp) | |||
281 | * this before we drop the port count. The call is protected | 286 | * this before we drop the port count. The call is protected |
282 | * by the port mutex | 287 | * by the port mutex |
283 | */ | 288 | */ |
284 | port->serial->type->close(tty, port, filp); | 289 | serial->type->close(tty, port, filp); |
285 | 290 | ||
286 | if (port->port.count == (port->console ? 2 : 1)) { | 291 | if (port->port.count == (port->console ? 2 : 1)) { |
287 | struct tty_struct *tty = tty_port_tty_get(&port->port); | 292 | struct tty_struct *tty = tty_port_tty_get(&port->port); |
@@ -295,17 +300,23 @@ static void serial_close(struct tty_struct *tty, struct file *filp) | |||
295 | } | 300 | } |
296 | } | 301 | } |
297 | 302 | ||
298 | if (port->port.count == 1) { | ||
299 | mutex_lock(&port->serial->disc_mutex); | ||
300 | if (!port->serial->disconnected) | ||
301 | usb_autopm_put_interface(port->serial->interface); | ||
302 | mutex_unlock(&port->serial->disc_mutex); | ||
303 | module_put(port->serial->type->driver.owner); | ||
304 | } | ||
305 | --port->port.count; | 303 | --port->port.count; |
306 | 304 | count = port->port.count; | |
307 | mutex_unlock(&port->mutex); | 305 | mutex_unlock(&port->mutex); |
308 | usb_serial_put(port->serial); | 306 | put_device(&port->dev); |
307 | |||
308 | /* Mustn't dereference port any more */ | ||
309 | if (count == 0) { | ||
310 | mutex_lock(&serial->disc_mutex); | ||
311 | if (!serial->disconnected) | ||
312 | usb_autopm_put_interface(serial->interface); | ||
313 | mutex_unlock(&serial->disc_mutex); | ||
314 | } | ||
315 | usb_serial_put(serial); | ||
316 | |||
317 | /* Mustn't dereference serial any more */ | ||
318 | if (count == 0) | ||
319 | module_put(owner); | ||
309 | } | 320 | } |
310 | 321 | ||
311 | static int serial_write(struct tty_struct *tty, const unsigned char *buf, | 322 | static int serial_write(struct tty_struct *tty, const unsigned char *buf, |
@@ -549,7 +560,13 @@ static void kill_traffic(struct usb_serial_port *port) | |||
549 | 560 | ||
550 | static void port_free(struct usb_serial_port *port) | 561 | static void port_free(struct usb_serial_port *port) |
551 | { | 562 | { |
563 | /* | ||
564 | * Stop all the traffic before cancelling the work, so that | ||
565 | * nobody will restart it by calling usb_serial_port_softint. | ||
566 | */ | ||
552 | kill_traffic(port); | 567 | kill_traffic(port); |
568 | cancel_work_sync(&port->work); | ||
569 | |||
553 | usb_free_urb(port->read_urb); | 570 | usb_free_urb(port->read_urb); |
554 | usb_free_urb(port->write_urb); | 571 | usb_free_urb(port->write_urb); |
555 | usb_free_urb(port->interrupt_in_urb); | 572 | usb_free_urb(port->interrupt_in_urb); |
@@ -558,7 +575,6 @@ static void port_free(struct usb_serial_port *port) | |||
558 | kfree(port->bulk_out_buffer); | 575 | kfree(port->bulk_out_buffer); |
559 | kfree(port->interrupt_in_buffer); | 576 | kfree(port->interrupt_in_buffer); |
560 | kfree(port->interrupt_out_buffer); | 577 | kfree(port->interrupt_out_buffer); |
561 | flush_scheduled_work(); /* port->work */ | ||
562 | kfree(port); | 578 | kfree(port); |
563 | } | 579 | } |
564 | 580 | ||
@@ -1043,6 +1059,12 @@ void usb_serial_disconnect(struct usb_interface *interface) | |||
1043 | usb_set_intfdata(interface, NULL); | 1059 | usb_set_intfdata(interface, NULL); |
1044 | /* must set a flag, to signal subdrivers */ | 1060 | /* must set a flag, to signal subdrivers */ |
1045 | serial->disconnected = 1; | 1061 | serial->disconnected = 1; |
1062 | mutex_unlock(&serial->disc_mutex); | ||
1063 | |||
1064 | /* Unfortunately, many of the sub-drivers expect the port structures | ||
1065 | * to exist when their shutdown method is called, so we have to go | ||
1066 | * through this awkward two-step unregistration procedure. | ||
1067 | */ | ||
1046 | for (i = 0; i < serial->num_ports; ++i) { | 1068 | for (i = 0; i < serial->num_ports; ++i) { |
1047 | port = serial->port[i]; | 1069 | port = serial->port[i]; |
1048 | if (port) { | 1070 | if (port) { |
@@ -1052,11 +1074,21 @@ void usb_serial_disconnect(struct usb_interface *interface) | |||
1052 | tty_kref_put(tty); | 1074 | tty_kref_put(tty); |
1053 | } | 1075 | } |
1054 | kill_traffic(port); | 1076 | kill_traffic(port); |
1077 | cancel_work_sync(&port->work); | ||
1078 | device_del(&port->dev); | ||
1079 | } | ||
1080 | } | ||
1081 | serial->type->shutdown(serial); | ||
1082 | for (i = 0; i < serial->num_ports; ++i) { | ||
1083 | port = serial->port[i]; | ||
1084 | if (port) { | ||
1085 | put_device(&port->dev); | ||
1086 | serial->port[i] = NULL; | ||
1055 | } | 1087 | } |
1056 | } | 1088 | } |
1089 | |||
1057 | /* let the last holder of this object | 1090 | /* let the last holder of this object |
1058 | * cause it to be cleaned up */ | 1091 | * cause it to be cleaned up */ |
1059 | mutex_unlock(&serial->disc_mutex); | ||
1060 | usb_serial_put(serial); | 1092 | usb_serial_put(serial); |
1061 | dev_info(dev, "device disconnected\n"); | 1093 | dev_info(dev, "device disconnected\n"); |
1062 | } | 1094 | } |
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index 4facce3d9364..5ac414bda718 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c | |||
@@ -296,14 +296,6 @@ static int visor_open(struct tty_struct *tty, struct usb_serial_port *port, | |||
296 | priv->throttled = 0; | 296 | priv->throttled = 0; |
297 | spin_unlock_irqrestore(&priv->lock, flags); | 297 | spin_unlock_irqrestore(&priv->lock, flags); |
298 | 298 | ||
299 | /* | ||
300 | * Force low_latency on so that our tty_push actually forces the data | ||
301 | * through, otherwise it is scheduled, and with high data rates (like | ||
302 | * with OHCI) data can get lost. | ||
303 | */ | ||
304 | if (tty) | ||
305 | tty->low_latency = 1; | ||
306 | |||
307 | /* Start reading from the device */ | 299 | /* Start reading from the device */ |
308 | usb_fill_bulk_urb(port->read_urb, serial->dev, | 300 | usb_fill_bulk_urb(port->read_urb, serial->dev, |
309 | usb_rcvbulkpipe(serial->dev, | 301 | usb_rcvbulkpipe(serial->dev, |