net: rdma: use __ethtool_get_ksettings
authorDavid Decotigny <decot@googlers.com>
Wed, 24 Feb 2016 18:58:07 +0000 (10:58 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 Feb 2016 03:06:46 +0000 (22:06 -0500)
Signed-off-by: David Decotigny <decot@googlers.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/rdma/ib_addr.h

index c34c9002460c567a8e7e3e8cd9cb6acb751c97d8..931a47ba45718ad5c329b1085c7fac5319e7448f 100644 (file)
@@ -262,24 +262,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_link_ksettings cmd;
        int err;
 
        rtnl_lock();
-       err = __ethtool_get_settings(dev, &cmd);
+       err = __ethtool_get_link_ksettings(dev, &cmd);
        rtnl_unlock();
        if (err)
                return IB_RATE_PORT_CURRENT;
 
-       speed = ethtool_cmd_speed(&cmd);
-       if (speed >= 40000)
+       if (cmd.base.speed >= 40000)
                return IB_RATE_40_GBPS;
-       else if (speed >= 30000)
+       else if (cmd.base.speed >= 30000)
                return IB_RATE_30_GBPS;
-       else if (speed >= 20000)
+       else if (cmd.base.speed >= 20000)
                return IB_RATE_20_GBPS;
-       else if (speed >= 10000)
+       else if (cmd.base.speed >= 10000)
                return IB_RATE_10_GBPS;
        else
                return IB_RATE_PORT_CURRENT;