- struct catc *catc = dev->priv;
- u32 cmd;
-
- if (get_user(cmd, (u32 __user *)useraddr))
- return -EFAULT;
-
- switch (cmd) {
- /* get driver info */
- case ETHTOOL_GDRVINFO: {
- struct ethtool_drvinfo info = {ETHTOOL_GDRVINFO};
- strncpy(info.driver, driver_name, ETHTOOL_BUSINFO_LEN);
- strncpy(info.version, DRIVER_VERSION, ETHTOOL_BUSINFO_LEN);
- usb_make_path (catc->usbdev, info.bus_info, sizeof info.bus_info);
- if (copy_to_user(useraddr, &info, sizeof(info)))
- return -EFAULT;
- return 0;
- }
-
- /* get settings */
- case ETHTOOL_GSET:
- if (catc->is_f5u011) {
- struct ethtool_cmd ecmd = { ETHTOOL_GSET,
- SUPPORTED_10baseT_Half | SUPPORTED_TP,
- ADVERTISED_10baseT_Half | ADVERTISED_TP,
- SPEED_10,
- DUPLEX_HALF,
- PORT_TP,
- 0,
- XCVR_INTERNAL,
- AUTONEG_DISABLE,
- 1,
- 1
- };
- if (copy_to_user(useraddr, &ecmd, sizeof(ecmd)))
- return -EFAULT;
- return 0;
- } else {
- return -EOPNOTSUPP;
- }
-
- /* get link status */
- case ETHTOOL_GLINK: {
- struct ethtool_value edata = {ETHTOOL_GLINK};
- edata.data = netif_carrier_ok(dev);
- if (copy_to_user(useraddr, &edata, sizeof(edata)))
- return -EFAULT;
- return 0;
- }
- }
-
- return -EOPNOTSUPP;
+ struct catc *catc = netdev_priv(dev);
+ strncpy(info->driver, driver_name, ETHTOOL_BUSINFO_LEN);
+ strncpy(info->version, DRIVER_VERSION, ETHTOOL_BUSINFO_LEN);
+ usb_make_path (catc->usbdev, info->bus_info, sizeof info->bus_info);