aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/realtek/patches-5.10/704-drivers-net-phy-eee-support-for-rtl838x.patch
blob: 3cb04c086873c96567646b8e6de4ed358f510620 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -1449,6 +1449,11 @@ int phylink_ethtool_ksettings_set(struct
 		 *   the presence of a PHY, this should not be changed as that
 		 *   should be determined from the media side advertisement.
 		 */
+		if (pl->phydev->drv->get_port && pl->phydev->drv->set_port) {
+			if(pl->phydev->drv->get_port(pl->phydev) != kset->base.port) {
+				pl->phydev->drv->set_port(pl->phydev, kset->base.port);
+			}
+		}
 		return phy_ethtool_ksettings_set(pl->phydev, kset);
 	}
 
@@ -1750,8 +1755,11 @@ int phylink_ethtool_get_eee(struct phyli
 
 	ASSERT_RTNL();
 
-	if (pl->phydev)
+	if (pl->phydev) {
+		if (pl->phydev->drv->get_eee)
+			return pl->phydev->drv->get_eee(pl->phydev, eee);
 		ret = phy_ethtool_get_eee(pl->phydev, eee);
+	}
 
 	return ret;
 }
@@ -1768,8 +1776,11 @@ int phylink_ethtool_set_eee(struct phyli
 
 	ASSERT_RTNL();
 
-	if (pl->phydev)
+	if (pl->phydev) {
+		if (pl->phydev->drv->set_eee)
+			return pl->phydev->drv->set_eee(pl->phydev, eee);
 		ret = phy_ethtool_set_eee(pl->phydev, eee);
+	}
 
 	return ret;
 }