gateway-dk: take the mwifiex driver patches from ASK

ASK now carries the NXP mwifiex fixes for each kernel line next to its
Yocto recipe: the cfg80211 set_monitor_channel compat fix this tree
kept a copy of, plus fixes for skb ownership, ralist locking, A-MSDU
aggregation and scan teardown. Apply them in order from the pinned ASK
tree, failing if there are none for the kernel line, and drop the local
copy of the first one.
This commit is contained in:
Tomaz Zaman 2026-11-25 00:14:50 +01:00 • committed by Igor
parent 992d4febc8
commit 7ea09187e1
2 changed files with 10 additions and 58 deletions

View file

@ -687,11 +687,16 @@ function pre_customize_image__002_build_wifi() {
mkdir -p "${SDCARD}/tmp/wifi"
cp -a "${SRC}/cache/sources/nxp-mwifiex" "${SDCARD}/tmp/wifi/mwifiex"
# Mainline cfg80211 compat: the driver gates set_monitor_channel's net_device arg on
# >= 6.13, but the 6.12.y stable series backported that one API in 6.12.101; the in-kernel
# cfg80211 build needs this one-op fix.
run_host_command_logged patch -p1 -d "${SDCARD}/tmp/wifi/mwifiex" \
< "${SRC}/packages/bsp/gateway-dk/mwifiex-cfg80211-set_monitor_channel.patch"
# ASK carries the driver's fixes for this kernel line (cfg80211 set_monitor_channel compat,
# skb ownership, ralist locking, scan teardown, ...) next to its Yocto recipe; apply them
# in order from the pinned ASK tree rather than keep a drifting copy here.
local wifi_patch wifi_patches=0
for wifi_patch in "${ASK_CACHE_DIR}/meta-ask/recipes-kernel/nxp-mwifiex/files/${KERNEL_MAJOR_MINOR}"/[0-9]*.patch; do
[[ -f "${wifi_patch}" ]] || continue
run_host_command_logged patch -p1 -d "${SDCARD}/tmp/wifi/mwifiex" < "${wifi_patch}"
wifi_patches=$((wifi_patches + 1))
done
[[ "${wifi_patches}" -gt 0 ]] || exit_with_error "No mwifiex patches in the ASK tree for kernel line" "${KERNEL_MAJOR_MINOR}"
# Build mlan.ko + moal.ko against the kernel headers. PCIe-9098 only (every other SDIO/USB/
# PCIe variant off); cfg80211 fullmac, STA + uAP, no WEXT. Flags are passed as command-line

View file

@ -1,53 +0,0 @@
From 4e1c401292de666104e9854ba5cc749d01961fbe Mon Sep 17 00:00:00 2001
From: Tomaz Zaman <tomaz@mono.si>
Date: Tue, 25 Aug 2026 17:35:09 +0200
Subject: [PATCH] mwifiex: match mainline set_monitor_channel signature (>=
6.12.101)
The moal driver gates the struct net_device *dev parameter of
set_monitor_channel on CFG80211_VERSION_CODE >= 6.13.0. That argument was
originally slated for 6.13, but the change (torvalds/linux commit
9c4f830927750a2bf9fd9426a5257f0fdce3b662, "wifi: cfg80211: pass net_device
to set_monitor_channel") was backported to the 6.12.y stable series in
v6.12.101 for multi-radio wiphy support. Verified: v6.12.100 has the old
two-argument signature, v6.12.101 has the three-argument one.
OpenWrt builds this driver against its mac80211 backports package, so
CFG80211_VERSION_CODE reports >= 6.13 and the guard resolves. Armbian builds
against the kernel's in-kernel cfg80211, so on 6.12.101..6.12.103 the guard
selects the old signature and the cfg80211_ops assignment fails with
-Wincompatible-pointer-types. Lower the guard to 6.12.101 at the forward
declaration and the definition; the added dev parameter is unused by the
body. set_monitor_channel is the only cfg80211 op the 6.12.y stable series
backported that this driver guards.
Signed-off-by: Tomaz Zaman <tomaz@mono.si>
---
mlinux/moal_sta_cfg80211.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mlinux/moal_sta_cfg80211.c b/mlinux/moal_sta_cfg80211.c
index 21092c2..f9ea859 100644
--- a/mlinux/moal_sta_cfg80211.c
+++ b/mlinux/moal_sta_cfg80211.c
@@ -127,7 +127,7 @@ rmp_table_t rmp_table_sta_6G[] = {
#ifdef UAP_SUPPORT
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
static int woal_cfg80211_set_monitor_channel(struct wiphy *wiphy,
-#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
+#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 101)
struct net_device *dev,
#endif
struct cfg80211_chan_def *chandef);
@@ -699,7 +699,7 @@ static const struct wiphy_coalesce_support coalesce_support = {
#ifdef UAP_SUPPORT
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
static int woal_cfg80211_set_monitor_channel(struct wiphy *wiphy,
-#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
+#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 101)
struct net_device *dev,
#endif
struct cfg80211_chan_def *chandef)
--
2.47.3