summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2011-02-22 16:52:28 +0000
committerDavid S. Miller <davem@davemloft.net>2011-02-23 14:23:32 -0800
commit4e4db200541d49404ff39ac482efee072dd72144 (patch)
treeaa8d62bf8b6fc551ccac1f3aa6b616e30031c4fa /net/core
parent14d1232f490c1c696582909fb3b69e67a8d38a34 (diff)
downloadblackbird-op-linux-4e4db200541d49404ff39ac482efee072dd72144.tar.gz
blackbird-op-linux-4e4db200541d49404ff39ac482efee072dd72144.zip
net: Fix ETHTOOL_GFEATURES compatibility
Implement getting rx checksum state for not updated drivers. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/ethtool.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 66cdc76770ce..69a3edc182f9 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -168,6 +168,18 @@ EXPORT_SYMBOL(ethtool_ntuple_flush);
#define ETHTOOL_DEV_FEATURE_WORDS 1
+static void ethtool_get_features_compat(struct net_device *dev,
+ struct ethtool_get_features_block *features)
+{
+ if (!dev->ethtool_ops)
+ return;
+
+ /* getting RX checksum */
+ if (dev->ethtool_ops->get_rx_csum)
+ if (dev->ethtool_ops->get_rx_csum(dev))
+ features[0].active |= NETIF_F_RXCSUM;
+}
+
static int ethtool_get_features(struct net_device *dev, void __user *useraddr)
{
struct ethtool_gfeatures cmd = {
@@ -185,6 +197,8 @@ static int ethtool_get_features(struct net_device *dev, void __user *useraddr)
u32 __user *sizeaddr;
u32 copy_size;
+ ethtool_get_features_compat(dev, features);
+
sizeaddr = useraddr + offsetof(struct ethtool_gfeatures, size);
if (get_user(copy_size, sizeaddr))
return -EFAULT;
OpenPOWER on IntegriCloud