mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-09 14:53:05 +00:00
rtl8188eu: Change all "if(" to "if ("
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
aa89a39a09
commit
6ead3e77dc
61 changed files with 3500 additions and 3500 deletions
|
@ -119,7 +119,7 @@ int rtw_check_network_type(unsigned char *rate, int ratelen, int channel)
|
|||
{
|
||||
if ((rtw_is_cckratesonly_included(rate)) == true)
|
||||
return WIRELESS_11B;
|
||||
else if((rtw_is_cckrates_included(rate)) == true)
|
||||
else if ((rtw_is_cckrates_included(rate)) == true)
|
||||
return WIRELESS_11BG;
|
||||
else
|
||||
return WIRELESS_11G;
|
||||
|
@ -174,9 +174,9 @@ inline u8 secondary_ch_offset_to_hal_ch_offset(u8 ch_offset)
|
|||
{
|
||||
if (ch_offset == SCN)
|
||||
return HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
else if(ch_offset == SCA)
|
||||
else if (ch_offset == SCA)
|
||||
return HAL_PRIME_CHNL_OFFSET_UPPER;
|
||||
else if(ch_offset == SCB)
|
||||
else if (ch_offset == SCB)
|
||||
return HAL_PRIME_CHNL_OFFSET_LOWER;
|
||||
|
||||
return HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
|
@ -186,9 +186,9 @@ inline u8 hal_ch_offset_to_secondary_ch_offset(u8 ch_offset)
|
|||
{
|
||||
if (ch_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE)
|
||||
return SCN;
|
||||
else if(ch_offset == HAL_PRIME_CHNL_OFFSET_LOWER)
|
||||
else if (ch_offset == HAL_PRIME_CHNL_OFFSET_LOWER)
|
||||
return SCB;
|
||||
else if(ch_offset == HAL_PRIME_CHNL_OFFSET_UPPER)
|
||||
else if (ch_offset == HAL_PRIME_CHNL_OFFSET_UPPER)
|
||||
return SCA;
|
||||
|
||||
return SCN;
|
||||
|
@ -266,25 +266,25 @@ u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, u
|
|||
u8 *target_ie = NULL;
|
||||
|
||||
|
||||
if(ielen)
|
||||
if (ielen)
|
||||
*ielen = 0;
|
||||
|
||||
if(!in_ie || in_len<=0)
|
||||
if (!in_ie || in_len<=0)
|
||||
return target_ie;
|
||||
|
||||
cnt = 0;
|
||||
|
||||
while(cnt<in_len)
|
||||
{
|
||||
if(eid == in_ie[cnt]
|
||||
if (eid == in_ie[cnt]
|
||||
&& ( !oui || _rtw_memcmp(&in_ie[cnt+2], oui, oui_len) == true))
|
||||
{
|
||||
target_ie = &in_ie[cnt];
|
||||
|
||||
if(ie)
|
||||
if (ie)
|
||||
memcpy(ie, &in_ie[cnt], in_ie[cnt+1]+2);
|
||||
|
||||
if(ielen)
|
||||
if (ielen)
|
||||
*ielen = in_ie[cnt+1]+2;
|
||||
|
||||
break;
|
||||
|
@ -318,7 +318,7 @@ int rtw_ies_remove_ie(u8 *ies, uint *ies_len, uint offset, u8 eid, u8 *oui, u8 o
|
|||
u8 *start;
|
||||
uint search_len;
|
||||
|
||||
if(!ies || !ies_len || *ies_len <= offset)
|
||||
if (!ies || !ies_len || *ies_len <= offset)
|
||||
goto exit;
|
||||
|
||||
start = ies + offset;
|
||||
|
@ -418,7 +418,7 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
|
|||
|
||||
*(__le16*)ie |= cpu_to_le16(cap_IBSS);
|
||||
|
||||
if(pregistrypriv->preamble == PREAMBLE_SHORT)
|
||||
if (pregistrypriv->preamble == PREAMBLE_SHORT)
|
||||
*(__le16*)ie |= cpu_to_le16(cap_ShortPremble);
|
||||
|
||||
if (pdev_network->Privacy)
|
||||
|
@ -431,9 +431,9 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
|
|||
ie = rtw_set_ie(ie, _SSID_IE_, pdev_network->Ssid.SsidLength, pdev_network->Ssid.Ssid, &sz);
|
||||
|
||||
/* supported rates */
|
||||
if(pregistrypriv->wireless_mode == WIRELESS_11ABGN)
|
||||
if (pregistrypriv->wireless_mode == WIRELESS_11ABGN)
|
||||
{
|
||||
if(pdev_network->Configuration.DSConfig > 14)
|
||||
if (pdev_network->Configuration.DSConfig > 14)
|
||||
wireless_mode = WIRELESS_11A_5N;
|
||||
else
|
||||
wireless_mode = WIRELESS_11BG_24N;
|
||||
|
@ -471,7 +471,7 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
|
|||
}
|
||||
|
||||
/* HT Cap. */
|
||||
if(((pregistrypriv->wireless_mode&WIRELESS_11_5N)||(pregistrypriv->wireless_mode&WIRELESS_11_24N))
|
||||
if (((pregistrypriv->wireless_mode&WIRELESS_11_5N)||(pregistrypriv->wireless_mode&WIRELESS_11_24N))
|
||||
&& (pregistrypriv->ht_enable==true))
|
||||
{
|
||||
/* todo: */
|
||||
|
@ -756,7 +756,7 @@ int rtw_get_sec_ie(u8 *in_ie,uint in_len,u8 *rsn_ie,u16 *rsn_len,u8 *wpa_ie,u16
|
|||
{
|
||||
authmode=in_ie[cnt];
|
||||
|
||||
if((authmode==_WPA_IE_ID_)&&(_rtw_memcmp(&in_ie[cnt+2], &wpa_oui[0],4)==true))
|
||||
if ((authmode==_WPA_IE_ID_)&&(_rtw_memcmp(&in_ie[cnt+2], &wpa_oui[0],4)==true))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n rtw_get_wpa_ie: sec_idx=%d in_ie[cnt+1]+2=%d\n",sec_idx,in_ie[cnt+1]+2));
|
||||
|
||||
|
@ -775,7 +775,7 @@ int rtw_get_sec_ie(u8 *in_ie,uint in_len,u8 *rsn_ie,u16 *rsn_len,u8 *wpa_ie,u16
|
|||
}
|
||||
else
|
||||
{
|
||||
if(authmode==_WPA2_IE_ID_)
|
||||
if (authmode==_WPA2_IE_ID_)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n get_rsn_ie: sec_idx=%d in_ie[cnt+1]+2=%d\n",sec_idx,in_ie[cnt+1]+2));
|
||||
|
||||
|
@ -811,11 +811,11 @@ u8 rtw_is_wps_ie(u8 *ie_ptr, uint *wps_ielen)
|
|||
u8 match = false;
|
||||
u8 eid, wps_oui[4]={0x0,0x50,0xf2,0x04};
|
||||
|
||||
if(ie_ptr == NULL) return match;
|
||||
if (ie_ptr == NULL) return match;
|
||||
|
||||
eid = ie_ptr[0];
|
||||
|
||||
if((eid==_WPA_IE_ID_)&&(_rtw_memcmp(&ie_ptr[2], wps_oui, 4)==true))
|
||||
if ((eid==_WPA_IE_ID_)&&(_rtw_memcmp(&ie_ptr[2], wps_oui, 4)==true))
|
||||
{
|
||||
/* DBG_8192C("==> found WPS_IE.....\n"); */
|
||||
*wps_ielen = ie_ptr[1]+2;
|
||||
|
@ -861,10 +861,10 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
|
|||
u8 *wpsie_ptr=NULL;
|
||||
u8 eid, wps_oui[4]={0x0,0x50,0xf2,0x04};
|
||||
|
||||
if(wps_ielen)
|
||||
if (wps_ielen)
|
||||
*wps_ielen = 0;
|
||||
|
||||
if(!in_ie || in_len<=0)
|
||||
if (!in_ie || in_len<=0)
|
||||
return wpsie_ptr;
|
||||
|
||||
cnt = 0;
|
||||
|
@ -873,14 +873,14 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
|
|||
{
|
||||
eid = in_ie[cnt];
|
||||
|
||||
if((eid==_WPA_IE_ID_)&&(_rtw_memcmp(&in_ie[cnt+2], wps_oui, 4)==true))
|
||||
if ((eid==_WPA_IE_ID_)&&(_rtw_memcmp(&in_ie[cnt+2], wps_oui, 4)==true))
|
||||
{
|
||||
wpsie_ptr = &in_ie[cnt];
|
||||
|
||||
if(wps_ie)
|
||||
if (wps_ie)
|
||||
memcpy(wps_ie, &in_ie[cnt], in_ie[cnt+1]+2);
|
||||
|
||||
if(wps_ielen)
|
||||
if (wps_ielen)
|
||||
*wps_ielen = in_ie[cnt+1]+2;
|
||||
|
||||
cnt+=in_ie[cnt+1]+2;
|
||||
|
@ -913,7 +913,7 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_att
|
|||
u8 * target_attr_ptr = NULL;
|
||||
u8 wps_oui[4]={0x00,0x50,0xF2,0x04};
|
||||
|
||||
if(len_attr)
|
||||
if (len_attr)
|
||||
*len_attr = 0;
|
||||
|
||||
if ( ( wps_ie[0] != _VENDOR_SPECIFIC_IE_ ) ||
|
||||
|
@ -933,14 +933,14 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_att
|
|||
u16 attr_len = attr_data_len + 4;
|
||||
|
||||
/* DBG_871X("%s attr_ptr:%p, id:%u, length:%u\n", __FUNCTION__, attr_ptr, attr_id, attr_data_len); */
|
||||
if( attr_id == target_attr_id )
|
||||
if ( attr_id == target_attr_id )
|
||||
{
|
||||
target_attr_ptr = attr_ptr;
|
||||
|
||||
if(buf_attr)
|
||||
if (buf_attr)
|
||||
memcpy(buf_attr, attr_ptr, attr_len);
|
||||
|
||||
if(len_attr)
|
||||
if (len_attr)
|
||||
*len_attr = attr_len;
|
||||
|
||||
break;
|
||||
|
@ -970,17 +970,17 @@ u8 *rtw_get_wps_attr_content(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8
|
|||
u8 *attr_ptr;
|
||||
u32 attr_len;
|
||||
|
||||
if(len_content)
|
||||
if (len_content)
|
||||
*len_content = 0;
|
||||
|
||||
attr_ptr = rtw_get_wps_attr(wps_ie, wps_ielen, target_attr_id, NULL, &attr_len);
|
||||
|
||||
if(attr_ptr && attr_len)
|
||||
if (attr_ptr && attr_len)
|
||||
{
|
||||
if(buf_content)
|
||||
if (buf_content)
|
||||
memcpy(buf_content, attr_ptr+4, attr_len-4);
|
||||
|
||||
if(len_content)
|
||||
if (len_content)
|
||||
*len_content = attr_len-4;
|
||||
|
||||
return attr_ptr+4;
|
||||
|
@ -1224,7 +1224,7 @@ enum ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
|
|||
static u8 key_char2num(u8 ch);
|
||||
static u8 key_char2num(u8 ch)
|
||||
{
|
||||
if((ch>='0')&&(ch<='9'))
|
||||
if ((ch>='0')&&(ch<='9'))
|
||||
return ch - '0';
|
||||
else if ((ch>='a')&&(ch<='f'))
|
||||
return ch - 'a' + 10;
|
||||
|
@ -1254,7 +1254,7 @@ u8 convert_ip_addr(u8 hch, u8 mch, u8 lch)
|
|||
void rtw_macaddr_cfg(u8 *mac_addr)
|
||||
{
|
||||
u8 mac[ETH_ALEN];
|
||||
if(mac_addr == NULL) return;
|
||||
if (mac_addr == NULL) return;
|
||||
|
||||
if ( rtw_initmac )
|
||||
{ /* Users specify the mac address */
|
||||
|
@ -1322,7 +1322,7 @@ void dump_wps_ie(u8 *ie, u32 ie_len)
|
|||
uint wps_ielen;
|
||||
|
||||
wps_ie = rtw_get_wps_ie(ie, ie_len, NULL, &wps_ielen);
|
||||
if(wps_ie != ie || wps_ielen == 0)
|
||||
if (wps_ie != ie || wps_ielen == 0)
|
||||
return;
|
||||
|
||||
pos+=6;
|
||||
|
@ -1354,7 +1354,7 @@ u32 rtw_get_p2p_merged_ies_len(u8 *in_ie, u32 in_len)
|
|||
{
|
||||
pIE = (struct ndis_802_11_variable_ies *)(in_ie+ i);
|
||||
|
||||
if( pIE->ElementID == _VENDOR_SPECIFIC_IE_ && _rtw_memcmp(pIE->data, OUI, 4) )
|
||||
if ( pIE->ElementID == _VENDOR_SPECIFIC_IE_ && _rtw_memcmp(pIE->data, OUI, 4) )
|
||||
{
|
||||
len += pIE->Length-4; /* 4 is P2P OUI length, don't count it in this loop */
|
||||
}
|
||||
|
@ -1380,7 +1380,7 @@ int rtw_p2p_merge_ies(u8 *in_ie, u32 in_len, u8 *merge_ie)
|
|||
u8 ELOUI[6] = { 0xDD, 0x00, 0x50, 0x6f, 0x9a, 0x09 }; /* EID;Len;OUI, Len would copy at the end of function */
|
||||
int i=0;
|
||||
|
||||
if( merge_ie != NULL)
|
||||
if ( merge_ie != NULL)
|
||||
{
|
||||
/* Set first P2P OUI */
|
||||
memcpy(merge_ie, ELOUI, 6);
|
||||
|
@ -1391,7 +1391,7 @@ int rtw_p2p_merge_ies(u8 *in_ie, u32 in_len, u8 *merge_ie)
|
|||
pIE = (struct ndis_802_11_variable_ies *)(in_ie+ i);
|
||||
|
||||
/* Take out the rest of P2P OUIs */
|
||||
if( pIE->ElementID == _VENDOR_SPECIFIC_IE_ && _rtw_memcmp(pIE->data, OUI, 4) )
|
||||
if ( pIE->ElementID == _VENDOR_SPECIFIC_IE_ && _rtw_memcmp(pIE->data, OUI, 4) )
|
||||
{
|
||||
memcpy( merge_ie, pIE->data +4, pIE->Length -4);
|
||||
len += pIE->Length-4;
|
||||
|
@ -1417,7 +1417,7 @@ void dump_p2p_ie(u8 *ie, u32 ie_len) {
|
|||
uint p2p_ielen;
|
||||
|
||||
p2p_ie = rtw_get_p2p_ie(ie, ie_len, NULL, &p2p_ielen);
|
||||
if(p2p_ie != ie || p2p_ielen == 0)
|
||||
if (p2p_ie != ie || p2p_ielen == 0)
|
||||
return;
|
||||
|
||||
pos+=6;
|
||||
|
@ -1478,7 +1478,7 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
|
|||
dump_stack();
|
||||
return NULL;
|
||||
}
|
||||
if( ( eid == _VENDOR_SPECIFIC_IE_ ) && ( _rtw_memcmp( &in_ie[cnt+2], p2p_oui, 4) == true ) )
|
||||
if ( ( eid == _VENDOR_SPECIFIC_IE_ ) && ( _rtw_memcmp( &in_ie[cnt+2], p2p_oui, 4) == true ) )
|
||||
{
|
||||
p2p_ie_ptr = in_ie + cnt;
|
||||
|
||||
|
@ -1523,7 +1523,7 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *buf_attr
|
|||
u8 *target_attr_ptr = NULL;
|
||||
u8 p2p_oui[4]={0x50,0x6F,0x9A,0x09};
|
||||
|
||||
if(len_attr)
|
||||
if (len_attr)
|
||||
*len_attr = 0;
|
||||
|
||||
if ( !p2p_ie || ( p2p_ie[0] != _VENDOR_SPECIFIC_IE_ ) ||
|
||||
|
@ -1543,14 +1543,14 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *buf_attr
|
|||
u16 attr_len = attr_data_len + 3;
|
||||
|
||||
/* DBG_871X("%s attr_ptr:%p, id:%u, length:%u\n", __FUNCTION__, attr_ptr, attr_id, attr_data_len); */
|
||||
if( attr_id == target_attr_id )
|
||||
if ( attr_id == target_attr_id )
|
||||
{
|
||||
target_attr_ptr = attr_ptr;
|
||||
|
||||
if(buf_attr)
|
||||
if (buf_attr)
|
||||
memcpy(buf_attr, attr_ptr, attr_len);
|
||||
|
||||
if(len_attr)
|
||||
if (len_attr)
|
||||
*len_attr = attr_len;
|
||||
|
||||
break;
|
||||
|
@ -1580,17 +1580,17 @@ u8 *rtw_get_p2p_attr_content(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *
|
|||
u8 *attr_ptr;
|
||||
u32 attr_len;
|
||||
|
||||
if(len_content)
|
||||
if (len_content)
|
||||
*len_content = 0;
|
||||
|
||||
attr_ptr = rtw_get_p2p_attr(p2p_ie, p2p_ielen, target_attr_id, NULL, &attr_len);
|
||||
|
||||
if(attr_ptr && attr_len)
|
||||
if (attr_ptr && attr_len)
|
||||
{
|
||||
if(buf_content)
|
||||
if (buf_content)
|
||||
memcpy(buf_content, attr_ptr+3, attr_len-3);
|
||||
|
||||
if(len_content)
|
||||
if (len_content)
|
||||
*len_content = attr_len-3;
|
||||
|
||||
return attr_ptr+3;
|
||||
|
@ -1608,7 +1608,7 @@ u32 rtw_set_p2p_attr_content(u8 *pbuf, u8 attr_id, u16 attr_len, u8 *pdata_attr)
|
|||
/* u16*)(pbuf + 1) = cpu_to_le16(attr_len); */
|
||||
RTW_PUT_LE16(pbuf + 1, attr_len);
|
||||
|
||||
if(pdata_attr)
|
||||
if (pdata_attr)
|
||||
memcpy(pbuf + 3, pdata_attr, attr_len);
|
||||
|
||||
a_len = attr_len + 3;
|
||||
|
@ -1625,7 +1625,7 @@ static uint rtw_p2p_attr_remove(u8 *ie, uint ielen_ori, u8 attr_id)
|
|||
|
||||
while(1) {
|
||||
target_attr=rtw_get_p2p_attr(ie, ielen, attr_id, NULL, &target_attr_len);
|
||||
if(target_attr && target_attr_len)
|
||||
if (target_attr && target_attr_len)
|
||||
{
|
||||
u8 *next_attr = target_attr+target_attr_len;
|
||||
uint remain_len = ielen-(next_attr-ie);
|
||||
|
@ -1651,10 +1651,10 @@ void rtw_wlan_bssid_ex_remove_p2p_attr(struct wlan_bssid_ex *bss_ex, u8 attr_id)
|
|||
uint p2p_ielen, p2p_ielen_ori;
|
||||
int cnt;
|
||||
|
||||
if( (p2p_ie=rtw_get_p2p_ie(bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_, NULL, &p2p_ielen_ori)) )
|
||||
if ( (p2p_ie=rtw_get_p2p_ie(bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_, NULL, &p2p_ielen_ori)) )
|
||||
{
|
||||
p2p_ielen=rtw_p2p_attr_remove(p2p_ie, p2p_ielen_ori, attr_id);
|
||||
if(p2p_ielen != p2p_ielen_ori) {
|
||||
if (p2p_ielen != p2p_ielen_ori) {
|
||||
|
||||
u8 *next_ie_ori = p2p_ie+p2p_ielen_ori;
|
||||
u8 *next_ie = p2p_ie+p2p_ielen;
|
||||
|
@ -1679,7 +1679,7 @@ void dump_wfd_ie(u8 *ie, u32 ie_len)
|
|||
u8 *wfd_ie;
|
||||
uint wfd_ielen;
|
||||
|
||||
if(rtw_get_wfd_ie(ie, ie_len, NULL, &wfd_ielen) == false)
|
||||
if (rtw_get_wfd_ie(ie, ie_len, NULL, &wfd_ielen) == false)
|
||||
return;
|
||||
|
||||
pos+=6;
|
||||
|
@ -1711,7 +1711,7 @@ int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
|
|||
{
|
||||
eid = in_ie[cnt];
|
||||
|
||||
if( ( eid == _VENDOR_SPECIFIC_IE_ ) && ( _rtw_memcmp( &in_ie[cnt+2], wfd_oui, 4) == true ) )
|
||||
if ( ( eid == _VENDOR_SPECIFIC_IE_ ) && ( _rtw_memcmp( &in_ie[cnt+2], wfd_oui, 4) == true ) )
|
||||
{
|
||||
if ( wfd_ie != NULL )
|
||||
{
|
||||
|
@ -1800,13 +1800,13 @@ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *
|
|||
u16 attrlen = RTW_GET_BE16(wfd_ie + cnt + 1);
|
||||
|
||||
attr_id = wfd_ie[cnt];
|
||||
if( attr_id == target_attr_id )
|
||||
if ( attr_id == target_attr_id )
|
||||
{
|
||||
/* 3 -> 1 byte for attribute ID field, 2 bytes for length field */
|
||||
if(attr_content)
|
||||
if (attr_content)
|
||||
memcpy( attr_content, &wfd_ie[ cnt + 3 ], attrlen );
|
||||
|
||||
if(attr_contentlen)
|
||||
if (attr_contentlen)
|
||||
*attr_contentlen = attrlen;
|
||||
|
||||
cnt += attrlen + 3;
|
||||
|
@ -1878,7 +1878,7 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork)
|
|||
int ret = _FAIL;
|
||||
pbuf = rtw_get_wpa_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength-12);
|
||||
|
||||
if(pbuf && (wpa_ielen>0)) {
|
||||
if (pbuf && (wpa_ielen>0)) {
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_get_cipher_info: wpa_ielen: %d", wpa_ielen));
|
||||
if (_SUCCESS == rtw_parse_wpa_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is8021x)) {
|
||||
|
||||
|
@ -1893,7 +1893,7 @@ static int rtw_get_cipher_info(struct wlan_network *pnetwork)
|
|||
|
||||
pbuf = rtw_get_wpa2_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength-12);
|
||||
|
||||
if(pbuf && (wpa_ielen>0)) {
|
||||
if (pbuf && (wpa_ielen>0)) {
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("get RSN IE\n"));
|
||||
if (_SUCCESS == rtw_parse_wpa2_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is8021x)) {
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("get RSN IE OK!!!\n"));
|
||||
|
@ -1954,7 +1954,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
|
|||
/* get bwmode and ch_offset */
|
||||
/* parsing HT_CAP_IE */
|
||||
p = rtw_get_ie(pnetwork->network.IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pnetwork->network.IELength - _FIXED_IE_LENGTH_);
|
||||
if(p && len>0) {
|
||||
if (p && len>0) {
|
||||
pht_cap = (struct ieee80211_ht_cap *)(p + 2);
|
||||
pnetwork->BcnInfo.ht_cap_info = le16_to_cpu(pht_cap->cap_info);
|
||||
} else {
|
||||
|
@ -1962,7 +1962,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
|
|||
}
|
||||
/* parsing HT_INFO_IE */
|
||||
p = rtw_get_ie(pnetwork->network.IEs + _FIXED_IE_LENGTH_, _HT_ADD_INFO_IE_, &len, pnetwork->network.IELength - _FIXED_IE_LENGTH_);
|
||||
if(p && len>0) {
|
||||
if (p && len>0) {
|
||||
pht_info = (struct HT_info_element *)(p + 2);
|
||||
pnetwork->BcnInfo.ht_info_infos_0 = pht_info->infos[0];
|
||||
} else {
|
||||
|
@ -1975,63 +1975,63 @@ u16 rtw_mcs_rate(u8 rf_type, u8 bw_40MHz, u8 short_GI_20, u8 short_GI_40, unsign
|
|||
{
|
||||
u16 max_rate = 0;
|
||||
|
||||
if(rf_type == RF_1T1R)
|
||||
if (rf_type == RF_1T1R)
|
||||
{
|
||||
if(MCS_rate[0] & BIT(7))
|
||||
if (MCS_rate[0] & BIT(7))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?1500:1350):((short_GI_20)?722:650);
|
||||
else if(MCS_rate[0] & BIT(6))
|
||||
else if (MCS_rate[0] & BIT(6))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?1350:1215):((short_GI_20)?650:585);
|
||||
else if(MCS_rate[0] & BIT(5))
|
||||
else if (MCS_rate[0] & BIT(5))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?1200:1080):((short_GI_20)?578:520);
|
||||
else if(MCS_rate[0] & BIT(4))
|
||||
else if (MCS_rate[0] & BIT(4))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?900:810):((short_GI_20)?433:390);
|
||||
else if(MCS_rate[0] & BIT(3))
|
||||
else if (MCS_rate[0] & BIT(3))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?600:540):((short_GI_20)?289:260);
|
||||
else if(MCS_rate[0] & BIT(2))
|
||||
else if (MCS_rate[0] & BIT(2))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?450:405):((short_GI_20)?217:195);
|
||||
else if(MCS_rate[0] & BIT(1))
|
||||
else if (MCS_rate[0] & BIT(1))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?300:270):((short_GI_20)?144:130);
|
||||
else if(MCS_rate[0] & BIT(0))
|
||||
else if (MCS_rate[0] & BIT(0))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?150:135):((short_GI_20)?72:65);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(MCS_rate[1])
|
||||
if (MCS_rate[1])
|
||||
{
|
||||
if(MCS_rate[1] & BIT(7))
|
||||
if (MCS_rate[1] & BIT(7))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?3000:2700):((short_GI_20)?1444:1300);
|
||||
else if(MCS_rate[1] & BIT(6))
|
||||
else if (MCS_rate[1] & BIT(6))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?2700:2430):((short_GI_20)?1300:1170);
|
||||
else if(MCS_rate[1] & BIT(5))
|
||||
else if (MCS_rate[1] & BIT(5))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?2400:2160):((short_GI_20)?1156:1040);
|
||||
else if(MCS_rate[1] & BIT(4))
|
||||
else if (MCS_rate[1] & BIT(4))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?1800:1620):((short_GI_20)?867:780);
|
||||
else if(MCS_rate[1] & BIT(3))
|
||||
else if (MCS_rate[1] & BIT(3))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?1200:1080):((short_GI_20)?578:520);
|
||||
else if(MCS_rate[1] & BIT(2))
|
||||
else if (MCS_rate[1] & BIT(2))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?900:810):((short_GI_20)?433:390);
|
||||
else if(MCS_rate[1] & BIT(1))
|
||||
else if (MCS_rate[1] & BIT(1))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?600:540):((short_GI_20)?289:260);
|
||||
else if(MCS_rate[1] & BIT(0))
|
||||
else if (MCS_rate[1] & BIT(0))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?300:270):((short_GI_20)?144:130);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(MCS_rate[0] & BIT(7))
|
||||
if (MCS_rate[0] & BIT(7))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?1500:1350):((short_GI_20)?722:650);
|
||||
else if(MCS_rate[0] & BIT(6))
|
||||
else if (MCS_rate[0] & BIT(6))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?1350:1215):((short_GI_20)?650:585);
|
||||
else if(MCS_rate[0] & BIT(5))
|
||||
else if (MCS_rate[0] & BIT(5))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?1200:1080):((short_GI_20)?578:520);
|
||||
else if(MCS_rate[0] & BIT(4))
|
||||
else if (MCS_rate[0] & BIT(4))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?900:810):((short_GI_20)?433:390);
|
||||
else if(MCS_rate[0] & BIT(3))
|
||||
else if (MCS_rate[0] & BIT(3))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?600:540):((short_GI_20)?289:260);
|
||||
else if(MCS_rate[0] & BIT(2))
|
||||
else if (MCS_rate[0] & BIT(2))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?450:405):((short_GI_20)?217:195);
|
||||
else if(MCS_rate[0] & BIT(1))
|
||||
else if (MCS_rate[0] & BIT(1))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?300:270):((short_GI_20)?144:130);
|
||||
else if(MCS_rate[0] & BIT(0))
|
||||
else if (MCS_rate[0] & BIT(0))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?150:135):((short_GI_20)?72:65);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue