mxm_wifiex: fix L6.6 kernel next tree build errors

When build wifi driver based on L6.6 kernel next tree, will observe the
following build errors.
These errors caused by kernel patch 076fc8775daf("wifi: cfg80211: remove
wdev mutex"), it removes mtx from struct wireless_dev and uses wiphy
mutex instead.

CC [M]  /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_main.o
/work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_main.c: In function ‘woal_evt_work_queue’:
/work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_main.c:11361:47: error: ‘struct wireless_dev’ has no member named ‘mtx’
11361 |                         mutex_lock(&priv->wdev->mtx);
      |                                               ^~
/work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_main.c:11364:49: error: ‘struct wireless_dev’ has no member named ‘mtx’
11364 |                         mutex_unlock(&priv->wdev->mtx);
      |                                                 ^~
make[3]: *** [scripts/Makefile.build:243: /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_main.o] Error 1
make[2]: *** [/work/linux-upstream-next/Makefile:1913: /work/mwifiex/mxm_wifiex/wlan_src] Error 2
make[1]: *** [Makefile:234: __sub-make] Error 2
make[1]: Leaving directory '/work/linux-upstream-next'
make: *** [Makefile:598: default] Error 2

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
This commit is contained in:
Sherry Sun 2023-09-13 18:55:37 +08:00
parent 26246bf60a
commit 0f0c33998c
3 changed files with 25 additions and 4 deletions

View file

@ -5076,7 +5076,9 @@ void woal_cfg80211_notify_channel(moal_private *priv,
#if KERNEL_VERSION(3, 8, 0) <= CFG80211_VERSION_CODE
if (MLAN_STATUS_SUCCESS ==
woal_chandef_create(priv, &chandef, pchan_info)) {
#if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE
#if KERNEL_VERSION(6, 6, 0) <= CFG80211_VERSION_CODE
wiphy_lock(priv->wdev->wiphy);
#elif KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE
mutex_lock(&priv->wdev->mtx);
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
@ -5089,7 +5091,9 @@ void woal_cfg80211_notify_channel(moal_private *priv,
#else
cfg80211_ch_switch_notify(priv->netdev, &chandef);
#endif
#if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE
#if KERNEL_VERSION(6, 6, 0) <= CFG80211_VERSION_CODE
wiphy_unlock(priv->wdev->wiphy);
#elif KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE
mutex_unlock(&priv->wdev->mtx);
#endif
priv->channel = pchan_info->channel;

View file

@ -11356,7 +11356,13 @@ t_void woal_evt_work_queue(struct work_struct *work)
break;
case WOAL_EVENT_RX_MGMT_PKT:
#if defined(UAP_CFG80211) || defined(STA_CFG80211)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
priv = evt->priv;
wiphy_lock(priv->wdev->wiphy);
cfg80211_rx_mlme_mgmt(priv->netdev, evt->evt.event_buf,
evt->evt.event_len);
wiphy_unlock(priv->wdev->wiphy);
#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
priv = evt->priv;
mutex_lock(&priv->wdev->mtx);
cfg80211_rx_mlme_mgmt(priv->netdev, evt->evt.event_buf,

View file

@ -2656,10 +2656,17 @@ void woal_host_mlme_process_assoc_resp(moal_private *priv,
resp.req_ies = assoc_req_buf;
resp.req_ies_len =
assoc_info->assoc_req_len;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
wiphy_lock(priv->wdev->wiphy);
cfg80211_rx_assoc_resp(priv->netdev,
&resp);
wiphy_unlock(priv->wdev->wiphy);
#else
mutex_lock(&priv->wdev->mtx);
cfg80211_rx_assoc_resp(priv->netdev,
&resp);
mutex_unlock(&priv->wdev->mtx);
#endif
#else
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
mutex_lock(&priv->wdev->mtx);
@ -9652,7 +9659,11 @@ void woal_host_mlme_disconnect(moal_private *priv, u16 reason_code, u8 *sa)
}
if (GET_BSS_ROLE(priv) != MLAN_BSS_ROLE_UAP) {
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)
wiphy_lock(priv->wdev->wiphy);
cfg80211_rx_mlme_mgmt(priv->netdev, frame_buf, 26);
wiphy_unlock(priv->wdev->wiphy);
#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
mutex_lock(&priv->wdev->mtx);
cfg80211_rx_mlme_mgmt(priv->netdev, frame_buf, 26);
mutex_unlock(&priv->wdev->mtx);