On 07/09/2005 10:13, Peter Favrholdt wrote:
I'm using a 2 port USB RS232 dongle to connect to a serial-IR cradle for a bar code reader). Detecting the baudrate of the serial-IR involves keeping DTR low while changing baudrate.

This works using normal 16550A serial ports as well as the FTDI driver version 1.4.0 (Linux 2.6.8) but stopped working with the change to "ensure RTS and DTR are raised when changing baudrate" introduced in version 1.4.1 (Linux 2.6.9).

The attached patch fixes this, so RTS and DTR is only raised when changing baudrate iff the previous baudrate was B0.

Signed-off-by: Peter Favrholdt <[EMAIL PROTECTED]>

Greg, this patch looks fine to me. The "standard" serial driver (serial_core, etc.) also only raises RTS and DTR iff the previous baudrate was B0 (but with additional flow control checks in the case of RTS that don't apply to ftdi_sio as that handles CRTSCTS in hardware).

I'd be prepared to sign it off. Ignore this signature if you think it's irrelevant!

Signed-off-by: Ian Abbott <[EMAIL PROTECTED]>

------------------------------------------------------------------------

--- linux-2.6.13/drivers/usb/serial/ftdi_sio.c  2005-08-29 01:41:01.000000000 
+0200
+++ linux-2.6.13_ftdi_new/drivers/usb/serial/ftdi_sio.c 2005-09-06 
07:37:43.000000000 +0200
@@ -1806,10 +1806,12 @@
        } else {
                /* set the baudrate determined before */
                if (change_speed(port)) {
-                       err("%s urb failed to set baurdrate", __FUNCTION__);
+                       err("%s urb failed to set baudrate", __FUNCTION__);
+               }
+               /* Ensure RTS and DTR are raised when baudrate changed from 0 */
+               if ((old_termios->c_cflag & CBAUD) == B0) {
+                       set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
                }
-               /* Ensure  RTS and DTR are raised */
-               set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
        }
/* Set flow control */



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to