]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/tty_driver.h
tty: shutdown method
[linux-2.6-omap-h63xx.git] / include / linux / tty_driver.h
index e1065ac0d9226c1217dfd142792e3e03f9944d40..2322313a8589d614c84275d020f0ad1a33d9ad41 100644 (file)
  *
  *     Required method.
  *
+ * void (*shutdown)(struct tty_struct * tty);
+ *
+ *     This routine is called when a particular tty device is closed for
+ *     the last time freeing up the resources.
+ *
  * int (*write)(struct tty_struct * tty,
  *              const unsigned char *buf, int count);
  *
  *
  *     Optional: If not provided then the write method is called under
  *     the atomic write lock to keep it serialized with the ldisc.
+ *
+ * int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty,
+ *                             unsigned int rows, unsigned int cols);
+ *
+ *     Called when a termios request is issued which changes the
+ *     requested terminal geometry.
+ *
+ *     Optional: the default action is to update the termios structure
+ *     without error. This is usually the correct behaviour. Drivers should
+ *     not force errors here if they are not resizable objects (eg a serial
+ *     line). See tty_do_resize() if you need to wrap the standard method
+ *     in your own logic - the usual case.
+ *
+ * void (*set_termiox)(struct tty_struct *tty, struct termiox *new);
+ *
+ *     Called when the device receives a termiox based ioctl. Passes down
+ *     the requested data from user space. This method will not be invoked
+ *     unless the tty also has a valid tty->termiox pointer.
+ *
+ *     Optional: Called under the termios lock
  */
 
 #include <linux/fs.h>
@@ -180,6 +205,7 @@ struct tty_driver;
 struct tty_operations {
        int  (*open)(struct tty_struct * tty, struct file * filp);
        void (*close)(struct tty_struct * tty, struct file * filp);
+       void (*shutdown)(struct tty_struct *tty);
        int  (*write)(struct tty_struct * tty,
                      const unsigned char *buf, int count);
        int  (*put_char)(struct tty_struct *tty, unsigned char ch);
@@ -206,6 +232,9 @@ struct tty_operations {
        int (*tiocmget)(struct tty_struct *tty, struct file *file);
        int (*tiocmset)(struct tty_struct *tty, struct file *file,
                        unsigned int set, unsigned int clear);
+       int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty,
+                               struct winsize *ws);
+       int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew);
 #ifdef CONFIG_CONSOLE_POLL
        int (*poll_init)(struct tty_driver *driver, int line, char *options);
        int (*poll_get_char)(struct tty_driver *driver, int line);