netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>,
	Russell King - ARM Linux <linux@armlinux.org.uk>,
	Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	David Miller <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: [PATCH net-next 4/5] net: phy: c45: add support for EEE link partner ability 2 to genphy_c45_read_eee_lpa
Date: Wed, 14 Feb 2024 21:18:50 +0100	[thread overview]
Message-ID: <be7f8af6-0acc-4289-aefe-d4bf5dd39a2f@gmail.com> (raw)
In-Reply-To: <558e122f-e900-4a17-a03a-2b9ec4fed124@gmail.com>

Add support for reading EEE link partner ability 2 register.

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 5a245f0cc..b09c6baf0 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -781,6 +781,17 @@ static int genphy_c45_read_eee_lpa(struct phy_device *phydev,
 		mii_eee_cap1_mod_linkmode_t(lpa, val);
 	}
 
+	if (linkmode_intersects(phydev->supported_eee, PHY_EEE_CAP2_FEATURES)) {
+		/* IEEE 802.3-2022 45.2.7.17 EEE link partner ability 2
+		 * (Register 7.63)
+		 */
+		val = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_EEE_LPABLE2);
+		if (val < 0)
+			return val;
+
+		mii_eee_cap2_mod_linkmode_adv_t(lpa, val);
+	}
+
 	if (linkmode_test_bit(ETHTOOL_LINK_MODE_10baseT1L_Full_BIT,
 			      phydev->supported_eee)) {
 		/* IEEE 802.3cg-2019 45.2.7.26 10BASE-T1 AN status register
-- 
2.43.1



  parent reply	other threads:[~2024-02-14 20:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14 20:15 [PATCH net-next 0/5] net: phy: add support for the EEE 2 registers Heiner Kallweit
2024-02-14 20:16 ` [PATCH net-next 1/5] net: mdio: add helpers for accessing the EEE CAP2 registers Heiner Kallweit
2024-02-14 20:17 ` [PATCH net-next 2/5] net: phy: add PHY_EEE_CAP2_FEATURES Heiner Kallweit
2024-02-14 20:18 ` [PATCH net-next 3/5] net: phy: c45: add and use genphy_c45_read_eee_cap2 Heiner Kallweit
2024-02-14 20:18 ` Heiner Kallweit [this message]
2024-02-14 20:19 ` [PATCH net-next 5/5] net: phy: c45: add support for MDIO_AN_EEE_ADV2 Heiner Kallweit
2024-02-17 18:50 ` [PATCH net-next 0/5] net: phy: add support for the EEE 2 registers patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=be7f8af6-0acc-4289-aefe-d4bf5dd39a2f@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).