lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <46489BC2.6040403@sun.com>
Date:	Mon, 14 May 2007 10:26:26 -0700
From:	Yinghai Lu <Yinghai.Lu@....COM>
To:	Andrew Morton <akpm@...ux-foundation.org>, rmk@....linux.org.uk,
	Andi Kleen <ak@...e.de>, bjorn.helgaas@...com
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: [PATCH] serial: set RTS and DTR if flow is 'r'

[PATCH] serial: set RTS and DTR if flow is 'r'

if the serial console flow is set to 'r', We need to set RTS and DTR.
Some UARTs on other side need these bit set, otherwise will send char to or
receive char from the host that kernel is runing esp for kernel boot stage.

BTW:
earlyprintk and early_uart are hard coded to set DTR/RTS.

Signed-off-by: Yinghai Lu <yinghai.lu@....com>
Cc: Russell King <rmk@....linux.org.uk>
Cc: Andi Kleen <ak@...e.de>
Cc: Bjorn Helgaas <bjorn.helgaas@...com>

diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 48e259a..439a00a 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2154,6 +2154,16 @@ serial8250_set_termios(struct uart_port *port, 
struct ktermios *termios,
}
serial_outp(up, UART_FCR, fcr); /* set fcr */
}
+
+ /* if serial console flow is 'r', we need to set RTS and DTR to MCR.
+ * some uarts on other side don't support no flow control. So we state
+ * console=ttyS0,9600n8r in kernel command line to make those uart can
+ * work.
+ */
+ if (termios->c_cflag & CRTSCTS) {
+ up->port.mctrl |= TIOCM_RTS | TIOCM_DTR;
+ }
+
serial8250_set_mctrl(&up->port, up->port.mctrl);
spin_unlock_irqrestore(&up->port.lock, flags);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ