|
@@ -321,14 +321,19 @@ static void usa26_indat_callback(struct urb *urb)
|
|
/* 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;
|
|
|
|
- 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) */
|
|
/* 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 +654,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;
|
|
|
|
- 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) */
|
|
/* 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 +723,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)
|
|
|
|
- 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) */
|
|
/* 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;
|
|
@@ -784,14 +798,20 @@ static void usa90_indat_callback(struct urb *urb)
|
|
/* 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;
|
|
|
|
- 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) */
|
|
/* 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);
|
|
}
|
|
}
|