On Sat, May 22, 2004 at 01:56:40PM +1000, Ben Low wrote:
> Hello All,
>
> I'm using seven ATEN UC-232A USB-serial adapters on a 2.4.26 kernel and
> have found that data read from any of these devices it littered with
> NULs. For example, here's a sample from a Cisco router's boot sequence:
>
> # cat /dev/usb/tts/1 > /tmp/o
> # vi /tmp/o
> [EMAIL PROTECTED]
> System Bootstrap, Version 12.1(3r)T2, RELEASE SOFTWARE (fc1)^M
> [EMAIL PROTECTED] (c) 2000 by cisco Systems, Inc.^M
> C2600 platform with [EMAIL PROTECTED] Kbytes of main memory
> ^M
> ^Mprogram load complete, entry point^@: 0x80008000, size: 0x8f6510
> ^MSelf decompressing the image :
> [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL
> PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL
> PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]
> [EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@#^@
>
> None of those NULs were sent by the router.
>
> Is this a known issue? (list archive doesn't seem to indicate so)
Yes it is, it's because some pl2303 devices do not clear their status
bits if an overrun or some other error occurs. Can you try the
following patch from Andrej Filipcic that backports the fix in 2.6 to
2.4 and let me know if that solves it or not?
thanks,
greg k-h
--- /usr/src/linux-2.4/drivers/usb/serial/pl2303.c 2004-04-14 15:05:35.000000000
+0200
+++ pl2303.c.24 2004-05-19 22:47:04.000000000 +0200
@@ -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
@@ -678,6 +679,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);
@@ -708,8 +710,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);
@@ -767,7 +771,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 */
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel