netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: phy: let genphy_c45_read_abilities also check aneg capability
@ 2019-02-22  7:23 Heiner Kallweit
  2019-02-22 16:51 ` Maxime Chevallier
  2019-02-24 20:35 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Heiner Kallweit @ 2019-02-22  7:23 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, David Miller; +Cc: netdev, Maxime Chevallier

When using genphy_c45_read_abilities() as get_features callback we
also have to set the autoneg capability in phydev->supported.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/phy-c45.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index 4835c96cb..f05ef267a 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -336,6 +336,17 @@ int genphy_c45_pma_read_abilities(struct phy_device *phydev)
 {
 	int val;
 
+	linkmode_clear_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, phydev->supported);
+	if (phydev->c45_ids.devices_in_package & MDIO_DEVS_AN) {
+		val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_STAT1);
+		if (val < 0)
+			return val;
+
+		if (val & MDIO_AN_STAT1_ABLE)
+			linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
+					 phydev->supported);
+	}
+
 	val = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_STAT2);
 	if (val < 0)
 		return val;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: phy: let genphy_c45_read_abilities also check aneg capability
  2019-02-22  7:23 [PATCH net-next] net: phy: let genphy_c45_read_abilities also check aneg capability Heiner Kallweit
@ 2019-02-22 16:51 ` Maxime Chevallier
  2019-02-24 20:35 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Chevallier @ 2019-02-22 16:51 UTC (permalink / raw)
  To: Heiner Kallweit; +Cc: Andrew Lunn, Florian Fainelli, David Miller, netdev

Hello Heiner,

On Fri, 22 Feb 2019 08:23:04 +0100
Heiner Kallweit <hkallweit1@gmail.com> wrote:

>When using genphy_c45_read_abilities() as get_features callback we
>also have to set the autoneg capability in phydev->supported.

>@@ -336,6 +336,17 @@ int genphy_c45_pma_read_abilities(struct phy_device *phydev)

This makes the helper not reading PMA-only registers, so the naming
isn't really relevant anymore, but that's a small detail.

Other than that,

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Thanks,

Maxime

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: phy: let genphy_c45_read_abilities also check aneg capability
  2019-02-22  7:23 [PATCH net-next] net: phy: let genphy_c45_read_abilities also check aneg capability Heiner Kallweit
  2019-02-22 16:51 ` Maxime Chevallier
@ 2019-02-24 20:35 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-02-24 20:35 UTC (permalink / raw)
  To: hkallweit1; +Cc: andrew, f.fainelli, netdev, maxime.chevallier

From: Heiner Kallweit <hkallweit1@gmail.com>
Date: Fri, 22 Feb 2019 08:23:04 +0100

> When using genphy_c45_read_abilities() as get_features callback we
> also have to set the autoneg capability in phydev->supported.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-24 20:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-22  7:23 [PATCH net-next] net: phy: let genphy_c45_read_abilities also check aneg capability Heiner Kallweit
2019-02-22 16:51 ` Maxime Chevallier
2019-02-24 20:35 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).