summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/3com
diff options
context:
space:
mode:
authorPhilippe Reynes <tremyfr@gmail.com>2016-11-06 15:02:32 +0100
committerDavid S. Miller <davem@davemloft.net>2016-11-09 13:25:14 -0500
commitb12ab9b11966ee6c724e34b2f0f13ea76932b6bf (patch)
treebf59a5ec1224e28f8e315e1abb856d00a5faba14 /drivers/net/ethernet/3com
parent90fdd04e2c2c9090693922d855c267ddce77eff6 (diff)
downloadlinux-b12ab9b11966ee6c724e34b2f0f13ea76932b6bf.tar.bz2
net: 3com: typhoon: fix typhoon_get_link_ksettings
When moving from typhoon_get_settings to typhoon_getlink_ksettings in the commit f7a5537cd2a5 ("net: 3com: typhoon: use new api ethtool_{get|set}_link_ksettings"), we use a local variable supported but we forgot to update the struct ethtool_link_ksettings with this value. We also initialize advertising to zero, because otherwise it may be uninitialized if no case of the switch (tp->xcvr_select) is used. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/3com')
-rw-r--r--drivers/net/ethernet/3com/typhoon.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/ethernet/3com/typhoon.c b/drivers/net/ethernet/3com/typhoon.c
index dbdf06f2af49..a0cacbe846ba 100644
--- a/drivers/net/ethernet/3com/typhoon.c
+++ b/drivers/net/ethernet/3com/typhoon.c
@@ -1000,7 +1000,7 @@ typhoon_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct typhoon *tp = netdev_priv(dev);
- u32 supported, advertising;
+ u32 supported, advertising = 0;
supported = SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full |
SUPPORTED_Autoneg;
@@ -1049,6 +1049,11 @@ typhoon_get_link_ksettings(struct net_device *dev,
else
cmd->base.autoneg = AUTONEG_DISABLE;
+ ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
+ supported);
+ ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising,
+ advertising);
+
return 0;
}