mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-09 14:53:05 +00:00
Change "if(" to "if (" and the same changes for "while", "for", "switch" and "do"
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
124abebb96
commit
a55f866a62
105 changed files with 6893 additions and 6893 deletions
|
@ -60,10 +60,10 @@ _func_enter_;
|
|||
goto exit;
|
||||
}
|
||||
|
||||
for(i = 0; i < ssid->SsidLength; i++)
|
||||
for (i = 0; i < ssid->SsidLength; i++)
|
||||
{
|
||||
//wifi, printable ascii code must be supported
|
||||
if(!( (ssid->Ssid[i] >= 0x20) && (ssid->Ssid[i] <= 0x7e) )){
|
||||
if (!( (ssid->Ssid[i] >= 0x20) && (ssid->Ssid[i] <= 0x7e) )){
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("ssid has nonprintabl ascii\n"));
|
||||
ret= _FALSE;
|
||||
break;
|
||||
|
@ -103,7 +103,7 @@ _func_enter_;
|
|||
|
||||
pmlmepriv->to_join = _TRUE;
|
||||
|
||||
if(_rtw_queue_empty(queue)== _TRUE)
|
||||
if (_rtw_queue_empty(queue)== _TRUE)
|
||||
{
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
|
||||
|
@ -111,7 +111,7 @@ _func_enter_;
|
|||
//when set_ssid/set_bssid for rtw_do_join(), but scanning queue is empty
|
||||
//we try to issue sitesurvey firstly
|
||||
|
||||
if(pmlmepriv->LinkDetectInfo.bBusyTraffic==_FALSE
|
||||
if (pmlmepriv->LinkDetectInfo.bBusyTraffic==_FALSE
|
||||
#ifdef CONFIG_LAYER2_ROAMING
|
||||
|| pmlmepriv->to_roaming >0
|
||||
#endif
|
||||
|
@ -119,7 +119,7 @@ _func_enter_;
|
|||
{
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_do_join(): site survey if scanned_queue is empty\n."));
|
||||
// submit site_survey_cmd
|
||||
if(_SUCCESS!=(ret=rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)) ) {
|
||||
if (_SUCCESS!=(ret=rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)) ) {
|
||||
pmlmepriv->to_join = _FALSE;
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_do_join(): site survey return error\n."));
|
||||
}
|
||||
|
@ -136,14 +136,14 @@ _func_enter_;
|
|||
{
|
||||
int select_ret;
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
if((select_ret=rtw_select_and_join_from_scanned_queue(pmlmepriv))==_SUCCESS)
|
||||
if ((select_ret=rtw_select_and_join_from_scanned_queue(pmlmepriv))==_SUCCESS)
|
||||
{
|
||||
pmlmepriv->to_join = _FALSE;
|
||||
_set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)==_TRUE)
|
||||
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)==_TRUE)
|
||||
{
|
||||
// submit createbss_cmd to change to a ADHOC_MASTER
|
||||
|
||||
|
@ -161,7 +161,7 @@ _func_enter_;
|
|||
|
||||
rtw_generate_random_ibss(pibss);
|
||||
|
||||
if(rtw_createbss_cmd(padapter)!=_SUCCESS)
|
||||
if (rtw_createbss_cmd(padapter)!=_SUCCESS)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("***Error=>do_goin: rtw_createbss_cmd status FAIL*** \n "));
|
||||
ret = _FALSE;
|
||||
|
@ -179,14 +179,14 @@ _func_enter_;
|
|||
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
|
||||
|
||||
#if 0
|
||||
if((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE))
|
||||
if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE))
|
||||
{
|
||||
if(_rtw_memcmp(pmlmepriv->cur_network.network.Ssid.Ssid, pmlmepriv->assoc_ssid.Ssid, pmlmepriv->assoc_ssid.SsidLength))
|
||||
if (_rtw_memcmp(pmlmepriv->cur_network.network.Ssid.Ssid, pmlmepriv->assoc_ssid.Ssid, pmlmepriv->assoc_ssid.SsidLength))
|
||||
{
|
||||
// for funk to do roaming
|
||||
// funk will reconnect, but funk will not sitesurvey before reconnect
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("for funk to do roaming"));
|
||||
if(pmlmepriv->sitesurveyctrl.traffic_busy==_FALSE)
|
||||
if (pmlmepriv->sitesurveyctrl.traffic_busy==_FALSE)
|
||||
rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0);
|
||||
}
|
||||
|
||||
|
@ -195,14 +195,14 @@ _func_enter_;
|
|||
|
||||
//when set_ssid/set_bssid for rtw_do_join(), but there are no desired bss in scanning queue
|
||||
//we try to issue sitesurvey firstly
|
||||
if(pmlmepriv->LinkDetectInfo.bBusyTraffic==_FALSE
|
||||
if (pmlmepriv->LinkDetectInfo.bBusyTraffic==_FALSE
|
||||
#ifdef CONFIG_LAYER2_ROAMING
|
||||
|| pmlmepriv->to_roaming >0
|
||||
#endif
|
||||
)
|
||||
{
|
||||
//DBG_871X("rtw_do_join() when no desired bss in scanning queue \n");
|
||||
if( _SUCCESS!=(ret=rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)) ){
|
||||
if ( _SUCCESS!=(ret=rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)) ){
|
||||
pmlmepriv->to_join = _FALSE;
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("do_join(): site survey return error\n."));
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ u8 rtw_set_802_11_reload_defaults(_adapter * padapter, NDIS_802_11_RELOAD_DEFAUL
|
|||
{
|
||||
_func_enter_;
|
||||
|
||||
switch( reloadDefaults)
|
||||
switch ( reloadDefaults)
|
||||
{
|
||||
case Ndis802_11ReloadWEPKeys:
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("SetInfo OID_802_11_RELOAD_DEFAULTS : Ndis802_11ReloadWEPKeys\n"));
|
||||
|
@ -290,7 +290,7 @@ u8 set_802_11_test(_adapter* padapter, NDIS_802_11_TEST *test)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
switch(test->Type)
|
||||
switch (test->Type)
|
||||
{
|
||||
case 1:
|
||||
NdisMIndicateStatus(padapter->hndis_adapter, NDIS_STATUS_MEDIA_SPECIFIC_INDICATION, (PVOID)&test->AuthenticationEvent, test->Length - 8);
|
||||
|
@ -384,7 +384,7 @@ handle_tkip_countermeasure:
|
|||
if (padapter->securitypriv.btkip_countermeasure == _TRUE) {
|
||||
cur_time = rtw_get_current_time();
|
||||
|
||||
if( (cur_time - padapter->securitypriv.btkip_countermeasure_time) > 60 * HZ )
|
||||
if ( (cur_time - padapter->securitypriv.btkip_countermeasure_time) > 60 * HZ )
|
||||
{
|
||||
padapter->securitypriv.btkip_countermeasure = _FALSE;
|
||||
padapter->securitypriv.btkip_countermeasure_time = 0;
|
||||
|
@ -433,7 +433,7 @@ _func_enter_;
|
|||
DBG_871X_LEVEL(_drv_always_, "set ssid [%s] fw_state=0x%08x\n",
|
||||
ssid->Ssid, get_fwstate(pmlmepriv));
|
||||
|
||||
if(padapter->hw_init_completed==_FALSE){
|
||||
if (padapter->hw_init_completed==_FALSE){
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
|
||||
("set_ssid: hw_init_completed==_FALSE=>exit!!!\n"));
|
||||
status = _FAIL;
|
||||
|
@ -457,13 +457,13 @@ _func_enter_;
|
|||
if ((pmlmepriv->assoc_ssid.SsidLength == ssid->SsidLength) &&
|
||||
(_rtw_memcmp(&pmlmepriv->assoc_ssid.Ssid, ssid->Ssid, ssid->SsidLength) == _TRUE))
|
||||
{
|
||||
if((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _FALSE))
|
||||
if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _FALSE))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
|
||||
("Set SSID is the same ssid, fw_state=0x%08x\n",
|
||||
get_fwstate(pmlmepriv)));
|
||||
|
||||
if(rtw_is_same_ibss(padapter, pnetwork) == _FALSE)
|
||||
if (rtw_is_same_ibss(padapter, pnetwork) == _FALSE)
|
||||
{
|
||||
//if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again
|
||||
rtw_disassoc_cmd(padapter, 0, _TRUE);
|
||||
|
@ -541,7 +541,7 @@ handle_tkip_countermeasure:
|
|||
if (padapter->securitypriv.btkip_countermeasure == _TRUE) {
|
||||
cur_time = rtw_get_current_time();
|
||||
|
||||
if( (cur_time - padapter->securitypriv.btkip_countermeasure_time) > 60 * HZ )
|
||||
if ( (cur_time - padapter->securitypriv.btkip_countermeasure_time) > 60 * HZ )
|
||||
{
|
||||
padapter->securitypriv.btkip_countermeasure = _FALSE;
|
||||
padapter->securitypriv.btkip_countermeasure_time = 0;
|
||||
|
@ -598,14 +598,14 @@ _func_enter_;
|
|||
("+rtw_set_802_11_infrastructure_mode: old=%d new=%d fw_state=0x%08x\n",
|
||||
*pold_state, networktype, get_fwstate(pmlmepriv)));
|
||||
|
||||
if(*pold_state != networktype)
|
||||
if (*pold_state != networktype)
|
||||
{
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,(" change mode!"));
|
||||
//DBG_871X("change mode, old_mode=%d, new_mode=%d, fw_state=0x%x\n", *pold_state, networktype, get_fwstate(pmlmepriv));
|
||||
|
||||
if(*pold_state==Ndis802_11APMode)
|
||||
if (*pold_state==Ndis802_11APMode)
|
||||
{
|
||||
//change to other mode from Ndis802_11APMode
|
||||
cur_network->join_res = -1;
|
||||
|
@ -615,16 +615,16 @@ _func_enter_;
|
|||
#endif
|
||||
}
|
||||
|
||||
if((check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE) ||(*pold_state==Ndis802_11IBSS))
|
||||
if ((check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE) ||(*pold_state==Ndis802_11IBSS))
|
||||
rtw_disassoc_cmd(padapter, 0, _TRUE);
|
||||
|
||||
if((check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE) ||
|
||||
if ((check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE) ||
|
||||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)== _TRUE) )
|
||||
rtw_free_assoc_resources(padapter, 1);
|
||||
|
||||
if((*pold_state == Ndis802_11Infrastructure) ||(*pold_state == Ndis802_11IBSS))
|
||||
if ((*pold_state == Ndis802_11Infrastructure) ||(*pold_state == Ndis802_11IBSS))
|
||||
{
|
||||
if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
|
||||
{
|
||||
rtw_indicate_disconnect(padapter); //will clr Linked_state; before this function, we must have chked whether issue dis-assoc_cmd or not
|
||||
}
|
||||
|
@ -634,7 +634,7 @@ _func_enter_;
|
|||
|
||||
_clr_fwstate_(pmlmepriv, ~WIFI_NULL_STATE);
|
||||
|
||||
switch(networktype)
|
||||
switch (networktype)
|
||||
{
|
||||
case Ndis802_11IBSS:
|
||||
set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
|
||||
|
@ -725,7 +725,7 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_set_802_11_bssid_list_scan fail since fw_state = %x\n", get_fwstate(pmlmepriv)));
|
||||
res = _TRUE;
|
||||
|
||||
if(check_fwstate(pmlmepriv, (_FW_UNDER_SURVEY|_FW_UNDER_LINKING))== _TRUE){
|
||||
if (check_fwstate(pmlmepriv, (_FW_UNDER_SURVEY|_FW_UNDER_LINKING))== _TRUE){
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n###_FW_UNDER_SURVEY|_FW_UNDER_LINKING\n\n"));
|
||||
} else {
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n###pmlmepriv->sitesurveyctrl.traffic_busy==_TRUE\n\n"));
|
||||
|
@ -764,17 +764,17 @@ _func_enter_;
|
|||
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_authentication_mode:psecuritypriv->ndisauthtype=%d", psecuritypriv->ndisauthtype));
|
||||
|
||||
if(psecuritypriv->ndisauthtype>3)
|
||||
if (psecuritypriv->ndisauthtype>3)
|
||||
psecuritypriv->dot11AuthAlgrthm=dot11AuthAlgrthm_8021X;
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
if(psecuritypriv->ndisauthtype == 6)
|
||||
if (psecuritypriv->ndisauthtype == 6)
|
||||
psecuritypriv->dot11AuthAlgrthm=dot11AuthAlgrthm_WAPI;
|
||||
#endif
|
||||
|
||||
res=rtw_set_auth(padapter,psecuritypriv);
|
||||
|
||||
if(res==_SUCCESS)
|
||||
if (res==_SUCCESS)
|
||||
ret=_TRUE;
|
||||
else
|
||||
ret=_FALSE;
|
||||
|
@ -798,14 +798,14 @@ _func_enter_;
|
|||
btransmitkey= (wep->KeyIndex & 0x80000000) > 0 ? _TRUE : _FALSE; //for ???
|
||||
keyid=wep->KeyIndex & 0x3fffffff;
|
||||
|
||||
if(keyid>4)
|
||||
if (keyid>4)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("MgntActrtw_set_802_11_add_wep:keyid>4=>fail\n"));
|
||||
ret=_FALSE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
switch(wep->KeyLength)
|
||||
switch (wep->KeyLength)
|
||||
{
|
||||
case 5:
|
||||
psecuritypriv->dot11PrivacyAlgrthm=_WEP40_;
|
||||
|
@ -838,7 +838,7 @@ _func_enter_;
|
|||
|
||||
res=rtw_set_key(padapter,psecuritypriv, keyid, 1);
|
||||
|
||||
if(res==_FAIL)
|
||||
if (res==_FAIL)
|
||||
ret= _FALSE;
|
||||
exit:
|
||||
|
||||
|
@ -864,7 +864,7 @@ _func_enter_;
|
|||
{
|
||||
int res;
|
||||
struct security_priv* psecuritypriv=&(padapter->securitypriv);
|
||||
if( keyindex < 4 ){
|
||||
if ( keyindex < 4 ){
|
||||
|
||||
_rtw_memset(&psecuritypriv->dot11DefKey[keyindex], 0, 16);
|
||||
|
||||
|
@ -872,7 +872,7 @@ _func_enter_;
|
|||
|
||||
psecuritypriv->dot11DefKeylen[keyindex]=0;
|
||||
|
||||
if(res==_FAIL)
|
||||
if (res==_FAIL)
|
||||
ret=_FAIL;
|
||||
|
||||
}
|
||||
|
@ -913,7 +913,7 @@ _func_enter_;
|
|||
goto exit;
|
||||
}
|
||||
|
||||
if(key->KeyIndex & 0x40000000)
|
||||
if (key->KeyIndex & 0x40000000)
|
||||
{
|
||||
// Pairwise key
|
||||
|
||||
|
@ -922,7 +922,7 @@ _func_enter_;
|
|||
pbssid=get_bssid(&padapter->mlmepriv);
|
||||
stainfo=rtw_get_stainfo(&padapter->stapriv, pbssid);
|
||||
|
||||
if((stainfo!=NULL)&&(padapter->securitypriv.dot11AuthAlgrthm==dot11AuthAlgrthm_8021X)){
|
||||
if ((stainfo!=NULL)&&(padapter->securitypriv.dot11AuthAlgrthm==dot11AuthAlgrthm_8021X)){
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY:( stainfo!=NULL)&&(Adapter->securitypriv.dot11AuthAlgrthm==dot11AuthAlgrthm_8021X)\n"));
|
||||
encryptionalgo=stainfo->dot118021XPrivacy;
|
||||
}
|
||||
|
@ -935,11 +935,11 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_set_802_11_add_key: (Adapter->securitypriv.dot11PrivacyAlgrthm ==%d)!\n",padapter->securitypriv.dot11PrivacyAlgrthm));
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_set_802_11_add_key: (Adapter->securitypriv.dot11AuthAlgrthm ==%d)!\n",padapter->securitypriv.dot11AuthAlgrthm));
|
||||
|
||||
if((stainfo!=NULL)){
|
||||
if ((stainfo!=NULL)){
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_set_802_11_add_key: (stainfo->dot118021XPrivacy ==%d)!\n", stainfo->dot118021XPrivacy));
|
||||
}
|
||||
|
||||
if(key->KeyIndex & 0x000000FF){
|
||||
if (key->KeyIndex & 0x000000FF){
|
||||
// The key index is specified in the lower 8 bits by values of zero to 255.
|
||||
// The key index should be set to zero for a Pairwise key, and the driver should fail with
|
||||
// NDIS_STATUS_INVALID_DATA if the lower 8 bits is not zero
|
||||
|
@ -957,8 +957,8 @@ _func_enter_;
|
|||
}
|
||||
|
||||
// Check key length for TKIP.
|
||||
//if(encryptionAlgorithm == RT_ENC_TKIP_ENCRYPTION && key->KeyLength != 32)
|
||||
if((encryptionalgo== _TKIP_)&& (key->KeyLength != 32)){
|
||||
//if (encryptionAlgorithm == RT_ENC_TKIP_ENCRYPTION && key->KeyLength != 32)
|
||||
if ((encryptionalgo== _TKIP_)&& (key->KeyLength != 32)){
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("TKIP KeyLength:0x%x != 32\n", key->KeyLength));
|
||||
ret=_FAIL;
|
||||
goto exit;
|
||||
|
@ -966,9 +966,9 @@ _func_enter_;
|
|||
}
|
||||
|
||||
// Check key length for AES.
|
||||
if((encryptionalgo== _AES_)&& (key->KeyLength != 16)) {
|
||||
if ((encryptionalgo== _AES_)&& (key->KeyLength != 16)) {
|
||||
// For our supplicant, EAPPkt9x.vxd, cannot differentiate TKIP and AES case.
|
||||
if(key->KeyLength == 32) {
|
||||
if (key->KeyLength == 32) {
|
||||
key->KeyLength = 16;
|
||||
} else {
|
||||
ret= _FAIL;
|
||||
|
@ -977,7 +977,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
// Check key length for WEP. For NDTEST, 2005.01.27, by rcnjko.
|
||||
if( (encryptionalgo== _WEP40_|| encryptionalgo== _WEP104_) && (key->KeyLength != 5 || key->KeyLength != 13)) {
|
||||
if ( (encryptionalgo== _WEP40_|| encryptionalgo== _WEP104_) && (key->KeyLength != 5 || key->KeyLength != 13)) {
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("WEP KeyLength:0x%x != 5 or 13\n", key->KeyLength));
|
||||
ret=_FAIL;
|
||||
goto exit;
|
||||
|
@ -1001,11 +1001,11 @@ _func_enter_;
|
|||
|
||||
|
||||
// when add wep key through add key and didn't assigned encryption type before
|
||||
if((padapter->securitypriv.ndisauthtype<=3)&&(padapter->securitypriv.dot118021XGrpPrivacy==0))
|
||||
if ((padapter->securitypriv.ndisauthtype<=3)&&(padapter->securitypriv.dot118021XGrpPrivacy==0))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("keylen=%d( Adapter->securitypriv.dot11PrivacyAlgrthm=%x )padapter->securitypriv.dot118021XGrpPrivacy(%x)\n", key->KeyLength,padapter->securitypriv.dot11PrivacyAlgrthm,padapter->securitypriv.dot118021XGrpPrivacy));
|
||||
|
||||
switch(key->KeyLength)
|
||||
switch (key->KeyLength)
|
||||
{
|
||||
case 5:
|
||||
padapter->securitypriv.dot11PrivacyAlgrthm=_WEP40_;
|
||||
|
@ -1033,20 +1033,20 @@ _func_enter_;
|
|||
|
||||
}
|
||||
|
||||
if((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE)==_TRUE) && (IS_MAC_ADDRESS_BROADCAST(key->BSSID) == _FALSE)) {
|
||||
if ((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE)==_TRUE) && (IS_MAC_ADDRESS_BROADCAST(key->BSSID) == _FALSE)) {
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,(" IBSS but BSSID is not Broadcast Address.\n"));
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
// Check key length for TKIP
|
||||
if((encryptionalgo== _TKIP_) && (key->KeyLength != 32)) {
|
||||
if ((encryptionalgo== _TKIP_) && (key->KeyLength != 32)) {
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,(" TKIP GTK KeyLength:%u != 32\n", key->KeyLength));
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
|
||||
} else if(encryptionalgo== _AES_ && (key->KeyLength != 16 && key->KeyLength != 32) ) {
|
||||
} else if (encryptionalgo== _AES_ && (key->KeyLength != 16 && key->KeyLength != 32) ) {
|
||||
|
||||
// Check key length for AES
|
||||
// For NDTEST, we allow keylen=32 in this case. 2005.01.27, by rcnjko.
|
||||
|
@ -1056,16 +1056,16 @@ _func_enter_;
|
|||
}
|
||||
|
||||
// Change the key length for EAPPkt9x.vxd. Added by Annie, 2005-11-03.
|
||||
if((encryptionalgo== _AES_) && (key->KeyLength == 32) ) {
|
||||
if ((encryptionalgo== _AES_) && (key->KeyLength == 32) ) {
|
||||
key->KeyLength = 16;
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("AES key length changed: %u\n", key->KeyLength) );
|
||||
}
|
||||
|
||||
if(key->KeyIndex & 0x8000000) {//error ??? 0x8000_0000
|
||||
if (key->KeyIndex & 0x8000000) {//error ??? 0x8000_0000
|
||||
bgrouptkey = _TRUE;
|
||||
}
|
||||
|
||||
if((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE)==_TRUE)&&(check_fwstate(&padapter->mlmepriv, _FW_LINKED)==_TRUE))
|
||||
if ((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE)==_TRUE)&&(check_fwstate(&padapter->mlmepriv, _FW_LINKED)==_TRUE))
|
||||
{
|
||||
bgrouptkey = _TRUE;
|
||||
}
|
||||
|
@ -1082,7 +1082,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
// If WEP encryption algorithm, just call rtw_set_802_11_add_wep().
|
||||
if((padapter->securitypriv.dot11AuthAlgrthm !=dot11AuthAlgrthm_8021X)&&(encryptionalgo== _WEP40_ || encryptionalgo== _WEP104_))
|
||||
if ((padapter->securitypriv.dot11AuthAlgrthm !=dot11AuthAlgrthm_8021X)&&(encryptionalgo== _WEP40_ || encryptionalgo== _WEP104_))
|
||||
{
|
||||
u8 ret;
|
||||
u32 keyindex;
|
||||
|
@ -1110,10 +1110,10 @@ _func_enter_;
|
|||
|
||||
}
|
||||
|
||||
if(key->KeyIndex & 0x20000000){
|
||||
if (key->KeyIndex & 0x20000000){
|
||||
// SetRSC
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: +++++ SetRSC+++++\n"));
|
||||
if(bgroup == _TRUE)
|
||||
if (bgroup == _TRUE)
|
||||
{
|
||||
NDIS_802_11_KEY_RSC keysrc=key->KeyRSC & 0x00FFFFFFFFFFFFULL;
|
||||
_rtw_memcpy(&padapter->securitypriv.dot11Grprxpn, &keysrc, 8);
|
||||
|
@ -1128,16 +1128,16 @@ _func_enter_;
|
|||
|
||||
// Indicate this key idx is used for TX
|
||||
// Save the key in KeyMaterial
|
||||
if(bgroup == _TRUE) // Group transmit key
|
||||
if (bgroup == _TRUE) // Group transmit key
|
||||
{
|
||||
int res;
|
||||
|
||||
if(bgrouptkey == _TRUE)
|
||||
if (bgrouptkey == _TRUE)
|
||||
{
|
||||
padapter->securitypriv.dot118021XGrpKeyid=(u8)key->KeyIndex;
|
||||
}
|
||||
|
||||
if((key->KeyIndex&0x3) == 0){
|
||||
if ((key->KeyIndex&0x3) == 0){
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
@ -1146,7 +1146,7 @@ _func_enter_;
|
|||
_rtw_memset(&padapter->securitypriv.dot118021XGrptxmickey[(u8)((key->KeyIndex) & 0x03)], 0, 16);
|
||||
_rtw_memset(&padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)], 0, 16);
|
||||
|
||||
if((key->KeyIndex & 0x10000000))
|
||||
if ((key->KeyIndex & 0x10000000))
|
||||
{
|
||||
_rtw_memcpy(&padapter->securitypriv.dot118021XGrptxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 16, 8);
|
||||
_rtw_memcpy(&padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 24, 8);
|
||||
|
@ -1186,7 +1186,7 @@ _func_enter_;
|
|||
|
||||
res=rtw_set_key(padapter,&padapter->securitypriv, key->KeyIndex, 1);
|
||||
|
||||
if(res==_FAIL)
|
||||
if (res==_FAIL)
|
||||
ret= _FAIL;
|
||||
|
||||
goto exit;
|
||||
|
@ -1199,13 +1199,13 @@ _func_enter_;
|
|||
pbssid=get_bssid(&padapter->mlmepriv);
|
||||
stainfo=rtw_get_stainfo(&padapter->stapriv , pbssid );
|
||||
|
||||
if(stainfo!=NULL)
|
||||
if (stainfo!=NULL)
|
||||
{
|
||||
_rtw_memset( &stainfo->dot118021x_UncstKey, 0, 16);// clear keybuffer
|
||||
|
||||
_rtw_memcpy(&stainfo->dot118021x_UncstKey, key->KeyMaterial, 16);
|
||||
|
||||
if(encryptionalgo== _TKIP_)
|
||||
if (encryptionalgo== _TKIP_)
|
||||
{
|
||||
padapter->securitypriv.busetkipkey=_FALSE;
|
||||
|
||||
|
@ -1214,7 +1214,7 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n ==========_set_timer\n"));
|
||||
|
||||
// if TKIP, save the Receive/Transmit MIC key in KeyMaterial[128-255]
|
||||
if((key->KeyIndex & 0x10000000)){
|
||||
if ((key->KeyIndex & 0x10000000)){
|
||||
_rtw_memcpy(&stainfo->dot11tkiptxmickey, key->KeyMaterial + 16, 8);
|
||||
_rtw_memcpy(&stainfo->dot11tkiprxmickey, key->KeyMaterial + 24, 8);
|
||||
|
||||
|
@ -1225,14 +1225,14 @@ _func_enter_;
|
|||
}
|
||||
|
||||
}
|
||||
else if(encryptionalgo == _AES_)
|
||||
else if (encryptionalgo == _AES_)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
//Set key to CAM through H2C command
|
||||
if(bgrouptkey)//never go to here
|
||||
if (bgrouptkey)//never go to here
|
||||
{
|
||||
res=rtw_setstakey_cmd(padapter, (unsigned char *)stainfo, _FALSE);
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(group)\n"));
|
||||
|
@ -1242,7 +1242,7 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(unicast)\n"));
|
||||
}
|
||||
|
||||
if(res ==_FALSE)
|
||||
if (res ==_FALSE)
|
||||
ret= _FAIL;
|
||||
|
||||
}
|
||||
|
@ -1286,7 +1286,7 @@ _func_enter_;
|
|||
|
||||
pbssid=get_bssid(&padapter->mlmepriv);
|
||||
stainfo=rtw_get_stainfo(&padapter->stapriv , pbssid );
|
||||
if(stainfo !=NULL){
|
||||
if (stainfo !=NULL){
|
||||
encryptionalgo=stainfo->dot118021XPrivacy;
|
||||
|
||||
// clear key by BSSID
|
||||
|
@ -1341,14 +1341,14 @@ u16 rtw_get_cur_max_rate(_adapter *adapter)
|
|||
}
|
||||
#endif
|
||||
|
||||
if((check_fwstate(pmlmepriv, _FW_LINKED) != _TRUE)
|
||||
if ((check_fwstate(pmlmepriv, _FW_LINKED) != _TRUE)
|
||||
&& (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) != _TRUE))
|
||||
return 0;
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
if (pmlmeext->cur_wireless_mode & (WIRELESS_11_24N|WIRELESS_11_5N)) {
|
||||
p = rtw_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->IELength-12);
|
||||
if(p && ht_ielen>0)
|
||||
if (p && ht_ielen>0)
|
||||
{
|
||||
pht_capie = (struct rtw_ieee80211_ht_cap *)(p+2);
|
||||
|
||||
|
@ -1375,10 +1375,10 @@ u16 rtw_get_cur_max_rate(_adapter *adapter)
|
|||
else
|
||||
#endif //CONFIG_80211N_HT
|
||||
{
|
||||
while( (pcur_bss->SupportedRates[i]!=0) && (pcur_bss->SupportedRates[i]!=0xFF))
|
||||
while ( (pcur_bss->SupportedRates[i]!=0) && (pcur_bss->SupportedRates[i]!=0xFF))
|
||||
{
|
||||
rate = pcur_bss->SupportedRates[i]&0x7F;
|
||||
if(rate>max_rate)
|
||||
if (rate>max_rate)
|
||||
max_rate = rate;
|
||||
i++;
|
||||
}
|
||||
|
@ -1398,7 +1398,7 @@ u16 rtw_get_cur_max_rate(_adapter *adapter)
|
|||
*/
|
||||
int rtw_set_scan_mode(_adapter *adapter, RT_SCAN_TYPE scan_mode)
|
||||
{
|
||||
if(scan_mode != SCAN_ACTIVE && scan_mode != SCAN_PASSIVE)
|
||||
if (scan_mode != SCAN_ACTIVE && scan_mode != SCAN_PASSIVE)
|
||||
return _FAIL;
|
||||
|
||||
adapter->mlmepriv.scan_mode = scan_mode;
|
||||
|
@ -1437,13 +1437,13 @@ int rtw_set_country(_adapter *adapter, const char *country_code)
|
|||
|
||||
//TODO: should have a table to match country code and RT_CHANNEL_DOMAIN
|
||||
//TODO: should consider 2-character and 3-character country code
|
||||
if(0 == strcmp(country_code, "US"))
|
||||
if (0 == strcmp(country_code, "US"))
|
||||
channel_plan = RT_CHANNEL_DOMAIN_FCC;
|
||||
else if(0 == strcmp(country_code, "EU"))
|
||||
else if (0 == strcmp(country_code, "EU"))
|
||||
channel_plan = RT_CHANNEL_DOMAIN_ETSI;
|
||||
else if(0 == strcmp(country_code, "JP"))
|
||||
else if (0 == strcmp(country_code, "JP"))
|
||||
channel_plan = RT_CHANNEL_DOMAIN_MKK;
|
||||
else if(0 == strcmp(country_code, "CN"))
|
||||
else if (0 == strcmp(country_code, "CN"))
|
||||
channel_plan = RT_CHANNEL_DOMAIN_CHINA;
|
||||
else
|
||||
DBG_871X("%s unknown country_code:%s\n", __FUNCTION__, country_code);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue