]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/core/ethtool.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi...
[mv-sheeva.git] / net / core / ethtool.c
index cf36ff44ebb2520339d3ff5045499a3321756239..4c12ddb5f5ee43ab546278ba5527c2e10939824b 100644 (file)
@@ -34,11 +34,13 @@ u32 ethtool_op_get_rx_csum(struct net_device *dev)
 {
        return (dev->features & NETIF_F_ALL_CSUM) != 0;
 }
+EXPORT_SYMBOL(ethtool_op_get_rx_csum);
 
 u32 ethtool_op_get_tx_csum(struct net_device *dev)
 {
        return (dev->features & NETIF_F_ALL_CSUM) != 0;
 }
+EXPORT_SYMBOL(ethtool_op_get_tx_csum);
 
 int ethtool_op_set_tx_csum(struct net_device *dev, u32 data)
 {
@@ -896,6 +898,19 @@ static int ethtool_set_value(struct net_device *dev, char __user *useraddr,
        return actor(dev, edata.data);
 }
 
+static int ethtool_flash_device(struct net_device *dev, char __user *useraddr)
+{
+       struct ethtool_flash efl;
+
+       if (copy_from_user(&efl, useraddr, sizeof(efl)))
+               return -EFAULT;
+
+       if (!dev->ethtool_ops->flash_device)
+               return -EOPNOTSUPP;
+
+       return dev->ethtool_ops->flash_device(dev, &efl);
+}
+
 /* The main entry point in this file.  Called from net/core/dev.c */
 
 int dev_ethtool(struct net *net, struct ifreq *ifr)
@@ -1109,6 +1124,9 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
        case ETHTOOL_SGRO:
                rc = ethtool_set_gro(dev, useraddr);
                break;
+       case ETHTOOL_FLASHDEV:
+               rc = ethtool_flash_device(dev, useraddr);
+               break;
        default:
                rc = -EOPNOTSUPP;
        }
@@ -1125,7 +1143,6 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
 EXPORT_SYMBOL(ethtool_op_get_link);
 EXPORT_SYMBOL(ethtool_op_get_sg);
 EXPORT_SYMBOL(ethtool_op_get_tso);
-EXPORT_SYMBOL(ethtool_op_get_tx_csum);
 EXPORT_SYMBOL(ethtool_op_set_sg);
 EXPORT_SYMBOL(ethtool_op_set_tso);
 EXPORT_SYMBOL(ethtool_op_set_tx_csum);