aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/tty.h4
-rw-r--r--include/linux/tty_flip.h8
2 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 38fcc0574ba9..ad98b4376968 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -39,10 +39,14 @@ struct tty_buffer {
39 int size; 39 int size;
40 int commit; 40 int commit;
41 int read; 41 int read;
42 int flags;
42 /* Data points here */ 43 /* Data points here */
43 unsigned long data[0]; 44 unsigned long data[0];
44}; 45};
45 46
47/* Values for .flags field of tty_buffer */
48#define TTYB_NORMAL 1 /* buffer has no flags buffer */
49
46static inline unsigned char *char_buf_ptr(struct tty_buffer *b, int ofs) 50static inline unsigned char *char_buf_ptr(struct tty_buffer *b, int ofs)
47{ 51{
48 return ((unsigned char *)b->data) + ofs; 52 return ((unsigned char *)b->data) + ofs;
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index 3f821e98af0f..c28dd523f96e 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -17,8 +17,12 @@ static inline int tty_insert_flip_char(struct tty_port *port,
17 unsigned char ch, char flag) 17 unsigned char ch, char flag)
18{ 18{
19 struct tty_buffer *tb = port->buf.tail; 19 struct tty_buffer *tb = port->buf.tail;
20 if (tb && tb->used < tb->size) { 20 int change;
21 *flag_buf_ptr(tb, tb->used) = flag; 21
22 change = (tb->flags & TTYB_NORMAL) && (flag != TTY_NORMAL);
23 if (!change && tb->used < tb->size) {
24 if (~tb->flags & TTYB_NORMAL)
25 *flag_buf_ptr(tb, tb->used) = flag;
22 *char_buf_ptr(tb, tb->used++) = ch; 26 *char_buf_ptr(tb, tb->used++) = ch;
23 return 1; 27 return 1;
24 } 28 }