]> bbs.cooldavid.org Git - jme.git/commitdiff
ethtool: Use full 32 bit speed range in ethtool's set_settings
authorDavid Decotigny <decot@google.com>
Wed, 27 Apr 2011 18:32:39 +0000 (18:32 +0000)
committerGuo-Fu Tseng <cooldavid@cooldavid.org>
Tue, 28 Jun 2011 10:04:28 +0000 (18:04 +0800)
This makes sure the ethtool's set_settings() callback of network
drivers don't ignore the 16 most significant bits when ethtool calls
their set_settings().

All drivers compiled with make allyesconfig on x86_64 have been
updated.

Signed-off-by: David Decotigny <decot@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
jme.c
jme.h

diff --git a/jme.c b/jme.c
index b941494d08f9d4a1fef30c969292aba27180ea85..fb41bbeb786ed2c89e94a08c180b69a722c5575e 100644 (file)
--- a/jme.c
+++ b/jme.c
@@ -2670,7 +2670,8 @@ jme_set_settings(struct net_device *netdev,
        struct jme_adapter *jme = netdev_priv(netdev);
        int rc, fdc = 0;
 
-       if (ecmd->speed == SPEED_1000 && ecmd->autoneg != AUTONEG_ENABLE)
+       if (ethtool_cmd_speed(ecmd) == SPEED_1000
+           && ecmd->autoneg != AUTONEG_ENABLE)
                return -EINVAL;
 
        /*
diff --git a/jme.h b/jme.h
index 9b9e61964e2f7830d57cea9a7d07a2b05b2fcd78..3dafe833ba2b284696f8adcb60f47995877fb3ec 100644 (file)
--- a/jme.h
+++ b/jme.h
@@ -535,6 +535,13 @@ static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb)
 #define JME_NEW_PM_API
 #endif
 
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,26)
+static inline __u32 ethtool_cmd_speed(struct ethtool_cmd *ep)
+{
+       return ep->speed;
+}
+#endif
+
 /*
  * Jmac Adapter Private data
  */