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_USER_H__ |
| 7 | #define __CHAN_USER_H__ |
| 8 | |
| 9 | #include "init.h" |
| 10 | |
| 11 | struct chan_opts { |
| 12 | void (*announce)(char *dev_name, int dev); |
| 13 | char *xterm_title; |
| 14 | int raw; |
| 15 | unsigned long tramp_stack; |
| 16 | int in_kernel; |
| 17 | }; |
| 18 | |
| 19 | enum chan_init_pri { INIT_STATIC, INIT_ALL, INIT_ONE }; |
| 20 | |
| 21 | struct chan_ops { |
| 22 | char *type; |
| 23 | void *(*init)(char *, int, struct chan_opts *); |
| 24 | int (*open)(int, int, int, void *, char **); |
| 25 | void (*close)(int, void *); |
| 26 | int (*read)(int, char *, void *); |
| 27 | int (*write)(int, const char *, int, void *); |
Paolo 'Blaisorblade' Giarrusso | 55c033c | 2005-11-13 16:07:11 -0800 | [diff] [blame] | 28 | int (*console_write)(int, const char *, int); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | int (*window_size)(int, void *, unsigned short *, unsigned short *); |
| 30 | void (*free)(void *); |
| 31 | int winch; |
| 32 | }; |
| 33 | |
| 34 | extern struct chan_ops fd_ops, null_ops, port_ops, pts_ops, pty_ops, tty_ops, |
| 35 | xterm_ops; |
| 36 | |
| 37 | extern void generic_close(int fd, void *unused); |
| 38 | extern int generic_read(int fd, char *c_out, void *unused); |
| 39 | extern int generic_write(int fd, const char *buf, int n, void *unused); |
Paolo 'Blaisorblade' Giarrusso | 55c033c | 2005-11-13 16:07:11 -0800 | [diff] [blame] | 40 | extern int generic_console_write(int fd, const char *buf, int n); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | extern int generic_window_size(int fd, void *unused, unsigned short *rows_out, |
| 42 | unsigned short *cols_out); |
| 43 | extern void generic_free(void *data); |
| 44 | |
| 45 | struct tty_struct; |
| 46 | extern void register_winch(int fd, struct tty_struct *tty); |
| 47 | extern void register_winch_irq(int fd, int tty_fd, int pid, struct tty_struct *tty); |
| 48 | |
| 49 | #define __channel_help(fn, prefix) \ |
| 50 | __uml_help(fn, prefix "[0-9]*=<channel description>\n" \ |
| 51 | " Attach a console or serial line to a host channel. See\n" \ |
| 52 | " http://user-mode-linux.sourceforge.net/input.html for a complete\n" \ |
| 53 | " description of this switch.\n\n" \ |
| 54 | ); |
| 55 | |
| 56 | #endif |
| 57 | |
| 58 | /* |
| 59 | * Overrides for Emacs so that we follow Linus's tabbing style. |
| 60 | * Emacs will notice this stuff at the end of the file and automatically |
| 61 | * adjust the settings for this buffer only. This must remain at the end |
| 62 | * of the file. |
| 63 | * --------------------------------------------------------------------------- |
| 64 | * Local variables: |
| 65 | * c-file-style: "linux" |
| 66 | * End: |
| 67 | */ |