aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2013-03-21 07:36:51 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-25 16:50:50 -0400
commit143d9d961608b737d90a813deaaf91affb41c83c (patch)
tree5ee70e765be90948e9a6afb6f346e15326eb676d
parent5cb27dde2e8b7bcbdce6de270c73c021a65caff8 (diff)
USB: serial: add tiocmiwait subdriver operation
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>
-rw-r--r--drivers/usb/serial/usb-serial.c15
-rw-r--r--include/linux/usb/serial.h1
2 files changed, 12 insertions, 4 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 0b39d013c505..ada400d6594b 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -402,10 +402,17 @@ static int serial_ioctl(struct tty_struct *tty,
402 402
403 dev_dbg(tty->dev, "%s - cmd 0x%.4x\n", __func__, cmd); 403 dev_dbg(tty->dev, "%s - cmd 0x%.4x\n", __func__, cmd);
404 404
405 if (port->serial->type->ioctl) 405 switch (cmd) {
406 retval = port->serial->type->ioctl(tty, cmd, arg); 406 case TIOCMIWAIT:
407 else 407 if (port->serial->type->tiocmiwait)
408 retval = -ENOIOCTLCMD; 408 retval = port->serial->type->tiocmiwait(tty, arg);
409 break;
410 default:
411 if (port->serial->type->ioctl)
412 retval = port->serial->type->ioctl(tty, cmd, arg);
413 else
414 retval = -ENOIOCTLCMD;
415 }
409 416
410 return retval; 417 return retval;
411} 418}
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 3f8f5e3c76d5..9c8b53f80f48 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -272,6 +272,7 @@ struct usb_serial_driver {
272 int (*tiocmget)(struct tty_struct *tty); 272 int (*tiocmget)(struct tty_struct *tty);
273 int (*tiocmset)(struct tty_struct *tty, 273 int (*tiocmset)(struct tty_struct *tty,
274 unsigned int set, unsigned int clear); 274 unsigned int set, unsigned int clear);
275 int (*tiocmiwait)(struct tty_struct *tty, unsigned long arg);
275 int (*get_icount)(struct tty_struct *tty, 276 int (*get_icount)(struct tty_struct *tty,
276 struct serial_icounter_struct *icount); 277 struct serial_icounter_struct *icount);
277 /* Called by the tty layer for port level work. There may or may not 278 /* Called by the tty layer for port level work. There may or may not