chan.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2000, 2001 Jeff Dike ([email protected])
  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 chan_enable_winch(struct chan *chan, struct tty_port *port);
  36. extern int enable_chan(struct line *line);
  37. extern void close_chan(struct line *line);
  38. extern int chan_window_size(struct line *line,
  39. unsigned short *rows_out,
  40. unsigned short *cols_out);
  41. extern int chan_config_string(struct line *line, char *str, int size,
  42. char **error_out);
  43. #endif