From 5ddbfb80396367082e194b4c307d8fbdcabdf7e9 Mon Sep 17 00:00:00 2001 From: Sherry Sun Date: Fri, 10 Mar 2023 11:38:03 +0800 Subject: [PATCH] mxm_wifiex: fix next-20230224 Linux Factory rebase build errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When build wifi driver based on next-20230224 Linux code, will observe the following build errors. /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_shim.c: In function ‘moal_recv_event’: /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_shim.c:3475:25: error: too few arguments to function ‘cfg80211_ch_switch_notify’ 3475 | cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0); | ^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_main.h:123, from /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_shim.c:28: ./include/net/cfg80211.h:8375:6: note: declared here 8375 | void cfg80211_ch_switch_notify(struct net_device *dev, | ^~~~~~~~~~~~~~~~~~~~~~~~~ make[2]: *** [scripts/Makefile.build:252: /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_shim.o] Error 1 make[1]: *** [Makefile:2028: /work/mwifiex/mxm_wifiex/wlan_src] Error 2 make[1]: Leaving directory '/work/linux-nxp-rebase' This is caused by kernel patch b345f0637c00("wifi: cfg80211: include puncturing bitmap in channel switch events"), now cfg80211_ch_switch_notify() needs four parameters. Note: The patch was introduced in L6.2 kernel next tree, but in L6.3 kernel linus tree, so maybe you need to change the kernel version to L6.3 after we rebase the linux-nxp-rebase to L6.3. Signed-off-by: Sherry Sun --- mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c | 4 +++- mxm_wifiex/wlan_src/mlinux/moal_shim.c | 4 +++- mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c index 086fada..fbce6bb 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c @@ -4995,7 +4995,9 @@ void woal_cfg80211_notify_channel(moal_private *priv, #if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE mutex_lock(&priv->wdev->mtx); #endif -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 2, 0) + cfg80211_ch_switch_notify(priv->netdev, &chandef, 0, 0); +#elif ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) cfg80211_ch_switch_notify(priv->netdev, &chandef, 0); #else cfg80211_ch_switch_notify(priv->netdev, &chandef); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_shim.c b/mxm_wifiex/wlan_src/mlinux/moal_shim.c index 150af65..432df6c 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_shim.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_shim.c @@ -3471,7 +3471,9 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent) PRINTM(MMSG, "Channel Under Nop: notify cfg80211 new channel=%d\n", priv->channel); -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 2, 0) + cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0, 0); +#elif ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0); #else cfg80211_ch_switch_notify(priv->netdev, &priv->chan); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c index 2f0d60c..eafbcc2 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c @@ -3467,7 +3467,9 @@ static void woal_switch_uap_channel(moal_private *priv, t_u8 wait_option) priv->channel = uap_channel.channel; moal_memcpy_ext(priv->phandle, &priv->chan, &priv->csa_chan, sizeof(struct cfg80211_chan_def), sizeof(priv->chan)); -#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 2, 0) + cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0, 0); +#elif ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13) cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0); #else cfg80211_ch_switch_notify(priv->netdev, &priv->chan);