From b4bd85d504ef5f858e116b6f6b566621169fb094 Mon Sep 17 00:00:00 2001 From: Jonas Jelonek Date: Sun, 21 Dec 2025 13:14:04 +0000 Subject: [PATCH] realtek: pcs: add enum for port media 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 Link: https://github.com/openwrt/openwrt/pull/21385 Signed-off-by: Robert Marko --- .../files-6.12/drivers/net/pcs/pcs-rtl-otto.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c index 9974955a3a..3ba29b0dc9 100644 --- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c +++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c @@ -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 {