Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=adb5dca17dde297b685d57ec68fa0e5490feee8b Commit: adb5dca17dde297b685d57ec68fa0e5490feee8b Parent: 149b36eae2ab6aa6056664f4bc461f3d3affc9c1 Author: Alan Cox <[EMAIL PROTECTED]> AuthorDate: Thu Oct 18 01:24:17 2007 -0700 Committer: Greg Kroah-Hartman <[EMAIL PROTECTED]> CommitDate: Thu Oct 25 12:18:40 2007 -0700
USB: ark3116: update termios handling - Set the i/ospeed in the initial termios properly - Use the tty_encode_baud_rate functions to report resulting rates properly Signed-off-by: Alan Cox <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/usb/serial/ark3116.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c index 2a8e537..ddfee91 100644 --- a/drivers/usb/serial/ark3116.c +++ b/drivers/usb/serial/ark3116.c @@ -161,7 +161,8 @@ static void ark3116_set_termios(struct usb_serial_port *port, { struct usb_serial *serial = port->serial; struct ark3116_private *priv = usb_get_serial_port_data(port); - unsigned int cflag = port->tty->termios->c_cflag; + struct ktermios *termios = port->tty->termios; + unsigned int cflag = termios->c_cflag; unsigned long flags; int baud; int ark3116_baud; @@ -177,11 +178,14 @@ static void ark3116_set_termios(struct usb_serial_port *port, *(port->tty->termios) = tty_std_termios; port->tty->termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; + termios->c_ispeed = 9600; + termios->c_ospeed = 9600; priv->termios_initialized = 1; } spin_unlock_irqrestore(&priv->lock, flags); - cflag = port->tty->termios->c_cflag; + cflag = termios->c_cflag; + termios->c_cflag &= ~(CMSPAR|CRTSCTS); buf = kmalloc(1, GFP_KERNEL); if (!buf) { @@ -254,9 +258,13 @@ static void ark3116_set_termios(struct usb_serial_port *port, case 115200: case 230400: case 460800: + /* Report the resulting rate back to the caller */ + tty_encode_baud_rate(port->tty, baud, baud); break; /* set 9600 as default (if given baudrate is invalid for example) */ default: + tty_encode_baud_rate(port->tty, 9600, 9600); + case 0: baud = 9600; } @@ -302,6 +310,7 @@ static void ark3116_set_termios(struct usb_serial_port *port, /* TEST ARK3116_SND(154, 0xFE, 0x40, 0xFFFF, 0x0006); */ kfree(buf); + return; } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html