realtek: dsa: enhance pcs_get_state() for RTL93xx
authorHarshal Gohel <[email protected]>
Mon, 14 Jul 2025 08:37:28 +0000 (10:37 +0200)
committerHauke Mehrtens <[email protected]>
Thu, 7 Aug 2025 13:50:01 +0000 (15:50 +0200)
commit9ccfca33038ac27cedca6f6bb18f18c47a7e38d0
treebd0176016a06079917fc68b9013ea389ecfa3711
parent2645c4afbb0935ed91d38c961037465078078064
realtek: dsa: enhance pcs_get_state() for RTL93xx

Currently the SerDes driven SFP ports give strange ethtool readings
on RTL93xx devices. Especially duplex and speed are shown even if
no link is up and running. That leads to confusion because the MAC
reports arbitrary values.

Enhance the readout by refactoring the pcs_get_state() function.
Calculate speed/duplex/pause only if link is detected.

Suggested-by: Markus Stockhausen <[email protected]>
Signed-off-by: Harshal Gohel <[email protected]>
Signed-off-by: Sharadanand Karanjkar <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/19575
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/dsa.c