]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: phy: 6.18: switch to sfp module caps
authorJonas Jelonek <jelonek.jonas@gmail.com>
Tue, 16 Dec 2025 16:51:22 +0000 (16:51 +0000)
committerRobert Marko <robimarko@gmail.com>
Sun, 29 Mar 2026 16:08:21 +0000 (18:08 +0200)
Kernel 6.18 uses dedicated sfp_module_caps instead of a plain bitmask
for supported modes. Switch to that the fix the rtl83xx-phy driver.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21181
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.18/drivers/net/phy/realtek/realtek_multiport.c

index 3074e5785843d4452c1964592676e7f1db23003e..bc9066726ec05c9250bca0f94f69cf102424229f 100644 (file)
@@ -397,13 +397,12 @@ static int rtl8214fc_write_mmd(struct phy_device *phydev, int devnum, u16 regnum
 
 static int rtl8214fc_sfp_insert(void *upstream, const struct sfp_eeprom_id *id)
 {
-       __ETHTOOL_DECLARE_LINK_MODE_MASK(support) = { 0, };
-       DECLARE_PHY_INTERFACE_MASK(interfaces);
        struct phy_device *phydev = upstream;
+       const struct sfp_module_caps *caps;
        phy_interface_t iface;
 
-       sfp_parse_support(phydev->sfp_bus, id, support, interfaces);
-       iface = sfp_select_interface(phydev->sfp_bus, support);
+       caps = sfp_get_module_caps(phydev->sfp_bus);
+       iface = sfp_select_interface(phydev->sfp_bus, caps->link_modes);
 
        phydev_info(phydev, "%s SFP module inserted\n", phy_modes(iface));