ark3116.c (11e4afb49b7fa1fc8e1ffd850c1806dd86a08204) | ark3116.c (0bca1b913affbd7e2fdaffee62a499659a466eb5) |
---|---|
1/* 2 * Copyright (C) 2009 by Bart Hartgers (bart.hartgers+ark3116@gmail.com) 3 * Original version: 4 * Copyright (C) 2006 5 * Simon Schulz (ark3116_driver <at> auctionant.de) 6 * 7 * ark3116 8 * - implements a driver for the arkmicro ark3116 chipset (vendor=0x6547, --- 397 unchanged lines hidden (view full) --- 406 /* enable DMA */ 407 ark3116_write_reg(port->serial, UART_FCR, UART_FCR_DMA_SELECT); 408 409err_out: 410 kfree(buf); 411 return result; 412} 413 | 1/* 2 * Copyright (C) 2009 by Bart Hartgers (bart.hartgers+ark3116@gmail.com) 3 * Original version: 4 * Copyright (C) 2006 5 * Simon Schulz (ark3116_driver <at> auctionant.de) 6 * 7 * ark3116 8 * - implements a driver for the arkmicro ark3116 chipset (vendor=0x6547, --- 397 unchanged lines hidden (view full) --- 406 /* enable DMA */ 407 ark3116_write_reg(port->serial, UART_FCR, UART_FCR_DMA_SELECT); 408 409err_out: 410 kfree(buf); 411 return result; 412} 413 |
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 |
|
414static int ark3116_ioctl(struct tty_struct *tty, struct file *file, 415 unsigned int cmd, unsigned long arg) 416{ 417 struct usb_serial_port *port = tty->driver_data; 418 struct ark3116_private *priv = usb_get_serial_port_data(port); 419 struct serial_struct serstruct; 420 void __user *user_arg = (void __user *)arg; 421 --- 33 unchanged lines hidden (view full) --- 455 (prev.dsr != priv->icount.dsr)) || 456 (arg & TIOCM_CD && 457 (prev.dcd != priv->icount.dcd)) || 458 (arg & TIOCM_CTS && 459 (prev.cts != priv->icount.cts))) 460 return 0; 461 } 462 break; | 434static int ark3116_ioctl(struct tty_struct *tty, struct file *file, 435 unsigned int cmd, unsigned long arg) 436{ 437 struct usb_serial_port *port = tty->driver_data; 438 struct ark3116_private *priv = usb_get_serial_port_data(port); 439 struct serial_struct serstruct; 440 void __user *user_arg = (void __user *)arg; 441 --- 33 unchanged lines hidden (view full) --- 475 (prev.dsr != priv->icount.dsr)) || 476 (arg & TIOCM_CD && 477 (prev.dcd != priv->icount.dcd)) || 478 (arg & TIOCM_CTS && 479 (prev.cts != priv->icount.cts))) 480 return 0; 481 } 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 } | 483 } |
482 } | |
483 484 return -ENOIOCTLCMD; 485} 486 487static int ark3116_tiocmget(struct tty_struct *tty, struct file *file) 488{ 489 struct usb_serial_port *port = tty->driver_data; 490 struct ark3116_private *priv = usb_get_serial_port_data(port); --- 240 unchanged lines hidden (view full) --- 731 .num_ports = 1, 732 .attach = ark3116_attach, 733 .release = ark3116_release, 734 .set_termios = ark3116_set_termios, 735 .init_termios = ark3116_init_termios, 736 .ioctl = ark3116_ioctl, 737 .tiocmget = ark3116_tiocmget, 738 .tiocmset = ark3116_tiocmset, | 484 485 return -ENOIOCTLCMD; 486} 487 488static int ark3116_tiocmget(struct tty_struct *tty, struct file *file) 489{ 490 struct usb_serial_port *port = tty->driver_data; 491 struct ark3116_private *priv = usb_get_serial_port_data(port); --- 240 unchanged lines hidden (view full) --- 732 .num_ports = 1, 733 .attach = ark3116_attach, 734 .release = ark3116_release, 735 .set_termios = ark3116_set_termios, 736 .init_termios = ark3116_init_termios, 737 .ioctl = ark3116_ioctl, 738 .tiocmget = ark3116_tiocmget, 739 .tiocmset = ark3116_tiocmset, |
740 .get_icount = ark3116_get_icount, |
|
739 .open = ark3116_open, 740 .close = ark3116_close, 741 .break_ctl = ark3116_break_ctl, 742 .read_int_callback = ark3116_read_int_callback, 743 .process_read_urb = ark3116_process_read_urb, 744}; 745 746static int __init ark3116_init(void) --- 133 unchanged lines hidden --- | 741 .open = ark3116_open, 742 .close = ark3116_close, 743 .break_ctl = ark3116_break_ctl, 744 .read_int_callback = ark3116_read_int_callback, 745 .process_read_urb = ark3116_process_read_urb, 746}; 747 748static int __init ark3116_init(void) --- 133 unchanged lines hidden --- |