1 #ifndef _LINUX_TTY_LDISC_H
2 #define _LINUX_TTY_LDISC_H
3
4
5
6
7
8 #include <linux/fs.h>
9 #include <linux/wait.h>
10
11 struct tty_ldisc {
12 int magic;
13 int num;
14 int flags;
15
16
17
18 int (*open)(struct tty_struct *);
19 void (*close)(struct tty_struct *);
20 void (*flush_buffer)(struct tty_struct *tty);
21 int (*chars_in_buffer)(struct tty_struct *tty);
22 int (*read)(struct tty_struct * tty, struct file * file,
23 unsigned char * buf, unsigned int nr);
24 int (*write)(struct tty_struct * tty, struct file * file,
25 const unsigned char * buf, unsigned int nr);
26 int (*ioctl)(struct tty_struct * tty, struct file * file,
27 unsigned int cmd, unsigned long arg);
28 void (*set_termios)(struct tty_struct *tty, struct termios * old);
29 int (*select)(struct tty_struct * tty, struct inode * inode,
30 struct file * file, int sel_type,
31 struct select_table_struct *wait);
32
33
34
35
36 void (*receive_buf)(struct tty_struct *, const unsigned char *cp,
37 char *fp, int count);
38 int (*receive_room)(struct tty_struct *);
39 void (*write_wakeup)(struct tty_struct *);
40 };
41
42 #define TTY_LDISC_MAGIC 0x5403
43
44 #define LDISC_FLAG_DEFINED 0x00000001
45
46 #endif