diff options
Diffstat (limited to 'drivers/net/usb/hso.c')
-rw-r--r-- | drivers/net/usb/hso.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 8110595fbbcc..b154a94de03e 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -1636,11 +1636,11 @@ hso_wait_modem_status(struct hso_serial *serial, unsigned long arg) | |||
1636 | * NB: both 1->0 and 0->1 transitions are counted except for | 1636 | * NB: both 1->0 and 0->1 transitions are counted except for |
1637 | * RI where only 0->1 is counted. | 1637 | * RI where only 0->1 is counted. |
1638 | */ | 1638 | */ |
1639 | static int hso_get_count(struct hso_serial *serial, | 1639 | static int hso_get_count(struct tty_struct *tty, |
1640 | struct serial_icounter_struct __user *icnt) | 1640 | struct serial_icounter_struct *icount) |
1641 | { | 1641 | { |
1642 | struct serial_icounter_struct icount; | ||
1643 | struct uart_icount cnow; | 1642 | struct uart_icount cnow; |
1643 | struct hso_serial *serial = get_serial_by_tty(tty); | ||
1644 | struct hso_tiocmget *tiocmget = serial->tiocmget; | 1644 | struct hso_tiocmget *tiocmget = serial->tiocmget; |
1645 | 1645 | ||
1646 | memset(&icount, 0, sizeof(struct serial_icounter_struct)); | 1646 | memset(&icount, 0, sizeof(struct serial_icounter_struct)); |
@@ -1651,19 +1651,19 @@ static int hso_get_count(struct hso_serial *serial, | |||
1651 | memcpy(&cnow, &tiocmget->icount, sizeof(struct uart_icount)); | 1651 | memcpy(&cnow, &tiocmget->icount, sizeof(struct uart_icount)); |
1652 | spin_unlock_irq(&serial->serial_lock); | 1652 | spin_unlock_irq(&serial->serial_lock); |
1653 | 1653 | ||
1654 | icount.cts = cnow.cts; | 1654 | icount->cts = cnow.cts; |
1655 | icount.dsr = cnow.dsr; | 1655 | icount->dsr = cnow.dsr; |
1656 | icount.rng = cnow.rng; | 1656 | icount->rng = cnow.rng; |
1657 | icount.dcd = cnow.dcd; | 1657 | icount->dcd = cnow.dcd; |
1658 | icount.rx = cnow.rx; | 1658 | icount->rx = cnow.rx; |
1659 | icount.tx = cnow.tx; | 1659 | icount->tx = cnow.tx; |
1660 | icount.frame = cnow.frame; | 1660 | icount->frame = cnow.frame; |
1661 | icount.overrun = cnow.overrun; | 1661 | icount->overrun = cnow.overrun; |
1662 | icount.parity = cnow.parity; | 1662 | icount->parity = cnow.parity; |
1663 | icount.brk = cnow.brk; | 1663 | icount->brk = cnow.brk; |
1664 | icount.buf_overrun = cnow.buf_overrun; | 1664 | icount->buf_overrun = cnow.buf_overrun; |
1665 | 1665 | ||
1666 | return copy_to_user(icnt, &icount, sizeof(icount)) ? -EFAULT : 0; | 1666 | return 0; |
1667 | } | 1667 | } |
1668 | 1668 | ||
1669 | 1669 | ||
@@ -1755,10 +1755,6 @@ static int hso_serial_ioctl(struct tty_struct *tty, struct file *file, | |||
1755 | case TIOCMIWAIT: | 1755 | case TIOCMIWAIT: |
1756 | ret = hso_wait_modem_status(serial, arg); | 1756 | ret = hso_wait_modem_status(serial, arg); |
1757 | break; | 1757 | break; |
1758 | |||
1759 | case TIOCGICOUNT: | ||
1760 | ret = hso_get_count(serial, uarg); | ||
1761 | break; | ||
1762 | default: | 1758 | default: |
1763 | ret = -ENOIOCTLCMD; | 1759 | ret = -ENOIOCTLCMD; |
1764 | break; | 1760 | break; |
@@ -3291,6 +3287,7 @@ static const struct tty_operations hso_serial_ops = { | |||
3291 | .chars_in_buffer = hso_serial_chars_in_buffer, | 3287 | .chars_in_buffer = hso_serial_chars_in_buffer, |
3292 | .tiocmget = hso_serial_tiocmget, | 3288 | .tiocmget = hso_serial_tiocmget, |
3293 | .tiocmset = hso_serial_tiocmset, | 3289 | .tiocmset = hso_serial_tiocmset, |
3290 | .get_icount = hso_get_count, | ||
3294 | .unthrottle = hso_unthrottle | 3291 | .unthrottle = hso_unthrottle |
3295 | }; | 3292 | }; |
3296 | 3293 | ||