提交 c17ee886 编写于 作者: A Alan Cox 提交者: Linus Torvalds

tty-usb-console: Fix termios

Setting CFLAG bits is all well and good but you must sort out ispeed and
ospeed properly.
Signed-off-by: NAlan Cox <alan@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 4dbd5a09
......@@ -82,38 +82,10 @@ static int usb_console_setup(struct console *co, char *options)
doflow = (*s++ == 'r');
}
/* build a cflag setting */
switch (baud) {
case 1200:
cflag |= B1200;
break;
case 2400:
cflag |= B2400;
break;
case 4800:
cflag |= B4800;
break;
case 19200:
cflag |= B19200;
break;
case 38400:
cflag |= B38400;
break;
case 57600:
cflag |= B57600;
break;
case 115200:
cflag |= B115200;
break;
case 9600:
default:
cflag |= B9600;
/*
* Set this to a sane value to prevent a divide error
*/
/* Sane default */
if (baud == 0)
baud = 9600;
break;
}
switch (bits) {
case 7:
cflag |= CS7;
......@@ -188,6 +160,7 @@ static int usb_console_setup(struct console *co, char *options)
if (serial->type->set_termios) {
termios->c_cflag = cflag;
tty_termios_encode_baud_rate(termios, baud, baud);
serial->type->set_termios(NULL, port, &dummy);
port->port.tty = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册