Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36361
b: refs/heads/master
c: 2f430b4
h: refs/heads/master
i:
  36359: 2181ef3
v: v3
  • Loading branch information
Werner Lemberg authored and Greg Kroah-Hartman committed Sep 27, 2006
1 parent addc169 commit 4032142
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bfb2c965d669045b7629fd577b7834c87c2dfd54
refs/heads/master: 2f430b4bbae7faa167730f954252eb7db4ac58dd
34 changes: 31 additions & 3 deletions trunk/drivers/usb/serial/ark3116.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/*
* Copyright (C) 2006
* Simon Schulz (ark3116_driver <at> auctionant.de)
*
* ark3116
* - implements a driver for the arkmicro ark3116 chipset (vendor=0x6547,
* productid=0x0232) (used in a datacable called KQ-U8A)
Expand All @@ -8,8 +11,6 @@
*
* - 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
* 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
Expand All @@ -22,6 +23,8 @@
#include <linux/module.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include <linux/serial.h>
#include <asm/uaccess.h>


static int debug;
Expand Down Expand Up @@ -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,
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;
}

Expand Down

0 comments on commit 4032142

Please sign in to comment.