rtl8188eu: Remove dead code associated with WAPI

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-07-12 01:29:15 -05:00
parent 7c593a903d
commit acda213bd2
16 changed files with 5 additions and 841 deletions

View file

@ -1039,14 +1039,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)
{
@ -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);

View file

@ -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)
{

View file

@ -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;
}

View file

@ -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;
}