chan_user.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com)
  3. * Licensed under the GPL
  4. */
  5. #ifndef __CHAN_USER_H__
  6. #define __CHAN_USER_H__
  7. #include <init.h>
  8. struct chan_opts {
  9. void (*const announce)(char *dev_name, int dev);
  10. char *xterm_title;
  11. const int raw;
  12. };
  13. struct chan_ops {
  14. char *type;
  15. void *(*init)(char *, int, const struct chan_opts *);
  16. int (*open)(int, int, int, void *, char **);
  17. void (*close)(int, void *);
  18. int (*read)(int, char *, void *);
  19. int (*write)(int, const char *, int, void *);
  20. int (*console_write)(int, const char *, int);
  21. int (*window_size)(int, void *, unsigned short *, unsigned short *);
  22. void (*free)(void *);
  23. int winch;
  24. };
  25. extern const struct chan_ops fd_ops, null_ops, port_ops, pts_ops, pty_ops,
  26. tty_ops, xterm_ops;
  27. extern void generic_close(int fd, void *unused);
  28. extern int generic_read(int fd, char *c_out, void *unused);
  29. extern int generic_write(int fd, const char *buf, int n, void *unused);
  30. extern int generic_console_write(int fd, const char *buf, int n);
  31. extern int generic_window_size(int fd, void *unused, unsigned short *rows_out,
  32. unsigned short *cols_out);
  33. extern void generic_free(void *data);
  34. struct tty_port;
  35. extern void register_winch(int fd, struct tty_port *port);
  36. extern void register_winch_irq(int fd, int tty_fd, int pid,
  37. struct tty_port *port, unsigned long stack);
  38. #define __channel_help(fn, prefix) \
  39. __uml_help(fn, prefix "[0-9]*=<channel description>\n" \
  40. " Attach a console or serial line to a host channel. See\n" \
  41. " http://user-mode-linux.sourceforge.net/old/input.html for a complete\n" \
  42. " description of this switch.\n\n" \
  43. );
  44. #endif