diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2018-03-26 23:48:24 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-04-23 04:16:50 -0400 |
commit | c5f78b1fe4e5baf4c4ca30377c2d7e06e2e391ec (patch) | |
tree | 7aa24241fd71460d638053895d3585660e10881e | |
parent | d6810a82c7c7e3b262db5e9e67f6bd81b41f3840 (diff) |
serial: Introduce UPSTAT_SYNC_FIFO for synchronised FIFOs
This change adds a flag to indicate that a UART is has an external means
of synchronising its FIFO, without needing CTSRTS or XON/XOFF.
This allows us to use the throttle/unthrottle callbacks, without having
to claim other methods of flow control.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Tested-by: Eddie James <eajames@linux.vnet.ibm.com>
Tested-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/serial_core.c | 4 | ||||
-rw-r--r-- | include/linux/serial_core.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 0466f9f08a91..c47158c93202 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c | |||
@@ -674,8 +674,8 @@ static void uart_send_xchar(struct tty_struct *tty, char ch) | |||
674 | static void uart_throttle(struct tty_struct *tty) | 674 | static void uart_throttle(struct tty_struct *tty) |
675 | { | 675 | { |
676 | struct uart_state *state = tty->driver_data; | 676 | struct uart_state *state = tty->driver_data; |
677 | upstat_t mask = UPSTAT_SYNC_FIFO; | ||
677 | struct uart_port *port; | 678 | struct uart_port *port; |
678 | upstat_t mask = 0; | ||
679 | 679 | ||
680 | port = uart_port_ref(state); | 680 | port = uart_port_ref(state); |
681 | if (!port) | 681 | if (!port) |
@@ -703,8 +703,8 @@ static void uart_throttle(struct tty_struct *tty) | |||
703 | static void uart_unthrottle(struct tty_struct *tty) | 703 | static void uart_unthrottle(struct tty_struct *tty) |
704 | { | 704 | { |
705 | struct uart_state *state = tty->driver_data; | 705 | struct uart_state *state = tty->driver_data; |
706 | upstat_t mask = UPSTAT_SYNC_FIFO; | ||
706 | struct uart_port *port; | 707 | struct uart_port *port; |
707 | upstat_t mask = 0; | ||
708 | 708 | ||
709 | port = uart_port_ref(state); | 709 | port = uart_port_ref(state); |
710 | if (!port) | 710 | if (!port) |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 1d356105f25a..d224961e1346 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -233,6 +233,7 @@ struct uart_port { | |||
233 | #define UPSTAT_AUTORTS ((__force upstat_t) (1 << 2)) | 233 | #define UPSTAT_AUTORTS ((__force upstat_t) (1 << 2)) |
234 | #define UPSTAT_AUTOCTS ((__force upstat_t) (1 << 3)) | 234 | #define UPSTAT_AUTOCTS ((__force upstat_t) (1 << 3)) |
235 | #define UPSTAT_AUTOXOFF ((__force upstat_t) (1 << 4)) | 235 | #define UPSTAT_AUTOXOFF ((__force upstat_t) (1 << 4)) |
236 | #define UPSTAT_SYNC_FIFO ((__force upstat_t) (1 << 5)) | ||
236 | 237 | ||
237 | int hw_stopped; /* sw-assisted CTS flow state */ | 238 | int hw_stopped; /* sw-assisted CTS flow state */ |
238 | unsigned int mctrl; /* current modem ctrl settings */ | 239 | unsigned int mctrl; /* current modem ctrl settings */ |