Skip to content

Commit 0746472

Browse files
hkallweitNipaLocal
authored andcommitted
r8169: copy vendor driver 2.5G/5G EEE advertisement constraints
Vendor driver r8125 doesn't advertise 2.5G EEE on RTL8125A, and r8126 doesn't advertise 5G EEE. Likely there are compatibility issues, therefore do the same in r8169. With this change we don't have to disable 2.5G EEE advertisement in rtl8125a_config_eee_phy() any longer. We use new phylib accessor phy_set_eee_broken() to mark the respective EEE modes as broken. Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 87f78d8 commit 0746472

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5228,6 +5228,12 @@ static int r8169_mdio_register(struct rtl8169_private *tp)
52285228
phy_support_eee(tp->phydev);
52295229
phy_support_asym_pause(tp->phydev);
52305230

5231+
/* mimic behavior of r8125/r8126 vendor drivers */
5232+
if (tp->mac_version == RTL_GIGA_MAC_VER_61)
5233+
phy_set_eee_broken(tp->phydev,
5234+
ETHTOOL_LINK_MODE_2500baseT_Full_BIT);
5235+
phy_set_eee_broken(tp->phydev, ETHTOOL_LINK_MODE_5000baseT_Full_BIT);
5236+
52315237
/* PHY will be woken up in rtl_open() */
52325238
phy_suspend(tp->phydev);
52335239

drivers/net/ethernet/realtek/r8169_phy_config.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,7 @@ static void rtl8125_common_config_eee_phy(struct phy_device *phydev)
9696
phy_modify_paged(phydev, 0xa4a, 0x11, 0x0200, 0x0000);
9797
}
9898

99-
static void rtl8125a_config_eee_phy(struct phy_device *phydev)
100-
{
101-
rtl8168g_config_eee_phy(phydev);
102-
/* disable EEE at 2.5Gbps */
103-
phy_modify_paged(phydev, 0xa6d, 0x12, 0x0001, 0x0000);
104-
rtl8125_common_config_eee_phy(phydev);
105-
}
106-
107-
static void rtl8125b_config_eee_phy(struct phy_device *phydev)
99+
static void rtl8125_config_eee_phy(struct phy_device *phydev)
108100
{
109101
rtl8168g_config_eee_phy(phydev);
110102
rtl8125_common_config_eee_phy(phydev);
@@ -1066,7 +1058,7 @@ static void rtl8125a_2_hw_phy_config(struct rtl8169_private *tp,
10661058
rtl8168g_enable_gphy_10m(phydev);
10671059

10681060
rtl8168g_disable_aldps(phydev);
1069-
rtl8125a_config_eee_phy(phydev);
1061+
rtl8125_config_eee_phy(phydev);
10701062
}
10711063

10721064
static void rtl8125b_hw_phy_config(struct rtl8169_private *tp,
@@ -1106,7 +1098,7 @@ static void rtl8125b_hw_phy_config(struct rtl8169_private *tp,
11061098

11071099
rtl8125_legacy_force_mode(phydev);
11081100
rtl8168g_disable_aldps(phydev);
1109-
rtl8125b_config_eee_phy(phydev);
1101+
rtl8125_config_eee_phy(phydev);
11101102
}
11111103

11121104
static void rtl8125d_hw_phy_config(struct rtl8169_private *tp,
@@ -1116,7 +1108,7 @@ static void rtl8125d_hw_phy_config(struct rtl8169_private *tp,
11161108
rtl8168g_enable_gphy_10m(phydev);
11171109
rtl8125_legacy_force_mode(phydev);
11181110
rtl8168g_disable_aldps(phydev);
1119-
rtl8125b_config_eee_phy(phydev);
1111+
rtl8125_config_eee_phy(phydev);
11201112
}
11211113

11221114
static void rtl8126a_hw_phy_config(struct rtl8169_private *tp,

0 commit comments

Comments
 (0)