forked from dlink-dir_819/openwrt
There is a patch/bug cascade in the realtek target phy code that must be resolved. 1. The phy_driver structure is patched to add features ONLY needed for RTL8214FC 2. The kernel is patched to allow switching fiber/copper port of phys through ethtool by calling these new features. 3. With those patches applied the bootup always switches RTL8214FC ports to copper. Even if a SFP module was found before and the phy driver switched to fibre before. 3. So another patch is needed that reprobes the SFP module to activate fiber again. 4. Because of the reprobing we need a fourth patch that avoid duplicate devices. Simplify this by removing all patches and reusing the existing ethtool phy tunable interface. The command line usage might be counterintuitive but it avoids tons of problems in the code. In addition, this scenario is not used frequently. Before:ethtool -s lan25 port fibre/tp After: ethtool --set-phy-tunable lan25 downshift on/off Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/18816 Signed-off-by: Robert Marko <robimarko@gmail.com>
50 lines
1.3 KiB
Diff
50 lines
1.3 KiB
Diff
From 2b88563ee5aafd9571d965b7f2093a0f58d98a31 Mon Sep 17 00:00:00 2001
|
|
From: John Crispin <john@phrozen.org>
|
|
Date: Thu, 26 Nov 2020 12:02:21 +0100
|
|
Subject: net: phy: EEE support for rtl838x
|
|
|
|
* rename the target to realtek
|
|
* add refactored DSA driver
|
|
* add latest gpio driver
|
|
* lots of arch cleanups
|
|
* new irq driver
|
|
* additional boards
|
|
|
|
Submitted-by: Bert Vermeulen <bert@biot.com>
|
|
Submitted-by: Birger Koblitz <mail@birger-koblitz.de>
|
|
Submitted-by: Sander Vanheule <sander@svanheule.net>
|
|
Submitted-by: Bjørn Mork <bjorn@mork.no>
|
|
Submitted-by: John Crispin <john@phrozen.org>
|
|
---
|
|
drivers/net/phy/phylink. | 14 +++++++++++--
|
|
1 file changed, 12 insertions(+), 2 deletions(-)
|
|
|
|
--- a/drivers/net/phy/phylink.c
|
|
+++ b/drivers/net/phy/phylink.c
|
|
@@ -2805,8 +2805,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;
|
|
}
|
|
@@ -2823,8 +2826,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;
|
|
}
|