From cd09e87fb9d3159c14112b71f210820a8a6aa32f Mon Sep 17 00:00:00 2001 From: Sherry Sun Date: Fri, 1 Mar 2024 14:29:19 +0800 Subject: [PATCH] mxm_wifiex: fix L6.8 kernel next tree build errors -- cfg80211_ch_switch_notify MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building the wifi driver based on L6.8 kernel next tree, will observe the following build errors. These errors are caused by kernel patch b82730bf57b5("wifi: cfg80211/mac80211: move puncturing into chandef"), which moves puncturing into chandef and deletes the fourth parameter punct_bitmap of function cfg80211_ch_switch_notify(), here change the code accordingly to avoid the build break. /mwifiex/mxm_wifiex/wlan_src/mlinux/moal_shim.c: In function ‘moal_recv_event’: /mwifiex/mxm_wifiex/wlan_src/mlinux/moal_shim.c:3911:25: error: too many arguments to function ‘cfg80211_ch_switch_notify’ 3911 | cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0, | ^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /mwifiex/mxm_wifiex/wlan_src/mlinux/moal_main.h:130, from /mwifiex/mxm_wifiex/wlan_src/mlinux/moal_shim.c:28: ./include/net/cfg80211.h:8759:6: note: declared here 8759 | void cfg80211_ch_switch_notify(struct net_device *dev, | ^~~~~~~~~~~~~~~~~~~~~~~~~ make[3]: *** [scripts/Makefile.build:244: /mwifiex/mxm_wifiex/wlan_src/mlinux/moal_shim.o] Error 1 make[3]: *** Waiting for unfinished jobs.... /mwifiex/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c: In function ‘woal_cfg80211_notify_channel’: /mwifiex/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c:5175:17: error: too many arguments to function ‘cfg80211_ch_switch_notify’ 5175 | cfg80211_ch_switch_notify(priv->netdev, &chandef, 0, 0); | ^~~~~~~~~~~~~~~~~~~~~~~~~ ... 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 dab4a54..f742c1c 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_cfg80211.c @@ -5171,7 +5171,9 @@ void woal_cfg80211_notify_channel(moal_private *priv, #elif KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE mutex_lock(&priv->wdev->mtx); #endif -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) + cfg80211_ch_switch_notify(priv->netdev, &chandef, 0); +#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) cfg80211_ch_switch_notify(priv->netdev, &chandef, 0, 0); #elif ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) && IMX_ANDROID_13)) cfg80211_ch_switch_notify(priv->netdev, &chandef, 0, 0); diff --git a/mxm_wifiex/wlan_src/mlinux/moal_shim.c b/mxm_wifiex/wlan_src/mlinux/moal_shim.c index 23289c7..26fffa1 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_shim.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_shim.c @@ -3907,7 +3907,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(6, 3, 0) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) + cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0); +#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0, 0); #elif ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) && IMX_ANDROID_13)) diff --git a/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c b/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c index d0e9446..72e084f 100644 --- a/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c +++ b/mxm_wifiex/wlan_src/mlinux/moal_uap_cfg80211.c @@ -3820,7 +3820,9 @@ static void woal_switch_uap_channel(moal_private *priv, t_u8 wait_option) priv->bandwidth = uap_channel.bandcfg.chanWidth; moal_memcpy_ext(priv->phandle, &priv->chan, &priv->csa_chan, sizeof(struct cfg80211_chan_def), sizeof(priv->chan)); -#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) +#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 8, 0) + cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0); +#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0, 0); #elif ((CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) && IMX_ANDROID_13)) cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0, 0);