Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: Convert the USB drivers to the new icount interface

Simple pasting job using the new ops function. Also fix a couple of devices
directly returning the internal struct (which happens at this point to match
for the fields that matter but isn't correct or futureproof)

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Alan Cox and committed by
Greg Kroah-Hartman
0bca1b91 d281da7f

+203 -145
+16 -19
drivers/net/usb/hso.c
··· 1645 1645 * NB: both 1->0 and 0->1 transitions are counted except for 1646 1646 * RI where only 0->1 is counted. 1647 1647 */ 1648 - static int hso_get_count(struct hso_serial *serial, 1649 - struct serial_icounter_struct __user *icnt) 1648 + static int hso_get_count(struct tty_struct *tty, 1649 + struct serial_icounter_struct *icount) 1650 1650 { 1651 - struct serial_icounter_struct icount; 1652 1651 struct uart_icount cnow; 1652 + struct hso_serial *serial = get_serial_by_tty(tty); 1653 1653 struct hso_tiocmget *tiocmget = serial->tiocmget; 1654 1654 1655 1655 memset(&icount, 0, sizeof(struct serial_icounter_struct)); ··· 1660 1660 memcpy(&cnow, &tiocmget->icount, sizeof(struct uart_icount)); 1661 1661 spin_unlock_irq(&serial->serial_lock); 1662 1662 1663 - icount.cts = cnow.cts; 1664 - icount.dsr = cnow.dsr; 1665 - icount.rng = cnow.rng; 1666 - icount.dcd = cnow.dcd; 1667 - icount.rx = cnow.rx; 1668 - icount.tx = cnow.tx; 1669 - icount.frame = cnow.frame; 1670 - icount.overrun = cnow.overrun; 1671 - icount.parity = cnow.parity; 1672 - icount.brk = cnow.brk; 1673 - icount.buf_overrun = cnow.buf_overrun; 1663 + icount->cts = cnow.cts; 1664 + icount->dsr = cnow.dsr; 1665 + icount->rng = cnow.rng; 1666 + icount->dcd = cnow.dcd; 1667 + icount->rx = cnow.rx; 1668 + icount->tx = cnow.tx; 1669 + icount->frame = cnow.frame; 1670 + icount->overrun = cnow.overrun; 1671 + icount->parity = cnow.parity; 1672 + icount->brk = cnow.brk; 1673 + icount->buf_overrun = cnow.buf_overrun; 1674 1674 1675 - return copy_to_user(icnt, &icount, sizeof(icount)) ? -EFAULT : 0; 1675 + return 0; 1676 1676 } 1677 1677 1678 1678 ··· 1763 1763 switch (cmd) { 1764 1764 case TIOCMIWAIT: 1765 1765 ret = hso_wait_modem_status(serial, arg); 1766 - break; 1767 - 1768 - case TIOCGICOUNT: 1769 - ret = hso_get_count(serial, uarg); 1770 1766 break; 1771 1767 default: 1772 1768 ret = -ENOIOCTLCMD; ··· 3296 3300 .chars_in_buffer = hso_serial_chars_in_buffer, 3297 3301 .tiocmget = hso_serial_tiocmget, 3298 3302 .tiocmset = hso_serial_tiocmset, 3303 + .get_icount = hso_get_count, 3299 3304 .unthrottle = hso_unthrottle 3300 3305 }; 3301 3306
+21 -19
drivers/usb/serial/ark3116.c
··· 411 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 434 static int ark3116_ioctl(struct tty_struct *tty, struct file *file, 415 435 unsigned int cmd, unsigned long arg) 416 436 { ··· 480 460 return 0; 481 461 } 482 462 break; 483 - case TIOCGICOUNT: { 484 - struct serial_icounter_struct icount; 485 - struct async_icount cnow = priv->icount; 486 - memset(&icount, 0, sizeof(icount)); 487 - icount.cts = cnow.cts; 488 - icount.dsr = cnow.dsr; 489 - icount.rng = cnow.rng; 490 - icount.dcd = cnow.dcd; 491 - icount.rx = cnow.rx; 492 - icount.tx = cnow.tx; 493 - icount.frame = cnow.frame; 494 - icount.overrun = cnow.overrun; 495 - icount.parity = cnow.parity; 496 - icount.brk = cnow.brk; 497 - icount.buf_overrun = cnow.buf_overrun; 498 - if (copy_to_user(user_arg, &icount, sizeof(icount))) 499 - return -EFAULT; 500 - return 0; 501 - } 502 463 } 503 464 504 465 return -ENOIOCTLCMD; ··· 737 736 .ioctl = ark3116_ioctl, 738 737 .tiocmget = ark3116_tiocmget, 739 738 .tiocmset = ark3116_tiocmset, 739 + .get_icount = ark3116_get_icount, 740 740 .open = ark3116_open, 741 741 .close = ark3116_close, 742 742 .break_ctl = ark3116_break_ctl,
+1
drivers/usb/serial/ftdi_sio.c
··· 2168 2168 * - mask passed in arg for lines of interest 2169 2169 * (use |'ed TIOCM_RNG/DSR/CD/CTS for masking) 2170 2170 * Caller should use TIOCGICOUNT to see which one it was. 2171 + * (except that the driver doesn't support it !) 2171 2172 * 2172 2173 * This code is borrowed from linux/drivers/char/serial.c 2173 2174 */
+27 -22
drivers/usb/serial/io_edgeport.c
··· 222 222 static int edge_tiocmget(struct tty_struct *tty, struct file *file); 223 223 static int edge_tiocmset(struct tty_struct *tty, struct file *file, 224 224 unsigned int set, unsigned int clear); 225 + static int edge_get_icount(struct tty_struct *tty, 226 + struct serial_icounter_struct *icount); 225 227 static int edge_startup(struct usb_serial *serial); 226 228 static void edge_disconnect(struct usb_serial *serial); 227 229 static void edge_release(struct usb_serial *serial); ··· 1626 1624 return result; 1627 1625 } 1628 1626 1627 + static int edge_get_icount(struct tty_struct *tty, 1628 + struct serial_icounter_struct *icount) 1629 + { 1630 + struct usb_serial_port *port = tty->driver_data; 1631 + struct edgeport_port *edge_port = usb_get_serial_port_data(port); 1632 + struct async_icount cnow; 1633 + cnow = edge_port->icount; 1634 + 1635 + icount->cts = cnow.cts; 1636 + icount->dsr = cnow.dsr; 1637 + icount->rng = cnow.rng; 1638 + icount->dcd = cnow.dcd; 1639 + icount->rx = cnow.rx; 1640 + icount->tx = cnow.tx; 1641 + icount->frame = cnow.frame; 1642 + icount->overrun = cnow.overrun; 1643 + icount->parity = cnow.parity; 1644 + icount->brk = cnow.brk; 1645 + icount->buf_overrun = cnow.buf_overrun; 1646 + 1647 + dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", 1648 + __func__, port->number, icount->rx, icount->tx); 1649 + return 0; 1650 + } 1651 + 1629 1652 static int get_serial_info(struct edgeport_port *edge_port, 1630 1653 struct serial_struct __user *retinfo) 1631 1654 { ··· 1677 1650 } 1678 1651 1679 1652 1680 - 1681 1653 /***************************************************************************** 1682 1654 * SerialIoctl 1683 1655 * this function handles any ioctl calls to the driver ··· 1689 1663 struct edgeport_port *edge_port = usb_get_serial_port_data(port); 1690 1664 struct async_icount cnow; 1691 1665 struct async_icount cprev; 1692 - struct serial_icounter_struct icount; 1693 1666 1694 1667 dbg("%s - port %d, cmd = 0x%x", __func__, port->number, cmd); 1695 1668 ··· 1727 1702 /* NOTREACHED */ 1728 1703 break; 1729 1704 1730 - case TIOCGICOUNT: 1731 - cnow = edge_port->icount; 1732 - memset(&icount, 0, sizeof(icount)); 1733 - icount.cts = cnow.cts; 1734 - icount.dsr = cnow.dsr; 1735 - icount.rng = cnow.rng; 1736 - icount.dcd = cnow.dcd; 1737 - icount.rx = cnow.rx; 1738 - icount.tx = cnow.tx; 1739 - icount.frame = cnow.frame; 1740 - icount.overrun = cnow.overrun; 1741 - icount.parity = cnow.parity; 1742 - icount.brk = cnow.brk; 1743 - icount.buf_overrun = cnow.buf_overrun; 1744 - 1745 - dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", 1746 - __func__, port->number, icount.rx, icount.tx); 1747 - if (copy_to_user((void __user *)arg, &icount, sizeof(icount))) 1748 - return -EFAULT; 1749 - return 0; 1750 1705 } 1751 1706 return -ENOIOCTLCMD; 1752 1707 }
+4
drivers/usb/serial/io_tables.h
··· 123 123 .set_termios = edge_set_termios, 124 124 .tiocmget = edge_tiocmget, 125 125 .tiocmset = edge_tiocmset, 126 + .get_icount = edge_get_icount, 126 127 .write = edge_write, 127 128 .write_room = edge_write_room, 128 129 .chars_in_buffer = edge_chars_in_buffer, ··· 153 152 .set_termios = edge_set_termios, 154 153 .tiocmget = edge_tiocmget, 155 154 .tiocmset = edge_tiocmset, 155 + .get_icount = edge_get_icount, 156 156 .write = edge_write, 157 157 .write_room = edge_write_room, 158 158 .chars_in_buffer = edge_chars_in_buffer, ··· 183 181 .set_termios = edge_set_termios, 184 182 .tiocmget = edge_tiocmget, 185 183 .tiocmset = edge_tiocmset, 184 + .get_icount = edge_get_icount, 186 185 .write = edge_write, 187 186 .write_room = edge_write_room, 188 187 .chars_in_buffer = edge_chars_in_buffer, ··· 212 209 .set_termios = edge_set_termios, 213 210 .tiocmget = edge_tiocmget, 214 211 .tiocmset = edge_tiocmset, 212 + .get_icount = edge_get_icount, 215 213 .write = edge_write, 216 214 .write_room = edge_write_room, 217 215 .chars_in_buffer = edge_chars_in_buffer,
+22 -7
drivers/usb/serial/io_ti.c
··· 2510 2510 return result; 2511 2511 } 2512 2512 2513 + static int edge_get_icount(struct tty_struct *tty, 2514 + struct serial_icounter_struct *icount) 2515 + { 2516 + struct usb_serial_port *port = tty->driver_data; 2517 + struct edgeport_port *edge_port = usb_get_serial_port_data(port); 2518 + struct async_icount *ic = &edge_port->icount; 2519 + 2520 + icount->cts = ic->cts; 2521 + icount->dsr = ic->dsr; 2522 + icount->rng = ic->rng; 2523 + icount->dcd = ic->dcd; 2524 + icount->tx = ic->tx; 2525 + icount->rx = ic->rx; 2526 + icount->frame = ic->frame; 2527 + icount->parity = ic->parity; 2528 + icount->overrun = ic->overrun; 2529 + icount->brk = ic->brk; 2530 + icount->buf_overrun = ic->buf_overrun; 2531 + return 0; 2532 + } 2533 + 2513 2534 static int get_serial_info(struct edgeport_port *edge_port, 2514 2535 struct serial_struct __user *retinfo) 2515 2536 { ··· 2593 2572 } 2594 2573 /* not reached */ 2595 2574 break; 2596 - case TIOCGICOUNT: 2597 - dbg("%s - (%d) TIOCGICOUNT RX=%d, TX=%d", __func__, 2598 - port->number, edge_port->icount.rx, edge_port->icount.tx); 2599 - if (copy_to_user((void __user *)arg, &edge_port->icount, 2600 - sizeof(edge_port->icount))) 2601 - return -EFAULT; 2602 - return 0; 2603 2575 } 2604 2576 return -ENOIOCTLCMD; 2605 2577 } ··· 2772 2758 .set_termios = edge_set_termios, 2773 2759 .tiocmget = edge_tiocmget, 2774 2760 .tiocmset = edge_tiocmset, 2761 + .get_icount = edge_get_icount, 2775 2762 .write = edge_write, 2776 2763 .write_room = edge_write_room, 2777 2764 .chars_in_buffer = edge_chars_in_buffer,
+29 -25
drivers/usb/serial/mos7720.c
··· 1896 1896 return 0; 1897 1897 } 1898 1898 1899 + static int mos7720_get_icount(struct tty_struct *tty, 1900 + struct serial_icounter_struct *icount) 1901 + { 1902 + struct usb_serial_port *port = tty->driver_data; 1903 + struct moschip_port *mos7720_port; 1904 + struct async_icount cnow; 1905 + 1906 + mos7720_port = usb_get_serial_port_data(port); 1907 + cnow = mos7720_port->icount; 1908 + 1909 + icount->cts = cnow.cts; 1910 + icount->dsr = cnow.dsr; 1911 + icount->rng = cnow.rng; 1912 + icount->dcd = cnow.dcd; 1913 + icount->rx = cnow.rx; 1914 + icount->tx = cnow.tx; 1915 + icount->frame = cnow.frame; 1916 + icount->overrun = cnow.overrun; 1917 + icount->parity = cnow.parity; 1918 + icount->brk = cnow.brk; 1919 + icount->buf_overrun = cnow.buf_overrun; 1920 + 1921 + dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", __func__, 1922 + port->number, icount->rx, icount->tx); 1923 + return 0; 1924 + } 1925 + 1899 1926 static int set_modem_info(struct moschip_port *mos7720_port, unsigned int cmd, 1900 1927 unsigned int __user *value) 1901 1928 { 1902 - unsigned int mcr ; 1929 + unsigned int mcr; 1903 1930 unsigned int arg; 1904 1931 1905 1932 struct usb_serial_port *port; ··· 2000 1973 struct moschip_port *mos7720_port; 2001 1974 struct async_icount cnow; 2002 1975 struct async_icount cprev; 2003 - struct serial_icounter_struct icount; 2004 1976 2005 1977 mos7720_port = usb_get_serial_port_data(port); 2006 1978 if (mos7720_port == NULL) ··· 2047 2021 } 2048 2022 /* NOTREACHED */ 2049 2023 break; 2050 - 2051 - case TIOCGICOUNT: 2052 - cnow = mos7720_port->icount; 2053 - 2054 - memset(&icount, 0, sizeof(struct serial_icounter_struct)); 2055 - 2056 - icount.cts = cnow.cts; 2057 - icount.dsr = cnow.dsr; 2058 - icount.rng = cnow.rng; 2059 - icount.dcd = cnow.dcd; 2060 - icount.rx = cnow.rx; 2061 - icount.tx = cnow.tx; 2062 - icount.frame = cnow.frame; 2063 - icount.overrun = cnow.overrun; 2064 - icount.parity = cnow.parity; 2065 - icount.brk = cnow.brk; 2066 - icount.buf_overrun = cnow.buf_overrun; 2067 - 2068 - dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", __func__, 2069 - port->number, icount.rx, icount.tx); 2070 - if (copy_to_user((void __user *)arg, &icount, sizeof(icount))) 2071 - return -EFAULT; 2072 - return 0; 2073 2024 } 2074 2025 2075 2026 return -ENOIOCTLCMD; ··· 2215 2212 .ioctl = mos7720_ioctl, 2216 2213 .tiocmget = mos7720_tiocmget, 2217 2214 .tiocmset = mos7720_tiocmset, 2215 + .get_icount = mos7720_get_icount, 2218 2216 .set_termios = mos7720_set_termios, 2219 2217 .write = mos7720_write, 2220 2218 .write_room = mos7720_write_room,
+29 -24
drivers/usb/serial/mos7840.c
··· 2209 2209 return 0; 2210 2210 } 2211 2211 2212 + static int mos7840_get_icount(struct tty_struct *tty, 2213 + struct serial_icounter_struct *icount) 2214 + { 2215 + struct usb_serial_port *port = tty->driver_data; 2216 + struct moschip_port *mos7840_port; 2217 + struct async_icount cnow; 2218 + 2219 + mos7840_port = mos7840_get_port_private(port); 2220 + cnow = mos7840_port->icount; 2221 + 2222 + smp_rmb(); 2223 + icount->cts = cnow.cts; 2224 + icount->dsr = cnow.dsr; 2225 + icount->rng = cnow.rng; 2226 + icount->dcd = cnow.dcd; 2227 + icount->rx = cnow.rx; 2228 + icount->tx = cnow.tx; 2229 + icount->frame = cnow.frame; 2230 + icount->overrun = cnow.overrun; 2231 + icount->parity = cnow.parity; 2232 + icount->brk = cnow.brk; 2233 + icount->buf_overrun = cnow.buf_overrun; 2234 + 2235 + dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", __func__, 2236 + port->number, icount->rx, icount->tx); 2237 + return 0; 2238 + } 2239 + 2212 2240 /***************************************************************************** 2213 2241 * SerialIoctl 2214 2242 * this function handles any ioctl calls to the driver ··· 2251 2223 2252 2224 struct async_icount cnow; 2253 2225 struct async_icount cprev; 2254 - struct serial_icounter_struct icount; 2255 2226 2256 2227 if (mos7840_port_paranoia_check(port, __func__)) { 2257 2228 dbg("%s", "Invalid port"); ··· 2309 2282 /* NOTREACHED */ 2310 2283 break; 2311 2284 2312 - case TIOCGICOUNT: 2313 - cnow = mos7840_port->icount; 2314 - smp_rmb(); 2315 - 2316 - memset(&icount, 0, sizeof(struct serial_icounter_struct)); 2317 - 2318 - icount.cts = cnow.cts; 2319 - icount.dsr = cnow.dsr; 2320 - icount.rng = cnow.rng; 2321 - icount.dcd = cnow.dcd; 2322 - icount.rx = cnow.rx; 2323 - icount.tx = cnow.tx; 2324 - icount.frame = cnow.frame; 2325 - icount.overrun = cnow.overrun; 2326 - icount.parity = cnow.parity; 2327 - icount.brk = cnow.brk; 2328 - icount.buf_overrun = cnow.buf_overrun; 2329 - 2330 - dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", __func__, 2331 - port->number, icount.rx, icount.tx); 2332 - if (copy_to_user(argp, &icount, sizeof(icount))) 2333 - return -EFAULT; 2334 - return 0; 2335 2285 default: 2336 2286 break; 2337 2287 } ··· 2678 2674 .break_ctl = mos7840_break, 2679 2675 .tiocmget = mos7840_tiocmget, 2680 2676 .tiocmset = mos7840_tiocmset, 2677 + .get_icount = mos7840_get_icount, 2681 2678 .attach = mos7840_startup, 2682 2679 .disconnect = mos7840_disconnect, 2683 2680 .release = mos7840_release,
+25 -21
drivers/usb/serial/ssu100.c
··· 416 416 return 0; 417 417 } 418 418 419 + static int ssu100_get_icount(struct tty_struct *tty, 420 + struct serial_icounter_struct *icount) 421 + { 422 + struct usb_serial_port *port = tty->driver_data; 423 + struct ssu100_port_private *priv = usb_get_serial_port_data(port); 424 + struct async_icount cnow = priv->icount; 425 + 426 + icount->cts = cnow.cts; 427 + icount->dsr = cnow.dsr; 428 + icount->rng = cnow.rng; 429 + icount->dcd = cnow.dcd; 430 + icount->rx = cnow.rx; 431 + icount->tx = cnow.tx; 432 + icount->frame = cnow.frame; 433 + icount->overrun = cnow.overrun; 434 + icount->parity = cnow.parity; 435 + icount->brk = cnow.brk; 436 + icount->buf_overrun = cnow.buf_overrun; 437 + 438 + return 0; 439 + } 440 + 441 + 442 + 419 443 static int ssu100_ioctl(struct tty_struct *tty, struct file *file, 420 444 unsigned int cmd, unsigned long arg) 421 445 { ··· 456 432 457 433 case TIOCMIWAIT: 458 434 return wait_modem_info(port, arg); 459 - 460 - case TIOCGICOUNT: 461 - { 462 - struct serial_icounter_struct icount; 463 - struct async_icount cnow = priv->icount; 464 - memset(&icount, 0, sizeof(icount)); 465 - icount.cts = cnow.cts; 466 - icount.dsr = cnow.dsr; 467 - icount.rng = cnow.rng; 468 - icount.dcd = cnow.dcd; 469 - icount.rx = cnow.rx; 470 - icount.tx = cnow.tx; 471 - icount.frame = cnow.frame; 472 - icount.overrun = cnow.overrun; 473 - icount.parity = cnow.parity; 474 - icount.brk = cnow.brk; 475 - icount.buf_overrun = cnow.buf_overrun; 476 - if (copy_to_user(user_arg, &icount, sizeof(icount))) 477 - return -EFAULT; 478 - return 0; 479 - } 480 435 481 436 default: 482 437 break; ··· 729 726 .process_read_urb = ssu100_process_read_urb, 730 727 .tiocmget = ssu100_tiocmget, 731 728 .tiocmset = ssu100_tiocmset, 729 + .get_icount = ssu100_get_icount, 732 730 .ioctl = ssu100_ioctl, 733 731 .set_termios = ssu100_set_termios, 734 732 .disconnect = usb_serial_generic_disconnect,
+29 -8
drivers/usb/serial/ti_usb_3410_5052.c
··· 108 108 static void ti_unthrottle(struct tty_struct *tty); 109 109 static int ti_ioctl(struct tty_struct *tty, struct file *file, 110 110 unsigned int cmd, unsigned long arg); 111 + static int ti_get_icount(struct tty_struct *tty, 112 + struct serial_icounter_struct *icount); 111 113 static void ti_set_termios(struct tty_struct *tty, 112 114 struct usb_serial_port *port, struct ktermios *old_termios); 113 115 static int ti_tiocmget(struct tty_struct *tty, struct file *file); ··· 239 237 .set_termios = ti_set_termios, 240 238 .tiocmget = ti_tiocmget, 241 239 .tiocmset = ti_tiocmset, 240 + .get_icount = ti_get_icount, 242 241 .break_ctl = ti_break, 243 242 .read_int_callback = ti_interrupt_callback, 244 243 .read_bulk_callback = ti_bulk_in_callback, ··· 268 265 .set_termios = ti_set_termios, 269 266 .tiocmget = ti_tiocmget, 270 267 .tiocmset = ti_tiocmset, 268 + .get_icount = ti_get_icount, 271 269 .break_ctl = ti_break, 272 270 .read_int_callback = ti_interrupt_callback, 273 271 .read_bulk_callback = ti_bulk_in_callback, ··· 792 788 } 793 789 } 794 790 791 + static int ti_get_icount(struct tty_struct *tty, 792 + struct serial_icounter_struct *icount) 793 + { 794 + struct usb_serial_port *port = tty->driver_data; 795 + struct ti_port *tport = usb_get_serial_port_data(port); 796 + struct async_icount cnow = tport->tp_icount; 797 + 798 + dbg("%s - (%d) TIOCGICOUNT RX=%d, TX=%d", 799 + __func__, port->number, 800 + cnow.rx, cnow.tx); 801 + 802 + icount->cts = cnow.cts; 803 + icount->dsr = cnow.dsr; 804 + icount->rng = cnow.rng; 805 + icount->dcd = cnow.dcd; 806 + icount->rx = cnow.rx; 807 + icount->tx = cnow.tx; 808 + icount->frame = cnow.frame; 809 + icount->overrun = cnow.overrun; 810 + icount->parity = cnow.parity; 811 + icount->brk = cnow.brk; 812 + icount->buf_overrun = cnow.buf_overrun; 813 + 814 + return 0; 815 + } 795 816 796 817 static int ti_ioctl(struct tty_struct *tty, struct file *file, 797 818 unsigned int cmd, unsigned long arg) ··· 859 830 cprev = cnow; 860 831 } 861 832 break; 862 - case TIOCGICOUNT: 863 - dbg("%s - (%d) TIOCGICOUNT RX=%d, TX=%d", 864 - __func__, port->number, 865 - tport->tp_icount.rx, tport->tp_icount.tx); 866 - if (copy_to_user((void __user *)arg, &tport->tp_icount, 867 - sizeof(tport->tp_icount))) 868 - return -EFAULT; 869 - return 0; 870 833 } 871 834 return -ENOIOCTLCMD; 872 835 }