diff options
Diffstat (limited to 'drivers/net/forcedeth.c')
-rw-r--r-- | drivers/net/forcedeth.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 0e1c76a8c045..d24b3f3e646b 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -4029,6 +4029,7 @@ static int nv_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
4029 | static int nv_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | 4029 | static int nv_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) |
4030 | { | 4030 | { |
4031 | struct fe_priv *np = netdev_priv(dev); | 4031 | struct fe_priv *np = netdev_priv(dev); |
4032 | u32 speed = ethtool_cmd_speed(ecmd); | ||
4032 | 4033 | ||
4033 | if (ecmd->port != PORT_MII) | 4034 | if (ecmd->port != PORT_MII) |
4034 | return -EINVAL; | 4035 | return -EINVAL; |
@@ -4054,7 +4055,7 @@ static int nv_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
4054 | /* Note: autonegotiation disable, speed 1000 intentionally | 4055 | /* Note: autonegotiation disable, speed 1000 intentionally |
4055 | * forbidden - no one should need that. */ | 4056 | * forbidden - no one should need that. */ |
4056 | 4057 | ||
4057 | if (ecmd->speed != SPEED_10 && ecmd->speed != SPEED_100) | 4058 | if (speed != SPEED_10 && speed != SPEED_100) |
4058 | return -EINVAL; | 4059 | return -EINVAL; |
4059 | if (ecmd->duplex != DUPLEX_HALF && ecmd->duplex != DUPLEX_FULL) | 4060 | if (ecmd->duplex != DUPLEX_HALF && ecmd->duplex != DUPLEX_FULL) |
4060 | return -EINVAL; | 4061 | return -EINVAL; |
@@ -4138,13 +4139,13 @@ static int nv_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
4138 | 4139 | ||
4139 | adv = mii_rw(dev, np->phyaddr, MII_ADVERTISE, MII_READ); | 4140 | adv = mii_rw(dev, np->phyaddr, MII_ADVERTISE, MII_READ); |
4140 | adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4 | ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM); | 4141 | adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4 | ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM); |
4141 | if (ecmd->speed == SPEED_10 && ecmd->duplex == DUPLEX_HALF) | 4142 | if (speed == SPEED_10 && ecmd->duplex == DUPLEX_HALF) |
4142 | adv |= ADVERTISE_10HALF; | 4143 | adv |= ADVERTISE_10HALF; |
4143 | if (ecmd->speed == SPEED_10 && ecmd->duplex == DUPLEX_FULL) | 4144 | if (speed == SPEED_10 && ecmd->duplex == DUPLEX_FULL) |
4144 | adv |= ADVERTISE_10FULL; | 4145 | adv |= ADVERTISE_10FULL; |
4145 | if (ecmd->speed == SPEED_100 && ecmd->duplex == DUPLEX_HALF) | 4146 | if (speed == SPEED_100 && ecmd->duplex == DUPLEX_HALF) |
4146 | adv |= ADVERTISE_100HALF; | 4147 | adv |= ADVERTISE_100HALF; |
4147 | if (ecmd->speed == SPEED_100 && ecmd->duplex == DUPLEX_FULL) | 4148 | if (speed == SPEED_100 && ecmd->duplex == DUPLEX_FULL) |
4148 | adv |= ADVERTISE_100FULL; | 4149 | adv |= ADVERTISE_100FULL; |
4149 | np->pause_flags &= ~(NV_PAUSEFRAME_AUTONEG|NV_PAUSEFRAME_RX_ENABLE|NV_PAUSEFRAME_TX_ENABLE); | 4150 | np->pause_flags &= ~(NV_PAUSEFRAME_AUTONEG|NV_PAUSEFRAME_RX_ENABLE|NV_PAUSEFRAME_TX_ENABLE); |
4150 | if (np->pause_flags & NV_PAUSEFRAME_RX_REQ) {/* for rx we set both advertisements but disable tx pause */ | 4151 | if (np->pause_flags & NV_PAUSEFRAME_RX_REQ) {/* for rx we set both advertisements but disable tx pause */ |