Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cfg80211 Function Argument Errors and Include Missing Header Files for 5.15.x Linux Kernel Compatibility #1160

Open
wants to merge 2 commits into
base: v5.6.4.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
EXTRA_CFLAGS += -I$(srctree)/$(src)/include
EXTRA_CFLAGS += -I$(srctree)/$(src)/hal/phydm
EXTRA_CFLAGS += -I$(srctree)/$(src)/core/crypto
EXTRA_CFLAGS += -I$(srctree)/$(src)/platform
EXTRA_CFLAGS += -I$(srctree)/$(src)/os_dep
EXTRA_CFLAGS += -I$(srctree)/$(src)/tools
EXTRA_CFLAGS += -I$(srctree)/$(src)/android
EXTRA_CFLAGS += -I$(srctree)/$(src)/core

EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS) -fno-pie
EXTRA_CFLAGS += -O3
EXTRA_CFLAGS += -Wno-unused-variable
EXTRA_CFLAGS += -Wno-unused-value
EXTRA_CFLAGS += -Wno-unused-label
EXTRA_CFLAGS += -Wno-unused-parameter
#EXTRA_CFLAGS += -Wno-unused-function
EXTRA_CFLAGS += -Wno-unused-function
#EXTRA_CFLAGS += -Wno-implicit-fallthrough
EXTRA_CFLAGS += -Wno-cast-function-type
EXTRA_CFLAGS += -Wno-missing-declarations
Expand Down
36 changes: 19 additions & 17 deletions os_dep/linux/ioctl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,9 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset,

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
if (started) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 9, 0))
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false, 0);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 9, 0))
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 78))
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)) || (RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(8,0))
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, false);
Expand All @@ -476,9 +476,9 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset,
if (!rtw_cfg80211_allow_ch_switch_notify(adapter))
goto exit;

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 9, 0))
cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0, 0);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(6, 9, 0))
cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 78))
cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0);
#else
cfg80211_ch_switch_notify(adapter->pnetdev, &chdef);
Expand Down Expand Up @@ -1155,7 +1155,9 @@ void rtw_cfg80211_indicate_connect(_adapter *padapter)
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 0, 0)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 78))
roam_info.links[0].bssid = cur_network->network.MacAddress;
#else
roam_info.channel = notify_channel;
roam_info.bssid = cur_network->network.MacAddress;
#endif
Expand Down Expand Up @@ -1738,7 +1740,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
}

static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 78))
, int link_id
#endif
, u8 key_index
Expand Down Expand Up @@ -1885,7 +1887,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev
}

static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 78))
, int link_id
#endif
, u8 keyid
Expand Down Expand Up @@ -2053,7 +2055,7 @@ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev
}

static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 78))
int link_id,
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
Expand All @@ -2077,7 +2079,7 @@ static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,

static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
struct net_device *ndev,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 78))
int link_id,
#endif
u8 key_index
Expand Down Expand Up @@ -2129,7 +2131,7 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30))
int cfg80211_rtw_set_default_mgmt_key(struct wiphy *wiphy,
struct net_device *ndev,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 78))
int link_id,
#endif
u8 key_index)
Expand Down Expand Up @@ -5318,10 +5320,10 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd
return ret;
}

#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 2))
static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
#else
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 78))
static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id)
#else
static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
#endif
{
_adapter *adapter = (_adapter *)rtw_netdev_priv(ndev);
Expand Down Expand Up @@ -6194,7 +6196,7 @@ static int cfg80211_rtw_set_channel(struct wiphy *wiphy
return 0;
}

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 78))
static int cfg80211_rtw_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, unsigned int link_id, struct cfg80211_chan_def *chandef){
#else
static int cfg80211_rtw_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, struct cfg80211_chan_def *chandef){
Expand Down Expand Up @@ -10489,7 +10491,7 @@ void rtw_wdev_unregister(struct wireless_dev *wdev)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2))
if (wdev->links[0].client.current_bss) {
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2))
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 78))
if (wdev->connected) {
#else
if (wdev->current_bss) {
Expand Down