From 3555bdb25800fe9fb280c64663ab2e3a46762d63 Mon Sep 17 00:00:00 2001 From: Carlos Garces Date: Fri, 15 Oct 2021 17:31:30 +0200 Subject: [PATCH] Replace custom definitions with existing ones at linux/ieee80211.h. port 69fea2b4e59c52844cf5196c9c81157792d194fb port 6ee9e6ee5c486f68e424185e133984d0a6ae662c port f179515da9780c4cd37bee76c3cbb6f7364451d6 port aaa0bc19facf31426ca57267edc681a42dbd1ee1 port 99bb776980eeb231558a6ede0a1dd8d1a6e8ec0c port 00f0b682841337c4d2e7dd2e75d86acb6b7ce2d8 port fc41e9618fc65bea5d615d487ca7de3b0e1110bc port 3359e2927b321c635d9529bab1f087ac39c82227 port 38caee0abe9db1db387e7bea60a980eda22e9fa6 port b05cc3a9156b6b674904016d9c213e71c149f4c2 --- core/mesh/rtw_mesh.c | 4 +- core/rtw_ap.c | 100 +++++++-------- core/rtw_cmd.c | 12 +- core/rtw_ieee80211.c | 28 ++-- core/rtw_mlme.c | 14 +- core/rtw_mlme_ext.c | 232 +++++++++++++++++----------------- core/rtw_p2p.c | 42 +++--- core/rtw_recv.c | 4 +- core/rtw_rm.c | 2 +- core/rtw_rson.c | 6 +- core/rtw_security.c | 2 +- core/rtw_tdls.c | 76 +++++------ core/rtw_wapi.c | 6 +- core/rtw_wlan_util.c | 46 +++---- core/rtw_xmit.c | 18 +-- hal/hal_com.c | 50 ++++---- hal/hal_mcc.c | 6 +- include/wifi.h | 107 +--------------- os_dep/linux/ioctl_cfg80211.c | 14 +- os_dep/linux/ioctl_linux.c | 12 +- 20 files changed, 339 insertions(+), 442 deletions(-) diff --git a/core/mesh/rtw_mesh.c b/core/mesh/rtw_mesh.c index e7fb58f..215d480 100644 --- a/core/mesh/rtw_mesh.c +++ b/core/mesh/rtw_mesh.c @@ -2429,10 +2429,10 @@ int rtw_mesh_peer_establish(_adapter *adapter, struct mesh_plink_ent *plink, str rtw_ap_parse_sta_capability(adapter, sta, plink->rx_conf_ies); - if (rtw_ap_parse_sta_supported_rates(adapter, sta, tlv_ies, tlv_ieslen) != _STATS_SUCCESSFUL_) + if (rtw_ap_parse_sta_supported_rates(adapter, sta, tlv_ies, tlv_ieslen) != WLAN_STATUS_SUCCESS) goto exit; - if (rtw_ap_parse_sta_security_ie(adapter, sta, &elems) != _STATS_SUCCESSFUL_) + if (rtw_ap_parse_sta_security_ie(adapter, sta, &elems) != WLAN_STATUS_SUCCESS) goto exit; rtw_ap_parse_sta_wmm_ie(adapter, sta, tlv_ies, tlv_ieslen); diff --git a/core/rtw_ap.c b/core/rtw_ap.c index b3a31b8..e524d3a 100644 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -102,7 +102,7 @@ static void update_BCNTIM(_adapter *padapter) u8 *p, *dst_ie, *premainder_ie = NULL, *pbackup_remainder_ie = NULL; uint offset, tmp_len, tim_ielen, tim_ie_offset, remainder_ielen; - p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, _TIM_IE_, &tim_ielen, pnetwork_mlmeext->IELength - _FIXED_IE_LENGTH_); + p = rtw_get_ie(pie + _FIXED_IE_LENGTH_, WLAN_EID_DS_PARAMS, &tim_ielen, pnetwork_mlmeext->IELength - _FIXED_IE_LENGTH_); if (p != NULL && tim_ielen > 0) { tim_ielen += 2; @@ -121,12 +121,12 @@ static void update_BCNTIM(_adapter *padapter) offset = _FIXED_IE_LENGTH_; /* get ssid_ie len */ - p = rtw_get_ie(pie + _BEACON_IE_OFFSET_, _SSID_IE_, &tmp_len, (pnetwork_mlmeext->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(pie + _BEACON_IE_OFFSET_, WLAN_EID_SSID, &tmp_len, (pnetwork_mlmeext->IELength - _BEACON_IE_OFFSET_)); if (p != NULL) offset += tmp_len + 2; /*get supported rates len*/ - p = rtw_get_ie(pie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &tmp_len, (pnetwork_mlmeext->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(pie + _BEACON_IE_OFFSET_, WLAN_EID_SUPP_RATES, &tmp_len, (pnetwork_mlmeext->IELength - _BEACON_IE_OFFSET_)); if (p != NULL) offset += tmp_len + 2; @@ -600,7 +600,7 @@ void expire_timeout_chk(_adapter *padapter) /* to update bcn with tim_bitmap for this station */ rtw_tim_map_set(padapter, pstapriv->tim_bitmap, psta->cmn.aid); - update_beacon(padapter, _TIM_IE_, NULL, _TRUE); + update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE); if (!pmlmeext->active_keep_alive_check) continue; @@ -1505,7 +1505,7 @@ static void rtw_ap_check_scan(_adapter *padapter) ie = pbss->IEs; /*check if HT CAP INFO IE exists or not*/ - pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_CAPABILITY_IE_, &ie_len, (pbss->IELength - _BEACON_IE_OFFSET_)); + pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_HT_CAPABILITY, &ie_len, (pbss->IELength - _BEACON_IE_OFFSET_)); if (pbuf == NULL) { /* HT CAP INFO IE don't exist, it is b/g mode bss.*/ @@ -1814,11 +1814,11 @@ update_beacon: /* AP is not starting a 40 MHz BSS in presence of an 802.11g BSS. */ mlme->ht_op_mode &= (~HT_INFO_OPERATION_MODE_OP_MODE_MASK); mlme->ht_op_mode |= OP_MODE_MAY_BE_LEGACY_STAS; - update_beacon(pdvobj->padapters[i], _HT_ADD_INFO_IE_, NULL, _FALSE); + update_beacon(pdvobj->padapters[i], WLAN_EID_HT_OPERATION, NULL, _FALSE); } #endif - update_beacon(pdvobj->padapters[i], _TIM_IE_, NULL, _FALSE); + update_beacon(pdvobj->padapters[i], WLAN_EID_DS_PARAMS, NULL, _FALSE); } if (mlme_act != MLME_OPCH_SWITCH @@ -1963,7 +1963,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) cap = RTW_GET_LE16(ie); /* SSID */ - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SSID_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_SSID, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len > 0) { memset(&pbss_network->Ssid, 0, sizeof(NDIS_802_11_SSID)); memcpy(pbss_network->Ssid.Ssid, (p + 2), ie_len); @@ -1989,7 +1989,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) /* chnnel */ channel = 0; pbss_network->Configuration.Length = 0; - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _DSSET_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_DS_PARAMS, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len > 0) channel = *(p + 2); @@ -1998,10 +1998,10 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) memset(supportRate, 0, NDIS_802_11_LENGTH_RATES_EX); /* get supported rates */ - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_SUPP_RATES, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p != NULL) { if (padapter->registrypriv.wireless_mode == WIRELESS_11B) { - ret_rm = rtw_remove_ie_g_rate(ie , &len, _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_); + ret_rm = rtw_remove_ie_g_rate(ie , &len, _BEACON_IE_OFFSET_, WLAN_EID_SUPP_RATES); RTW_DBG("%s, rtw_remove_ie_g_rate=%d\n", __FUNCTION__,ret_rm); ie_len = ie_len - ret_rm; pbss_network->IELength=pbss_network->IELength - ret_rm; @@ -2012,12 +2012,12 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) } /* get ext_supported rates */ - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _EXT_SUPPORTEDRATES_IE_, &ie_len, pbss_network->IELength - _BEACON_IE_OFFSET_); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_EXT_SUPP_RATES, &ie_len, pbss_network->IELength - _BEACON_IE_OFFSET_); if (p != NULL) { if (padapter->registrypriv.wireless_mode == WIRELESS_11B) { pbss_network->IELength = pbss_network->IELength-*(p+1) -2; ret_rm = rtw_ies_remove_ie(ie , &len,_BEACON_IE_OFFSET_, - _EXT_SUPPORTEDRATES_IE_,NULL,0); + WLAN_EID_EXT_SUPP_RATES,NULL,0); RTW_DBG("%s, remove_ie of ext_supported rates =%d\n", __FUNCTION__, ret_rm); } else { memcpy(supportRate + supportRateNum, p + 2, ie_len); @@ -2032,12 +2032,12 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) /* parsing ERP_IE */ - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _ERPINFO_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_ERP_INFO, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len > 0) { if(padapter->registrypriv.wireless_mode == WIRELESS_11B ) { pbss_network->IELength = pbss_network->IELength - *(p+1) - 2; - ret_rm = rtw_ies_remove_ie(ie , &len, _BEACON_IE_OFFSET_, _ERPINFO_IE_,NULL,0); + ret_rm = rtw_ies_remove_ie(ie , &len, _BEACON_IE_OFFSET_, WLAN_EID_ERP_INFO,NULL,0); RTW_DBG("%s, remove_ie of ERP_IE=%d\n", __FUNCTION__, ret_rm); } else ERP_IE_handler(padapter, (PNDIS_802_11_VARIABLE_IEs)p); @@ -2058,7 +2058,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) pairwise_cipher = 0; psecuritypriv->wpa2_group_cipher = _NO_PRIVACY_; psecuritypriv->wpa2_pairwise_cipher = _NO_PRIVACY_; - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _RSN_IE_2_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len > 0) { if (rtw_parse_wpa2_ie(p, ie_len + 2, &group_cipher, &pairwise_cipher, &akm, &mfp_opt) == _SUCCESS) { psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; @@ -2131,7 +2131,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) psecuritypriv->wpa_group_cipher = _NO_PRIVACY_; psecuritypriv->wpa_pairwise_cipher = _NO_PRIVACY_; for (p = ie + _BEACON_IE_OFFSET_; ; p += (ie_len + 2)) { - p = rtw_get_ie(p, _SSN_IE_1_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2))); + p = rtw_get_ie(p, WLAN_EID_VENDOR_SPECIFIC, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2))); if ((p) && (_rtw_memcmp(p + 2, RTW_WPA_OUI, 4))) { if (rtw_parse_wpa_ie(p, ie_len + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) { psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; @@ -2213,7 +2213,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) #endif if (pregistrypriv->wmm_enable) { for (p = ie + _BEACON_IE_OFFSET_; ; p += (ie_len + 2)) { - p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2))); + p = rtw_get_ie(p, WLAN_EID_VENDOR_SPECIFIC, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2))); if ((p) && _rtw_memcmp(p + 2, WMM_PARA_IE, 6)) { pmlmepriv->qospriv.qos_option = 1; @@ -2238,7 +2238,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) if(padapter->registrypriv.ht_enable && is_supported_ht(padapter->registrypriv.wireless_mode)) { /* parsing HT_CAP_IE */ - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_CAPABILITY_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_HT_CAPABILITY, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len > 0) { u8 rf_type = 0; HT_CAP_AMPDU_FACTOR max_rx_ampdu_factor = MAX_AMPDU_FACTOR_64K; @@ -2354,7 +2354,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) } /* parsing HT_INFO_IE */ - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_ADD_INFO_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_HT_OPERATION, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len > 0) { pHT_info_ie = p; if (channel == 0) @@ -2876,7 +2876,7 @@ u8 rtw_ap_bmc_frames_hdl(_adapter *padapter) if ((rtw_tim_map_is_set(padapter, pstapriv->tim_bitmap, 0)) && (psta_bmc->sleepq_len > 0)) { int tx_counts = 0; - _update_beacon(padapter, _TIM_IE_, NULL, _FALSE, "update TIM with TIB=1"); + _update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _FALSE, "update TIM with TIB=1"); RTW_INFO("sleepq_len of bmc_sta = %d\n", psta_bmc->sleepq_len); @@ -2926,7 +2926,7 @@ u8 rtw_ap_bmc_frames_hdl(_adapter *padapter) if (update_tim == _TRUE) { RTW_INFO("clear TIB\n"); - _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "bmc sleepq and HIQ empty"); + _update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "bmc sleepq and HIQ empty"); } } } @@ -3006,13 +3006,13 @@ static void update_bcn_ext_capab_ie(_adapter *padapter) u8 *ie = pnetwork->IEs; u8 null_extcap_data[8] = {0}; - pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _EXT_CAP_IE_, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); + pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_EXT_CAPABILITY , &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); if (pbuf && ie_len > 0) - rtw_remove_bcn_ie(padapter, pnetwork, _EXT_CAP_IE_); + rtw_remove_bcn_ie(padapter, pnetwork, WLAN_EID_EXT_CAPABILITY ); if ((pmlmepriv->ext_capab_ie_len > 0) && (_rtw_memcmp(pmlmepriv->ext_capab_ie_data, null_extcap_data, sizeof(null_extcap_data)) == _FALSE)) - rtw_add_bcn_ie(padapter, pnetwork, _EXT_CAP_IE_, pmlmepriv->ext_capab_ie_data, pmlmepriv->ext_capab_ie_len); + rtw_add_bcn_ie(padapter, pnetwork, WLAN_EID_EXT_CAPABILITY , pmlmepriv->ext_capab_ie_data, pmlmepriv->ext_capab_ie_len); } @@ -3031,7 +3031,7 @@ static void update_bcn_erpinfo_ie(_adapter *padapter) return; /* parsing ERP_IE */ - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _ERPINFO_IE_, &len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_ERP_INFO, &len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); if (p && len > 0) { PNDIS_802_11_VARIABLE_IEs pIE = (PNDIS_802_11_VARIABLE_IEs)p; @@ -3084,7 +3084,7 @@ static void update_bcn_htinfo_ie(_adapter *padapter) pmlmepriv->num_sta_40mhz_intolerant, pmlmepriv->ht_20mhz_width_req, pmlmepriv->ht_intolerant_ch_reported, atomic_read(&pmlmepriv->olbc)); /*parsing HT_INFO_IE, currently only update ht_op_mode - pht_info->infos[1] & pht_info->infos[2] for wifi logo test*/ - p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_ADD_INFO_IE_, &len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_HT_OPERATION, &len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); if (p && len > 0) { struct HT_info_element *pht_info = NULL; @@ -3262,27 +3262,27 @@ void _update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx, const char *ta _enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL); switch (ie_id) { - case _TIM_IE_: + case WLAN_EID_DS_PARAMS: update_BCNTIM(padapter); break; - case _ERPINFO_IE_: + case WLAN_EID_ERP_INFO: update_bcn_erpinfo_ie(padapter); break; - case _HT_CAPABILITY_IE_: + case WLAN_EID_HT_CAPABILITY: update_bcn_htcap_ie(padapter); break; - case _RSN_IE_2_: + case WLAN_EID_RSN: update_bcn_rsn_ie(padapter); break; - case _HT_ADD_INFO_IE_: + case WLAN_EID_HT_OPERATION: update_bcn_htinfo_ie(padapter); break; - case _EXT_CAP_IE_: + case WLAN_EID_EXT_CAPABILITY : update_bcn_ext_capab_ie(padapter); break; @@ -3294,7 +3294,7 @@ void _update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx, const char *ta break; #endif - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: update_bcn_vendor_spec_ie(padapter, oui); break; @@ -3377,7 +3377,7 @@ void rtw_process_public_act_bsscoex(_adapter *padapter, u8 *pframe, uint frame_l if (beacon_updated) { - update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _TRUE); + update_beacon(padapter, WLAN_EID_HT_OPERATION, NULL, _TRUE); associated_stainfo_update(padapter, psta, STA_INFO_UPDATE_BW); } @@ -3588,7 +3588,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta) if (pmlmepriv->num_sta_non_erp == 1) { beacon_updated = _TRUE; - update_beacon(padapter, _ERPINFO_IE_, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_ERP_INFO, NULL, _FALSE); } } @@ -3600,7 +3600,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta) if (pmlmepriv->num_sta_non_erp == 0) { beacon_updated = _TRUE; - update_beacon(padapter, _ERPINFO_IE_, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_ERP_INFO, NULL, _FALSE); } } @@ -3698,8 +3698,8 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta) } if (rtw_ht_operation_update(padapter) > 0) { - update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE); - update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_HT_CAPABILITY, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_HT_OPERATION, NULL, _FALSE); beacon_updated = _TRUE; } } @@ -3739,7 +3739,7 @@ u8 bss_cap_update_on_sta_leave(_adapter *padapter, struct sta_info *psta) if (rtw_tim_map_is_set(padapter, pstapriv->tim_bitmap, psta->cmn.aid)) { rtw_tim_map_clear(padapter, pstapriv->tim_bitmap, psta->cmn.aid); beacon_updated = _TRUE; - update_beacon(padapter, _TIM_IE_, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _FALSE); } if (psta->no_short_preamble_set) { @@ -3755,7 +3755,7 @@ u8 bss_cap_update_on_sta_leave(_adapter *padapter, struct sta_info *psta) pmlmepriv->num_sta_non_erp--; if (pmlmepriv->num_sta_non_erp == 0) { beacon_updated = _TRUE; - update_beacon(padapter, _ERPINFO_IE_, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_ERP_INFO, NULL, _FALSE); } } @@ -3792,8 +3792,8 @@ u8 bss_cap_update_on_sta_leave(_adapter *padapter, struct sta_info *psta) } if (rtw_ht_operation_update(padapter) > 0) { - update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE); - update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_HT_CAPABILITY, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_HT_OPERATION, NULL, _FALSE); } #endif /* CONFIG_80211N_HT */ @@ -4311,7 +4311,7 @@ void rtw_ap_update_bss_chbw(_adapter *adapter, WLAN_BSSID_EX *bss, u8 ch, u8 bw, change_band = _TRUE; /* update channel in IE */ - p = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _DSSET_IE_, &ie_len, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs))); + p = rtw_get_ie((bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)), WLAN_EID_DS_PARAMS, &ie_len, (bss->IELength - sizeof(NDIS_802_11_FIXED_IEs))); if (p && ie_len > 0) *(p + 2) = ch; @@ -5102,7 +5102,7 @@ void tx_beacon_handlder(struct dvobj_priv *pdvobj) if (!check_fwstate(&padapter->mlmepriv, WIFI_OP_CH_SWITCHING) && !IS_CH_WAITING(adapter_to_rfctl(padapter)) ) { - /*update_beacon(padapter, _TIM_IE_, NULL, _FALSE);*/ + /*update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _FALSE);*/ /*issue_beacon(padapter, 0);*/ send_beacon(padapter); } @@ -5144,13 +5144,13 @@ u16 rtw_ap_parse_sta_supported_rates(_adapter *adapter, struct sta_info *sta, u8 u8 rate_set[12]; u8 rate_num; int i; - u16 status = _STATS_SUCCESSFUL_; + u16 status = WLAN_STATUS_SUCCESS; rtw_ies_get_supported_rate(tlv_ies, tlv_ies_len, rate_set, &rate_num); if (rate_num == 0) { RTW_INFO(FUNC_ADPT_FMT" sta "MAC_FMT" with no supported rate\n" , FUNC_ADPT_ARG(adapter), MAC_ARG(sta->cmn.mac_addr)); - status = _STATS_FAILURE_; + status = WLAN_STATUS_UNSPECIFIED_FAILURE; goto exit; } @@ -5183,7 +5183,7 @@ u16 rtw_ap_parse_sta_security_ie(_adapter *adapter, struct sta_info *sta, struct int group_cipher = 0, pairwise_cipher = 0; u32 akm = 0; u8 mfp_opt = MFP_NO; - u16 status = _STATS_SUCCESSFUL_; + u16 status = WLAN_STATUS_SUCCESS; sta->dot8021xalg = 0; sta->wpa_psk = 0; @@ -5268,7 +5268,7 @@ u16 rtw_ap_parse_sta_security_ie(_adapter *adapter, struct sta_info *sta, struct } #endif /* CONFIG_IOCTL_CFG80211 */ - if (status != _STATS_SUCCESSFUL_) + if (status != WLAN_STATUS_SUCCESS) goto exit; if (!MLME_IS_AP(adapter)) @@ -5306,7 +5306,7 @@ u16 rtw_ap_parse_sta_security_ie(_adapter *adapter, struct sta_info *sta, struct if (!selected_registrar) { RTW_INFO("selected_registrar is _FALSE , or AP is not ready to do WPS\n"); - status = _STATS_UNABLE_HANDLE_STA_; + status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; goto exit; } } diff --git a/core/rtw_cmd.c b/core/rtw_cmd.c index 82dd960..dd1fe3d 100644 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -1470,7 +1470,7 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network *pnetwork) #ifdef CONFIG_80211N_HT phtpriv->ht_option = _FALSE; if (pregistrypriv->ht_enable && is_supported_ht(pregistrypriv->wireless_mode)) { - ptmp = rtw_get_ie(&pnetwork->network.IEs[12], _HT_CAPABILITY_IE_, &tmp_len, pnetwork->network.IELength - 12); + ptmp = rtw_get_ie(&pnetwork->network.IEs[12], WLAN_EID_HT_CAPABILITY, &tmp_len, pnetwork->network.IELength - 12); if (ptmp && tmp_len > 0) { /* Added by Albert 2010/06/23 */ /* For the WEP mode, we will use the bg mode to do the connection to avoid some IOT issue. */ @@ -3231,8 +3231,8 @@ static void dynamic_update_bcn_check(_adapter *padapter) && _FALSE == atomic_read(&pmlmepriv->olbc_ht)) { if (rtw_ht_operation_update(padapter) > 0) { - update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE); - update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _TRUE); + update_beacon(padapter, WLAN_EID_HT_CAPABILITY, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_HT_OPERATION, NULL, _TRUE); } } #endif /* CONFIG_80211N_HT */ @@ -3245,8 +3245,8 @@ static void dynamic_update_bcn_check(_adapter *padapter) && _FALSE != atomic_read(&pmlmepriv->olbc_ht)) { if (rtw_ht_operation_update(padapter) > 0) { - update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE); - update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _TRUE); + update_beacon(padapter, WLAN_EID_HT_CAPABILITY, NULL, _FALSE); + update_beacon(padapter, WLAN_EID_HT_OPERATION, NULL, _TRUE); } atomic_set(&pmlmepriv->olbc, _FALSE); @@ -4147,7 +4147,7 @@ static void rtw_chk_hi_queue_hdl(_adapter *padapter) rtw_tim_map_clear(padapter, pstapriv->sta_dz_bitmap, 0); if (update_tim == _TRUE) - _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "bmc sleepq and HIQ empty"); + _update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "bmc sleepq and HIQ empty"); } else /* re check again */ rtw_chk_hi_queue_cmd(padapter); diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 348faa6..fa949b8 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -530,7 +530,7 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv) ie += 2; /* SSID */ - ie = rtw_set_ie(ie, _SSID_IE_, pdev_network->Ssid.SsidLength, pdev_network->Ssid.Ssid, &sz); + ie = rtw_set_ie(ie, WLAN_EID_SSID, pdev_network->Ssid.SsidLength, pdev_network->Ssid.Ssid, &sz); /* supported rates */ if (pregistrypriv->wireless_mode == WIRELESS_11ABGN) { @@ -551,21 +551,21 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv) rateLen = rtw_get_rateset_len(pdev_network->SupportedRates); if (rateLen > 8) { - ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, 8, pdev_network->SupportedRates, &sz); - /* ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), (pdev_network->SupportedRates + 8), &sz); */ + ie = rtw_set_ie(ie, WLAN_EID_SUPP_RATES, 8, pdev_network->SupportedRates, &sz); + /* ie = rtw_set_ie(ie, WLAN_EID_EXT_SUPP_RATES, (rateLen - 8), (pdev_network->SupportedRates + 8), &sz); */ } else - ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, rateLen, pdev_network->SupportedRates, &sz); + ie = rtw_set_ie(ie, WLAN_EID_SUPP_RATES, rateLen, pdev_network->SupportedRates, &sz); /* DS parameter set */ - ie = rtw_set_ie(ie, _DSSET_IE_, 1, (u8 *)&(pdev_network->Configuration.DSConfig), &sz); + ie = rtw_set_ie(ie, WLAN_EID_DS_PARAMS, 1, (u8 *)&(pdev_network->Configuration.DSConfig), &sz); /* IBSS Parameter Set */ - ie = rtw_set_ie(ie, _IBSS_PARA_IE_, 2, (u8 *)&(pdev_network->Configuration.ATIMWindow), &sz); + ie = rtw_set_ie(ie, WLAN_EID_IBSS_PARAMS, 2, (u8 *)&(pdev_network->Configuration.ATIMWindow), &sz); if (rateLen > 8) - ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), (pdev_network->SupportedRates + 8), &sz); + ie = rtw_set_ie(ie, WLAN_EID_EXT_SUPP_RATES, (rateLen - 8), (pdev_network->SupportedRates + 8), &sz); #ifdef CONFIG_80211N_HT /* HT Cap. */ @@ -942,8 +942,8 @@ int rtw_get_wapi_ie(u8 *in_ie, uint in_len, u8 *wapi_ie, u16 *wapi_len) while (cnt < in_len) { authmode = in_ie[cnt]; - /* if(authmode==_WAPI_IE_) */ - if (authmode == _WAPI_IE_ && (_rtw_memcmp(&in_ie[cnt + 6], wapi_oui1, 4) == _TRUE || + /* if(authmode==WLAN_EID_BSS_AC_ACCESS_DELAY) */ + if (authmode == WLAN_EID_BSS_AC_ACCESS_DELAY && (_rtw_memcmp(&in_ie[cnt + 6], wapi_oui1, 4) == _TRUE || _rtw_memcmp(&in_ie[cnt + 6], wapi_oui2, 4) == _TRUE)) { if (wapi_ie) memcpy(wapi_ie, &in_ie[cnt], in_ie[cnt + 1] + 2); @@ -1124,7 +1124,7 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id , u8 *buf_at if (len_attr) *len_attr = 0; - if ((wps_ie[0] != _VENDOR_SPECIFIC_IE_) || + if ((wps_ie[0] != WLAN_EID_VENDOR_SPECIFIC) || (_rtw_memcmp(wps_ie + 2, wps_oui , 4) != _TRUE)) return attr_ptr; @@ -1413,7 +1413,7 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len, elems->vht_op_mode_notify = pos; elems->vht_op_mode_notify_len = elen; break; - case _EID_RRM_EN_CAP_IE_: + case WLAN_EID_RRM_ENABLED_CAPABILITIES : elems->rm_en_cap = pos; elems->rm_en_cap_len = elen; break; @@ -1767,7 +1767,7 @@ void rtw_ies_get_chbw(u8 *ies, int ies_len, u8 *ch, u8 *bw, u8 *offset, u8 ht, u *bw = CHANNEL_WIDTH_20; *offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; - p = rtw_get_ie(ies, _DSSET_IE_, &ie_len, ies_len); + p = rtw_get_ie(ies, WLAN_EID_DS_PARAMS, &ie_len, ies_len); if (p && ie_len > 0) *ch = *(p + 2); @@ -1944,7 +1944,7 @@ u32 rtw_get_p2p_merged_ies_len(u8 *in_ie, u32 in_len) while (i < in_len) { pIE = (PNDIS_802_11_VARIABLE_IEs)(in_ie + i); - if (pIE->ElementID == _VENDOR_SPECIFIC_IE_ && _rtw_memcmp(pIE->data, OUI, 4)) { + if (pIE->ElementID == WLAN_EID_VENDOR_SPECIFIC && _rtw_memcmp(pIE->data, OUI, 4)) { len += pIE->Length - 4; /* 4 is P2P OUI length, don't count it in this loop */ } @@ -1978,7 +1978,7 @@ int rtw_p2p_merge_ies(u8 *in_ie, u32 in_len, u8 *merge_ie) pIE = (PNDIS_802_11_VARIABLE_IEs)(in_ie + i); /* Take out the rest of P2P OUIs */ - if (pIE->ElementID == _VENDOR_SPECIFIC_IE_ && _rtw_memcmp(pIE->data, OUI, 4)) { + if (pIE->ElementID == WLAN_EID_VENDOR_SPECIFIC && _rtw_memcmp(pIE->data, OUI, 4)) { memcpy(merge_ie, pIE->data + 4, pIE->Length - 4); len += pIE->Length - 4; merge_ie += pIE->Length - 4; diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 47de85b..5d70d49 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -1190,7 +1190,7 @@ int rtw_is_desired_network(_adapter *adapter, struct wlan_network *pnetwork) bselected = _FALSE; if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) { - p = rtw_get_ie(pnetwork->network.IEs + _BEACON_IE_OFFSET_, _RSN_IE_2_, &ie_len, (pnetwork->network.IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(pnetwork->network.IEs + _BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len, (pnetwork->network.IELength - _BEACON_IE_OFFSET_)); if (p && ie_len > 0) bselected = _TRUE; else @@ -4606,7 +4606,7 @@ void rtw_build_wmm_ie_ht(_adapter *padapter, u8 *out_ie, uint *pout_len) if (padapter->mlmepriv.qospriv.qos_option == 0) { out_len = *pout_len; - pframe = rtw_set_ie(out_ie + out_len, _VENDOR_SPECIFIC_IE_, + pframe = rtw_set_ie(out_ie + out_len, WLAN_EID_VENDOR_SPECIFIC, _WMM_IE_Length_, WMM_IE, pout_len); padapter->mlmepriv.qospriv.qos_option = 1; @@ -4846,16 +4846,16 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui } #endif/*CONFIG_BEAMFORMING*/ - pframe = rtw_set_ie(out_ie + out_len, _HT_CAPABILITY_IE_, + pframe = rtw_set_ie(out_ie + out_len, WLAN_EID_HT_CAPABILITY, sizeof(struct rtw_ieee80211_ht_cap), (unsigned char *)&ht_capie, pout_len); phtpriv->ht_option = _TRUE; if (in_ie != NULL) { - p = rtw_get_ie(in_ie, _HT_ADD_INFO_IE_, &ielen, in_len); + p = rtw_get_ie(in_ie, WLAN_EID_HT_OPERATION, &ielen, in_len); if (p && (ielen == sizeof(struct ieee80211_ht_addt_info))) { out_len = *pout_len; - pframe = rtw_set_ie(out_ie + out_len, _HT_ADD_INFO_IE_, ielen, p + 2 , pout_len); + pframe = rtw_set_ie(out_ie + out_len, WLAN_EID_HT_OPERATION, ielen, p + 2 , pout_len); } } @@ -4903,7 +4903,7 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel) /* check Max Rx A-MPDU Size */ len = 0; - p = rtw_get_ie(pie + sizeof(NDIS_802_11_FIXED_IEs), _HT_CAPABILITY_IE_, &len, ie_len - sizeof(NDIS_802_11_FIXED_IEs)); + p = rtw_get_ie(pie + sizeof(NDIS_802_11_FIXED_IEs), WLAN_EID_HT_CAPABILITY, &len, ie_len - sizeof(NDIS_802_11_FIXED_IEs)); if (p && len > 0) { pht_capie = (struct rtw_ieee80211_ht_cap *)(p + 2); max_ampdu_sz = (pht_capie->ampdu_params_info & IEEE80211_HT_AMPDU_PARM_FACTOR); @@ -4916,7 +4916,7 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel) len = 0; - p = rtw_get_ie(pie + sizeof(NDIS_802_11_FIXED_IEs), _HT_ADD_INFO_IE_, &len, ie_len - sizeof(NDIS_802_11_FIXED_IEs)); + p = rtw_get_ie(pie + sizeof(NDIS_802_11_FIXED_IEs), WLAN_EID_HT_OPERATION, &len, ie_len - sizeof(NDIS_802_11_FIXED_IEs)); if (p && len > 0) { pht_addtinfo = (struct ieee80211_ht_addt_info *)(p + 2); /* todo: */ diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index c795048..dd357af 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -1203,7 +1203,7 @@ static u8 cmp_pkt_chnl_diff(_adapter *padapter, u8 *pframe, uint packet_len) u8 channel; u8 *p; - p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _BEACON_IE_OFFSET_, _DSSET_IE_, &len, packet_len - _BEACON_IE_OFFSET_); + p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _BEACON_IE_OFFSET_, WLAN_EID_DS_PARAMS, &len, packet_len - _BEACON_IE_OFFSET_); if (p) { channel = *(p + 2); if (padapter->mlmeextpriv.cur_channel >= channel) @@ -1550,7 +1550,7 @@ _continue: u8 RC_OUI[4] = {0x00, 0xE0, 0x4C, 0x0A}; /* EID[1] + EID_LEN[1] + RC_OUI[4] + MAC[6] + PairingID[2] + ChannelNum[2] */ - p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, _VENDOR_SPECIFIC_IE_, (int *)&ielen, + p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, WLAN_EID_VENDOR_SPECIFIC, (int *)&ielen, len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_); if (!p || ielen != 14) @@ -1656,7 +1656,7 @@ _non_rc_device: } #endif - p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, _SSID_IE_, (int *)&ielen, + p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, WLAN_EID_SSID, (int *)&ielen, len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_); @@ -2111,14 +2111,14 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) RTW_INFO("auth rejected due to bad alg [alg=%d, auth_mib=%d] %02X%02X%02X%02X%02X%02X\n", algorithm, auth_mode, sa[0], sa[1], sa[2], sa[3], sa[4], sa[5]); - status = _STATS_NO_SUPP_ALG_; + status = WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG; goto auth_fail; } #if CONFIG_RTW_MACADDR_ACL if (rtw_access_ctrl(padapter, sa) == _FALSE) { - status = _STATS_UNABLE_HANDLE_STA_; + status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; goto auth_fail; } #endif @@ -2131,7 +2131,7 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) pstat = rtw_alloc_stainfo(pstapriv, sa); if (pstat == NULL) { RTW_INFO(" Exceed the upper limit of supported clients...\n"); - status = _STATS_UNABLE_HANDLE_STA_; + status = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; goto auth_fail; } @@ -2192,7 +2192,7 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) if ((pstat->auth_seq + 1) != seq) { RTW_INFO("(1)auth rejected because out of seq [rx_seq=%d, exp_seq=%d]!\n", seq, pstat->auth_seq + 1); - status = _STATS_OUT_OF_AUTH_SEQ_; + status = WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION; goto auth_fail; } @@ -2210,7 +2210,7 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) } else { RTW_INFO("(2)auth rejected because out of seq [rx_seq=%d, exp_seq=%d]!\n", seq, pstat->auth_seq + 1); - status = _STATS_OUT_OF_AUTH_SEQ_; + status = WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION; goto auth_fail; } } else { /* shared system or auto authentication */ @@ -2232,12 +2232,12 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) /* checking for challenging txt... */ RTW_INFO("checking for challenging txt...\n"); - p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + 4 + _AUTH_IE_OFFSET_ , _CHLGETXT_IE_, (int *)&ie_len, + p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + 4 + _AUTH_IE_OFFSET_ , WLAN_EID_CHALLENGE, (int *)&ie_len, len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_ - 4); if ((p == NULL) || (ie_len <= 0)) { RTW_INFO("auth rejected because challenge failure!(1)\n"); - status = _STATS_CHALLENGE_FAIL_; + status = WLAN_STATUS_CHALLENGE_FAIL; goto auth_fail; } @@ -2253,13 +2253,13 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) } } else { RTW_INFO("auth rejected because challenge failure!\n"); - status = _STATS_CHALLENGE_FAIL_; + status = WLAN_STATUS_CHALLENGE_FAIL; goto auth_fail; } } else { RTW_INFO("(3)auth rejected because out of seq [rx_seq=%d, exp_seq=%d]!\n", seq, pstat->auth_seq + 1); - status = _STATS_OUT_OF_AUTH_SEQ_; + status = WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION; goto auth_fail; } } @@ -2269,7 +2269,7 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) pstat->auth_seq = seq + 1; #ifdef CONFIG_NATIVEAP_MLME - issue_auth(padapter, pstat, (unsigned short)(_STATS_SUCCESSFUL_)); + issue_auth(padapter, pstat, (unsigned short)(WLAN_STATUS_SUCCESS)); #endif if ((pstat->state & WIFI_FW_AUTH_SUCCESS) || (pstat->state & WIFI_FW_ASSOC_SUCCESS)) @@ -2355,7 +2355,7 @@ normal: if (seq == 2) { if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared) { /* legendary shared system */ - p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _AUTH_IE_OFFSET_, _CHLGETXT_IE_, (int *)&len, + p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _AUTH_IE_OFFSET_, WLAN_EID_CHALLENGE, (int *)&len, pkt_len - WLAN_HDR_A3_LEN - _AUTH_IE_OFFSET_); if (p == NULL) { @@ -2411,7 +2411,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) struct sta_info *pstat; unsigned char reassoc, *pos; int left; - unsigned short status = _STATS_SUCCESSFUL_; + unsigned short status = WLAN_STATUS_SUCCESS; unsigned short frame_type, ie_offset = 0; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); @@ -2455,7 +2455,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) pstat = rtw_get_stainfo(pstapriv, get_addr2_ptr(pframe)); if (pstat == (struct sta_info *)NULL) { - status = _RSON_CLS2_; + status = WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA; goto asoc_class2_error; } @@ -2475,7 +2475,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) /* check if this stat has been successfully authenticated/assocated */ if (!((pstat->state) & WIFI_FW_AUTH_SUCCESS)) { if (!((pstat->state) & WIFI_FW_ASSOC_SUCCESS)) { - status = _RSON_CLS2_; + status = WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA; goto asoc_class2_error; } else { pstat->state &= (~WIFI_FW_ASSOC_SUCCESS); @@ -2506,7 +2506,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) if (rtw_ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed) { RTW_INFO("STA " MAC_FMT " sent invalid association request\n", MAC_ARG(pstat->cmn.mac_addr)); - status = _STATS_FAILURE_; + status = WLAN_STATUS_UNSPECIFIED_FAILURE; goto OnAssocReqFail; } @@ -2534,19 +2534,19 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) || elems.ssid_len != cur->Ssid.SsidLength || _rtw_memcmp(elems.ssid, cur->Ssid.Ssid, cur->Ssid.SsidLength) == _FALSE ) { - status = _STATS_FAILURE_; + status = WLAN_STATUS_UNSPECIFIED_FAILURE; goto OnAssocReqFail; } /* (Extended) Supported rates */ status = rtw_ap_parse_sta_supported_rates(padapter, pstat , pframe + WLAN_HDR_A3_LEN + ie_offset, pkt_len - WLAN_HDR_A3_LEN - ie_offset); - if (status != _STATS_SUCCESSFUL_) + if (status != WLAN_STATUS_SUCCESS) goto OnAssocReqFail; /* check RSN/WPA/WPS */ status = rtw_ap_parse_sta_security_ie(padapter, pstat, &elems); - if (status != _STATS_SUCCESSFUL_) + if (status != WLAN_STATUS_SUCCESS) goto OnAssocReqFail; /* check if there is WMM IE & support WWM-PS */ @@ -2575,7 +2575,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) */ } - if (status != _STATS_SUCCESSFUL_) + if (status != WLAN_STATUS_SUCCESS) goto OnAssocReqFail; #ifdef CONFIG_P2P @@ -2587,7 +2587,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) p2p_status_code = (u8)process_assoc_req_p2p_ie(pwdinfo, pframe, pkt_len, pstat); if (p2p_status_code > 0) { pstat->p2p_status_code = p2p_status_code; - status = _STATS_CAP_FAIL_; + status = WLAN_STATUS_CAPS_UNSUPPORTED; goto OnAssocReqFail; } } @@ -2650,7 +2650,7 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) } /* now the station is qualified to join our BSS... */ - if (pstat && (pstat->state & WIFI_FW_ASSOC_SUCCESS) && (_STATS_SUCCESSFUL_ == status)) { + if (pstat && (pstat->state & WIFI_FW_ASSOC_SUCCESS) && (WLAN_STATUS_SUCCESS == status)) { #ifdef CONFIG_NATIVEAP_MLME #ifdef CONFIG_IEEE80211W if (pstat->bpairwise_key_installed != _TRUE) @@ -2820,7 +2820,7 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) pIE = (PNDIS_802_11_VARIABLE_IEs)(pframe + i); switch (pIE->ElementID) { - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: if (_rtw_memcmp(pIE->data, WMM_PARA_OUI, 6)) /* WMM */ WMM_param_handler(padapter, pIE); #if defined(CONFIG_P2P) && defined(CONFIG_WFD) @@ -2830,19 +2830,19 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) break; #ifdef CONFIG_WAPI_SUPPORT - case _WAPI_IE_: + case WLAN_EID_BSS_AC_ACCESS_DELAY: pWapiIE = pIE; break; #endif - case _HT_CAPABILITY_IE_: /* HT caps */ + case WLAN_EID_HT_CAPABILITY: /* HT caps */ HT_caps_handler(padapter, pIE); #ifdef ROKU_PRIVATE HT_caps_handler_infra_ap(padapter, pIE); #endif /* ROKU_PRIVATE */ break; - case _HT_EXTRA_INFO_IE_: /* HT info */ + case WLAN_EID_HT_OPERATION: /* HT info */ HT_info_handler(padapter, pIE); break; @@ -2859,11 +2859,11 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) break; #endif - case _ERPINFO_IE_: + case WLAN_EID_ERP_INFO: ERP_IE_handler(padapter, pIE); break; #ifdef CONFIG_TDLS - case _EXT_CAP_IE_: + case WLAN_EID_EXT_CAPABILITY : if (check_ap_tdls_prohibited(pIE->data, pIE->Length) == _TRUE) padapter->tdlsinfo.ap_prohibited = _TRUE; if (check_ap_tdls_ch_switching_prohibited(pIE->data, pIE->Length) == _TRUE) @@ -2872,18 +2872,18 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) #endif /* CONFIG_TDLS */ #ifdef CONFIG_RTW_80211K - case _EID_RRM_EN_CAP_IE_: + case WLAN_EID_RRM_ENABLED_CAPABILITIES : RM_IE_handler(padapter, pIE); break; #endif #ifdef ROKU_PRIVATE /* Infra mode, used to store AP's info , Parse the supported rates from AssocRsp */ - case _SUPPORTEDRATES_IE_: + case WLAN_EID_SUPP_RATES: Supported_rate_infra_ap(padapter, pIE); break; - case _EXT_SUPPORTEDRATES_IE_: + case WLAN_EID_EXT_SUPP_RATES: Extended_Supported_rate_infra_ap(padapter, pIE); break; #endif /* ROKU_PRIVATE */ @@ -3831,7 +3831,7 @@ void issue_p2p_GO_request(_adapter *padapter, u8 *raddr) wpsielen += 2; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); /* P2P IE Section. */ @@ -4111,7 +4111,7 @@ void issue_p2p_GO_request(_adapter *padapter, u8 *raddr) /* Channel Number */ p2pie[p2pielen++] = pwdinfo->operating_channel; /* operating channel number */ - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); #ifdef CONFIG_WFD wfdielen = build_nego_req_wfd_ie(pwdinfo, pframe); @@ -4248,7 +4248,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l memcpy(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "pbc", 3); } - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); /* P2P IE Section. */ @@ -4529,7 +4529,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l } - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); #ifdef CONFIG_WFD wfdielen = build_nego_resp_wfd_ie(pwdinfo, pframe); @@ -4763,7 +4763,7 @@ void issue_p2p_GO_confirm(_adapter *padapter, u8 *raddr, u8 result) p2pielen += pwdinfo->nego_ssidlen; } - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); #ifdef CONFIG_WFD wfdielen = build_nego_confirm_wfd_ie(pwdinfo, pframe); @@ -5061,7 +5061,7 @@ void issue_p2p_invitation_request(_adapter *padapter, u8 *raddr) memcpy(p2pie + p2pielen, pwdinfo->device_name, pwdinfo->device_name_len); p2pielen += pwdinfo->device_name_len; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); #ifdef CONFIG_WFD wfdielen = build_invitation_req_wfd_ie(pwdinfo, pframe); @@ -5296,7 +5296,7 @@ void issue_p2p_invitation_response(_adapter *padapter, u8 *raddr, u8 dialogToken } } - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); #ifdef CONFIG_WFD wfdielen = build_invitation_resp_wfd_ie(pwdinfo, pframe); @@ -5405,7 +5405,7 @@ void issue_p2p_provision_request(_adapter *padapter, u8 *pssid, u8 ussidlen, u8 *(u16 *)(wpsie + wpsielen) = cpu_to_be16(pwdinfo->tx_prov_disc_info.wps_config_method_request); wpsielen += 2; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); #ifdef CONFIG_WFD @@ -5526,14 +5526,14 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) /* SSID */ - pframe = rtw_set_ie(pframe, _SSID_IE_, 7, pwdinfo->p2p_wildcard_ssid, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, 7, pwdinfo->p2p_wildcard_ssid, &pattrib->pktlen); /* supported rates... */ /* Use the OFDM rate in the P2P probe response frame. ( 6(B), 9(B), 12, 18, 24, 36, 48, 54 ) */ - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, 8, pwdinfo->support_rate, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, 8, pwdinfo->support_rate, &pattrib->pktlen); /* DS parameter set */ - pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&pwdinfo->listen_channel, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&pwdinfo->listen_channel, &pattrib->pktlen); #ifdef CONFIG_IOCTL_CFG80211 if (adapter_wdev_data(padapter)->p2p_enabled && pwdinfo->driver_interface == DRIVER_CFG80211) { @@ -5747,7 +5747,7 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) wpsielen += 2; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); p2pielen = build_probe_resp_p2p_ie(pwdinfo, pframe); @@ -5845,11 +5845,11 @@ int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ)) - pframe = rtw_set_ie(pframe, _SSID_IE_, pwdinfo->tx_prov_disc_info.ssid.SsidLength, pwdinfo->tx_prov_disc_info.ssid.Ssid, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, pwdinfo->tx_prov_disc_info.ssid.SsidLength, pwdinfo->tx_prov_disc_info.ssid.Ssid, &(pattrib->pktlen)); else - pframe = rtw_set_ie(pframe, _SSID_IE_, P2P_WILDCARD_SSID_LEN, pwdinfo->p2p_wildcard_ssid, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, P2P_WILDCARD_SSID_LEN, pwdinfo->p2p_wildcard_ssid, &(pattrib->pktlen)); /* Use the OFDM rate in the P2P probe request frame. ( 6(B), 9(B), 12(B), 24(B), 36, 48, 54 ) */ - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, 8, pwdinfo->support_rate, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, 8, pwdinfo->support_rate, &pattrib->pktlen); #ifdef CONFIG_IOCTL_CFG80211 if (adapter_wdev_data(padapter)->p2p_enabled && pwdinfo->driver_interface == DRIVER_CFG80211) { @@ -5969,7 +5969,7 @@ int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) *(u16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_DPID_REGISTRAR_SPEC); /* Registrar-specified */ wpsielen += 2; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); /* P2P OUI */ p2pielen = 0; @@ -6071,7 +6071,7 @@ int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) } - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); } @@ -7974,7 +7974,7 @@ void issue_beacon(_adapter *padapter, int timeout_ms) } #ifdef CONFIG_RTW_80211K - pframe = rtw_set_ie(pframe, _EID_RRM_EN_CAP_IE_, + pframe = rtw_set_ie(pframe, WLAN_EID_RRM_ENABLED_CAPABILITIES , sizeof(padapter->rmpriv.rm_en_cap_def), padapter->rmpriv.rm_en_cap_def, &pattrib->pktlen); #endif @@ -8043,14 +8043,14 @@ void issue_beacon(_adapter *padapter, int timeout_ms) pattrib->pktlen += 2; /* SSID */ - pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pattrib->pktlen); /* supported rates... */ rate_len = rtw_get_rateset_len(cur_network->SupportedRates); - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pattrib->pktlen); /* DS parameter set */ - pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pattrib->pktlen); /* if( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) */ { @@ -8059,16 +8059,16 @@ void issue_beacon(_adapter *padapter, int timeout_ms) /* IBSS Parameter Set... */ /* ATIMWindow = cur->Configuration.ATIMWindow; */ ATIMWindow = 0; - pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_IBSS_PARAMS, 2, (unsigned char *)(&ATIMWindow), &pattrib->pktlen); /* ERP IE */ - pframe = rtw_set_ie(pframe, _ERPINFO_IE_, 1, &erpinfo, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_ERP_INFO, 1, &erpinfo, &pattrib->pktlen); } /* EXTERNDED SUPPORTED RATE */ if (rate_len > 8) - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, (rate_len - 8), (cur_network->SupportedRates + 8), &pattrib->pktlen); /* todo:HT for adhoc */ @@ -8210,7 +8210,7 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe u8 buf[MAX_IE_SZ]; u8 *ies = pmgntframe->buf_addr + TXDESC_OFFSET + sizeof(struct rtw_ieee80211_hdr_3addr); - ssid_ie = rtw_get_ie(ies + _FIXED_IE_LENGTH_, _SSID_IE_, &ssid_ielen, + ssid_ie = rtw_get_ie(ies + _FIXED_IE_LENGTH_, WLAN_EID_SSID, &ssid_ielen, (pframe - ies) - _FIXED_IE_LENGTH_); ssid_ielen_diff = cur_network->Ssid.SsidLength - ssid_ielen; @@ -8266,14 +8266,14 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe /* below for ad-hoc mode */ /* SSID */ - pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pattrib->pktlen); /* supported rates... */ rate_len = rtw_get_rateset_len(cur_network->SupportedRates); - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pattrib->pktlen); /* DS parameter set */ - pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pattrib->pktlen); if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) { u8 erpinfo = 0; @@ -8281,16 +8281,16 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe /* IBSS Parameter Set... */ /* ATIMWindow = cur->Configuration.ATIMWindow; */ ATIMWindow = 0; - pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_IBSS_PARAMS, 2, (unsigned char *)(&ATIMWindow), &pattrib->pktlen); /* ERP IE */ - pframe = rtw_set_ie(pframe, _ERPINFO_IE_, 1, &erpinfo, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_ERP_INFO, 1, &erpinfo, &pattrib->pktlen); } /* EXTERNDED SUPPORTED RATE */ if (rate_len > 8) - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, (rate_len - 8), (cur_network->SupportedRates + 8), &pattrib->pktlen); /* todo:HT for adhoc */ @@ -8298,7 +8298,7 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe } #ifdef CONFIG_RTW_80211K - pframe = rtw_set_ie(pframe, _EID_RRM_EN_CAP_IE_, + pframe = rtw_set_ie(pframe, WLAN_EID_RRM_ENABLED_CAPABILITIES , sizeof(padapter->rmpriv.rm_en_cap_def), padapter->rmpriv.rm_en_cap_def, &pattrib->pktlen); #endif @@ -8360,7 +8360,7 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe memcpy(&RC_INFO[10], (u8 *)&psta->pid, 2); memcpy(&RC_INFO[12], (u8 *)&cu_ch, 2); - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, sizeof(RC_INFO), RC_INFO, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, sizeof(RC_INFO), RC_INFO, &pattrib->pktlen); } } #endif /* CONFIG_AUTO_AP_MODE */ @@ -8462,20 +8462,20 @@ int _issue_probereq(_adapter *padapter, const NDIS_802_11_SSID *pssid, const u8 pattrib->pktlen = sizeof(struct rtw_ieee80211_hdr_3addr); if (pssid && !MLME_IS_MESH(padapter)) - pframe = rtw_set_ie(pframe, _SSID_IE_, pssid->SsidLength, pssid->Ssid, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, pssid->SsidLength, pssid->Ssid, &(pattrib->pktlen)); else - pframe = rtw_set_ie(pframe, _SSID_IE_, 0, NULL, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, 0, NULL, &(pattrib->pktlen)); get_rate_set(padapter, bssrate, &bssrate_len); if (bssrate_len > 8) { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , 8, bssrate, &(pattrib->pktlen)); - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES , 8, bssrate, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); } else - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES , bssrate_len , bssrate, &(pattrib->pktlen)); if (ch) - pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, &ch, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, &ch, &pattrib->pktlen); #ifdef CONFIG_RTW_MESH if (MLME_IS_MESH(padapter)) { @@ -8625,7 +8625,7 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status /* setting auth algo number */ val16 = (u16)psta->authalg; - if (status != _STATS_SUCCESSFUL_) + if (status != WLAN_STATUS_SUCCESS) val16 = 0; if (val16) { @@ -8647,7 +8647,7 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status /* added challenging text... */ if ((psta->auth_seq == 2) && (psta->state & WIFI_FW_AUTH_STATE) && (use_shared_key == 1)) - pframe = rtw_set_ie(pframe, _CHLGETXT_IE_, 128, psta->chg_txt, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_CHALLENGE, 128, psta->chg_txt, &(pattrib->pktlen)); #endif } else { memcpy(pwlanhdr->addr1, get_my_bssid(&pmlmeinfo->network), ETH_ALEN); @@ -8700,7 +8700,7 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status /* then checking to see if sending challenging text... */ if ((pmlmeinfo->auth_seq == 3) && (pmlmeinfo->state & WIFI_FW_AUTH_STATE) && (use_shared_key == 1)) { - pframe = rtw_set_ie(pframe, _CHLGETXT_IE_, 128, pmlmeinfo->chg_txt, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_CHALLENGE, 128, pmlmeinfo->chg_txt, &(pattrib->pktlen)); SetPrivacy(fctrl); @@ -8799,10 +8799,10 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p pframe = rtw_set_fixed_ie(pframe, _ASOC_ID_ , (unsigned char *)&val, &(pattrib->pktlen)); if (pstat->bssratelen <= 8) - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, pstat->bssratelen, pstat->bssrateset, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, pstat->bssratelen, pstat->bssrateset, &(pattrib->pktlen)); else { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, 8, pstat->bssrateset, &(pattrib->pktlen)); - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (pstat->bssratelen - 8), pstat->bssrateset + 8, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, 8, pstat->bssrateset, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, (pstat->bssratelen - 8), pstat->bssrateset + 8, &(pattrib->pktlen)); } #ifdef CONFIG_IEEE80211W @@ -8813,7 +8813,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p timeout_itvl[0] = 0x03; timeout_interval = cpu_to_le32(timeout_interval); memcpy(timeout_itvl + 1, &timeout_interval, 4); - pframe = rtw_set_ie(pframe, _TIMEOUT_ITVL_IE_, 5, timeout_itvl, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_TIMEOUT_INTERVAL, 5, timeout_itvl, &(pattrib->pktlen)); } #endif /* CONFIG_IEEE80211W */ @@ -8823,7 +8823,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p /* FILL HT CAP INFO IE */ /* p = hostapd_eid_ht_capabilities_info(hapd, p); */ - pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_CAPABILITY_IE_, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); + pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_HT_CAPABILITY, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); if (pbuf && ie_len > 0) { memcpy(pframe, pbuf, ie_len + 2); pframe += (ie_len + 2); @@ -8832,7 +8832,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p /* FILL HT ADD INFO IE */ /* p = hostapd_eid_ht_operation(hapd, p); */ - pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_ADD_INFO_IE_, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); + pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_HT_OPERATION, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); if (pbuf && ie_len > 0) { memcpy(pframe, pbuf, ie_len + 2); pframe += (ie_len + 2); @@ -8846,7 +8846,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p if (pmlmepriv->ext_capab_ie_len > 0) { uint ie_len = 0; - pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _EXT_CAP_IE_, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); + pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_EXT_CAPABILITY , &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); if (pbuf && ie_len > 0) { memcpy(pframe, pbuf, ie_len + 2); pframe += (ie_len + 2); @@ -8884,7 +8884,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p unsigned char WMM_PARA_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01}; for (pbuf = ie + _BEACON_IE_OFFSET_; ; pbuf += (ie_len + 2)) { - pbuf = rtw_get_ie(pbuf, _VENDOR_SPECIFIC_IE_, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2))); + pbuf = rtw_get_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, &ie_len, (pnetwork->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2))); if (pbuf && _rtw_memcmp(pbuf + 2, WMM_PARA_IE, 6)) { memcpy(pframe, pbuf, ie_len + 2); pframe += (ie_len + 2); @@ -8901,7 +8901,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_REALTEK) - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 6 , REALTEK_96B_IE, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, 6 , REALTEK_96B_IE, &(pattrib->pktlen)); /* add WPS IE ie for wps 2.0 */ if (pmlmepriv->wps_assoc_resp_ie && pmlmepriv->wps_assoc_resp_ie_len > 0) { @@ -9049,7 +9049,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) } /* SSID */ - pframe = rtw_set_ie(pframe, _SSID_IE_, pmlmeinfo->network.Ssid.SsidLength, pmlmeinfo->network.Ssid.Ssid, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, pmlmeinfo->network.Ssid.SsidLength, pmlmeinfo->network.Ssid.Ssid, &(pattrib->pktlen)); #ifdef CONFIG_DFS /* Dot H */ @@ -9148,10 +9148,10 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) if (bssrate_len > 8) { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , 8, bssrate, &(pattrib->pktlen)); - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES , 8, bssrate, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); } else if (bssrate_len > 0) - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES , bssrate_len , bssrate, &(pattrib->pktlen)); else RTW_INFO("%s: Connect to AP without 11b and 11g data rate!\n", __FUNCTION__); @@ -9161,7 +9161,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) | pmlmeinfo->network.PhyInfo.rm_en_cap[2] | pmlmeinfo->network.PhyInfo.rm_en_cap[3] | pmlmeinfo->network.PhyInfo.rm_en_cap[4]) - pframe = rtw_set_ie(pframe, _EID_RRM_EN_CAP_IE_, 5, + pframe = rtw_set_ie(pframe, WLAN_EID_RRM_ENABLED_CAPABILITIES , 5, (u8 *)padapter->rmpriv.rm_en_cap_def, &(pattrib->pktlen)); #endif /* CONFIG_RTW_80211K */ @@ -9170,7 +9170,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) pIE = (PNDIS_802_11_VARIABLE_IEs)(pmlmeinfo->network.IEs + i); switch (pIE->ElementID) { - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: if ((_rtw_memcmp(pIE->data, RTW_WPA_OUI, 4)) || (_rtw_memcmp(pIE->data, WMM_OUI, 4)) || (_rtw_memcmp(pIE->data, WPS_OUI, 4))) { @@ -9183,7 +9183,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) vs_ie_length = 14; } - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, vs_ie_length, pIE->data, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, vs_ie_length, pIE->data, &(pattrib->pktlen)); } break; @@ -9243,7 +9243,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) } if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_REALTEK) - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 6 , REALTEK_96B_IE, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, 6 , REALTEK_96B_IE, &(pattrib->pktlen)); #ifdef CONFIG_WAPI_SUPPORT @@ -9387,7 +9387,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) memcpy(p2pie + p2pielen, pwdinfo->device_addr, ETH_ALEN); /* P2P Interface Address List */ p2pielen += ETH_ALEN; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen); } } @@ -10466,7 +10466,7 @@ void issue_action_BSSCoexistPacket(_adapter *padapter) pbss_network = (WLAN_BSSID_EX *)&pnetwork->network; - p = rtw_get_ie(pbss_network->IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pbss_network->IELength - _FIXED_IE_LENGTH_); + p = rtw_get_ie(pbss_network->IEs + _FIXED_IE_LENGTH_, WLAN_EID_HT_CAPABILITY, &len, pbss_network->IELength - _FIXED_IE_LENGTH_); if ((p == NULL) || (len == 0)) { /* non-HT */ if ((pbss_network->Configuration.DSConfig <= 0) || (pbss_network->Configuration.DSConfig > 14)) continue; @@ -10974,7 +10974,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI #endif /* checking SSID */ - p = rtw_get_ie(bssid->IEs + ie_offset, _SSID_IE_, &len, bssid->IELength - ie_offset); + p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_SSID, &len, bssid->IELength - ie_offset); if (p == NULL) { RTW_INFO("marc: cannot find SSID for survey event\n"); return _FAIL; @@ -10994,13 +10994,13 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI /* checking rate info... */ i = 0; - p = rtw_get_ie(bssid->IEs + ie_offset, _SUPPORTEDRATES_IE_, &len, bssid->IELength - ie_offset); + p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_SUPP_RATES, &len, bssid->IELength - ie_offset); if (p != NULL) { if (len > NDIS_802_11_LENGTH_RATES_EX) { RTW_INFO("%s()-%d: IE too long (%d) for survey event\n", __FUNCTION__, __LINE__, len); return _FAIL; } - if (rtw_validate_value(_SUPPORTEDRATES_IE_, p+2, len) == _FALSE) { + if (rtw_validate_value(WLAN_EID_SUPP_RATES, p+2, len) == _FALSE) { rtw_absorb_ssid_ifneed(padapter, bssid, pframe); RTW_DBG_DUMP("Invalidated Support Rate IE --", p, len+2); return _FAIL; @@ -11009,13 +11009,13 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI i = len; } - p = rtw_get_ie(bssid->IEs + ie_offset, _EXT_SUPPORTEDRATES_IE_, &len, bssid->IELength - ie_offset); + p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_EXT_SUPP_RATES, &len, bssid->IELength - ie_offset); if (p != NULL) { if (len > (NDIS_802_11_LENGTH_RATES_EX - i)) { RTW_INFO("%s()-%d: IE too long (%d) for survey event\n", __FUNCTION__, __LINE__, len); return _FAIL; } - if (rtw_validate_value(_EXT_SUPPORTEDRATES_IE_, p+2, len) == _FALSE) { + if (rtw_validate_value(WLAN_EID_EXT_SUPP_RATES, p+2, len) == _FALSE) { rtw_absorb_ssid_ifneed(padapter, bssid, pframe); RTW_DBG_DUMP("Invalidated EXT Support Rate IE --", p, len+2); return _FAIL; @@ -11063,7 +11063,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI return _FAIL; /* Checking for DSConfig */ - p = rtw_get_ie(bssid->IEs + ie_offset, _DSSET_IE_, &len, bssid->IELength - ie_offset); + p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_DS_PARAMS, &len, bssid->IELength - ie_offset); bssid->Configuration.DSConfig = 0; bssid->Configuration.Length = 0; @@ -11073,7 +11073,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI else { /* In 5G, some ap do not have DSSET IE */ /* checking HT info for channel */ - p = rtw_get_ie(bssid->IEs + ie_offset, _HT_ADD_INFO_IE_, &len, bssid->IELength - ie_offset); + p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_HT_OPERATION, &len, bssid->IELength - ie_offset); if (p) { struct HT_info_element *HT_info = (struct HT_info_element *)(p + 2); bssid->Configuration.DSConfig = HT_info->primary_channel; @@ -11144,7 +11144,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI if ((pregistrypriv->wifi_spec == 1) && (_FALSE == pmlmeinfo->bwmode_updated)) { struct mlme_priv *pmlmepriv = &padapter->mlmepriv; #ifdef CONFIG_80211N_HT - p = rtw_get_ie(bssid->IEs + ie_offset, _HT_CAPABILITY_IE_, &len, bssid->IELength - ie_offset); + p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_HT_CAPABILITY, &len, bssid->IELength - ie_offset); if (p && len > 0) { struct HT_caps_element *pHT_caps; pHT_caps = (struct HT_caps_element *)(p + 2); @@ -11178,7 +11178,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI bssid->PhyInfo.SignalQuality = 101; #ifdef CONFIG_RTW_80211K - p = rtw_get_ie(bssid->IEs + ie_offset, _EID_RRM_EN_CAP_IE_, &len, bssid->IELength - ie_offset); + p = rtw_get_ie(bssid->IEs + ie_offset, WLAN_EID_RRM_ENABLED_CAPABILITIES , &len, bssid->IELength - ie_offset); if (p) memcpy(bssid->PhyInfo.rm_en_cap, (p + 2), *(p + 1)); @@ -13748,16 +13748,16 @@ static int rtw_auto_ap_start_beacon(_adapter *adapter) ie += 2; /* SSID */ - ie = rtw_set_ie(ie, _SSID_IE_, ssid_len, ssid, &sz); + ie = rtw_set_ie(ie, WLAN_EID_SSID, ssid_len, ssid, &sz); /* supported rates */ wireless_mode = WIRELESS_11BG_24N; rtw_set_supported_rate(supportRate, wireless_mode) ; rateLen = rtw_get_rateset_len(supportRate); if (rateLen > 8) - ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, 8, supportRate, &sz); + ie = rtw_set_ie(ie, WLAN_EID_SUPP_RATES, 8, supportRate, &sz); else - ie = rtw_set_ie(ie, _SUPPORTEDRATES_IE_, rateLen, supportRate, &sz); + ie = rtw_set_ie(ie, WLAN_EID_SUPP_RATES, rateLen, supportRate, &sz); /* DS parameter set */ @@ -13766,11 +13766,11 @@ static int rtw_auto_ap_start_beacon(_adapter *adapter) else oper_channel = adapter_to_dvobj(adapter)->oper_channel; - ie = rtw_set_ie(ie, _DSSET_IE_, 1, &oper_channel, &sz); + ie = rtw_set_ie(ie, WLAN_EID_DS_PARAMS, 1, &oper_channel, &sz); /* ext supported rates */ if (rateLen > 8) - ie = rtw_set_ie(ie, _EXT_SUPPORTEDRATES_IE_, (rateLen - 8), (supportRate + 8), &sz); + ie = rtw_set_ie(ie, WLAN_EID_EXT_SUPP_RATES, (rateLen - 8), (supportRate + 8), &sz); RTW_INFO("%s, start auto ap beacon sz=%d\n", __FUNCTION__, sz); @@ -14009,17 +14009,17 @@ u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) pIE = (PNDIS_802_11_VARIABLE_IEs)(pnetwork->IEs + i); switch (pIE->ElementID) { - case _VENDOR_SPECIFIC_IE_: /* Get WMM IE. */ + case WLAN_EID_VENDOR_SPECIFIC: /* Get WMM IE. */ if (_rtw_memcmp(pIE->data, WMM_OUI, 4)) WMM_param_handler(padapter, pIE); break; #ifdef CONFIG_80211N_HT - case _HT_CAPABILITY_IE_: /* Get HT Cap IE. */ + case WLAN_EID_HT_CAPABILITY: /* Get HT Cap IE. */ pmlmeinfo->HT_caps_enable = 1; break; - case _HT_EXTRA_INFO_IE_: /* Get HT Info IE. */ + case WLAN_EID_HT_OPERATION: /* Get HT Info IE. */ pmlmeinfo->HT_info_enable = 1; break; #endif /* CONFIG_80211N_HT */ @@ -15965,7 +15965,7 @@ void change_band_update_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 ch) if (ch >= 36) { network_type = WIRELESS_11A; total_rate_len = IEEE80211_NUM_OFDM_RATESLEN; - rtw_remove_bcn_ie(padapter, pnetwork, _ERPINFO_IE_); + rtw_remove_bcn_ie(padapter, pnetwork, WLAN_EID_ERP_INFO); #ifdef CONFIG_80211AC_VHT /* if channel in 5G band, then add vht ie . */ if ((pmlmepriv->htpriv.ht_option == _TRUE) @@ -15981,7 +15981,7 @@ void change_band_update_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 ch) } else { network_type = WIRELESS_11BG; total_rate_len = IEEE80211_CCK_RATE_LEN + IEEE80211_NUM_OFDM_RATESLEN; - rtw_add_bcn_ie(padapter, pnetwork, _ERPINFO_IE_, &erpinfo, 1); + rtw_add_bcn_ie(padapter, pnetwork, WLAN_EID_ERP_INFO, &erpinfo, 1); #ifdef CONFIG_80211AC_VHT rtw_vht_ies_detach(padapter, pnetwork); #endif @@ -15999,12 +15999,12 @@ void change_band_update_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 ch) remainder_rate_len = 0; } - rtw_add_bcn_ie(padapter, pnetwork, _SUPPORTEDRATES_IE_, pnetwork->SupportedRates, rate_len); + rtw_add_bcn_ie(padapter, pnetwork, WLAN_EID_SUPP_RATES, pnetwork->SupportedRates, rate_len); if (remainder_rate_len) - rtw_add_bcn_ie(padapter, pnetwork, _EXT_SUPPORTEDRATES_IE_, (pnetwork->SupportedRates + 8), remainder_rate_len); + rtw_add_bcn_ie(padapter, pnetwork, WLAN_EID_EXT_SUPP_RATES, (pnetwork->SupportedRates + 8), remainder_rate_len); else - rtw_remove_bcn_ie(padapter, pnetwork, _EXT_SUPPORTEDRATES_IE_); + rtw_remove_bcn_ie(padapter, pnetwork, WLAN_EID_EXT_SUPP_RATES); pnetwork->Length = get_WLAN_BSSID_EX_sz(pnetwork); } diff --git a/core/rtw_p2p.c b/core/rtw_p2p.c index ab2f3a5..6cc2867 100644 --- a/core/rtw_p2p.c +++ b/core/rtw_p2p.c @@ -261,7 +261,7 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s /* P2P_ATTR_STATUS */ p2pielen += rtw_set_p2p_attr_content(&p2pie[p2pielen], P2P_ATTR_STATUS, 1, &status); - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, p2pie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, p2pie, &pattrib->pktlen); pattrib->last_txcmdsz = pattrib->pktlen; @@ -361,7 +361,7 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr, RTW_PUT_BE16(wpsie + wpsielen, config_method); wpsielen += 2; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); #ifdef CONFIG_WFD wfdielen = build_provdisc_resp_wfd_ie(pwdinfo, pframe); @@ -451,7 +451,7 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, p2pie, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, p2pie, &(pattrib->pktlen)); pattrib->last_txcmdsz = pattrib->pktlen; @@ -510,7 +510,7 @@ u32 build_beacon_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) /* go_add_noa_attr(pwdinfo); */ - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &len); + pbuf = rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &len); return len; @@ -626,7 +626,7 @@ u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[wfdielen++] = 0; wfdie[wfdielen++] = 0; - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -738,7 +738,7 @@ u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[wfdielen++] = 0; wfdie[wfdielen++] = 0; - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -929,7 +929,7 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel #endif /* CONFIG_TDLS*/ #endif /* CONFIG_CONCURRENT_MODE */ - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + pbuf = rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -1035,7 +1035,7 @@ u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[wfdielen++] = 0; wfdie[wfdielen++] = 0; - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -1134,7 +1134,7 @@ u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[wfdielen++] = 0; wfdie[wfdielen++] = 0; - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -1233,7 +1233,7 @@ u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[wfdielen++] = 0; wfdie[wfdielen++] = 0; - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -1333,7 +1333,7 @@ u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[wfdielen++] = 0; - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -1433,7 +1433,7 @@ u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[wfdielen++] = 0; - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + pbuf = rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -1546,7 +1546,7 @@ u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) } - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -1659,7 +1659,7 @@ u32 build_invitation_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) } - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -1759,7 +1759,7 @@ u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[wfdielen++] = 0; - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -1858,7 +1858,7 @@ u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) wfdie[wfdielen++] = 0; wfdie[wfdielen++] = 0; - rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); + rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, &len); exit: return len; @@ -2071,7 +2071,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) p2pielen += go_add_group_info_attr(pwdinfo, p2pie + p2pielen); - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &len); + pbuf = rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &len); return len; @@ -2200,7 +2200,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 } - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &len); + pbuf = rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &len); return len; @@ -2235,7 +2235,7 @@ u32 build_assoc_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 status /* Value: */ - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &len); + pbuf = rtw_set_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &len); return len; @@ -2256,7 +2256,7 @@ u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l u32 p2pielen = 0; int ssid_len = 0, rate_cnt = 0; - p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, _SUPPORTEDRATES_IE_, (int *)&rate_cnt, + p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, WLAN_EID_SUPP_RATES, (int *)&rate_cnt, len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_); if (rate_cnt <= 4) { @@ -2289,7 +2289,7 @@ u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l /* 5. Requested Device Type in WSC IE. (Todo) */ /* 6. Device ID attribute in P2P IE. (Todo) */ - p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, _SSID_IE_, (int *)&ssid_len, + p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_, WLAN_EID_SSID, (int *)&ssid_len, len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_); ssid_len &= 0xff; /* Just last 1 byte is valid for ssid len of the probe request */ diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 52a33b4..e2c4fa0 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -1662,7 +1662,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) /* upate BCN for TIM IE */ /* update_BCNTIM(padapter); */ - update_beacon(padapter, _TIM_IE_, NULL, _TRUE); + update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE); } /* _exit_critical_bh(&psta->sleep_q.lock, &irqL); */ @@ -1688,7 +1688,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame) /* upate BCN for TIM IE */ /* update_BCNTIM(padapter); */ - update_beacon(padapter, _TIM_IE_, NULL, _TRUE); + update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE); } } } diff --git a/core/rtw_rm.c b/core/rtw_rm.c index e246e4c..5489664 100644 --- a/core/rtw_rm.c +++ b/core/rtw_rm.c @@ -1082,7 +1082,7 @@ static u8 *rm_gen_bcn_detail_elem(_adapter *padapter, u8 *pframe, #if (RM_MORE_DBG_MSG) RTW_INFO("RM: bcn_req_ssid\n"); #endif - pframe = rtw_set_ie(pframe, _SSID_IE_, + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, pbss->Ssid.SsidLength, pbss->Ssid.Ssid, &my_len); break; diff --git a/core/rtw_rson.c b/core/rtw_rson.c index 0d4b8fb..713aca6 100644 --- a/core/rtw_rson.c +++ b/core/rtw_rson.c @@ -218,7 +218,7 @@ int rtw_get_rson_struct(WLAN_BSSID_EX *bssid, struct rtw_rson_struct *rson_data limit = bssid->IELength - _BEACON_IE_OFFSET_; for (p = bssid->IEs + _BEACON_IE_OFFSET_; ; p += (len + 2)) { - p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &len, limit); + p = rtw_get_ie(p, WLAN_EID_VENDOR_SPECIFIC, &len, limit); limit -= len; if ((p == NULL) || (len == 0)) break; @@ -252,7 +252,7 @@ u32 rtw_rson_append_ie(_adapter *padapter, unsigned char *pframe, u32 *len) if ((!pdvobj) || (!pframe)) return 0; ptr = ori = pframe; - *ptr++ = _VENDOR_SPECIFIC_IE_; + *ptr++ = WLAN_EID_VENDOR_SPECIFIC; *ptr++ = ie_len = sizeof(RTW_RSON_OUI)+sizeof(pdvobj->rson_data); memcpy(ptr, RTW_RSON_OUI, sizeof(RTW_RSON_OUI)); ptr = ptr + sizeof(RTW_RSON_OUI); @@ -434,7 +434,7 @@ u8 rtw_rson_ap_check_sta(_adapter *padapter, u8 *pframe, uint pkt_len, unsigned #ifndef CONFIG_RTW_REPEATER_SON_ROOT memset(&rson_target, 0, sizeof(rson_target)); for (p = pframe + WLAN_HDR_A3_LEN + ie_offset; ; p += (len + 2)) { - p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &len, pkt_len - WLAN_HDR_A3_LEN - ie_offset); + p = rtw_get_ie(p, WLAN_EID_VENDOR_SPECIFIC, &len, pkt_len - WLAN_HDR_A3_LEN - ie_offset); if ((p == NULL) || (len == 0)) break; diff --git a/core/rtw_security.c b/core/rtw_security.c index c16be72..45dab27 100644 --- a/core/rtw_security.c +++ b/core/rtw_security.c @@ -2045,7 +2045,7 @@ u32 rtw_BIP_verify(_adapter *padapter, u8 *whdr_pos, sint flen u8 mic[16]; mme = whdr_pos + flen - 18; - if (*mme != _MME_IE_) + if (*mme != WLAN_EID_MMIE ) return RTW_RX_HANDLED; /* copy key index */ diff --git a/core/rtw_tdls.c b/core/rtw_tdls.c index 4e8a282..e91e07c 100644 --- a/core/rtw_tdls.c +++ b/core/rtw_tdls.c @@ -727,24 +727,24 @@ u8 *rtw_tdls_set_rsnie(struct tdls_txmgmt *ptxmgmt, u8 *pframe, struct pkt_attri int len = 0; if (ptxmgmt->len > 0) - p = rtw_get_ie(ptxmgmt->buf, _RSN_IE_2_, &len, ptxmgmt->len); + p = rtw_get_ie(ptxmgmt->buf, WLAN_EID_RSN, &len, ptxmgmt->len); if (p != NULL) - return rtw_set_ie(pframe, _RSN_IE_2_, len, p + 2, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_RSN, len, p + 2, &(pattrib->pktlen)); else if (init == _TRUE) - return rtw_set_ie(pframe, _RSN_IE_2_, sizeof(TDLS_RSNIE), TDLS_RSNIE, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_RSN, sizeof(TDLS_RSNIE), TDLS_RSNIE, &(pattrib->pktlen)); else - return rtw_set_ie(pframe, _RSN_IE_2_, sizeof(ptdls_sta->TDLS_RSNIE), ptdls_sta->TDLS_RSNIE, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_RSN, sizeof(ptdls_sta->TDLS_RSNIE), ptdls_sta->TDLS_RSNIE, &(pattrib->pktlen)); } u8 *rtw_tdls_set_ext_cap(u8 *pframe, struct pkt_attrib *pattrib) { - return rtw_set_ie(pframe, _EXT_CAP_IE_ , sizeof(TDLS_EXT_CAPIE), TDLS_EXT_CAPIE, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_EXT_CAPABILITY , sizeof(TDLS_EXT_CAPIE), TDLS_EXT_CAPIE, &(pattrib->pktlen)); } u8 *rtw_tdls_set_qos_cap(u8 *pframe, struct pkt_attrib *pattrib) { - return rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, sizeof(TDLS_WMMIE), TDLS_WMMIE, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, sizeof(TDLS_WMMIE), TDLS_WMMIE, &(pattrib->pktlen)); } u8 *rtw_tdls_set_ftie(struct tdls_txmgmt *ptxmgmt, u8 *pframe, struct pkt_attrib *pattrib, u8 *ANonce, u8 *SNonce) @@ -777,10 +777,10 @@ u8 *rtw_tdls_set_timeout_interval(struct tdls_txmgmt *ptxmgmt, u8 *pframe, struc int len = 0; if (ptxmgmt->len > 0) - p = rtw_get_ie(ptxmgmt->buf, _TIMEOUT_ITVL_IE_, &len, ptxmgmt->len); + p = rtw_get_ie(ptxmgmt->buf, WLAN_EID_TIMEOUT_INTERVAL, &len, ptxmgmt->len); if (p != NULL) - return rtw_set_ie(pframe, _TIMEOUT_ITVL_IE_, len, p + 2, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_TIMEOUT_INTERVAL, len, p + 2, &(pattrib->pktlen)); else { /* Timeout interval */ timeout_itvl[0] = 0x02; @@ -789,7 +789,7 @@ u8 *rtw_tdls_set_timeout_interval(struct tdls_txmgmt *ptxmgmt, u8 *pframe, struc else memcpy(timeout_itvl + 1, (u8 *)(&ptdls_sta->TDLS_PeerKey_Lifetime), 4); - return rtw_set_ie(pframe, _TIMEOUT_ITVL_IE_, 5, timeout_itvl, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_TIMEOUT_INTERVAL, 5, timeout_itvl, &(pattrib->pktlen)); } } @@ -867,14 +867,14 @@ u8 *rtw_tdls_set_supported_rate(_adapter *padapter, u8 *pframe, struct pkt_attri bssrate_len = rtw_get_rateset_len(bssrate); if (bssrate_len > 8) { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , 8, bssrate, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES , 8, bssrate, &(pattrib->pktlen)); more_supportedrates = 1; } else - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES , bssrate_len , bssrate, &(pattrib->pktlen)); /* extended supported rates */ if (more_supportedrates == 1) - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES , (bssrate_len - 8), (bssrate + 8), &(pattrib->pktlen)); return pframe; } @@ -1075,7 +1075,7 @@ u8 *rtw_tdls_set_wmm_params(_adapter *padapter, u8 *pframe, struct pkt_attrib *p memcpy(wmm_param_ele + 6, (u8 *)&TDLS_WMM_PARAM_IE, sizeof(TDLS_WMM_PARAM_IE)); else memcpy(wmm_param_ele + 6, (u8 *)&pmlmeinfo->WMM_param, sizeof(pmlmeinfo->WMM_param)); - return rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 24, wmm_param_ele, &(pattrib->pktlen)); + return rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, 24, wmm_param_ele, &(pattrib->pktlen)); } else return pframe; } @@ -1902,7 +1902,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct if (ptdls_sta) { txmgmt.dialog_token = *(ptr + 2); /* Copy dialog token */ - txmgmt.status_code = _STATS_SUCCESSFUL_; + txmgmt.status_code = WLAN_STATUS_SUCCESS; /* Parsing information element */ for (j = FIXED_IE; j < parsing_length;) { @@ -1910,13 +1910,13 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct pIE = (PNDIS_802_11_VARIABLE_IEs)(ptr + j); switch (pIE->ElementID) { - case _SUPPORTEDRATES_IE_: + case WLAN_EID_SUPP_RATES: memcpy(supportRate, pIE->data, pIE->Length); supportRateNum = pIE->Length; break; case _COUNTRY_IE_: break; - case _EXT_SUPPORTEDRATES_IE_: + case WLAN_EID_EXT_SUPP_RATES: if (supportRateNum < sizeof(supportRate)) { memcpy(supportRate + supportRateNum, pIE->data, pIE->Length); supportRateNum += pIE->Length; @@ -1924,7 +1924,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct break; case _SUPPORTED_CH_IE_: break; - case _RSN_IE_2_: + case WLAN_EID_RSN: rsnie_included = 1; if (prx_pkt_attrib->encrypt) { prsnie = (u8 *)pIE; @@ -1941,22 +1941,22 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct txmgmt.status_code = _STATS_INVALID_RSNIE_; } break; - case _EXT_CAP_IE_: + case WLAN_EID_EXT_CAPABILITY : break; - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: break; case _FTIE_: if (prx_pkt_attrib->encrypt) memcpy(SNonce, (ptr + j + 52), 32); break; - case _TIMEOUT_ITVL_IE_: + case WLAN_EID_TIMEOUT_INTERVAL: if (prx_pkt_attrib->encrypt) timeout_interval = cpu_to_le32(*(u32 *)(ptr + j + 3)); break; case _RIC_Descriptor_IE_: break; #ifdef CONFIG_80211N_HT - case _HT_CAPABILITY_IE_: + case WLAN_EID_HT_CAPABILITY: rtw_tdls_process_ht_cap(padapter, ptdls_sta, pIE->data, pIE->Length); break; #endif @@ -1983,7 +1983,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct /* Check status code */ /* If responder STA has/hasn't security on AP, but request hasn't/has RSNIE, it should reject */ - if (txmgmt.status_code == _STATS_SUCCESSFUL_) { + if (txmgmt.status_code == WLAN_STATUS_SUCCESS) { if (rsnie_included && prx_pkt_attrib->encrypt == 0) txmgmt.status_code = _STATS_SEC_DISABLED_; else if (rsnie_included == 0 && prx_pkt_attrib->encrypt) @@ -2027,7 +2027,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct if (rtw_tdls_is_driver_setup(padapter)) { issue_tdls_setup_rsp(padapter, &txmgmt); - if (txmgmt.status_code == _STATS_SUCCESSFUL_) + if (txmgmt.status_code == WLAN_STATUS_SUCCESS) _set_timer(&ptdls_sta->handshake_timer, TDLS_HANDSHAKE_TIME); else { rtw_tdls_teardown_pre_hdl(padapter, ptdls_sta); @@ -2092,13 +2092,13 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct pIE = (PNDIS_802_11_VARIABLE_IEs)(ptr + j); switch (pIE->ElementID) { - case _SUPPORTEDRATES_IE_: + case WLAN_EID_SUPP_RATES: memcpy(supportRate, pIE->data, pIE->Length); supportRateNum = pIE->Length; break; case _COUNTRY_IE_: break; - case _EXT_SUPPORTEDRATES_IE_: + case WLAN_EID_EXT_SUPP_RATES: if (supportRateNum < sizeof(supportRate)) { memcpy(supportRate + supportRateNum, pIE->data, pIE->Length); supportRateNum += pIE->Length; @@ -2106,7 +2106,7 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct break; case _SUPPORTED_CH_IE_: break; - case _RSN_IE_2_: + case WLAN_EID_RSN: prsnie = (u8 *)pIE; /* Check CCMP pairwise_cipher presence. */ ppairwise_cipher = prsnie + 10; @@ -2115,9 +2115,9 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct if (_rtw_memcmp(ppairwise_cipher + 4 * k, RSN_CIPHER_SUITE_CCMP, 4) == _TRUE) verify_ccmp = 1; } - case _EXT_CAP_IE_: + case WLAN_EID_EXT_CAPABILITY : break; - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: if (_rtw_memcmp((u8 *)pIE + 2, WMM_INFO_OUI, 6) == _TRUE) { /* WMM Info ID and OUI */ if ((pregistrypriv->wmm_enable == _TRUE) || (padapter->mlmepriv.htpriv.ht_option == _TRUE)) @@ -2128,14 +2128,14 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct pftie = (u8 *)pIE; memcpy(ANonce, (ptr + j + 20), 32); break; - case _TIMEOUT_ITVL_IE_: + case WLAN_EID_TIMEOUT_INTERVAL: ptimeout_ie = (u8 *)pIE; timeout_interval = cpu_to_le32(*(u32 *)(ptimeout_ie + 3)); break; case _RIC_Descriptor_IE_: break; #ifdef CONFIG_80211N_HT - case _HT_CAPABILITY_IE_: + case WLAN_EID_HT_CAPABILITY: rtw_tdls_process_ht_cap(padapter, ptdls_sta, pIE->data, pIE->Length); break; #endif @@ -2173,7 +2173,7 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct if (prx_pkt_attrib->encrypt) { if (verify_ccmp == 1) { - txmgmt.status_code = _STATS_SUCCESSFUL_; + txmgmt.status_code = WLAN_STATUS_SUCCESS; if (rtw_tdls_is_driver_setup(padapter) == _TRUE) { wpa_tdls_generate_tpk(padapter, ptdls_sta); if (tdls_verify_mic(ptdls_sta->tpk.kck, 2, plinkid_ie, prsnie, ptimeout_ie, pftie) == _FAIL) { @@ -2188,13 +2188,13 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct } else txmgmt.status_code = _STATS_INVALID_RSNIE_; } else - txmgmt.status_code = _STATS_SUCCESSFUL_; + txmgmt.status_code = WLAN_STATUS_SUCCESS; if (rtw_tdls_is_driver_setup(padapter) == _TRUE) { memcpy(txmgmt.peer, prx_pkt_attrib->src, ETH_ALEN); issue_tdls_setup_cfm(padapter, &txmgmt); - if (txmgmt.status_code == _STATS_SUCCESSFUL_) { + if (txmgmt.status_code == WLAN_STATUS_SUCCESS) { rtw_tdls_set_link_established(padapter, _TRUE); if (ptdls_sta->tdls_sta_state & TDLS_RESPONDER_STATE) { @@ -2262,10 +2262,10 @@ int On_TDLS_Setup_Cfm(_adapter *padapter, union recv_frame *precv_frame, struct pIE = (PNDIS_802_11_VARIABLE_IEs)(ptr + j); switch (pIE->ElementID) { - case _RSN_IE_2_: + case WLAN_EID_RSN: prsnie = (u8 *)pIE; break; - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: if (_rtw_memcmp((u8 *)pIE + 2, WMM_PARA_OUI, 6) == _TRUE) { /* WMM Parameter ID and OUI */ ptdls_sta->qos_option = _TRUE; @@ -2274,11 +2274,11 @@ int On_TDLS_Setup_Cfm(_adapter *padapter, union recv_frame *precv_frame, struct case _FTIE_: pftie = (u8 *)pIE; break; - case _TIMEOUT_ITVL_IE_: + case WLAN_EID_TIMEOUT_INTERVAL: ptimeout_ie = (u8 *)pIE; break; #ifdef CONFIG_80211N_HT - case _HT_EXTRA_INFO_IE_: + case WLAN_EID_HT_OPERATION: break; #endif #ifdef CONFIG_80211AC_VHT @@ -2789,7 +2789,7 @@ void wfd_ie_tdls(_adapter *padapter, u8 *pframe, u32 *pktlen) memcpy(wfdie + wfdielen, pwfd_info->ip_address, 4); wfdielen += 4; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wfdielen, (unsigned char *) wfdie, pktlen); } #endif /* CONFIG_WFD */ diff --git a/core/rtw_wapi.c b/core/rtw_wapi.c index 2502f8a..403c53d 100644 --- a/core/rtw_wapi.c +++ b/core/rtw_wapi.c @@ -569,7 +569,7 @@ void rtw_build_probe_resp_wapi_ie(_adapter *padapter, unsigned char *pframe, str WapiSetIE(padapter); WapiIELength = pWapiInfo->wapiIELength; - pframe[0] = _WAPI_IE_; + pframe[0] = WLAN_EID_BSS_AC_ACCESS_DELAY; pframe[1] = WapiIELength; memcpy(pframe + 2, pWapiInfo->wapiIE, WapiIELength); pframe += WapiIELength + 2; @@ -591,7 +591,7 @@ void rtw_build_beacon_wapi_ie(_adapter *padapter, unsigned char *pframe, struct WapiSetIE(padapter); WapiIELength = pWapiInfo->wapiIELength; - pframe[0] = _WAPI_IE_; + pframe[0] = WLAN_EID_BSS_AC_ACCESS_DELAY; pframe[1] = WapiIELength; memcpy(pframe + 2, pWapiInfo->wapiIE, WapiIELength); pframe += WapiIELength + 2; @@ -627,7 +627,7 @@ void rtw_build_assoc_req_wapi_ie(_adapter *padapter, unsigned char *pframe, stru memcpy(pWapiInfo->wapiIE + WapiIELength, &bkidNum, 2); WapiIELength += 2; - pframe[0] = _WAPI_IE_; + pframe[0] = WLAN_EID_BSS_AC_ACCESS_DELAY; pframe[1] = WapiIELength; memcpy(pframe + 2, pWapiInfo->wapiIE, WapiIELength); pframe += WapiIELength + 2; diff --git a/core/rtw_wlan_util.c b/core/rtw_wlan_util.c index 1c9df57..14df13b 100644 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -2298,8 +2298,8 @@ inline bool match_ranges(u16 EID, u32 value) int nr_range; switch (EID) { - case _EXT_SUPPORTEDRATES_IE_: - case _SUPPORTEDRATES_IE_: + case WLAN_EID_EXT_SUPP_RATES: + case WLAN_EID_SUPP_RATES: nr_range = sizeof(support_rate_ranges)/sizeof(u8); for (i = 0; i < nr_range; i++) { /* clear bit7 before searching. */ @@ -2331,8 +2331,8 @@ bool rtw_validate_value(u16 EID, u8 *p, u16 len) u32 i, nr_val; switch (EID) { - case _EXT_SUPPORTEDRATES_IE_: - case _SUPPORTEDRATES_IE_: + case WLAN_EID_EXT_SUPP_RATES: + case WLAN_EID_SUPP_RATES: nr_val = len; for (i=0; inetwork); /* scan queue records as Hidden SSID && Input frame is NOT Hidden SSID */ if (hidden_ssid_ap(snetwork) && !hidden_ssid_ap(bssid)) { - p = rtw_get_ie(snetwork->IEs+ie_offset, _SSID_IE_, &ssid_len_ori, snetwork->IELength-ie_offset); + p = rtw_get_ie(snetwork->IEs+ie_offset, WLAN_EID_SSID, &ssid_len_ori, snetwork->IELength-ie_offset); if (!p) { _exit_critical_bh(&padapter->mlmepriv.scanned_queue.lock, &irqL); return; @@ -2679,14 +2679,14 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta pIE = (PNDIS_802_11_VARIABLE_IEs)(pframe + (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN) + i); switch (pIE->ElementID) { - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: /* to update WMM paramter set while receiving beacon */ if (_rtw_memcmp(pIE->data, WMM_PARA_OUI, 6) && pIE->Length == WLAN_WMM_LEN) /* WMM */ (WMM_param_handler(padapter, pIE)) ? report_wmm_edca_update(padapter) : 0; break; - case _HT_EXTRA_INFO_IE_: /* HT info */ + case WLAN_EID_HT_OPERATION: /* HT info */ /* HT_info_handler(padapter, pIE); */ bwmode_update_check(padapter, pIE); break; @@ -2695,13 +2695,13 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta rtw_process_vht_op_mode_notify(padapter, pIE->data, psta); break; #endif /* CONFIG_80211AC_VHT */ - case _ERPINFO_IE_: + case WLAN_EID_ERP_INFO: ERP_IE_handler(padapter, pIE); VCS_update(padapter, psta); break; #ifdef CONFIG_TDLS - case _EXT_CAP_IE_: + case WLAN_EID_EXT_CAPABILITY : if (check_ap_tdls_prohibited(pIE->data, pIE->Length) == _TRUE) ptdlsinfo->ap_prohibited = _TRUE; if (check_ap_tdls_ch_switching_prohibited(pIE->data, pIE->Length) == _TRUE) @@ -2813,12 +2813,12 @@ unsigned int is_ap_in_tkip(_adapter *padapter) pIE = (PNDIS_802_11_VARIABLE_IEs)(pmlmeinfo->network.IEs + i); switch (pIE->ElementID) { - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: if ((_rtw_memcmp(pIE->data, RTW_WPA_OUI, 4)) && (_rtw_memcmp((pIE->data + 12), WPA_TKIP_CIPHER, 4))) return _TRUE; break; - case _RSN_IE_2_: + case WLAN_EID_RSN: if (_rtw_memcmp((pIE->data + 8), RSN_TKIP_CIPHER, 4)) return _TRUE; @@ -2847,14 +2847,14 @@ unsigned int should_forbid_n_rate(_adapter *padapter) pIE = (PNDIS_802_11_VARIABLE_IEs)(cur_network->IEs + i); switch (pIE->ElementID) { - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: if (_rtw_memcmp(pIE->data, RTW_WPA_OUI, 4) && ((_rtw_memcmp((pIE->data + 12), WPA_CIPHER_SUITE_CCMP, 4)) || (_rtw_memcmp((pIE->data + 16), WPA_CIPHER_SUITE_CCMP, 4)))) return _FALSE; break; - case _RSN_IE_2_: + case WLAN_EID_RSN: if ((_rtw_memcmp((pIE->data + 8), RSN_CIPHER_SUITE_CCMP, 4)) || (_rtw_memcmp((pIE->data + 12), RSN_CIPHER_SUITE_CCMP, 4))) return _FALSE; @@ -2886,12 +2886,12 @@ unsigned int is_ap_in_wep(_adapter *padapter) pIE = (PNDIS_802_11_VARIABLE_IEs)(pmlmeinfo->network.IEs + i); switch (pIE->ElementID) { - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: if (_rtw_memcmp(pIE->data, RTW_WPA_OUI, 4)) return _FALSE; break; - case _RSN_IE_2_: + case WLAN_EID_RSN: return _FALSE; default: @@ -3098,7 +3098,7 @@ unsigned char check_assoc_AP(u8 *pframe, uint len) pIE = (PNDIS_802_11_VARIABLE_IEs)(pframe + i); switch (pIE->ElementID) { - case _VENDOR_SPECIFIC_IE_: + case WLAN_EID_VENDOR_SPECIFIC: if ((_rtw_memcmp(pIE->data, ARTHEROS_OUI1, 3)) || (_rtw_memcmp(pIE->data, ARTHEROS_OUI2, 3))) { RTW_INFO("link to Artheros AP\n"); return HT_IOT_PEER_ATHEROS; @@ -3462,7 +3462,7 @@ int rtw_ies_get_supported_rate(u8 *ies, uint ies_len, u8 *rate_set, u8 *rate_num return _FALSE; *rate_num = 0; - ie = rtw_get_ie(ies, _SUPPORTEDRATES_IE_, &ie_len, ies_len); + ie = rtw_get_ie(ies, WLAN_EID_SUPP_RATES, &ie_len, ies_len); if (ie == NULL) goto ext_rate; @@ -3480,7 +3480,7 @@ int rtw_ies_get_supported_rate(u8 *ies, uint ies_len, u8 *rate_set, u8 *rate_num } ext_rate: - ie = rtw_get_ie(ies, _EXT_SUPPORTEDRATES_IE_, &ie_len, ies_len); + ie = rtw_get_ie(ies, WLAN_EID_EXT_SUPP_RATES, &ie_len, ies_len); if (ie) { /* get valid extended supported rates */ for (i = 0; i < 12; i++) { @@ -4222,25 +4222,25 @@ unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame) len += 2; /* SSID */ - pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &len); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &len); /* supported rates... */ rate_len = rtw_get_rateset_len(cur_network->SupportedRates); - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &len); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &len); /* DS parameter set */ - pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &len); + pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &len); /* IBSS Parameter Set... */ /* ATIMWindow = cur->Configuration.ATIMWindow; */ ATIMWindow = 0; - pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &len); + pframe = rtw_set_ie(pframe, WLAN_EID_IBSS_PARAMS, 2, (unsigned char *)(&ATIMWindow), &len); /* todo: ERP IE */ /* EXTERNDED SUPPORTED RATE */ if (rate_len > 8) - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &len); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, (rate_len - 8), (cur_network->SupportedRates + 8), &len); if ((len + TXDESC_SIZE) > 256) { /* RTW_INFO("marc: beacon frame too large\n"); */ diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index 8b78b12..534bb94 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -2888,7 +2888,7 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame RTW_PUT_LE64(&MME[2], padapter->securitypriv.dot11wBIPtxpn.val); /* add MME IE with MIC all zero, MME string doesn't include element id and length */ - pframe = rtw_set_ie(pframe, _MME_IE_ , 16 , MME, &(pattrib->pktlen)); + pframe = rtw_set_ie(pframe, WLAN_EID_MMIE , 16 , MME, &(pattrib->pktlen)); pattrib->last_txcmdsz = pattrib->pktlen; /* total frame length - header length */ frame_body_len = pattrib->pktlen - sizeof(struct rtw_ieee80211_hdr_3addr); @@ -3124,7 +3124,7 @@ void rtw_update_protection(_adapter *padapter, u8 *ie, uint ie_len) case AUTO_VCS: default: - perp = rtw_get_ie(ie, _ERPINFO_IE_, &erp_len, ie_len); + perp = rtw_get_ie(ie, WLAN_EID_ERP_INFO, &erp_len, ie_len); if (perp == NULL) pxmitpriv->vcs = NONE_VCS; else { @@ -4816,9 +4816,9 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p /* RTW_INFO_DUMP("enqueue, tim=", pstapriv->tim_bitmap, pstapriv->aid_bmp_len); */ if (update_tim == _TRUE) { if (is_broadcast_mac_addr(pattrib->ra)) - _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "buffer BC"); + _update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "buffer BC"); else - _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "buffer MC"); + _update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "buffer MC"); } else chk_bmc_sleepq_cmd(padapter); @@ -4885,7 +4885,7 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p if (update_tim == _TRUE) { /* RTW_INFO("sleepq_len==1, update BCNTIM\n"); */ /* upate BCN for TIM IE */ - _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "buffer UC"); + _update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "buffer UC"); } } @@ -5170,11 +5170,11 @@ _exit: if (update_mask) { /* update_BCNTIM(padapter); */ if ((update_mask & (BIT(0) | BIT(1))) == (BIT(0) | BIT(1))) - _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "clear UC&BMC"); + _update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "clear UC&BMC"); else if ((update_mask & BIT(1)) == BIT(1)) - _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "clear BMC"); + _update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "clear BMC"); else - _update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "clear UC"); + _update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE, "clear UC"); } } @@ -5252,7 +5252,7 @@ void xmit_delivery_enabled_frames(_adapter *padapter, struct sta_info *psta) /* RTW_INFO_DUMP("update_BCNTIM, tim=", pstapriv->tim_bitmap, pstapriv->aid_bmp_len); */ /* upate BCN for TIM IE */ /* update_BCNTIM(padapter); */ - update_beacon(padapter, _TIM_IE_, NULL, _TRUE); + update_beacon(padapter, WLAN_EID_DS_PARAMS, NULL, _TRUE); /* update_mask = BIT(0); */ } diff --git a/hal/hal_com.c b/hal/hal_com.c index 0c21b57..8fda3a3 100644 --- a/hal/hal_com.c +++ b/hal/hal_com.c @@ -6174,14 +6174,14 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe pktlen += 2; /* SSID */ - pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pktlen); /* supported rates... */ rate_len = rtw_get_rateset_len(cur_network->SupportedRates); - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pktlen); /* DS parameter set */ - pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pktlen); /* if( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) */ { @@ -6190,16 +6190,16 @@ static void rtw_hal_construct_P2PBeacon(_adapter *padapter, u8 *pframe, u32 *pLe /* IBSS Parameter Set... */ /* ATIMWindow = cur->Configuration.ATIMWindow; */ ATIMWindow = 0; - pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_IBSS_PARAMS, 2, (unsigned char *)(&ATIMWindow), &pktlen); /* ERP IE */ - pframe = rtw_set_ie(pframe, _ERPINFO_IE_, 1, &erpinfo, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_ERP_INFO, 1, &erpinfo, &pktlen); } /* EXTERNDED SUPPORTED RATE */ if (rate_len > 8) - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, (rate_len - 8), (cur_network->SupportedRates + 8), &pktlen); /* todo:HT for adhoc */ @@ -6299,14 +6299,14 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p /* SSID */ - pframe = rtw_set_ie(pframe, _SSID_IE_, 7, pwdinfo->p2p_wildcard_ssid, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, 7, pwdinfo->p2p_wildcard_ssid, &pktlen); /* supported rates... */ /* Use the OFDM rate in the P2P probe response frame. ( 6(B), 9(B), 12, 18, 24, 36, 48, 54 ) */ - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, 8, pwdinfo->support_rate, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, 8, pwdinfo->support_rate, &pktlen); /* DS parameter set */ - pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&pwdinfo->listen_channel, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&pwdinfo->listen_channel, &pktlen); #ifdef CONFIG_IOCTL_CFG80211 if (pwdinfo->driver_interface == DRIVER_CFG80211) { @@ -6520,7 +6520,7 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p wpsielen += 2; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pktlen); p2pielen = build_probe_resp_p2p_ie(pwdinfo, pframe); @@ -6648,7 +6648,7 @@ static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pL *(u16 *)(wpsie + wpsielen) = cpu_to_be16(WPS_DPID_PBC); wpsielen += 2; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pktlen); /* P2P IE Section. */ @@ -6930,7 +6930,7 @@ static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pL } - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pktlen); #ifdef CONFIG_WFD wfdielen = build_nego_resp_wfd_ie(pwdinfo, pframe); @@ -7175,7 +7175,7 @@ static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 * } #endif - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2pie, &pktlen); #ifdef CONFIG_WFD wfdielen = build_invitation_resp_wfd_ie(pwdinfo, pframe); @@ -7288,7 +7288,7 @@ static void rtw_hal_construct_P2PProvisionDisRsp(_adapter *padapter, u8 *pframe, RTW_PUT_BE16(wpsie + wpsielen, WPS_CM_PUSH_BUTTON); wpsielen += 2; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pktlen); #ifdef CONFIG_WFD wfdielen = build_provdisc_resp_wfd_ie(pwdinfo, pframe); @@ -7438,21 +7438,21 @@ void rtw_hal_construct_beacon(_adapter *padapter, /* below for ad-hoc mode */ /* SSID */ - pframe = rtw_set_ie(pframe, _SSID_IE_, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, cur_network->Ssid.SsidLength, cur_network->Ssid.Ssid, &pktlen); /* supported rates... */ rate_len = rtw_get_rateset_len(cur_network->SupportedRates); - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, ((rate_len > 8) ? 8 : rate_len), cur_network->SupportedRates, &pktlen); /* DS parameter set */ - pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pktlen); if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) { u32 ATIMWindow; /* IBSS Parameter Set... */ /* ATIMWindow = cur->Configuration.ATIMWindow; */ ATIMWindow = 0; - pframe = rtw_set_ie(pframe, _IBSS_PARA_IE_, 2, (unsigned char *)(&ATIMWindow), &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_IBSS_PARAMS, 2, (unsigned char *)(&ATIMWindow), &pktlen); } @@ -7461,7 +7461,7 @@ void rtw_hal_construct_beacon(_adapter *padapter, /* EXTERNDED SUPPORTED RATE */ if (rate_len > 8) - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, (rate_len - 8), (cur_network->SupportedRates + 8), &pktlen); /* todo:HT for adhoc */ #endif @@ -8060,19 +8060,19 @@ static void rtw_hal_construct_ProbeReq(_adapter *padapter, u8 *pframe, pframe += pktlen; if (ssid == NULL) - pframe = rtw_set_ie(pframe, _SSID_IE_, 0, NULL, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, 0, NULL, &pktlen); else { /* RTW_INFO("%s len:%d\n", ssid->SSID, ssid->SSID_len); */ - pframe = rtw_set_ie(pframe, _SSID_IE_, ssid->SSID_len, ssid->SSID, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SSID, ssid->SSID_len, ssid->SSID, &pktlen); } get_rate_set(padapter, bssrate, &bssrate_len); if (bssrate_len > 8) { - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , 8, bssrate, &pktlen); - pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_ , (bssrate_len - 8), (bssrate + 8), &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES , 8, bssrate, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES , (bssrate_len - 8), (bssrate + 8), &pktlen); } else - pframe = rtw_set_ie(pframe, _SUPPORTEDRATES_IE_ , bssrate_len , bssrate, &pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES , bssrate_len , bssrate, &pktlen); *pLength = pktlen; } @@ -14585,7 +14585,7 @@ u8 * rtw_hal_set_8812a_vendor_ie(_adapter *padapter , u8 *pframe ,uint *frlen ) vendor_info[6] = RT_HT_CAP_USE_JAGUAR_CCUT; else vendor_info[6] = RT_HT_CAP_USE_JAGUAR_BCUT; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_,vender_len,vendor_info , frlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC,vender_len,vendor_info , frlen); return pframe; } diff --git a/hal/hal_mcc.c b/hal/hal_mcc.c index 55d92c5..a1cf8fd 100644 --- a/hal/hal_mcc.c +++ b/hal/hal_mcc.c @@ -132,7 +132,7 @@ static void rtw_hal_mcc_build_p2p_noa_attr(PADAPTER padapter, u8 *ie, u32 *ie_le , p2p_noa_attr_ie[p2p_noa_attr_len + 3]); p2p_noa_attr_len = p2p_noa_attr_len + 4; - rtw_set_ie(ie, _VENDOR_SPECIFIC_IE_, p2p_noa_attr_len, (u8 *)p2p_noa_attr_ie, ie_len); + rtw_set_ie(ie, WLAN_EID_VENDOR_SPECIFIC, p2p_noa_attr_len, (u8 *)p2p_noa_attr_ie, ie_len); } @@ -183,7 +183,7 @@ static void rtw_hal_mcc_update_go_p2p_ie(PADAPTER padapter) RTW_INFO("p2p_go_noa_ie_len:%d\n", pmccadapriv->p2p_go_noa_ie_len); RTW_INFO_DUMP("\n", pmccadapriv->p2p_go_noa_ie, pmccadapriv->p2p_go_noa_ie_len); } - update_beacon(padapter, _VENDOR_SPECIFIC_IE_, P2P_OUI, _TRUE); + update_beacon(padapter, WLAN_EID_VENDOR_SPECIFIC, P2P_OUI, _TRUE); } /** @@ -200,7 +200,7 @@ static void rtw_hal_mcc_remove_go_p2p_ie(PADAPTER padapter) return; pmccadapriv->p2p_go_noa_ie_len = 0; - update_beacon(padapter, _VENDOR_SPECIFIC_IE_, P2P_OUI, _TRUE); + update_beacon(padapter, WLAN_EID_VENDOR_SPECIFIC, P2P_OUI, _TRUE); } /* restore IQK value for all interface */ diff --git a/include/wifi.h b/include/wifi.h index 427408e..dcdc034 100644 --- a/include/wifi.h +++ b/include/wifi.h @@ -118,76 +118,14 @@ enum WIFI_FRAME_SUBTYPE { WIFI_QOS_DATA_NULL = (BIT(6) | WIFI_QOS_DATA_TYPE), }; -enum WIFI_REASON_CODE { - _RSON_RESERVED_ = 0, - _RSON_UNSPECIFIED_ = 1, - _RSON_AUTH_NO_LONGER_VALID_ = 2, - _RSON_DEAUTH_STA_LEAVING_ = 3, - _RSON_INACTIVITY_ = 4, - _RSON_UNABLE_HANDLE_ = 5, - _RSON_CLS2_ = 6, - _RSON_CLS3_ = 7, - _RSON_DISAOC_STA_LEAVING_ = 8, - _RSON_ASOC_NOT_AUTH_ = 9, - - /* WPA reason */ - _RSON_INVALID_IE_ = 13, - _RSON_MIC_FAILURE_ = 14, - _RSON_4WAY_HNDSHK_TIMEOUT_ = 15, - _RSON_GROUP_KEY_UPDATE_TIMEOUT_ = 16, - _RSON_DIFF_IE_ = 17, - _RSON_MLTCST_CIPHER_NOT_VALID_ = 18, - _RSON_UNICST_CIPHER_NOT_VALID_ = 19, - _RSON_AKMP_NOT_VALID_ = 20, - _RSON_UNSUPPORT_RSNE_VER_ = 21, - _RSON_INVALID_RSNE_CAP_ = 22, - _RSON_IEEE_802DOT1X_AUTH_FAIL_ = 23, - - /* belowing are Realtek definition */ - _RSON_PMK_NOT_AVAILABLE_ = 24, - _RSON_TDLS_TEAR_TOOFAR_ = 25, - _RSON_TDLS_TEAR_UN_RSN_ = 26, -}; /* Reason codes (IEEE 802.11-2007, 7.3.1.7, Table 7-22) */ - -enum WIFI_STATUS_CODE { - _STATS_SUCCESSFUL_ = 0, - _STATS_FAILURE_ = 1, - _STATS_SEC_DISABLED_ = 5, - _STATS_NOT_IN_SAME_BSS_ = 7, - _STATS_CAP_FAIL_ = 10, - _STATS_NO_ASOC_ = 11, - _STATS_OTHER_ = 12, - _STATS_NO_SUPP_ALG_ = 13, - _STATS_OUT_OF_AUTH_SEQ_ = 14, - _STATS_CHALLENGE_FAIL_ = 15, - _STATS_AUTH_TIMEOUT_ = 16, - _STATS_UNABLE_HANDLE_STA_ = 17, - _STATS_RATE_FAIL_ = 18, - _STATS_REFUSED_TEMPORARILY_ = 30, - _STATS_DECLINE_REQ_ = 37, - _STATS_INVALID_PARAMETERS_ = 38, - _STATS_INVALID_RSNIE_ = 72, +enum { + _STATS_REFUSED_TEMPORARILY_ = 30, /* Code-22-65535 reserved */ }; - /* IEEE 802.11r */ #define WLAN_STATUS_INVALID_PMKID 53 -enum WIFI_REG_DOMAIN { - DOMAIN_FCC = 1, - DOMAIN_IC = 2, - DOMAIN_ETSI = 3, - DOMAIN_SPAIN = 4, - DOMAIN_FRANCE = 5, - DOMAIN_MKK = 6, - DOMAIN_ISRAEL = 7, - DOMAIN_MKK1 = 8, - DOMAIN_MKK2 = 9, - DOMAIN_MKK3 = 10, - DOMAIN_MAX -}; - #define _TO_DS_ BIT(8) #define _FROM_DS_ BIT(9) #define _MORE_FRAG_ BIT(10) @@ -501,47 +439,6 @@ static inline int IsFrameTypeData(unsigned char *pframe) #define _FIXED_IE_LENGTH_ _BEACON_IE_OFFSET_ -#define _SSID_IE_ 0 -#define _SUPPORTEDRATES_IE_ 1 -#define _DSSET_IE_ 3 -#define _TIM_IE_ 5 -#define _IBSS_PARA_IE_ 6 -#define _COUNTRY_IE_ 7 -#define _CHLGETXT_IE_ 16 -#define _SUPPORTED_CH_IE_ 36 -#define _CH_SWTICH_ANNOUNCE_ 37 /* Secondary Channel Offset */ -#define _MEAS_REQ_IE_ 38 -#define _MEAS_RSP_IE_ 39 -#define _RSN_IE_2_ 48 -#define _SSN_IE_1_ 221 -#define _ERPINFO_IE_ 42 -#define _EXT_SUPPORTEDRATES_IE_ 50 - -#define _HT_CAPABILITY_IE_ 45 -#define _MDIE_ 54 -#define _FTIE_ 55 -#define _TIMEOUT_ITVL_IE_ 56 -#define _SRC_IE_ 59 -#define _HT_EXTRA_INFO_IE_ 61 -#define _HT_ADD_INFO_IE_ 61 /* _HT_EXTRA_INFO_IE_ */ -#define _WAPI_IE_ 68 -#define _EID_RRM_EN_CAP_IE_ 70 - - -/* #define EID_BSSCoexistence 72 */ /* 20/40 BSS Coexistence - * #define EID_BSSIntolerantChlReport 73 */ -#define _RIC_Descriptor_IE_ 75 -#ifdef CONFIG_IEEE80211W -#define _MME_IE_ 76 /* 802.11w Management MIC element */ -#endif /* CONFIG_IEEE80211W */ -#define _LINK_ID_IE_ 101 -#define _CH_SWITCH_TIMING_ 104 -#define _PTI_BUFFER_STATUS_ 106 -#define _EXT_CAP_IE_ 127 -#define _VENDOR_SPECIFIC_IE_ 221 - -#define _RESERVED47_ 47 - typedef enum _ELEMENT_ID { EID_SsId = 0, /* service set identifier (0:32) */ EID_SupRates = 1, /* supported rates (1:8) */ diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 51daeb0..c054262 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -2657,7 +2657,7 @@ static void _rtw_cfg80211_surveydone_event_callback(_adapter *padapter, struct c if (_rtw_memcmp(pnetwork->network.Ssid.Ssid, "Ralink_11n_AP", 13)) { uint ie_len = 0; u8 *p = NULL; - p = rtw_get_ie(pnetwork->network.IEs + _BEACON_IE_OFFSET_, _RSN_IE_2_, &ie_len, (pnetwork->network.IELength - _BEACON_IE_OFFSET_)); + p = rtw_get_ie(pnetwork->network.IEs + _BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len, (pnetwork->network.IELength - _BEACON_IE_OFFSET_)); RTW_INFO("ie_len=%d\n", ie_len); } } @@ -4944,8 +4944,8 @@ static int rtw_add_beacon(_adapter *adapter, const u8 *head, size_t head_len, co #endif /* CONFIG_P2P */ /* pbss_network->IEs will not include p2p_ie, wfd ie */ - rtw_ies_remove_ie(pbuf, &len, _BEACON_IE_OFFSET_, _VENDOR_SPECIFIC_IE_, P2P_OUI, 4); - rtw_ies_remove_ie(pbuf, &len, _BEACON_IE_OFFSET_, _VENDOR_SPECIFIC_IE_, WFD_OUI, 4); + rtw_ies_remove_ie(pbuf, &len, _BEACON_IE_OFFSET_, WLAN_EID_VENDOR_SPECIFIC, P2P_OUI, 4); + rtw_ies_remove_ie(pbuf, &len, _BEACON_IE_OFFSET_, WLAN_EID_VENDOR_SPECIFIC, WFD_OUI, 4); if (rtw_check_beacon_data(adapter, pbuf, len) == _SUCCESS) { #ifdef CONFIG_P2P @@ -6438,7 +6438,7 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, p2pielen += devinfo_contentlen; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2p_ie, &p2p_ielen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, p2pielen, (unsigned char *) p2p_ie, &p2p_ielen); /* p2pielen = build_prov_disc_request_p2p_ie( pwdinfo, pframe, NULL, 0, pwdinfo->tx_prov_disc_info.peerDevAddr); */ /* pframe += p2pielen; */ pattrib->pktlen += p2p_ielen; @@ -6473,7 +6473,7 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, *(u16 *)(wpsie + wpsielen) = cpu_to_be16(pwdinfo->tx_prov_disc_info.wps_config_method_request); wpsielen += 2; - pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); + pframe = rtw_set_ie(pframe, WLAN_EID_VENDOR_SPECIFIC, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen); #ifdef CONFIG_WFD @@ -8188,7 +8188,7 @@ u8 *rtw_cfg80211_construct_mesh_beacon_ies(struct wiphy *wiphy, _adapter *adapte *c = WLAN_EID_TIM; *(c + 1) = 4; c += 6; - //c = rtw_set_ie(c, _TIM_IE_, 4, NULL, NULL); + //c = rtw_set_ie(c, WLAN_EID_DS_PARAMS, 4, NULL, NULL); /* Extended Supported Rates */ if (n_bitrates > 8) @@ -8889,7 +8889,7 @@ static int rtw_cfg80211_set_beacon_wpsp2pie(struct net_device *ndev, char *buf, memcpy(pmlmepriv->wps_beacon_ie, wps_ie, wps_ielen); pmlmepriv->wps_beacon_ie_len = wps_ielen; - update_beacon(padapter, _VENDOR_SPECIFIC_IE_, wps_oui, _TRUE); + update_beacon(padapter, WLAN_EID_VENDOR_SPECIFIC, wps_oui, _TRUE); } diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index a6f496f..ae07a71 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -358,7 +358,7 @@ static inline char *iwe_stream_protocol_process(_adapter *padapter, #ifdef CONFIG_80211N_HT /* parsing HT_CAP_IE */ if(padapter->registrypriv.ht_enable && is_supported_ht(padapter->registrypriv.wireless_mode)) { - p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.IELength - ie_offset); + p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], WLAN_EID_HT_CAPABILITY, &ht_ielen, pnetwork->network.IELength - ie_offset); if (p && ht_ielen > 0) ht_cap = _TRUE; } @@ -423,7 +423,7 @@ static inline char *iwe_stream_rate_process(_adapter *padapter, /* parsing HT_CAP_IE */ if(is_supported_ht(padapter->registrypriv.wireless_mode)) { - p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.IELength - ie_offset); + p = rtw_get_ie(&pnetwork->network.IEs[ie_offset], WLAN_EID_HT_CAPABILITY, &ht_ielen, pnetwork->network.IELength - ie_offset); if (p && ht_ielen > 0) { struct rtw_ieee80211_ht_cap *pht_capie; ht_cap = _TRUE; @@ -1093,7 +1093,7 @@ static int rtw_set_wpa_ie(_adapter *padapter, char *pie, unsigned short ielen) while (cnt < ielen) { eid = buf[cnt]; - if ((eid == _VENDOR_SPECIFIC_IE_) && (_rtw_memcmp(&buf[cnt + 2], wps_oui, 4) == _TRUE)) { + if ((eid == WLAN_EID_VENDOR_SPECIFIC) && (_rtw_memcmp(&buf[cnt + 2], wps_oui, 4) == _TRUE)) { RTW_INFO("SET WPS_IE\n"); padapter->securitypriv.wps_ie_len = ((buf[cnt + 1] + 2) < MAX_WPS_IE_LEN) ? (buf[cnt + 1] + 2) : MAX_WPS_IE_LEN; @@ -1150,7 +1150,7 @@ static int rtw_wx_get_name(struct net_device *dev, if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE) == _TRUE) { /* parsing HT_CAP_IE */ if( is_supported_ht(padapter->registrypriv.wireless_mode)&&(padapter->registrypriv.ht_enable)) { - p = rtw_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->IELength - 12); + p = rtw_get_ie(&pcur_bss->IEs[12], WLAN_EID_HT_CAPABILITY, &ht_ielen, pcur_bss->IELength - 12); if (p && ht_ielen > 0 ) ht_cap = _TRUE; } @@ -7450,7 +7450,7 @@ static int rtw_set_wps_beacon(struct net_device *dev, struct ieee_param *param, memcpy(pmlmepriv->wps_beacon_ie, param->u.bcn_ie.buf, ie_len); - update_beacon(padapter, _VENDOR_SPECIFIC_IE_, wps_oui, _TRUE); + update_beacon(padapter, WLAN_EID_VENDOR_SPECIFIC, wps_oui, _TRUE); pmlmeext->bstart_bss = _TRUE; @@ -7833,7 +7833,7 @@ static int rtw_wx_set_priv(struct net_device *dev, int probereq_wpsie_len = len; u8 wps_oui[4] = {0x0, 0x50, 0xf2, 0x04}; - if ((_VENDOR_SPECIFIC_IE_ == probereq_wpsie[0]) && + if ((WLAN_EID_VENDOR_SPECIFIC == probereq_wpsie[0]) && (_rtw_memcmp(&probereq_wpsie[2], wps_oui, 4) == _TRUE)) { cp_sz = probereq_wpsie_len > MAX_WPS_IE_LEN ? MAX_WPS_IE_LEN : probereq_wpsie_len;