aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ark3116.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/usb/serial/ark3116.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'drivers/usb/serial/ark3116.c')
-rw-r--r--drivers/usb/serial/ark3116.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
index 4e41a2a39422..5cdb9d912275 100644
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -411,7 +411,27 @@ err_out:
411 return result; 411 return result;
412} 412}
413 413
414static int ark3116_ioctl(struct tty_struct *tty, struct file *file, 414static 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
434static int ark3116_ioctl(struct tty_struct *tty,
415 unsigned int cmd, unsigned long arg) 435 unsigned int cmd, unsigned long arg)
416{ 436{
417 struct usb_serial_port *port = tty->driver_data; 437 struct usb_serial_port *port = tty->driver_data;
@@ -460,31 +480,12 @@ 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;
485} 486}
486 487
487static int ark3116_tiocmget(struct tty_struct *tty, struct file *file) 488static int ark3116_tiocmget(struct tty_struct *tty)
488{ 489{
489 struct usb_serial_port *port = tty->driver_data; 490 struct usb_serial_port *port = tty->driver_data;
490 struct ark3116_private *priv = usb_get_serial_port_data(port); 491 struct ark3116_private *priv = usb_get_serial_port_data(port);
@@ -510,7 +511,7 @@ static int ark3116_tiocmget(struct tty_struct *tty, struct file *file)
510 (ctrl & UART_MCR_OUT2 ? TIOCM_OUT2 : 0); 511 (ctrl & UART_MCR_OUT2 ? TIOCM_OUT2 : 0);
511} 512}
512 513
513static int ark3116_tiocmset(struct tty_struct *tty, struct file *file, 514static int ark3116_tiocmset(struct tty_struct *tty,
514 unsigned set, unsigned clr) 515 unsigned set, unsigned clr)
515{ 516{
516 struct usb_serial_port *port = tty->driver_data; 517 struct usb_serial_port *port = tty->driver_data;
@@ -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,