From: Julius Bairaktaris Date: Thu, 2 Jul 2026 18:48:12 +0000 (+0200) Subject: qualcommax: dwmac-ipq5018: support the kernel 6.18 stmmac API X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32aa686d97c7e83da62a912eb0fa7e84ab59a8e2;p=thirdparty%2Fopenwrt.git qualcommax: dwmac-ipq5018: support the kernel 6.18 stmmac API The fix_mac_speed() callback takes the speed as an int on 6.18 (SPEED_UNKNOWN is negative); it was unsigned int on 6.12. Select the prototype on LINUX_VERSION_CODE so the driver keeps building on the 6.12 main kernel and on the 6.18 testing kernel. Signed-off-by: Julius Bairaktaris Link: https://github.com/openwrt/openwrt/pull/24031 Signed-off-by: Jonas Jelonek --- diff --git a/target/linux/qualcommax/files/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq5018.c b/target/linux/qualcommax/files/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq5018.c index 0caabd93516..54ec16f17f7 100644 --- a/target/linux/qualcommax/files/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq5018.c +++ b/target/linux/qualcommax/files/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq5018.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "stmmac_platform.h" @@ -35,7 +36,11 @@ struct ipq5018_gmac { struct clk *tx_clk; }; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 18, 0) +static void ipq5018_gmac_fix_speed(void *priv, int speed, unsigned int mode) +#else static void ipq5018_gmac_fix_speed(void *priv, unsigned int speed, unsigned int mode) +#endif { struct ipq5018_gmac *gmac = priv; unsigned long rate;