From 19b2ce8ab2456393920ee6cfb732c41b98c3999f Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Sun, 24 Oct 2021 14:02:20 +0200 Subject: [PATCH] Cleanup ieee80211.h Remove unused valued Use WLAN_* values from include/linux/ieee80211.h --- core/rtw_mlme_ext.c | 2 +- include/ieee80211.h | 21 +++------------------ os_dep/linux/ioctl_cfg80211.c | 2 +- os_dep/linux/ioctl_cfg80211.h | 2 +- 4 files changed, 6 insertions(+), 21 deletions(-) diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 3a0d2ec..f08ec25 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -16138,7 +16138,7 @@ void rtw_set_external_auth_status(_adapter *padapter, params.ssid.ssid_len = RTW_GET_BE64((u8 *)data + 42); params.key_mgmt_suite = RTW_GET_BE32((u8 *)data + 58); params.status = RTW_GET_BE16((u8 *)data + 62); - memcpy(¶ms.pmkid, (u8 *)data + 64, PMKID_LEN); + memcpy(¶ms.pmkid, (u8 *)data + 64, WLAN_PMKID_LEN); rtw_cfg80211_external_auth_status(wiphy, dev, ¶ms); #endif /* CONFIG_IOCTL_CFG80211 */ diff --git a/include/ieee80211.h b/include/ieee80211.h index ed317f4..5687201 100644 --- a/include/ieee80211.h +++ b/include/ieee80211.h @@ -166,10 +166,7 @@ extern u8 WLAN_AKM_FT_FILS_SHA384[]; #define WLAN_AKM_TYPE_FT_FILS_SHA384 BIT(14) /* IEEE 802.11i */ -#define PMKID_LEN 16 -#define PMK_LEN 32 -#define PMK_LEN_SUITE_B_192 48 -#define PMK_LEN_MAX 48 + #define WPA_REPLAY_COUNTER_LEN 8 #define WPA_NONCE_LEN 32 #define WPA_KEY_RSC_LEN 8 @@ -177,24 +174,12 @@ extern u8 WLAN_AKM_FT_FILS_SHA384[]; #define WPA_GTK_MAX_LEN 32 /* IEEE 802.11, 8.5.2 EAPOL-Key frames */ -#define WPA_KEY_INFO_TYPE_MASK ((u16) (BIT(0) | BIT(1) | BIT(2))) -#define WPA_KEY_INFO_TYPE_AKM_DEFINED 0 -#define WPA_KEY_INFO_TYPE_HMAC_MD5_RC4 BIT(0) -#define WPA_KEY_INFO_TYPE_HMAC_SHA1_AES BIT(1) -#define WPA_KEY_INFO_TYPE_AES_128_CMAC 3 #define WPA_KEY_INFO_KEY_TYPE BIT(3) /* 1 = Pairwise, 0 = Group key */ + /* bit4..5 is used in WPA, but is reserved in IEEE 802.11i/RSN */ -#define WPA_KEY_INFO_KEY_INDEX_MASK (BIT(4) | BIT(5)) -#define WPA_KEY_INFO_KEY_INDEX_SHIFT 4 -#define WPA_KEY_INFO_INSTALL BIT(6) /* pairwise */ -#define WPA_KEY_INFO_TXRX BIT(6) /* group */ + #define WPA_KEY_INFO_ACK BIT(7) #define WPA_KEY_INFO_MIC BIT(8) -#define WPA_KEY_INFO_SECURE BIT(9) -#define WPA_KEY_INFO_ERROR BIT(10) -#define WPA_KEY_INFO_REQUEST BIT(11) -#define WPA_KEY_INFO_ENCR_KEY_DATA BIT(12) /* IEEE 802.11i/RSN only */ -#define WPA_KEY_INFO_SMK_MESSAGE BIT(13) struct ieee802_1x_hdr { u8 version; diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 9d0be56..e754dd8 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -9423,7 +9423,7 @@ void rtw_cfg80211_external_auth_status(struct wiphy *wiphy, struct net_device *d psta->expire_to = padapter->stapriv.assoc_to; if (params->pmkid != NULL) { - /* RTW_INFO_DUMP("PMKID:", params->pmkid, PMKID_LEN); */ + /* RTW_INFO_DUMP("PMKID:", params->pmkid, WLAN_PMKID_LEN); */ _rtw_set_pmksa(dev, params->bssid, params->pmkid); } diff --git a/os_dep/linux/ioctl_cfg80211.h b/os_dep/linux/ioctl_cfg80211.h index 19e5e1e..c459dc1 100644 --- a/os_dep/linux/ioctl_cfg80211.h +++ b/os_dep/linux/ioctl_cfg80211.h @@ -204,7 +204,7 @@ struct rtw_external_auth_params { struct cfg80211_ssid ssid; unsigned int key_mgmt_suite; u16 status; - u8 pmkid[PMKID_LEN]; + u8 pmkid[WLAN_PMKID_LEN]; }; bool rtw_cfg80211_is_connect_requested(_adapter *adapter);