diff options
Diffstat (limited to 'drivers/net')
-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 1cd752f9a6e1..b8e957249132 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) * NB: both 1->0 and 0->1 transitions are counted except for * RI where only 0->1 is counted. */ -static int hso_get_count(struct hso_serial *serial, - struct serial_icounter_struct __user *icnt) +static int hso_get_count(struct tty_struct *tty, + struct serial_icounter_struct *icount) { - struct serial_icounter_struct icount; struct uart_icount cnow; + struct hso_serial *serial = get_serial_by_tty(tty); struct hso_tiocmget *tiocmget = serial->tiocmget; memset(&icount, 0, sizeof(struct serial_icounter_struct)); @@ -1660,19 +1660,19 @@ static int hso_get_count(struct hso_serial *serial, memcpy(&cnow, &tiocmget->icount, sizeof(struct uart_icount)); spin_unlock_irq(&serial->serial_lock); - icount.cts = cnow.cts; - icount.dsr = cnow.dsr; - icount.rng = cnow.rng; - icount.dcd = cnow.dcd; - icount.rx = cnow.rx; - icount.tx = cnow.tx; - icount.frame = cnow.frame; - icount.overrun = cnow.overrun; - icount.parity = cnow.parity; - icount.brk = cnow.brk; - icount.buf_overrun = cnow.buf_overrun; + icount->cts = cnow.cts; + icount->dsr = cnow.dsr; + icount->rng = cnow.rng; + icount->dcd = cnow.dcd; + icount->rx = cnow.rx; + icount->tx = cnow.tx; + icount->frame = cnow.frame; + icount->overrun = cnow.overrun; + icount->parity = cnow.parity; + icount->brk = cnow.brk; + icount->buf_overrun = cnow.buf_overrun; - return copy_to_user(icnt, &icount, sizeof(icount)) ? -EFAULT : 0; + return 0; } @@ -1764,10 +1764,6 @@ static int hso_serial_ioctl(struct tty_struct *tty, struct file *file, case TIOCMIWAIT: ret = hso_wait_modem_status(serial, arg); break; - - case TIOCGICOUNT: - ret = hso_get_count(serial, uarg); - break; default: ret = -ENOIOCTLCMD; break; @@ -3300,6 +3296,7 @@ static const struct tty_operations hso_serial_ops = { .chars_in_buffer = hso_serial_chars_in_buffer, .tiocmget = hso_serial_tiocmget, .tiocmset = hso_serial_tiocmset, + .get_icount = hso_get_count, .unthrottle = hso_unthrottle }; |