X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Flinux%2Ftty_ldisc.h;h=83c6e6c10ebb57b52ed41742fcf6a0bd830668a6;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=c851b7dc997e83753c6db2bfa9ff610e99dcf65c;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index c851b7dc9..83c6e6c10 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h @@ -81,20 +81,19 @@ * 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 @@ -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