Skip to content

Commit c5f78b1

Browse files
jk-ozlabsgregkh
authored andcommitted
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>
1 parent d6810a8 commit c5f78b1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

drivers/tty/serial/serial_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,8 +674,8 @@ static void uart_send_xchar(struct tty_struct *tty, char ch)
674674
static void uart_throttle(struct tty_struct *tty)
675675
{
676676
struct uart_state *state = tty->driver_data;
677+
upstat_t mask = UPSTAT_SYNC_FIFO;
677678
struct uart_port *port;
678-
upstat_t mask = 0;
679679

680680
port = uart_port_ref(state);
681681
if (!port)
@@ -703,8 +703,8 @@ static void uart_throttle(struct tty_struct *tty)
703703
static void uart_unthrottle(struct tty_struct *tty)
704704
{
705705
struct uart_state *state = tty->driver_data;
706+
upstat_t mask = UPSTAT_SYNC_FIFO;
706707
struct uart_port *port;
707-
upstat_t mask = 0;
708708

709709
port = uart_port_ref(state);
710710
if (!port)

include/linux/serial_core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ struct uart_port {
233233
#define UPSTAT_AUTORTS ((__force upstat_t) (1 << 2))
234234
#define UPSTAT_AUTOCTS ((__force upstat_t) (1 << 3))
235235
#define UPSTAT_AUTOXOFF ((__force upstat_t) (1 << 4))
236+
#define UPSTAT_SYNC_FIFO ((__force upstat_t) (1 << 5))
236237

237238
int hw_stopped; /* sw-assisted CTS flow state */
238239
unsigned int mctrl; /* current modem ctrl settings */

0 commit comments

Comments
 (0)