aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohn Tsiombikas <nuclear@member.fsf.org>2010-02-25 10:09:08 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 17:55:17 -0500
commit67b9946dd07eeef8188e4cab816d2c370bcaa7b2 (patch)
tree880b1a0bb8b04be2ce6be18152c02dcb992fd7a9 /drivers
parentac7d4ca9e0b27d7705d273f17afd29828db35ee6 (diff)
USB: pl2303: initial TIOCGSERIAL support
I've got a trivial patch for the pl2303 driver, that's what I needed to make the wacom serial tablet driver work properly. It uses the TIOCGSERIAL ioctl to determine if it's talking to a serial device or not, which I gather is rather common, but the pl2303 driver didn't implement that ioctl. Here's a patch, I'm not sure it's absolutely correct, I mostly looked at other similar usbserial drivers to see what I must do, but it works for me. Signed-off-by: John Tsiombikas <nuclear@member.fsf.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/serial/pl2303.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index 571dcf182866..895d0722183e 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -895,10 +895,23 @@ static int wait_modem_info(struct usb_serial_port *port, unsigned int arg)
895static int pl2303_ioctl(struct tty_struct *tty, struct file *file, 895static int pl2303_ioctl(struct tty_struct *tty, struct file *file,
896 unsigned int cmd, unsigned long arg) 896 unsigned int cmd, unsigned long arg)
897{ 897{
898 struct serial_struct ser;
898 struct usb_serial_port *port = tty->driver_data; 899 struct usb_serial_port *port = tty->driver_data;
899 dbg("%s (%d) cmd = 0x%04x", __func__, port->number, cmd); 900 dbg("%s (%d) cmd = 0x%04x", __func__, port->number, cmd);
900 901
901 switch (cmd) { 902 switch (cmd) {
903 case TIOCGSERIAL:
904 memset(&ser, 0, sizeof ser);
905 ser.type = PORT_16654;
906 ser.line = port->serial->minor;
907 ser.port = port->number;
908 ser.baud_base = 460800;
909
910 if (copy_to_user((void __user *)arg, &ser, sizeof ser))
911 return -EFAULT;
912
913 return 0;
914
902 case TIOCMIWAIT: 915 case TIOCMIWAIT:
903 dbg("%s (%d) TIOCMIWAIT", __func__, port->number); 916 dbg("%s (%d) TIOCMIWAIT", __func__, port->number);
904 return wait_modem_info(port, arg); 917 return wait_modem_info(port, arg);