aboutsummaryrefslogtreecommitdiffstats
path: root/usb
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2009-03-20 20:38:35 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2009-03-20 20:38:35 -0700
commit55beb9c578708d8190c09d866cbd94e29741ff32 (patch)
tree4022644259ae176432bcb50135659d7438f5c398 /usb
parent97f7b41f413dda4a877e524a47d718d7b13fafe6 (diff)
downloadpatches-55beb9c578708d8190c09d866cbd94e29741ff32.tar.gz
symbol ioctl patch
Diffstat (limited to 'usb')
-rw-r--r--usb/usb-symbolserial-log-the-ioctl-commands.patch90
1 files changed, 90 insertions, 0 deletions
diff --git a/usb/usb-symbolserial-log-the-ioctl-commands.patch b/usb/usb-symbolserial-log-the-ioctl-commands.patch
new file mode 100644
index 00000000000000..af0717dfcefbc6
--- /dev/null
+++ b/usb/usb-symbolserial-log-the-ioctl-commands.patch
@@ -0,0 +1,90 @@
+From foo@baz Fri Mar 20 20:26:30 PDT 2009
+Date: Fri, 20 Mar 2009 20:26:30 -0700
+To: Greg KH <greg@kroah.com>
+From: Greg Kroah-Hartman <gregkh@suse.de>
+Subject: USB: symbolserial: log the ioctl commands
+
+We need to figure out what userspace programs are expecting from this
+driver, so log them so we can try to get it right.
+
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/serial/symbolserial.c | 59 ++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 59 insertions(+)
+
+--- a/drivers/usb/serial/symbolserial.c
++++ b/drivers/usb/serial/symbolserial.c
+@@ -205,6 +205,62 @@ static void symbol_unthrottle(struct tty
+ __func__, result);
+ }
+
++static int symbol_ioctl(struct tty_struct *tty, struct file *file,
++ unsigned int cmd, unsigned long arg)
++{
++ struct usb_serial_port *port = tty->driver_data;
++ struct device *dev = &port->dev;
++
++ /*
++ * Right now we need to figure out what commands
++ * most userspace tools want to see for this driver,
++ * so just log the things.
++ */
++ switch (cmd) {
++ case TIOCSERGETLSR:
++ dev_info(dev, "%s: TIOCSERGETLSR\n", __func__);
++ break;
++
++ case TIOCGSERIAL:
++ dev_info(dev, "%s: TIOCGSERIAL\n", __func__);
++ break;
++
++ case TIOCMIWAIT:
++ dev_info(dev, "%s: TIOCMIWAIT\n", __func__);
++ break;
++
++ case TIOCGICOUNT:
++ dev_info(dev, "%s: TIOCGICOUNT\n", __func__);
++ break;
++ default:
++ dev_info(dev, "%s: unknown (%d)\n", __func__, cmd);
++ }
++ return -ENOIOCTLCMD;
++}
++
++static int symbol_tiocmget(struct tty_struct *tty, struct file *file)
++{
++ struct usb_serial_port *port = tty->driver_data;
++ struct device *dev = &port->dev;
++
++ /* TODO */
++ /* probably just need to shadow whatever was sent to us here */
++ dev_info(dev, "%s\n", __func__);
++ return 0;
++}
++
++static int symbol_tiocmset(struct tty_struct *tty, struct file *file,
++ unsigned int set, unsigned int clear)
++{
++ struct usb_serial_port *port = tty->driver_data;
++ struct device *dev = &port->dev;
++
++ /* TODO */
++ /* probably just need to shadow whatever was sent to us here */
++ dev_info(dev, "%s\n", __func__);
++ return 0;
++}
++
+ static int symbol_startup(struct usb_serial *serial)
+ {
+ struct symbol_private *priv;
+@@ -311,6 +367,9 @@ static struct usb_serial_driver symbol_d
+ .shutdown = symbol_shutdown,
+ .throttle = symbol_throttle,
+ .unthrottle = symbol_unthrottle,
++ .ioctl = symbol_ioctl,
++ .tiocmget = symbol_tiocmget,
++ .tiocmset = symbol_tiocmset,
+ };
+
+ static int __init symbol_init(void)