SERIAL: core: add hardware assisted h/w flow control support
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 17 Apr 2012 15:41:10 +0000 (16:41 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 4 Nov 2012 11:25:55 +0000 (11:25 +0000)
Ports which are handling h/w flow control in hardware must not have
their RTS state altered depending on the tty's hardware-stopped state.
Avoid this additional logic when setting the termios state.

Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/tty/serial/serial_core.c
include/linux/serial_core.h

index bd10bbd564467eaa5fc2743d77d3b67111c469c6..9d8796e7718830cc6c1bc64b7db67171a0121692 100644 (file)
@@ -1255,6 +1255,13 @@ static void uart_set_termios(struct tty_struct *tty,
                uart_set_mctrl(uport, mask);
        }
 
+       /*
+        * If the port is doing h/w assisted flow control, do nothing.
+        * We assume that tty->hw_stopped has never been set.
+        */
+       if (uport->flags & UPF_HARD_FLOW)
+               return;
+
        /* Handle turning off CRTSCTS */
        if ((old_termios->c_cflag & CRTSCTS) && !(cflag & CRTSCTS)) {
                spin_lock_irqsave(&uport->lock, flags);
index 00051388de3c5e10f216165a3284300e3d082767..e2cda5d04e480452c28097f1e577d1c321f13f66 100644 (file)
@@ -163,6 +163,8 @@ struct uart_port {
 #define UPF_BUGGY_UART         ((__force upf_t) (1 << 14))
 #define UPF_NO_TXEN_TEST       ((__force upf_t) (1 << 15))
 #define UPF_MAGIC_MULTIPLIER   ((__force upf_t) (1 << 16))
+/* Port has hardware-assisted h/w flow control (iow, auto-RTS *not* auto-CTS) */
+#define UPF_HARD_FLOW          ((__force upf_t) (1 << 21))
 /* Port has hardware-assisted s/w flow control */
 #define UPF_SOFT_FLOW          ((__force upf_t) (1 << 22))
 #define UPF_CONS_FLOW          ((__force upf_t) (1 << 23))
This page took 0.044801 seconds and 5 git commands to generate.