aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dl2k.c
diff options
context:
space:
mode:
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 }