aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ksz884x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ksz884x.c')
-rw-r--r--drivers/net/ksz884x.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/ksz884x.c b/drivers/net/ksz884x.c
index 2c37a3804303..41ea5920c158 100644
--- a/drivers/net/ksz884x.c
+++ b/drivers/net/ksz884x.c
@@ -5998,6 +5998,7 @@ static int netdev_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
5998 struct dev_priv *priv = netdev_priv(dev); 5998 struct dev_priv *priv = netdev_priv(dev);
5999 struct dev_info *hw_priv = priv->adapter; 5999 struct dev_info *hw_priv = priv->adapter;
6000 struct ksz_port *port = &priv->port; 6000 struct ksz_port *port = &priv->port;
6001 u32 speed = ethtool_cmd_speed(cmd);
6001 int rc; 6002 int rc;
6002 6003
6003 /* 6004 /*
@@ -6006,11 +6007,11 @@ static int netdev_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
6006 */ 6007 */
6007 if (cmd->autoneg && priv->advertising == cmd->advertising) { 6008 if (cmd->autoneg && priv->advertising == cmd->advertising) {
6008 cmd->advertising |= ADVERTISED_ALL; 6009 cmd->advertising |= ADVERTISED_ALL;
6009 if (10 == cmd->speed) 6010 if (10 == speed)
6010 cmd->advertising &= 6011 cmd->advertising &=
6011 ~(ADVERTISED_100baseT_Full | 6012 ~(ADVERTISED_100baseT_Full |
6012 ADVERTISED_100baseT_Half); 6013 ADVERTISED_100baseT_Half);
6013 else if (100 == cmd->speed) 6014 else if (100 == speed)
6014 cmd->advertising &= 6015 cmd->advertising &=
6015 ~(ADVERTISED_10baseT_Full | 6016 ~(ADVERTISED_10baseT_Full |
6016 ADVERTISED_10baseT_Half); 6017 ADVERTISED_10baseT_Half);
@@ -6032,8 +6033,8 @@ static int netdev_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
6032 port->force_link = 0; 6033 port->force_link = 0;
6033 } else { 6034 } else {
6034 port->duplex = cmd->duplex + 1; 6035 port->duplex = cmd->duplex + 1;
6035 if (cmd->speed != 1000) 6036 if (1000 != speed)
6036 port->speed = cmd->speed; 6037 port->speed = speed;
6037 if (cmd->autoneg) 6038 if (cmd->autoneg)
6038 port->force_link = 0; 6039 port->force_link = 0;
6039 else 6040 else