linux-mips
[Top] [All Lists]

[PATCH net-next v2 11/17] net: rdma: use __ethtool_get_ksettings

To: "David S. Miller" <davem@davemloft.net>, Ben Hutchings <ben@decadent.org.uk>, Amir Vadai <amirv@mellanox.com>, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-api@vger.kernel.org, linux-mips@linux-mips.org, fcoe-devel@open-fcoe.org
Subject: [PATCH net-next v2 11/17] net: rdma: use __ethtool_get_ksettings
From: David Decotigny <ddecotig@gmail.com>
Date: Wed, 4 Feb 2015 11:53:35 -0800
Cc: Eric Dumazet <edumazet@google.com>, Eugenia Emantayev <eugenia@mellanox.co.il>, Or Gerlitz <ogerlitz@mellanox.com>, Ido Shamay <idos@mellanox.com>, Joe Perches <joe@perches.com>, Saeed Mahameed <saeedm@mellanox.com>, Govindarajulu Varadarajan <_govind@gmx.com>, Venkata Duvvuru <VenkatKumar.Duvvuru@Emulex.Com>, Jeff Kirsher <jeffrey.t.kirsher@intel.com>, Eyal Perry <eyalpe@mellanox.com>, Pravin B Shelar <pshelar@nicira.com>, Ed Swierk <eswierk@skyportsystems.com>, Upinder Malhi <umalhi@cisco.com>, Robert Love <robert.w.love@intel.com>, "James E.J. Bottomley" <JBottomley@parallels.com>, David Decotigny <decot@googlers.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mMTSQiMFrwr5wbhHf8JpvxVChdjYWO7p7Czhlhfg17Y=; b=kLoDnpfEJqo7nVQIA7L+3QTxoY44ae13yG9Dxx3GAVNlAVilNYwRqHeTjs0NS5UWky BaBKq6ShxeWqZ3IRZjgIVuMncHfmVcoGISDhnYvuiovXAIW/j8xS1txRF4CHC/d7/myp Yt6n5JC9YlT1Avadv+2dEO1w2bNvpn536+DIiGaEDxCh36TL98LXsfhOk7DXKmf1rzi6 jj4H+vlzFu9zqT5/R9Jwo34RZ10gNwhg1KGBxjcU2T+MTuPahg1G1c0+93uDfWInxaid on0YezEb3cCESYbdbW2nMIynUrpPK4w51FJMa2PXE5XWZ6LVvJ0I329J4yDZe0CQn9BQ 25qQ==
In-reply-to: <1423079621-1374-1-git-send-email-ddecotig@gmail.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1423079621-1374-1-git-send-email-ddecotig@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
From: David Decotigny <decot@googlers.com>

Signed-off-by: David Decotigny <decot@googlers.com>
---
 include/rdma/ib_addr.h | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h
index ce55906..782bb8c 100644
--- a/include/rdma/ib_addr.h
+++ b/include/rdma/ib_addr.h
@@ -241,24 +241,22 @@ static inline enum ib_mtu iboe_get_mtu(int mtu)
 
 static inline int iboe_get_rate(struct net_device *dev)
 {
-       struct ethtool_cmd cmd;
-       u32 speed;
+       struct ethtool_ksettings cmd;
        int err;
 
        rtnl_lock();
-       err = __ethtool_get_settings(dev, &cmd);
+       err = __ethtool_get_ksettings(dev, &cmd);
        rtnl_unlock();
        if (err)
                return IB_RATE_PORT_CURRENT;
 
-       speed = ethtool_cmd_speed(&cmd);
-       if (speed >= 40000)
+       if (cmd.parent.speed >= 40000)
                return IB_RATE_40_GBPS;
-       else if (speed >= 30000)
+       else if (cmd.parent.speed >= 30000)
                return IB_RATE_30_GBPS;
-       else if (speed >= 20000)
+       else if (cmd.parent.speed >= 20000)
                return IB_RATE_20_GBPS;
-       else if (speed >= 10000)
+       else if (cmd.parent.speed >= 10000)
                return IB_RATE_10_GBPS;
        else
                return IB_RATE_PORT_CURRENT;
-- 
2.2.0.rc0.207.ga3a616c


<Prev in Thread] Current Thread [Next in Thread>