]> Pileus Git - ~andy/linux/blob - arch/um/drivers/line.h
um: remove line_ioctl()
[~andy/linux] / arch / um / drivers / line.h
1 /* 
2  * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
3  * Licensed under the GPL
4  */
5
6 #ifndef __LINE_H__
7 #define __LINE_H__
8
9 #include "linux/list.h"
10 #include "linux/workqueue.h"
11 #include "linux/tty.h"
12 #include "linux/interrupt.h"
13 #include "linux/spinlock.h"
14 #include "linux/mutex.h"
15 #include "chan_user.h"
16 #include "mconsole_kern.h"
17
18 /* There's only two modifiable fields in this - .mc.list and .driver */
19 struct line_driver {
20         const char *name;
21         const char *device_name;
22         const short major;
23         const short minor_start;
24         const short type;
25         const short subtype;
26         const int read_irq;
27         const char *read_irq_name;
28         const int write_irq;
29         const char *write_irq_name;
30         struct mc_device mc;
31         struct tty_driver *driver;
32 };
33
34 struct line {
35         struct tty_port port;
36         struct mutex count_lock;
37         int valid;
38
39         char *init_str;
40         struct list_head chan_list;
41         struct chan *chan_in, *chan_out;
42
43         /*This lock is actually, mostly, local to*/
44         spinlock_t lock;
45         int throttled;
46         /* Yes, this is a real circular buffer.
47          * XXX: And this should become a struct kfifo!
48          *
49          * buffer points to a buffer allocated on demand, of length
50          * LINE_BUFSIZE, head to the start of the ring, tail to the end.*/
51         char *buffer;
52         char *head;
53         char *tail;
54
55         int sigio;
56         struct delayed_work task;
57         const struct line_driver *driver;
58 };
59
60 extern void line_close(struct tty_struct *tty, struct file * filp);
61 extern int line_open(struct line *lines, struct tty_struct *tty);
62 extern int line_setup(char **conf, unsigned nlines, char **def,
63                       char *init, char *name);
64 extern int line_write(struct tty_struct *tty, const unsigned char *buf,
65                       int len);
66 extern int line_put_char(struct tty_struct *tty, unsigned char ch);
67 extern void line_set_termios(struct tty_struct *tty, struct ktermios * old);
68 extern int line_chars_in_buffer(struct tty_struct *tty);
69 extern void line_flush_buffer(struct tty_struct *tty);
70 extern void line_flush_chars(struct tty_struct *tty);
71 extern int line_write_room(struct tty_struct *tty);
72 extern void line_throttle(struct tty_struct *tty);
73 extern void line_unthrottle(struct tty_struct *tty);
74
75 extern char *add_xterm_umid(char *base);
76 extern int line_setup_irq(int fd, int input, int output, struct line *line,
77                           void *data);
78 extern void line_close_chan(struct line *line);
79 extern int register_lines(struct line_driver *line_driver,
80                           const struct tty_operations *driver,
81                           struct line *lines, int nlines);
82 extern int setup_one_line(struct line *lines, int n, char *init,
83                           const struct chan_opts *opts, char **error_out);
84 extern void close_lines(struct line *lines, int nlines);
85
86 extern int line_config(struct line *lines, unsigned int sizeof_lines,
87                        char *str, const struct chan_opts *opts,
88                        char **error_out);
89 extern int line_id(char **str, int *start_out, int *end_out);
90 extern int line_remove(struct line *lines, unsigned int sizeof_lines, int n,
91                        char **error_out);
92 extern int line_get_config(char *dev, struct line *lines,
93                            unsigned int sizeof_lines, char *str,
94                            int size, char **error_out);
95
96 #endif