From e4dcee8099802c71437a15b940f66106d9f88b2f Mon Sep 17 00:00:00 2001 From: Jeff Dike Date: Fri, 6 Jan 2006 00:18:58 -0800 Subject: [PATCH] uml: Add throttling to console driver This patch adds support for throttling and unthrottling input when the tty driver can't handle it. Signed-off-by: Jeff Dike Cc: Paolo 'Blaisorblade' Giarrusso Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/um/include/chan_kern.h | 2 ++ arch/um/include/line.h | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'arch/um/include') diff --git a/arch/um/include/chan_kern.h b/arch/um/include/chan_kern.h index 84d1f64f979..1bb5e9d9427 100644 --- a/arch/um/include/chan_kern.h +++ b/arch/um/include/chan_kern.h @@ -38,6 +38,8 @@ extern int console_write_chan(struct list_head *chans, const char *buf, int len); extern int console_open_chan(struct line *line, struct console *co, struct chan_opts *opts); +extern void deactivate_chan(struct list_head *chans, int irq); +extern void reactivate_chan(struct list_head *chans, int irq); extern void chan_enable_winch(struct list_head *chans, struct tty_struct *tty); extern void enable_chan(struct line *line); extern void close_chan(struct list_head *chans, int delay_free_irq); diff --git a/arch/um/include/line.h b/arch/um/include/line.h index e6cc3abfd4d..6f4d680dc1d 100644 --- a/arch/um/include/line.h +++ b/arch/um/include/line.h @@ -38,6 +38,7 @@ struct line { struct list_head chan_list; int valid; int count; + int throttled; /*This lock is actually, mostly, local to*/ spinlock_t lock; @@ -60,6 +61,7 @@ struct line { { init_str : str, \ init_pri : INIT_STATIC, \ valid : 1, \ + throttled : 0, \ lock : SPIN_LOCK_UNLOCKED, \ buffer : NULL, \ head : NULL, \ @@ -88,6 +90,8 @@ extern void line_flush_chars(struct tty_struct *tty); extern int line_write_room(struct tty_struct *tty); extern int line_ioctl(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg); +extern void line_throttle(struct tty_struct *tty); +extern void line_unthrottle(struct tty_struct *tty); extern char *add_xterm_umid(char *base); extern int line_setup_irq(int fd, int input, int output, struct line *line, -- cgit v1.2.3