mac80211: fix unaligned.h header location for 6.12 kernel
authorShiji Yang <yangshiji66@outlook.com>
Mon, 28 Apr 2025 14:15:51 +0000 (22:15 +0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 3 May 2025 18:16:25 +0000 (20:16 +0200)
Fix mt76 build error on 6.12 kernel:

In file included from /workspaces/openwrt/build_dir/target-x86_64_musl/linux-x86_64/mt76-2025.04.11~be28ef77/mt76x0/eeprom.c:13:
/workspaces/openwrt/staging_dir/target-x86_64_musl/usr/include/mac80211-backport/asm/unaligned.h:3:15: fatal error: asm/unaligned.h: No such file or directory
    3 | #include_next <asm/unaligned.h>
      |               ^~~~~~~~~~~~~~~~~

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18637
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/kernel/mac80211/patches/build/120-backport-fix-unaligned.h-header-location.patch [new file with mode: 0644]

diff --git a/package/kernel/mac80211/patches/build/120-backport-fix-unaligned.h-header-location.patch b/package/kernel/mac80211/patches/build/120-backport-fix-unaligned.h-header-location.patch
new file mode 100644 (file)
index 0000000..1fe6ab2
--- /dev/null
@@ -0,0 +1,26 @@
+From: Shiji Yang <yangshiji66@outlook.com>
+Date: Mon, 28 Apr 2025 22:03:18 +0800
+Subject: [PATCH] backport: fix unaligned.h header location
+
+unaligned.h was moved from include/asm-generic/ to include/linux/
+in 6.12-rc2 kernel.
+
+Link: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.12.y&id=5f60d5f6bbc12e782fac78110b0ee62698f3b576
+Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
+---
+ backport-include/asm/unaligned.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/backport-include/asm/unaligned.h
++++ b/backport-include/asm/unaligned.h
+@@ -1,6 +1,10 @@
+ #ifndef __BACKPORT_ASM_GENERIC_UNALIGNED_H
+ #define __BACKPORT_ASM_GENERIC_UNALIGNED_H
++#if LINUX_VERSION_IS_GEQ(6,12,0)
++#include_next <linux/unaligned.h>
++#else
+ #include_next <asm/unaligned.h>
++#endif
+ #if LINUX_VERSION_IS_LESS(5,7,0)
+ static inline u32 __get_unaligned_be24(const u8 *p)