realtek: pcs: add enum for port media
authorJonas Jelonek <jelonek.jonas@gmail.com>
Sun, 21 Dec 2025 13:14:04 +0000 (13:14 +0000)
committerRobert Marko <robimarko@gmail.com>
Wed, 7 Jan 2026 10:01:11 +0000 (11:01 +0100)
The Realtek SDK includes a lot of code around specific port media,
usually having quite some differences between 10G fiber, 1G fiber and
DAC cables. For each type, several magic values are set which in the end
usually make different kinds of links work optimal.

While there is currently no way to get that media information from the
kernel, add some fields as an enum to have a notion of different media
kinds. In additional steps, code for the subtargets can be taken over
from the SDK to handle different media.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21385
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c

index 9974955a3a3f4b2742f65a95acf69589def72b36..3ba29b0dc9ba0ab1f2ad998a8903331eff65904c 100644 (file)
@@ -131,6 +131,18 @@ enum rtpcs_sds_mode {
        RTPCS_SDS_MODE_USXGMII_2_5GSXGMII,
 };
 
+enum rtpcs_port_media {
+       RTPCS_PORT_MEDIA_NONE,
+       RTPCS_PORT_MEDIA_FIBER_100M,
+       RTPCS_PORT_MEDIA_FIBER_1G,
+       RTPCS_PORT_MEDIA_FIBER_2_5G,
+       RTPCS_PORT_MEDIA_FIBER_10G,
+       RTPCS_PORT_MEDIA_DAC_50CM,
+       RTPCS_PORT_MEDIA_DAC_100CM,
+       RTPCS_PORT_MEDIA_DAC_300CM,
+       RTPCS_PORT_MEDIA_DAC_500CM,
+};
+
 struct rtpcs_ctrl;
 
 struct rtpcs_serdes {