aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/rtl838x/patches-5.4/704-drivers-net-phy-eee-support-for-rtl838x.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/rtl838x/patches-5.4/704-drivers-net-phy-eee-support-for-rtl838x.patch')
-rw-r--r--target/linux/rtl838x/patches-5.4/704-drivers-net-phy-eee-support-for-rtl838x.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/target/linux/rtl838x/patches-5.4/704-drivers-net-phy-eee-support-for-rtl838x.patch b/target/linux/rtl838x/patches-5.4/704-drivers-net-phy-eee-support-for-rtl838x.patch
new file mode 100644
index 0000000000..5262be53c6
--- /dev/null
+++ b/target/linux/rtl838x/patches-5.4/704-drivers-net-phy-eee-support-for-rtl838x.patch
@@ -0,0 +1,41 @@
+--- a/drivers/net/phy/phylink.c
++++ b/drivers/net/phy/phylink.c
+@@ -1244,6 +1244,11 @@
+
+ /* If we have a PHY, configure the phy */
+ if (pl->phydev) {
++ 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);
++ }
++ }
+ ret = phy_ethtool_ksettings_set(pl->phydev, &our_kset);
+ if (ret)
+ return ret;
+@@ -1422,8 +1427,11 @@
+
+ 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;
+ }
+@@ -1440,9 +1448,11 @@
+
+ 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;
+ }
+ EXPORT_SYMBOL_GPL(phylink_ethtool_set_eee);