]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: proper RTL8214FC fibre/copper detection 18724/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Tue, 6 May 2025 06:44:43 +0000 (02:44 -0400)
committerRobert Marko <robimarko@gmail.com>
Fri, 9 May 2025 08:24:16 +0000 (10:24 +0200)
commit4cfd1c450181893a8063588eafd4eadef6a7e235
treec5de6a865433404a6651922953f2a75c1ad5c1fc
parent41728acc772a2f0cd5563a57379f321e94f79983
realtek: proper RTL8214FC fibre/copper detection

The RTL8214FC currently uses generic PHY functions. That makes it look like a copper
device. Switching to/from fibre works fortunately but the autonegotiation handling
still works on MII_LPA (PHY register 5) as if a copper link is used. Fix that by

- advertising a superset of TP/FIBRE features
- using clause 37 functions when on fibre

Additionally enhance the code of the driver to assist further development.

- log the speed of the inserted module to detect wrongly inserted 10gbase-r modules
- order phy driver functions alphabetically (keep match/name on top)
- remove genphy_loopback as the kernel uses it if not provided

Remark! The driver internally uses PORT_MII for the TP port. Align with that and
report MII to ethtool instead of TP. Other drivers do the same and it can be
changed in the future if needed.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/18724
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.6/drivers/net/phy/rtl83xx-phy.c