Skip to content

Commit

Permalink
net: 3com: typhoon: fix typhoon_get_link_ksettings
Browse files Browse the repository at this point in the history
When moving from typhoon_get_settings to typhoon_getlink_ksettings
in the commit f7a5537 ("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>
  • Loading branch information
Philippe Reynes authored and David S. Miller committed Nov 9, 2016
1 parent 90fdd04 commit b12ab9b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/ethernet/3com/typhoon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit b12ab9b

Please sign in to comment.