Commit da571b2d authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'usb-serial-3.18-rc6' of...

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: default avatarJohan Hovold <johan@kernel.org>
parents 2aea83a4 75bcbf29
...@@ -120,6 +120,7 @@ static const struct usb_device_id id_table[] = { ...@@ -120,6 +120,7 @@ static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
{ USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */ { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
{ USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-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, 0x88A4) }, /* MMB Networks ZigBee USB Device */
{ USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */
{ USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */ { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */
......
...@@ -470,6 +470,39 @@ static const struct usb_device_id id_table_combined[] = { ...@@ -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_01FD_PID) },
{ USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_01FE_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_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_PERLE_ULTRAPORT_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) }, { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) }, { USB_DEVICE(FTDI_VID, FTDI_TNC_X_PID) },
......
...@@ -926,8 +926,8 @@ ...@@ -926,8 +926,8 @@
#define BAYER_CONTOUR_CABLE_PID 0x6001 #define BAYER_CONTOUR_CABLE_PID 0x6001
/* /*
* The following are the values for the Matrix Orbital FTDI Range * Matrix Orbital Intelligent USB displays.
* Anything in this range will use an FT232RL. * http://www.matrixorbital.com
*/ */
#define MTXORB_VID 0x1B3D #define MTXORB_VID 0x1B3D
#define MTXORB_FTDI_RANGE_0100_PID 0x0100 #define MTXORB_FTDI_RANGE_0100_PID 0x0100
...@@ -1186,8 +1186,39 @@ ...@@ -1186,8 +1186,39 @@
#define MTXORB_FTDI_RANGE_01FD_PID 0x01FD #define MTXORB_FTDI_RANGE_01FD_PID 0x01FD
#define MTXORB_FTDI_RANGE_01FE_PID 0x01FE #define MTXORB_FTDI_RANGE_01FE_PID 0x01FE
#define MTXORB_FTDI_RANGE_01FF_PID 0x01FF #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) * The Mobility Lab (TML)
......
...@@ -311,24 +311,30 @@ static void usa26_indat_callback(struct urb *urb) ...@@ -311,24 +311,30 @@ static void usa26_indat_callback(struct urb *urb)
if ((data[0] & 0x80) == 0) { if ((data[0] & 0x80) == 0) {
/* no errors on individual bytes, only /* no errors on individual bytes, only
possible overrun err */ possible overrun err */
if (data[0] & RXERROR_OVERRUN) if (data[0] & RXERROR_OVERRUN) {
err = TTY_OVERRUN; tty_insert_flip_char(&port->port, 0,
else TTY_OVERRUN);
err = 0; }
for (i = 1; i < urb->actual_length ; ++i) 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 { } else {
/* some bytes had errors, every byte has status */ /* some bytes had errors, every byte has status */
dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__); dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);
for (i = 0; i + 1 < urb->actual_length; i += 2) { for (i = 0; i + 1 < urb->actual_length; i += 2) {
int stat = data[i], flag = 0; int stat = data[i];
if (stat & RXERROR_OVERRUN) int flag = TTY_NORMAL;
flag |= TTY_OVERRUN;
if (stat & RXERROR_FRAMING) if (stat & RXERROR_OVERRUN) {
flag |= TTY_FRAME; tty_insert_flip_char(&port->port, 0,
if (stat & RXERROR_PARITY) TTY_OVERRUN);
flag |= TTY_PARITY; }
/* XXX should handle break (0x10) */ /* 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], tty_insert_flip_char(&port->port, data[i+1],
flag); flag);
} }
...@@ -649,14 +655,19 @@ static void usa49_indat_callback(struct urb *urb) ...@@ -649,14 +655,19 @@ static void usa49_indat_callback(struct urb *urb)
} else { } else {
/* some bytes had errors, every byte has status */ /* some bytes had errors, every byte has status */
for (i = 0; i + 1 < urb->actual_length; i += 2) { for (i = 0; i + 1 < urb->actual_length; i += 2) {
int stat = data[i], flag = 0; int stat = data[i];
if (stat & RXERROR_OVERRUN) int flag = TTY_NORMAL;
flag |= TTY_OVERRUN;
if (stat & RXERROR_FRAMING) if (stat & RXERROR_OVERRUN) {
flag |= TTY_FRAME; tty_insert_flip_char(&port->port, 0,
if (stat & RXERROR_PARITY) TTY_OVERRUN);
flag |= TTY_PARITY; }
/* XXX should handle break (0x10) */ /* 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], tty_insert_flip_char(&port->port, data[i+1],
flag); flag);
} }
...@@ -713,15 +724,19 @@ static void usa49wg_indat_callback(struct urb *urb) ...@@ -713,15 +724,19 @@ static void usa49wg_indat_callback(struct urb *urb)
*/ */
for (x = 0; x + 1 < len && for (x = 0; x + 1 < len &&
i + 1 < urb->actual_length; x += 2) { 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) if (stat & RXERROR_OVERRUN) {
flag |= TTY_OVERRUN; tty_insert_flip_char(&port->port, 0,
if (stat & RXERROR_FRAMING) TTY_OVERRUN);
flag |= TTY_FRAME; }
if (stat & RXERROR_PARITY)
flag |= TTY_PARITY;
/* XXX should handle break (0x10) */ /* 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], tty_insert_flip_char(&port->port, data[i+1],
flag); flag);
i += 2; i += 2;
...@@ -773,25 +788,31 @@ static void usa90_indat_callback(struct urb *urb) ...@@ -773,25 +788,31 @@ static void usa90_indat_callback(struct urb *urb)
if ((data[0] & 0x80) == 0) { if ((data[0] & 0x80) == 0) {
/* no errors on individual bytes, only /* no errors on individual bytes, only
possible overrun err*/ possible overrun err*/
if (data[0] & RXERROR_OVERRUN) if (data[0] & RXERROR_OVERRUN) {
err = TTY_OVERRUN; tty_insert_flip_char(&port->port, 0,
else TTY_OVERRUN);
err = 0; }
for (i = 1; i < urb->actual_length ; ++i) for (i = 1; i < urb->actual_length ; ++i)
tty_insert_flip_char(&port->port, tty_insert_flip_char(&port->port,
data[i], err); data[i], TTY_NORMAL);
} else { } else {
/* some bytes had errors, every byte has status */ /* some bytes had errors, every byte has status */
dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__); dev_dbg(&port->dev, "%s - RX error!!!!\n", __func__);
for (i = 0; i + 1 < urb->actual_length; i += 2) { for (i = 0; i + 1 < urb->actual_length; i += 2) {
int stat = data[i], flag = 0; int stat = data[i];
if (stat & RXERROR_OVERRUN) int flag = TTY_NORMAL;
flag |= TTY_OVERRUN;
if (stat & RXERROR_FRAMING) if (stat & RXERROR_OVERRUN) {
flag |= TTY_FRAME; tty_insert_flip_char(
if (stat & RXERROR_PARITY) &port->port, 0,
flag |= TTY_PARITY; TTY_OVERRUN);
}
/* XXX should handle break (0x10) */ /* 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, tty_insert_flip_char(&port->port,
data[i+1], flag); data[i+1], flag);
} }
......
...@@ -490,10 +490,9 @@ static void ssu100_update_lsr(struct usb_serial_port *port, u8 lsr, ...@@ -490,10 +490,9 @@ static void ssu100_update_lsr(struct usb_serial_port *port, u8 lsr,
if (*tty_flag == TTY_NORMAL) if (*tty_flag == TTY_NORMAL)
*tty_flag = TTY_FRAME; *tty_flag = TTY_FRAME;
} }
if (lsr & UART_LSR_OE){ if (lsr & UART_LSR_OE) {
port->icount.overrun++; port->icount.overrun++;
if (*tty_flag == TTY_NORMAL) tty_insert_flip_char(&port->port, 0, TTY_OVERRUN);
*tty_flag = TTY_OVERRUN;
} }
} }
...@@ -511,12 +510,8 @@ static void ssu100_process_read_urb(struct urb *urb) ...@@ -511,12 +510,8 @@ static void ssu100_process_read_urb(struct urb *urb)
if ((len >= 4) && if ((len >= 4) &&
(packet[0] == 0x1b) && (packet[1] == 0x1b) && (packet[0] == 0x1b) && (packet[1] == 0x1b) &&
((packet[2] == 0x00) || (packet[2] == 0x01))) { ((packet[2] == 0x00) || (packet[2] == 0x01))) {
if (packet[2] == 0x00) { if (packet[2] == 0x00)
ssu100_update_lsr(port, packet[3], &flag); ssu100_update_lsr(port, packet[3], &flag);
if (flag == TTY_OVERRUN)
tty_insert_flip_char(&port->port, 0,
TTY_OVERRUN);
}
if (packet[2] == 0x01) if (packet[2] == 0x01)
ssu100_update_msr(port, packet[3]); ssu100_update_msr(port, packet[3]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment