1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-03-09 15:40:20 +00:00

Add qualcommax kernel 6.12 support

This commit is contained in:
Ycarus (Yannick Chabanois) 2025-01-10 18:11:03 +01:00
parent cb0fb6be18
commit 2ac3cb3c06
55 changed files with 18140 additions and 0 deletions

View file

@ -0,0 +1,72 @@
From ef91390278b98b48adf65e6d3b772ddecfc4f6b0 Mon Sep 17 00:00:00 2001
From: Mantas Pucka <mantas@8devices.com>
Date: Tue, 10 Dec 2024 13:05:30 +0200
Subject: [PATCH 7/9] ssdk: replace deprecated strlcpy() with strscpy()
Since linux-6.12 strlcpy() is no longer available
Signed-off-by: Mantas Pucka <mantas@8devices.com>
---
src/shell_lib/shell_io.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
--- a/src/shell_lib/shell_io.c
+++ b/src/shell_lib/shell_io.c
@@ -951,16 +951,16 @@ cmd_sscanf(const char *buf, const char *
if(buf[0] == '0' && (buf[1] == 'x' || buf[1] == 'X'))
{
if(!fmt)
- strlcpy(fmt_tmp, "%x", sizeof(fmt_tmp));
+ strscpy(fmt_tmp, "%x", sizeof(fmt_tmp));
else
{
if(strspn(fmt, "%lLxXhH") != strlen(fmt))
return SW_BAD_VALUE;
if(fmt[0] == '%' && ((fmt[1] == 'l' || fmt[1] == 'L') &&
(fmt[2] == 'l' || fmt[2] == 'L')))
- strlcpy(fmt_tmp, "%llx", sizeof(fmt_tmp));
+ strscpy(fmt_tmp, "%llx", sizeof(fmt_tmp));
else
- strlcpy(fmt_tmp, fmt, sizeof(fmt_tmp));
+ strscpy(fmt_tmp, fmt, sizeof(fmt_tmp));
}
}
else
@@ -968,16 +968,16 @@ cmd_sscanf(const char *buf, const char *
if(strspn(buf, "1234567890") != strlen(buf))
return SW_BAD_VALUE;
if(!fmt)
- strlcpy(fmt_tmp, "%d", sizeof(fmt_tmp));
+ strscpy(fmt_tmp, "%d", sizeof(fmt_tmp));
else
{
if(strspn(fmt, "%lLdD") != strlen(fmt))
return SW_BAD_VALUE;
if(fmt[0] == '%' && ((fmt[1] == 'l' || fmt[1] == 'L') &&
(fmt[2] == 'l' || fmt[2] == 'L')))
- strlcpy(fmt_tmp, "%lld", sizeof(fmt_tmp));
+ strscpy(fmt_tmp, "%lld", sizeof(fmt_tmp));
else
- strlcpy(fmt_tmp, fmt, sizeof(fmt_tmp));
+ strscpy(fmt_tmp, fmt, sizeof(fmt_tmp));
}
}
if(sscanf(buf, fmt_tmp, arg_val) != 1)
@@ -2736,7 +2736,7 @@ cmd_data_check_portmap(char *cmdstr, fal
return SW_OK;
}
- strlcpy(tmp_str, cmdstr, sizeof(tmp_str));
+ strscpy(tmp_str, cmdstr, sizeof(tmp_str));
tmp = (void *) strsep(&cmdstr, ",");
while (tmp)
{
@@ -12818,7 +12818,7 @@ cmd_data_check_tunnel_encap_entry(char *
break;
}
/* copy 2 chars from cmd */
- strlcpy(cmd_byte, cmd, sizeof(cmd_byte));
+ strscpy(cmd_byte, cmd, sizeof(cmd_byte));
sscanf(cmd_byte, "%hhx",
&(entry.pkt_header.pkt_header_data[bytes]));
cmd += 2;

View file

@ -0,0 +1,25 @@
From 85c328ef31f3da7b2dab82c5a1c8559295620f76 Mon Sep 17 00:00:00 2001
From: Mantas Pucka <mantas@8devices.com>
Date: Tue, 10 Dec 2024 13:10:07 +0200
Subject: [PATCH 8/9] ssdk: disable warnings to support linux-6.12
Linux 6.12 adds these new warnings which become build errors with
default -Werror.
Signed-off-by: Mantas Pucka <mantas@8devices.com>
---
make/linux_opt.mk | 3 +++
1 file changed, 3 insertions(+)
--- a/make/linux_opt.mk
+++ b/make/linux_opt.mk
@@ -314,6 +314,9 @@ endif
MODULE_CFLAG += $(OPT_FLAG) -Wall -DVERSION=\"$(VERSION)\" -DBUILD_DATE=\"$(BUILD_DATE)\" -DOS=\"$(OS)\" -D"KBUILD_STR(s)=\#s"
+# Linux 6.12 compatibility
+MODULE_CFLAG += -Wno-missing-prototypes -Wno-missing-declarations -Wno-discarded-qualifiers
+
MODULE_INC += -I$(PRJ_PATH)/include \
-I$(PRJ_PATH)/include/common \
-I$(PRJ_PATH)/include/api \

View file

@ -0,0 +1,22 @@
From 01e7ad1b785b0662e9a2f41cb7dffbcea35ed0c1 Mon Sep 17 00:00:00 2001
From: Mantas Pucka <mantas@8devices.com>
Date: Tue, 10 Dec 2024 13:13:16 +0200
Subject: [PATCH 9/9] ssdk: add missing include
Fixes build with linux 6.12
Signed-off-by: Mantas Pucka <mantas@8devices.com>
---
src/init/ssdk_dts.c | 1 +
1 file changed, 1 insertion(+)
--- a/src/init/ssdk_dts.c
+++ b/src/init/ssdk_dts.c
@@ -38,6 +38,7 @@
#include <linux/of.h>
#include <linux/of_mdio.h>
#include <linux/of_platform.h>
+#include <linux/platform_device.h>
static ssdk_dt_global_t ssdk_dt_global = {0};
#ifdef HPPE

View file

@ -0,0 +1,50 @@
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,19 @@
-include ./config
-
ifndef PRJ_PATH
PRJ_PATH=$(shell pwd)
endif
export PRJ_PATH
-include ./make/config.mk
-include ./make/tools.mk
-include ./make/$(OS)_opt.mk
+include $(PRJ_PATH)/config
+
+include $(PRJ_PATH)/make/config.mk
+include $(PRJ_PATH)/make/tools.mk
+include $(PRJ_PATH)/make/$(OS)_opt.mk
SUB_DIR=$(patsubst %/, %, $(dir $(wildcard src/*/Makefile)))
SUB_LIB=$(subst src/, , $(SUB_DIR))
+include $(PRJ_PATH)/Makefile.modules
+
####################################################################
# SSDK-Style Makefile
####################################################################
@@ -27,11 +29,7 @@ all: $(BIN_DIR) kslib
# LNX Modules-Style Makefile
####################################################################
modules: $(BIN_DIR) kslib_c
- mkdir -p ./temp/;cp * ./temp -a;cd ./temp;cp ../Makefile.modules ./Makefile;
- make -C $(SYS_PATH) M=$(PRJ_PATH)/temp $(LNX_MAKEOPTS) modules
- cp $(PRJ_PATH)/temp/Module.symvers $(PRJ_PATH)/Module.symvers;
- cp temp/*.ko build/bin;
- rm -Rf ./temp/*.o ./temp/*.ko ./temp/*.a
+ @$(MAKE) -C $(SYS_PATH) M=$(PRJ_PATH) $(LNX_MAKEOPTS) modules
@echo "---Build [SSDK-$(VERSION)] at $(BUILD_DATE) finished."
kslib_c:
--- a/make/linux_opt.mk
+++ b/make/linux_opt.mk
@@ -785,6 +785,6 @@ LOCAL_CFLAGS += $(CPU_CFLAG) -D"KBUILD_M
####################################################################
# cflags for LNX Modules-Style Makefile
####################################################################
-LNX_LOCAL_CFLAGS += $(MODULE_INC) $(MODULE_CFLAG) ${EXTRA_INC} -DFALLTHROUGH
+LNX_LOCAL_CFLAGS = $(MODULE_INC) $(MODULE_CFLAG) ${EXTRA_INC} -DFALLTHROUGH
export LNX_LOCAL_CFLAGS