linux-mips
[Top] [All Lists]

[PATCH net-next v2 06/17] net: bonding: 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 06/17] net: bonding: use __ethtool_get_ksettings
From: David Decotigny <ddecotig@gmail.com>
Date: Wed, 4 Feb 2015 11:53:30 -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=vdm635z5BIZ8baPqZ15MvHu2KHpz60EVvs+bLBDU//k=; b=E5rIn44cPRHuyjRTwi13+C4BY2Gqas29dPp5INLnmjCCXHZbNZF9YtDDvKEcvTL3lH k9ApsdiwrFuI8PhUj4mpFjHq5bya9VqdtfupifIqKTkHs1L2uE2I7Dl3DX4oladahi2h j3nyT+Y6LWrQu9PUjKJiTV9SjXdPF03G6srSp5WPIEhesgVqu04z9Z37ZQb4wyDczGAo +XD0aRlWfOjWsh5togSard31Dc9MvMLU9c00JZBj9mmiypuL2MVVUc2ardV9h7ofrkqX YXjn9oDJ55s8V6CFUTC4xfnTI67JNEx+v5x4vtZfOm7qoRMoaHtcEMZnFo+lF5Yx2Uuw Xeow==
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>
---
 drivers/net/bonding/bond_main.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index c9e519c..9aba5a8 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -372,22 +372,20 @@ down:
 static void bond_update_speed_duplex(struct slave *slave)
 {
        struct net_device *slave_dev = slave->dev;
-       struct ethtool_cmd ecmd;
-       u32 slave_speed;
+       struct ethtool_ksettings ecmd;
        int res;
 
        slave->speed = SPEED_UNKNOWN;
        slave->duplex = DUPLEX_UNKNOWN;
 
-       res = __ethtool_get_settings(slave_dev, &ecmd);
+       res = __ethtool_get_ksettings(slave_dev, &ecmd);
        if (res < 0)
                return;
 
-       slave_speed = ethtool_cmd_speed(&ecmd);
-       if (slave_speed == 0 || slave_speed == ((__u32) -1))
+       if (ecmd.parent.speed == 0 || ecmd.parent.speed == ((__u32) -1))
                return;
 
-       switch (ecmd.duplex) {
+       switch (ecmd.parent.duplex) {
        case DUPLEX_FULL:
        case DUPLEX_HALF:
                break;
@@ -395,8 +393,8 @@ static void bond_update_speed_duplex(struct slave *slave)
                return;
        }
 
-       slave->speed = slave_speed;
-       slave->duplex = ecmd.duplex;
+       slave->speed = ecmd.parent.speed;
+       slave->duplex = ecmd.parent.duplex;
 
        return;
 }
-- 
2.2.0.rc0.207.ga3a616c


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