diff --git a/Makefile b/Makefile index 4cff9ee..b60681e 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,6 @@ CONFIG_HW_PWRP_DETECTION = n CONFIG_WIFI_TEST = n CONFIG_BT_COEXIST = n CONFIG_INTEL_WIDI = n -CONFIG_WAPI_SUPPORT = n CONFIG_EFUSE_CONFIG_FILE = n CONFIG_EXT_CLK = n CONFIG_FTP_PROTECT = n @@ -133,10 +132,6 @@ ifeq ($(CONFIG_INTEL_WIDI), y) EXTRA_CFLAGS += -DCONFIG_INTEL_WIDI endif -ifeq ($(CONFIG_WAPI_SUPPORT), y) -EXTRA_CFLAGS += -DCONFIG_WAPI_SUPPORT -endif - ifeq ($(CONFIG_EFUSE_CONFIG_FILE), y) EXTRA_CFLAGS += -DCONFIG_EFUSE_CONFIG_FILE endif @@ -198,8 +193,6 @@ rtk_core := \ 8188eu-$(CONFIG_INTEL_WIDI) += core/rtw_intel_widi.o -8188eu-$(CONFIG_WAPI_SUPPORT) += core/rtw_wapi.o \ - core/rtw_wapi_sms4.o 8188eu-y += $(_HAL_INTFS_FILES) 8188eu-y += $(_OS_INTFS_FILES) diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index d234bb3..7da7cdb 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -755,50 +755,6 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi } -#ifdef CONFIG_WAPI_SUPPORT -int rtw_get_wapi_ie(u8 *in_ie,uint in_len,u8 *wapi_ie,u16 *wapi_len) -{ - u8 authmode, i; - uint cnt; - u8 wapi_oui1[4]={0x0,0x14,0x72,0x01}; - u8 wapi_oui2[4]={0x0,0x14,0x72,0x02}; - -_func_enter_; - cnt = (_TIMESTAMP_ + _BEACON_ITERVAL_ + _CAPABILITY_); - while (cntndisauthtype>3) psecuritypriv->dot11AuthAlgrthm=dot11AuthAlgrthm_8021X; -#ifdef CONFIG_WAPI_SUPPORT - if (psecuritypriv->ndisauthtype == 6) - psecuritypriv->dot11AuthAlgrthm=dot11AuthAlgrthm_WAPI; -#endif - res=rtw_set_auth(padapter,psecuritypriv); if (res==_SUCCESS) diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 80e571f..8bc7507 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -1327,20 +1327,6 @@ _func_enter_; _clr_fwstate_(pmlmepriv, _FW_LINKED); #endif - -#ifdef CONFIG_WAPI_SUPPORT - psta = rtw_get_stainfo(pstapriv,cur_network->MacAddress); - if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) - { - rtw_wapi_return_one_sta_info(padapter, psta->hwaddr); - } - else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) || - check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) - { - rtw_wapi_return_all_sta_info(padapter); - } -#endif - if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) #ifdef CONFIG_LAYER2_ROAMING || (pmlmepriv->to_roaming<=0) @@ -3187,10 +3173,6 @@ void _rtw_roaming(_adapter *padapter, struct wlan_network *tgt_network) pmlmepriv->assoc_by_bssid = false; -#ifdef CONFIG_WAPI_SUPPORT - rtw_wapi_return_all_sta_info(padapter); -#endif - while (1) { if ( _SUCCESS==(do_join_r=rtw_do_join(padapter)) ) { break; diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 93edd05..16521b4 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -1962,11 +1962,6 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) } #endif break; -#ifdef CONFIG_WAPI_SUPPORT - case _WAPI_IE_: - pWapiIE = pIE; - break; -#endif case _HT_CAPABILITY_IE_: /* HT caps */ HT_caps_handler(padapter, pIE); break; @@ -1982,10 +1977,6 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) i += (pIE->Length + 2); } -#ifdef CONFIG_WAPI_SUPPORT - rtw_wapi_on_assoc_ok(padapter, pIE); -#endif - pmlmeinfo->state &= (~WIFI_FW_ASSOC_STATE); pmlmeinfo->state |= WIFI_FW_ASSOC_SUCCESS; @@ -6820,10 +6811,6 @@ void issue_assocreq(_adapter *padapter) if (pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_REALTEK) pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, 6 , REALTEK_96B_IE, &(pattrib->pktlen)); -#ifdef CONFIG_WAPI_SUPPORT - rtw_build_assoc_req_wapi_ie(padapter, pframe, pattrib); -#endif - #ifdef CONFIG_P2P #ifdef CONFIG_IOCTL_CFG80211 @@ -8422,13 +8409,6 @@ void start_clnt_join(_adapter* padapter) val8 = (pmlmeinfo->auth_algo == dot11AuthAlgrthm_8021X)? 0xcc: 0xcf; -#ifdef CONFIG_WAPI_SUPPORT - if (padapter->wapiInfo.bWapiEnable && pmlmeinfo->auth_algo == dot11AuthAlgrthm_WAPI) - { - /* Disable TxUseDefaultKey, RxUseDefaultKey, RxBroadcastUseDefaultKey. */ - val8 = 0x4c; - } -#endif rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8)); /* switch channel */ @@ -9852,10 +9832,6 @@ u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) rtw_antenna_select_cmd(padapter, pparm->network.PhyInfo.Optimum_antenna, false); #endif -#ifdef CONFIG_WAPI_SUPPORT - rtw_wapi_clear_all_cam_entry(padapter); -#endif - rtw_joinbss_reset(padapter); pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_20; diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 9cc51ee..0a0e5ed 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -605,13 +605,8 @@ _func_enter_; case _AES_: res = rtw_aes_decrypt(padapter, (u8 * )precv_frame); break; -#ifdef CONFIG_WAPI_SUPPORT - case _SMS4_: - rtw_sms4_decrypt(padapter, (u8 * )precv_frame); - break; -#endif default: - break; + break; } } else if (prxattrib->bdecrypted==1 @@ -1688,14 +1683,6 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame) struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv; #endif -#ifdef CONFIG_WAPI_SUPPORT - PRT_WAPI_T pWapiInfo = &adapter->wapiInfo; - struct recv_frame_hdr *phdr = &precv_frame->u.hdr; - u8 wai_pkt = 0; - u16 sc; - u8 external_len = 0; -#endif - _func_enter_; @@ -1727,9 +1714,6 @@ _func_enter_; pattrib->mdata = GetMData(ptr); pattrib->privacy = GetPrivacy(ptr); pattrib->order = GetOrder(ptr); -#ifdef CONFIG_WAPI_SUPPORT - sc = (pattrib->seq_num<<4) | pattrib->frag_num; -#endif #if 1 /* Dump rx packets */ { @@ -1787,45 +1771,11 @@ _func_enter_; retval = _FAIL; /* only data frame return _SUCCESS */ break; case WIFI_DATA_TYPE: /* data */ -#ifdef CONFIG_WAPI_SUPPORT - if (pattrib->qos) - external_len = 2; - else - external_len= 0; - - wai_pkt = rtw_wapi_is_wai_packet(adapter,ptr); - - phdr->bIsWaiPacket = wai_pkt; - - if (wai_pkt !=0){ - if (sc != adapter->wapiInfo.wapiSeqnumAndFragNum) - { - adapter->wapiInfo.wapiSeqnumAndFragNum = sc; - } - else - { - retval = _FAIL; - break; - } - } - else{ - - if (rtw_wapi_drop_for_key_absent(adapter,GetAddr2Ptr(ptr))){ - retval=_FAIL; - WAPI_TRACE(WAPI_RX,"drop for key absent for rx\n"); - break; - } - } - -#endif - rtw_led_control(adapter, LED_CTL_RX); pattrib->qos = (subtype & BIT(7))? 1:0; retval = validate_recv_data_frame(adapter, precv_frame); - if (retval == _FAIL) - { + if (retval == _FAIL) { struct recv_priv *precvpriv = &adapter->recvpriv; - /* RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_data_frame fail\n")); */ precvpriv->rx_drop++; } break; @@ -2931,10 +2881,6 @@ static int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe) count_rx_stats(padapter, prframe, NULL); -#ifdef CONFIG_WAPI_SUPPORT - rtw_wapi_update_info(padapter, prframe); -#endif - #ifdef CONFIG_80211N_HT ret = process_recv_indicatepkts(padapter, prframe); if (ret != _SUCCESS) diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index fda1009..72ca530 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -634,14 +634,8 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr #ifdef CONFIG_LPS /* If EAPOL , ARP , OR DHCP packet, driver must be in active mode. */ -#ifdef CONFIG_WAPI_SUPPORT - if ( (pattrib->ether_type == 0x88B4) || (pattrib->ether_type == 0x0806) || (pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1) ) -#else if ( (pattrib->ether_type == 0x0806) || (pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1) ) -#endif - { rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SPECIAL_PACKET, 1); - } #endif bmcast = IS_MCAST(pattrib->ra); @@ -729,11 +723,6 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr { GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt, bmcast); -#ifdef CONFIG_WAPI_SUPPORT - if (pattrib->ether_type == 0x88B4) - pattrib->encrypt=_NO_PRIVACY_; -#endif - switch (psecuritypriv->dot11AuthAlgrthm) { case dot11AuthAlgrthm_Open: @@ -783,14 +772,6 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr pattrib->iv_len = 8; pattrib->icv_len = 8; break; - -#ifdef CONFIG_WAPI_SUPPORT - case _SMS4_: - pattrib->iv_len = 18; - pattrib->icv_len = 16; - break; -#endif - default: pattrib->iv_len = 0; pattrib->icv_len = 0; @@ -813,11 +794,6 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("update_attrib: bswenc=false\n")); } -#ifdef CONFIG_WAPI_SUPPORT - if (pattrib->encrypt == _SMS4_) - pattrib->bswenc = false; -#endif - rtw_set_tx_chksum_offload(pkt, pattrib); update_attrib_phy_info(pattrib, psta); @@ -988,12 +964,8 @@ _func_enter_; case _AES_: rtw_aes_encrypt(padapter, (u8 * )pxmitframe); break; -#ifdef CONFIG_WAPI_SUPPORT - case _SMS4_: - rtw_sms4_encrypt(padapter, (u8 * )pxmitframe); -#endif default: - break; + break; } } else { @@ -1331,11 +1303,6 @@ _func_enter_; else AES_IV(pattrib->iv, psta->dot11txpn, 0); break; -#ifdef CONFIG_WAPI_SUPPORT - case _SMS4_: - rtw_wapi_get_iv(padapter,pattrib->ra,pattrib->iv); - break; -#endif } } @@ -2456,16 +2423,6 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt) res = update_attrib(padapter, *ppkt, &pxmitframe->attrib); -#ifdef CONFIG_WAPI_SUPPORT - if (pxmitframe->attrib.ether_type != 0x88B4) - { - if (rtw_wapi_drop_for_key_absent(padapter, pxmitframe->attrib.ra)) - { - WAPI_TRACE(WAPI_RX,"drop for key absend when tx\n"); - res = _FAIL; - } - } -#endif if (res == _FAIL) { RT_TRACE(_module_xmit_osdep_c_, _drv_err_, ("rtw_xmit: update attrib fail\n")); #ifdef DBG_TX_DROP_FRAME diff --git a/hal/rtl8188eu_xmit.c b/hal/rtl8188eu_xmit.c index def6066..7208763 100644 --- a/hal/rtl8188eu_xmit.c +++ b/hal/rtl8188eu_xmit.c @@ -137,12 +137,6 @@ static void fill_txdesc_sectype(struct pkt_attrib *pattrib, struct tx_desc *ptxd ptxdesc->txdw1 |= cpu_to_le32((0x01<txdw2 |= cpu_to_le32(0x7 << AMPDU_DENSITY_SHT); break; -#ifdef CONFIG_WAPI_SUPPORT - case _SMS4_: - ptxdesc->txdw1 |= cpu_to_le32((0x02<txdw2 |= cpu_to_le32(0x7 << AMPDU_DENSITY_SHT); - break; -#endif case _AES_: ptxdesc->txdw1 |= cpu_to_le32((0x03<txdw2 |= cpu_to_le32(0x7 << AMPDU_DENSITY_SHT); diff --git a/include/drv_types.h b/include/drv_types.h index 947b5ed..6dc0dbe 100644 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -69,10 +69,6 @@ typedef struct _ADAPTER _adapter, ADAPTER,*PADAPTER; #include #include -#ifdef CONFIG_WAPI_SUPPORT -#include -#endif - #ifdef CONFIG_DRVEXT_MODULE #include #endif @@ -373,12 +369,6 @@ struct _ADAPTER{ struct wifidirect_info wdinfo; #endif //CONFIG_P2P -#ifdef CONFIG_WAPI_SUPPORT - u8 WapiSupport; - RT_WAPI_T wapiInfo; -#endif - - #ifdef CONFIG_WFD struct wifi_display_info wfd_info; #endif //CONFIG_WFD diff --git a/include/rtw_recv.h b/include/rtw_recv.h index ecf324f..7ba1a8b 100644 --- a/include/rtw_recv.h +++ b/include/rtw_recv.h @@ -379,18 +379,8 @@ struct recv_frame_hdr //for A-MPDU Rx reordering buffer control struct recv_reorder_ctrl *preorder_ctrl; - -#ifdef CONFIG_WAPI_SUPPORT - u8 UserPriority; - u8 WapiTempPN[16]; - u8 WapiSrcAddr[6]; - u8 bWapiCheckPNInDecrypt; - u8 bIsWaiPacket; -#endif - }; - union recv_frame{ union{ diff --git a/include/rtw_wapi.h b/include/rtw_wapi.h deleted file mode 100644 index ef993dc..0000000 --- a/include/rtw_wapi.h +++ /dev/null @@ -1,229 +0,0 @@ -#ifndef __INC_WAPI_H -#define __INC_WAPI_H - -#include -#include -#include -#include -#include -#include -//#include "rtl819x_Qos.h" - -#define CONFIG_WAPI_SW_SMS4 -#define WAPI_DEBUG - -#define SMS4_MIC_LEN 16 -#define WAPI_EXT_LEN 18 -#define MAX_WAPI_IE_LEN 256 -#define sMacHdrLng 24 // octets in data header, no WEP - -#ifdef WAPI_DEBUG - -/* WAPI trace debug */ -extern u32 wapi_debug_component; - -static inline void dump_buf(u8 *buf, u32 len) -{ - u32 i; - printk("-----------------Len %d----------------\n", len); - for (i=0; iu.crypt.alg, "SMS4")) -#endif - { ret = -EINVAL; goto exit; } - } if (strcmp(param->u.crypt.alg, "WEP") == 0) { @@ -1179,78 +1174,8 @@ _func_enter_; } } } - else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) //adhoc mode - { - } } -#ifdef CONFIG_WAPI_SUPPORT - if (strcmp(param->u.crypt.alg, "SMS4") == 0) - { - PRT_WAPI_T pWapiInfo = &padapter->wapiInfo; - PRT_WAPI_STA_INFO pWapiSta; - u8 WapiASUEPNInitialValueSrc[16] = {0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C} ; - u8 WapiAEPNInitialValueSrc[16] = {0x37,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C} ; - u8 WapiAEMultiCastPNInitialValueSrc[16] = {0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C} ; - - if (param->u.crypt.set_tx == 1) - { - list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) { - if (_rtw_memcmp(pWapiSta->PeerMacAddr,param->sta_addr,6)) - { - _rtw_memcpy(pWapiSta->lastTxUnicastPN,WapiASUEPNInitialValueSrc,16); - - pWapiSta->wapiUsk.bSet = true; - _rtw_memcpy(pWapiSta->wapiUsk.dataKey,param->u.crypt.key,16); - _rtw_memcpy(pWapiSta->wapiUsk.micKey,param->u.crypt.key+16,16); - pWapiSta->wapiUsk.keyId = param->u.crypt.idx ; - pWapiSta->wapiUsk.bTxEnable = true; - - _rtw_memcpy(pWapiSta->lastRxUnicastPNBEQueue,WapiAEPNInitialValueSrc,16); - _rtw_memcpy(pWapiSta->lastRxUnicastPNBKQueue,WapiAEPNInitialValueSrc,16); - _rtw_memcpy(pWapiSta->lastRxUnicastPNVIQueue,WapiAEPNInitialValueSrc,16); - _rtw_memcpy(pWapiSta->lastRxUnicastPNVOQueue,WapiAEPNInitialValueSrc,16); - _rtw_memcpy(pWapiSta->lastRxUnicastPN,WapiAEPNInitialValueSrc,16); - pWapiSta->wapiUskUpdate.bTxEnable = false; - pWapiSta->wapiUskUpdate.bSet = false; - - if (psecuritypriv->sw_encrypt== false || psecuritypriv->sw_decrypt == false) - { - //set unicast key for ASUE - rtw_wapi_set_key(padapter, &pWapiSta->wapiUsk, pWapiSta, false, false); - } - } - } - } - else - { - list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) { - if (_rtw_memcmp(pWapiSta->PeerMacAddr,get_bssid(pmlmepriv),6)) - { - pWapiSta->wapiMsk.bSet = true; - _rtw_memcpy(pWapiSta->wapiMsk.dataKey,param->u.crypt.key,16); - _rtw_memcpy(pWapiSta->wapiMsk.micKey,param->u.crypt.key+16,16); - pWapiSta->wapiMsk.keyId = param->u.crypt.idx ; - pWapiSta->wapiMsk.bTxEnable = false; - if (!pWapiSta->bSetkeyOk) - pWapiSta->bSetkeyOk = true; - pWapiSta->bAuthenticateInProgress = false; - - _rtw_memcpy(pWapiSta->lastRxMulticastPN, WapiAEMultiCastPNInitialValueSrc, 16); - - if (psecuritypriv->sw_decrypt == false) - { - //set rx broadcast key for ASUE - rtw_wapi_set_key(padapter, &pWapiSta->wapiMsk, pWapiSta, true, false); - } - } - - } - } - } -#endif - - exit: DBG_88E("%s, ret=%d\n", __func__, ret); @@ -1311,23 +1236,6 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, case WLAN_CIPHER_SUITE_CCMP: alg_name = "CCMP"; break; - -#ifdef CONFIG_WAPI_SUPPORT - case WLAN_CIPHER_SUITE_SMS4: - alg_name= "SMS4"; - if (pairwise == NL80211_KEYTYPE_PAIRWISE) { - if (key_index != 0 && key_index != 1) { - ret = -ENOTSUPP; - goto addkey_end; - } - _rtw_memcpy((void*)param->sta_addr, (void*)mac_addr, ETH_ALEN); - } else { - DBG_88E("mac_addr is null\n"); - } - DBG_88E("rtw_wx_set_enc_ext: SMS4 case\n"); - break; -#endif - default: ret = -ENOTSUPP; goto addkey_end; @@ -2043,28 +1951,15 @@ static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv, if (psecuritypriv->ndisauthtype>Ndis802_11AuthModeWPA) psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; - -#ifdef CONFIG_WAPI_SUPPORT - if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWAPI) - psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_WAPI; -#endif - break; case NL80211_AUTHTYPE_SHARED_KEY: - psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Shared; - psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled; - - break; default: psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; - //return -ENOTSUPP; } - return 0; - } static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 cipher, bool ucast) @@ -2087,12 +1982,6 @@ static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 ciph case IW_AUTH_CIPHER_NONE: *profile_cipher = _NO_PRIVACY_; ndisencryptstatus = Ndis802_11EncryptionDisabled; -#ifdef CONFIG_WAPI_SUPPORT - if (psecuritypriv->dot11PrivacyAlgrthm ==_SMS4_ ) - { - *profile_cipher = _SMS4_; - } -#endif break; case WLAN_CIPHER_SUITE_WEP40: *profile_cipher = _WEP40_; @@ -2110,12 +1999,6 @@ static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 ciph *profile_cipher = _AES_; ndisencryptstatus = Ndis802_11Encryption3Enabled; break; -#ifdef CONFIG_WAPI_SUPPORT - case WLAN_CIPHER_SUITE_SMS4: - *profile_cipher = _SMS4_; - ndisencryptstatus = Ndis802_11_EncrypteionWAPI; - break; -#endif default: DBG_88E("Unsupported cipher: 0x%x\n", cipher); return -ENOTSUPP; @@ -2141,22 +2024,9 @@ static int rtw_cfg80211_set_key_mgt(struct security_priv *psecuritypriv, u32 key psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; else if (key_mgt == WLAN_AKM_SUITE_PSK) { psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; - } -#ifdef CONFIG_WAPI_SUPPORT - else if (key_mgt ==WLAN_AKM_SUITE_WAPI_PSK){ - psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_WAPI; - } - else if (key_mgt ==WLAN_AKM_SUITE_WAPI_CERT){ - psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_WAPI; - } -#endif - - - else { + } else { DBG_88E("Invalid key mgt: 0x%x\n", key_mgt); - //return -EINVAL; } - return 0; } @@ -2524,31 +2394,11 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; //open system psecuritypriv->ndisauthtype = Ndis802_11AuthModeOpen; -#ifdef CONFIG_WAPI_SUPPORT - padapter->wapiInfo.bWapiEnable = false; -#endif - ret = rtw_cfg80211_set_wpa_version(psecuritypriv, sme->crypto.wpa_versions); if (ret < 0) goto exit; - -#ifdef CONFIG_WAPI_SUPPORT - if (sme->crypto.wpa_versions & NL80211_WAPI_VERSION_1) - { - padapter->wapiInfo.bWapiEnable = true; - padapter->wapiInfo.extra_prefix_len = WAPI_EXT_LEN; - padapter->wapiInfo.extra_postfix_len = SMS4_MIC_LEN; - } -#endif - ret = rtw_cfg80211_set_auth_type(psecuritypriv, sme->auth_type); -#ifdef CONFIG_WAPI_SUPPORT - if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_WAPI) - padapter->mlmeextpriv.mlmext_info.auth_algo = psecuritypriv->dot11AuthAlgrthm; -#endif - - if (ret < 0) goto exit; @@ -2636,15 +2486,6 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, goto exit; } -#ifdef CONFIG_WAPI_SUPPORT - if (sme->crypto.akm_suites[0] ==WLAN_AKM_SUITE_WAPI_PSK){ - padapter->wapiInfo.bWapiPSK = true; - } - else if (sme->crypto.akm_suites[0] ==WLAN_AKM_SUITE_WAPI_CERT){ - padapter->wapiInfo.bWapiPSK = false; - } -#endif - authmode = psecuritypriv->ndisauthtype; rtw_set_802_11_authentication_mode(padapter, authmode); diff --git a/os_dep/ioctl_linux.c b/os_dep/ioctl_linux.c index b258306..dc9b125 100644 --- a/os_dep/ioctl_linux.c +++ b/os_dep/ioctl_linux.c @@ -589,48 +589,6 @@ static char *translate_scan(_adapter *padapter, } } -#ifdef CONFIG_WAPI_SUPPORT - { - sint out_len_wapi=0; - /* here use static for stack size */ - static u8 buf_wapi[MAX_WAPI_IE_LEN]; - static u8 wapi_ie[MAX_WAPI_IE_LEN]; - u16 wapi_len=0; - u16 i; - - _rtw_memset(buf_wapi, 0, MAX_WAPI_IE_LEN); - _rtw_memset(wapi_ie, 0, MAX_WAPI_IE_LEN); - - out_len_wapi=rtw_get_wapi_ie(pnetwork->network.IEs ,pnetwork->network.IELength,wapi_ie,&wapi_len); - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_wx_get_scan: ssid=%s\n",pnetwork->network.Ssid.Ssid)); - RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_wx_get_scan: wapi_len=%d\n",wapi_len)); - - DBG_88E("rtw_wx_get_scan: %s ",pnetwork->network.Ssid.Ssid); - DBG_88E("rtw_wx_get_scan: ssid = %d ",wapi_len); - - - if (wapi_len > 0) - { - p=buf_wapi; - _rtw_memset(buf_wapi, 0, MAX_WAPI_IE_LEN); - p += sprintf(p, "wapi_ie="); - for (i = 0; i < wapi_len; i++) { - p += sprintf(p, "%02x", wapi_ie[i]); - } - - _rtw_memset(&iwe, 0, sizeof(iwe)); - iwe.cmd = IWEVCUSTOM; - iwe.u.data.length = strlen(buf_wapi); - start = iwe_stream_add_point(info, start, stop, &iwe,buf_wapi); - - _rtw_memset(&iwe, 0, sizeof(iwe)); - iwe.cmd =IWEVGENIE; - iwe.u.data.length = wapi_len; - start = iwe_stream_add_point(info, start, stop, &iwe, wapi_ie); - } - } -#endif - { struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); u8 ss, sq; @@ -750,15 +708,9 @@ _func_enter_; goto exit; } } else { -#ifdef CONFIG_WAPI_SUPPORT - if (strcmp(param->u.crypt.alg, "SMS4")) -#endif - { - ret = -EINVAL; goto exit; } - } if (strcmp(param->u.crypt.alg, "WEP") == 0) { @@ -922,77 +874,8 @@ _func_enter_; } } } - else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) //adhoc mode - { - } } -#ifdef CONFIG_WAPI_SUPPORT - if (strcmp(param->u.crypt.alg, "SMS4") == 0) - { - PRT_WAPI_T pWapiInfo = &padapter->wapiInfo; - PRT_WAPI_STA_INFO pWapiSta; - u8 WapiASUEPNInitialValueSrc[16] = {0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C} ; - u8 WapiAEPNInitialValueSrc[16] = {0x37,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C} ; - u8 WapiAEMultiCastPNInitialValueSrc[16] = {0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C,0x36,0x5C} ; - - if (param->u.crypt.set_tx == 1) - { - list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) { - if (!memcmp(pWapiSta->PeerMacAddr,param->sta_addr,6)) - { - _rtw_memcpy(pWapiSta->lastTxUnicastPN,WapiASUEPNInitialValueSrc,16); - - pWapiSta->wapiUsk.bSet = true; - _rtw_memcpy(pWapiSta->wapiUsk.dataKey,param->u.crypt.key,16); - _rtw_memcpy(pWapiSta->wapiUsk.micKey,param->u.crypt.key+16,16); - pWapiSta->wapiUsk.keyId = param->u.crypt.idx ; - pWapiSta->wapiUsk.bTxEnable = true; - - _rtw_memcpy(pWapiSta->lastRxUnicastPNBEQueue,WapiAEPNInitialValueSrc,16); - _rtw_memcpy(pWapiSta->lastRxUnicastPNBKQueue,WapiAEPNInitialValueSrc,16); - _rtw_memcpy(pWapiSta->lastRxUnicastPNVIQueue,WapiAEPNInitialValueSrc,16); - _rtw_memcpy(pWapiSta->lastRxUnicastPNVOQueue,WapiAEPNInitialValueSrc,16); - _rtw_memcpy(pWapiSta->lastRxUnicastPN,WapiAEPNInitialValueSrc,16); - pWapiSta->wapiUskUpdate.bTxEnable = false; - pWapiSta->wapiUskUpdate.bSet = false; - - if (psecuritypriv->sw_encrypt== false || psecuritypriv->sw_decrypt == false) - { - //set unicast key for ASUE - rtw_wapi_set_key(padapter, &pWapiSta->wapiUsk, pWapiSta, false, false); - } - } - } - } - else - { - list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) { - if (!memcmp(pWapiSta->PeerMacAddr,get_bssid(pmlmepriv),6)) - { - pWapiSta->wapiMsk.bSet = true; - _rtw_memcpy(pWapiSta->wapiMsk.dataKey,param->u.crypt.key,16); - _rtw_memcpy(pWapiSta->wapiMsk.micKey,param->u.crypt.key+16,16); - pWapiSta->wapiMsk.keyId = param->u.crypt.idx ; - pWapiSta->wapiMsk.bTxEnable = false; - if (!pWapiSta->bSetkeyOk) - pWapiSta->bSetkeyOk = true; - pWapiSta->bAuthenticateInProgress = false; - - _rtw_memcpy(pWapiSta->lastRxMulticastPN, WapiAEMultiCastPNInitialValueSrc, 16); - - if (psecuritypriv->sw_decrypt == false) - { - //set rx broadcast key for ASUE - rtw_wapi_set_key(padapter, &pWapiSta->wapiMsk, pWapiSta, true, false); - } - } - - } - } - } -#endif - exit: if (pwep) { @@ -2770,21 +2653,6 @@ static int rtw_wx_set_auth(struct net_device *dev, switch (param->flags & IW_AUTH_INDEX) { case IW_AUTH_WPA_VERSION: -#ifdef CONFIG_WAPI_SUPPORT -#ifndef CONFIG_IOCTL_CFG80211 - padapter->wapiInfo.bWapiEnable = false; - if (value == IW_AUTH_WAPI_VERSION_1) - { - padapter->wapiInfo.bWapiEnable = true; - psecuritypriv->dot11PrivacyAlgrthm = _SMS4_; - psecuritypriv->dot118021XGrpPrivacy = _SMS4_; - psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_WAPI; - pmlmeinfo->auth_algo = psecuritypriv->dot11AuthAlgrthm; - padapter->wapiInfo.extra_prefix_len = WAPI_EXT_LEN; - padapter->wapiInfo.extra_postfix_len = SMS4_MIC_LEN; - } -#endif -#endif break; case IW_AUTH_CIPHER_PAIRWISE: @@ -2793,21 +2661,10 @@ static int rtw_wx_set_auth(struct net_device *dev, break; case IW_AUTH_KEY_MGMT: -#ifdef CONFIG_WAPI_SUPPORT -#ifndef CONFIG_IOCTL_CFG80211 - DBG_88E("rtw_wx_set_auth: IW_AUTH_KEY_MGMT case\n"); - if (value == IW_AUTH_KEY_MGMT_WAPI_PSK) - padapter->wapiInfo.bWapiPSK = true; - else - padapter->wapiInfo.bWapiPSK = false; - DBG_88E("rtw_wx_set_auth: IW_AUTH_KEY_MGMT bwapipsk %d\n",padapter->wapiInfo.bWapiPSK); -#endif -#endif /* * ??? does not use these parameters */ break; - case IW_AUTH_TKIP_COUNTERMEASURES: { if (param->value) @@ -2852,7 +2709,6 @@ static int rtw_wx_set_auth(struct net_device *dev, } case IW_AUTH_80211_AUTH_ALG: - #if defined(CONFIG_ANDROID) || 1 /* * It's the starting point of a link layer connection using wpa_supplicant @@ -2865,41 +2721,16 @@ static int rtw_wx_set_auth(struct net_device *dev, rtw_free_assoc_resources(padapter, 1); } #endif - - ret = wpa_set_auth_algs(dev, (u32)param->value); - break; - case IW_AUTH_WPA_ENABLED: - - //if (param->value) - // padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_8021X; //802.1x - //else - // padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_Open;//open system - - //_disassociate(priv); - break; - case IW_AUTH_RX_UNENCRYPTED_EAPOL: - //ieee->ieee802_1x = param->value; break; - case IW_AUTH_PRIVACY_INVOKED: - //ieee->privacy_invoked = param->value; break; - -#ifdef CONFIG_WAPI_SUPPORT -#ifndef CONFIG_IOCTL_CFG80211 - case IW_AUTH_WAPI_ENABLED: - break; -#endif -#endif - default: return -EOPNOTSUPP; - } return ret; @@ -2943,15 +2774,6 @@ static int rtw_wx_set_enc_ext(struct net_device *dev, case IW_ENCODE_ALG_CCMP: alg_name = "CCMP"; break; -#ifdef CONFIG_WAPI_SUPPORT -#ifndef CONFIG_IOCTL_CFG80211 - case IW_ENCODE_ALG_SM4: - alg_name= "SMS4"; - _rtw_memcpy(param->sta_addr, pext->addr.sa_data, ETH_ALEN); - DBG_88E("rtw_wx_set_enc_ext: SMS4 case\n"); - break; -#endif -#endif default: return -1; } @@ -2975,16 +2797,7 @@ static int rtw_wx_set_enc_ext(struct net_device *dev, param->u.crypt.idx = (pencoding->flags&0x00FF) -1 ; if (pext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) - { -#ifdef CONFIG_WAPI_SUPPORT -#ifndef CONFIG_IOCTL_CFG80211 - if (pext->alg == IW_ENCODE_ALG_SM4) - _rtw_memcpy(param->u.crypt.seq, pext->rx_seq, 16); - else -#endif -#endif _rtw_memcpy(param->u.crypt.seq, pext->rx_seq, 8); - } if (pext->key_len) { diff --git a/os_dep/os_intfs.c b/os_dep/os_intfs.c index beb60bb..129f5bb 100644 --- a/os_dep/os_intfs.c +++ b/os_dep/os_intfs.c @@ -1226,11 +1226,6 @@ _func_enter_; } #endif //CONFIG_INTEL_WIDI -#ifdef CONFIG_WAPI_SUPPORT - padapter->WapiSupport = true; //set true temp, will revise according to Efuse or Registry value later. - rtw_wapi_init(padapter); -#endif - #ifdef CONFIG_BR_EXT _rtw_spinlock_init(&padapter->br_ext_lock); #endif // CONFIG_BR_EXT @@ -1298,10 +1293,6 @@ u8 rtw_free_drv_sw(_adapter *padapter) RT_TRACE(_module_os_intfs_c_,_drv_info_,("==>rtw_free_drv_sw")); -#ifdef CONFIG_WAPI_SUPPORT - rtw_wapi_free(padapter); -#endif - //we can call rtw_p2p_enable here, but: // 1. rtw_p2p_enable may have IO operation // 2. rtw_p2p_enable is bundled with wext interface @@ -1689,12 +1680,7 @@ static int netdev_close(struct net_device *pnetdev) padapter->rtw_wdev->iftype = NL80211_IFTYPE_MONITOR; //set this at the end #endif //CONFIG_IOCTL_CFG80211 -#ifdef CONFIG_WAPI_SUPPORT - rtw_wapi_disable_tx(padapter); -#endif - RT_TRACE(_module_os_intfs_c_,_drv_info_,("-88eu_drv - drv_close\n")); DBG_88E("-88eu_drv - drv_close, bup=%d\n", padapter->bup); - return 0; } diff --git a/os_dep/recv_linux.c b/os_dep/recv_linux.c index bce7e87..35e1cbb 100644 --- a/os_dep/recv_linux.c +++ b/os_dep/recv_linux.c @@ -248,17 +248,8 @@ _func_enter_; } #endif -#ifdef CONFIG_WAPI_SUPPORT - if (rtw_wapi_check_for_drop(padapter,precv_frame)) - { - WAPI_TRACE(WAPI_ERR, "%s(): Rx Reorder Drop case!!\n", __func__); - goto _recv_indicatepkt_drop; - } -#endif - skb = precv_frame->u.hdr.pkt; - if (skb == NULL) - { + if (skb == NULL) { RT_TRACE(_module_recv_osdep_c_,_drv_err_,("rtw_recv_indicatepkt():skb==NULL something wrong!!!!\n")); goto _recv_indicatepkt_drop; }