USB: serial: add tiocmiwait subdriver operation
authorJohan Hovold <jhovold@gmail.com>
Thu, 21 Mar 2013 11:36:51 +0000 (12:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Mar 2013 20:50:50 +0000 (13:50 -0700)
Add tiocmiwait operation to struct usb_serial_driver.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/usb-serial.c
include/linux/usb/serial.h

index 0b39d013c505eb93209f6b45de10387b81daa118..ada400d6594b2d5a96578621ad53704a4bc7946a 100644 (file)
@@ -402,10 +402,17 @@ static int serial_ioctl(struct tty_struct *tty,
 
        dev_dbg(tty->dev, "%s - cmd 0x%.4x\n", __func__, cmd);
 
-       if (port->serial->type->ioctl)
-               retval = port->serial->type->ioctl(tty, cmd, arg);
-       else
-               retval = -ENOIOCTLCMD;
+       switch (cmd) {
+       case TIOCMIWAIT:
+               if (port->serial->type->tiocmiwait)
+                       retval = port->serial->type->tiocmiwait(tty, arg);
+               break;
+       default:
+               if (port->serial->type->ioctl)
+                       retval = port->serial->type->ioctl(tty, cmd, arg);
+               else
+                       retval = -ENOIOCTLCMD;
+       }
 
        return retval;
 }
index 3f8f5e3c76d5c28a27a232aa6ce68d1fc9c5027c..9c8b53f80f4814476ae1c11d5c8404f8b74291bb 100644 (file)
@@ -272,6 +272,7 @@ struct usb_serial_driver {
        int  (*tiocmget)(struct tty_struct *tty);
        int  (*tiocmset)(struct tty_struct *tty,
                         unsigned int set, unsigned int clear);
+       int  (*tiocmiwait)(struct tty_struct *tty, unsigned long arg);
        int  (*get_icount)(struct tty_struct *tty,
                        struct serial_icounter_struct *icount);
        /* Called by the tty layer for port level work. There may or may not