public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail•com>
To: "Marek Behún" <kabel@kernel•org>, "Andrew Lunn" <andrew@lunn•ch>,
	"Russell King - ARM Linux" <linux@armlinux•org.uk>,
	"Jakub Kicinski" <kuba@kernel•org>,
	"David Miller" <davem@davemloft•net>,
	"Paolo Abeni" <pabeni@redhat•com>,
	"Eric Dumazet" <edumazet@google•com>
Cc: "netdev@vger•kernel.org" <netdev@vger•kernel.org>
Subject: [PATCH net-next 3/3] net: phy: realtek: add 5Gbps support to rtl822x_config_aneg()
Date: Sun, 4 Feb 2024 15:18:50 +0100	[thread overview]
Message-ID: <5644ab50-e3e9-477c-96db-05cd5bdc2563@gmail.com> (raw)
In-Reply-To: <31a83fd9-90ce-402a-84c7-d5c20540b730@gmail.com>

RTL8126 as an evolution of RTL8125 supports 5Gbps. rtl822x_config_aneg()
is used by the PHY driver for the integrated PHY, therefore add 5Gbps
support to it.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail•com>
---
 drivers/net/phy/realtek.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index ffc13c495..06f6672a4 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -680,15 +680,19 @@ static int rtl822x_config_aneg(struct phy_device *phydev)
 	int ret = 0;
 
 	if (phydev->autoneg == AUTONEG_ENABLE) {
-		u16 adv2500 = 0;
+		u16 adv = 0;
 
 		if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
 				      phydev->advertising))
-			adv2500 = MDIO_AN_10GBT_CTRL_ADV2_5G;
+			adv |= MDIO_AN_10GBT_CTRL_ADV2_5G;
+		if (linkmode_test_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
+				      phydev->advertising))
+			adv |= MDIO_AN_10GBT_CTRL_ADV5G;
 
 		ret = phy_modify_paged_changed(phydev, 0xa5d, 0x12,
-					       MDIO_AN_10GBT_CTRL_ADV2_5G,
-					       adv2500);
+					       MDIO_AN_10GBT_CTRL_ADV2_5G |
+					       MDIO_AN_10GBT_CTRL_ADV5G,
+					       adv);
 		if (ret < 0)
 			return ret;
 	}
-- 
2.43.0



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

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-04 14:15 [PATCH net-next 0/3] net: phy: realtek: complete 5Gbps support and replace private constants Heiner Kallweit
2024-02-04 14:16 ` [PATCH net-next 1/3] net: mdio: add 2.5g and 5g related PMA speed constants Heiner Kallweit
2024-02-04 14:17 ` [PATCH net-next 2/3] net: phy: realtek: use generic MDIO constants Heiner Kallweit
2024-02-04 16:00   ` Andrew Lunn
2024-02-04 16:26     ` Heiner Kallweit
2024-02-04 16:35       ` Heiner Kallweit
2024-02-07 19:51         ` Heiner Kallweit
2024-02-07 20:28           ` Andrew Lunn
2024-02-07 21:19           ` Heiner Kallweit
2024-02-07 22:31             ` Andrew Lunn
2024-02-08  7:18               ` Heiner Kallweit
2024-02-04 14:18 ` Heiner Kallweit [this message]
2024-02-08  2:30 ` [PATCH net-next 0/3] net: phy: realtek: complete 5Gbps support and replace private constants 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=5644ab50-e3e9-477c-96db-05cd5bdc2563@gmail.com \
    --to=hkallweit1@gmail$(echo .)com \
    --cc=andrew@lunn$(echo .)ch \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=kabel@kernel$(echo .)org \
    --cc=kuba@kernel$(echo .)org \
    --cc=linux@armlinux$(echo .)org.uk \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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