ethtool: allow ETHTOOL_GSSET_INFO for users
[pandora-kernel.git] / net / core / ethtool.c
index 6cdba5f..2367246 100644 (file)
@@ -569,15 +569,25 @@ int __ethtool_set_flags(struct net_device *dev, u32 data)
        return 0;
 }
 
-static int ethtool_get_settings(struct net_device *dev, void __user *useraddr)
+int __ethtool_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
-       struct ethtool_cmd cmd = { .cmd = ETHTOOL_GSET };
-       int err;
+       ASSERT_RTNL();
 
-       if (!dev->ethtool_ops->get_settings)
+       if (!dev->ethtool_ops || !dev->ethtool_ops->get_settings)
                return -EOPNOTSUPP;
 
-       err = dev->ethtool_ops->get_settings(dev, &cmd);
+       memset(cmd, 0, sizeof(struct ethtool_cmd));
+       cmd->cmd = ETHTOOL_GSET;
+       return dev->ethtool_ops->get_settings(dev, cmd);
+}
+EXPORT_SYMBOL(__ethtool_get_settings);
+
+static int ethtool_get_settings(struct net_device *dev, void __user *useraddr)
+{
+       int err;
+       struct ethtool_cmd cmd;
+
+       err = __ethtool_get_settings(dev, &cmd);
        if (err < 0)
                return err;
 
@@ -1539,6 +1549,8 @@ static noinline_for_stack int ethtool_flash_device(struct net_device *dev,
        if (!dev->ethtool_ops->flash_device)
                return -EOPNOTSUPP;
 
+       efl.data[ETHTOOL_FLASH_MAX_FILENAME - 1] = 0;
+
        return dev->ethtool_ops->flash_device(dev, &efl);
 }
 
@@ -1660,6 +1672,7 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
        case ETHTOOL_GRXCSUM:
        case ETHTOOL_GTXCSUM:
        case ETHTOOL_GSG:
+       case ETHTOOL_GSSET_INFO:
        case ETHTOOL_GSTRINGS:
        case ETHTOOL_GTSO:
        case ETHTOOL_GPERMADDR: