aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/usb/hso.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 1cd752f9a6e..b8e95724913 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -1645,11 +1645,11 @@ hso_wait_modem_status(struct hso_serial *serial, unsigned long arg)
1645 * NB: both 1->0 and 0->1 transitions are counted except for 1645 * NB: both 1->0 and 0->1 transitions are counted except for
1646 * RI where only 0->1 is counted. 1646 * RI where only 0->1 is counted.
1647 */ 1647 */
1648static int hso_get_count(struct hso_serial *serial, 1648static int hso_get_count(struct tty_struct *tty,
1649 struct serial_icounter_struct __user *icnt) 1649 struct serial_icounter_struct *icount)
1650{ 1650{
1651 struct serial_icounter_struct icount;
1652 struct uart_icount cnow; 1651 struct uart_icount cnow;
1652 struct hso_serial *serial = get_serial_by_tty(tty);
1653 struct hso_tiocmget *tiocmget = serial->tiocmget; 1653 struct hso_tiocmget *tiocmget = serial->tiocmget;
1654 1654
1655 memset(&icount, 0, sizeof(struct serial_icounter_struct)); 1655 memset(&icount, 0, sizeof(struct serial_icounter_struct));
@@ -1660,19 +1660,19 @@ static int hso_get_count(struct hso_serial *serial,
1660 memcpy(&cnow, &tiocmget->icount, sizeof(struct uart_icount)); 1660 memcpy(&cnow, &tiocmget->icount, sizeof(struct uart_icount));
1661 spin_unlock_irq(&serial->serial_lock); 1661 spin_unlock_irq(&serial->serial_lock);
1662 1662
1663 icount.cts = cnow.cts; 1663 icount->cts = cnow.cts;
1664 icount.dsr = cnow.dsr; 1664 icount->dsr = cnow.dsr;
1665 icount.rng = cnow.rng; 1665 icount->rng = cnow.rng;
1666 icount.dcd = cnow.dcd; 1666 icount->dcd = cnow.dcd;
1667 icount.rx = cnow.rx; 1667 icount->rx = cnow.rx;
1668 icount.tx = cnow.tx; 1668 icount->tx = cnow.tx;
1669 icount.frame = cnow.frame; 1669 icount->frame = cnow.frame;
1670 icount.overrun = cnow.overrun; 1670 icount->overrun = cnow.overrun;
1671 icount.parity = cnow.parity; 1671 icount->parity = cnow.parity;
1672 icount.brk = cnow.brk; 1672 icount->brk = cnow.brk;
1673 icount.buf_overrun = cnow.buf_overrun; 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
@@ -1764,10 +1764,6 @@ static int hso_serial_ioctl(struct tty_struct *tty, struct file *file,
1764 case TIOCMIWAIT: 1764 case TIOCMIWAIT:
1765 ret = hso_wait_modem_status(serial, arg); 1765 ret = hso_wait_modem_status(serial, arg);
1766 break; 1766 break;
1767
1768 case TIOCGICOUNT:
1769 ret = hso_get_count(serial, uarg);
1770 break;
1771 default: 1767 default:
1772 ret = -ENOIOCTLCMD; 1768 ret = -ENOIOCTLCMD;
1773 break; 1769 break;
@@ -3300,6 +3296,7 @@ static const struct tty_operations hso_serial_ops = {
3300 .chars_in_buffer = hso_serial_chars_in_buffer, 3296 .chars_in_buffer = hso_serial_chars_in_buffer,
3301 .tiocmget = hso_serial_tiocmget, 3297 .tiocmget = hso_serial_tiocmget,
3302 .tiocmset = hso_serial_tiocmset, 3298 .tiocmset = hso_serial_tiocmset,
3299 .get_icount = hso_get_count,
3303 .unthrottle = hso_unthrottle 3300 .unthrottle = hso_unthrottle
3304}; 3301};
3305 3302