diff --git a/Makefile b/Makefile index b27a5f4..d9dc640 100755 --- a/Makefile +++ b/Makefile @@ -21,7 +21,6 @@ CONFIG_USB_HCI = y CONFIG_POWER_SAVING = y CONFIG_USB_AUTOSUSPEND = n CONFIG_BT_COEXIST = n -CONFIG_WAPI_SUPPORT = n CONFIG_EFUSE_CONFIG_FILE = n CONFIG_EXT_CLK = n CONFIG_WOWLAN = n @@ -103,14 +102,6 @@ ifeq ($(CONFIG_BT_COEXIST), y) EXTRA_CFLAGS += -DCONFIG_BT_COEXIST endif -ifeq ($(CONFIG_RTL8192CU_REDEFINE_1X1), y) -EXTRA_CFLAGS += -DRTL8192C_RECONFIG_TO_1T1R -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 @@ -179,9 +170,6 @@ rtk_core := core/rtw_cmd.o \ 8188eu-y += $(rtk_core) -8188eu-$(CONFIG_WAPI_SUPPORT) += core/rtw_wapi.o \ - core/rtw_wapi_sms4.o - 8188eu-y += core/rtw_efuse.o 8188eu-y += $(_HAL_INTFS_FILES) diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 1a0d3ef..e0ad139 100755 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -746,61 +746,14 @@ int rtw_parse_wpa2_ie(u8* rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi } return ret; - } -#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}; - -; - 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) @@ -669,8 +664,6 @@ u8 rtw_set_802_11_authentication_mode(struct adapter* padapter, NDIS_802_11_AUTH else ret=false; -; - return ret; } diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 833500d..a997a3c 100755 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -1397,19 +1397,6 @@ void rtw_indicate_disconnect( struct adapter *padapter ) if(rtw_to_roaming(padapter) > 0) _clr_fwstate_(pmlmepriv, _FW_LINKED); -#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) || (rtw_to_roaming(padapter) <= 0) ) @@ -3191,10 +3178,6 @@ void _rtw_roaming(struct 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 730d7b2..5c36035 100755 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -1990,7 +1990,7 @@ unsigned int OnAssocRsp(struct adapter *padapter, union recv_frame *precv_frame) { WMM_param_handler(padapter, pIE); } -#if defined(CONFIG_P2P) && defined(CONFIG_P2P) +#if defined(CONFIG_P2P) else if ( _rtw_memcmp(pIE->data, WFD_OUI, 4)) /* WFD */ { DBG_871X( "[%s] Found WFD IE\n", __FUNCTION__ ); @@ -1998,13 +1998,6 @@ unsigned int OnAssocRsp(struct 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; @@ -2023,10 +2016,6 @@ unsigned int OnAssocRsp(struct 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; @@ -6949,15 +6938,7 @@ void issue_assocreq(struct 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 @@ -8654,13 +8635,6 @@ void start_clnt_join(struct 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)); /* Because of AP's not receiving deauth before */ @@ -10107,10 +10081,6 @@ u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf) rtw_antenna_select_cmd(padapter, pparm->network.PhyInfo.Optimum_antenna, false); -#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 edf6908..ad6b1c9 100755 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -613,11 +613,6 @@ static union recv_frame *decryptor(struct adapter *padapter,union recv_frame *pr 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; } @@ -2021,16 +2016,6 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame) #ifdef CONFIG_TDLS struct tdls_info *ptdlsinfo = &adapter->tdlsinfo; #endif /* CONFIG_TDLS */ -#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 - -; - #ifdef CONFIG_AP_MODE if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) { @@ -2081,11 +2066,7 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame) 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 */ { u8 bDumpRxPkt; rtw_hal_get_def_var(adapter, HAL_DEF_DBG_DUMP_RXPKT, &(bDumpRxPkt)); @@ -2121,7 +2102,6 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame) } } } -#endif switch (type) { case WIFI_MGT_TYPE: /* mgnt */ @@ -2149,38 +2129,6 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame) 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); @@ -3372,10 +3320,6 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr count_rx_stats(padapter, prframe, NULL); #endif /* CONFIG_TDLS */ -#ifdef CONFIG_WAPI_SUPPORT - rtw_wapi_update_info(padapter, prframe); -#endif - ret = process_recv_indicatepkts(padapter, prframe); if (ret != _SUCCESS) { diff --git a/core/rtw_sreset.c b/core/rtw_sreset.c index a432be5..fee0727 100755 --- a/core/rtw_sreset.c +++ b/core/rtw_sreset.c @@ -124,11 +124,6 @@ static void sreset_restore_security_station(struct adapter *padapter) if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_8021X) { val8 = 0xcc; - #ifdef CONFIG_WAPI_SUPPORT - } else if (padapter->wapiInfo.bWapiEnable && pmlmeinfo->auth_algo == dot11AuthAlgrthm_WAPI) { - /* Disable TxUseDefaultKey, RxUseDefaultKey, RxBroadcastUseDefaultKey. */ - val8 = 0x4c; - #endif } else { val8 = 0xcf; } diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index f842276..dda5b13 100755 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -684,14 +684,8 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib } /* 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); - } bmcast = IS_MCAST(pattrib->ra); @@ -776,11 +770,6 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib { 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: @@ -830,14 +819,6 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib 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; @@ -859,10 +840,6 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib pattrib->bswenc = false; 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); @@ -1035,10 +1012,6 @@ static s32 xmitframe_swencrypt(struct adapter *padapter, struct xmit_frame *pxmi case _AES_: rtw_aes_encrypt(padapter, (u8 * )pxmitframe); break; -#ifdef CONFIG_WAPI_SUPPORT - case _SMS4_: - rtw_sms4_encrypt(padapter, (u8 * )pxmitframe); -#endif default: break; } @@ -1742,11 +1715,6 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit_fram 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 } } @@ -3150,16 +3118,6 @@ s32 rtw_xmit(struct 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/rtl8188e_cmd.c b/hal/rtl8188e_cmd.c index cf71f1d..215ab2d 100755 --- a/hal/rtl8188e_cmd.c +++ b/hal/rtl8188e_cmd.c @@ -611,11 +611,6 @@ static void ConstructARPResponse( case _AES_: EncryptionHeadOverhead = 8; break; -#ifdef CONFIG_WAPI_SUPPORT - case _SMS4_: - EncryptionHeadOverhead = 18; - break; -#endif default: EncryptionHeadOverhead = 0; } @@ -864,13 +859,8 @@ static void SetFwRsvdPagePkt(struct adapter *padapter, BOOLEAN bDLFinished) case _AES_: ReservedPagePacket[BufIndex-TxDescLen+6] |= BIT(6)|BIT(7); break; -#ifdef CONFIG_WAPI_SUPPORT - case _SMS4_: - ReservedPagePacket[BufIndex-TxDescLen+6] |= BIT(7); - break; -#endif default: - ; + break; } PageNeed = (u8)PageNum_128(TxDescLen + ARPLegnth); diff --git a/hal/rtl8188eu_xmit.c b/hal/rtl8188eu_xmit.c index 3f7c5d6..1bd8ff5 100755 --- 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); @@ -156,8 +150,6 @@ static void fill_txdesc_sectype(struct pkt_attrib *pattrib, struct tx_desc *ptxd static void fill_txdesc_vcs(struct pkt_attrib *pattrib, __le32 *pdw) { - /* DBG_8192C("cvs_mode=%d\n", pattrib->vcs_mode); */ - switch(pattrib->vcs_mode) { case RTS_CTS: diff --git a/include/drv_types.h b/include/drv_types.h index e8e87cb..60b1d80 100755 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -67,10 +67,6 @@ enum _NIC_VERSION { #include #include -#ifdef CONFIG_WAPI_SUPPORT -#include -#endif - #ifdef CONFIG_DRVEXT_MODULE #include #endif @@ -381,13 +377,6 @@ struct adapter { #ifdef CONFIG_TDLS struct tdls_info tdlsinfo; #endif //CONFIG_TDLS - -#ifdef CONFIG_WAPI_SUPPORT - u8 WapiSupport; - RT_WAPI_T wapiInfo; -#endif - - #ifdef CONFIG_P2P struct wifi_display_info wfd_info; #endif //CONFIG_P2P diff --git a/include/rtw_recv.h b/include/rtw_recv.h index 7390d26..b1a4a38 100755 --- a/include/rtw_recv.h +++ b/include/rtw_recv.h @@ -378,31 +378,16 @@ 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{ _list list; struct recv_frame_hdr hdr; uint mem[RECVFRAME_HDR_ALIGN>>2]; }u; - - //uint mem[MAX_RXSZ>>2]; - }; - extern union recv_frame *_rtw_alloc_recvframe (_queue *pfree_recv_queue); //get a free recv_frame from pfree_recv_queue extern union recv_frame *rtw_alloc_recvframe (_queue *pfree_recv_queue); //get a free recv_frame from pfree_recv_queue extern void rtw_init_recvframe(union recv_frame *precvframe ,struct recv_priv *precvpriv); diff --git a/include/wifi.h b/include/wifi.h index c907512..9ed2c5c 100755 --- a/include/wifi.h +++ b/include/wifi.h @@ -1071,19 +1071,4 @@ enum P2P_PS_MODE { #define IP_MCAST_MAC(mac) ((mac[0]==0x01)&&(mac[1]==0x00)&&(mac[2]==0x5e)) #define ICMPV6_MCAST_MAC(mac) ((mac[0]==0x33)&&(mac[1]==0x33)&&(mac[2]!=0xff)) -#ifdef CONFIG_WAPI_SUPPORT -#ifndef IW_AUTH_WAPI_VERSION_1 -#define IW_AUTH_WAPI_VERSION_1 0x00000008 -#endif -#ifndef IW_AUTH_KEY_MGMT_WAPI_PSK -#define IW_AUTH_KEY_MGMT_WAPI_PSK 0x04 -#endif -#ifndef IW_AUTH_WAPI_ENABLED -#define IW_AUTH_WAPI_ENABLED 0x20 -#endif -#ifndef IW_ENCODE_ALG_SM4 -#define IW_ENCODE_ALG_SM4 0x20 -#endif -#endif - #endif /* _WIFI_H_ */ diff --git a/os_dep/ioctl_cfg80211.c b/os_dep/ioctl_cfg80211.c index 1214ee2..7b1c798 100755 --- a/os_dep/ioctl_cfg80211.c +++ b/os_dep/ioctl_cfg80211.c @@ -37,30 +37,6 @@ #define RTW_CH_MAX_2G_CHANNEL 14 /* Max channel in 2G band */ - - -#ifdef CONFIG_WAPI_SUPPORT - -#ifndef WLAN_CIPHER_SUITE_SMS4 -#define WLAN_CIPHER_SUITE_SMS4 0x00147201 -#endif - -#ifndef WLAN_AKM_SUITE_WAPI_PSK -#define WLAN_AKM_SUITE_WAPI_PSK 0x000FAC04 -#endif - -#ifndef WLAN_AKM_SUITE_WAPI_CERT -#define WLAN_AKM_SUITE_WAPI_CERT 0x000FAC12 -#endif - -#ifndef NL80211_WAPI_VERSION_1 -#define NL80211_WAPI_VERSION_1 (1 << 2) -#endif - -#endif - - - static const u32 rtw_cipher_suites[] = { WLAN_CIPHER_SUITE_WEP40, WLAN_CIPHER_SUITE_WEP104, @@ -1235,14 +1211,9 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param 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) { @@ -1402,79 +1373,10 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param } } -#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)) - { - memcpy(pWapiSta->lastTxUnicastPN,WapiASUEPNInitialValueSrc,16); - - pWapiSta->wapiUsk.bSet = true; - memcpy(pWapiSta->wapiUsk.dataKey,param->u.crypt.key,16); - memcpy(pWapiSta->wapiUsk.micKey,param->u.crypt.key+16,16); - pWapiSta->wapiUsk.keyId = param->u.crypt.idx ; - pWapiSta->wapiUsk.bTxEnable = true; - - memcpy(pWapiSta->lastRxUnicastPNBEQueue,WapiAEPNInitialValueSrc,16); - memcpy(pWapiSta->lastRxUnicastPNBKQueue,WapiAEPNInitialValueSrc,16); - memcpy(pWapiSta->lastRxUnicastPNVIQueue,WapiAEPNInitialValueSrc,16); - memcpy(pWapiSta->lastRxUnicastPNVOQueue,WapiAEPNInitialValueSrc,16); - 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; - memcpy(pWapiSta->wapiMsk.dataKey,param->u.crypt.key,16); - 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; - - 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_8192C("%s, ret=%d\n", __func__, ret); - ; - return ret; } @@ -1534,22 +1436,6 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev, alg_name = "BIP"; break; #endif /* CONFIG_IEEE80211W */ -#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; - } - memcpy((void*)param->sta_addr, (void*)mac_addr, ETH_ALEN); - } else { - DBG_871X("mac_addr is null \n"); - } - DBG_871X("rtw_wx_set_enc_ext: SMS4 case \n"); - break; -#endif - default: ret = -ENOTSUPP; goto addkey_end; @@ -2315,20 +2201,12 @@ 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; @@ -2359,12 +2237,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_; @@ -2382,12 +2254,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_8192C("Unsupported cipher: 0x%x\n", cipher); return -ENOTSUPP; @@ -2413,18 +2279,7 @@ 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_8192C("Invalid key mgt: 0x%x\n", key_mgt); /* return -EINVAL; */ } @@ -2815,31 +2670,12 @@ 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; @@ -2927,15 +2763,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 3413d6b..2d6ddf9 100755 --- a/os_dep/ioctl_linux.c +++ b/os_dep/ioctl_linux.c @@ -529,48 +529,6 @@ static char *translate_scan(struct 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; - - memset(buf_wapi, 0, MAX_WAPI_IE_LEN); - 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_871X("rtw_wx_get_scan: %s ",pnetwork->network.Ssid.Ssid); - DBG_871X("rtw_wx_get_scan: ssid = %d ",wapi_len); - - - if (wapi_len > 0) - { - p=buf_wapi; - 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]); - } - - 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); - - 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 /* CONFIG_WAPI_SUPPORT */ - { struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); u8 ss, sq; @@ -724,20 +682,12 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, ret = -EINVAL; goto exit; } - } - else - { -#ifdef CONFIG_WAPI_SUPPORT - if (strcmp(param->u.crypt.alg, "SMS4")) -#endif - { - ret = -EINVAL; - goto exit; - } + } else { + ret = -EINVAL; + goto exit; } - if (strcmp(param->u.crypt.alg, "WEP") == 0) - { + if (strcmp(param->u.crypt.alg, "WEP") == 0) { RT_TRACE(_module_rtl871x_ioctl_os_c,_drv_err_,("wpa_set_encryption, crypt.alg = WEP\n")); DBG_871X("wpa_set_encryption, crypt.alg = WEP\n"); @@ -909,70 +859,6 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, } } -#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)) - { - memcpy(pWapiSta->lastTxUnicastPN,WapiASUEPNInitialValueSrc,16); - - pWapiSta->wapiUsk.bSet = true; - memcpy(pWapiSta->wapiUsk.dataKey,param->u.crypt.key,16); - memcpy(pWapiSta->wapiUsk.micKey,param->u.crypt.key+16,16); - pWapiSta->wapiUsk.keyId = param->u.crypt.idx ; - pWapiSta->wapiUsk.bTxEnable = true; - - memcpy(pWapiSta->lastRxUnicastPNBEQueue,WapiAEPNInitialValueSrc,16); - memcpy(pWapiSta->lastRxUnicastPNBKQueue,WapiAEPNInitialValueSrc,16); - memcpy(pWapiSta->lastRxUnicastPNVIQueue,WapiAEPNInitialValueSrc,16); - memcpy(pWapiSta->lastRxUnicastPNVOQueue,WapiAEPNInitialValueSrc,16); - 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; - memcpy(pWapiSta->wapiMsk.dataKey,param->u.crypt.key,16); - 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; - - 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) diff --git a/os_dep/os_intfs.c b/os_dep/os_intfs.c index bece790..5f68d5f 100755 --- a/os_dep/os_intfs.c +++ b/os_dep/os_intfs.c @@ -943,11 +943,6 @@ u8 rtw_init_drv_sw(struct adapter *padapter) rtw_hal_sreset_init(padapter); #endif -#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 */ @@ -1021,10 +1016,6 @@ u8 rtw_free_drv_sw(struct 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 */ @@ -1526,15 +1517,10 @@ static int netdev_close(struct net_device *pnetdev) wdev_to_priv(padapter->rtw_wdev)->bandroid_scan = false; padapter->rtw_wdev->iftype = NL80211_IFTYPE_MONITOR; /* set this at the end */ -#ifdef CONFIG_WAPI_SUPPORT - rtw_wapi_disable_tx(padapter); -#endif - RT_TRACE(_module_os_intfs_c_,_drv_info_,("-871x_drv - drv_close\n")); DBG_871X("-871x_drv - drv_close, bup=%d\n", padapter->bup); return 0; - } void rtw_ndev_destructor(struct net_device *ndev) diff --git a/os_dep/recv_linux.c b/os_dep/recv_linux.c index a151465..fdb294c 100755 --- a/os_dep/recv_linux.c +++ b/os_dep/recv_linux.c @@ -217,14 +217,6 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame } #endif -#ifdef CONFIG_WAPI_SUPPORT - if (rtw_wapi_check_for_drop(padapter,precv_frame)) - { - WAPI_TRACE(WAPI_ERR, "%s(): Rx Reorder Drop case!!\n", __FUNCTION__); - goto _recv_indicatepkt_drop; - } -#endif - skb = precv_frame->u.hdr.pkt; if(skb == NULL) {