From eff5b5a0c4cff2cdd89f2b3086805d598188cf63 Mon Sep 17 00:00:00 2001 From: seppzer0 Date: Wed, 19 Jul 2023 00:12:47 +0200 Subject: [PATCH] Add an extra definition for cfg80211_connect_bss() usage --- Makefile | 2 ++ os_dep/linux/ioctl_cfg80211.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 24c8574..b6d86d0 100755 --- a/Makefile +++ b/Makefile @@ -851,6 +851,8 @@ EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC -DCONFIG_RADIO_WORK #EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT EXTRA_CFLAGS += -DCONFIG_P2P_IPS +# A special rule for cfg80211_connect_bss() to receive all 10 arguments in an Android build +EXTRA_CFLAGS += -DCONFIG_CFG80211_CONNECT_BSS_ANDROID endif ifeq ($(CONFIG_PLATFORM_ANDROID_X86), y) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index f26d10f..ac0746d 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -1193,7 +1193,7 @@ check_bss: struct cfg80211_bss *bss; bss = cfg80211_get_bss(pwdev->wiphy, NULL, cur_network->network.MacAddress, NULL, 0, IEEE80211_BSS_TYPE_ANY, IEEE80211_PRIVACY_ANY); - #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) || defined(CONFIG_CFG80211_CONNECT_BSS_ANDROID)) cfg80211_connect_bss(wdev_to_ndev(pwdev), cur_network->network.MacAddress, bss , pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2 , pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2