[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231220155518.15692-10-kabel@kernel.org>
Date: Wed, 20 Dec 2023 16:55:12 +0100
From: Marek Behún <kabel@...nel.org>
To: netdev@...r.kernel.org,
Andrew Lunn <andrew@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: Russell King <rmk+kernel@...linux.org.uk>,
Alexander Couzens <lynxis@...0.eu>,
Daniel Golle <daniel@...rotopia.org>,
Heiner Kallweit <hkallweit1@...il.com>,
Willy Liu <willy.liu@...ltek.com>,
Ioana Ciornei <ioana.ciornei@....com>,
Marek Mojík <marek.mojik@....cz>,
Maximilián Maliar <maximilian.maliar@....cz>,
Marek Behún <kabel@...nel.org>
Subject: [PATCH net-next 09/15] net: phy: realtek: read standard MMD register for rtlgen speed capability
Read the standard "PMA/PMD speed ability" register instead of it's
vendor specific alias via paging in rtlgen_supports_2_5gbps(), which is
used by the .match_phy_device method.
Signed-off-by: Marek Behún <kabel@...nel.org>
---
drivers/net/phy/realtek.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index 66515981d2aa..0bb56d89157a 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -699,11 +699,7 @@ static int rtl822x_read_status(struct phy_device *phydev)
static bool rtlgen_supports_2_5gbps(struct phy_device *phydev)
{
- int val;
-
- phy_write(phydev, RTL821x_PAGE_SELECT, 0xa61);
- val = phy_read(phydev, 0x13);
- phy_write(phydev, RTL821x_PAGE_SELECT, 0);
+ int val = rtlgen_read_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_SPEED);
return val >= 0 && val & MDIO_PMA_SPEED_2_5G;
}
--
2.41.0
Powered by blists - more mailing lists