2 * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
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 "chan_user.h"
15 #include "mconsole_kern.h"
37 struct list_head chan_list
;
40 /*This lock is actually, mostly, local to*/
43 /* Yes, this is a real circular buffer.
44 * XXX: And this should become a struct kfifo!
46 * buffer points to a buffer allocated on demand, of length
47 * LINE_BUFSIZE, head to the start of the ring, tail to the end.*/
53 struct work_struct task
;
54 struct line_driver
*driver
;
58 #define LINE_INIT(str, d) \
60 init_pri : INIT_STATIC, \
74 #define LINES_INIT(n) { num : n }
76 extern void line_close(struct tty_struct
*tty
, struct file
* filp
);
77 extern int line_open(struct line
*lines
, struct tty_struct
*tty
,
78 struct chan_opts
*opts
);
79 extern int line_setup(struct line
*lines
, unsigned int sizeof_lines
, char *init
,
81 extern int line_write(struct tty_struct
*tty
, const unsigned char *buf
, int len
);
82 extern void line_put_char(struct tty_struct
*tty
, unsigned char ch
);
83 extern void line_set_termios(struct tty_struct
*tty
, struct termios
* old
);
84 extern int line_chars_in_buffer(struct tty_struct
*tty
);
85 extern void line_flush_buffer(struct tty_struct
*tty
);
86 extern void line_flush_chars(struct tty_struct
*tty
);
87 extern int line_write_room(struct tty_struct
*tty
);
88 extern int line_ioctl(struct tty_struct
*tty
, struct file
* file
,
89 unsigned int cmd
, unsigned long arg
);
91 extern char *add_xterm_umid(char *base
);
92 extern int line_setup_irq(int fd
, int input
, int output
, struct tty_struct
*tty
);
93 extern void line_close_chan(struct line
*line
);
94 extern void line_disable(struct tty_struct
*tty
, int current_irq
);
95 extern struct tty_driver
* line_register_devfs(struct lines
*set
,
96 struct line_driver
*line_driver
,
97 struct tty_operations
*driver
,
100 extern void lines_init(struct line
*lines
, int nlines
);
101 extern void close_lines(struct line
*lines
, int nlines
);
103 extern int line_config(struct line
*lines
, unsigned int sizeof_lines
, char *str
);
104 extern int line_remove(struct line
*lines
, unsigned int sizeof_lines
, char *str
);
105 extern int line_get_config(char *dev
, struct line
*lines
, unsigned int sizeof_lines
, char *str
,
106 int size
, char **error_out
);