mxm_wifiex: fix L6.7 kernel next tree build errors -- woal_cfg80211_set_beacon

When build wifi driver based on L6.7 kernel next tree, will observe the
following build errors.
These errors caused by kernel patch 66f85d57b710("wifi: cfg80211: modify
prototype for change_beacon") and bb55441c57cc(wifi: cfg80211: split
struct cfg80211_ap_settings), they modify the prototype for
change_beacon() in struct cfg80211_op to accept cfg80211_ap_update
instead of cfg80211_beacon_data so that it can process data in addition
to beacons.

CC [M]  /work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.o
/work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:381:26: error: initialization of ‘int (*)(struct wiphy *, struct net_device *, struct cfg80211_ap_update *)’ from incompatible pointer type ‘int (*)(struct wiphy *, struct net_device *, struct cfg80211_beacon_data *)’ [-Werror=incompatible-pointer-types]
  381 |         .change_beacon = woal_cfg80211_set_beacon,
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~
/work/mwifiex/mxm_wifiex/wlan_src/mlinux/moal_sta_cfg80211.c:381:26: note: (near initialization for ‘woal_cfg80211_ops.change_beacon’)

Also fix the build error caused by kernel patch 8e4687f6061e(wifi:
mac80211: rename struct cfg80211_rx_assoc_resp to
cfg80211_rx_assoc_resp_data), it renames the struct
cfg80211_rx_assoc_resp to cfg80211_rx_assoc_resp_data to avoid name
conflict with a function named cfg80211_rx_assoc_resp(). So we need to
make the corresponding changes in wifi driver.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
This commit is contained in:
Sherry Sun 2023-12-10 12:09:37 +08:00
parent 952d10f334
commit 84aa9543bb
3 changed files with 44 additions and 3 deletions

View file

@ -431,7 +431,13 @@ int woal_cfg80211_set_coalesce(struct wiphy *wiphy,
struct cfg80211_coalesce *coalesce);
#endif
#if KERNEL_VERSION(3, 4, 0) <= CFG80211_VERSION_CODE
#if KERNEL_VERSION(6, 7, 0) <= CFG80211_VERSION_CODE
int woal_cfg80211_add_beacon(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ap_settings *params);
int woal_cfg80211_set_beacon(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ap_update *info);
#elif KERNEL_VERSION(3, 4, 0) <= CFG80211_VERSION_CODE
int woal_cfg80211_add_beacon(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ap_settings *params);

View file

@ -2671,7 +2671,11 @@ void woal_host_mlme_process_assoc_resp(moal_private *priv,
struct cfg80211_bss *bss = NULL;
unsigned long flags;
u8 *assoc_req_buf = NULL;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)
struct cfg80211_rx_assoc_resp_data resp = {
.uapsd_queues = -1,
};
#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
struct cfg80211_rx_assoc_resp resp = {
.uapsd_queues = -1,
};

View file

@ -2865,7 +2865,18 @@ done:
return ret;
}
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)
/**
* @brief set AP or GO parameter
*
* @param wiphy A pointer to wiphy structure
* @param dev A pointer to net_device structure
* @param info A pointer to cfg80211_ap_update structure
* @return 0 -- success, otherwise fail
*/
int woal_cfg80211_set_beacon(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ap_update *info)
#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)
/**
* @brief set AP or GO parameter
*
@ -2890,6 +2901,9 @@ int woal_cfg80211_set_beacon(struct wiphy *wiphy, struct net_device *dev,
#endif
{
moal_private *priv = (moal_private *)woal_get_netdev_priv(dev);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)
struct cfg80211_beacon_data *params = &info->beacon;
#endif
int ret = 0;
ENTER();
@ -3696,6 +3710,10 @@ void woal_cac_timer_func(void *context)
static void woal_switch_uap_channel(moal_private *priv, t_u8 wait_option)
{
chan_band_info uap_channel;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)
struct cfg80211_ap_update *info = container_of(&priv->beacon_after,
struct cfg80211_ap_update, beacon);
#endif
t_u8 chan2Offset = SEC_CHAN_NONE;
ENTER();
woal_clear_all_mgmt_ies(priv, MOAL_IOCTL_WAIT);
@ -3703,8 +3721,13 @@ static void woal_switch_uap_channel(moal_private *priv, t_u8 wait_option)
PRINTM(MERROR, "%s: stop uap failed \n", __func__);
goto done;
}
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)
if (woal_cfg80211_set_beacon(priv->wdev->wiphy, priv->netdev, info)) {
#else
if (woal_cfg80211_set_beacon(priv->wdev->wiphy, priv->netdev,
&priv->beacon_after)) {
#endif
PRINTM(MERROR, "%s: set mgmt ies failed \n", __func__);
goto done;
}
@ -3999,6 +4022,10 @@ int woal_cfg80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
moal_private *priv = (moal_private *)woal_get_netdev_priv(dev);
t_u32 chsw_msec;
mlan_uap_bss_param *bss_cfg = NULL;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)
struct cfg80211_ap_update *info = container_of(&params->beacon_csa,
struct cfg80211_ap_update, beacon);
#endif
ENTER();
@ -4034,7 +4061,11 @@ int woal_cfg80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
}
woal_clear_all_mgmt_ies(priv, MOAL_IOCTL_WAIT);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 7, 0)
if (woal_cfg80211_set_beacon(wiphy, dev, info)) {
#else
if (woal_cfg80211_set_beacon(wiphy, dev, &params->beacon_csa)) {
#endif
PRINTM(MERROR, "%s: setting csa mgmt ies failed\n", __func__);
goto done;
}