ChangeSet 1.1451, 2004/06/14 16:19:17-07:00, Andrej.Filipcic@ijs.si [PATCH] USB: pl2303 & input overruns Backport the 2.6 fixes for handing overruns and other status reports from the device. drivers/usb/serial/pl2303.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) diff -Nru a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c --- a/drivers/usb/serial/pl2303.c Tue Jun 15 10:12:15 2004 +++ b/drivers/usb/serial/pl2303.c Tue Jun 15 10:12:15 2004 @@ -107,6 +107,7 @@ #define VENDOR_READ_REQUEST 0x01 #define UART_STATE 0x08 +#define UART_STATE_TRANSIENT_MASK 0x74 #define UART_DCD 0x01 #define UART_DSR 0x02 #define UART_BREAK_ERROR 0x04 @@ -681,6 +682,7 @@ struct pl2303_private *priv = usb_get_serial_port_data(port); unsigned char *data = urb->transfer_buffer; unsigned long flags; + u8 uart_state; dbg("%s (%d)", __FUNCTION__, port->number); @@ -711,8 +713,10 @@ return; /* Save off the uart status for others to look at */ + uart_state = data[UART_STATE]; spin_lock_irqsave(&priv->lock, flags); - priv->line_status = data[UART_STATE]; + uart_state |= (priv->line_status & UART_STATE_TRANSIENT_MASK); + priv->line_status = uart_state; spin_unlock_irqrestore(&priv->lock, flags); wake_up_interruptible (&priv->delta_msr_wait); @@ -770,7 +774,9 @@ spin_lock_irqsave(&priv->lock, flags); status = priv->line_status; + priv->line_status &= ~UART_STATE_TRANSIENT_MASK; spin_unlock_irqrestore(&priv->lock, flags); + wake_up_interruptible (&priv->delta_msr_wait); //AF from 2.6 /* break takes precedence over parity, */ /* which takes precedence over framing errors */