diff options
Diffstat (limited to 'drivers/usb/serial/ark3116.c')
| -rw-r--r-- | drivers/usb/serial/ark3116.c | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c index 4e41a2a39422..8f1d4fb19d24 100644 --- a/drivers/usb/serial/ark3116.c +++ b/drivers/usb/serial/ark3116.c | |||
| @@ -411,6 +411,26 @@ err_out: | |||
| 411 | return result; | 411 | return result; |
| 412 | } | 412 | } |
| 413 | 413 | ||
| 414 | static int ark3116_get_icount(struct tty_struct *tty, | ||
| 415 | struct serial_icounter_struct *icount) | ||
| 416 | { | ||
| 417 | struct usb_serial_port *port = tty->driver_data; | ||
| 418 | struct ark3116_private *priv = usb_get_serial_port_data(port); | ||
| 419 | struct async_icount cnow = priv->icount; | ||
| 420 | icount->cts = cnow.cts; | ||
| 421 | icount->dsr = cnow.dsr; | ||
| 422 | icount->rng = cnow.rng; | ||
| 423 | icount->dcd = cnow.dcd; | ||
| 424 | icount->rx = cnow.rx; | ||
| 425 | icount->tx = cnow.tx; | ||
| 426 | icount->frame = cnow.frame; | ||
| 427 | icount->overrun = cnow.overrun; | ||
| 428 | icount->parity = cnow.parity; | ||
| 429 | icount->brk = cnow.brk; | ||
| 430 | icount->buf_overrun = cnow.buf_overrun; | ||
| 431 | return 0; | ||
| 432 | } | ||
| 433 | |||
| 414 | static int ark3116_ioctl(struct tty_struct *tty, struct file *file, | 434 | static int ark3116_ioctl(struct tty_struct *tty, struct file *file, |
| 415 | unsigned int cmd, unsigned long arg) | 435 | unsigned int cmd, unsigned long arg) |
| 416 | { | 436 | { |
| @@ -460,25 +480,6 @@ static int ark3116_ioctl(struct tty_struct *tty, struct file *file, | |||
| 460 | return 0; | 480 | return 0; |
| 461 | } | 481 | } |
| 462 | break; | 482 | break; |
| 463 | case TIOCGICOUNT: { | ||
| 464 | struct serial_icounter_struct icount; | ||
| 465 | struct async_icount cnow = priv->icount; | ||
| 466 | memset(&icount, 0, sizeof(icount)); | ||
| 467 | icount.cts = cnow.cts; | ||
| 468 | icount.dsr = cnow.dsr; | ||
| 469 | icount.rng = cnow.rng; | ||
| 470 | icount.dcd = cnow.dcd; | ||
| 471 | icount.rx = cnow.rx; | ||
| 472 | icount.tx = cnow.tx; | ||
| 473 | icount.frame = cnow.frame; | ||
| 474 | icount.overrun = cnow.overrun; | ||
| 475 | icount.parity = cnow.parity; | ||
| 476 | icount.brk = cnow.brk; | ||
| 477 | icount.buf_overrun = cnow.buf_overrun; | ||
| 478 | if (copy_to_user(user_arg, &icount, sizeof(icount))) | ||
| 479 | return -EFAULT; | ||
| 480 | return 0; | ||
| 481 | } | ||
| 482 | } | 483 | } |
| 483 | 484 | ||
| 484 | return -ENOIOCTLCMD; | 485 | return -ENOIOCTLCMD; |
| @@ -736,6 +737,7 @@ static struct usb_serial_driver ark3116_device = { | |||
| 736 | .ioctl = ark3116_ioctl, | 737 | .ioctl = ark3116_ioctl, |
| 737 | .tiocmget = ark3116_tiocmget, | 738 | .tiocmget = ark3116_tiocmget, |
| 738 | .tiocmset = ark3116_tiocmset, | 739 | .tiocmset = ark3116_tiocmset, |
| 740 | .get_icount = ark3116_get_icount, | ||
| 739 | .open = ark3116_open, | 741 | .open = ark3116_open, |
| 740 | .close = ark3116_close, | 742 | .close = ark3116_close, |
| 741 | .break_ctl = ark3116_break_ctl, | 743 | .break_ctl = ark3116_break_ctl, |
