aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cassini.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/cassini.c')
-rw-r--r--drivers/net/cassini.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index 143a28c666af..a6c3f8c8c302 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -709,10 +709,11 @@ static void cas_begin_auto_negotiation(struct cas *cp, struct ethtool_cmd *ep)
709 if (ep->autoneg == AUTONEG_ENABLE) 709 if (ep->autoneg == AUTONEG_ENABLE)
710 cp->link_cntl = BMCR_ANENABLE; 710 cp->link_cntl = BMCR_ANENABLE;
711 else { 711 else {
712 u32 speed = ethtool_cmd_speed(ep);
712 cp->link_cntl = 0; 713 cp->link_cntl = 0;
713 if (ep->speed == SPEED_100) 714 if (speed == SPEED_100)
714 cp->link_cntl |= BMCR_SPEED100; 715 cp->link_cntl |= BMCR_SPEED100;
715 else if (ep->speed == SPEED_1000) 716 else if (speed == SPEED_1000)
716 cp->link_cntl |= CAS_BMCR_SPEED1000; 717 cp->link_cntl |= CAS_BMCR_SPEED1000;
717 if (ep->duplex == DUPLEX_FULL) 718 if (ep->duplex == DUPLEX_FULL)
718 cp->link_cntl |= BMCR_FULLDPLX; 719 cp->link_cntl |= BMCR_FULLDPLX;
@@ -4653,6 +4654,7 @@ static int cas_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
4653{ 4654{
4654 struct cas *cp = netdev_priv(dev); 4655 struct cas *cp = netdev_priv(dev);
4655 unsigned long flags; 4656 unsigned long flags;
4657 u32 speed = ethtool_cmd_speed(cmd);
4656 4658
4657 /* Verify the settings we care about. */ 4659 /* Verify the settings we care about. */
4658 if (cmd->autoneg != AUTONEG_ENABLE && 4660 if (cmd->autoneg != AUTONEG_ENABLE &&
@@ -4660,9 +4662,9 @@ static int cas_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
4660 return -EINVAL; 4662 return -EINVAL;
4661 4663
4662 if (cmd->autoneg == AUTONEG_DISABLE && 4664 if (cmd->autoneg == AUTONEG_DISABLE &&
4663 ((cmd->speed != SPEED_1000 && 4665 ((speed != SPEED_1000 &&
4664 cmd->speed != SPEED_100 && 4666 speed != SPEED_100 &&
4665 cmd->speed != SPEED_10) || 4667 speed != SPEED_10) ||
4666 (cmd->duplex != DUPLEX_HALF && 4668 (cmd->duplex != DUPLEX_HALF &&
4667 cmd->duplex != DUPLEX_FULL))) 4669 cmd->duplex != DUPLEX_FULL)))
4668 return -EINVAL; 4670 return -EINVAL;