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

When build wifi driver based on L6.13 kernel next tree, will observe the
following build errors. This is caused by the following three upstream
patches. Need to change corresponding API here to avoid the build break.

02f220b52670 ("wifi: ipw2x00/lib80211: move remaining lib80211 into
libipw")
7a53af85d3bb ("wifi: cfg80211: send MLO links tx power info in
GET_INTERFACE")
9c4f83092775 ("wifi: cfg80211: pass net_device to .set_monitor_channel")

In file included from mlinux/moal_main.c:29:
mlinux/moal_main.h:136:10: fatal error: net/lib80211.h: No such file or directory
  136 | #include <net/lib80211.h>
      |          ^~~~~~~~~~~~~~~~
 compilation terminated.
make[3]: *** [/kernel-source/scripts/Makefile.build:194: mlinux/moal_main.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from mlinux/moal_eth_ioctl.c:29:
mlinux/moal_main.h:136:10: fatal error: net/lib80211.h: No such file or directory
  136 | #include <net/lib80211.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.

mlinux/moal_sta_cfg80211.c:379:25: error: initialization of ‘int (*)(struct wiphy *, struct wireless_dev *, unsigned int,  int *)’ from incompatible pointer type ‘int (*)(struct wiphy *, struct wireless_dev *, int *)’ [-Werror=incompatible-pointer-types]
  379 |         .get_tx_power = woal_cfg80211_get_tx_power,
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
mlinux/moal_sta_cfg80211.c:379:25: note: (near initialization for ‘woal_cfg80211_ops.get_tx_power’)
mlinux/moal_sta_cfg80211.c:468:32: error: initialization of ‘int (*)(struct wiphy *, struct net_device *, struct cfg80211_chan_def *)’ from incompatible pointer type ‘int (*)(struct wiphy *, struct cfg80211_chan_def *)’ [-Werror=incompatible-pointer-types]
  468 |         .set_monitor_channel = woal_cfg80211_set_monitor_channel,
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mlinux/moal_sta_cfg80211.c:468:32: note: (near initialization for ‘woal_cfg80211_ops.set_monitor_channel’)
cc1: some warnings being treated as errors
make[4]: *** [/kernel-source/scripts/Makefile.build:194: mlinux/moal_sta_cfg80211.o] Error 1

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
This commit is contained in:
Sherry Sun 2025-02-12 14:34:07 +08:00
parent 0396cfb38a
commit 58368fe6e6
2 changed files with 12 additions and 1 deletions

View file

@ -133,7 +133,6 @@ Change log:
#include "moal_shim.h"
/* Wireless header */
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#include <net/lib80211.h>
#include <net/cfg80211.h>
#include <net/ieee80211_radiotap.h>
#endif

View file

@ -88,6 +88,9 @@ static const u32 cfg80211_akm_suites[] = {
#ifdef UAP_SUPPORT
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
static int woal_cfg80211_set_monitor_channel(struct wiphy *wiphy,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
struct net_device *dev,
#endif
struct cfg80211_chan_def *chandef);
#endif
#endif
@ -158,6 +161,9 @@ static int woal_cfg80211_set_cqm_rssi_config(struct wiphy *wiphy,
static int woal_cfg80211_get_tx_power(struct wiphy *wiphy,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
struct wireless_dev *wdev,
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
unsigned int link_id,
#endif
int *dbm);
@ -640,6 +646,9 @@ static const struct wiphy_coalesce_support coalesce_support = {
#ifdef UAP_SUPPORT
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
static int woal_cfg80211_set_monitor_channel(struct wiphy *wiphy,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
struct net_device *dev,
#endif
struct cfg80211_chan_def *chandef)
{
moal_handle *handle = (moal_handle *)woal_get_wiphy_priv(wiphy);
@ -6528,6 +6537,9 @@ static int woal_cfg80211_set_power_mgmt(struct wiphy *wiphy,
static int woal_cfg80211_get_tx_power(struct wiphy *wiphy,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
struct wireless_dev *wdev,
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
unsigned int link_id,
#endif
int *dbm)
{