aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/tulip/de2104x.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index ab78e1d58cb6..46d5a1b15036 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -1518,18 +1518,17 @@ static int __de_get_settings(struct de_private *de, struct ethtool_cmd *ecmd)
1518 switch (de->media_type) { 1518 switch (de->media_type) {
1519 case DE_MEDIA_AUI: 1519 case DE_MEDIA_AUI:
1520 ecmd->port = PORT_AUI; 1520 ecmd->port = PORT_AUI;
1521 ethtool_cmd_speed_set(ecmd, 5);
1522 break; 1521 break;
1523 case DE_MEDIA_BNC: 1522 case DE_MEDIA_BNC:
1524 ecmd->port = PORT_BNC; 1523 ecmd->port = PORT_BNC;
1525 ethtool_cmd_speed_set(ecmd, 2);
1526 break; 1524 break;
1527 default: 1525 default:
1528 ecmd->port = PORT_TP; 1526 ecmd->port = PORT_TP;
1529 ethtool_cmd_speed_set(ecmd, SPEED_10);
1530 break; 1527 break;
1531 } 1528 }
1532 1529
1530 ethtool_cmd_speed_set(ecmd, 10);
1531
1533 if (dr32(MacMode) & FullDuplex) 1532 if (dr32(MacMode) & FullDuplex)
1534 ecmd->duplex = DUPLEX_FULL; 1533 ecmd->duplex = DUPLEX_FULL;
1535 else 1534 else
@@ -1549,11 +1548,8 @@ static int __de_set_settings(struct de_private *de, struct ethtool_cmd *ecmd)
1549{ 1548{
1550 u32 new_media; 1549 u32 new_media;
1551 unsigned int media_lock; 1550 unsigned int media_lock;
1552 u32 speed = ethtool_cmd_speed(ecmd);
1553 1551
1554 if (speed != SPEED_10 && speed != 5 && speed != 2) 1552 if (ethtool_cmd_speed(ecmd) != 10)
1555 return -EINVAL;
1556 if (de->de21040 && speed == 2)
1557 return -EINVAL; 1553 return -EINVAL;
1558 if (ecmd->duplex != DUPLEX_HALF && ecmd->duplex != DUPLEX_FULL) 1554 if (ecmd->duplex != DUPLEX_HALF && ecmd->duplex != DUPLEX_FULL)
1559 return -EINVAL; 1555 return -EINVAL;