root/include/linux/tty_ldisc.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 #ifndef _LINUX_TTY_LDISC_H
   2 #define _LINUX_TTY_LDISC_H
   3 
   4 /*
   5  * Definitions for the tty line discipline
   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          * The following routines are called from above.
  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                          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          * The following routines are called from below.
  35          */
  36         void    (*receive_buf)(struct tty_struct *, 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 /* _LINUX_TTY_LDISC_H */

/* [previous][next][first][last][top][bottom][index][help] */