- struct eth_dev *dev = (struct eth_dev *) net->priv;
- u32 cmd;
-
- if (get_user (cmd, (u32 __user *)useraddr))
- return -EFAULT;
- switch (cmd) {
-
- case ETHTOOL_GDRVINFO: { /* get driver info */
- struct ethtool_drvinfo info;
-
- memset (&info, 0, sizeof info);
- info.cmd = ETHTOOL_GDRVINFO;
- strlcpy (info.driver, shortname, sizeof info.driver);
- strlcpy (info.version, DRIVER_VERSION, sizeof info.version);
- strlcpy (info.fw_version, dev->gadget->name,
- sizeof info.fw_version);
- strlcpy (info.bus_info, dev->gadget->dev.bus_id,
- sizeof info.bus_info);
- if (copy_to_user (useraddr, &info, sizeof (info)))
- return -EFAULT;
- return 0;
- }
-
- case ETHTOOL_GLINK: { /* get link status */
- struct ethtool_value edata = { ETHTOOL_GLINK };
-
- edata.data = (dev->gadget->speed != USB_SPEED_UNKNOWN);
- if (copy_to_user (useraddr, &edata, sizeof (edata)))
- return -EFAULT;
- return 0;
- }
-
- }
- /* Note that the ethtool user space code requires EOPNOTSUPP */
- return -EOPNOTSUPP;
+ struct eth_dev *dev = netdev_priv(net);
+ strlcpy(p->driver, shortname, sizeof p->driver);
+ strlcpy(p->version, DRIVER_VERSION, sizeof p->version);
+ strlcpy(p->fw_version, dev->gadget->name, sizeof p->fw_version);
+ strlcpy (p->bus_info, dev->gadget->dev.bus_id, sizeof p->bus_info);