mxm_wifiex: fix build warnings on L6.12 kernel next tree

When build wifi driver based on L6.12 kernel next tree, will observe the
following build errors. This is caused by the upstream patches
62c16f219a73 ("wifi: cfg80211: move DFS related members to links[] in
wireless_dev") and 81f67d60ebf2 ("wifi: cfg80211: handle DFS per link").
Need to change corresponding API here to avoid the build break.

/mwifiex/mlinux/moal_sta_cfg80211.c:435:34: error: initialization of ‘int (*)(struct wiphy *, struct net_device *, struct cfg80211_chan_def *, u32,  int)’ {aka ‘int (*)(struct wiphy *, struct net_device *, struct cfg80211_chan_def *, unsigned int,  int)’} from incompatible pointer type ‘int (*)(struct wiphy *, struct net_device *, struct cfg80211_chan_def *, u32)’ {aka ‘int (*)(struct wiphy *, struct net_device *, struct cfg80211_chan_def *, unsigned int)’} [-Werror=incompatible-pointer-types]
  435 |         .start_radar_detection = woal_cfg80211_start_radar_detection,
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/mwifiex/mlinux/moal_sta_cfg80211.c:435:34: note: (near initialization for ‘woal_cfg80211_ops.start_radar_detection’)
/mwifiex/mlinux/moal_cfg80211.c: In function ‘woal_cancel_cac’:
/mwifiex/mlinux/moal_cfg80211.c:1096:17: error: too few arguments to function ‘cfg80211_cac_event’
 1096 |                 cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel,
      |                 ^~~~~~~~~~~~~~~~~~
In file included from /mwifiex/mlinux/moal_main.h:136,
                 from /mwifiex/mlinux/moal_cfg80211.h:26,
                 from /mwifiex/mlinux/moal_cfg80211.c:23:
./include/net/cfg80211.h:8750:6: note: declared here
 8750 | void cfg80211_cac_event(struct net_device *netdev,
      |      ^~~~~~~~~~~~~~~~~~
/mwifiex/mlinux/moal_shim.c:3701:60: error: ‘struct wireless_dev’ has no member named ‘cac_start_time’
 3701 |                                                 (priv->wdev->cac_start_time +
      |                                                            ^~
/mwifiex/mlinux/moal_shim.c:3704:66: error: ‘struct wireless_dev’ has no member named ‘cac_time_ms’
 3704 |                                                                  ->cac_time_ms));
      |                                                                  ^~

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
This commit is contained in:
Sherry Sun 2024-10-05 12:51:17 +08:00
parent f45013f26a
commit e4ffd91b62
5 changed files with 71 additions and 11 deletions

View file

@ -1105,7 +1105,10 @@ void woal_cancel_cac(moal_private *priv)
if (woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT))
PRINTM(MERROR, "%s: cancel chan report failed \n",
__func__);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel,
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, 0);
#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel,
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL);
#else
@ -1200,7 +1203,12 @@ int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy,
PRINTM(MERROR,
"%s: cancel chan report failed \n",
__func__);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
cfg80211_cac_event(priv->netdev,
&priv->phandle->dfs_channel,
NL80211_RADAR_CAC_ABORTED,
GFP_KERNEL, 0);
#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
cfg80211_cac_event(priv->netdev,
&priv->phandle->dfs_channel,
NL80211_RADAR_CAC_ABORTED,

View file

@ -472,7 +472,12 @@ int woal_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev,
#endif
#if KERNEL_VERSION(3, 12, 0) <= CFG80211_VERSION_CODE
#if KERNEL_VERSION(3, 15, 0) <= CFG80211_VERSION_CODE
#if KERNEL_VERSION(6, 12, 0) <= CFG80211_VERSION_CODE
int woal_cfg80211_start_radar_detection(struct wiphy *wiphy,
struct net_device *dev,
struct cfg80211_chan_def *chandef,
u32 cac_time_msi, int link_id);
#elif KERNEL_VERSION(3, 15, 0) <= CFG80211_VERSION_CODE
int woal_cfg80211_start_radar_detection(struct wiphy *wiphy,
struct net_device *dev,
struct cfg80211_chan_def *chandef,

View file

@ -1224,7 +1224,7 @@ void woal_clean_up(moal_handle *handle)
handle->cac_period = MFALSE;
priv = handle->priv[handle->cac_bss_index];
if (priv) {
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
cfg80211_cac_event(priv->netdev, &handle->dfs_channel,
NL80211_RADAR_CAC_ABORTED,
GFP_KERNEL, 0);

View file

@ -3705,7 +3705,12 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
&priv->phandle->cac_timer);
priv->phandle->is_cac_timer_set = MFALSE;
if (radar_detected) {
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
cfg80211_cac_event(priv->netdev,
&priv->phandle->dfs_channel,
NL80211_RADAR_CAC_ABORTED,
GFP_KERNEL, 0);
#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
cfg80211_cac_event(priv->netdev,
&priv->phandle->dfs_channel,
NL80211_RADAR_CAC_ABORTED,
@ -3727,11 +3732,19 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
// WARN_ON(!time_after_eq(jiffies,
// timeout)); mdelay(100); Using
// optimized delay
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
timeout =
(priv->wdev->links[0].cac_start_time +
msecs_to_jiffies(
priv->wdev
->links[0].cac_time_ms));
#else
timeout =
(priv->wdev->cac_start_time +
msecs_to_jiffies(
priv->wdev
->cac_time_ms));
#endif
if (!time_after_eq(jiffies, timeout)) {
/* Exact time to make host and
* device timer in sync */
@ -3748,7 +3761,12 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
}
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
cfg80211_cac_event(priv->netdev,
&priv->phandle->dfs_channel,
NL80211_RADAR_CAC_FINISHED,
GFP_KERNEL, 0);
#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
cfg80211_cac_event(priv->netdev,
&priv->phandle->dfs_channel,
NL80211_RADAR_CAC_FINISHED,
@ -3826,7 +3844,12 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
woal_11h_cancel_chan_report_ioctl(priv,
MOAL_NO_WAIT);
/* upstream: inform cfg80211 */
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
cfg80211_cac_event(priv->netdev,
&priv->phandle->dfs_channel,
NL80211_RADAR_CAC_ABORTED,
GFP_KERNEL, 0);
#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
cfg80211_cac_event(priv->netdev,
&priv->phandle->dfs_channel,
NL80211_RADAR_CAC_ABORTED,

View file

@ -3168,7 +3168,10 @@ int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev)
if (woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT))
PRINTM(MERROR, "%s: cancel chan report failed \n",
__func__);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel,
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, 0);
#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel,
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL);
#else
@ -3848,7 +3851,10 @@ void woal_cac_timer_func(void *context)
moal_private *priv = handle->priv[handle->cac_bss_index];
PRINTM(MEVENT, "cac_timer fired.\n");
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
cfg80211_cac_event(priv->netdev, &handle->dfs_channel,
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, 0);
#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
cfg80211_cac_event(priv->netdev, &handle->dfs_channel,
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL);
#else
@ -4007,7 +4013,10 @@ void woal_process_cancel_chanrpt_event(moal_private *priv)
if (woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT))
PRINTM(MERROR, "%s: cancel chan report failed \n",
__func__);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel,
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, 0);
#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel,
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL);
#else
@ -4021,7 +4030,22 @@ void woal_process_cancel_chanrpt_event(moal_private *priv)
}
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
/**
* @brief start radar detection
*
* @param wiphy A pointer to wiphy structure
* @param dev A pointer to net_device structure
* @param chandef A pointer to cfg80211_chan_def structure
* @param cac_time_ms A cac dwell time
* @param link_id valid link_id for MLO operation or 0 otherwise.
* @return 0 -- success, otherwise fail
*/
int woal_cfg80211_start_radar_detection(struct wiphy *wiphy,
struct net_device *dev,
struct cfg80211_chan_def *chandef,
u32 cac_time_ms, int link_id)
#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
/**
* @brief start radar detection
*