]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: pcs: store active media type in SerDes state
authorJonas Jelonek <jelonek.jonas@gmail.com>
Sat, 27 Jun 2026 17:50:12 +0000 (17:50 +0000)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Sun, 28 Jun 2026 21:38:36 +0000 (23:38 +0200)
Track the resolved media type in struct rtpcs_serdes alongside hw_mode,
storing it as soon as rtpcs_sds_select_media() resolves it so all
subsequent ops (set_hw_mode, activate, post_config) can access it.

This is unused for now and will be used only in dead code in next
patches. Though, this dead code is going to be used with subsequent
patches.

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

index 9f03e6bd5c8620992dc89c7a6eede7a7975b9a4d..49b93cdc21eb249b338b3e5eb6cc34cc2842c703 100644 (file)
@@ -294,6 +294,7 @@ struct rtpcs_serdes {
        s16 link_port[RTPCS_MAX_LINKS_PER_SDS];
 
        enum rtpcs_sds_mode hw_mode;
+       enum rtpcs_sds_media media;
        u8 id;
        u8 num_of_links;
        bool first_start;
@@ -4011,6 +4012,8 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
                                if (ret < 0)
                                        return ret;
 
+                               sds->media = sds_media;
+
                                ret = sds->ops->config_media(sds, sds_media, hw_mode);
                                if (ret < 0)
                                        return ret;