]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/usb/hso.c
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[net-next-2.6.git] / drivers / net / usb / hso.c
index 6efca66b87663a84ec7f36529c190aa5a107d401..be8cc2a8e2137105ab85060472b748f4423f601d 100644 (file)
@@ -843,16 +843,7 @@ static netdev_tx_t hso_net_start_xmit(struct sk_buff *skb,
        return NETDEV_TX_OK;
 }
 
-static void hso_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *info)
-{
-       struct hso_net *odev = netdev_priv(net);
-
-       strncpy(info->driver, driver_name, ETHTOOL_BUSINFO_LEN);
-       usb_make_path(odev->parent->usb, info->bus_info, sizeof info->bus_info);
-}
-
 static const struct ethtool_ops ops = {
-       .get_drvinfo = hso_get_drvinfo,
        .get_link = ethtool_op_get_link
 };
 
@@ -1645,32 +1636,34 @@ 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));
+
        if (!tiocmget)
                 return -ENOENT;
        spin_lock_irq(&serial->serial_lock);
        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;
 }
 
 
@@ -1752,7 +1745,6 @@ static int hso_serial_ioctl(struct tty_struct *tty, struct file *file,
                            unsigned int cmd, unsigned long arg)
 {
        struct hso_serial *serial =  get_serial_by_tty(tty);
-       void __user *uarg = (void __user *)arg;
        int ret = 0;
        D4("IOCTL cmd: %d, arg: %ld", cmd, arg);
 
@@ -1762,10 +1754,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;
@@ -3298,6 +3286,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
 };