Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / include / linux / tty_ldisc.h
index c851b7d..83c6e6c 100644 (file)
  *     pointer of flag bytes which indicate whether a character was
  *     received with a parity error, etc.
  * 
- * int (*receive_room)(struct tty_struct *);
- *
- *     This function is called by the low-level tty driver to
- *     determine how many characters the line discpline can accept.
- *     The low-level driver must not send more characters than was
- *     indicated by receive_room, or the line discpline may drop
- *     those characters.
- * 
  * void        (*write_wakeup)(struct tty_struct *);
  *
  *     This function is called by the low-level tty driver to signal
  *     that line discpline should try to send more characters to the
  *     low-level driver for transmission.  If the line discpline does
  *     not have any more data to send, it can just return.
+ *
+ * int (*hangup)(struct tty_struct *)
+ *
+ *     Called on a hangup. Tells the discipline that it should
+ *     cease I/O to the tty driver. Can sleep. The driver should
+ *     seek to perform this action quickly but should wait until
+ *     any pending driver I/O is completed.
  */
 
 #include <linux/fs.h>
@@ -114,7 +113,7 @@ struct tty_ldisc {
        void    (*flush_buffer)(struct tty_struct *tty);
        ssize_t (*chars_in_buffer)(struct tty_struct *tty);
        ssize_t (*read)(struct tty_struct * tty, struct file * file,
-                       unsigned char * buf, size_t nr);
+                       unsigned char __user * buf, size_t nr);
        ssize_t (*write)(struct tty_struct * tty, struct file * file,
                         const unsigned char * buf, size_t nr); 
        int     (*ioctl)(struct tty_struct * tty, struct file * file,
@@ -122,16 +121,18 @@ struct tty_ldisc {
        void    (*set_termios)(struct tty_struct *tty, struct termios * old);
        unsigned int (*poll)(struct tty_struct *, struct file *,
                             struct poll_table_struct *);
+       int     (*hangup)(struct tty_struct *tty);
        
        /*
         * The following routines are called from below.
         */
        void    (*receive_buf)(struct tty_struct *, const unsigned char *cp,
                               char *fp, int count);
-       int     (*receive_room)(struct tty_struct *);
        void    (*write_wakeup)(struct tty_struct *);
 
        struct  module *owner;
+       
+       int refcount;
 };
 
 #define TTY_LDISC_MAGIC        0x5403