chan.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com)
  3. * Licensed under the GPL
  4. */
  5. #ifndef __CHAN_KERN_H__
  6. #define __CHAN_KERN_H__
  7. #include <linux/tty.h>
  8. #include <linux/list.h>
  9. #include <linux/console.h>
  10. #include "chan_user.h"
  11. #include "line.h"
  12. struct chan {
  13. struct list_head list;
  14. struct list_head free_list;
  15. struct line *line;
  16. char *dev;
  17. unsigned int primary:1;
  18. unsigned int input:1;
  19. unsigned int output:1;
  20. unsigned int opened:1;
  21. unsigned int enabled:1;
  22. int fd;
  23. const struct chan_ops *ops;
  24. void *data;
  25. };
  26. extern void chan_interrupt(struct line *line, int irq);
  27. extern int parse_chan_pair(char *str, struct line *line, int device,
  28. const struct chan_opts *opts, char **error_out);
  29. extern int write_chan(struct chan *chan, const char *buf, int len,
  30. int write_irq);
  31. extern int console_write_chan(struct chan *chan, const char *buf,
  32. int len);
  33. extern int console_open_chan(struct line *line, struct console *co);
  34. extern void deactivate_chan(struct chan *chan, int irq);
  35. extern void reactivate_chan(struct chan *chan, int irq);
  36. extern void chan_enable_winch(struct chan *chan, struct tty_port *port);
  37. extern int enable_chan(struct line *line);
  38. extern void close_chan(struct line *line);
  39. extern int chan_window_size(struct line *line,
  40. unsigned short *rows_out,
  41. unsigned short *cols_out);
  42. extern int chan_config_string(struct line *line, char *str, int size,
  43. char **error_out);
  44. #endif