]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
qualcommax: dwmac-ipq5018: support the kernel 6.18 stmmac API
authorJulius Bairaktaris <julius@bairaktaris.de>
Thu, 2 Jul 2026 18:48:12 +0000 (20:48 +0200)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Mon, 27 Jul 2026 07:34:38 +0000 (09:34 +0200)
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 <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24031
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
target/linux/qualcommax/files/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq5018.c

index 0caabd9351625787844c272d1b74d2166262330c..54ec16f17f79217659555dc0d6ef8ff7d8467180 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/platform_device.h>
 #include <linux/reset.h>
 #include <linux/stmmac.h>
+#include <linux/version.h>
 
 #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;