USB-serial fixes for v3.18-rc6

Three fixes for bugs related to TTY error reporting, which can to lead
 to data being dropped by the line discipline.
 
 Included is also some new device ids for ftdi_sio and cp210x.
 
 Signed-off-by: Johan Hovold <johan@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJUbwMwAAoJEEEN5E/e4bSV+tYQAMT6w2Spv0abcZvXKGiaaal8
 kexDDdD1g7ry2O353uUdrFERnGk8+pF8amokkHPVYIx5/sIgvyrhrmDloHuYAQgw
 c2IOXxFdIDDmwLJmNfVpssnJGIlWvKtcXVtEdNLgvYt6CaK9jOLkE5QSMFU4ICuW
 O8a9VKutjfekBGGL36oGUl5lduqVoMA32HU46iEFPniO3Gqi3OiOt/PddeuSbpSK
 e1DHgzsVF/KpnUrO7avUbsQQ3BfBOYHqHnor364KmQrIUjvAmEir4XW/e2T8TyGk
 rYvvIR35VeKkOn+SQ3NmixufC00p42s1+vsCQ7kmG6ISMHEfZM3Jj7iYhu1vOelR
 JLTu5WpzL125i6KnSbt/kxyGBmn1a+mTKlJ5K4oHJYY6+cttXzKXjCh71rz0hXXw
 +TAyeo5evWA0kG5d2L/5MU4J77gC7cIGIL+IFvYdS5cY060NM+rYB2Fz01M5MLE1
 AwgMc6vEcS25B9AX1jEkZIFaSnbefTiA4xGPV+Z7Ex9nsLzZ/OEGuuRXpW5schLq
 tl8arQFgdwJv1/++MN4pv7nrJc2rH6lR5CGBGOL9/zbbkPU+Bw7kX5zbcbSc6TN8
 PFJOFpwdZK98GSArRa6bZ1lr1xfKvYybTuSFzdJiPA1aaNIXiP8Bz5Nu2di6bGd8
 gQSdXZQ0giidTOC8NVko
 =aEjf
 -----END PGP SIGNATURE-----

Merge tag 'usb-serial-3.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus

Johan writes:

USB-serial fixes for v3.18-rc6

Three fixes for bugs related to TTY error reporting, which can to lead
to data being dropped by the line discipline.

Included is also some new device ids for ftdi_sio and cp210x.

Signed-off-by: Johan Hovold <johan@kernel.org>
This commit is contained in:
Greg Kroah-Hartman 2014-11-22 07:29:38 -08:00
commit da571b2d1c
5 changed files with 131 additions and 50 deletions

View File

@ -120,6 +120,7 @@ static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
{ USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
{ USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */
{ USB_DEVICE(0x10C4, 0x8875) }, /* CEL MeshConnect USB Stick */
{ USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */
{ USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */
{ USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */

View File

@ -470,6 +470,39 @@ static const struct usb_device_id id_table_combined[] = {
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FD_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FE_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FF_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_4701_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9300_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9301_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9302_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9303_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9304_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9305_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9306_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9307_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9308_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9309_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930A_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930B_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930C_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930D_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930E_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_930F_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9310_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9311_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9312_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9313_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9314_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9315_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9316_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9317_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9318_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_9319_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931A_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931B_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931C_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931D_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931E_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_931F_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) },

View File

@ -926,8 +926,8 @@
#define BAYER_CONTOUR_CABLE_PID 0x6001
/*
* The following are the values for the Matrix Orbital FTDI Range
* Anything in this range will use an FT232RL.
* Matrix Orbital Intelligent USB displays.
* http://www.matrixorbital.com
*/
#define MTXORB_VID 0x1B3D
#define MTXORB_FTDI_RANGE_0100_PID 0x0100
@ -1186,8 +1186,39 @@
#define MTXORB_FTDI_RANGE_01FD_PID 0x01FD
#define MTXORB_FTDI_RANGE_01FE_PID 0x01FE
#define MTXORB_FTDI_RANGE_01FF_PID 0x01FF
#define MTXORB_FTDI_RANGE_4701_PID 0x4701
#define MTXORB_FTDI_RANGE_9300_PID 0x9300
#define MTXORB_FTDI_RANGE_9301_PID 0x9301
#define MTXORB_FTDI_RANGE_9302_PID 0x9302
#define MTXORB_FTDI_RANGE_9303_PID 0x9303
#define MTXORB_FTDI_RANGE_9304_PID 0x9304
#define MTXORB_FTDI_RANGE_9305_PID 0x9305
#define MTXORB_FTDI_RANGE_9306_PID 0x9306
#define MTXORB_FTDI_RANGE_9307_PID 0x9307
#define MTXORB_FTDI_RANGE_9308_PID 0x9308
#define MTXORB_FTDI_RANGE_9309_PID 0x9309
#define MTXORB_FTDI_RANGE_930A_PID 0x930A
#define MTXORB_FTDI_RANGE_930B_PID 0x930B
#define MTXORB_FTDI_RANGE_930C_PID 0x930C
#define MTXORB_FTDI_RANGE_930D_PID 0x930D
#define MTXORB_FTDI_RANGE_930E_PID 0x930E
#define MTXORB_FTDI_RANGE_930F_PID 0x930F
#define MTXORB_FTDI_RANGE_9310_PID 0x9310
#define MTXORB_FTDI_RANGE_9311_PID 0x9311
#define MTXORB_FTDI_RANGE_9312_PID 0x9312
#define MTXORB_FTDI_RANGE_9313_PID 0x9313
#define MTXORB_FTDI_RANGE_9314_PID 0x9314
#define MTXORB_FTDI_RANGE_9315_PID 0x9315
#define MTXORB_FTDI_RANGE_9316_PID 0x9316
#define MTXORB_FTDI_RANGE_9317_PID 0x9317
#define MTXORB_FTDI_RANGE_9318_PID 0x9318
#define MTXORB_FTDI_RANGE_9319_PID 0x9319
#define MTXORB_FTDI_RANGE_931A_PID 0x931A
#define MTXORB_FTDI_RANGE_931B_PID 0x931B
#define MTXORB_FTDI_RANGE_931C_PID 0x931C
#define MTXORB_FTDI_RANGE_931D_PID 0x931D
#define MTXORB_FTDI_RANGE_931E_PID 0x931E
#define MTXORB_FTDI_RANGE_931F_PID 0x931F
/*
* The Mobility Lab (TML)

View File

@ -311,24 +311,30 @@ static void usa26_indat_callback(struct urb *urb)
if ((data[0] & 0x80) == 0) {
/* no errors on individual bytes, only
possible overrun err */
if (data[0] & RXERROR_OVERRUN)
err = TTY_OVERRUN;
else
err = 0;
if (data[0] & RXERROR_OVERRUN) {
tty_insert_flip_char(&port->port, 0,
TTY_OVERRUN);
}
for (i = 1; i < urb->actual_length ; ++i)
tty_insert_flip_char(&port->port, data[i], err);
tty_insert_flip_char(&port->port, data[i],
TTY_NORMAL);
} else {
/* some bytes had errors, every byte has status */
dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);
for (i = 0; i + 1 < urb->actual_length; i += 2) {
int stat = data[i], flag = 0;
if (stat & RXERROR_OVERRUN)
flag |= TTY_OVERRUN;
if (stat & RXERROR_FRAMING)
flag |= TTY_FRAME;
if (stat & RXERROR_PARITY)
flag |= TTY_PARITY;
int stat = data[i];
int flag = TTY_NORMAL;
if (stat & RXERROR_OVERRUN) {
tty_insert_flip_char(&port->port, 0,
TTY_OVERRUN);
}
/* XXX should handle break (0x10) */
if (stat & RXERROR_PARITY)
flag = TTY_PARITY;
else if (stat & RXERROR_FRAMING)
flag = TTY_FRAME;
tty_insert_flip_char(&port->port, data[i+1],
flag);
}
@ -649,14 +655,19 @@ static void usa49_indat_callback(struct urb *urb)
} else {
/* some bytes had errors, every byte has status */
for (i = 0; i + 1 < urb->actual_length; i += 2) {
int stat = data[i], flag = 0;
if (stat & RXERROR_OVERRUN)
flag |= TTY_OVERRUN;
if (stat & RXERROR_FRAMING)
flag |= TTY_FRAME;
if (stat & RXERROR_PARITY)
flag |= TTY_PARITY;
int stat = data[i];
int flag = TTY_NORMAL;
if (stat & RXERROR_OVERRUN) {
tty_insert_flip_char(&port->port, 0,
TTY_OVERRUN);
}
/* XXX should handle break (0x10) */
if (stat & RXERROR_PARITY)
flag = TTY_PARITY;
else if (stat & RXERROR_FRAMING)
flag = TTY_FRAME;
tty_insert_flip_char(&port->port, data[i+1],
flag);
}
@ -713,15 +724,19 @@ static void usa49wg_indat_callback(struct urb *urb)
*/
for (x = 0; x + 1 < len &&
i + 1 < urb->actual_length; x += 2) {
int stat = data[i], flag = 0;
int stat = data[i];
int flag = TTY_NORMAL;
if (stat & RXERROR_OVERRUN)
flag |= TTY_OVERRUN;
if (stat & RXERROR_FRAMING)
flag |= TTY_FRAME;
if (stat & RXERROR_PARITY)
flag |= TTY_PARITY;
if (stat & RXERROR_OVERRUN) {
tty_insert_flip_char(&port->port, 0,
TTY_OVERRUN);
}
/* XXX should handle break (0x10) */
if (stat & RXERROR_PARITY)
flag = TTY_PARITY;
else if (stat & RXERROR_FRAMING)
flag = TTY_FRAME;
tty_insert_flip_char(&port->port, data[i+1],
flag);
i += 2;
@ -773,25 +788,31 @@ static void usa90_indat_callback(struct urb *urb)
if ((data[0] & 0x80) == 0) {
/* no errors on individual bytes, only
possible overrun err*/
if (data[0] & RXERROR_OVERRUN)
err = TTY_OVERRUN;
else
err = 0;
if (data[0] & RXERROR_OVERRUN) {
tty_insert_flip_char(&port->port, 0,
TTY_OVERRUN);
}
for (i = 1; i < urb->actual_length ; ++i)
tty_insert_flip_char(&port->port,
data[i], err);
data[i], TTY_NORMAL);
} else {
/* some bytes had errors, every byte has status */
dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);
for (i = 0; i + 1 < urb->actual_length; i += 2) {
int stat = data[i], flag = 0;
if (stat & RXERROR_OVERRUN)
flag |= TTY_OVERRUN;
if (stat & RXERROR_FRAMING)
flag |= TTY_FRAME;
if (stat & RXERROR_PARITY)
flag |= TTY_PARITY;
int stat = data[i];
int flag = TTY_NORMAL;
if (stat & RXERROR_OVERRUN) {
tty_insert_flip_char(
&port->port, 0,
TTY_OVERRUN);
}
/* XXX should handle break (0x10) */
if (stat & RXERROR_PARITY)
flag = TTY_PARITY;
else if (stat & RXERROR_FRAMING)
flag = TTY_FRAME;
tty_insert_flip_char(&port->port,
data[i+1], flag);
}

View File

@ -492,8 +492,7 @@ static void ssu100_update_lsr(struct usb_serial_port *port, u8 lsr,
}
if (lsr & UART_LSR_OE) {
port->icount.overrun++;
if (*tty_flag == TTY_NORMAL)
*tty_flag = TTY_OVERRUN;
tty_insert_flip_char(&port->port, 0, TTY_OVERRUN);
}
}
@ -511,12 +510,8 @@ static void ssu100_process_read_urb(struct urb *urb)
if ((len >= 4) &&
(packet[0] == 0x1b) && (packet[1] == 0x1b) &&
((packet[2] == 0x00) || (packet[2] == 0x01))) {
if (packet[2] == 0x00) {
if (packet[2] == 0x00)
ssu100_update_lsr(port, packet[3], &flag);
if (flag == TTY_OVERRUN)
tty_insert_flip_char(&port->port, 0,
TTY_OVERRUN);
}
if (packet[2] == 0x01)
ssu100_update_msr(port, packet[3]);