mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-19 05:38:00 +00:00
13cdc8955c
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.80 Manually rebased: generic/hack-6.1/650-netfilter-add-xt_FLOWOFFLOAD-target.patch[1] All other patches automatically rebased. 1. Acknowledgement to @heheb and @DragonBluep. Upstream commit for ref: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.80&id=9c5662e95a8dcc232c3ef4deb21033badcd260f6 Build system: x86/64 Build-tested: x86/64/AMD Cezanne, ramips/tplink_archer-a6-v3 Run-tested: x86/64/AMD Cezanne, ramips/tplink_archer-a6-v3 Signed-off-by: John Audia <therealgraysky@proton.me>
61 lines
2.1 KiB
Diff
61 lines
2.1 KiB
Diff
From 92c8b9d558160d94b981dd8a2b9c47657627ffdc Mon Sep 17 00:00:00 2001
|
|
From: Daniel Golle <daniel@makrotopia.org>
|
|
Date: Sat, 22 Apr 2023 01:23:08 +0100
|
|
Subject: [PATCH 2/3] net: phy: realtek: use inline functions for 10GbE
|
|
advertisement
|
|
|
|
Use existing generic inline functions to encode local advertisement
|
|
of 10GbE link modes as well as to decode link-partner advertisement.
|
|
|
|
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|
---
|
|
drivers/net/phy/realtek.c | 22 +++++-----------------
|
|
1 file changed, 5 insertions(+), 17 deletions(-)
|
|
|
|
--- a/drivers/net/phy/realtek.c
|
|
+++ b/drivers/net/phy/realtek.c
|
|
@@ -68,10 +68,6 @@
|
|
#define RTL_SUPPORTS_5000FULL BIT(14)
|
|
#define RTL_SUPPORTS_2500FULL BIT(13)
|
|
#define RTL_SUPPORTS_10000FULL BIT(0)
|
|
-#define RTL_ADV_2500FULL BIT(7)
|
|
-#define RTL_LPADV_10000FULL BIT(11)
|
|
-#define RTL_LPADV_5000FULL BIT(6)
|
|
-#define RTL_LPADV_2500FULL BIT(5)
|
|
|
|
#define RTL9000A_GINMR 0x14
|
|
#define RTL9000A_GINMR_LINK_STATUS BIT(4)
|
|
@@ -671,14 +667,11 @@ static int rtl822x_config_aneg(struct ph
|
|
int ret = 0;
|
|
|
|
if (phydev->autoneg == AUTONEG_ENABLE) {
|
|
- u16 adv2500 = 0;
|
|
-
|
|
- if (linkmode_test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
|
|
- phydev->advertising))
|
|
- adv2500 = RTL_ADV_2500FULL;
|
|
-
|
|
ret = phy_modify_paged_changed(phydev, 0xa5d, 0x12,
|
|
- RTL_ADV_2500FULL, adv2500);
|
|
+ MDIO_AN_10GBT_CTRL_ADV10G |
|
|
+ MDIO_AN_10GBT_CTRL_ADV5G |
|
|
+ MDIO_AN_10GBT_CTRL_ADV2_5G,
|
|
+ linkmode_adv_to_mii_10gbt_adv_t(phydev->advertising));
|
|
if (ret < 0)
|
|
return ret;
|
|
}
|
|
@@ -715,12 +708,7 @@ static int rtl822x_read_status(struct ph
|
|
if (lpadv < 0)
|
|
return lpadv;
|
|
|
|
- linkmode_mod_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT,
|
|
- phydev->lp_advertising, lpadv & RTL_LPADV_10000FULL);
|
|
- linkmode_mod_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
|
|
- phydev->lp_advertising, lpadv & RTL_LPADV_5000FULL);
|
|
- linkmode_mod_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
|
|
- phydev->lp_advertising, lpadv & RTL_LPADV_2500FULL);
|
|
+ mii_10gbt_stat_mod_linkmode_lpa_t(phydev->lp_advertising, lpadv);
|
|
}
|
|
|
|
ret = rtlgen_read_status(phydev);
|