use common ieee80211 constants

Many defined constants in wifi.h are unused and/or available from
<linux/ieee80211.h>, some with slightly different names. Remove
the constants from ieee80211.h and wifi.h and use the common ones. Rename where
necessary.
This commit is contained in:
Carlos Garces 2021-10-12 17:52:52 +02:00
parent cc69f83f3d
commit 91b4661c5f
7 changed files with 17 additions and 202 deletions

View File

@ -3609,7 +3609,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
#if 0 #if 0
if (!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT) && if (!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) &&
!psta->no_short_slot_time_set) { !psta->no_short_slot_time_set) {
psta->no_short_slot_time_set = 1; psta->no_short_slot_time_set = 1;
pmlmepriv->num_sta_no_short_slot_time++; pmlmepriv->num_sta_no_short_slot_time++;
@ -3619,7 +3619,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
} }
#endif #endif
if (!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT)) { if (!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT_TIME)) {
if (!psta->no_short_slot_time_set) { if (!psta->no_short_slot_time_set) {
psta->no_short_slot_time_set = 1; psta->no_short_slot_time_set = 1;
@ -5210,10 +5210,10 @@ u16 rtw_ap_parse_sta_security_ie(_adapter *adapter, struct sta_info *sta, struct
status = WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION; status = WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION;
if (!sta->wpa2_group_cipher) if (!sta->wpa2_group_cipher)
status = WLAN_STATUS_GROUP_CIPHER_NOT_VALID; status = WLAN_STATUS_INVALID_GROUP_CIPHER;
if (!sta->wpa2_pairwise_cipher) if (!sta->wpa2_pairwise_cipher)
status = WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID; status = WLAN_STATUS_INVALID_PAIRWISE_CIPHER;
} else } else
status = WLAN_STATUS_INVALID_IE; status = WLAN_STATUS_INVALID_IE;
@ -5230,10 +5230,10 @@ u16 rtw_ap_parse_sta_security_ie(_adapter *adapter, struct sta_info *sta, struct
sta->wpa_pairwise_cipher = pairwise_cipher & sec->wpa_pairwise_cipher; sta->wpa_pairwise_cipher = pairwise_cipher & sec->wpa_pairwise_cipher;
if (!sta->wpa_group_cipher) if (!sta->wpa_group_cipher)
status = WLAN_STATUS_GROUP_CIPHER_NOT_VALID; status = WLAN_STATUS_INVALID_GROUP_CIPHER;
if (!sta->wpa_pairwise_cipher) if (!sta->wpa_pairwise_cipher)
status = WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID; status = WLAN_STATUS_INVALID_PAIRWISE_CIPHER;
} else } else
status = WLAN_STATUS_INVALID_IE; status = WLAN_STATUS_INVALID_IE;

View File

@ -1394,7 +1394,7 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
elems->timeout_int = pos; elems->timeout_int = pos;
elems->timeout_int_len = elen; elems->timeout_int_len = elen;
break; break;
case WLAN_EID_HT_CAP: case WLAN_EID_HT_CAPABILITY:
elems->ht_capabilities = pos; elems->ht_capabilities = pos;
elems->ht_capabilities_len = elen; elems->ht_capabilities_len = elen;
break; break;
@ -1410,7 +1410,7 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
elems->vht_operation = pos; elems->vht_operation = pos;
elems->vht_operation_len = elen; elems->vht_operation_len = elen;
break; break;
case WLAN_EID_VHT_OP_MODE_NOTIFY: case WLAN_EID_OPMODE_NOTIF:
elems->vht_op_mode_notify = pos; elems->vht_op_mode_notify = pos;
elems->vht_op_mode_notify_len = elen; elems->vht_op_mode_notify_len = elen;
break; break;
@ -1653,7 +1653,7 @@ void dump_ht_cap_ie(void *sel, const u8 *ie, u32 ie_len)
const u8 *ht_cap_ie; const u8 *ht_cap_ie;
sint ht_cap_ielen; sint ht_cap_ielen;
ht_cap_ie = rtw_get_ie(ie, WLAN_EID_HT_CAP, &ht_cap_ielen, ie_len); ht_cap_ie = rtw_get_ie(ie, WLAN_EID_HT_CAPABILITY, &ht_cap_ielen, ie_len);
if (!ie || ht_cap_ie != ie) if (!ie || ht_cap_ie != ie)
return; return;

View File

@ -711,7 +711,7 @@ int is_same_network(WLAN_BSSID_EX *src, WLAN_BSSID_EX *dst, u8 feature)
if (((_rtw_memcmp(src->MacAddress, dst->MacAddress, ETH_ALEN)) == _TRUE) && if (((_rtw_memcmp(src->MacAddress, dst->MacAddress, ETH_ALEN)) == _TRUE) &&
((s_cap & WLAN_CAPABILITY_IBSS) == (d_cap & WLAN_CAPABILITY_IBSS)) && ((s_cap & WLAN_CAPABILITY_IBSS) == (d_cap & WLAN_CAPABILITY_IBSS)) &&
((s_cap & WLAN_CAPABILITY_BSS) == (d_cap & WLAN_CAPABILITY_BSS))) { ((s_cap & WLAN_CAPABILITY_ESS) == (d_cap & WLAN_CAPABILITY_ESS))) {
if ((src->Ssid.SsidLength == dst->Ssid.SsidLength) && if ((src->Ssid.SsidLength == dst->Ssid.SsidLength) &&
(((_rtw_memcmp(src->Ssid.Ssid, dst->Ssid.Ssid, src->Ssid.SsidLength)) == _TRUE) || //Case of normal AP (((_rtw_memcmp(src->Ssid.Ssid, dst->Ssid.Ssid, src->Ssid.SsidLength)) == _TRUE) || //Case of normal AP
(is_all_null(src->Ssid.Ssid, src->Ssid.SsidLength) == _TRUE || is_all_null(dst->Ssid.Ssid, dst->Ssid.SsidLength) == _TRUE))) //Case of hidden AP (is_all_null(src->Ssid.Ssid, src->Ssid.SsidLength) == _TRUE || is_all_null(dst->Ssid.Ssid, dst->Ssid.SsidLength) == _TRUE))) //Case of hidden AP

View File

@ -693,65 +693,6 @@ struct ieee80211_snap_hdr {
#define WLAN_GET_SEQ_FRAG(seq) ((seq) & RTW_IEEE80211_SCTL_FRAG) #define WLAN_GET_SEQ_FRAG(seq) ((seq) & RTW_IEEE80211_SCTL_FRAG)
#define WLAN_GET_SEQ_SEQ(seq) ((seq) & RTW_IEEE80211_SCTL_SEQ) #define WLAN_GET_SEQ_SEQ(seq) ((seq) & RTW_IEEE80211_SCTL_SEQ)
/* Authentication algorithms */
#define WLAN_AUTH_OPEN 0
#define WLAN_AUTH_SHARED_KEY 1
#define WLAN_AUTH_SAE 3
#define WLAN_AUTH_CHALLENGE_LEN 128
#define WLAN_CAPABILITY_BSS (1<<0)
#define WLAN_CAPABILITY_IBSS (1<<1)
#define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
#define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3)
#define WLAN_CAPABILITY_PRIVACY (1<<4)
#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
#define WLAN_CAPABILITY_PBCC (1<<6)
#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
#define WLAN_CAPABILITY_SHORT_SLOT (1<<10)
/* Status codes */
#define WLAN_STATUS_SUCCESS 0
#define WLAN_STATUS_UNSPECIFIED_FAILURE 1
#define WLAN_STATUS_CAPS_UNSUPPORTED 10
#define WLAN_STATUS_REASSOC_NO_ASSOC 11
#define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12
#define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13
#define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14
#define WLAN_STATUS_CHALLENGE_FAIL 15
#define WLAN_STATUS_AUTH_TIMEOUT 16
#define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17
#define WLAN_STATUS_ASSOC_DENIED_RATES 18
/* 802.11b */
#define WLAN_STATUS_ASSOC_DENIED_NOSHORT 19
#define WLAN_STATUS_ASSOC_DENIED_NOPBCC 20
#define WLAN_STATUS_ASSOC_DENIED_NOAGILITY 21
/* Reason codes */
#define WLAN_REASON_UNSPECIFIED 1
#define WLAN_REASON_PREV_AUTH_NOT_VALID 2
#define WLAN_REASON_DEAUTH_LEAVING 3
#define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4
#define WLAN_REASON_DISASSOC_AP_BUSY 5
#define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6
#define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7
#define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8
#define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9
#define WLAN_REASON_MESH_PEER_CANCELED 52
#define WLAN_REASON_MESH_MAX_PEERS 53
#define WLAN_REASON_MESH_CONFIG 54
#define WLAN_REASON_MESH_CLOSE 55
#define WLAN_REASON_MESH_MAX_RETRIES 56
#define WLAN_REASON_MESH_CONFIRM_TIMEOUT 57
#define WLAN_REASON_MESH_INVALID_GTK 58
#define WLAN_REASON_MESH_INCONSISTENT_PARAM 59
#define WLAN_REASON_MESH_INVALID_SECURITY 60
#define WLAN_REASON_MESH_PATH_NOPROXY 61
#define WLAN_REASON_MESH_PATH_NOFORWARD 62
#define WLAN_REASON_MESH_PATH_DEST_UNREACHABLE 63
#define WLAN_REASON_MAC_EXISTS_IN_MBSS 64
#define WLAN_REASON_MESH_CHAN_REGULATORY 65
#define WLAN_REASON_MESH_CHAN 66
#define WLAN_REASON_SA_QUERY_TIMEOUT 65532 #define WLAN_REASON_SA_QUERY_TIMEOUT 65532
#define WLAN_REASON_ACTIVE_ROAM 65533 #define WLAN_REASON_ACTIVE_ROAM 65533
#define WLAN_REASON_JOIN_WRONG_CHANNEL 65534 #define WLAN_REASON_JOIN_WRONG_CHANNEL 65534
@ -764,56 +705,6 @@ struct ieee80211_snap_hdr {
|| reason == WLAN_REASON_SA_QUERY_TIMEOUT \ || reason == WLAN_REASON_SA_QUERY_TIMEOUT \
) )
/* Information Element IDs */
#define WLAN_EID_SSID 0
#define WLAN_EID_SUPP_RATES 1
#define WLAN_EID_FH_PARAMS 2
#define WLAN_EID_DS_PARAMS 3
#define WLAN_EID_CF_PARAMS 4
#define WLAN_EID_TIM 5
#define WLAN_EID_IBSS_PARAMS 6
#define WLAN_EID_CHALLENGE 16
/* EIDs defined by IEEE 802.11h - START */
#define WLAN_EID_PWR_CONSTRAINT 32
#define WLAN_EID_PWR_CAPABILITY 33
#define WLAN_EID_TPC_REQUEST 34
#define WLAN_EID_TPC_REPORT 35
#define WLAN_EID_SUPPORTED_CHANNELS 36
#define WLAN_EID_CHANNEL_SWITCH 37
#define WLAN_EID_MEASURE_REQUEST 38
#define WLAN_EID_MEASURE_REPORT 39
#define WLAN_EID_QUITE 40
#define WLAN_EID_IBSS_DFS 41
/* EIDs defined by IEEE 802.11h - END */
#define WLAN_EID_ERP_INFO 42
#define WLAN_EID_HT_CAP 45
#define WLAN_EID_RSN 48
#define WLAN_EID_EXT_SUPP_RATES 50
#define WLAN_EID_MOBILITY_DOMAIN 54
#define WLAN_EID_FAST_BSS_TRANSITION 55
#define WLAN_EID_TIMEOUT_INTERVAL 56
#define WLAN_EID_RIC_DATA 57
#define WLAN_EID_HT_OPERATION 61
#define WLAN_EID_SECONDARY_CHANNEL_OFFSET 62
#define WLAN_EID_20_40_BSS_COEXISTENCE 72
#define WLAN_EID_20_40_BSS_INTOLERANT 73
#define WLAN_EID_OVERLAPPING_BSS_SCAN_PARAMS 74
#define WLAN_EID_MMIE 76
#define WLAN_EID_MESH_CONFIG 113
#define WLAN_EID_MESH_ID 114
#define WLAN_EID_MPM 117
#define WLAN_EID_RANN 126
#define WLAN_EID_PREQ 130
#define WLAN_EID_PREP 131
#define WLAN_EID_PERR 132
#define WLAN_EID_AMPE 139
#define WLAN_EID_MIC 140
#define WLAN_EID_VENDOR_SPECIFIC 221
#define WLAN_EID_GENERIC (WLAN_EID_VENDOR_SPECIFIC)
#define WLAN_EID_VHT_CAPABILITY 191
#define WLAN_EID_VHT_OPERATION 192
#define WLAN_EID_VHT_OP_MODE_NOTIFY 199
#define IEEE80211_MGMT_HDR_LEN 24 #define IEEE80211_MGMT_HDR_LEN 24
#define IEEE80211_DATA_HDR3_LEN 24 #define IEEE80211_DATA_HDR3_LEN 24
#define IEEE80211_DATA_HDR4_LEN 30 #define IEEE80211_DATA_HDR4_LEN 30

View File

@ -150,35 +150,6 @@ enum WIFI_REASON_CODE {
}; };
/* Reason codes (IEEE 802.11-2007, 7.3.1.7, Table 7-22) */ /* Reason codes (IEEE 802.11-2007, 7.3.1.7, Table 7-22) */
#if 0
#define WLAN_REASON_UNSPECIFIED 1
#define WLAN_REASON_PREV_AUTH_NOT_VALID 2
#define WLAN_REASON_DEAUTH_LEAVING 3
#define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4
#define WLAN_REASON_DISASSOC_AP_BUSY 5
#define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6
#define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7
#define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8
#define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9
#endif
/* IEEE 802.11h */
#define WLAN_REASON_PWR_CAPABILITY_NOT_VALID 10
#define WLAN_REASON_SUPPORTED_CHANNEL_NOT_VALID 11
#if 0
/* IEEE 802.11i */
#define WLAN_REASON_INVALID_IE 13
#define WLAN_REASON_MICHAEL_MIC_FAILURE 14
#define WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT 15
#define WLAN_REASON_GROUP_KEY_UPDATE_TIMEOUT 16
#define WLAN_REASON_IE_IN_4WAY_DIFFERS 17
#define WLAN_REASON_GROUP_CIPHER_NOT_VALID 18
#define WLAN_REASON_PAIRWISE_CIPHER_NOT_VALID 19
#define WLAN_REASON_AKMP_NOT_VALID 20
#define WLAN_REASON_UNSUPPORTED_RSN_IE_VERSION 21
#define WLAN_REASON_INVALID_RSN_IE_CAPAB 22
#define WLAN_REASON_IEEE_802_1X_AUTH_FAILED 23
#define WLAN_REASON_CIPHER_SUITE_REJECTED 24
#endif
enum WIFI_STATUS_CODE { enum WIFI_STATUS_CODE {
_STATS_SUCCESSFUL_ = 0, _STATS_SUCCESSFUL_ = 0,
@ -200,55 +171,8 @@ enum WIFI_STATUS_CODE {
_STATS_INVALID_RSNIE_ = 72, _STATS_INVALID_RSNIE_ = 72,
}; };
/* Status codes (IEEE 802.11-2007, 7.3.1.9, Table 7-23) */
#if 0
#define WLAN_STATUS_SUCCESS 0
#define WLAN_STATUS_UNSPECIFIED_FAILURE 1
#define WLAN_STATUS_CAPS_UNSUPPORTED 10
#define WLAN_STATUS_REASSOC_NO_ASSOC 11
#define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12
#define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13
#define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14
#define WLAN_STATUS_CHALLENGE_FAIL 15
#define WLAN_STATUS_AUTH_TIMEOUT 16
#define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17
#define WLAN_STATUS_ASSOC_DENIED_RATES 18
#endif
/* entended */
/* IEEE 802.11b */
#define WLAN_STATUS_ASSOC_DENIED_NOSHORT 19
#define WLAN_STATUS_ASSOC_DENIED_NOPBCC 20
#define WLAN_STATUS_ASSOC_DENIED_NOAGILITY 21
/* IEEE 802.11h */
#define WLAN_STATUS_SPEC_MGMT_REQUIRED 22
#define WLAN_STATUS_PWR_CAPABILITY_NOT_VALID 23
#define WLAN_STATUS_SUPPORTED_CHANNEL_NOT_VALID 24
/* IEEE 802.11g */
#define WLAN_STATUS_ASSOC_DENIED_NO_SHORT_SLOT_TIME 25
#define WLAN_STATUS_ASSOC_DENIED_NO_ER_PBCC 26
#define WLAN_STATUS_ASSOC_DENIED_NO_DSSS_OFDM 27
/* IEEE 802.11w */
#define WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY 30
#define WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION 31
/* IEEE 802.11i */
#define WLAN_STATUS_INVALID_IE 40
#define WLAN_STATUS_GROUP_CIPHER_NOT_VALID 41
#define WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID 42
#define WLAN_STATUS_AKMP_NOT_VALID 43
#define WLAN_STATUS_UNSUPPORTED_RSN_IE_VERSION 44
#define WLAN_STATUS_INVALID_RSN_IE_CAPAB 45
#define WLAN_STATUS_CIPHER_REJECTED_PER_POLICY 46
#define WLAN_STATUS_TS_NOT_CREATED 47
#define WLAN_STATUS_DIRECT_LINK_NOT_ALLOWED 48
#define WLAN_STATUS_DEST_STA_NOT_PRESENT 49
#define WLAN_STATUS_DEST_STA_NOT_QOS_STA 50
#define WLAN_STATUS_ASSOC_DENIED_LISTEN_INT_TOO_LARGE 51
/* IEEE 802.11r */ /* IEEE 802.11r */
#define WLAN_STATUS_INVALID_FT_ACTION_FRAME_COUNT 52
#define WLAN_STATUS_INVALID_PMKID 53 #define WLAN_STATUS_INVALID_PMKID 53
#define WLAN_STATUS_INVALID_MDIE 54
#define WLAN_STATUS_INVALID_FTIE 55
enum WIFI_REG_DOMAIN { enum WIFI_REG_DOMAIN {
DOMAIN_FCC = 1, DOMAIN_FCC = 1,

View File

@ -8207,12 +8207,12 @@ u8 *rtw_cfg80211_construct_mesh_beacon_ies(struct wiphy *wiphy, _adapter *adapte
memset(ht_cap, 0, HT_CAP_IE_LEN); memset(ht_cap, 0, HT_CAP_IE_LEN);
memset(ht_op, 0, HT_OP_IE_LEN); memset(ht_op, 0, HT_OP_IE_LEN);
/* WLAN_EID_HT_CAP */ /* WLAN_EID_HT_CAPABILITY */
RTW_PUT_LE16(HT_CAP_ELE_CAP_INFO(ht_cap), sta_ht_cap->cap); RTW_PUT_LE16(HT_CAP_ELE_CAP_INFO(ht_cap), sta_ht_cap->cap);
SET_HT_CAP_ELE_MAX_AMPDU_LEN_EXP(ht_cap, sta_ht_cap->ampdu_factor); SET_HT_CAP_ELE_MAX_AMPDU_LEN_EXP(ht_cap, sta_ht_cap->ampdu_factor);
SET_HT_CAP_ELE_MIN_MPDU_S_SPACE(ht_cap, sta_ht_cap->ampdu_density); SET_HT_CAP_ELE_MIN_MPDU_S_SPACE(ht_cap, sta_ht_cap->ampdu_density);
memcpy(HT_CAP_ELE_SUP_MCS_SET(ht_cap), &sta_ht_cap->mcs, 16); memcpy(HT_CAP_ELE_SUP_MCS_SET(ht_cap), &sta_ht_cap->mcs, 16);
c = rtw_set_ie(c, WLAN_EID_HT_CAP, HT_CAP_IE_LEN, ht_cap, NULL); c = rtw_set_ie(c, WLAN_EID_HT_CAPABILITY, HT_CAP_IE_LEN, ht_cap, NULL);
/* WLAN_EID_HT_OPERATION */ /* WLAN_EID_HT_OPERATION */
SET_HT_OP_ELE_PRI_CHL(ht_op, ch); SET_HT_OP_ELE_PRI_CHL(ht_op, ch);

View File

@ -318,9 +318,9 @@ static inline char *iwe_stream_mode_process(_adapter *padapter,
char *start, char *stop, struct iw_event *iwe, u16 cap) char *start, char *stop, struct iw_event *iwe, u16 cap)
{ {
/* Add mode */ /* Add mode */
if (cap & (WLAN_CAPABILITY_IBSS | WLAN_CAPABILITY_BSS)) { if (cap & (WLAN_CAPABILITY_IBSS | WLAN_CAPABILITY_ESS)) {
iwe->cmd = SIOCGIWMODE; iwe->cmd = SIOCGIWMODE;
if (cap & WLAN_CAPABILITY_BSS) if (cap & WLAN_CAPABILITY_ESS)
iwe->u.mode = IW_MODE_MASTER; iwe->u.mode = IW_MODE_MASTER;
else else
iwe->u.mode = IW_MODE_ADHOC; iwe->u.mode = IW_MODE_ADHOC;
@ -7396,7 +7396,7 @@ static int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param)
psta = rtw_get_stainfo(pstapriv, param->sta_addr); psta = rtw_get_stainfo(pstapriv, param->sta_addr);
if (psta) { if (psta) {
if ((psta->wpa_ie[0] == WLAN_EID_RSN) || (psta->wpa_ie[0] == WLAN_EID_GENERIC)) { if ((psta->wpa_ie[0] == WLAN_EID_RSN) || (psta->wpa_ie[0] == WLAN_EID_VENDOR_SPECIFIC)) {
int wpa_ie_len; int wpa_ie_len;
int copy_len; int copy_len;