aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-05-09 18:21:59 -0400
committerRussell King <rmk@dyn-67.arm.linux.org.uk>2005-05-09 18:21:59 -0400
commit05ab3014636ff60a319d37cdf37dca594b015eec (patch)
treed9d948a5ecd5e10cd511ebca328df2ef08d5e076 /include/linux
parent88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff)
[PATCH] Serial: Add uart_insert_char()
Add uart_insert_char(), which handles inserting characters into the flip buffer. This helper function handles the correct semantics for handling overrun in addition to inserting normal characters. Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/serial_core.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index c3fb5984f250..d6025af7efac 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -479,6 +479,25 @@ uart_handle_cts_change(struct uart_port *port, unsigned int status)
479 } 479 }
480} 480}
481 481
482#include <linux/tty_flip.h>
483
484static inline void
485uart_insert_char(struct uart_port *port, unsigned int status,
486 unsigned int overrun, unsigned int ch, unsigned int flag)
487{
488 struct tty_struct *tty = port->info->tty;
489
490 if ((status & port->ignore_status_mask & ~overrun) == 0)
491 tty_insert_flip_char(tty, ch, flag);
492
493 /*
494 * Overrun is special. Since it's reported immediately,
495 * it doesn't affect the current character.
496 */
497 if (status & ~port->ignore_status_mask & overrun)
498 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
499}
500
482/* 501/*
483 * UART_ENABLE_MS - determine if port should enable modem status irqs 502 * UART_ENABLE_MS - determine if port should enable modem status irqs
484 */ 503 */