[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201014125650.12137-1-l.stelmach@samsung.com>
Date: Wed, 14 Oct 2020 14:56:50 +0200
From: Łukasz Stelmach <l.stelmach@...sung.com>
To: Andrew Lunn <andrew@...n.ch>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Bartłomiej Żolnierkiewicz
<b.zolnierkie@...sung.com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Łukasz Stelmach <l.stelmach@...sung.com>
Subject: [PATCH] net: phy: Prevent reporting advertised modes when autoneg
is off
Do not report advertised link modes when autonegotiation is turned
off. mii_ethtool_get_link_ksettings() exhibits the same behaviour.
Signed-off-by: Łukasz Stelmach <l.stelmach@...sung.com>
---
drivers/net/phy/phy.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 35525a671400..3cadf224fdb2 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -315,7 +315,8 @@ void phy_ethtool_ksettings_get(struct phy_device *phydev,
struct ethtool_link_ksettings *cmd)
{
linkmode_copy(cmd->link_modes.supported, phydev->supported);
- linkmode_copy(cmd->link_modes.advertising, phydev->advertising);
+ if (phydev->autoneg)
+ linkmode_copy(cmd->link_modes.advertising, phydev->advertising);
linkmode_copy(cmd->link_modes.lp_advertising, phydev->lp_advertising);
cmd->base.speed = phydev->speed;
--
2.26.2
Powered by blists - more mailing lists