Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com) |
| 3 | * Licensed under the GPL |
| 4 | */ |
| 5 | |
| 6 | #ifndef __CHAN_KERN_H__ |
| 7 | #define __CHAN_KERN_H__ |
| 8 | |
Al Viro | 510c72a3 | 2011-08-18 20:08:29 +0100 | [diff] [blame] | 9 | #include <linux/tty.h> |
| 10 | #include <linux/list.h> |
| 11 | #include <linux/console.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | #include "chan_user.h" |
| 13 | #include "line.h" |
| 14 | |
| 15 | struct chan { |
| 16 | struct list_head list; |
Jeff Dike | 165dc59 | 2006-01-06 00:18:57 -0800 | [diff] [blame] | 17 | struct list_head free_list; |
| 18 | struct line *line; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | char *dev; |
| 20 | unsigned int primary:1; |
| 21 | unsigned int input:1; |
| 22 | unsigned int output:1; |
| 23 | unsigned int opened:1; |
Jeff Dike | 165dc59 | 2006-01-06 00:18:57 -0800 | [diff] [blame] | 24 | unsigned int enabled:1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | int fd; |
Jeff Dike | 5e7672e | 2006-09-27 01:50:33 -0700 | [diff] [blame] | 26 | const struct chan_ops *ops; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | void *data; |
| 28 | }; |
| 29 | |
Jiri Slaby | 2e124b4 | 2013-01-03 15:53:06 +0100 | [diff] [blame] | 30 | extern void chan_interrupt(struct line *line, int irq); |
Jeff Dike | 165dc59 | 2006-01-06 00:18:57 -0800 | [diff] [blame] | 31 | extern int parse_chan_pair(char *str, struct line *line, int device, |
Jeff Dike | f28169d | 2007-02-10 01:43:53 -0800 | [diff] [blame] | 32 | const struct chan_opts *opts, char **error_out); |
Al Viro | bed5e39 | 2011-09-08 10:49:34 -0400 | [diff] [blame] | 33 | extern int write_chan(struct chan *chan, const char *buf, int len, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | int write_irq); |
Al Viro | bed5e39 | 2011-09-08 10:49:34 -0400 | [diff] [blame] | 35 | extern int console_write_chan(struct chan *chan, const char *buf, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | int len); |
Jeff Dike | a52f362 | 2007-02-10 01:44:06 -0800 | [diff] [blame] | 37 | extern int console_open_chan(struct line *line, struct console *co); |
Al Viro | bed5e39 | 2011-09-08 10:49:34 -0400 | [diff] [blame] | 38 | extern void deactivate_chan(struct chan *chan, int irq); |
| 39 | extern void reactivate_chan(struct chan *chan, int irq); |
Richard Weinberger | 2116bda | 2013-03-11 10:05:45 +0100 | [diff] [blame] | 40 | extern void chan_enable_winch(struct chan *chan, struct tty_port *port); |
Jeff Dike | d14ad81 | 2007-07-15 23:38:54 -0700 | [diff] [blame] | 41 | extern int enable_chan(struct line *line); |
Al Viro | 10c890c0 | 2011-09-10 08:39:18 -0400 | [diff] [blame] | 42 | extern void close_chan(struct line *line); |
Al Viro | bed5e39 | 2011-09-08 10:49:34 -0400 | [diff] [blame] | 43 | extern int chan_window_size(struct line *line, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | unsigned short *rows_out, |
| 45 | unsigned short *cols_out); |
Al Viro | bed5e39 | 2011-09-08 10:49:34 -0400 | [diff] [blame] | 46 | extern int chan_config_string(struct line *line, char *str, int size, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | char **error_out); |
| 48 | |
| 49 | #endif |