diff options
author | Werner Lemberg <wl@gnu.org> | 2006-07-18 11:00:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-27 14:58:49 -0400 |
commit | 2f430b4bbae7faa167730f954252eb7db4ac58dd (patch) | |
tree | fa3cbccf8fc63040eb384153aed4d02905aeb0e0 /drivers | |
parent | bfb2c965d669045b7629fd577b7834c87c2dfd54 (diff) |
USB: ark3116: Add TIOCGSERIAL and TIOCSSERIAL ioctl calls.
Add (dummy?) support for TIOCGSERIAL and TIOCSSERIAL ioctl calls to the USB
serial driver file `ark3116.c'. This is sufficient for me to run wvdial
successfully, receive my email, and do webbrowsing with firefox. On the
other hand, running the cvs program to update archives seems not to work,
and the traceroute command sometimes says
send failed: No buffer space available
Looks like a buffering problem... My knowledge of serial device drivers is
zero, so I can't fix this -- I just did a cut'n'paste from other USB serial
drivers...
Signed-off-by: Werner Lemberg <wl@gnu.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/serial/ark3116.c | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c index 970d9ef0a7a5..d37300e1811a 100644 --- a/drivers/usb/serial/ark3116.c +++ b/drivers/usb/serial/ark3116.c | |||
@@ -1,4 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2006 | ||
3 | * Simon Schulz (ark3116_driver <at> auctionant.de) | ||
4 | * | ||
2 | * ark3116 | 5 | * ark3116 |
3 | * - implements a driver for the arkmicro ark3116 chipset (vendor=0x6547, | 6 | * - implements a driver for the arkmicro ark3116 chipset (vendor=0x6547, |
4 | * productid=0x0232) (used in a datacable called KQ-U8A) | 7 | * productid=0x0232) (used in a datacable called KQ-U8A) |
@@ -8,8 +11,6 @@ | |||
8 | * | 11 | * |
9 | * - based on logs created by usbsnoopy | 12 | * - based on logs created by usbsnoopy |
10 | * | 13 | * |
11 | * Author : Simon Schulz [ark3116_driver<AT>auctionant.de] | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify it | 14 | * This program is free software; you can redistribute it and/or modify it |
14 | * under the terms of the GNU General Public License as published by the | 15 | * under the terms of the GNU General Public License as published by the |
15 | * Free Software Foundation; either version 2 of the License, or (at your | 16 | * Free Software Foundation; either version 2 of the License, or (at your |
@@ -22,6 +23,8 @@ | |||
22 | #include <linux/module.h> | 23 | #include <linux/module.h> |
23 | #include <linux/usb.h> | 24 | #include <linux/usb.h> |
24 | #include <linux/usb/serial.h> | 25 | #include <linux/usb/serial.h> |
26 | #include <linux/serial.h> | ||
27 | #include <asm/uaccess.h> | ||
25 | 28 | ||
26 | 29 | ||
27 | static int debug; | 30 | static int debug; |
@@ -379,7 +382,32 @@ static int ark3116_open(struct usb_serial_port *port, struct file *filp) | |||
379 | static int ark3116_ioctl(struct usb_serial_port *port, struct file *file, | 382 | static int ark3116_ioctl(struct usb_serial_port *port, struct file *file, |
380 | unsigned int cmd, unsigned long arg) | 383 | unsigned int cmd, unsigned long arg) |
381 | { | 384 | { |
382 | dbg("ioctl not supported yet..."); | 385 | struct serial_struct serstruct; |
386 | void __user *user_arg = (void __user *)arg; | ||
387 | |||
388 | switch (cmd) { | ||
389 | case TIOCGSERIAL: | ||
390 | /* XXX: Some of these values are probably wrong. */ | ||
391 | memset(&serstruct, 0, sizeof (serstruct)); | ||
392 | serstruct.type = PORT_16654; | ||
393 | serstruct.line = port->serial->minor; | ||
394 | serstruct.port = port->number; | ||
395 | serstruct.custom_divisor = 0; | ||
396 | serstruct.baud_base = 460800; | ||
397 | |||
398 | if (copy_to_user(user_arg, &serstruct, sizeof (serstruct))) | ||
399 | return -EFAULT; | ||
400 | |||
401 | return 0; | ||
402 | case TIOCSSERIAL: | ||
403 | if (copy_from_user(&serstruct, user_arg, sizeof (serstruct))) | ||
404 | return -EFAULT; | ||
405 | return 0; | ||
406 | default: | ||
407 | dbg("%s cmd 0x%04x not supported", __FUNCTION__, cmd); | ||
408 | break; | ||
409 | } | ||
410 | |||
383 | return -ENOIOCTLCMD; | 411 | return -ENOIOCTLCMD; |
384 | } | 412 | } |
385 | 413 | ||