aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/line.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/drivers/line.h')
-rw-r--r--arch/um/drivers/line.h29
1 files changed, 11 insertions, 18 deletions
diff --git a/arch/um/drivers/line.h b/arch/um/drivers/line.h
index 63df3ca02ac2..0a1834719dba 100644
--- a/arch/um/drivers/line.h
+++ b/arch/um/drivers/line.h
@@ -15,7 +15,7 @@
15#include "chan_user.h" 15#include "chan_user.h"
16#include "mconsole_kern.h" 16#include "mconsole_kern.h"
17 17
18/* There's only one modifiable field in this - .mc.list */ 18/* There's only two modifiable fields in this - .mc.list and .driver */
19struct line_driver { 19struct line_driver {
20 const char *name; 20 const char *name;
21 const char *device_name; 21 const char *device_name;
@@ -28,17 +28,18 @@ struct line_driver {
28 const int write_irq; 28 const int write_irq;
29 const char *write_irq_name; 29 const char *write_irq_name;
30 struct mc_device mc; 30 struct mc_device mc;
31 struct tty_driver *driver;
31}; 32};
32 33
33struct line { 34struct line {
34 struct tty_struct *tty; 35 struct tty_struct *tty;
35 spinlock_t count_lock; 36 struct mutex count_lock;
36 unsigned long count; 37 unsigned long count;
37 int valid; 38 int valid;
38 39
39 char *init_str; 40 char *init_str;
40 int init_pri;
41 struct list_head chan_list; 41 struct list_head chan_list;
42 struct chan *chan_in, *chan_out;
42 43
43 /*This lock is actually, mostly, local to*/ 44 /*This lock is actually, mostly, local to*/
44 spinlock_t lock; 45 spinlock_t lock;
@@ -55,21 +56,12 @@ struct line {
55 int sigio; 56 int sigio;
56 struct delayed_work task; 57 struct delayed_work task;
57 const struct line_driver *driver; 58 const struct line_driver *driver;
58 int have_irq;
59}; 59};
60 60
61#define LINE_INIT(str, d) \
62 { .count_lock = __SPIN_LOCK_UNLOCKED((str).count_lock), \
63 .init_str = str, \
64 .init_pri = INIT_STATIC, \
65 .valid = 1, \
66 .lock = __SPIN_LOCK_UNLOCKED((str).lock), \
67 .driver = d }
68
69extern void line_close(struct tty_struct *tty, struct file * filp); 61extern void line_close(struct tty_struct *tty, struct file * filp);
70extern int line_open(struct line *lines, struct tty_struct *tty); 62extern int line_open(struct line *lines, struct tty_struct *tty);
71extern int line_setup(struct line *lines, unsigned int sizeof_lines, 63extern int line_setup(char **conf, unsigned nlines, char **def,
72 char *init, char **error_out); 64 char *init, char *name);
73extern int line_write(struct tty_struct *tty, const unsigned char *buf, 65extern int line_write(struct tty_struct *tty, const unsigned char *buf,
74 int len); 66 int len);
75extern int line_put_char(struct tty_struct *tty, unsigned char ch); 67extern int line_put_char(struct tty_struct *tty, unsigned char ch);
@@ -87,10 +79,11 @@ extern char *add_xterm_umid(char *base);
87extern int line_setup_irq(int fd, int input, int output, struct line *line, 79extern int line_setup_irq(int fd, int input, int output, struct line *line,
88 void *data); 80 void *data);
89extern void line_close_chan(struct line *line); 81extern void line_close_chan(struct line *line);
90extern struct tty_driver *register_lines(struct line_driver *line_driver, 82extern int register_lines(struct line_driver *line_driver,
91 const struct tty_operations *driver, 83 const struct tty_operations *driver,
92 struct line *lines, int nlines); 84 struct line *lines, int nlines);
93extern void lines_init(struct line *lines, int nlines, struct chan_opts *opts); 85extern int setup_one_line(struct line *lines, int n, char *init,
86 const struct chan_opts *opts, char **error_out);
94extern void close_lines(struct line *lines, int nlines); 87extern void close_lines(struct line *lines, int nlines);
95 88
96extern int line_config(struct line *lines, unsigned int sizeof_lines, 89extern int line_config(struct line *lines, unsigned int sizeof_lines,