Commit 2f430b4b authored by Werner Lemberg's avatar Werner Lemberg Committed by Greg Kroah-Hartman

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: default avatarWerner Lemberg <wl@gnu.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent bfb2c965
/* /*
* Copyright (C) 2006
* Simon Schulz (ark3116_driver <at> auctionant.de)
*
* ark3116 * ark3116
* - implements a driver for the arkmicro ark3116 chipset (vendor=0x6547, * - implements a driver for the arkmicro ark3116 chipset (vendor=0x6547,
* productid=0x0232) (used in a datacable called KQ-U8A) * productid=0x0232) (used in a datacable called KQ-U8A)
...@@ -8,8 +11,6 @@ ...@@ -8,8 +11,6 @@
* *
* - based on logs created by usbsnoopy * - based on logs created by usbsnoopy
* *
* Author : Simon Schulz [ark3116_driver<AT>auctionant.de]
*
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the * under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your * Free Software Foundation; either version 2 of the License, or (at your
...@@ -22,6 +23,8 @@ ...@@ -22,6 +23,8 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/usb.h> #include <linux/usb.h>
#include <linux/usb/serial.h> #include <linux/usb/serial.h>
#include <linux/serial.h>
#include <asm/uaccess.h>
static int debug; static int debug;
...@@ -379,7 +382,32 @@ static int ark3116_open(struct usb_serial_port *port, struct file *filp) ...@@ -379,7 +382,32 @@ static int ark3116_open(struct usb_serial_port *port, struct file *filp)
static int ark3116_ioctl(struct usb_serial_port *port, struct file *file, static int ark3116_ioctl(struct usb_serial_port *port, struct file *file,
unsigned int cmd, unsigned long arg) unsigned int cmd, unsigned long arg)
{ {
dbg("ioctl not supported yet..."); struct serial_struct serstruct;
void __user *user_arg = (void __user *)arg;
switch (cmd) {
case TIOCGSERIAL:
/* XXX: Some of these values are probably wrong. */
memset(&serstruct, 0, sizeof (serstruct));
serstruct.type = PORT_16654;
serstruct.line = port->serial->minor;
serstruct.port = port->number;
serstruct.custom_divisor = 0;
serstruct.baud_base = 460800;
if (copy_to_user(user_arg, &serstruct, sizeof (serstruct)))
return -EFAULT;
return 0;
case TIOCSSERIAL:
if (copy_from_user(&serstruct, user_arg, sizeof (serstruct)))
return -EFAULT;
return 0;
default:
dbg("%s cmd 0x%04x not supported", __FUNCTION__, cmd);
break;
}
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment