aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cassini.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/cassini.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/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;