Skip to content

Commit

Permalink
USB: symbolserial: log the ioctl commands
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Greg Kroah-Hartman committed Mar 24, 2009
1 parent 68b44ea commit 3d940b7
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions drivers/usb/serial/symbolserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,62 @@ static void symbol_unthrottle(struct tty_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;
Expand Down Expand Up @@ -311,6 +367,9 @@ static struct usb_serial_driver symbol_device = {
.shutdown = symbol_shutdown,
.throttle = symbol_throttle,
.unthrottle = symbol_unthrottle,
.ioctl = symbol_ioctl,
.tiocmget = symbol_tiocmget,
.tiocmset = symbol_tiocmset,
};

static int __init symbol_init(void)
Expand Down

0 comments on commit 3d940b7

Please sign in to comment.