Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 289464
b: refs/heads/master
c: 18c7572
h: refs/heads/master
v: v3
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Feb 24, 2012
1 parent 72cd4ce commit 9c06840
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 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: 4c954326823585bd014f36b2babd39c107c2bbb4
refs/heads/master: 18c75720e667719c923e0547abb60dfcd9c4ee90
30 changes: 29 additions & 1 deletion trunk/drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <linux/serial.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/serial.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/uaccess.h>
Expand Down Expand Up @@ -773,10 +774,37 @@ static int acm_tty_tiocmset(struct tty_struct *tty,
return acm_set_control(acm, acm->ctrlout = newctrl);
}

static int get_serial_info(struct acm *acm, struct serial_struct __user *info)
{
struct serial_struct tmp;

if (!info)
return -EINVAL;

memset(&tmp, 0, sizeof(tmp));
tmp.flags = ASYNC_LOW_LATENCY;
tmp.xmit_fifo_size = acm->writesize;
tmp.baud_base = le32_to_cpu(acm->line.dwDTERate);

if (copy_to_user(info, &tmp, sizeof(tmp)))
return -EFAULT;
else
return 0;
}

static int acm_tty_ioctl(struct tty_struct *tty,
unsigned int cmd, unsigned long arg)
{
return -ENOIOCTLCMD;
struct acm *acm = tty->driver_data;
int rv = -ENOIOCTLCMD;

switch (cmd) {
case TIOCGSERIAL: /* gets serial port data */
rv = get_serial_info(acm, (struct serial_struct __user *) arg);
break;
}

return rv;
}

static const __u32 acm_tty_speed[] = {
Expand Down

0 comments on commit 9c06840

Please sign in to comment.