Add tiocmiwait operation to struct usb_serial_driver.
Signed-off-by: Johan Hovold <[email protected]>
---
drivers/usb/serial/usb-serial.c | 15 +++++++++++----
include/linux/usb/serial.h | 1 +
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index c481a80..c17becb 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -406,10 +406,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;
}
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index d7f6b59..8cb74c0 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -270,6 +270,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
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html