]> git.openfabrics.org - ~tnikolova/compat/.git/commitdiff
compat: backport __ethtool_get_settings
authorVladimir Sokolovsky <vlad@mellanox.com>
Wed, 22 Feb 2012 11:10:29 +0000 (13:10 +0200)
committerVladimir Sokolovsky <vlad@mellanox.com>
Wed, 22 Feb 2012 17:09:02 +0000 (19:09 +0200)
[linux-2.6] (master)$ \
   git describe --contains  4bc71cb983fd2844e603bf633df2bb53385182d2
v3.2-rc1~129^2~289

Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
compat/compat-3.2.c
include/linux/compat-3.2.h

index 80f5597b5b95c8ab2c964d60f816a411bb749978..dd85387c1f2ae9e21f9977afafa0a2a4eab98101 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright 2012  Luis R. Rodriguez <mcgrof@frijolero.org>
+ * Copyright (c) 2012 Mellanox Technologies. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -10,6 +11,8 @@
 
 #include <linux/kernel.h>
 #include <linux/device.h>
+#include <linux/ethtool.h>
+#include <linux/rtnetlink.h>
 
 int __netdev_printk(const char *level, const struct net_device *dev,
                           struct va_format *vaf)
@@ -32,3 +35,16 @@ int __netdev_printk(const char *level, const struct net_device *dev,
        return r;
 }
 EXPORT_SYMBOL(__netdev_printk);
+
+int __ethtool_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+{
+        ASSERT_RTNL();
+
+        if (!dev->ethtool_ops || !dev->ethtool_ops->get_settings)
+                return -EOPNOTSUPP;
+
+        memset(cmd, 0, sizeof(struct ethtool_cmd));
+        cmd->cmd = ETHTOOL_GSET;
+        return dev->ethtool_ops->get_settings(dev, cmd);
+}
+EXPORT_SYMBOL(__ethtool_get_settings);
index cb14f0b12042cc2d43ff057dc9b6fa4c5bc68389..fd8d1f942a5fac6b3bedbc63770d13e476c20637 100644 (file)
@@ -7,9 +7,13 @@
 
 #include <linux/skbuff.h>
 #include <linux/dma-mapping.h>
+#include <linux/ethtool.h>
 
 #define PMSG_IS_AUTO(msg)      (((msg).event & PM_EVENT_AUTO) != 0)
 
+extern int __ethtool_get_settings(struct net_device *dev,
+                                 struct ethtool_cmd *cmd);
+
 /**
  * skb_frag_page - retrieve the page refered to by a paged fragment
  * @frag: the paged fragment