From de617fc8d50783d7a55c5a7c573e360cb827b6be Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Wed, 20 Oct 2021 17:34:38 +0200 Subject: [PATCH] Fix IEEE80211 authentication algorithm constants. Use the values provided by linux/wireless.h Port 5befa937e8daaebcde81b9423eb93f3ff2e918f7 Port b658acbf64ae38b8fca982c2929ccc0bf4eb1ea2 --- include/ieee80211.h | 3 --- os_dep/linux/ioctl_linux.c | 16 ++++++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/include/ieee80211.h b/include/ieee80211.h index 3d3c8ce..631c785 100644 --- a/include/ieee80211.h +++ b/include/ieee80211.h @@ -89,9 +89,6 @@ enum { #define IEEE_PARAM_IEEE_802_1X 6 #define IEEE_PARAM_WPAX_SELECT 7 -#define AUTH_ALG_OPEN_SYSTEM 0x1 -#define AUTH_ALG_SHARED_KEY 0x2 -#define AUTH_ALG_LEAP 0x00000004 #define IEEE_MLME_STA_DEAUTH 1 #define IEEE_MLME_STA_DISASSOC 2 diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 2c7b3cf..5a5858e 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -755,13 +755,13 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value) _adapter *padapter = (_adapter *) rtw_netdev_priv(dev); int ret = 0; - if ((value & AUTH_ALG_SHARED_KEY) && (value & AUTH_ALG_OPEN_SYSTEM)) { - RTW_INFO("wpa_set_auth_algs, AUTH_ALG_SHARED_KEY and AUTH_ALG_OPEN_SYSTEM [value:0x%x]\n", value); + if ((value & IW_AUTH_ALG_SHARED_KEY) && (value & IW_AUTH_ALG_OPEN_SYSTEM)) { + RTW_INFO("wpa_set_auth_algs, IW_AUTH_ALG_SHARED_KEY and IW_AUTH_ALG_OPEN_SYSTEM [value:0x%x]\n", value); padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeAutoSwitch; padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Auto; - } else if (value & AUTH_ALG_SHARED_KEY) { - RTW_INFO("wpa_set_auth_algs, AUTH_ALG_SHARED_KEY [value:0x%x]\n", value); + } else if (value & IW_AUTH_ALG_SHARED_KEY) { + RTW_INFO("wpa_set_auth_algs, IW_AUTH_ALG_SHARED_KEY [value:0x%x]\n", value); padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled; #ifdef CONFIG_PLATFORM_MT53XX @@ -771,8 +771,8 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value) padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeShared; padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Shared; #endif - } else if (value & AUTH_ALG_OPEN_SYSTEM) { - RTW_INFO("wpa_set_auth_algs, AUTH_ALG_OPEN_SYSTEM\n"); + } else if (value & IW_AUTH_ALG_OPEN_SYSTEM) { + RTW_INFO("wpa_set_auth_algs, IW_AUTH_ALG_OPEN_SYSTEM\n"); /* padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled; */ if (padapter->securitypriv.ndisauthtype < Ndis802_11AuthModeWPAPSK) { #ifdef CONFIG_PLATFORM_MT53XX @@ -784,8 +784,8 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value) #endif } - } else if (value & AUTH_ALG_LEAP) - RTW_INFO("wpa_set_auth_algs, AUTH_ALG_LEAP\n"); + } else if (value & IW_AUTH_ALG_LEAP) + RTW_INFO("wpa_set_auth_algs, IW_AUTH_ALG_LEAP\n"); else { RTW_INFO("wpa_set_auth_algs, error!\n"); ret = -EINVAL;