aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dl2k.c
diff options
context:
space:
mode:
authorDavid Decotigny <decot@google.com>2011-04-27 14:32:39 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-29 17:03:00 -0400
commit25db0338813a8915457636b1f6abe6a28fa73f8d (patch)
tree29ea39e45de1342beb4e3c58da0cfbc9915b617e /drivers/net/dl2k.c
parent8ae6daca85c8bbd6a32c382db5e2a2a989f8bed2 (diff)
ethtool: Use full 32 bit speed range in ethtool's set_settings
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>
Diffstat (limited to 'drivers/net/dl2k.c')
-rw-r--r--drivers/net/dl2k.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c
index c05db6046050..ab63989619d4 100644
--- a/drivers/net/dl2k.c
+++ b/drivers/net/dl2k.c
@@ -1219,31 +1219,20 @@ static int rio_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
1219 } else { 1219 } else {
1220 np->an_enable = 0; 1220 np->an_enable = 0;
1221 if (np->speed == 1000) { 1221 if (np->speed == 1000) {
1222 cmd->speed = SPEED_100; 1222 ethtool_cmd_speed_set(cmd, SPEED_100);
1223 cmd->duplex = DUPLEX_FULL; 1223 cmd->duplex = DUPLEX_FULL;
1224 printk("Warning!! Can't disable Auto negotiation in 1000Mbps, change to Manual 100Mbps, Full duplex.\n"); 1224 printk("Warning!! Can't disable Auto negotiation in 1000Mbps, change to Manual 100Mbps, Full duplex.\n");
1225 } 1225 }
1226 switch(cmd->speed + cmd->duplex) { 1226 switch (ethtool_cmd_speed(cmd)) {
1227 1227 case SPEED_10:
1228 case SPEED_10 + DUPLEX_HALF:
1229 np->speed = 10;
1230 np->full_duplex = 0;
1231 break;
1232
1233 case SPEED_10 + DUPLEX_FULL:
1234 np->speed = 10; 1228 np->speed = 10;
1235 np->full_duplex = 1; 1229 np->full_duplex = (cmd->duplex == DUPLEX_FULL);
1236 break; 1230 break;
1237 case SPEED_100 + DUPLEX_HALF: 1231 case SPEED_100:
1238 np->speed = 100; 1232 np->speed = 100;
1239 np->full_duplex = 0; 1233 np->full_duplex = (cmd->duplex == DUPLEX_FULL);
1240 break;
1241 case SPEED_100 + DUPLEX_FULL:
1242 np->speed = 100;
1243 np->full_duplex = 1;
1244 break; 1234 break;
1245 case SPEED_1000 + DUPLEX_HALF:/* not supported */ 1235 case SPEED_1000: /* not supported */
1246 case SPEED_1000 + DUPLEX_FULL:/* not supported */
1247 default: 1236 default:
1248 return -EINVAL; 1237 return -EINVAL;
1249 } 1238 }