From: Tim Michals <tcmichals@gmail.com>
To: yanli.yang@bedmex.com
Cc: zhirun.liu@aicsemi.com, dijia.xu@aicsemi.com,
chunqiu.liu@aicsemi.com, johannes@sipsolutions.net,
kvalo@kernel.org, linux-wireless@vger.kernel.org,
Tim Michals <tcmichals@gmail.com>
Subject: [PATCH RFC v2 2/2] wifi: aic: update cfg80211 API compatibility for modern kernels
Date: Sat, 8 Aug 2026 12:23:05 -0500 [thread overview]
Message-ID: <20260808172305.138690-2-tcmichals@gmail.com> (raw)
In-Reply-To: <20260808172305.138690-1-tcmichals@gmail.com>
Fixes modern kernel API compilation differences in `aic8800_fdrv`:
1. `netif_rx_ni` was removed in Linux 5.18+. Provide compatibility macro
in `rwnx_compat.h` mapping to `netif_rx`.
2. `cfg80211_probe_status` parameter count was updated in Linux 6.0+.
Wrap `cfg80211_probe_status` invocation with `LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)`.
3. `remain_on_channel` callback signature in `struct cfg80211_ops` dropped
`rx_addr` in Linux 6.5+. Wrap signature definition for Linux 6.5+.
Signed-off-by: Tim Michals <tcmichals@gmail.com>
Tested-by: Tim Michals <tcmichals@gmail.com>
---
drivers/net/wireless/aic/aic8800_fdrv/rwnx_compat.h | 5 +++++
drivers/net/wireless/aic/aic8800_fdrv/rwnx_main.c | 20 ++++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/drivers/net/wireless/aic/aic8800_fdrv/rwnx_compat.h b/drivers/net/wireless/aic/aic8800_fdrv/rwnx_compat.h
index b2c3d4e..f5e6d7c 100644
--- a/drivers/net/wireless/aic/aic8800_fdrv/rwnx_compat.h
+++ b/drivers/net/wireless/aic/aic8800_fdrv/rwnx_compat.h
@@ -21,6 +21,11 @@
#ifndef _RWNX_COMPAT_H_
#define _RWNX_COMPAT_H_
+#include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
+#ifndef netif_rx_ni
+#define netif_rx_ni netif_rx
+#endif
+#endif
/* CFG80211 */
diff --git a/drivers/net/wireless/aic/aic8800_fdrv/rwnx_main.c b/drivers/net/wireless/aic/aic8800_fdrv/rwnx_main.c
index c3d4e5f..a6b7c8d 100644
--- a/drivers/net/wireless/aic/aic8800_fdrv/rwnx_main.c
+++ b/drivers/net/wireless/aic/aic8800_fdrv/rwnx_main.c
@@ -2824,12 +2824,22 @@ static void apm_probe_sta_work_process(struct work_struct *work)
if (found)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
+ cfg80211_probe_status(rwnx_vif->ndev, mac,
+ (u64)rwnx_vif->sta_probe.probe_id,
+ true, 0, false, GFP_ATOMIC);
+ else
+ cfg80211_probe_status(rwnx_vif->ndev, mac,
+ (u64)rwnx_vif->sta_probe.probe_id,
+ false, 0, false, GFP_ATOMIC);
+#else
cfg80211_probe_status(rwnx_vif->ndev, mac,
(u64)rwnx_vif->sta_probe.probe_id, -1,
true, 0, false, GFP_ATOMIC);
else
cfg80211_probe_status(rwnx_vif->ndev, mac,
(u64)rwnx_vif->sta_probe.probe_id, -1,
false, 0, false, GFP_ATOMIC);
+#endif
rwnx_vif->sta_probe.probe_id++;
}
@@ -3463,6 +3473,16 @@ static int rwnx_cfg80211_remain_on_channel_(struct wiphy *wiphy,
return error;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
+static int rwnx_cfg80211_remain_on_channel(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ struct ieee80211_channel *chan,
+ unsigned int duration, u64 *cookie)
+{
+ return rwnx_cfg80211_remain_on_channel_(wiphy, wdev, chan,
+ duration, cookie, false);
+}
+#else
static int rwnx_cfg80211_remain_on_channel(struct wiphy *wiphy,
struct wireless_dev *wdev,
struct ieee80211_channel *chan,
--
2.43.0
next prev parent reply other threads:[~2026-08-08 17:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-08 17:23 [PATCH RFC v2 1/2] wifi: aic: fix stack buffer overflow in aicbt_patch_info_unpack Tim Michals
2026-08-08 17:23 ` Tim Michals [this message]
2026-08-08 19:01 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260808172305.138690-2-tcmichals@gmail.com \
--to=tcmichals@gmail.com \
--cc=chunqiu.liu@aicsemi.com \
--cc=dijia.xu@aicsemi.com \
--cc=johannes@sipsolutions.net \
--cc=kvalo@kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=yanli.yang@bedmex.com \
--cc=zhirun.liu@aicsemi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox