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:
Larry Finger 2013-05-08 23:04:25 -05:00
parent 124abebb96
commit a55f866a62
105 changed files with 6893 additions and 6893 deletions

View file

@ -94,8 +94,8 @@ static void update_BCNTIM(_adapter *padapter)
//DBG_871X("%s\n", __FUNCTION__);
//update TIM IE
//if(pstapriv->tim_bitmap)
if(_TRUE)
//if (pstapriv->tim_bitmap)
if (_TRUE)
{
u8 *p, *dst_ie, *premainder_ie=NULL, *pbackup_remainder_ie=NULL;
u16 tim_bitmap_le;
@ -145,10 +145,10 @@ static void update_BCNTIM(_adapter *padapter)
}
if(remainder_ielen>0)
if (remainder_ielen>0)
{
pbackup_remainder_ie = rtw_malloc(remainder_ielen);
if(pbackup_remainder_ie && premainder_ie)
if (pbackup_remainder_ie && premainder_ie)
_rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
}
@ -156,7 +156,7 @@ static void update_BCNTIM(_adapter *padapter)
*dst_ie++=_TIM_IE_;
if((pstapriv->tim_bitmap&0xff00) && (pstapriv->tim_bitmap&0x00fc))
if ((pstapriv->tim_bitmap&0xff00) && (pstapriv->tim_bitmap&0x00fc))
tim_ielen = 5;
else
tim_ielen = 4;
@ -166,23 +166,23 @@ static void update_BCNTIM(_adapter *padapter)
*dst_ie++=0;//DTIM count
*dst_ie++=1;//DTIM peroid
if(pstapriv->tim_bitmap&BIT(0))//for bc/mc frames
if (pstapriv->tim_bitmap&BIT(0))//for bc/mc frames
*dst_ie++ = BIT(0);//bitmap ctrl
else
*dst_ie++ = 0;
if(tim_ielen==4)
if (tim_ielen==4)
{
*dst_ie++ = *(u8*)&tim_bitmap_le;
}
else if(tim_ielen==5)
else if (tim_ielen==5)
{
_rtw_memcpy(dst_ie, &tim_bitmap_le, 2);
dst_ie+=2;
}
//copy remainder IE
if(pbackup_remainder_ie)
if (pbackup_remainder_ie)
{
_rtw_memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
@ -219,7 +219,7 @@ void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *d
{
break;
}
else if(pIE->ElementID == index) // already exist the same IE
else if (pIE->ElementID == index) // already exist the same IE
{
p = (u8 *)pIE;
ielen = pIE->Length;
@ -242,16 +242,16 @@ void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *d
remainder_ielen = pnetwork->IELength - ie_offset - ielen;
if(bmatch)
if (bmatch)
dst_ie = p;
else
dst_ie = (p+ielen);
}
if(remainder_ielen>0)
if (remainder_ielen>0)
{
pbackup_remainder_ie = rtw_malloc(remainder_ielen);
if(pbackup_remainder_ie && premainder_ie)
if (pbackup_remainder_ie && premainder_ie)
_rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
}
@ -262,7 +262,7 @@ void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *d
dst_ie+=len;
//copy remainder IE
if(pbackup_remainder_ie)
if (pbackup_remainder_ie)
{
_rtw_memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
@ -293,15 +293,15 @@ void rtw_remove_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index)
dst_ie = p;
}
if(remainder_ielen>0)
if (remainder_ielen>0)
{
pbackup_remainder_ie = rtw_malloc(remainder_ielen);
if(pbackup_remainder_ie && premainder_ie)
if (pbackup_remainder_ie && premainder_ie)
_rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
}
//copy remainder IE
if(pbackup_remainder_ie)
if (pbackup_remainder_ie)
{
_rtw_memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
@ -330,11 +330,11 @@ u8 chk_sta_is_alive(struct sta_info *psta)
);
#endif
//if(sta_last_rx_pkts(psta) == sta_rx_pkts(psta))
if((psta->sta_stats.last_rx_data_pkts + psta->sta_stats.last_rx_ctrl_pkts) == (psta->sta_stats.rx_data_pkts + psta->sta_stats.rx_ctrl_pkts))
//if (sta_last_rx_pkts(psta) == sta_rx_pkts(psta))
if ((psta->sta_stats.last_rx_data_pkts + psta->sta_stats.last_rx_ctrl_pkts) == (psta->sta_stats.rx_data_pkts + psta->sta_stats.rx_ctrl_pkts))
{
#if 0
if(psta->state&WIFI_SLEEP_STATE)
if (psta->state&WIFI_SLEEP_STATE)
ret = _TRUE;
#endif
}
@ -376,7 +376,7 @@ void expire_timeout_chk(_adapter *padapter)
psta = LIST_CONTAINOR(plist, struct sta_info, auth_list);
plist = get_next(plist);
if(psta->expire_to>0)
if (psta->expire_to>0)
{
psta->expire_to--;
if (psta->expire_to == 0)
@ -479,7 +479,7 @@ void expire_timeout_chk(_adapter *padapter)
pstapriv->tim_bitmap |= BIT(psta->aid);
update_beacon(padapter, _TIM_IE_, NULL, _FALSE);
if(!pmlmeext->active_keep_alive_check)
if (!pmlmeext->active_keep_alive_check)
continue;
}
}
@ -588,13 +588,13 @@ void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level)
WLAN_BSSID_EX *pcur_network = (WLAN_BSSID_EX *)&pmlmepriv->cur_network.network;
#ifdef CONFIG_80211N_HT
if(psta)
if (psta)
psta_ht = &psta->htpriv;
else
return;
#endif //CONFIG_80211N_HT
if(!(psta->state & _FW_LINKED))
if (!(psta->state & _FW_LINKED))
return;
//b/g mode ra_bitmap
@ -605,10 +605,10 @@ void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level)
}
#ifdef CONFIG_80211N_HT
//n mode ra_bitmap
if(psta_ht->ht_option)
if (psta_ht->ht_option)
{
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
if(rf_type == RF_2T2R)
if (rf_type == RF_2T2R)
limit=16;// 2R
else
limit=8;// 1R
@ -624,13 +624,13 @@ void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level)
#endif //CONFIG_80211N_HT
#if 0//gtest
if(get_rf_mimo_mode(padapter) == RTL8712_RF_2T2R)
if (get_rf_mimo_mode(padapter) == RTL8712_RF_2T2R)
{
//is this a 2r STA?
if((pstat->tx_ra_bitmap & 0x0ff00000) != 0 && !(priv->pshare->has_2r_sta & BIT(pstat->aid)))
if ((pstat->tx_ra_bitmap & 0x0ff00000) != 0 && !(priv->pshare->has_2r_sta & BIT(pstat->aid)))
{
priv->pshare->has_2r_sta |= BIT(pstat->aid);
if(rtw_read16(padapter, 0x102501f6) != 0xffff)
if (rtw_read16(padapter, 0x102501f6) != 0xffff)
{
rtw_write16(padapter, 0x102501f6, 0xffff);
reset_1r_sta_RA(priv, 0xffff);
@ -639,9 +639,9 @@ void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level)
}
else// bg or 1R STA?
{
if((priv->pmib->dot11BssType.net_work_type & WIRELESS_11N) && pstat->ht_cap_len && priv->pshare->has_2r_sta == 0)
if ((priv->pmib->dot11BssType.net_work_type & WIRELESS_11N) && pstat->ht_cap_len && priv->pshare->has_2r_sta == 0)
{
if(rtw_read16(padapter, 0x102501f6) != 0x7777)
if (rtw_read16(padapter, 0x102501f6) != 0x7777)
{ // MCS7 SGI
rtw_write16(padapter, 0x102501f6,0x7777);
reset_1r_sta_RA(priv, 0x7777);
@ -811,7 +811,7 @@ static void update_bmc_sta(_adapter *padapter)
WLAN_BSSID_EX *pcur_network = (WLAN_BSSID_EX *)&pmlmepriv->cur_network.network;
struct sta_info *psta = rtw_get_bcmc_stainfo(padapter);
if(psta)
if (psta)
{
psta->aid = 0;//default set to 0
//psta->mac_id = psta->aid+4;
@ -863,7 +863,7 @@ static void update_bmc_sta(_adapter *padapter)
//ap mode
rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, _TRUE);
//if(pHalData->fw_ractrl == _TRUE)
//if (pHalData->fw_ractrl == _TRUE)
{
u8 arg = 0;
@ -931,7 +931,7 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta)
//ap mode
rtw_hal_set_odm_var(padapter,HAL_ODM_STA_INFO,psta,_TRUE);
if(psecuritypriv->dot11AuthAlgrthm==dot11AuthAlgrthm_8021X)
if (psecuritypriv->dot11AuthAlgrthm==dot11AuthAlgrthm_8021X)
psta->ieee8021x_blocked = _TRUE;
else
psta->ieee8021x_blocked = _FALSE;
@ -943,19 +943,19 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta)
VCS_update(padapter, psta);
#ifdef CONFIG_80211N_HT
//HT related cap
if(phtpriv_sta->ht_option)
if (phtpriv_sta->ht_option)
{
//check if sta supports rx ampdu
phtpriv_sta->ampdu_enable = phtpriv_ap->ampdu_enable;
//check if sta support s Short GI
if((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SGI_20|IEEE80211_HT_CAP_SGI_40))
if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SGI_20|IEEE80211_HT_CAP_SGI_40))
{
phtpriv_sta->sgi = _TRUE;
}
// bwmode
if((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH))
if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH))
{
//phtpriv_sta->bwmode = HT_CHANNEL_WIDTH_40;
phtpriv_sta->bwmode = pmlmeext->cur_bwmode;
@ -1028,7 +1028,7 @@ static void update_hw_ht_param(_adapter *padapter)
// Config SM Power Save setting
//
pmlmeinfo->SM_PS = (pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info & 0x0C) >> 2;
if(pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC)
if (pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC)
{
/*u8 i;
//update the MCS rates
@ -1076,7 +1076,7 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
//check if there is wps ie,
//if there is wpsie in beacon, the hostapd will update beacon twice when stating hostapd,
//and at first time the security ie ( RSN/WPA IE) will not include in beacon.
if(NULL == rtw_get_wps_ie(pnetwork->IEs+_FIXED_IE_LENGTH_, pnetwork->IELength-_FIXED_IE_LENGTH_, NULL, NULL))
if (NULL == rtw_get_wps_ie(pnetwork->IEs+_FIXED_IE_LENGTH_, pnetwork->IELength-_FIXED_IE_LENGTH_, NULL, NULL))
{
pmlmeext->bstart_bss = _TRUE;
}
@ -1084,10 +1084,10 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
//todo: update wmm, ht cap
//pmlmeinfo->WMM_enable;
//pmlmeinfo->HT_enable;
if(pmlmepriv->qospriv.qos_option)
if (pmlmepriv->qospriv.qos_option)
pmlmeinfo->WMM_enable = _TRUE;
#ifdef CONFIG_80211N_HT
if(pmlmepriv->htpriv.ht_option)
if (pmlmepriv->htpriv.ht_option)
{
pmlmeinfo->WMM_enable = _TRUE;
pmlmeinfo->HT_enable = _TRUE;
@ -1099,7 +1099,7 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
#endif //#CONFIG_80211N_HT
if(pmlmepriv->cur_network.join_res != _TRUE) //setting only at first time
if (pmlmepriv->cur_network.join_res != _TRUE) //setting only at first time
{
//WEP Key will be set before this function, do not clear CAM.
if ((psecuritypriv->dot11PrivacyAlgrthm != _WEP40_) && (psecuritypriv->dot11PrivacyAlgrthm != _WEP104_))
@ -1138,7 +1138,7 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
UpdateBrateTbl(padapter, pnetwork->SupportedRates);
rtw_hal_set_hwreg(padapter, HW_VAR_BASIC_RATE, pnetwork->SupportedRates);
if(pmlmepriv->cur_network.join_res != _TRUE) //setting only at first time
if (pmlmepriv->cur_network.join_res != _TRUE) //setting only at first time
{
//u32 initialgain;
@ -1150,9 +1150,9 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
//Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE);
#ifdef CONFIG_CONCURRENT_MODE
if(padapter->adapter_type > PRIMARY_ADAPTER)
if (padapter->adapter_type > PRIMARY_ADAPTER)
{
if(rtw_buddy_adapter_up(padapter))
if (rtw_buddy_adapter_up(padapter))
{
_adapter *pbuddy_adapter = padapter->pbuddy_adapter;
@ -1175,7 +1175,7 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
#ifdef CONFIG_80211N_HT
//set channel, bwmode
p = rtw_get_ie((pnetwork->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _HT_ADD_INFO_IE_, &ie_len, (pnetwork->IELength - sizeof(NDIS_802_11_FIXED_IEs)));
if( p && ie_len)
if ( p && ie_len)
{
pht_info = (struct HT_info_element *)(p+2);
@ -1212,11 +1212,11 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
//TODO: need to judge the phy parameters on concurrent mode for single phy
//set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode);
#ifdef CONFIG_CONCURRENT_MODE
if(!check_buddy_fwstate(padapter, _FW_LINKED|_FW_UNDER_LINKING|_FW_UNDER_SURVEY))
if (!check_buddy_fwstate(padapter, _FW_LINKED|_FW_UNDER_LINKING|_FW_UNDER_SURVEY))
{
set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode);
}
else if(check_buddy_fwstate(padapter, _FW_LINKED)==_TRUE)//only second adapter can enter AP Mode
else if (check_buddy_fwstate(padapter, _FW_LINKED)==_TRUE)//only second adapter can enter AP Mode
{
_adapter *pbuddy_adapter = padapter->pbuddy_adapter;
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
@ -1227,19 +1227,19 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
DBG_871X("second adapter, CH=%d, BW=%d, offset=%d\n", cur_channel, cur_bwmode, cur_ch_offset);
cur_channel = pbuddy_mlmeext->cur_channel;
if(cur_bwmode == HT_CHANNEL_WIDTH_40)
if (cur_bwmode == HT_CHANNEL_WIDTH_40)
{
if(pht_info)
if (pht_info)
pht_info->infos[0] &= ~(BIT(0)|BIT(1));
if(pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40)
if (pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40)
{
cur_ch_offset = pbuddy_mlmeext->cur_ch_offset;
//to update cur_ch_offset value in beacon
if(pht_info)
if (pht_info)
{
switch(cur_ch_offset)
switch (cur_ch_offset)
{
case HAL_PRIME_CHNL_OFFSET_LOWER:
pht_info->infos[0] |= 0x1;
@ -1254,23 +1254,23 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
}
}
else if(pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_20)
else if (pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_20)
{
cur_bwmode = HT_CHANNEL_WIDTH_20;
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
if(cur_channel>0 && cur_channel<5)
if (cur_channel>0 && cur_channel<5)
{
if(pht_info)
if (pht_info)
pht_info->infos[0] |= 0x1;
cur_bwmode = HT_CHANNEL_WIDTH_40;
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
}
if(cur_channel>7 && cur_channel<(14+1))
if (cur_channel>7 && cur_channel<(14+1))
{
if(pht_info)
if (pht_info)
pht_info->infos[0] |= 0x3;
cur_bwmode = HT_CHANNEL_WIDTH_40;
@ -1285,10 +1285,10 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
// to update channel value in beacon
pnetwork->Configuration.DSConfig = cur_channel;
p = rtw_get_ie((pnetwork->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _DSSET_IE_, &ie_len, (pnetwork->IELength - sizeof(NDIS_802_11_FIXED_IEs)));
if(p && ie_len>0)
if (p && ie_len>0)
*(p + 2) = cur_channel;
if(pht_info)
if (pht_info)
pht_info->primary_channel = cur_channel;
}
#else
@ -1318,14 +1318,14 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
pwdinfo->p2p_group_ssid_len = pnetwork->Ssid.SsidLength;
#endif //CONFIG_P2P
if(_TRUE == pmlmeext->bstart_bss)
if (_TRUE == pmlmeext->bstart_bss)
{
update_beacon(padapter, _TIM_IE_, NULL, _FALSE);
#ifndef CONFIG_INTERRUPT_BASED_TXBCN //other case will tx beacon when bcn interrupt coming in.
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
//issue beacon frame
if(send_beacon(padapter)==_FAIL)
if (send_beacon(padapter)==_FAIL)
{
DBG_871X("issue_beacon, fail!\n");
}
@ -1378,11 +1378,11 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
DBG_871X("%s, len=%d\n", __FUNCTION__, len);
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) != _TRUE)
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != _TRUE)
return _FAIL;
if(len>MAX_IE_SZ)
if (len>MAX_IE_SZ)
return _FAIL;
pbss_network->IELength = len;
@ -1392,7 +1392,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
_rtw_memcpy(ie, pbuf, pbss_network->IELength);
if(pbss_network->InfrastructureMode!=Ndis802_11APMode)
if (pbss_network->InfrastructureMode!=Ndis802_11APMode)
return _FAIL;
pbss_network->Rssi = 0;
@ -1411,7 +1411,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
//SSID
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SSID_IE_, &ie_len, (pbss_network->IELength -_BEACON_IE_OFFSET_));
if(p && ie_len>0)
if (p && ie_len>0)
{
_rtw_memset(&pbss_network->Ssid, 0, sizeof(NDIS_802_11_SSID));
_rtw_memcpy(pbss_network->Ssid.Ssid, (p + 2), ie_len);
@ -1422,7 +1422,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
channel = 0;
pbss_network->Configuration.Length = 0;
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _DSSET_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
if(p && ie_len>0)
if (p && ie_len>0)
channel = *(p + 2);
pbss_network->Configuration.DSConfig = channel;
@ -1453,7 +1453,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
//parsing ERP_IE
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _ERPINFO_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
if(p && ie_len>0)
if (p && ie_len>0)
{
ERP_IE_handler(padapter, (PNDIS_802_11_VARIABLE_IEs)p);
}
@ -1471,9 +1471,9 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
psecuritypriv->wpa2_group_cipher = _NO_PRIVACY_;
psecuritypriv->wpa2_pairwise_cipher = _NO_PRIVACY_;
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _RSN_IE_2_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
if(p && ie_len>0)
if (p && ie_len>0)
{
if(rtw_parse_wpa2_ie(p, ie_len+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS)
if (rtw_parse_wpa2_ie(p, ie_len+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS)
{
psecuritypriv->dot11AuthAlgrthm= dot11AuthAlgrthm_8021X;
@ -1483,7 +1483,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
psecuritypriv->wpa2_group_cipher = group_cipher;
psecuritypriv->wpa2_pairwise_cipher = pairwise_cipher;
#if 0
switch(group_cipher)
switch (group_cipher)
{
case WPA_CIPHER_NONE:
psecuritypriv->wpa2_group_cipher = _NO_PRIVACY_;
@ -1502,7 +1502,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
break;
}
switch(pairwise_cipher)
switch (pairwise_cipher)
{
case WPA_CIPHER_NONE:
psecuritypriv->wpa2_pairwise_cipher = _NO_PRIVACY_;
@ -1535,7 +1535,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
p = rtw_get_ie(p, _SSN_IE_1_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2)));
if ((p) && (_rtw_memcmp(p+2, OUI1, 4)))
{
if(rtw_parse_wpa_ie(p, ie_len+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS)
if (rtw_parse_wpa_ie(p, ie_len+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS)
{
psecuritypriv->dot11AuthAlgrthm= dot11AuthAlgrthm_8021X;
@ -1547,7 +1547,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
psecuritypriv->wpa_pairwise_cipher = pairwise_cipher;
#if 0
switch(group_cipher)
switch (group_cipher)
{
case WPA_CIPHER_NONE:
psecuritypriv->wpa_group_cipher = _NO_PRIVACY_;
@ -1566,7 +1566,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
break;
}
switch(pairwise_cipher)
switch (pairwise_cipher)
{
case WPA_CIPHER_NONE:
psecuritypriv->wpa_pairwise_cipher = _NO_PRIVACY_;
@ -1601,12 +1601,12 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
//wmm
ie_len = 0;
pmlmepriv->qospriv.qos_option = 0;
if(pregistrypriv->wmm_enable)
if (pregistrypriv->wmm_enable)
{
for (p = ie + _BEACON_IE_OFFSET_; ;p += (ie_len + 2))
{
p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2)));
if((p) && _rtw_memcmp(p+2, WMM_PARA_IE, 6))
if ((p) && _rtw_memcmp(p+2, WMM_PARA_IE, 6))
{
pmlmepriv->qospriv.qos_option = 1;
@ -1630,7 +1630,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
#ifdef CONFIG_80211N_HT
//parsing HT_CAP_IE
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_CAPABILITY_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
if(p && ie_len>0)
if (p && ie_len>0)
{
u8 rf_type;
@ -1645,7 +1645,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
if((psecuritypriv->wpa_pairwise_cipher & WPA_CIPHER_CCMP) ||
if ((psecuritypriv->wpa_pairwise_cipher & WPA_CIPHER_CCMP) ||
(psecuritypriv->wpa2_pairwise_cipher & WPA_CIPHER_CCMP))
{
pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&(0x07<<2));
@ -1657,7 +1657,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_FACTOR & 0x03); //set Max Rx AMPDU size to 64K
if(rf_type == RF_1T1R)
if (rf_type == RF_1T1R)
{
pht_cap->supp_mcs_set[0] = 0xff;
pht_cap->supp_mcs_set[1] = 0x0;
@ -1669,12 +1669,12 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
//parsing HT_INFO_IE
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_ADD_INFO_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
if(p && ie_len>0)
if (p && ie_len>0)
{
pHT_info_ie=p;
}
#endif //CONFIG_80211N_HT
switch(network_type)
switch (network_type)
{
case WIRELESS_11B:
pbss_network->NetworkTypeInUse = Ndis802_11DS;
@ -1698,7 +1698,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
#ifdef CONFIG_80211N_HT
pmlmepriv->htpriv.ht_option = _FALSE;
if( (psecuritypriv->wpa2_pairwise_cipher&WPA_CIPHER_TKIP) ||
if ( (psecuritypriv->wpa2_pairwise_cipher&WPA_CIPHER_TKIP) ||
(psecuritypriv->wpa_pairwise_cipher&WPA_CIPHER_TKIP))
{
//todo:
@ -1706,12 +1706,12 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
}
//ht_cap
if(pregistrypriv->ht_enable && ht_cap==_TRUE)
if (pregistrypriv->ht_enable && ht_cap==_TRUE)
{
pmlmepriv->htpriv.ht_option = _TRUE;
pmlmepriv->qospriv.qos_option = 1;
if(pregistrypriv->ampdu_enable==1)
if (pregistrypriv->ampdu_enable==1)
{
pmlmepriv->htpriv.ampdu_enable = _TRUE;
}
@ -1731,7 +1731,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
//alloc sta_info for ap itself
psta = rtw_get_stainfo(&padapter->stapriv, pbss_network->MacAddress);
if(!psta)
if (!psta)
{
psta = rtw_alloc_stainfo(&padapter->stapriv, pbss_network->MacAddress);
if (psta == NULL)
@ -1774,7 +1774,7 @@ int rtw_acl_add_sta(_adapter *padapter, u8 *addr)
DBG_871X("%s(acl_num=%d)=" MAC_FMT "\n", __func__, pacl_list->num, MAC_ARG(addr));
if((NUM_ACL-1) < pacl_list->num)
if ((NUM_ACL-1) < pacl_list->num)
return (-1);
@ -1788,9 +1788,9 @@ int rtw_acl_add_sta(_adapter *padapter, u8 *addr)
paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
plist = get_next(plist);
if(_rtw_memcmp(paclnode->addr, addr, ETH_ALEN))
if (_rtw_memcmp(paclnode->addr, addr, ETH_ALEN))
{
if(paclnode->valid == _TRUE)
if (paclnode->valid == _TRUE)
{
added = _TRUE;
DBG_871X("%s, sta has been added\n", __func__);
@ -1802,17 +1802,17 @@ int rtw_acl_add_sta(_adapter *padapter, u8 *addr)
_exit_critical_bh(&(pacl_node_q->lock), &irqL);
if(added == _TRUE)
if (added == _TRUE)
return ret;
_enter_critical_bh(&(pacl_node_q->lock), &irqL);
for(i=0; i< NUM_ACL; i++)
for (i=0; i< NUM_ACL; i++)
{
paclnode = &pacl_list->aclnode[i];
if(paclnode->valid == _FALSE)
if (paclnode->valid == _FALSE)
{
_rtw_init_listhead(&paclnode->list);
@ -1857,9 +1857,9 @@ int rtw_acl_remove_sta(_adapter *padapter, u8 *addr)
paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
plist = get_next(plist);
if(_rtw_memcmp(paclnode->addr, addr, ETH_ALEN))
if (_rtw_memcmp(paclnode->addr, addr, ETH_ALEN))
{
if(paclnode->valid == _TRUE)
if (paclnode->valid == _TRUE)
{
paclnode->valid = _FALSE;
@ -1897,12 +1897,12 @@ static void update_bcn_erpinfo_ie(_adapter *padapter)
DBG_871X("%s, ERP_enable=%d\n", __FUNCTION__, pmlmeinfo->ERP_enable);
if(!pmlmeinfo->ERP_enable)
if (!pmlmeinfo->ERP_enable)
return;
//parsing ERP_IE
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _ERPINFO_IE_, &len, (pnetwork->IELength - _BEACON_IE_OFFSET_));
if(p && len>0)
if (p && len>0)
{
PNDIS_802_11_VARIABLE_IEs pIE = (PNDIS_802_11_VARIABLE_IEs)p;
@ -1911,7 +1911,7 @@ static void update_bcn_erpinfo_ie(_adapter *padapter)
else
pIE->data[0] &= ~(RTW_ERP_INFO_NON_ERP_PRESENT|RTW_ERP_INFO_USE_PROTECTION);
if(pmlmepriv->num_sta_no_short_preamble > 0)
if (pmlmepriv->num_sta_no_short_preamble > 0)
pIE->data[0] |= RTW_ERP_INFO_BARKER_PREAMBLE_MODE;
else
pIE->data[0] &= ~(RTW_ERP_INFO_BARKER_PREAMBLE_MODE);
@ -1967,7 +1967,7 @@ static void update_bcn_wps_ie(_adapter *padapter)
pwps_ie = rtw_get_wps_ie(ie+_FIXED_IE_LENGTH_, ielen-_FIXED_IE_LENGTH_, NULL, &wps_ielen);
if(pwps_ie==NULL || wps_ielen==0)
if (pwps_ie==NULL || wps_ielen==0)
return;
wps_offset = (uint)(pwps_ie-ie);
@ -1976,33 +1976,33 @@ static void update_bcn_wps_ie(_adapter *padapter)
remainder_ielen = ielen - wps_offset - wps_ielen;
if(remainder_ielen>0)
if (remainder_ielen>0)
{
pbackup_remainder_ie = rtw_malloc(remainder_ielen);
if(pbackup_remainder_ie)
if (pbackup_remainder_ie)
_rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
}
pwps_ie_src = pmlmepriv->wps_beacon_ie;
if(pwps_ie_src == NULL)
if (pwps_ie_src == NULL)
return;
wps_ielen = (uint)pwps_ie_src[1];//to get ie data len
if((wps_offset+wps_ielen+2+remainder_ielen)<=MAX_IE_SZ)
if ((wps_offset+wps_ielen+2+remainder_ielen)<=MAX_IE_SZ)
{
_rtw_memcpy(pwps_ie, pwps_ie_src, wps_ielen+2);
pwps_ie += (wps_ielen+2);
if(pbackup_remainder_ie)
if (pbackup_remainder_ie)
_rtw_memcpy(pwps_ie, pbackup_remainder_ie, remainder_ielen);
//update IELength
pnetwork->IELength = wps_offset + (wps_ielen+2) + remainder_ielen;
}
if(pbackup_remainder_ie)
if (pbackup_remainder_ie)
rtw_mfree(pbackup_remainder_ie, remainder_ielen);
}
@ -2016,19 +2016,19 @@ static void update_bcn_vendor_spec_ie(_adapter *padapter, u8*oui)
{
DBG_871X("%s\n", __FUNCTION__);
if(_rtw_memcmp(RTW_WPA_OUI, oui, 4))
if (_rtw_memcmp(RTW_WPA_OUI, oui, 4))
{
update_bcn_wpa_ie(padapter);
}
else if(_rtw_memcmp(WMM_OUI, oui, 4))
else if (_rtw_memcmp(WMM_OUI, oui, 4))
{
update_bcn_wmm_ie(padapter);
}
else if(_rtw_memcmp(WPS_OUI, oui, 4))
else if (_rtw_memcmp(WPS_OUI, oui, 4))
{
update_bcn_wps_ie(padapter);
}
else if(_rtw_memcmp(P2P_OUI, oui, 4))
else if (_rtw_memcmp(P2P_OUI, oui, 4))
{
update_bcn_p2p_ie(padapter);
}
@ -2049,19 +2049,19 @@ void update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx)
//DBG_871X("%s\n", __FUNCTION__);
if(!padapter)
if (!padapter)
return;
pmlmepriv = &(padapter->mlmepriv);
pmlmeext = &(padapter->mlmeextpriv);
//pmlmeinfo = &(pmlmeext->mlmext_info);
if(_FALSE == pmlmeext->bstart_bss)
if (_FALSE == pmlmeext->bstart_bss)
return;
_enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL);
switch(ie_id)
switch (ie_id)
{
case 0xFF:
@ -2115,7 +2115,7 @@ void update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx)
#ifndef CONFIG_INTERRUPT_BASED_TXBCN
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
if(tx)
if (tx)
{
//send_beacon(padapter);//send_beacon must execute on TSR level
set_tx_beacon_cmd(padapter);
@ -2150,7 +2150,7 @@ static int rtw_ht_operation_update(_adapter *padapter)
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct ht_priv *phtpriv_ap = &pmlmepriv->htpriv;
if(pmlmepriv->htpriv.ht_option == _TRUE)
if (pmlmepriv->htpriv.ht_option == _TRUE)
return 0;
//if (!iface->conf->ieee80211n || iface->conf->ht_op_mode_fixed)
@ -2219,7 +2219,7 @@ static int rtw_ht_operation_update(_adapter *padapter)
void associated_clients_update(_adapter *padapter, u8 updated)
{
//update associcated stations cap.
if(updated == _TRUE)
if (updated == _TRUE)
{
_irqL irqL;
_list *phead, *plist;
@ -2267,9 +2267,9 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
#endif
if(!(psta->flags & WLAN_STA_SHORT_PREAMBLE))
if (!(psta->flags & WLAN_STA_SHORT_PREAMBLE))
{
if(!psta->no_short_preamble_set)
if (!psta->no_short_preamble_set)
{
psta->no_short_preamble_set = 1;
@ -2286,7 +2286,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
}
else
{
if(psta->no_short_preamble_set)
if (psta->no_short_preamble_set)
{
psta->no_short_preamble_set = 0;
@ -2311,9 +2311,9 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
}
#endif
if(psta->flags & WLAN_STA_NONERP)
if (psta->flags & WLAN_STA_NONERP)
{
if(!psta->nonerp_set)
if (!psta->nonerp_set)
{
psta->nonerp_set = 1;
@ -2329,7 +2329,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
}
else
{
if(psta->nonerp_set)
if (psta->nonerp_set)
{
psta->nonerp_set = 0;
@ -2356,9 +2356,9 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
}
#endif
if(!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT))
if (!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT))
{
if(!psta->no_short_slot_time_set)
if (!psta->no_short_slot_time_set)
{
psta->no_short_slot_time_set = 1;
@ -2375,7 +2375,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
}
else
{
if(psta->no_short_slot_time_set)
if (psta->no_short_slot_time_set)
{
psta->no_short_slot_time_set = 0;
@ -2433,7 +2433,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
psta->no_ht_set = 1;
pmlmepriv->num_sta_no_ht++;
}
if(pmlmepriv->htpriv.ht_option == _TRUE) {
if (pmlmepriv->htpriv.ht_option == _TRUE) {
DBG_871X("%s STA " MAC_FMT
" - no HT, num of non-HT stations %d\n",
__FUNCTION__, MAC_ARG(psta->hwaddr),
@ -2462,7 +2462,7 @@ u8 bss_cap_update_on_sta_leave(_adapter *padapter, struct sta_info *psta)
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
if(!psta)
if (!psta)
return beacon_updated;
if (psta->no_short_preamble_set) {
@ -2539,7 +2539,7 @@ u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reaso
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct sta_priv *pstapriv = &padapter->stapriv;
if(!psta)
if (!psta)
return beacon_updated;
#ifdef CONFIG_80211N_HT
@ -2594,7 +2594,7 @@ u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reaso
}
int rtw_ap_inform_ch_switch(_adapter *padapter, u8 new_ch, u8 ch_offset)
int rtw_ap_inform_ch_switch (_adapter *padapter, u8 new_ch, u8 ch_offset)
{
_irqL irqL;
_list *phead, *plist;
@ -2605,7 +2605,7 @@ int rtw_ap_inform_ch_switch(_adapter *padapter, u8 new_ch, u8 ch_offset)
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
if((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
return ret;
DBG_871X(FUNC_NDEV_FMT" with ch:%u, offset:%u\n",
@ -2621,12 +2621,12 @@ int rtw_ap_inform_ch_switch(_adapter *padapter, u8 new_ch, u8 ch_offset)
psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
plist = get_next(plist);
issue_action_spct_ch_switch(padapter, psta->hwaddr, new_ch, ch_offset);
issue_action_spct_ch_switch (padapter, psta->hwaddr, new_ch, ch_offset);
psta->expire_to = ((pstapriv->expire_to * 2) > 5) ? 5 : (pstapriv->expire_to * 2);
}
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
issue_action_spct_ch_switch(padapter, bc_addr, new_ch, ch_offset);
issue_action_spct_ch_switch (padapter, bc_addr, new_ch, ch_offset);
return ret;
}
@ -2644,7 +2644,7 @@ int rtw_sta_flush(_adapter *padapter)
DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(padapter->pnetdev));
if((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
return ret;
@ -2685,18 +2685,18 @@ void sta_info_update(_adapter *padapter, struct sta_info *psta)
//update wmm cap.
if(WLAN_STA_WME&flags)
if (WLAN_STA_WME&flags)
psta->qos_option = 1;
else
psta->qos_option = 0;
if(pmlmepriv->qospriv.qos_option == 0)
if (pmlmepriv->qospriv.qos_option == 0)
psta->qos_option = 0;
#ifdef CONFIG_80211N_HT
//update 802.11n ht cap.
if(WLAN_STA_HT&flags)
if (WLAN_STA_HT&flags)
{
psta->htpriv.ht_option = _TRUE;
psta->qos_option = 1;
@ -2706,7 +2706,7 @@ void sta_info_update(_adapter *padapter, struct sta_info *psta)
psta->htpriv.ht_option = _FALSE;
}
if(pmlmepriv->htpriv.ht_option == _FALSE)
if (pmlmepriv->htpriv.ht_option == _FALSE)
psta->htpriv.ht_option = _FALSE;
#endif
@ -2719,7 +2719,7 @@ void sta_info_update(_adapter *padapter, struct sta_info *psta)
/* called >= TSR LEVEL for USB or SDIO Interface*/
void ap_sta_info_defer_update(_adapter *padapter, struct sta_info *psta)
{
if(psta->state & _FW_LINKED)
if (psta->state & _FW_LINKED)
{
//add ratid
add_RATid(padapter, psta, 0);//DM_RATR_STA_INIT
@ -2759,7 +2759,7 @@ void start_ap_mode(_adapter *padapter)
pmlmepriv->ht_op_mode = 0;
#endif
for(i=0; i<NUM_STA; i++)
for (i=0; i<NUM_STA; i++)
pstapriv->sta_aid[i] = NULL;
pmlmepriv->wps_beacon_ie = NULL;
@ -2774,7 +2774,7 @@ void start_ap_mode(_adapter *padapter)
_rtw_init_listhead(&(pacl_list->acl_node_q.queue));
pacl_list->num = 0;
pacl_list->mode = 0;
for(i = 0; i < NUM_ACL; i++)
for (i = 0; i < NUM_ACL; i++)
{
_rtw_init_listhead(&pacl_list->aclnode[i].list);
pacl_list->aclnode[i].valid = _FALSE;
@ -2812,7 +2812,7 @@ void stop_ap_mode(_adapter *padapter)
paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
plist = get_next(plist);
if(paclnode->valid == _TRUE)
if (paclnode->valid == _TRUE)
{
paclnode->valid = _FALSE;

View file

@ -90,11 +90,11 @@ static __inline__ unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, un
unsigned short tagLen, tagType;
start_ptr = cur_ptr = (unsigned char *)ph->tag;
while((cur_ptr - start_ptr) < ntohs(ph->length)) {
while ((cur_ptr - start_ptr) < ntohs(ph->length)) {
// prevent un-alignment access
tagType = (unsigned short)((cur_ptr[0] << 8) + cur_ptr[1]);
tagLen = (unsigned short)((cur_ptr[2] << 8) + cur_ptr[3]);
if(tagType == type)
if (tagType == type)
return cur_ptr;
cur_ptr = cur_ptr + TAG_HDR_LEN + tagLen;
}
@ -155,7 +155,7 @@ static __inline__ unsigned long __nat25_timeout(_adapter *priv)
static __inline__ int __nat25_has_expired(_adapter *priv,
struct nat25_network_db_entry *fdb)
{
if(time_before_eq(fdb->ageing_timer, __nat25_timeout(priv)))
if (time_before_eq(fdb->ageing_timer, __nat25_timeout(priv)))
return 1;
return 0;
@ -330,7 +330,7 @@ static void convert_ipv6_mac_to_mc(struct sk_buff *skb)
static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
{
if(networkAddr[0] == NAT25_IPV4)
if (networkAddr[0] == NAT25_IPV4)
{
unsigned long x;
@ -338,7 +338,7 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
return x & (NAT25_HASH_SIZE - 1);
}
else if(networkAddr[0] == NAT25_IPX)
else if (networkAddr[0] == NAT25_IPX)
{
unsigned long x;
@ -347,7 +347,7 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
return x & (NAT25_HASH_SIZE - 1);
}
else if(networkAddr[0] == NAT25_APPLE)
else if (networkAddr[0] == NAT25_APPLE)
{
unsigned long x;
@ -355,7 +355,7 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
return x & (NAT25_HASH_SIZE - 1);
}
else if(networkAddr[0] == NAT25_PPPOE)
else if (networkAddr[0] == NAT25_PPPOE)
{
unsigned long x;
@ -364,7 +364,7 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
return x & (NAT25_HASH_SIZE - 1);
}
#ifdef CL_IPV6_PASS
else if(networkAddr[0] == NAT25_IPV6)
else if (networkAddr[0] == NAT25_IPV6)
{
unsigned long x;
@ -397,7 +397,7 @@ static __inline__ void __network_hash_link(_adapter *priv,
//_enter_critical_bh(&priv->br_ext_lock, &irqL);
ent->next_hash = priv->nethash[hash];
if(ent->next_hash != NULL)
if (ent->next_hash != NULL)
ent->next_hash->pprev_hash = &ent->next_hash;
priv->nethash[hash] = ent;
ent->pprev_hash = &priv->nethash[hash];
@ -413,7 +413,7 @@ static __inline__ void __network_hash_unlink(struct nat25_network_db_entry *ent)
//_enter_critical_bh(&priv->br_ext_lock, &irqL);
*(ent->pprev_hash) = ent->next_hash;
if(ent->next_hash != NULL)
if (ent->next_hash != NULL)
ent->next_hash->pprev_hash = ent->pprev_hash;
ent->next_hash = NULL;
ent->pprev_hash = NULL;
@ -432,9 +432,9 @@ static int __nat25_db_network_lookup_and_replace(_adapter *priv,
db = priv->nethash[__nat25_network_hash(networkAddr)];
while (db != NULL)
{
if(!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN))
if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN))
{
if(!__nat25_has_expired(priv, db))
if (!__nat25_has_expired(priv, db))
{
// replace the destination mac address
memcpy(skb->data, db->macAddr, ETH_ALEN);
@ -511,7 +511,7 @@ static void __nat25_db_network_insert(_adapter *priv,
db = priv->nethash[hash];
while (db != NULL)
{
if(!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN))
if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN))
{
memcpy(db->macAddr, macAddr, ETH_ALEN);
db->ageing_timer = jiffies;
@ -523,7 +523,7 @@ static void __nat25_db_network_insert(_adapter *priv,
}
db = (struct nat25_network_db_entry *) rtw_malloc(sizeof(*db));
if(db == NULL) {
if (db == NULL) {
_exit_critical_bh(&priv->br_ext_lock, &irqL);
return;
}
@ -550,10 +550,10 @@ static void __nat25_db_print(_adapter *priv)
struct nat25_network_db_entry *db;
counter++;
if((counter % 16) != 0)
if ((counter % 16) != 0)
return;
for(i=0, j=0; i<NAT25_HASH_SIZE; i++)
for (i=0, j=0; i<NAT25_HASH_SIZE; i++)
{
db = priv->nethash[i];
@ -634,7 +634,7 @@ void nat25_db_cleanup(_adapter *priv)
_irqL irqL;
_enter_critical_bh(&priv->br_ext_lock, &irqL);
for(i=0; i<NAT25_HASH_SIZE; i++)
for (i=0; i<NAT25_HASH_SIZE; i++)
{
struct nat25_network_db_entry *f;
f = priv->nethash[i];
@ -642,7 +642,7 @@ void nat25_db_cleanup(_adapter *priv)
struct nat25_network_db_entry *g;
g = f->next_hash;
if(priv->scdb_entry == f)
if (priv->scdb_entry == f)
{
memset(priv->scdb_mac, 0, ETH_ALEN);
memset(priv->scdb_ip, 0, 4);
@ -665,7 +665,7 @@ void nat25_db_expire(_adapter *priv)
_irqL irqL;
_enter_critical_bh(&priv->br_ext_lock, &irqL);
//if(!priv->ethBrExtInfo.nat25_disable)
//if (!priv->ethBrExtInfo.nat25_disable)
{
for (i=0; i<NAT25_HASH_SIZE; i++)
{
@ -677,9 +677,9 @@ void nat25_db_expire(_adapter *priv)
struct nat25_network_db_entry *g;
g = f->next_hash;
if(__nat25_has_expired(priv, f))
if (__nat25_has_expired(priv, f))
{
if(atomic_dec_and_test(&f->use_count))
if (atomic_dec_and_test(&f->use_count))
{
#ifdef BR_EXT_DEBUG
#ifdef CL_IPV6_PASS
@ -732,7 +732,7 @@ void nat25_db_expire(_adapter *priv)
f->networkAddr[10]);
#endif
#endif
if(priv->scdb_entry == f)
if (priv->scdb_entry == f)
{
memset(priv->scdb_mac, 0, ETH_ALEN);
memset(priv->scdb_ip, 0, 4);
@ -785,10 +785,10 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
unsigned short protocol;
unsigned char networkAddr[MAX_NETWORK_ADDR_LEN];
if(skb == NULL)
if (skb == NULL)
return -1;
if((method <= NAT25_MIN) || (method >= NAT25_MAX))
if ((method <= NAT25_MIN) || (method >= NAT25_MAX))
return -1;
protocol = *((unsigned short *)(skb->data + 2 * ETH_ALEN));
@ -796,17 +796,17 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
/*---------------------------------------------------*/
/* Handle IP frame */
/*---------------------------------------------------*/
if(protocol == __constant_htons(ETH_P_IP))
if (protocol == __constant_htons(ETH_P_IP))
{
struct iphdr* iph = (struct iphdr *)(skb->data + ETH_HLEN);
if(((unsigned char*)(iph) + (iph->ihl<<2)) >= (skb->data + ETH_HLEN + skb->len))
if (((unsigned char*)(iph) + (iph->ihl<<2)) >= (skb->data + ETH_HLEN + skb->len))
{
DEBUG_WARN("NAT25: malformed IP packet !\n");
return -1;
}
switch(method)
switch (method)
{
case NAT25_CHECK:
return -1;
@ -868,19 +868,19 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
/*---------------------------------------------------*/
/* Handle ARP frame */
/*---------------------------------------------------*/
else if(protocol == __constant_htons(ETH_P_ARP))
else if (protocol == __constant_htons(ETH_P_ARP))
{
struct arphdr *arp = (struct arphdr *)(skb->data + ETH_HLEN);
unsigned char *arp_ptr = (unsigned char *)(arp + 1);
unsigned int *sender, *target;
if(arp->ar_pro != __constant_htons(ETH_P_IP))
if (arp->ar_pro != __constant_htons(ETH_P_IP))
{
DEBUG_WARN("NAT25: arp protocol unknown (%4x)!\n", htons(arp->ar_pro));
return -1;
}
switch(method)
switch (method)
{
case NAT25_CHECK:
return 0; // skb_copy for all ARP frame
@ -932,7 +932,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
/*---------------------------------------------------*/
/* Handle IPX and Apple Talk frame */
/*---------------------------------------------------*/
else if((protocol == __constant_htons(ETH_P_IPX)) ||
else if ((protocol == __constant_htons(ETH_P_IPX)) ||
(protocol <= __constant_htons(ETH_FRAME_LEN)))
{
unsigned char ipx_header[2] = {0xFF, 0xFF};
@ -941,14 +941,14 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
struct ddpehdr *ddp = NULL;
unsigned char *framePtr = skb->data + ETH_HLEN;
if(protocol == __constant_htons(ETH_P_IPX))
if (protocol == __constant_htons(ETH_P_IPX))
{
DEBUG_INFO("NAT25: Protocol=IPX (Ethernet II)\n");
ipx = (struct ipxhdr *)framePtr;
}
else if(protocol <= __constant_htons(ETH_FRAME_LEN))
else if (protocol <= __constant_htons(ETH_FRAME_LEN))
{
if(!memcmp(ipx_header, framePtr, 2))
if (!memcmp(ipx_header, framePtr, 2))
{
DEBUG_INFO("NAT25: Protocol=IPX (Ethernet 802.3)\n");
ipx = (struct ipxhdr *)framePtr;
@ -958,7 +958,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
unsigned char ipx_8022_type = 0xE0;
unsigned char snap_8022_type = 0xAA;
if(*framePtr == snap_8022_type)
if (*framePtr == snap_8022_type)
{
unsigned char ipx_snap_id[5] = {0x0, 0x0, 0x0, 0x81, 0x37}; // IPX SNAP ID
unsigned char aarp_snap_id[5] = {0x00, 0x00, 0x00, 0x80, 0xF3}; // Apple Talk AARP SNAP ID
@ -966,20 +966,20 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
framePtr += 3; // eliminate the 802.2 header
if(!memcmp(ipx_snap_id, framePtr, 5))
if (!memcmp(ipx_snap_id, framePtr, 5))
{
framePtr += 5; // eliminate the SNAP header
DEBUG_INFO("NAT25: Protocol=IPX (Ethernet SNAP)\n");
ipx = (struct ipxhdr *)framePtr;
}
else if(!memcmp(aarp_snap_id, framePtr, 5))
else if (!memcmp(aarp_snap_id, framePtr, 5))
{
framePtr += 5; // eliminate the SNAP header
ea = (struct elapaarp *)framePtr;
}
else if(!memcmp(ddp_snap_id, framePtr, 5))
else if (!memcmp(ddp_snap_id, framePtr, 5))
{
framePtr += 5; // eliminate the SNAP header
@ -992,11 +992,11 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
return -1;
}
}
else if(*framePtr == ipx_8022_type)
else if (*framePtr == ipx_8022_type)
{
framePtr += 3; // eliminate the 802.2 header
if(!memcmp(ipx_header, framePtr, 2))
if (!memcmp(ipx_header, framePtr, 2))
{
DEBUG_INFO("NAT25: Protocol=IPX (Ethernet 802.2)\n");
ipx = (struct ipxhdr *)framePtr;
@ -1012,12 +1012,12 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
return -1;
/* IPX */
if(ipx != NULL)
if (ipx != NULL)
{
switch(method)
switch (method)
{
case NAT25_CHECK:
if(!memcmp(skb->data+ETH_ALEN, ipx->ipx_source.node, ETH_ALEN))
if (!memcmp(skb->data+ETH_ALEN, ipx->ipx_source.node, ETH_ALEN))
{
DEBUG_INFO("NAT25: Check IPX skb_copy\n");
return 0;
@ -1044,7 +1044,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
ipx->ipx_source.node[5],
ipx->ipx_source.sock);
if(!memcmp(skb->data+ETH_ALEN, ipx->ipx_source.node, ETH_ALEN))
if (!memcmp(skb->data+ETH_ALEN, ipx->ipx_source.node, ETH_ALEN))
{
DEBUG_INFO("NAT25: Use IPX Net, and Socket as network addr\n");
@ -1066,7 +1066,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
case NAT25_LOOKUP:
{
if(!memcmp(GET_MY_HWADDR(priv), ipx->ipx_dest.node, ETH_ALEN))
if (!memcmp(GET_MY_HWADDR(priv), ipx->ipx_dest.node, ETH_ALEN))
{
DEBUG_INFO("NAT25: Lookup IPX, Modify Destination IPX Node addr\n");
@ -1092,16 +1092,16 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
}
/* AARP */
else if(ea != NULL)
else if (ea != NULL)
{
/* Sanity check fields. */
if(ea->hw_len != ETH_ALEN || ea->pa_len != AARP_PA_ALEN)
if (ea->hw_len != ETH_ALEN || ea->pa_len != AARP_PA_ALEN)
{
DEBUG_WARN("NAT25: Appletalk AARP Sanity check fail!\n");
return -1;
}
switch(method)
switch (method)
{
case NAT25_CHECK:
return 0;
@ -1148,9 +1148,9 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
}
/* DDP */
else if(ddp != NULL)
else if (ddp != NULL)
{
switch(method)
switch (method)
{
case NAT25_CHECK:
return -1;
@ -1196,13 +1196,13 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
/*---------------------------------------------------*/
/* Handle PPPoE frame */
/*---------------------------------------------------*/
else if((protocol == __constant_htons(ETH_P_PPP_DISC)) ||
else if ((protocol == __constant_htons(ETH_P_PPP_DISC)) ||
(protocol == __constant_htons(ETH_P_PPP_SES)))
{
struct pppoe_hdr *ph = (struct pppoe_hdr *)(skb->data + ETH_HLEN);
unsigned short *pMagic;
switch(method)
switch (method)
{
case NAT25_CHECK:
if (ph->sid == 0)
@ -1210,9 +1210,9 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
return 1;
case NAT25_INSERT:
if(ph->sid == 0) // Discovery phase according to tag
if (ph->sid == 0) // Discovery phase according to tag
{
if(ph->code == PADI_CODE || ph->code == PADR_CODE)
if (ph->code == PADI_CODE || ph->code == PADR_CODE)
{
if (priv->ethBrExtInfo.addPPPoETag) {
struct pppoe_tag *tag, *pOldTag;
@ -1247,7 +1247,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
memcpy(tag->tag_data+MAGIC_CODE_LEN, skb->data+ETH_ALEN, ETH_ALEN);
//Add relay tag
if(__nat25_add_pppoe_tag(skb, tag) < 0)
if (__nat25_add_pppoe_tag(skb, tag) < 0)
return -1;
DEBUG_INFO("NAT25: Insert PPPoE, forward %s packet\n",
@ -1287,7 +1287,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
return 0;
case NAT25_LOOKUP:
if(ph->code == PADO_CODE || ph->code == PADS_CODE)
if (ph->code == PADO_CODE || ph->code == PADS_CODE)
{
if (priv->ethBrExtInfo.addPPPoETag) {
struct pppoe_tag *tag;
@ -1295,7 +1295,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
unsigned short tagType, tagLen;
int offset=0;
if((ptr = __nat25_find_pppoe_tag(ph, ntohs(PTT_RELAY_SID))) == 0) {
if ((ptr = __nat25_find_pppoe_tag(ph, ntohs(PTT_RELAY_SID))) == 0) {
DEBUG_ERR("Fail to find PTT_RELAY_SID in FADO!\n");
return -1;
}
@ -1304,7 +1304,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
tagType = (unsigned short)((ptr[0] << 8) + ptr[1]);
tagLen = (unsigned short)((ptr[2] << 8) + ptr[3]);
if((tagType != ntohs(PTT_RELAY_SID)) || (tagLen < (MAGIC_CODE_LEN+RTL_RELAY_TAG_LEN))) {
if ((tagType != ntohs(PTT_RELAY_SID)) || (tagLen < (MAGIC_CODE_LEN+RTL_RELAY_TAG_LEN))) {
DEBUG_ERR("Invalid PTT_RELAY_SID tag length [%d]!\n", tagLen);
return -1;
}
@ -1342,7 +1342,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
}
}
else {
if(ph->sid != 0)
if (ph->sid != 0)
{
DEBUG_INFO("NAT25: Lookup PPPoE, lookup session packet from %s\n", skb->dev->name);
__nat25_generate_pppoe_network_addr(networkAddr, skb->data+ETH_ALEN, &(ph->sid));
@ -1365,9 +1365,9 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
/*---------------------------------------------------*/
/* Handle EAP frame */
/*---------------------------------------------------*/
else if(protocol == __constant_htons(0x888e))
else if (protocol == __constant_htons(0x888e))
{
switch(method)
switch (method)
{
case NAT25_CHECK:
return -1;
@ -1386,10 +1386,10 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
/*---------------------------------------------------*/
/* Handle C-Media proprietary frame */
/*---------------------------------------------------*/
else if((protocol == __constant_htons(0xe2ae)) ||
else if ((protocol == __constant_htons(0xe2ae)) ||
(protocol == __constant_htons(0xe2af)))
{
switch(method)
switch (method)
{
case NAT25_CHECK:
return -1;
@ -1409,7 +1409,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
/* Handle IPV6 frame */
/*---------------------------------------------------*/
#ifdef CL_IPV6_PASS
else if(protocol == __constant_htons(ETH_P_IPV6))
else if (protocol == __constant_htons(ETH_P_IPV6))
{
struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + ETH_HLEN);
@ -1419,7 +1419,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
return -1;
}
switch(method)
switch (method)
{
case NAT25_CHECK:
if (skb->data[0] & 1)
@ -1487,7 +1487,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
int nat25_handle_frame(_adapter *priv, struct sk_buff *skb)
{
#ifdef BR_EXT_DEBUG
if((!priv->ethBrExtInfo.nat25_disable) && (!(skb->data[0] & 1)))
if ((!priv->ethBrExtInfo.nat25_disable) && (!(skb->data[0] & 1)))
{
panic_printk("NAT25: Input Frame: DA=%02x%02x%02x%02x%02x%02x SA=%02x%02x%02x%02x%02x%02x\n",
skb->data[0],
@ -1505,7 +1505,7 @@ int nat25_handle_frame(_adapter *priv, struct sk_buff *skb)
}
#endif
if(!(skb->data[0] & 1))
if (!(skb->data[0] & 1))
{
int is_vlan_tag=0, i, retval=0;
unsigned short vlan_hdr=0;
@ -1558,7 +1558,7 @@ int nat25_handle_frame(_adapter *priv, struct sk_buff *skb)
*((unsigned short *)(skb->data+ETH_ALEN*2+2)) = vlan_hdr;
}
if(retval == -1) {
if (retval == -1) {
//DEBUG_ERR("NAT25: Lookup fail!\n");
return -1;
}
@ -1581,11 +1581,11 @@ void mac_clone(_adapter *priv, unsigned char *addr)
int mac_clone_handle_frame(_adapter *priv, struct sk_buff *skb)
{
if(priv->ethBrExtInfo.macclone_enable && !priv->macclone_completed)
if (priv->ethBrExtInfo.macclone_enable && !priv->macclone_completed)
{
if(!(skb->data[ETH_ALEN] & 1)) //// check any other particular MAC add
if (!(skb->data[ETH_ALEN] & 1)) //// check any other particular MAC add
{
if(memcmp(skb->data+ETH_ALEN, GET_MY_HWADDR(priv), ETH_ALEN) &&
if (memcmp(skb->data+ETH_ALEN, GET_MY_HWADDR(priv), ETH_ALEN) &&
((priv->dev->br_port) &&
memcmp(skb->data+ETH_ALEN, priv->br_mac, ETH_ALEN)))
{
@ -1625,30 +1625,30 @@ struct dhcpMessage {
void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb)
{
if(skb == NULL)
if (skb == NULL)
return;
if(!priv->ethBrExtInfo.dhcp_bcst_disable)
if (!priv->ethBrExtInfo.dhcp_bcst_disable)
{
unsigned short protocol = *((unsigned short *)(skb->data + 2 * ETH_ALEN));
if(protocol == __constant_htons(ETH_P_IP)) // IP
if (protocol == __constant_htons(ETH_P_IP)) // IP
{
struct iphdr* iph = (struct iphdr *)(skb->data + ETH_HLEN);
if(iph->protocol == IPPROTO_UDP) // UDP
if (iph->protocol == IPPROTO_UDP) // UDP
{
struct udphdr *udph = (struct udphdr *)((SIZE_PTR)iph + (iph->ihl << 2));
if((udph->source == __constant_htons(CLIENT_PORT))
if ((udph->source == __constant_htons(CLIENT_PORT))
&& (udph->dest == __constant_htons(SERVER_PORT))) // DHCP request
{
struct dhcpMessage *dhcph =
(struct dhcpMessage *)((SIZE_PTR)udph + sizeof(struct udphdr));
if(dhcph->cookie == __constant_htonl(DHCP_MAGIC)) // match magic word
if (dhcph->cookie == __constant_htonl(DHCP_MAGIC)) // match magic word
{
if(!(dhcph->flags & htons(BROADCAST_FLAG))) // if not broadcast
if (!(dhcph->flags & htons(BROADCAST_FLAG))) // if not broadcast
{
register int sum = 0;
@ -1658,7 +1658,7 @@ void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb)
// recalculate checksum
sum = ~(udph->check) & 0xffff;
sum += dhcph->flags;
while(sum >> 16)
while (sum >> 16)
sum = (sum & 0xffff) + (sum >> 16);
udph->check = ~sum;
}
@ -1684,7 +1684,7 @@ void *scdb_findEntry(_adapter *priv, unsigned char *macAddr,
db = priv->nethash[hash];
while (db != NULL)
{
if(!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) {
if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) {
//_exit_critical_bh(&priv->br_ext_lock, &irqL);
return (void *)db;
}

View file

@ -49,7 +49,7 @@ u32 WaitC2Hevent( PADAPTER pAdapter,BOOLEAN *C2H_event ,u32 delay_time)
_rtw_down_sema(&pMptCtx->MPh2c_Sema);
if( pMptCtx->bMPh2c_timeout == _TRUE )
if ( pMptCtx->bMPh2c_timeout == _TRUE )
{
C2H_event =_FALSE;
@ -75,12 +75,12 @@ mptbt_CheckC2hFrame(
DBG_8192C("[MPT], retLen = %d\n", pExtC2h->retLen);
DBG_8192C("[MPT], opCodeVer : req/rsp=%d/%d\n", pH2c->opCodeVer, pExtC2h->opCodeVer);
DBG_8192C("[MPT], reqNum : req/rsp=%d/%d\n", pH2c->reqNum, pExtC2h->reqNum);
if(pExtC2h->reqNum != pH2c->reqNum)
if (pExtC2h->reqNum != pH2c->reqNum)
{
c2hStatus = BT_STATUS_C2H_REQNUM_MISMATCH;
DBG_8192C("[MPT], Error!! C2H reqNum Mismatch!!\n");
}
else if(pExtC2h->opCodeVer != pH2c->opCodeVer)
else if (pExtC2h->opCodeVer != pH2c->opCodeVer)
{
c2hStatus = BT_STATUS_OPCODE_L_VERSION_MISMATCH;
DBG_8192C("[MPT], Error!! OPCode version L mismatch!!\n");
@ -108,21 +108,21 @@ mptbt_SendH2c(
//PlatformResetEvent(&pMptCtx->MptH2cRspEvent);
//PlatformResetEvent(&pMptCtx->MptBtC2hEvent);
// if(OldIrql == PASSIVE_LEVEL)
// if (OldIrql == PASSIVE_LEVEL)
// {
//RTPRINT_DATA(FMPBT, FMPBT_H2C_CONTENT, ("[MPT], MPT H2C hex: \n"), pH2c, h2cCmdLen);
for(i=0; i<BT_H2C_MAX_RETRY; i++)
for (i=0; i<BT_H2C_MAX_RETRY; i++)
{
DBG_8192C("[MPT], Send H2C command to wifi!!!\n");
FillH2CCmd(Adapter, 70, h2cCmdLen, (pu1Byte)pH2c);
pMptCtx->h2cReqNum++;
pMptCtx->h2cReqNum %= 16;
if(WaitC2Hevent(Adapter, &pMptCtx->MptH2cRspEvent, 100))
if (WaitC2Hevent(Adapter, &pMptCtx->MptH2cRspEvent, 100))
{
DBG_8192C("[MPT], Received WiFi MptH2cRspEvent!!!\n");
if(WaitC2Hevent(Adapter, &pMptCtx->MptBtC2hEvent, 400))
if (WaitC2Hevent(Adapter, &pMptCtx->MptBtC2hEvent, 400))
{
DBG_8192C("[MPT], Received MptBtC2hEvent!!!\n");
break;
@ -160,7 +160,7 @@ mptbt_CheckBtRspStatus(
{
BT_CTRL_STATUS retStatus=BT_OP_STATUS_SUCCESS;
switch(pExtC2h->statusCode)
switch (pExtC2h->statusCode)
{
case BT_OP_STATUS_SUCCESS:
retStatus = BT_STATUS_BT_OP_SUCCESS;
@ -217,21 +217,21 @@ mptbt_BtFwOpCodeProcess(
DBG_8192C("[MPT], pH2c->opCodeVer=%d\n", pH2c->opCodeVer);
DBG_8192C("[MPT], pH2c->reqNum=%d\n", pH2c->reqNum);
DBG_8192C("[MPT], h2c parameter length=%d\n", h2cParaLen);
if(h2cParaLen)
if (h2cParaLen)
{
DBG_8192C("[MPT], parameters(hex): \n");
for(i=0;i<h2cParaLen;i++)
for (i=0;i<h2cParaLen;i++)
{
DBG_8192C(" 0x%x \n", pH2c->buf[i]);
}
}
h2cStatus = mptbt_SendH2c(Adapter, pH2c, h2cParaLen+2);
if(BT_STATUS_H2C_SUCCESS == h2cStatus)
if (BT_STATUS_H2C_SUCCESS == h2cStatus)
{
// if reach here, it means H2C get the correct c2h response,
c2hStatus = mptbt_CheckC2hFrame(Adapter, pH2c, pExtC2h);
if(BT_STATUS_C2H_SUCCESS == c2hStatus)
if (BT_STATUS_C2H_SUCCESS == c2hStatus)
{
retStatus = mptbt_CheckBtRspStatus(Adapter, pExtC2h);
}
@ -280,7 +280,7 @@ mptbt_BtReady(
//
// 1. check upper layer opcode version
if(pBtReq->opCodeVer != 1)
if (pBtReq->opCodeVer != 1)
{
DBG_8192C("[MPT], Error!! Upper OP code version not match!!!\n");
pBtRsp->status = BT_STATUS_OPCODE_U_VERSION_MISMATCH;
@ -299,7 +299,7 @@ mptbt_BtReady(
// execute h2c and check respond c2h from bt fw is correct or not
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// ckeck bt return status.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -319,7 +319,7 @@ mptbt_BtReady(
// execute h2c and check respond c2h from bt fw is correct or not
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// ckeck bt return status.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -337,7 +337,7 @@ mptbt_BtReady(
// execute h2c and check respond c2h from bt fw is correct or not
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// ckeck bt return status.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -350,7 +350,7 @@ mptbt_BtReady(
bdAddr[0] = pExtC2h->buf[2];
}
DBG_8192C("[MPT], Local BDAddr:");
for(i=0; i<6; i++)
for (i=0; i<6; i++)
{
DBG_8192C(" 0x%x ", bdAddr[i]);
}
@ -359,7 +359,7 @@ mptbt_BtReady(
pu2Tmp = (pu2Byte)&pBtRsp->pParamStart[1];
*pu2Tmp = btRealFwVer;
pBtRsp->pParamStart[3] = btFwVer;
for(i=0; i<6; i++)
for (i=0; i<6; i++)
{
pBtRsp->pParamStart[4+i] = bdAddr[5-i];
}
@ -430,14 +430,14 @@ mptbt_BtSetMode(
// check upper layer parameters
//
// 1. check upper layer opcode version
if(pBtReq->opCodeVer != 1)
if (pBtReq->opCodeVer != 1)
{
DBG_8192C("[MPT], Error!! Upper OP code version not match!!!\n");
pBtRsp->status = BT_STATUS_OPCODE_U_VERSION_MISMATCH;
return paraLen;
}
// 2. check upper layer parameter length
if(1 == pBtReq->paraLength)
if (1 == pBtReq->paraLength)
{
btModeToSet = pBtReq->pParamStart[0];
DBG_8192C("[MPT], BtTestMode=%d \n", btModeToSet);
@ -456,7 +456,7 @@ mptbt_BtSetMode(
// 1. fill h2c parameters
// check bt mode
btOpcode = BT_LO_OP_SET_BT_MODE;
if(btModeToSet >= MP_BT_MODE_MAX)
if (btModeToSet >= MP_BT_MODE_MAX)
{
pBtRsp->status = BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
return paraLen;
@ -472,7 +472,7 @@ mptbt_BtSetMode(
}
// 3. construct respond status code and data.
if(BT_STATUS_BT_OP_SUCCESS == retStatus)
if (BT_STATUS_BT_OP_SUCCESS == retStatus)
{
pBtRsp->status = BT_STATUS_SUCCESS;
}
@ -501,19 +501,19 @@ MPTBT_FwC2hBtMpCtrl(
_cancel_timer_ex( &pMptCtx->MPh2c_timeout_timer);
DBG_8192C("[MPT], MPTBT_FwC2hBtMpCtrl(), hex: \n");
for(i=0;i<=length;i++)
for (i=0;i<=length;i++)
{
//DBG_8192C("[MPT], MPTBT_FwC2hBtMpCtrl(), hex: \n",tmpBuf[i], length);
DBG_8192C(" 0x%x ",tmpBuf[i]);
}
DBG_8192C("\n [MPT], pExtC2h->extendId=0x%x\n", pExtC2h->extendId);
switch(pExtC2h->extendId)
switch (pExtC2h->extendId)
{
case EXT_C2H_WIFI_FW_ACTIVE_RSP:
DBG_8192C("[MPT], EXT_C2H_WIFI_FW_ACTIVE_RSP\n");
DBG_8192C("[MPT], pExtC2h->buf hex: \n");
for(i=0;i<=(length-3);i++)
for (i=0;i<=(length-3);i++)
DBG_8192C(" 0x%x ",pExtC2h->buf[i]);
//PlatformSetEvent(&pMptCtx->MptH2cRspEvent);
pMptCtx->MptH2cRspEvent=_TRUE;
@ -528,7 +528,7 @@ MPTBT_FwC2hBtMpCtrl(
DBG_8192C("[MPT], pExtC2h->opCodeVer=0x%x\n", pExtC2h->opCodeVer);
DBG_8192C("[MPT], pExtC2h->reqNum=0x%x\n", pExtC2h->reqNum);
DBG_8192C("[MPT], pExtC2h->buf hex: \n");
for(i=0;i<=(length-3);i++)
for (i=0;i<=(length-3);i++)
DBG_8192C(" 0x%x ",pExtC2h->buf[0]);
//PlatformSetEvent(&pMptCtx->MptBtC2hEvent);
pMptCtx->MptBtC2hEvent=_TRUE;
@ -571,14 +571,14 @@ mptbt_BtGetGeneral(
//
// check upper layer opcode version
if(pBtReq->opCodeVer != 1)
if (pBtReq->opCodeVer != 1)
{
DBG_8192C("[MPT], Error!! Upper OP code version not match!!!\n");
pBtRsp->status = BT_STATUS_OPCODE_U_VERSION_MISMATCH;
return paraLen;
}
// check upper layer parameter length
if(pBtReq->paraLength < 1)
if (pBtReq->paraLength < 1)
{
DBG_8192C("[MPT], Error!! wrong parameter length=%d (should larger than 1)\n", pBtReq->paraLength);
pBtRsp->status = BT_STATUS_PARAMETER_FORMAT_ERROR_U;
@ -590,12 +590,12 @@ mptbt_BtGetGeneral(
DBG_8192C("[MPT], getType=%d, getParaLen=%d\n", getType, getParaLen);
// check parameter first
switch(getType)
switch (getType)
{
case BT_GGET_REG:
DBG_8192C("[MPT], [BT_GGET_REG]\n");
validParaLen = 5;
if(getParaLen == validParaLen)
if (getParaLen == validParaLen)
{
btOpcode = BT_LO_OP_READ_REG;
regType = pBtReq->pParamStart[1];
@ -603,14 +603,14 @@ mptbt_BtGetGeneral(
regAddr = *pu4Tmp;
DBG_8192C("[MPT], BT_GGET_REG regType=0x%x, regAddr=0x%x!!\n",
regType, regAddr);
if(regType >= BT_REG_MAX)
if (regType >= BT_REG_MAX)
{
pBtRsp->status = (btOpcode<<8)| BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
return paraLen;
}
else
{
if( ((BT_REG_RF==regType)&&(regAddr>0x7f)) ||
if ( ((BT_REG_RF==regType)&&(regAddr>0x7f)) ||
((BT_REG_MODEM==regType)&&(regAddr>0x1ff)) ||
((BT_REG_BLUEWIZE==regType)&&(regAddr>0xfff)) ||
((BT_REG_VENDOR==regType)&&(regAddr>0xfff)) ||
@ -629,11 +629,11 @@ mptbt_BtGetGeneral(
case BT_GGET_REPORT:
DBG_8192C("[MPT], [BT_GGET_REPORT]\n");
validParaLen = 1;
if(getParaLen == validParaLen)
if (getParaLen == validParaLen)
{
reportType = pBtReq->pParamStart[1];
DBG_8192C("[MPT], BT_GGET_REPORT reportType=0x%x!!\n", reportType);
if(reportType >= BT_REPORT_MAX)
if (reportType >= BT_REPORT_MAX)
{
pBtRsp->status = BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
return paraLen;
@ -648,7 +648,7 @@ mptbt_BtGetGeneral(
}
break;
}
if(getParaLen != validParaLen)
if (getParaLen != validParaLen)
{
DBG_8192C("[MPT], Error!! wrong parameter length=%d for BT_GET_GEN_CMD cmd id=0x%x, paraLen should=0x%x\n",
getParaLen, getType, validParaLen);
@ -659,7 +659,7 @@ mptbt_BtGetGeneral(
//
// execute lower layer opcodes
//
if(BT_GGET_REG == getType)
if (BT_GGET_REG == getType)
{
// fill h2c parameters
// here we should write reg value first then write the address, adviced by Austin
@ -671,7 +671,7 @@ mptbt_BtGetGeneral(
// execute h2c and check respond c2h from bt fw is correct or not
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// construct respond status code and data.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -687,14 +687,14 @@ mptbt_BtGetGeneral(
*pu4Tmp = regValue;
paraLen = 4;
}
else if(BT_GGET_STATUS == getType)
else if (BT_GGET_STATUS == getType)
{
btOpcode = BT_LO_OP_GET_BT_STATUS;
h2cParaLen = 0;
// execute h2c and check respond c2h from bt fw is correct or not
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// construct respond status code and data.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -707,9 +707,9 @@ mptbt_BtGetGeneral(
pBtRsp->pParamStart[0], pBtRsp->pParamStart[1]);
paraLen = 2;
}
else if(BT_GGET_REPORT == getType)
else if (BT_GGET_REPORT == getType)
{
switch(reportType)
switch (reportType)
{
case BT_REPORT_RX_PACKET_CNT:
{
@ -719,7 +719,7 @@ mptbt_BtGetGeneral(
// execute h2c and check respond c2h from bt fw is correct or not
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// construct respond status code and data.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -733,7 +733,7 @@ mptbt_BtGetGeneral(
// execute h2c and check respond c2h from bt fw is correct or not
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// construct respond status code and data.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -752,7 +752,7 @@ mptbt_BtGetGeneral(
// execute h2c and check respond c2h from bt fw is correct or not
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// construct respond status code and data.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -766,7 +766,7 @@ mptbt_BtGetGeneral(
// execute h2c and check respond c2h from bt fw is correct or not
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// construct respond status code and data.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -785,7 +785,7 @@ mptbt_BtGetGeneral(
// execute h2c and check respond c2h from bt fw is correct or not
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// construct respond status code and data.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -804,7 +804,7 @@ mptbt_BtGetGeneral(
// execute h2c and check respond c2h from bt fw is correct or not
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// construct respond status code and data.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -818,7 +818,7 @@ mptbt_BtGetGeneral(
// execute h2c and check respond c2h from bt fw is correct or not
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// construct respond status code and data.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -837,7 +837,7 @@ mptbt_BtGetGeneral(
// execute h2c and check respond c2h from bt fw is correct or not
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// construct respond status code and data.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -852,7 +852,7 @@ mptbt_BtGetGeneral(
// execute h2c and check respond c2h from bt fw is correct or not
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// construct respond status code and data.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -863,7 +863,7 @@ mptbt_BtGetGeneral(
bdAddr[0] = pExtC2h->buf[2];
DBG_8192C("[MPT], Connected Target BDAddr:%s", bdAddr);
for(i=0; i<6; i++)
for (i=0; i<6; i++)
{
pBtRsp->pParamStart[i] = bdAddr[5-i];
}
@ -909,14 +909,14 @@ mptbt_BtSetGeneral(
//
// check upper layer opcode version
if(pBtReq->opCodeVer != 1)
if (pBtReq->opCodeVer != 1)
{
DBG_8192C("[MPT], Error!! Upper OP code version not match!!!\n");
pBtRsp->status = BT_STATUS_OPCODE_U_VERSION_MISMATCH;
return paraLen;
}
// check upper layer parameter length
if(pBtReq->paraLength < 1)
if (pBtReq->paraLength < 1)
{
DBG_8192C("[MPT], Error!! wrong parameter length=%d (should larger than 1)\n", pBtReq->paraLength);
pBtRsp->status = BT_STATUS_PARAMETER_FORMAT_ERROR_U;
@ -928,12 +928,12 @@ mptbt_BtSetGeneral(
DBG_8192C("[MPT], setType=%d, setParaLen=%d\n", setType, setParaLen);
// check parameter first
switch(setType)
switch (setType)
{
case BT_GSET_REG:
DBG_8192C ("[MPT], [BT_GSET_REG]\n");
validParaLen = 9;
if(setParaLen == validParaLen)
if (setParaLen == validParaLen)
{
btOpcode = BT_LO_OP_WRITE_REG_VALUE;
regType = pBtReq->pParamStart[1];
@ -943,14 +943,14 @@ mptbt_BtSetGeneral(
regValue = *pu4Tmp;
DBG_8192C("[MPT], BT_GSET_REG regType=0x%x, regAddr=0x%x, regValue=0x%x!!\n",
regType, regAddr, regValue);
if(regType >= BT_REG_MAX)
if (regType >= BT_REG_MAX)
{
pBtRsp->status = (btOpcode<<8)| BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
return paraLen;
}
else
{
if( ((BT_REG_RF==regType)&&(regAddr>0x7f)) ||
if ( ((BT_REG_RF==regType)&&(regAddr>0x7f)) ||
((BT_REG_MODEM==regType)&&(regAddr>0x1ff)) ||
((BT_REG_BLUEWIZE==regType)&&(regAddr>0xfff)) ||
((BT_REG_VENDOR==regType)&&(regAddr>0xfff)) ||
@ -969,10 +969,10 @@ mptbt_BtSetGeneral(
case BT_GSET_TARGET_BD_ADDR:
DBG_8192C("[MPT], [BT_GSET_TARGET_BD_ADDR]\n");
validParaLen = 6;
if(setParaLen == validParaLen)
if (setParaLen == validParaLen)
{
btOpcode = BT_LO_OP_SET_TARGET_BD_ADDR_H;
if( (pBtReq->pParamStart[1]==0) &&
if ( (pBtReq->pParamStart[1]==0) &&
(pBtReq->pParamStart[2]==0) &&
(pBtReq->pParamStart[3]==0) &&
(pBtReq->pParamStart[4]==0) &&
@ -983,7 +983,7 @@ mptbt_BtSetGeneral(
pBtRsp->status = (btOpcode<<8)|BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
return paraLen;
}
if( (pBtReq->pParamStart[1]==0xff) &&
if ( (pBtReq->pParamStart[1]==0xff) &&
(pBtReq->pParamStart[2]==0xff) &&
(pBtReq->pParamStart[3]==0xff) &&
(pBtReq->pParamStart[4]==0xff) &&
@ -1006,11 +1006,11 @@ mptbt_BtSetGeneral(
case BT_GSET_TX_PWR_FINETUNE:
DBG_8192C("[MPT], [BT_GSET_TX_PWR_FINETUNE]\n");
validParaLen = 1;
if(setParaLen == validParaLen)
if (setParaLen == validParaLen)
{
btOpcode = BT_LO_OP_SET_TX_POWER_CALIBRATION;
calVal = pBtReq->pParamStart[1];
if( (calVal<1) || (calVal>9) )
if ( (calVal<1) || (calVal>9) )
{
pBtRsp->status = (btOpcode<<8)|BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
return paraLen;
@ -1019,7 +1019,7 @@ mptbt_BtSetGeneral(
}
break;
case BT_GSET_UPDATE_BT_PATCH:
if(IS_HARDWARE_TYPE_8723AE(Adapter) && Adapter->bFWReady)
if (IS_HARDWARE_TYPE_8723AE(Adapter) && Adapter->bFWReady)
{
u1Byte i;
DBG_8192C ("[MPT], write regs for load patch\n");
@ -1031,7 +1031,7 @@ mptbt_BtSetGeneral(
PlatformEFIOWrite4Byte(Adapter, 0x68, 0xb005000c);
rtw_msleep_os(50);
PlatformEFIOWrite1Byte(Adapter, 0xCC, 0x29);
for(i=0; i<12; i++)
for (i=0; i<12; i++)
rtw_msleep_os(100);
//#if (DEV_BUS_TYPE == RT_PCI_INTERFACE)
// BTFwPatch8723A(Adapter);
@ -1047,7 +1047,7 @@ mptbt_BtSetGeneral(
}
break;
}
if(setParaLen != validParaLen)
if (setParaLen != validParaLen)
{
DBG_8192C("[MPT], Error!! wrong parameter length=%d for BT_SET_GEN_CMD cmd id=0x%x, paraLen should=0x%x\n",
setParaLen, setType, validParaLen);
@ -1058,7 +1058,7 @@ mptbt_BtSetGeneral(
//
// execute lower layer opcodes
//
if(BT_GSET_REG == setType)
if (BT_GSET_REG == setType)
{
// fill h2c parameters
// here we should write reg value first then write the address, adviced by Austin
@ -1070,7 +1070,7 @@ mptbt_BtSetGeneral(
// execute h2c and check respond c2h from bt fw is correct or not
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// construct respond status code and data.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -1086,28 +1086,28 @@ mptbt_BtSetGeneral(
// execute h2c and check respond c2h from bt fw is correct or not
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// construct respond status code and data.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
return paraLen;
}
}
else if(BT_GSET_RESET == setType)
else if (BT_GSET_RESET == setType)
{
btOpcode = BT_LO_OP_RESET;
h2cParaLen = 0;
// execute h2c and check respond c2h from bt fw is correct or not
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// construct respond status code and data.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
return paraLen;
}
}
else if(BT_GSET_TARGET_BD_ADDR == setType)
else if (BT_GSET_TARGET_BD_ADDR == setType)
{
// fill h2c parameters
btOpcode = BT_LO_OP_SET_TARGET_BD_ADDR_L;
@ -1117,7 +1117,7 @@ mptbt_BtSetGeneral(
h2cParaLen = 3;
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// ckeck bt return status.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -1131,14 +1131,14 @@ mptbt_BtSetGeneral(
h2cParaLen = 3;
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// ckeck bt return status.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
return paraLen;
}
}
else if(BT_GSET_TX_PWR_FINETUNE == setType)
else if (BT_GSET_TX_PWR_FINETUNE == setType)
{
// fill h2c parameters
btOpcode = BT_LO_OP_SET_TX_POWER_CALIBRATION;
@ -1146,7 +1146,7 @@ mptbt_BtSetGeneral(
h2cParaLen = 1;
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
// ckeck bt return status.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -1183,14 +1183,14 @@ mptbt_BtSetTxRxPars(
//
// 1. check upper layer opcode version
if(pBtReq->opCodeVer != 1)
if (pBtReq->opCodeVer != 1)
{
DBG_8192C("[MPT], Error!! Upper OP code version not match!!!\n");
pBtRsp->status = BT_STATUS_OPCODE_U_VERSION_MISMATCH;
return paraLen;
}
// 2. check upper layer parameter length
if(pBtReq->paraLength == sizeof(BT_TXRX_PARAMETERS))
if (pBtReq->paraLength == sizeof(BT_TXRX_PARAMETERS))
{
DBG_8192C ("[MPT], pTxRxPars->txrxChannel=0x%x \n", pTxRxPars->txrxChannel);
DBG_8192C ("[MPT], pTxRxPars->txrxTxPktCnt=0x%8x \n", pTxRxPars->txrxTxPktCnt);
@ -1222,7 +1222,7 @@ mptbt_BtSetTxRxPars(
// fill h2c parameters
btOpcode = BT_LO_OP_SET_PKT_HEADER;
if(pTxRxPars->txrxPktHeader > 0x3ffff)
if (pTxRxPars->txrxPktHeader > 0x3ffff)
{
DBG_8192C ("[MPT], Error!! pTxRxPars->txrxPktHeader=0x%x is out of range, (should be between 0x0~0x3ffff)\n", pTxRxPars->txrxPktHeader);
pBtRsp->status = (btOpcode<<8)|BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
@ -1238,7 +1238,7 @@ mptbt_BtSetTxRxPars(
}
// ckeck bt return status.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -1249,7 +1249,7 @@ mptbt_BtSetTxRxPars(
btOpcode = BT_LO_OP_SET_PKT_TYPE_LEN;
{
u2Byte payloadLenLimit=0;
switch(pTxRxPars->txrxPktType)
switch (pTxRxPars->txrxPktType)
{
case MP_BT_PKT_DH1:
payloadLenLimit = 27*8;
@ -1290,7 +1290,7 @@ mptbt_BtSetTxRxPars(
break;
}
if(pTxRxPars->txrxPayloadLen > payloadLenLimit)
if (pTxRxPars->txrxPayloadLen > payloadLenLimit)
{
DBG_8192C ("[MPT], Error!! pTxRxPars->txrxPayloadLen=0x%x, (should smaller than %d)\n",
pTxRxPars->txrxPayloadLen, payloadLenLimit);
@ -1306,7 +1306,7 @@ mptbt_BtSetTxRxPars(
}
// ckeck bt return status.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -1315,7 +1315,7 @@ mptbt_BtSetTxRxPars(
// fill h2c parameters
btOpcode = BT_LO_OP_SET_PKT_CNT_L_PL_TYPE;
if(pTxRxPars->txrxPayloadType > MP_BT_PAYLOAD_MAX)
if (pTxRxPars->txrxPayloadType > MP_BT_PAYLOAD_MAX)
{
DBG_8192C ("[MPT], Error!! pTxRxPars->txrxPayloadType=0x%x, (should be between 0~4)\n", pTxRxPars->txrxPayloadType);
pBtRsp->status = (btOpcode<<8)|BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
@ -1331,7 +1331,7 @@ mptbt_BtSetTxRxPars(
}
// ckeck bt return status.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -1340,7 +1340,7 @@ mptbt_BtSetTxRxPars(
// fill h2c parameters
btOpcode = BT_LO_OP_SET_PKT_CNT_H_PKT_INTV;
if(pTxRxPars->txrxTxPktInterval > 15)
if (pTxRxPars->txrxTxPktInterval > 15)
{
DBG_8192C ("[MPT], Error!! pTxRxPars->txrxTxPktInterval=0x%x, (should be between 0~15)\n", pTxRxPars->txrxTxPktInterval);
pBtRsp->status = (btOpcode<<8)|BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
@ -1356,7 +1356,7 @@ mptbt_BtSetTxRxPars(
}
// ckeck bt return status.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -1372,7 +1372,7 @@ mptbt_BtSetTxRxPars(
}
// ckeck bt return status.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -1382,7 +1382,7 @@ mptbt_BtSetTxRxPars(
// fill h2c parameters
btOpcode = BT_LO_OP_SET_CHNL_TX_GAIN;
if( (pTxRxPars->txrxChannel > 78) ||
if ( (pTxRxPars->txrxChannel > 78) ||
(pTxRxPars->txrxTxGainIndex > 7) )
{
DBG_8192C ("[MPT], Error!! pTxRxPars->txrxChannel=0x%x, (should be between 0~78)\n", pTxRxPars->txrxChannel);
@ -1399,7 +1399,7 @@ mptbt_BtSetTxRxPars(
}
// ckeck bt return status.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -1408,7 +1408,7 @@ mptbt_BtSetTxRxPars(
// fill h2c parameters
btOpcode = BT_LO_OP_SET_BD_ADDR_L;
if( (pTxRxPars->txrxBdaddr[0]==0) &&
if ( (pTxRxPars->txrxBdaddr[0]==0) &&
(pTxRxPars->txrxBdaddr[1]==0) &&
(pTxRxPars->txrxBdaddr[2]==0) &&
(pTxRxPars->txrxBdaddr[3]==0) &&
@ -1419,7 +1419,7 @@ mptbt_BtSetTxRxPars(
pBtRsp->status = (btOpcode<<8)|BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
return paraLen;
}
if( (pTxRxPars->txrxBdaddr[0]==0xff) &&
if ( (pTxRxPars->txrxBdaddr[0]==0xff) &&
(pTxRxPars->txrxBdaddr[1]==0xff) &&
(pTxRxPars->txrxBdaddr[2]==0xff) &&
(pTxRxPars->txrxBdaddr[3]==0xff) &&
@ -1439,7 +1439,7 @@ mptbt_BtSetTxRxPars(
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
}
// ckeck bt return status.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -1455,7 +1455,7 @@ mptbt_BtSetTxRxPars(
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
}
// ckeck bt return status.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -1488,14 +1488,14 @@ mptbt_BtTestCtrl(
//
// 1. check upper layer opcode version
if(pBtReq->opCodeVer != 1)
if (pBtReq->opCodeVer != 1)
{
DBG_8192C("[MPT], Error!! Upper OP code version not match!!!\n");
pBtRsp->status = BT_STATUS_OPCODE_U_VERSION_MISMATCH;
return paraLen;
}
// 2. check upper layer parameter length
if(1 == pBtReq->paraLength)
if (1 == pBtReq->paraLength)
{
testCtrl = pBtReq->pParamStart[0];
DBG_8192C("[MPT], testCtrl=%d \n", testCtrl);
@ -1514,7 +1514,7 @@ mptbt_BtTestCtrl(
// 1. fill h2c parameters
// check bt mode
btOpcode = BT_LO_OP_TEST_CTRL;
if(testCtrl >= MP_BT_TEST_MAX)
if (testCtrl >= MP_BT_TEST_MAX)
{
DBG_8192C("[MPT], Error!! testCtrl=0x%x, (should be between smaller or equal to 0x%x)\n",
testCtrl, MP_BT_TEST_MAX-1);
@ -1529,7 +1529,7 @@ mptbt_BtTestCtrl(
}
// 3. construct respond status code and data.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -1570,7 +1570,7 @@ mptbt_TestBT(
// 3. construct respond status code and data.
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
{
pBtRsp->status = ((btOpcode<<8)|retStatus);
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
@ -1599,7 +1599,7 @@ mptbt_BtControlProcess(
DBG_8192C("[MPT], input opCodeVer=%d\n", pBtReq->opCodeVer);
DBG_8192C("[MPT], input OpCode=%d\n", pBtReq->OpCode);
DBG_8192C("[MPT], paraLength=%d \n", pBtReq->paraLength);
if(pBtReq->paraLength)
if (pBtReq->paraLength)
{
//DBG_8192C("[MPT], parameters(hex):0x%x %d \n",&pBtReq->pParamStart[0], pBtReq->paraLength);
}
@ -1612,7 +1612,7 @@ mptbt_BtControlProcess(
_rtw_memset((PVOID)&pMptCtx->mptOutBuf[0], '\0',100);
switch(pBtReq->OpCode)
switch (pBtReq->OpCode)
{
case BT_UP_OP_BT_READY:
DBG_8192C("[MPT], OPcode : [BT_READY]\n");

View file

@ -130,7 +130,7 @@ _func_enter_;
#ifdef PLATFORM_OS_XP
pevtpriv->pc2h_mdl= IoAllocateMdl((u8 *)pevtpriv->c2h_mem, C2H_MEM_SZ , FALSE, FALSE, NULL);
if(pevtpriv->pc2h_mdl == NULL){
if (pevtpriv->pc2h_mdl == NULL){
res= _FAIL;
goto exit;
}
@ -172,7 +172,7 @@ _func_enter_;
#ifdef CONFIG_C2H_WK
_cancel_workitem_sync(&pevtpriv->c2h_wk);
while(pevtpriv->c2h_wk_alive)
while (pevtpriv->c2h_wk_alive)
rtw_msleep_os(10);
while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
@ -194,7 +194,7 @@ void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv)
{
_func_enter_;
if(pcmdpriv){
if (pcmdpriv){
_rtw_spinlock_free(&(pcmdpriv->cmd_queue.lock));
_rtw_free_sema(&(pcmdpriv->cmd_queue_sema));
//_rtw_free_sema(&(pcmdpriv->cmd_done_sema));
@ -309,14 +309,14 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
#ifdef SUPPORT_HW_RFOFF_DETECTED
//To decide allow or not
if( (pcmdpriv->padapter->pwrctrlpriv.bHWPwrPindetect)
if ( (pcmdpriv->padapter->pwrctrlpriv.bHWPwrPindetect)
&&(!pcmdpriv->padapter->registrypriv.usbss_enable)
)
{
if(cmd_obj->cmdcode == GEN_CMD_CODE(_Set_Drv_Extra) )
if (cmd_obj->cmdcode == GEN_CMD_CODE(_Set_Drv_Extra) )
{
struct drvextra_cmd_parm *pdrvextra_cmd_parm = (struct drvextra_cmd_parm *)cmd_obj->parmbuf;
if(pdrvextra_cmd_parm->ec_id == POWER_SAVING_CTRL_WK_CID)
if (pdrvextra_cmd_parm->ec_id == POWER_SAVING_CTRL_WK_CID)
{
//DBG_871X("==>enqueue POWER_SAVING_CTRL_WK_CID\n");
bAllow = _TRUE;
@ -325,10 +325,10 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
}
#endif
if(cmd_obj->cmdcode == GEN_CMD_CODE(_SetChannelPlan))
if (cmd_obj->cmdcode == GEN_CMD_CODE(_SetChannelPlan))
bAllow = _TRUE;
if( (pcmdpriv->padapter->hw_init_completed ==_FALSE && bAllow == _FALSE)
if ( (pcmdpriv->padapter->hw_init_completed ==_FALSE && bAllow == _FALSE)
|| pcmdpriv->cmdthd_running== _FALSE //com_thread not running
)
{
@ -363,14 +363,14 @@ _func_enter_;
pcmdpriv = &(padapter->pbuddy_adapter->cmdpriv);
#endif
if( _FAIL == (res=rtw_cmd_filter(pcmdpriv, cmd_obj)) ) {
if ( _FAIL == (res=rtw_cmd_filter(pcmdpriv, cmd_obj)) ) {
rtw_free_cmd_obj(cmd_obj);
goto exit;
}
res = _rtw_enqueue_cmd(&pcmdpriv->cmd_queue, cmd_obj);
if(res == _SUCCESS)
if (res == _SUCCESS)
_rtw_up_sema(&pcmdpriv->cmd_queue_sema);
exit:
@ -404,15 +404,15 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd)
{
_func_enter_;
if((pcmd->cmdcode!=_JoinBss_CMD_) &&(pcmd->cmdcode!= _CreateBss_CMD_))
if ((pcmd->cmdcode!=_JoinBss_CMD_) &&(pcmd->cmdcode!= _CreateBss_CMD_))
{
//free parmbuf in cmd_obj
rtw_mfree((unsigned char*)pcmd->parmbuf, pcmd->cmdsz);
}
if(pcmd->rsp!=NULL)
if (pcmd->rsp!=NULL)
{
if(pcmd->rspsz!= 0)
if (pcmd->rspsz!= 0)
{
//free rsp in cmd_obj
rtw_mfree((unsigned char*)pcmd->rsp, pcmd->rspsz);
@ -447,7 +447,7 @@ _func_enter_;
RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("start r871x rtw_cmd_thread !!!!\n"));
while(1)
while (1)
{
if (_rtw_down_sema(&pcmdpriv->cmd_queue_sema) == _FAIL)
break;
@ -476,14 +476,14 @@ _next:
break;
}
if(!(pcmd = rtw_dequeue_cmd(pcmdpriv))) {
if (!(pcmd = rtw_dequeue_cmd(pcmdpriv))) {
#ifdef CONFIG_LPS_LCLK
rtw_unregister_cmd_alive(padapter);
#endif
continue;
}
if( _FAIL == rtw_cmd_filter(pcmdpriv, pcmd) )
if ( _FAIL == rtw_cmd_filter(pcmdpriv, pcmd) )
{
pcmd->res = H2C_DROPPED;
goto post_process;
@ -495,7 +495,7 @@ _next:
_rtw_memcpy(pcmdbuf, pcmd->parmbuf, pcmd->cmdsz);
if(pcmd->cmdcode <= (sizeof(wlancmds) /sizeof(struct cmd_hdl)))
if (pcmd->cmdcode <= (sizeof(wlancmds) /sizeof(struct cmd_hdl)))
{
cmd_hdl = wlancmds[pcmd->cmdcode].h2cfuns;
@ -517,10 +517,10 @@ _next:
post_process:
//call callback function for post-processed
if(pcmd->cmdcode <= (sizeof(rtw_cmd_callback) /sizeof(struct _cmd_callback)))
if (pcmd->cmdcode <= (sizeof(rtw_cmd_callback) /sizeof(struct _cmd_callback)))
{
pcmd_callback = rtw_cmd_callback[pcmd->cmdcode].callback;
if(pcmd_callback == NULL)
if (pcmd_callback == NULL)
{
RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("mlme_cmd_hdl(): pcmd_callback=0x%p, cmdcode=0x%x\n", pcmd_callback, pcmd->cmdcode));
rtw_free_cmd_obj(pcmd);
@ -548,13 +548,13 @@ post_process:
// free all cmd_obj resources
do{
pcmd = rtw_dequeue_cmd(pcmdpriv);
if(pcmd==NULL)
if (pcmd==NULL)
break;
//DBG_871X("%s: leaving... drop cmdcode:%u\n", __FUNCTION__, pcmd->cmdcode);
rtw_free_cmd_obj(pcmd);
}while(1);
}while (1);
_rtw_up_sema(&pcmdpriv->terminate_cmdthread_sema);
@ -624,7 +624,7 @@ void rtw_free_evt_obj(struct evt_obj *pevtobj)
{
_func_enter_;
if(pevtobj->parmbuf)
if (pevtobj->parmbuf)
rtw_mfree((unsigned char*)pevtobj->parmbuf, pevtobj->evtsz);
rtw_mfree((unsigned char*)pevtobj, sizeof(struct evt_obj));
@ -701,7 +701,7 @@ u8 rtw_sitesurvey_cmd(_adapter *padapter, NDIS_802_11_SSID *ssid, int ssid_num,
_func_enter_;
#ifdef CONFIG_LPS
if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE){
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE){
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1);
}
#endif
@ -763,12 +763,12 @@ _func_enter_;
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
if(res == _SUCCESS) {
if (res == _SUCCESS) {
pmlmepriv->scan_start_time = rtw_get_current_time();
#ifdef CONFIG_STA_MODE_SCAN_UNDER_AP_MODE
if((padapter->pbuddy_adapter->mlmeextpriv.mlmext_info.state&0x03) == WIFI_FW_AP_STATE)
if ((padapter->pbuddy_adapter->mlmeextpriv.mlmext_info.state&0x03) == WIFI_FW_AP_STATE)
_set_timer(&pmlmepriv->scan_to_timer, SURVEY_TO * ( 38 + ( 38 / RTW_SCAN_NUM_OF_CH ) * RTW_STAY_AP_CH_MILLISECOND ) + 1000 );
else
#endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE
@ -878,13 +878,13 @@ u8 rtw_setphy_cmd(_adapter *padapter, u8 modem, u8 ch)
_func_enter_;
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ph2c==NULL){
if (ph2c==NULL){
res= _FAIL;
goto exit;
}
psetphypara = (struct setphy_parm*)rtw_zmalloc(sizeof(struct setphy_parm));
if(psetphypara==NULL){
if (psetphypara==NULL){
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
res= _FAIL;
goto exit;
@ -911,13 +911,13 @@ u8 rtw_setbbreg_cmd(_adapter*padapter, u8 offset, u8 val)
u8 res=_SUCCESS;
_func_enter_;
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ph2c==NULL){
if (ph2c==NULL){
res= _FAIL;
goto exit;
}
pwritebbparm = (struct writeBB_parm*)rtw_zmalloc(sizeof(struct writeBB_parm));
if(pwritebbparm==NULL){
if (pwritebbparm==NULL){
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
res= _FAIL;
goto exit;
@ -943,13 +943,13 @@ u8 rtw_getbbreg_cmd(_adapter *padapter, u8 offset, u8 *pval)
_func_enter_;
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ph2c==NULL){
if (ph2c==NULL){
res=_FAIL;
goto exit;
}
prdbbparm = (struct readBB_parm*)rtw_zmalloc(sizeof(struct readBB_parm));
if(prdbbparm ==NULL){
if (prdbbparm ==NULL){
rtw_mfree((unsigned char *) ph2c, sizeof(struct cmd_obj));
return _FAIL;
}
@ -977,13 +977,13 @@ u8 rtw_setrfreg_cmd(_adapter *padapter, u8 offset, u32 val)
u8 res=_SUCCESS;
_func_enter_;
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ph2c==NULL){
if (ph2c==NULL){
res= _FAIL;
goto exit;
}
pwriterfparm = (struct writeRF_parm*)rtw_zmalloc(sizeof(struct writeRF_parm));
if(pwriterfparm==NULL){
if (pwriterfparm==NULL){
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
res= _FAIL;
goto exit;
@ -1010,13 +1010,13 @@ u8 rtw_getrfreg_cmd(_adapter *padapter, u8 offset, u8 *pval)
_func_enter_;
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ph2c==NULL){
if (ph2c==NULL){
res= _FAIL;
goto exit;
}
prdrfparm = (struct readRF_parm*)rtw_zmalloc(sizeof(struct readRF_parm));
if(prdrfparm ==NULL){
if (prdrfparm ==NULL){
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
res= _FAIL;
goto exit;
@ -1089,7 +1089,7 @@ _func_enter_;
}
pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(pcmd==NULL){
if (pcmd==NULL){
res= _FAIL;
goto exit;
}
@ -1128,7 +1128,7 @@ u8 rtw_createbss_cmd_ex(_adapter *padapter, unsigned char *pbss, unsigned int s
_func_enter_;
pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(pcmd==NULL){
if (pcmd==NULL){
res= _FAIL;
goto exit;
}
@ -1178,7 +1178,7 @@ _func_enter_;
}
pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(pcmd==NULL){
if (pcmd==NULL){
res=_FAIL;
RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("rtw_joinbss_cmd: memory allocate for cmd_obj fail!!!\n"));
goto exit;
@ -1198,7 +1198,7 @@ _func_enter_;
//for hidden ap to set fw_state here
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) != _TRUE)
{
switch(ndis_network_mode)
switch (ndis_network_mode)
{
case Ndis802_11IBSS:
set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
@ -1217,9 +1217,9 @@ _func_enter_;
}
psecnetwork=(WLAN_BSSID_EX *)&psecuritypriv->sec_bss;
if(psecnetwork==NULL)
if (psecnetwork==NULL)
{
if(pcmd !=NULL)
if (pcmd !=NULL)
rtw_mfree((unsigned char *)pcmd, sizeof(struct cmd_obj));
res=_FAIL;
@ -1236,7 +1236,7 @@ _func_enter_;
auth=&psecuritypriv->authenticator_ie[0];
psecuritypriv->authenticator_ie[0]=(unsigned char)psecnetwork->IELength;
if((psecnetwork->IELength-12) < (256-1)) {
if ((psecnetwork->IELength-12) < (256-1)) {
_rtw_memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], psecnetwork->IELength-12);
} else {
_rtw_memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], (256-1));
@ -1258,7 +1258,7 @@ _func_enter_;
pqospriv->qos_option = 0;
if(pregistrypriv->wmm_enable)
if (pregistrypriv->wmm_enable)
{
u32 tmp_len;
@ -1277,7 +1277,7 @@ _func_enter_;
#ifdef CONFIG_80211N_HT
phtpriv->ht_option = _FALSE;
if(pregistrypriv->ht_enable)
if (pregistrypriv->ht_enable)
{
// Added by Albert 2010/06/23
// For the WEP mode, we will use the bg mode to do the connection to avoid some IOT issue.
@ -1306,7 +1306,7 @@ _func_enter_;
#if 0
psecuritypriv->supplicant_ie[0]=(u8)psecnetwork->IELength;
if(psecnetwork->IELength < (256-1))
if (psecnetwork->IELength < (256-1))
{
_rtw_memcpy(&psecuritypriv->supplicant_ie[1], &psecnetwork->IEs[0], psecnetwork->IELength);
}
@ -1406,13 +1406,13 @@ u8 rtw_setopmode_cmd(_adapter *padapter, NDIS_802_11_NETWORK_INFRASTRUCTURE net
_func_enter_;
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ph2c==NULL){
if (ph2c==NULL){
res= _FALSE;
goto exit;
}
psetop = (struct setopmode_parm*)rtw_zmalloc(sizeof(struct setopmode_parm));
if(psetop==NULL){
if (psetop==NULL){
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
res=_FALSE;
goto exit;
@ -1451,14 +1451,14 @@ _func_enter_;
}
psetstakey_para = (struct set_stakey_parm*)rtw_zmalloc(sizeof(struct set_stakey_parm));
if(psetstakey_para==NULL){
if (psetstakey_para==NULL){
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
res=_FAIL;
goto exit;
}
psetstakey_rsp = (struct set_stakey_rsp*)rtw_zmalloc(sizeof(struct set_stakey_rsp));
if(psetstakey_rsp == NULL){
if (psetstakey_rsp == NULL){
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
rtw_mfree((u8 *) psetstakey_para, sizeof(struct set_stakey_parm));
res=_FAIL;
@ -1471,9 +1471,9 @@ _func_enter_;
_rtw_memcpy(psetstakey_para->addr, sta->hwaddr,ETH_ALEN);
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE)){
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)){
#ifdef CONFIG_TDLS
if(sta->tdls_sta_state&TDLS_LINKED_STATE)
if (sta->tdls_sta_state&TDLS_LINKED_STATE)
psetstakey_para->algorithm=(u8)sta->dot118021XPrivacy;
else
#endif //CONFIG_TDLS
@ -1484,7 +1484,7 @@ _func_enter_;
if (unicast_key == _TRUE) {
#ifdef CONFIG_TDLS
if((sta->tdls_sta_state&TDLS_LINKED_STATE)==TDLS_LINKED_STATE)
if ((sta->tdls_sta_state&TDLS_LINKED_STATE)==TDLS_LINKED_STATE)
_rtw_memcpy(&psetstakey_para->key, sta->tpk.tk, 16);
else
#endif //CONFIG_TDLS
@ -1518,7 +1518,7 @@ u8 rtw_clearstakey_cmd(_adapter *padapter, u8 *psta, u8 entry, u8 enqueue)
_func_enter_;
if(!enqueue)
if (!enqueue)
{
clear_cam_entry(padapter, entry);
}
@ -1531,14 +1531,14 @@ _func_enter_;
}
psetstakey_para = (struct set_stakey_parm*)rtw_zmalloc(sizeof(struct set_stakey_parm));
if(psetstakey_para==NULL){
if (psetstakey_para==NULL){
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
res=_FAIL;
goto exit;
}
psetstakey_rsp = (struct set_stakey_rsp*)rtw_zmalloc(sizeof(struct set_stakey_rsp));
if(psetstakey_rsp == NULL){
if (psetstakey_rsp == NULL){
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
rtw_mfree((u8 *) psetstakey_para, sizeof(struct set_stakey_parm));
res=_FAIL;
@ -1575,13 +1575,13 @@ u8 rtw_setrttbl_cmd(_adapter *padapter, struct setratable_parm *prate_table)
_func_enter_;
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ph2c==NULL){
if (ph2c==NULL){
res= _FAIL;
goto exit;
}
psetrttblparm = (struct setratable_parm*)rtw_zmalloc(sizeof(struct setratable_parm));
if(psetrttblparm==NULL){
if (psetrttblparm==NULL){
rtw_mfree((unsigned char *) ph2c, sizeof(struct cmd_obj));
res= _FAIL;
goto exit;
@ -1607,13 +1607,13 @@ u8 rtw_getrttbl_cmd(_adapter *padapter, struct getratable_rsp *pval)
_func_enter_;
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ph2c==NULL){
if (ph2c==NULL){
res= _FAIL;
goto exit;
}
pgetrttblparm = (struct getratable_parm*)rtw_zmalloc(sizeof(struct getratable_parm));
if(pgetrttblparm==NULL){
if (pgetrttblparm==NULL){
rtw_mfree((unsigned char *) ph2c, sizeof(struct cmd_obj));
res= _FAIL;
goto exit;
@ -1649,20 +1649,20 @@ u8 rtw_setassocsta_cmd(_adapter *padapter, u8 *mac_addr)
_func_enter_;
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ph2c==NULL){
if (ph2c==NULL){
res= _FAIL;
goto exit;
}
psetassocsta_para = (struct set_assocsta_parm*)rtw_zmalloc(sizeof(struct set_assocsta_parm));
if(psetassocsta_para==NULL){
if (psetassocsta_para==NULL){
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
res=_FAIL;
goto exit;
}
psetassocsta_rsp = (struct set_stakey_rsp*)rtw_zmalloc(sizeof(struct set_assocsta_rsp));
if(psetassocsta_rsp==NULL){
if (psetassocsta_rsp==NULL){
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
rtw_mfree((u8 *) psetassocsta_para, sizeof(struct set_assocsta_parm));
return _FAIL;
@ -1694,13 +1694,13 @@ u8 rtw_addbareq_cmd(_adapter*padapter, u8 tid, u8 *addr)
_func_enter_;
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ph2c==NULL){
if (ph2c==NULL){
res= _FAIL;
goto exit;
}
paddbareq_parm = (struct addBaReq_parm*)rtw_zmalloc(sizeof(struct addBaReq_parm));
if(paddbareq_parm==NULL){
if (paddbareq_parm==NULL){
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
res= _FAIL;
goto exit;
@ -1738,13 +1738,13 @@ _func_enter_;
#endif
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ph2c==NULL){
if (ph2c==NULL){
res= _FAIL;
goto exit;
}
pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
if(pdrvextra_cmd_parm==NULL){
if (pdrvextra_cmd_parm==NULL){
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
res= _FAIL;
goto exit;
@ -1796,7 +1796,7 @@ _func_enter_;
if (enqueue) {
/* need enqueue, prepare cmd_obj and enqueue */
pcmdobj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(pcmdobj == NULL){
if (pcmdobj == NULL){
rtw_mfree((u8 *)set_ch_parm, sizeof(*set_ch_parm));
res=_FAIL;
goto exit;
@ -1806,7 +1806,7 @@ _func_enter_;
res = rtw_enqueue_cmd(pcmdpriv, pcmdobj);
} else {
/* no need to enqueue, do the cmd hdl directly and free cmd parameter */
if( H2C_SUCCESS !=set_ch_hdl(padapter, (u8 *)set_ch_parm) )
if ( H2C_SUCCESS !=set_ch_hdl(padapter, (u8 *)set_ch_parm) )
res = _FAIL;
rtw_mfree((u8 *)set_ch_parm, sizeof(*set_ch_parm));
@ -1836,24 +1836,24 @@ _func_enter_;
RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+rtw_set_chplan_cmd\n"));
//check input parameter
if(!rtw_is_channel_plan_valid(chplan)) {
if (!rtw_is_channel_plan_valid(chplan)) {
res = _FAIL;
goto exit;
}
//prepare cmd parameter
setChannelPlan_param = (struct SetChannelPlan_param *)rtw_zmalloc(sizeof(struct SetChannelPlan_param));
if(setChannelPlan_param == NULL) {
if (setChannelPlan_param == NULL) {
res= _FAIL;
goto exit;
}
setChannelPlan_param->channel_plan=chplan;
if(enqueue)
if (enqueue)
{
//need enqueue, prepare cmd_obj and enqueue
pcmdobj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(pcmdobj == NULL){
if (pcmdobj == NULL){
rtw_mfree((u8 *)setChannelPlan_param, sizeof(struct SetChannelPlan_param));
res=_FAIL;
goto exit;
@ -1865,14 +1865,14 @@ _func_enter_;
else
{
//no need to enqueue, do the cmd hdl directly and free cmd parameter
if( H2C_SUCCESS !=set_chplan_hdl(padapter, (unsigned char *)setChannelPlan_param) )
if ( H2C_SUCCESS !=set_chplan_hdl(padapter, (unsigned char *)setChannelPlan_param) )
res = _FAIL;
rtw_mfree((u8 *)setChannelPlan_param, sizeof(struct SetChannelPlan_param));
}
//do something based on res...
if(res == _SUCCESS)
if (res == _SUCCESS)
padapter->mlmepriv.ChannelPlan = chplan;
exit:
@ -1895,13 +1895,13 @@ _func_enter_;
RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+rtw_led_blink_cmd\n"));
pcmdobj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(pcmdobj == NULL){
if (pcmdobj == NULL){
res=_FAIL;
goto exit;
}
ledBlink_param = (struct LedBlink_param *)rtw_zmalloc(sizeof(struct LedBlink_param));
if(ledBlink_param == NULL) {
if (ledBlink_param == NULL) {
rtw_mfree((u8 *)pcmdobj, sizeof(struct cmd_obj));
res= _FAIL;
goto exit;
@ -1933,13 +1933,13 @@ _func_enter_;
RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+rtw_set_csa_cmd\n"));
pcmdobj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(pcmdobj == NULL){
if (pcmdobj == NULL){
res=_FAIL;
goto exit;
}
setChannelSwitch_param = (struct SetChannelSwitch_param *)rtw_zmalloc(sizeof(struct SetChannelSwitch_param));
if(setChannelSwitch_param == NULL) {
if (setChannelSwitch_param == NULL) {
rtw_mfree((u8 *)pcmdobj, sizeof(struct cmd_obj));
res= _FAIL;
goto exit;
@ -1973,13 +1973,13 @@ _func_enter_;
RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+rtw_set_tdls_cmd\n"));
pcmdobj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(pcmdobj == NULL){
if (pcmdobj == NULL){
res=_FAIL;
goto exit;
}
TDLSoption= (struct TDLSoption_param *)rtw_zmalloc(sizeof(struct TDLSoption_param));
if(TDLSoption == NULL) {
if (TDLSoption == NULL) {
rtw_mfree((u8 *)pcmdobj, sizeof(struct cmd_obj));
res= _FAIL;
goto exit;
@ -2020,15 +2020,15 @@ static void traffic_status_watchdog(_adapter *padapter)
//
// Determine if our traffic is busy now
//
if((check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE)
if ((check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE)
/*&& !MgntInitAdapterInProgress(pMgntInfo)*/)
{
#ifdef CONFIG_BT_COEXIST
if( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 50 ||
if ( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 50 ||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 50 )
#else // !CONFIG_BT_COEXIST
if( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 100 ||
if ( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 100 ||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 100 )
#endif // !CONFIG_BT_COEXIST
{
@ -2041,7 +2041,7 @@ static void traffic_status_watchdog(_adapter *padapter)
}
// Higher Tx/Rx data.
if( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 4000 ||
if ( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 4000 ||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 4000 )
{
bHigherBusyTraffic = _TRUE;
@ -2062,7 +2062,7 @@ static void traffic_status_watchdog(_adapter *padapter)
if (bPktCount > 20 && !pmlmepriv->ftp_lock_flag) {
pmlmepriv->ftp_lock_flag = 1;
rtw_lock_suspend();
} else if(bPktCount == 0 && pmlmepriv->ftp_lock_flag) {
} else if (bPktCount == 0 && pmlmepriv->ftp_lock_flag) {
pmlmepriv->ftp_lock_flag = 0;
rtw_unlock_suspend();
}
@ -2070,7 +2070,7 @@ static void traffic_status_watchdog(_adapter *padapter)
#ifdef CONFIG_TDLS
#ifdef CONFIG_TDLS_AUTOSETUP
if( ( ptdlsinfo->watchdog_count % TDLS_WATCHDOG_PERIOD ) == 0 ) //10 * 2sec, periodically sending
if ( ( ptdlsinfo->watchdog_count % TDLS_WATCHDOG_PERIOD ) == 0 ) //10 * 2sec, periodically sending
issue_tdls_dis_req( padapter, NULL );
ptdlsinfo->watchdog_count++;
#endif //CONFIG_TDLS_AUTOSETUP
@ -2082,7 +2082,7 @@ static void traffic_status_watchdog(_adapter *padapter)
#endif
{
// check traffic for powersaving.
if( ((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod + pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8 ) ||
if ( ((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod + pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8 ) ||
(pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2) )
{
//DBG_871X("Tx = %d, Rx = %d \n",pmlmepriv->LinkDetectInfo.NumTxOkInPeriod,pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod);
@ -2094,7 +2094,7 @@ static void traffic_status_watchdog(_adapter *padapter)
}
// LeisurePS only work in infra mode.
if(bEnterPS)
if (bEnterPS)
{
LPS_Enter(padapter);
}
@ -2133,7 +2133,7 @@ void dynamic_chk_wk_hdl(_adapter *padapter, u8 *pbuf, int sz)
#ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK
#ifdef CONFIG_AP_MODE
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
{
expire_timeout_chk(padapter);
}
@ -2144,7 +2144,7 @@ void dynamic_chk_wk_hdl(_adapter *padapter, u8 *pbuf, int sz)
rtw_hal_sreset_xmit_status_check(padapter);
#endif
//if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING|_FW_UNDER_SURVEY)==_FALSE)
//if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING|_FW_UNDER_SURVEY)==_FALSE)
{
linked_status_chk(padapter);
traffic_status_watchdog(padapter);
@ -2173,13 +2173,13 @@ void lps_ctrl_wk_hdl(_adapter *padapter, u8 lps_ctrl_type)
_func_enter_;
if((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE)
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE)
|| (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE))
{
return;
}
switch(lps_ctrl_type)
switch (lps_ctrl_type)
{
case LPS_CTRL_SCAN:
//DBG_871X("LPS_CTRL_SCAN \n");
@ -2259,19 +2259,19 @@ u8 rtw_lps_ctrl_wk_cmd(_adapter*padapter, u8 lps_ctrl_type, u8 enqueue)
_func_enter_;
//if(!pwrctrlpriv->bLeisurePs)
//if (!pwrctrlpriv->bLeisurePs)
// return res;
if(enqueue)
if (enqueue)
{
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ph2c==NULL){
if (ph2c==NULL){
res= _FAIL;
goto exit;
}
pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
if(pdrvextra_cmd_parm==NULL){
if (pdrvextra_cmd_parm==NULL){
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
res= _FAIL;
goto exit;
@ -2316,13 +2316,13 @@ u8 rtw_rpt_timer_cfg_cmd(_adapter*padapter, u16 minRptTime)
_func_enter_;
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ph2c==NULL){
if (ph2c==NULL){
res= _FAIL;
goto exit;
}
pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
if(pdrvextra_cmd_parm==NULL){
if (pdrvextra_cmd_parm==NULL){
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
res= _FAIL;
goto exit;
@ -2359,18 +2359,18 @@ u8 rtw_antenna_select_cmd(_adapter*padapter, u8 antenna,u8 enqueue)
_func_enter_;
rtw_hal_get_def_var(padapter, HAL_DEF_IS_SUPPORT_ANT_DIV, &(bSupportAntDiv));
if(_FALSE == bSupportAntDiv ) return res;
if (_FALSE == bSupportAntDiv ) return res;
if(_TRUE == enqueue)
if (_TRUE == enqueue)
{
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ph2c==NULL){
if (ph2c==NULL){
res= _FAIL;
goto exit;
}
pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
if(pdrvextra_cmd_parm==NULL){
if (pdrvextra_cmd_parm==NULL){
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
res= _FAIL;
goto exit;
@ -2412,19 +2412,19 @@ u8 p2p_protocol_wk_cmd(_adapter*padapter, int intCmdType )
_func_enter_;
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
{
return res;
}
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ph2c==NULL){
if (ph2c==NULL){
res= _FAIL;
goto exit;
}
pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
if(pdrvextra_cmd_parm==NULL){
if (pdrvextra_cmd_parm==NULL){
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
res= _FAIL;
goto exit;
@ -2462,13 +2462,13 @@ _func_enter_;
#endif
ppscmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ppscmd==NULL){
if (ppscmd==NULL){
res= _FAIL;
goto exit;
}
pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
if(pdrvextra_cmd_parm==NULL){
if (pdrvextra_cmd_parm==NULL){
rtw_mfree((unsigned char *)ppscmd, sizeof(struct cmd_obj));
res= _FAIL;
goto exit;
@ -2497,31 +2497,31 @@ static void rtw_chk_hi_queue_hdl(_adapter *padapter)
struct sta_priv *pstapriv = &padapter->stapriv;
psta_bmc = rtw_get_bcmc_stainfo(padapter);
if(!psta_bmc)
if (!psta_bmc)
return;
if(psta_bmc->sleepq_len==0)
if (psta_bmc->sleepq_len==0)
{
u8 val = 0;
//while((rtw_read32(padapter, 0x414)&0x00ffff00)!=0)
//while((rtw_read32(padapter, 0x414)&0x0000ff00)!=0)
//while ((rtw_read32(padapter, 0x414)&0x00ffff00)!=0)
//while ((rtw_read32(padapter, 0x414)&0x0000ff00)!=0)
rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &val);
while(_FALSE == val)
while (_FALSE == val)
{
rtw_msleep_os(100);
cnt++;
if(cnt>10)
if (cnt>10)
break;
rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &val);
}
if(cnt<=10)
if (cnt<=10)
{
pstapriv->tim_bitmap &= ~BIT(0);
pstapriv->sta_dz_bitmap &= ~BIT(0);
@ -2545,13 +2545,13 @@ u8 rtw_chk_hi_queue_cmd(_adapter*padapter)
u8 res = _SUCCESS;
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ph2c==NULL){
if (ph2c==NULL){
res= _FAIL;
goto exit;
}
pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
if(pdrvextra_cmd_parm==NULL){
if (pdrvextra_cmd_parm==NULL){
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
res= _FAIL;
goto exit;
@ -2678,12 +2678,12 @@ u8 rtw_drvextra_cmd_hdl(_adapter *padapter, unsigned char *pbuf)
{
struct drvextra_cmd_parm *pdrvextra_cmd;
if(!pbuf)
if (!pbuf)
return H2C_PARAMETERS_ERROR;
pdrvextra_cmd = (struct drvextra_cmd_parm*)pbuf;
switch(pdrvextra_cmd->ec_id)
switch (pdrvextra_cmd->ec_id)
{
case DYNAMIC_CHK_WK_CID:
dynamic_chk_wk_hdl(padapter, pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size);
@ -2749,7 +2749,7 @@ void rtw_survey_cmd_callback(_adapter* padapter , struct cmd_obj *pcmd)
_func_enter_;
if(pcmd->res == H2C_DROPPED)
if (pcmd->res == H2C_DROPPED)
{
//TODO: cancel timer and do timeout handler directly...
//need to make timeout handlerOS independent
@ -2802,13 +2802,13 @@ void rtw_joinbss_cmd_callback(_adapter* padapter, struct cmd_obj *pcmd)
_func_enter_;
if(pcmd->res == H2C_DROPPED)
if (pcmd->res == H2C_DROPPED)
{
//TODO: cancel timer and do timeout handler directly...
//need to make timeout handlerOS independent
_set_timer(&pmlmepriv->assoc_timer, 1);
}
else if(pcmd->res != H2C_SUCCESS)
else if (pcmd->res != H2C_SUCCESS)
{
RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("********Error:rtw_select_and_join_from_scanned_queue Wait Sema Fail ************\n"));
_set_timer(&pmlmepriv->assoc_timer, 1);
@ -2831,7 +2831,7 @@ void rtw_createbss_cmd_callback(_adapter *padapter, struct cmd_obj *pcmd)
_func_enter_;
if((pcmd->res != H2C_SUCCESS))
if ((pcmd->res != H2C_SUCCESS))
{
RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\n ********Error: rtw_createbss_cmd_callback Fail ************\n\n."));
_set_timer(&pmlmepriv->assoc_timer, 1 );
@ -2861,10 +2861,10 @@ _func_enter_;
_enter_critical_bh(&pmlmepriv->lock, &irqL);
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) )
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) )
{
psta = rtw_get_stainfo(&padapter->stapriv, pnetwork->MacAddress);
if(!psta)
if (!psta)
{
psta = rtw_alloc_stainfo(&padapter->stapriv, pnetwork->MacAddress);
if (psta == NULL)
@ -2885,7 +2885,7 @@ _func_enter_;
if ( pwlan == NULL)
{
pwlan = rtw_get_oldest_wlan_network(&pmlmepriv->scanned_queue);
if( pwlan == NULL)
if ( pwlan == NULL)
{
RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\n Error: can't get pwlan in rtw_joinbss_event_callback \n"));
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
@ -2913,7 +2913,7 @@ _func_enter_;
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
#if 0
if((pmlmepriv->fw_state) & WIFI_AP_STATE)
if ((pmlmepriv->fw_state) & WIFI_AP_STATE)
{
psta = rtw_alloc_stainfo(&padapter->stapriv, pnetwork->MacAddress);
@ -2955,7 +2955,7 @@ void rtw_setstaKey_cmdrsp_callback(_adapter* padapter , struct cmd_obj *pcmd)
_func_enter_;
if(psta==NULL)
if (psta==NULL)
{
RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\nERROR: rtw_setstaKey_cmdrsp_callback => can't get sta_info \n\n"));
goto exit;
@ -2981,7 +2981,7 @@ void rtw_setassocsta_cmdrsp_callback(_adapter* padapter, struct cmd_obj *pcmd)
_func_enter_;
if(psta==NULL)
if (psta==NULL)
{
RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\nERROR: setassocsta_cmdrsp_callbac => can't get sta_info \n\n"));
goto exit;

View file

@ -107,7 +107,7 @@ int proc_set_write_reg(struct file *file, const char *buffer,
return count;
}
switch(len)
switch (len)
{
case 1:
rtw_write8(padapter, addr, (u8)val);
@ -141,13 +141,13 @@ int proc_get_read_reg(char *page, char **start,
int len = 0;
if(proc_get_read_addr==0xeeeeeeee)
if (proc_get_read_addr==0xeeeeeeee)
{
*eof = 1;
return len;
}
switch(proc_get_read_len)
switch (proc_get_read_len)
{
case 1:
len += snprintf(page + len, count - len, "rtw_read8(0x%x)=0x%x\n", proc_get_read_addr, rtw_read8(padapter, proc_get_read_addr));
@ -314,7 +314,7 @@ int proc_get_ap_info(char *page, char **start,
int len = 0;
psta = rtw_get_stainfo(pstapriv, cur_network->network.MacAddress);
if(psta)
if (psta)
{
int i;
struct recv_reorder_ctrl *preorder_ctrl;
@ -331,10 +331,10 @@ int proc_get_ap_info(char *page, char **start,
len += snprintf(page + len, count - len, "agg_enable_bitmap=%x, candidate_tid_bitmap=%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap);
#endif //CONFIG_80211N_HT
for(i=0;i<16;i++)
for (i=0;i<16;i++)
{
preorder_ctrl = &psta->recvreorder_ctrl[i];
if(preorder_ctrl->enable)
if (preorder_ctrl->enable)
{
len += snprintf(page + len, count - len, "tid=%d, indicate_seq=%d\n", i, preorder_ctrl->indicate_seq);
}
@ -399,11 +399,11 @@ int proc_get_mac_reg_dump1(char *page, char **start,
len += snprintf(page + len, count - len, "\n======= MAC REG =======\n");
for(i=0x0;i<0x300;i+=4)
for (i=0x0;i<0x300;i+=4)
{
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
}
*eof = 1;
@ -422,11 +422,11 @@ int proc_get_mac_reg_dump2(char *page, char **start,
len += snprintf(page + len, count - len, "\n======= MAC REG =======\n");
memset(page, 0, count);
for(i=0x300;i<0x600;i+=4)
for (i=0x300;i<0x600;i+=4)
{
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
}
*eof = 1;
@ -445,11 +445,11 @@ int proc_get_mac_reg_dump3(char *page, char **start,
len += snprintf(page + len, count - len, "\n======= MAC REG =======\n");
for(i=0x600;i<0x800;i+=4)
for (i=0x600;i<0x800;i+=4)
{
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
}
*eof = 1;
@ -467,11 +467,11 @@ int proc_get_bb_reg_dump1(char *page, char **start,
int i,j=1;
len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
for(i=0x800;i<0xB00;i+=4)
for (i=0x800;i<0xB00;i+=4)
{
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
}
*eof = 1;
return len;
@ -487,11 +487,11 @@ int proc_get_bb_reg_dump2(char *page, char **start,
int i,j=1;
len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
for(i=0xB00;i<0xE00;i+=4)
for (i=0xB00;i<0xE00;i+=4)
{
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
}
*eof = 1;
return len;
@ -507,11 +507,11 @@ int proc_get_bb_reg_dump3(char *page, char **start,
int i,j=1;
len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
for(i=0xE00;i<0x1000;i+=4)
for (i=0xE00;i<0x1000;i+=4)
{
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
}
*eof = 1;
return len;
@ -530,13 +530,13 @@ int proc_get_rf_reg_dump1(char *page, char **start,
len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
path = 1;
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
for(i=0;i<0xC0;i++)
for (i=0;i<0xC0;i++)
{
//value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
len += snprintf(page + len, count - len, " 0x%08x ",value);
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
if ((j++)%4==0) len += snprintf(page + len, count - len, "\n");
}
*eof = 1;
@ -557,13 +557,13 @@ int proc_get_rf_reg_dump2(char *page, char **start,
len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
path = 1;
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
for(i=0xC0;i<0x100;i++)
for (i=0xC0;i<0x100;i++)
{
//value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
len += snprintf(page + len, count - len, " 0x%08x ",value);
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
if ((j++)%4==0) len += snprintf(page + len, count - len, "\n");
}
*eof = 1;
return len;
@ -583,13 +583,13 @@ int proc_get_rf_reg_dump3(char *page, char **start,
len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
path = 2;
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
for(i=0;i<0xC0;i++)
for (i=0;i<0xC0;i++)
{
//value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
len += snprintf(page + len, count - len, " 0x%08x ",value);
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
if ((j++)%4==0) len += snprintf(page + len, count - len, "\n");
}
*eof = 1;
@ -610,13 +610,13 @@ int proc_get_rf_reg_dump4(char *page, char **start,
len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
path = 2;
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
for(i=0xC0;i<0x100;i++)
for (i=0xC0;i<0x100;i++)
{
//value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
len += snprintf(page + len, count - len, " 0x%08x ",value);
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
if ((j++)%4==0) len += snprintf(page + len, count - len, "\n");
}
*eof = 1;
return len;
@ -668,7 +668,7 @@ int proc_set_rx_signal(struct file *file, const char *buffer,
is_signal_dbg = is_signal_dbg==0?0:1;
if(is_signal_dbg && num!=2)
if (is_signal_dbg && num!=2)
return count;
signal_strength = signal_strength>100?100:signal_strength;
@ -677,7 +677,7 @@ int proc_set_rx_signal(struct file *file, const char *buffer,
padapter->recvpriv.is_signal_dbg = is_signal_dbg;
padapter->recvpriv.signal_strength_dbg=signal_strength;
if(is_signal_dbg)
if (is_signal_dbg)
DBG_871X("set %s %u\n", "DBG_SIGNAL_STRENGTH", signal_strength);
else
DBG_871X("set %s\n", "HW_SIGNAL_STRENGTH");
@ -699,7 +699,7 @@ int proc_get_ht_enable(char *page, char **start,
int len = 0;
if(pregpriv)
if (pregpriv)
len += snprintf(page + len, count - len,
"%d\n",
pregpriv->ht_enable
@ -725,7 +725,7 @@ int proc_set_ht_enable(struct file *file, const char *buffer,
int num = sscanf(tmp, "%d ", &mode);
if( pregpriv && mode >= 0 && mode < 2 )
if ( pregpriv && mode >= 0 && mode < 2 )
{
pregpriv->ht_enable= mode;
printk("ht_enable=%d\n", pregpriv->ht_enable);
@ -746,7 +746,7 @@ int proc_get_cbw40_enable(char *page, char **start,
int len = 0;
if(pregpriv)
if (pregpriv)
len += snprintf(page + len, count - len,
"%d\n",
pregpriv->cbw40_enable
@ -772,7 +772,7 @@ int proc_set_cbw40_enable(struct file *file, const char *buffer,
int num = sscanf(tmp, "%d ", &mode);
if( pregpriv && mode >= 0 && mode < 2 )
if ( pregpriv && mode >= 0 && mode < 2 )
{
pregpriv->cbw40_enable= mode;
@ -795,7 +795,7 @@ int proc_get_ampdu_enable(char *page, char **start,
int len = 0;
if(pregpriv)
if (pregpriv)
len += snprintf(page + len, count - len,
"%d\n",
pregpriv->ampdu_enable
@ -821,7 +821,7 @@ int proc_set_ampdu_enable(struct file *file, const char *buffer,
int num = sscanf(tmp, "%d ", &mode);
if( pregpriv && mode >= 0 && mode < 3 )
if ( pregpriv && mode >= 0 && mode < 3 )
{
pregpriv->ampdu_enable= mode;
printk("ampdu_enable=%d\n", mode);
@ -843,7 +843,7 @@ int proc_get_two_path_rssi(char *page, char **start,
int len = 0;
if(padapter)
if (padapter)
len += snprintf(page + len, count - len,
"%d %d\n",
padapter->recvpriv.RxRssi[0],
@ -864,7 +864,7 @@ int proc_get_rx_stbc(char *page, char **start,
int len = 0;
if(pregpriv)
if (pregpriv)
len += snprintf(page + len, count - len,
"%d\n",
pregpriv->rx_stbc
@ -890,7 +890,7 @@ int proc_set_rx_stbc(struct file *file, const char *buffer,
int num = sscanf(tmp, "%d ", &mode);
if( pregpriv && (mode == 0 || mode == 1|| mode == 2|| mode == 3))
if ( pregpriv && (mode == 0 || mode == 1|| mode == 2|| mode == 3))
{
pregpriv->rx_stbc= mode;
printk("rx_stbc=%d\n", mode);
@ -934,7 +934,7 @@ int proc_set_rssi_disp(struct file *file, const char *buffer,
return count;
}
if(enable)
if (enable)
{
DBG_8192C("Turn On Rx RSSI Display Function\n");
padapter->bRxRSSIDisplay = enable ;
@ -973,7 +973,7 @@ int proc_get_all_sta_info(char *page, char **start,
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
for(i=0; i< NUM_STA; i++)
for (i=0; i< NUM_STA; i++)
{
phead = &(pstapriv->sta_hash[i]);
plist = get_next(phead);
@ -984,7 +984,7 @@ int proc_get_all_sta_info(char *page, char **start,
plist = get_next(plist);
//if(extra_arg == psta->aid)
//if (extra_arg == psta->aid)
{
len += snprintf(page + len, count - len, "sta's macaddr:" MAC_FMT "\n", MAC_ARG(psta->hwaddr));
len += snprintf(page + len, count - len, "rtsen=%d, cts2slef=%d\n", psta->rtsen, psta->cts2self);
@ -1004,10 +1004,10 @@ int proc_get_all_sta_info(char *page, char **start,
len += snprintf(page + len, count - len, "qos_info=0x%x\n", psta->qos_info);
len += snprintf(page + len, count - len, "dot118021XPrivacy=0x%x\n", psta->dot118021XPrivacy);
for(j=0;j<16;j++)
for (j=0;j<16;j++)
{
preorder_ctrl = &psta->recvreorder_ctrl[j];
if(preorder_ctrl->enable)
if (preorder_ctrl->enable)
{
len += snprintf(page + len, count - len, "tid=%d, indicate_seq=%d\n", j, preorder_ctrl->indicate_seq);
}
@ -1124,7 +1124,7 @@ int proc_get_btcoex_dbg(char *page, char **start,
int len = 0;
if(pregpriv)
if (pregpriv)
len += snprintf(page + len, count - len,
"%d\n",
BTCoexDbgLevel
@ -1150,7 +1150,7 @@ int proc_set_btcoex_dbg(struct file *file, const char *buffer,
int num = sscanf(tmp, "%d ", &mode);
if( pregpriv && (mode == 0 || mode == 1|| mode == 2|| mode == 3))
if ( pregpriv && (mode == 0 || mode == 1|| mode == 2|| mode == 3))
{
BTCoexDbgLevel= mode;
printk("btcoex_dbg=%d\n", BTCoexDbgLevel);

View file

@ -48,7 +48,7 @@ void shift_out_bits(_adapter * padapter, u16 data, u16 count)
u16 x,mask;
_func_enter_;
if(padapter->bSurpriseRemoved==_TRUE){
if (padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
@ -60,9 +60,9 @@ _func_enter_;
do
{
x &= ~_EEDI;
if(data & mask)
if (data & mask)
x |= _EEDI;
if(padapter->bSurpriseRemoved==_TRUE){
if (padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
@ -71,8 +71,8 @@ _func_enter_;
up_clk(padapter, &x);
down_clk(padapter, &x);
mask = mask >> 1;
} while(mask);
if(padapter->bSurpriseRemoved==_TRUE){
} while (mask);
if (padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
@ -86,7 +86,7 @@ u16 shift_in_bits (_adapter * padapter)
{
u16 x,d=0,i;
_func_enter_;
if(padapter->bSurpriseRemoved==_TRUE){
if (padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
@ -95,18 +95,18 @@ _func_enter_;
x &= ~( _EEDO | _EEDI);
d = 0;
for(i=0; i<16; i++)
for (i=0; i<16; i++)
{
d = d << 1;
up_clk(padapter, &x);
if(padapter->bSurpriseRemoved==_TRUE){
if (padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
x = rtw_read8(padapter, EE_9346CR);
x &= ~(_EEDI);
if(x & _EEDO)
if (x & _EEDO)
d |= 1;
down_clk(padapter, &x);
@ -157,23 +157,23 @@ void eeprom_clean(_adapter * padapter)
{
u16 x;
_func_enter_;
if(padapter->bSurpriseRemoved==_TRUE){
if (padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
x = rtw_read8(padapter, EE_9346CR);
if(padapter->bSurpriseRemoved==_TRUE){
if (padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
x &= ~(_EECS | _EEDI);
rtw_write8(padapter, EE_9346CR, (u8)x);
if(padapter->bSurpriseRemoved==_TRUE){
if (padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
up_clk(padapter, &x);
if(padapter->bSurpriseRemoved==_TRUE){
if (padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
@ -189,13 +189,13 @@ void eeprom_write16(_adapter * padapter, u16 reg, u16 data)
u8 tmp8_ori,tmp8_new,tmp8_clk_ori,tmp8_clk_new;
tmp8_ori=rtw_read8(padapter, 0x102502f1);
tmp8_new=tmp8_ori & 0xf7;
if(tmp8_ori != tmp8_new){
if (tmp8_ori != tmp8_new){
rtw_write8(padapter, 0x102502f1, tmp8_new);
RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x102502f1=====\n"));
}
tmp8_clk_ori=rtw_read8(padapter,0x10250003);
tmp8_clk_new=tmp8_clk_ori|0x20;
if(tmp8_clk_new!=tmp8_clk_ori){
if (tmp8_clk_new!=tmp8_clk_ori){
RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x10250003=====\n"));
rtw_write8(padapter, 0x10250003, tmp8_clk_new);
}
@ -210,7 +210,7 @@ _func_enter_;
shift_out_bits(padapter, EEPROM_EWEN_OPCODE, 5);
if(padapter->EepromAddressSize==8) //CF+ and SDIO
if (padapter->EepromAddressSize==8) //CF+ and SDIO
shift_out_bits(padapter, 0, 6);
else //USB
shift_out_bits(padapter, 0, 4);
@ -256,9 +256,9 @@ _func_enter_;
eeprom_clean(padapter );
exit:
#ifdef CONFIG_RTL8712
if(tmp8_clk_new!=tmp8_clk_ori)
if (tmp8_clk_new!=tmp8_clk_ori)
rtw_write8(padapter, 0x10250003, tmp8_clk_ori);
if(tmp8_new!=tmp8_ori)
if (tmp8_new!=tmp8_ori)
rtw_write8(padapter, 0x102502f1, tmp8_ori);
#endif
@ -275,27 +275,27 @@ u16 eeprom_read16(_adapter * padapter, u16 reg) //ReadEEprom
u8 tmp8_ori,tmp8_new,tmp8_clk_ori,tmp8_clk_new;
tmp8_ori= rtw_read8(padapter, 0x102502f1);
tmp8_new = tmp8_ori & 0xf7;
if(tmp8_ori != tmp8_new){
if (tmp8_ori != tmp8_new){
rtw_write8(padapter, 0x102502f1, tmp8_new);
RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x102502f1=====\n"));
}
tmp8_clk_ori=rtw_read8(padapter,0x10250003);
tmp8_clk_new=tmp8_clk_ori|0x20;
if(tmp8_clk_new!=tmp8_clk_ori){
if (tmp8_clk_new!=tmp8_clk_ori){
RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x10250003=====\n"));
rtw_write8(padapter, 0x10250003, tmp8_clk_new);
}
#endif
_func_enter_;
if(padapter->bSurpriseRemoved==_TRUE){
if (padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
// select EEPROM, reset bits, set _EECS
x = rtw_read8(padapter, EE_9346CR);
if(padapter->bSurpriseRemoved==_TRUE){
if (padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
@ -315,9 +315,9 @@ _func_enter_;
eeprom_clean(padapter);
out:
#ifdef CONFIG_RTL8712
if(tmp8_clk_new!=tmp8_clk_ori)
if (tmp8_clk_new!=tmp8_clk_ori)
rtw_write8(padapter, 0x10250003, tmp8_clk_ori);
if(tmp8_new!=tmp8_ori)
if (tmp8_new!=tmp8_ori)
rtw_write8(padapter, 0x102502f1, tmp8_ori);
#endif
@ -337,14 +337,14 @@ void eeprom_read_sz(_adapter * padapter, u16 reg, u8* data, u32 sz)
u16 x, data16;
u32 i;
_func_enter_;
if(padapter->bSurpriseRemoved==_TRUE){
if (padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
// select EEPROM, reset bits, set _EECS
x = rtw_read8(padapter, EE_9346CR);
if(padapter->bSurpriseRemoved==_TRUE){
if (padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
@ -359,7 +359,7 @@ _func_enter_;
shift_out_bits(padapter, reg, padapter->EepromAddressSize);
for(i=0; i<sz; i+=2)
for (i=0; i<sz; i+=2)
{
data16 = shift_in_bits(padapter);
data[i] = data16 & 0xff;
@ -384,7 +384,7 @@ _func_enter_;
reg = (u16)(addr_off >> 1);
addr_2align_odd = (u8)(addr_off & 0x1);
if(addr_2align_odd) //read that start at high part: e.g 1,3,5,7,9,...
if (addr_2align_odd) //read that start at high part: e.g 1,3,5,7,9,...
{
stmp = eeprom_read16(padapter, reg);
rbuf[idx++] = (u8) ((stmp>>8)&0xff); //return hogh-part of the short
@ -394,7 +394,7 @@ _func_enter_;
quotient = sz >> 1;
remainder = sz & 0x1;
for( i=0 ; i < quotient; i++)
for ( i=0 ; i < quotient; i++)
{
stmp = eeprom_read16(padapter, reg+i);
rbuf[idx++] = (u8) (stmp&0xff);
@ -402,7 +402,7 @@ _func_enter_;
}
reg = reg+i;
if(remainder){ //end of read at lower part of short : 0,2,4,6,...
if (remainder){ //end of read at lower part of short : 0,2,4,6,...
stmp = eeprom_read16(padapter, reg);
rbuf[idx] = (u8)(stmp & 0xff);
}

View file

@ -61,12 +61,12 @@ Efuse_Read1ByteFromFakeContent(
IN u16 Offset,
IN OUT u8 *Value )
{
if(Offset >= EFUSE_MAX_HW_SIZE)
if (Offset >= EFUSE_MAX_HW_SIZE)
{
return _FALSE;
}
//DbgPrint("Read fake content, offset = %d\n", Offset);
if(fakeEfuseBank == 0)
if (fakeEfuseBank == 0)
*Value = fakeEfuseContent[Offset];
else
*Value = fakeBTEfuseContent[fakeEfuseBank-1][Offset];
@ -84,11 +84,11 @@ Efuse_Write1ByteToFakeContent(
IN u16 Offset,
IN u8 Value )
{
if(Offset >= EFUSE_MAX_HW_SIZE)
if (Offset >= EFUSE_MAX_HW_SIZE)
{
return _FALSE;
}
if(fakeEfuseBank == 0)
if (fakeEfuseBank == 0)
fakeEfuseContent[Offset] = Value;
else
{
@ -158,10 +158,10 @@ u8
Efuse_CalculateWordCnts(IN u8 word_en)
{
u8 word_cnts = 0;
if(!(word_en & BIT(0))) word_cnts++; // 0 : write enable
if(!(word_en & BIT(1))) word_cnts++;
if(!(word_en & BIT(2))) word_cnts++;
if(!(word_en & BIT(3))) word_cnts++;
if (!(word_en & BIT(0))) word_cnts++; // 0 : write enable
if (!(word_en & BIT(1))) word_cnts++;
if (!(word_en & BIT(2))) word_cnts++;
if (!(word_en & BIT(3))) word_cnts++;
return word_cnts;
}
@ -188,7 +188,7 @@ ReadEFuseByte(
u16 retry;
//u32 start=rtw_get_current_time();
if(bPseudoTest)
if (bPseudoTest)
{
Efuse_Read1ByteFromFakeContent(Adapter, _offset, pbuf);
return;
@ -206,8 +206,8 @@ ReadEFuseByte(
//Check bit 32 read-ready
retry = 0;
value32 = rtw_read32(Adapter, EFUSE_CTRL);
//while(!(((value32 >> 24) & 0xff) & 0x80) && (retry<10))
while(!(((value32 >> 24) & 0xff) & 0x80) && (retry<10000))
//while (!(((value32 >> 24) & 0xff) & 0x80) && (retry<10))
while (!(((value32 >> 24) & 0xff) & 0x80) && (retry<10000))
{
value32 = rtw_read32(Adapter, EFUSE_CTRL);
retry++;
@ -324,11 +324,11 @@ EFUSE_Read1Byte(
//Wait Write-ready (0x30[31]=1)
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
while(!(Bytetemp & 0x80))
while (!(Bytetemp & 0x80))
{
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
k++;
if(k==1000)
if (k==1000)
{
k=0;
break;
@ -378,7 +378,7 @@ EFUSE_Write1Byte(
//RT_TRACE(COMP_EFUSE, DBG_LOUD, ("Addr=%x Data =%x\n", Address, Value));
EFUSE_GetEfuseDefinition(Adapter, EFUSE_WIFI , TYPE_EFUSE_REAL_CONTENT_LEN, (PVOID)&contentLen, _FALSE);
if( Address < contentLen) //E-fuse 512Byte
if ( Address < contentLen) //E-fuse 512Byte
{
rtw_write8(Adapter, EFUSE_CTRL, Value);
@ -398,11 +398,11 @@ EFUSE_Write1Byte(
//Wait Write-ready (0x30[31]=0)
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
while(Bytetemp & 0x80)
while (Bytetemp & 0x80)
{
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
k++;
if(k==100)
if (k==100)
{
k=0;
break;
@ -422,7 +422,7 @@ efuse_OneByteRead(
u8 tmpidx = 0;
u8 bResult;
if(bPseudoTest)
if (bPseudoTest)
{
bResult = Efuse_Read1ByteFromFakeContent(pAdapter, addr, data);
return bResult;
@ -435,11 +435,11 @@ efuse_OneByteRead(
rtw_write8(pAdapter, EFUSE_CTRL+3, 0x72);//read cmd
while(!(0x80 &rtw_read8(pAdapter, EFUSE_CTRL+3))&&(tmpidx<100))
while (!(0x80 &rtw_read8(pAdapter, EFUSE_CTRL+3))&&(tmpidx<100))
{
tmpidx++;
}
if(tmpidx<100)
if (tmpidx<100)
{
*data=rtw_read8(pAdapter, EFUSE_CTRL);
bResult = _TRUE;
@ -463,7 +463,7 @@ efuse_OneByteWrite(
u8 tmpidx = 0;
u8 bResult;
if(bPseudoTest)
if (bPseudoTest)
{
bResult = Efuse_Write1ByteToFakeContent(pAdapter, addr, data);
return bResult;
@ -481,11 +481,11 @@ efuse_OneByteWrite(
rtw_write8(pAdapter, EFUSE_CTRL+3, 0xF2);//write cmd
while((0x80 & rtw_read8(pAdapter, EFUSE_CTRL+3)) && (tmpidx<100) ){
while ((0x80 & rtw_read8(pAdapter, EFUSE_CTRL+3)) && (tmpidx<100) ){
tmpidx++;
}
if(tmpidx<100)
if (tmpidx<100)
{
bResult = _TRUE;
}
@ -716,7 +716,7 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
return _FAIL;
map = rtw_zmalloc(mapLen);
if(map == NULL){
if (map == NULL){
return _FAIL;
}
@ -772,7 +772,7 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
DBG_871X("offset=%x \n",offset);
DBG_871X("word_en=%x \n",word_en);
for(i=0;i<PGPKT_DATA_SIZE;i++)
for (i=0;i<PGPKT_DATA_SIZE;i++)
{
DBG_871X("data=%x \t",newdata[i]);
}
@ -814,7 +814,7 @@ u8 rtw_BT_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
return _FAIL;
map = rtw_zmalloc(mapLen);
if(map == NULL){
if (map == NULL){
return _FAIL;
}
@ -1099,7 +1099,7 @@ void EFUSE_ShadowMapUpdate(
else
{
#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
if(_SUCCESS != retriveAdaptorInfoFile(pAdapter->registrypriv.adaptor_info_caching_file_path, pEEPROM)) {
if (_SUCCESS != retriveAdaptorInfoFile(pAdapter->registrypriv.adaptor_info_caching_file_path, pEEPROM)) {
#endif
Efuse_ReadAllMap(pAdapter, efuseType, pEEPROM->efuse_eeprom_data, bPseudoTest);
@ -1207,14 +1207,14 @@ Efuse_InitSomeVar(
_rtw_memset((PVOID)&fakeEfuseInitMap[0], 0xff, EFUSE_MAX_MAP_LEN);
_rtw_memset((PVOID)&fakeEfuseModifiedMap[0], 0xff, EFUSE_MAX_MAP_LEN);
for(i=0; i<EFUSE_MAX_BT_BANK; i++)
for (i=0; i<EFUSE_MAX_BT_BANK; i++)
{
_rtw_memset((PVOID)&BTEfuseContent[i][0], EFUSE_MAX_HW_SIZE, 0xff);
}
_rtw_memset((PVOID)&BTEfuseInitMap[0], 0xff, EFUSE_BT_MAX_MAP_LEN);
_rtw_memset((PVOID)&BTEfuseModifiedMap[0], 0xff, EFUSE_BT_MAX_MAP_LEN);
for(i=0; i<EFUSE_MAX_BT_BANK; i++)
for (i=0; i<EFUSE_MAX_BT_BANK; i++)
{
_rtw_memset((PVOID)&fakeBTEfuseContent[i][0], 0xff, EFUSE_MAX_HW_SIZE);
}
@ -1235,9 +1235,9 @@ int storeAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv)
{
int ret =_SUCCESS;
if(path && eeprom_priv) {
if (path && eeprom_priv) {
ret = rtw_store_to_file(path, eeprom_priv->efuse_eeprom_data, EEPROM_MAX_SIZE_512);
if(ret == EEPROM_MAX_SIZE)
if (ret == EEPROM_MAX_SIZE)
ret = _SUCCESS;
else
ret = _FAIL;
@ -1254,17 +1254,17 @@ int retriveAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv)
mm_segment_t oldfs;
struct file *fp;
if(path && eeprom_priv) {
if (path && eeprom_priv) {
ret = rtw_retrive_from_file(path, eeprom_priv->efuse_eeprom_data, EEPROM_MAX_SIZE);
if(ret == EEPROM_MAX_SIZE)
if (ret == EEPROM_MAX_SIZE)
ret = _SUCCESS;
else
ret = _FAIL;
#if 0
if(isAdaptorInfoFileValid()) {
if (isAdaptorInfoFileValid()) {
return 0;
} else {
return _FAIL;

View file

@ -72,7 +72,7 @@ int rtw_get_bit_value_from_ieee_value(u8 val)
unsigned char dot11_rate_table[]={2,4,11,22,12,18,24,36,48,72,96,108,0}; // last element must be zero!!
int i=0;
while(dot11_rate_table[i] != 0) {
while (dot11_rate_table[i] != 0) {
if (dot11_rate_table[i] == val)
return BIT(i);
i++;
@ -84,7 +84,7 @@ uint rtw_is_cckrates_included(u8 *rate)
{
u32 i = 0;
while(rate[i]!=0)
while (rate[i]!=0)
{
if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
(((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) )
@ -100,7 +100,7 @@ uint rtw_is_cckratesonly_included(u8 *rate)
u32 i = 0;
while(rate[i]!=0)
while (rate[i]!=0)
{
if ( (((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) &&
(((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22) )
@ -127,7 +127,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;
@ -167,7 +167,7 @@ _func_enter_;
_func_exit_;
}
inline u8 *rtw_set_ie_ch_switch(u8 *buf, u32 *buf_len, u8 ch_switch_mode,
inline u8 *rtw_set_ie_ch_switch (u8 *buf, u32 *buf_len, u8 ch_switch_mode,
u8 new_ch, u8 ch_switch_cnt)
{
u8 ie_data[3];
@ -182,9 +182,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;
@ -194,9 +194,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;
@ -236,7 +236,7 @@ _func_enter_;
p = pbuf;
i = 0;
*len = 0;
while(1)
while (1)
{
if (*p == index)
{
@ -274,25 +274,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)
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)
_rtw_memcpy(ie, &in_ie[cnt], in_ie[cnt+1]+2);
if(ielen)
if (ielen)
*ielen = in_ie[cnt+1]+2;
break;
@ -326,7 +326,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;
@ -389,7 +389,7 @@ uint rtw_get_rateset_len(u8 *rateset)
{
uint i = 0;
_func_enter_;
while(1)
while (1)
{
if ((rateset[i]) == 0)
break;
@ -426,7 +426,7 @@ _func_enter_;
*(u16*)ie |= cpu_to_le16(cap_IBSS);
if(pregistrypriv->preamble == PREAMBLE_SHORT)
if (pregistrypriv->preamble == PREAMBLE_SHORT)
*(u16*)ie |= cpu_to_le16(cap_ShortPremble);
if (pdev_network->Privacy)
@ -439,9 +439,9 @@ _func_enter_;
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;
@ -480,7 +480,7 @@ _func_enter_;
#ifdef CONFIG_80211N_HT
//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:
@ -505,7 +505,7 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
u8 *pbuf = pie;
int limit_new = limit;
while(1)
while (1)
{
pbuf = rtw_get_ie(pbuf, _WPA_IE_ID_, &len, limit_new);
@ -766,18 +766,18 @@ int rtw_get_wapi_ie(u8 *in_ie,uint in_len,u8 *wapi_ie,u16 *wapi_len)
_func_enter_;
cnt = (_TIMESTAMP_ + _BEACON_ITERVAL_ + _CAPABILITY_);
while(cnt<in_len)
while (cnt<in_len)
{
authmode=in_ie[cnt];
//if(authmode==_WAPI_IE_)
if(authmode==_WAPI_IE_ && (_rtw_memcmp(&in_ie[cnt+6], wapi_oui1,4)==_TRUE ||
//if (authmode==_WAPI_IE_)
if (authmode==_WAPI_IE_ && (_rtw_memcmp(&in_ie[cnt+6], wapi_oui1,4)==_TRUE ||
_rtw_memcmp(&in_ie[cnt+6], wapi_oui2,4)==_TRUE))
{
if (wapi_ie) {
_rtw_memcpy(wapi_ie, &in_ie[cnt],in_ie[cnt+1]+2);
for(i=0;i<(in_ie[cnt+1]+2);i=i+8){
for (i=0;i<(in_ie[cnt+1]+2);i=i+8){
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n %2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n",
wapi_ie[i],wapi_ie[i+1],wapi_ie[i+2],wapi_ie[i+3],wapi_ie[i+4],
wapi_ie[i+5],wapi_ie[i+6],wapi_ie[i+7]));
@ -814,18 +814,18 @@ _func_enter_;
sec_idx=0;
while(cnt<in_len)
while (cnt<in_len)
{
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));
if (wpa_ie) {
_rtw_memcpy(wpa_ie, &in_ie[cnt],in_ie[cnt+1]+2);
for(i=0;i<(in_ie[cnt+1]+2);i=i+8){
for (i=0;i<(in_ie[cnt+1]+2);i=i+8){
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n %2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n",
wpa_ie[i],wpa_ie[i+1],wpa_ie[i+2],wpa_ie[i+3],wpa_ie[i+4],
wpa_ie[i+5],wpa_ie[i+6],wpa_ie[i+7]));
@ -837,14 +837,14 @@ _func_enter_;
}
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));
if (rsn_ie) {
_rtw_memcpy(rsn_ie, &in_ie[cnt],in_ie[cnt+1]+2);
for(i=0;i<(in_ie[cnt+1]+2);i=i+8){
for (i=0;i<(in_ie[cnt+1]+2);i=i+8){
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n %2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n",
rsn_ie[i],rsn_ie[i+1],rsn_ie[i+2],rsn_ie[i+3],rsn_ie[i+4],
rsn_ie[i+5],rsn_ie[i+6],rsn_ie[i+7]));
@ -873,11 +873,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;
@ -901,26 +901,26 @@ 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;
while(cnt<in_len)
while (cnt<in_len)
{
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)
_rtw_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;
@ -953,7 +953,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_ ) ||
@ -965,7 +965,7 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_att
// 6 = 1(Element ID) + 1(Length) + 4(WPS OUI)
attr_ptr = wps_ie + 6; //goto first attr
while(attr_ptr - wps_ie < wps_ielen)
while (attr_ptr - wps_ie < wps_ielen)
{
// 4 = 2(Attribute ID) + 2(Length)
u16 attr_id = RTW_GET_BE16(attr_ptr);
@ -973,14 +973,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)
_rtw_memcpy(buf_attr, attr_ptr, attr_len);
if(len_attr)
if (len_attr)
*len_attr = attr_len;
break;
@ -1010,17 +1010,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)
_rtw_memcpy(buf_content, attr_ptr+4, attr_len-4);
if(len_content)
if (len_content)
*len_content = attr_len-4;
return attr_ptr+4;
@ -1264,7 +1264,7 @@ 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;
@ -1295,13 +1295,13 @@ extern char* rtw_initmac;
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
int jj,kk;
for( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 )
for ( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 )
{
mac[jj] = key_2char2num(rtw_initmac[kk], rtw_initmac[kk+ 1]);
}
@ -1335,7 +1335,7 @@ void dump_ies(u8 *buf, u32 buf_len) {
u8* pos = (u8*)buf;
u8 id, len;
while(pos-buf<=buf_len){
while (pos-buf<=buf_len){
id = *pos;
len = *(pos+1);
@ -1358,11 +1358,11 @@ 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;
while(pos-ie < ie_len){
while (pos-ie < ie_len){
id = RTW_GET_BE16(pos);
len = RTW_GET_BE16(pos + 2);
@ -1382,11 +1382,11 @@ 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;
while(pos-ie < ie_len){
while (pos-ie < ie_len){
id = *pos;
len = RTW_GET_LE16(pos+1);
@ -1414,7 +1414,7 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
if ( p2p_ielen != NULL )
*p2p_ielen = 0;
while(cnt<in_len)
while (cnt<in_len)
{
eid = in_ie[cnt];
if ((in_len < 0) || (cnt > MAX_IE_SZ)) {
@ -1423,7 +1423,7 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
#endif
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;
@ -1468,7 +1468,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_ ) ||
@ -1480,7 +1480,7 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *buf_attr
// 6 = 1(Element ID) + 1(Length) + 3 (OUI) + 1(OUI Type)
attr_ptr = p2p_ie + 6; //goto first attr
while(attr_ptr - p2p_ie < p2p_ielen)
while (attr_ptr - p2p_ie < p2p_ielen)
{
// 3 = 1(Attribute ID) + 2(Length)
u8 attr_id = *attr_ptr;
@ -1488,14 +1488,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)
_rtw_memcpy(buf_attr, attr_ptr, attr_len);
if(len_attr)
if (len_attr)
*len_attr = attr_len;
break;
@ -1525,17 +1525,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)
_rtw_memcpy(buf_content, attr_ptr+3, attr_len-3);
if(len_content)
if (len_content)
*len_content = attr_len-3;
return attr_ptr+3;
@ -1553,7 +1553,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)
_rtw_memcpy(pbuf + 3, pdata_attr, attr_len);
a_len = attr_len + 3;
@ -1568,9 +1568,9 @@ static uint rtw_p2p_attr_remove(u8 *ie, uint ielen_ori, u8 attr_id)
uint ielen = ielen_ori;
int index=0;
while(1) {
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);
@ -1594,7 +1594,7 @@ static uint rtw_p2p_attr_remove(u8 *ie, uint ielen_ori, u8 attr_id)
}
else
{
//if(index>0)
//if (index>0)
// dump_ies(ie, ielen);
break;
}
@ -1609,17 +1609,17 @@ void rtw_WLAN_BSSID_EX_remove_p2p_attr(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)) )
{
#if 0
if(rtw_get_p2p_attr(p2p_ie, p2p_ielen_ori, attr_id, NULL, NULL)) {
if (rtw_get_p2p_attr(p2p_ie, p2p_ielen_ori, attr_id, NULL, NULL)) {
DBG_871X("rtw_get_p2p_attr: GOT P2P_ATTR:%u!!!!!!!!\n", attr_id);
dump_ies(bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_);
}
#endif
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;
@ -1654,11 +1654,11 @@ int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
return match;
}
while(cnt<in_len)
while (cnt<in_len)
{
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 )
{
@ -1718,18 +1718,18 @@ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *
// 1 ( WFD IE ) + 1 ( Length ) + 3 ( OUI ) + 1 ( OUI Type )
cnt = 6;
while( cnt < wfd_ielen )
while ( cnt < wfd_ielen )
{
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)
_rtw_memcpy( attr_content, &wfd_ie[ cnt + 3 ], attrlen );
if(attr_contentlen)
if (attr_contentlen)
*attr_contentlen = attrlen;
cnt += attrlen + 3;
@ -1801,7 +1801,7 @@ 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)) {
@ -1816,7 +1816,7 @@ 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"));
@ -1876,7 +1876,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 rtw_ieee80211_ht_cap *)(p + 2);
pnetwork->BcnInfo.ht_cap_info = pht_cap->cap_info;
} else {
@ -1884,7 +1884,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 {
@ -1897,63 +1897,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);
}
}
@ -1977,7 +1977,7 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8* category, u8 *act
c = frame_body[0];
switch(c) {
switch (c) {
case RTW_WLAN_CATEGORY_P2P: /* vendor-specific */
break;
default:

View file

@ -251,7 +251,7 @@ void _rtw_read_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
_func_enter_;
if( (adapter->bDriverStopped ==_TRUE) || (adapter->bSurpriseRemoved == _TRUE))
if ( (adapter->bDriverStopped ==_TRUE) || (adapter->bSurpriseRemoved == _TRUE))
{
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_mem:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
return;
@ -291,7 +291,7 @@ void _rtw_read_port(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
_func_enter_;
if( (adapter->bDriverStopped ==_TRUE) || (adapter->bSurpriseRemoved == _TRUE))
if ( (adapter->bDriverStopped ==_TRUE) || (adapter->bSurpriseRemoved == _TRUE))
{
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_port:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
return;
@ -313,7 +313,7 @@ void _rtw_read_port_cancel(_adapter *adapter)
_read_port_cancel = pintfhdl->io_ops._read_port_cancel;
if(_read_port_cancel)
if (_read_port_cancel)
_read_port_cancel(pintfhdl);
}
@ -362,7 +362,7 @@ void _rtw_write_port_cancel(_adapter *adapter)
_write_port_cancel = pintfhdl->io_ops._write_port_cancel;
if(_write_port_cancel)
if (_write_port_cancel)
_write_port_cancel(pintfhdl);
}

View file

@ -60,14 +60,14 @@ query_802_11_capability(
pCap->Length = sizeof(NDIS_802_11_CAPABILITY);
if(ulNumOfPairSupported > 1 )
if (ulNumOfPairSupported > 1 )
pCap->Length += (ulNumOfPairSupported-1) * sizeof(NDIS_802_11_AUTHENTICATION_ENCRYPTION);
pCap->Version = 2;
pCap->NoOfPMKIDs = NUM_PMKID_CACHE;
pCap->NoOfAuthEncryptPairsSupported = ulNumOfPairSupported;
if( sizeof (szAuthEnc) <= 240 ) // 240 = 256 - 4*4 // SecurityInfo.szCapability: only 256 bytes in size.
if ( sizeof (szAuthEnc) <= 240 ) // 240 = 256 - 4*4 // SecurityInfo.szCapability: only 256 bytes in size.
{
_rtw_memcpy( pucAuthEncryptionSupported, (u8*)szAuthEnc, sizeof (szAuthEnc) );
*pulOutLen = pCap->Length;
@ -98,7 +98,7 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
// Association Request related information
//------------------------------------------------------
// Req_1. AvailableRequestFixedIEs
if(psecnetwork!=NULL){
if (psecnetwork!=NULL){
pAssocInfo->AvailableRequestFixedIEs |= NDIS_802_11_AI_REQFI_CAPABILITIES|NDIS_802_11_AI_REQFI_CURRENTAPADDRESS;
pAssocInfo->RequestFixedIEs.Capabilities = (unsigned short)* & psecnetwork->IEs[10];
@ -107,25 +107,25 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
pAssocInfo->OffsetRequestIEs = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
if(check_fwstate( pmlmepriv, _FW_UNDER_LINKING|_FW_LINKED)==_TRUE)
if (check_fwstate( pmlmepriv, _FW_UNDER_LINKING|_FW_LINKED)==_TRUE)
{
if(psecuritypriv->ndisauthtype>=Ndis802_11AuthModeWPA2)
if (psecuritypriv->ndisauthtype>=Ndis802_11AuthModeWPA2)
pDest[0] =48; //RSN Information Element
else
pDest[0] =221; //WPA(SSN) Information Element
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n Adapter->ndisauthtype==Ndis802_11AuthModeWPA)?0xdd:0x30 [%d]",pDest[0]));
supp_ie=&psecuritypriv->supplicant_ie[0];
for(i=0;i<supp_ie[0];i++)
for (i=0;i<supp_ie[0];i++)
{
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("IEs [%d] = 0x%x \n\n", i,supp_ie[i]));
}
i=13; //0~11 is fixed information element
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("i= %d tgt_network->network.IELength=%d\n\n", i,(int)psecnetwork->IELength));
while((i<supp_ie[0]) && (i<256)){
if((unsigned char)supp_ie[i]==pDest[0]){
while ((i<supp_ie[0]) && (i<256)){
if ((unsigned char)supp_ie[i]==pDest[0]){
_rtw_memcpy((u8 *)(pDest),
&supp_ie[i],
supp_ie[1+i]+2);
@ -134,7 +134,7 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
}
i=i+supp_ie[i+1]+2;
if(supp_ie[1+i]==0)
if (supp_ie[1+i]==0)
i=i+1;
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("iteration i=%d IEs [%d] = 0x%x \n\n", i,i,supp_ie[i+1]));
@ -155,10 +155,10 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
// Association Response related information
//------------------------------------------------------
if(check_fwstate( pmlmepriv, _FW_LINKED)==_TRUE)
if (check_fwstate( pmlmepriv, _FW_LINKED)==_TRUE)
{
tgt_network =&(pmlmepriv->cur_network);
if(tgt_network!=NULL){
if (tgt_network!=NULL){
pAssocInfo->AvailableResponseFixedIEs =
NDIS_802_11_AI_RESFI_CAPABILITIES
|NDIS_802_11_AI_RESFI_ASSOCIATIONID
@ -171,11 +171,11 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
pDest = (u8 *)pAssocInfo + sizeof(NDIS_802_11_ASSOCIATION_INFORMATION)+pAssocInfo->RequestIELength;
auth_ie=&psecuritypriv->authenticator_ie[0];
for(i=0;i<auth_ie[0];i++)
for (i=0;i<auth_ie[0];i++)
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("IEs [%d] = 0x%x \n\n", i,auth_ie[i]));
i=auth_ie[0]-12;
if(i>0){
if (i>0){
_rtw_memcpy((u8 *)&pDest[0],&auth_ie[1],i);
pAssocInfo->ResponseIELength =i;
}

View file

@ -169,17 +169,17 @@ NDIS_STATUS oid_rt_pro_set_fw_dig_state_hdl(struct oid_par_priv* poid_par_priv)
_func_enter_;
if(poid_par_priv->type_of_oid != SET_OID)
if (poid_par_priv->type_of_oid != SET_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
}
_irqlevel_changed_(&oldirql,LOWER);
if(poid_par_priv->information_buf_len >= sizeof(struct setdig_parm))
if (poid_par_priv->information_buf_len >= sizeof(struct setdig_parm))
{
//DEBUG_ERR(("===> oid_rt_pro_set_fw_dig_state_hdl. type:0x%02x.\n",*((unsigned char*)poid_par_priv->information_buf )));
if(!rtw_setfwdig_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
if (!rtw_setfwdig_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
{
status = NDIS_STATUS_NOT_ACCEPTED;
}
@ -203,7 +203,7 @@ NDIS_STATUS oid_rt_pro_set_fw_ra_state_hdl(struct oid_par_priv* poid_par_priv)
_irqL oldirql;
_func_enter_;
if(poid_par_priv->type_of_oid != SET_OID)
if (poid_par_priv->type_of_oid != SET_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -212,10 +212,10 @@ NDIS_STATUS oid_rt_pro_set_fw_ra_state_hdl(struct oid_par_priv* poid_par_priv)
_irqlevel_changed_(&oldirql,LOWER);
if(poid_par_priv->information_buf_len >= sizeof(struct setra_parm))
if (poid_par_priv->information_buf_len >= sizeof(struct setra_parm))
{
//DEBUG_ERR(("===> oid_rt_pro_set_fw_ra_state_hdl. type:0x%02x.\n",*((unsigned char*)poid_par_priv->information_buf )));
if(!rtw_setfwra_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
if (!rtw_setfwra_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
{
status = NDIS_STATUS_NOT_ACCEPTED;
}
@ -236,14 +236,14 @@ NDIS_STATUS oid_rt_get_signal_quality_hdl(struct oid_par_priv* poid_par_priv)
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
//DEBUG_ERR(("<**********************oid_rt_get_signal_quality_hdl \n"));
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
}
#if 0
if(pMgntInfo->mAssoc || pMgntInfo->mIbss)
if (pMgntInfo->mAssoc || pMgntInfo->mIbss)
{
ulInfo = pAdapter->RxStats.SignalQuality;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
@ -265,13 +265,13 @@ NDIS_STATUS oid_rt_get_small_packet_crc_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
}
if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
if (poid_par_priv->information_buf_len >= sizeof(ULONG) )
{
*(ULONG *)poid_par_priv->information_buf = padapter->recvpriv.rx_smallpacket_crcerr;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
@ -289,13 +289,13 @@ NDIS_STATUS oid_rt_get_middle_packet_crc_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
}
if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
if (poid_par_priv->information_buf_len >= sizeof(ULONG) )
{
*(ULONG *)poid_par_priv->information_buf = padapter->recvpriv.rx_middlepacket_crcerr;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
@ -314,13 +314,13 @@ NDIS_STATUS oid_rt_get_large_packet_crc_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
}
if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
if (poid_par_priv->information_buf_len >= sizeof(ULONG) )
{
*(ULONG *)poid_par_priv->information_buf = padapter->recvpriv.rx_largepacket_crcerr;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
@ -340,7 +340,7 @@ NDIS_STATUS oid_rt_get_tx_retry_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -353,7 +353,7 @@ NDIS_STATUS oid_rt_get_rx_retry_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -367,12 +367,12 @@ NDIS_STATUS oid_rt_get_rx_total_packet_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
}
if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
if (poid_par_priv->information_buf_len >= sizeof(ULONG) )
{
*(u64 *)poid_par_priv->information_buf = padapter->recvpriv.rx_pkts + padapter->recvpriv.rx_drop;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
@ -391,7 +391,7 @@ NDIS_STATUS oid_rt_get_tx_beacon_ok_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -404,7 +404,7 @@ NDIS_STATUS oid_rt_get_tx_beacon_err_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -418,12 +418,12 @@ NDIS_STATUS oid_rt_get_rx_icv_err_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
}
if(poid_par_priv->information_buf_len>= sizeof(u32))
if (poid_par_priv->information_buf_len>= sizeof(u32))
{
//_rtw_memcpy(*(uint *)poid_par_priv->information_buf,padapter->recvpriv.rx_icv_err,sizeof(u32));
*(uint *)poid_par_priv->information_buf = padapter->recvpriv.rx_icv_err;
@ -443,7 +443,7 @@ NDIS_STATUS oid_rt_set_encryption_algorithm_hdl(struct oid_par_priv* poid_par_pr
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != SET_OID)
if (poid_par_priv->type_of_oid != SET_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -458,14 +458,14 @@ NDIS_STATUS oid_rt_get_preamble_mode_hdl(struct oid_par_priv* poid_par_priv)
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
ULONG preamblemode = 0 ;
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
}
if(poid_par_priv->information_buf_len>= sizeof(ULONG))
if (poid_par_priv->information_buf_len>= sizeof(ULONG))
{
if(padapter->registrypriv.preamble == PREAMBLE_LONG)
if (padapter->registrypriv.preamble == PREAMBLE_LONG)
preamblemode = 0;
else if (padapter->registrypriv.preamble == PREAMBLE_AUTO)
preamblemode = 1;
@ -488,7 +488,7 @@ NDIS_STATUS oid_rt_get_ap_ip_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -503,7 +503,7 @@ NDIS_STATUS oid_rt_get_channelplan_hdl(struct oid_par_priv* poid_par_priv)
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
struct eeprom_priv* peeprompriv = &padapter->eeprompriv;
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -519,7 +519,7 @@ NDIS_STATUS oid_rt_set_channelplan_hdl(struct oid_par_priv* poid_par_priv)
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
struct eeprom_priv* peeprompriv = &padapter->eeprompriv;
if(poid_par_priv->type_of_oid != SET_OID)
if (poid_par_priv->type_of_oid != SET_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -535,16 +535,16 @@ NDIS_STATUS oid_rt_set_preamble_mode_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
ULONG preamblemode = 0;
if(poid_par_priv->type_of_oid != SET_OID)
if (poid_par_priv->type_of_oid != SET_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
}
if(poid_par_priv->information_buf_len>= sizeof(ULONG))
if (poid_par_priv->information_buf_len>= sizeof(ULONG))
{
preamblemode = *(ULONG *)poid_par_priv->information_buf ;
if( preamblemode == 0)
if ( preamblemode == 0)
padapter->registrypriv.preamble = PREAMBLE_LONG;
else if (preamblemode==1 )
padapter->registrypriv.preamble = PREAMBLE_AUTO;
@ -567,7 +567,7 @@ NDIS_STATUS oid_rt_set_bcn_intvl_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != SET_OID)
if (poid_par_priv->type_of_oid != SET_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -588,12 +588,12 @@ NDIS_STATUS oid_rt_get_total_tx_bytes_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
}
if(poid_par_priv->information_buf_len>= sizeof(ULONG))
if (poid_par_priv->information_buf_len>= sizeof(ULONG))
{
*(u64 *)poid_par_priv->information_buf = padapter->xmitpriv.tx_bytes;
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
@ -612,12 +612,12 @@ NDIS_STATUS oid_rt_get_total_rx_bytes_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
}
if(poid_par_priv->information_buf_len>= sizeof(ULONG))
if (poid_par_priv->information_buf_len>= sizeof(ULONG))
{
//_rtw_memcpy(*(uint *)poid_par_priv->information_buf,padapter->recvpriv.rx_icv_err,sizeof(u32));
*(u64 *)poid_par_priv->information_buf = padapter->recvpriv.rx_bytes;
@ -642,7 +642,7 @@ NDIS_STATUS oid_rt_get_enc_key_mismatch_count_hdl(struct oid_par_priv* poid_par_
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -655,7 +655,7 @@ NDIS_STATUS oid_rt_get_enc_key_match_count_hdl(struct oid_par_priv* poid_par_pri
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -673,7 +673,7 @@ NDIS_STATUS oid_rt_get_channel_hdl(struct oid_par_priv* poid_par_priv)
ULONG channelnum;
_func_enter_;
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -701,7 +701,7 @@ NDIS_STATUS oid_rt_get_hardware_radio_off_hdl(struct oid_par_priv* poid_par_priv
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -714,7 +714,7 @@ NDIS_STATUS oid_rt_get_key_mismatch_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -728,12 +728,12 @@ NDIS_STATUS oid_rt_supported_wireless_mode_hdl(struct oid_par_priv* poid_par_pri
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
ULONG ulInfo = 0 ;
//DEBUG_ERR(("<**********************oid_rt_supported_wireless_mode_hdl \n"));
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
}
if(poid_par_priv->information_buf_len >= sizeof(ULONG)){
if (poid_par_priv->information_buf_len >= sizeof(ULONG)){
ulInfo |= 0x0100; //WIRELESS_MODE_B
ulInfo |= 0x0200; //WIRELESS_MODE_G
ulInfo |= 0x0400; //WIRELESS_MODE_A
@ -753,7 +753,7 @@ NDIS_STATUS oid_rt_get_channel_list_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -766,7 +766,7 @@ NDIS_STATUS oid_rt_get_scan_in_progress_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -795,7 +795,7 @@ NDIS_STATUS oid_rt_get_bss_wireless_mode_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -819,7 +819,7 @@ NDIS_STATUS oid_rt_ap_get_associated_station_list_hdl(struct oid_par_priv* poid_
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -846,7 +846,7 @@ NDIS_STATUS oid_rt_ap_set_passphrase_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != SET_OID)
if (poid_par_priv->type_of_oid != SET_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -865,14 +865,14 @@ NDIS_STATUS oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv* poid_par_priv)
_irqL oldirql;
_func_enter_;
//DEBUG_ERR(("<**********************oid_rt_pro_rf_write_registry_hdl \n"));
if(poid_par_priv->type_of_oid != SET_OID) //QUERY_OID
if (poid_par_priv->type_of_oid != SET_OID) //QUERY_OID
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
}
_irqlevel_changed_(&oldirql,LOWER);
if(poid_par_priv->information_buf_len== (sizeof(unsigned long)*3))
if (poid_par_priv->information_buf_len== (sizeof(unsigned long)*3))
{
//RegOffsetValue - The offset of RF register to write.
//RegDataWidth - The data width of RF register to write.
@ -880,7 +880,7 @@ NDIS_STATUS oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv* poid_par_priv)
//RegOffsetValue = *((unsigned long*)InformationBuffer);
//RegDataWidth = *((unsigned long*)InformationBuffer+1);
//RegDataValue = *((unsigned long*)InformationBuffer+2);
if(!rtw_setrfreg_cmd(Adapter,
if (!rtw_setrfreg_cmd(Adapter,
*(unsigned char*)poid_par_priv->information_buf,
(unsigned long)(*((unsigned long*)poid_par_priv->information_buf+2))))
{
@ -907,16 +907,16 @@ NDIS_STATUS oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv* poid_par_priv)
_func_enter_;
//DEBUG_ERR(("<**********************oid_rt_pro_rf_read_registry_hdl \n"));
if(poid_par_priv->type_of_oid != SET_OID) //QUERY_OID
if (poid_par_priv->type_of_oid != SET_OID) //QUERY_OID
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
}
_irqlevel_changed_(&oldirql,LOWER);
if(poid_par_priv->information_buf_len== (sizeof(unsigned long)*3))
if (poid_par_priv->information_buf_len== (sizeof(unsigned long)*3))
{
if(Adapter->mppriv.act_in_progress == _TRUE)
if (Adapter->mppriv.act_in_progress == _TRUE)
{
status = NDIS_STATUS_NOT_ACCEPTED;
}
@ -935,7 +935,7 @@ NDIS_STATUS oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv* poid_par_priv)
//RegOffsetValue = *((unsigned long*)InformationBuffer);
//RegDataWidth = *((unsigned long*)InformationBuffer+1);
//RegDataValue = *((unsigned long*)InformationBuffer+2);
if(!rtw_getrfreg_cmd(Adapter,
if (!rtw_getrfreg_cmd(Adapter,
*(unsigned char*)poid_par_priv->information_buf,
(unsigned char*)&Adapter->mppriv.workparam.io_value))
{
@ -974,7 +974,7 @@ NDIS_STATUS oid_rt_get_connect_state_hdl(struct oid_par_priv* poid_par_priv)
ULONG ulInfo;
if(poid_par_priv->type_of_oid != QUERY_OID)
if (poid_par_priv->type_of_oid != QUERY_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;
@ -985,11 +985,11 @@ NDIS_STATUS oid_rt_get_connect_state_hdl(struct oid_par_priv* poid_par_priv)
// nStatus==2 AdHocMode
// nStatus==3 NotAssociated
if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == _TRUE)
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == _TRUE)
ulInfo = CHECKINGSTATUS;
else if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
else if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
ulInfo = ASSOCIATED;
else if(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)== _TRUE)
else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)== _TRUE)
ulInfo = ADHOCMODE;
else
ulInfo = NOTASSOCIATED ;
@ -1000,11 +1000,11 @@ NDIS_STATUS oid_rt_get_connect_state_hdl(struct oid_par_priv* poid_par_priv)
#if 0
// Rearrange the order to let the UI still shows connection when scan is in progress
RT_TRACE(COMP_OID_QUERY, DBG_LOUD, ("===> Query OID_RT_GET_CONNECT_STATE.\n"));
if(pMgntInfo->mAssoc)
if (pMgntInfo->mAssoc)
ulInfo = 1;
else if(pMgntInfo->mIbss)
else if (pMgntInfo->mIbss)
ulInfo = 2;
else if(pMgntInfo->bScanInProgress)
else if (pMgntInfo->bScanInProgress)
ulInfo = 0;
else
ulInfo = 3;
@ -1020,7 +1020,7 @@ NDIS_STATUS oid_rt_set_default_key_id_hdl(struct oid_par_priv* poid_par_priv)
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
if(poid_par_priv->type_of_oid != SET_OID)
if (poid_par_priv->type_of_oid != SET_OID)
{
status = NDIS_STATUS_NOT_ACCEPTED;
return status;

View file

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

View file

@ -82,7 +82,7 @@ int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds, u32 cmd_len
ori_len = buf_offset+pattrib->pktlen;
//check if the io_buf can accommodate new cmds
if(ori_len + cmd_len + 8 > MAX_XMITBUF_SZ) {
if (ori_len + cmd_len + 8 > MAX_XMITBUF_SZ) {
DBG_871X("%s %u is large than MAX_XMITBUF_SZ:%u, can't accommodate new cmds\n", __FUNCTION__
, ori_len + cmd_len + 8, MAX_XMITBUF_SZ);
return _FAIL;
@ -98,11 +98,11 @@ int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds, u32 cmd_len
}
bool rtw_IOL_applied(ADAPTER *adapter)
{
if(1 == adapter->registrypriv.fw_iol)
if (1 == adapter->registrypriv.fw_iol)
return _TRUE;
#ifdef CONFIG_USB_HCI
if((2 == adapter->registrypriv.fw_iol) && (!adapter_to_dvobj(adapter)->ishighspeed))
if ((2 == adapter->registrypriv.fw_iol) && (!adapter_to_dvobj(adapter)->ishighspeed))
return _TRUE;
#endif
@ -111,11 +111,11 @@ bool rtw_IOL_applied(ADAPTER *adapter)
/*
bool rtw_IOL_applied(ADAPTER *adapter)
{
if(adapter->registrypriv.fw_iol)
if (adapter->registrypriv.fw_iol)
return _TRUE;
#ifdef CONFIG_USB_HCI
if(!adapter_to_dvobj(adapter)->ishighspeed)
if (!adapter_to_dvobj(adapter)->ishighspeed)
return _TRUE;
#endif
@ -142,7 +142,7 @@ int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, u8
cmd.address = cpu_to_le16(addr);
cmd.data = cpu_to_le32(value);
if(mask!=0xFF)
if (mask!=0xFF)
{
cmd.length = 12;
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
@ -163,7 +163,7 @@ int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, u
cmd.address = cpu_to_le16(addr);
cmd.data = cpu_to_le32(value);
if(mask!=0xFFFF)
if (mask!=0xFFFF)
{
cmd.length = 12;
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
@ -184,7 +184,7 @@ int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, u
cmd.address = cpu_to_le16(addr);
cmd.data = cpu_to_le32(value);
if(mask!=0xFFFFFFFF)
if (mask!=0xFFFFFFFF)
{
cmd.length = 12;
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
@ -206,7 +206,7 @@ int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr,
cmd.address = (rf_path<<8) |((addr) &0xFF);
cmd.data = cpu_to_le32(value);
if(mask!=0x000FFFFF)
if (mask!=0x000FFFFF)
{
cmd.length = 12;
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
@ -251,7 +251,7 @@ int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame)
u8 rtw_IOL_cmd_boundary_handle(struct xmit_frame *pxmit_frame)
{
u8 is_cmd_bndy = _FALSE;
if(((pxmit_frame->attrib.pktlen+32)%256) + 8 >= 256){
if (((pxmit_frame->attrib.pktlen+32)%256) + 8 >= 256){
rtw_IOL_append_END_cmd(pxmit_frame);
pxmit_frame->attrib.pktlen = ((((pxmit_frame->attrib.pktlen+32)/256)+1)*256 );
@ -268,10 +268,10 @@ void rtw_IOL_cmd_buf_dump(ADAPTER *Adapter,int buf_len,u8 *pbuf)
int j=1;
printk("###### %s ######\n",__FUNCTION__);
for(i=0;i< buf_len;i++){
for (i=0;i< buf_len;i++){
printk("%02x-",*(pbuf+i));
if(j%32 ==0) printk("\n");j++;
if (j%32 ==0) printk("\n");j++;
}
printk("\n");
printk("============= ioreg_cmd len = %d =============== \n",buf_len);
@ -380,10 +380,10 @@ int rtw_IOL_exec_cmd_array_sync(PADAPTER adapter, u8 *IOL_cmds, u32 cmd_num, u32
{
struct xmit_frame *xmit_frame;
if((xmit_frame=rtw_IOL_accquire_xmit_frame(adapter)) == NULL)
if ((xmit_frame=rtw_IOL_accquire_xmit_frame(adapter)) == NULL)
return _FAIL;
if(rtw_IOL_append_cmds(xmit_frame, IOL_cmds, cmd_num<<3) == _FAIL)
if (rtw_IOL_append_cmds(xmit_frame, IOL_cmds, cmd_num<<3) == _FAIL)
return _FAIL;
return rtw_IOL_exec_cmds_sync(adapter, xmit_frame, max_wating_ms,0);

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -50,7 +50,7 @@ u32 read_macreg(_adapter *padapter, u32 addr, u32 sz)
{
u32 val = 0;
switch(sz)
switch (sz)
{
case 1:
val = rtw_read8(padapter, addr);
@ -72,7 +72,7 @@ u32 read_macreg(_adapter *padapter, u32 addr, u32 sz)
void write_macreg(_adapter *padapter, u32 addr, u32 val, u32 sz)
{
switch(sz)
switch (sz)
{
case 1:
rtw_write8(padapter, addr, (u8)val);
@ -169,7 +169,7 @@ void mp_wi_callback(
struct mp_wi_cntx *pmp_wi_cntx=&pmppriv->wi_cntx;
// Execute specified action.
if(pmp_wi_cntx->curractfunc != NULL)
if (pmp_wi_cntx->curractfunc != NULL)
{
LARGE_INTEGER cur_time;
ULONGLONG start_time, end_time;
@ -426,7 +426,7 @@ MPT_InitializeAdapter(
//ledsetting = rtw_read32(pAdapter, REG_LEDCFG0);
//rtw_write32(pAdapter, REG_LEDCFG0, ledsetting & ~LED0DIS);
if(IS_HARDWARE_TYPE_8192DU(pAdapter))
if (IS_HARDWARE_TYPE_8192DU(pAdapter))
{
rtw_write32(pAdapter, REG_LEDCFG0, 0x8888);
}
@ -505,9 +505,9 @@ MPT_DeInitAdapter(
#if 0 // for Windows
PlatformFreeWorkItem( &(pMptCtx->MptWorkItem) );
while(pMptCtx->bMptWorkItemInProgress)
while (pMptCtx->bMptWorkItemInProgress)
{
if(NdisWaitEvent(&(pMptCtx->MptWorkItemEvent), 50))
if (NdisWaitEvent(&(pMptCtx->MptWorkItemEvent), 50))
{
break;
}
@ -727,7 +727,7 @@ void mp_stop_test(PADAPTER padapter)
_irqL irqL;
if(pmppriv->mode==MP_ON)
if (pmppriv->mode==MP_ON)
{
pmppriv->bSetTxPower=0;
_enter_critical_bh(&pmlmepriv->lock, &irqL);
@ -1200,7 +1200,7 @@ void SetPacketTx(PADAPTER padapter)
desc->txdw4 |= cpu_to_le32(USERATE);
desc->txdw4 |= cpu_to_le32(DISDATAFB);
if( pmp_priv->preamble ){
if ( pmp_priv->preamble ){
if (pmp_priv->rateidx <= MPT_RATE_54M)
desc->txdw4 |= cpu_to_le32(DATA_SHORT); // CCK Short Preamble
}
@ -1210,7 +1210,7 @@ void SetPacketTx(PADAPTER padapter)
// offset 20
desc->txdw5 |= cpu_to_le32(pmp_priv->rateidx & 0x0000001F);
if( pmp_priv->preamble ){
if ( pmp_priv->preamble ){
if (pmp_priv->rateidx > MPT_RATE_54M)
desc->txdw5 |= cpu_to_le32(SGI); // MCS Short Guard Interval
}
@ -1274,7 +1274,7 @@ void SetPacketRx(PADAPTER pAdapter, u8 bStartRx)
{
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
if(bStartRx)
if (bStartRx)
{
// Accept CRC error and destination address
#if 1
@ -1438,7 +1438,7 @@ void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv)
u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ;
u32 num_xmit_extbuf = NR_XMIT_EXTBUFF;
if(padapter->registrypriv.mp_mode ==0)
if (padapter->registrypriv.mp_mode ==0)
{
max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ;
num_xmit_extbuf = NR_XMIT_EXTBUFF;
@ -1450,18 +1450,18 @@ void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv)
}
pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf;
for(i=0; i<num_xmit_extbuf; i++)
for (i=0; i<num_xmit_extbuf; i++)
{
rtw_os_xmit_resource_free(padapter, pxmitbuf,(max_xmit_extbuf_size + XMITBUF_ALIGN_SZ));
pxmitbuf++;
}
if(pxmitpriv->pallocated_xmit_extbuf) {
if (pxmitpriv->pallocated_xmit_extbuf) {
rtw_vmfree(pxmitpriv->pallocated_xmit_extbuf, num_xmit_extbuf * sizeof(struct xmit_buf) + 4);
}
if(padapter->registrypriv.mp_mode ==0)
if (padapter->registrypriv.mp_mode ==0)
{
max_xmit_extbuf_size = 20000;
num_xmit_extbuf = 1;
@ -1506,7 +1506,7 @@ void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv)
pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitbuf->pallocated_buf), 4);
*/
if((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,max_xmit_extbuf_size + XMITBUF_ALIGN_SZ)) == _FAIL) {
if ((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,max_xmit_extbuf_size + XMITBUF_ALIGN_SZ)) == _FAIL) {
res= _FAIL;
goto exit;
}

View file

@ -1783,7 +1783,7 @@ _func_enter_;
u8 res=_SUCCESS;
DEBUG_INFO(("===> Set OID_RT_PRO_H2C_GET_RATE_TABLE.\n"));
if(pmp_wi_cntx->bmp_wi_progress ==_TRUE){
if (pmp_wi_cntx->bmp_wi_progress ==_TRUE){
DEBUG_ERR(("\n mp workitem is progressing, not allow to set another workitem right now!!!\n"));
Status = NDIS_STATUS_NOT_ACCEPTED;
break;
@ -1798,7 +1798,7 @@ _func_enter_;
res=rtw_getrttbl_cmd(Adapter,(struct getratable_rsp *)pmp_wi_cntx->param.data);
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
if(res != _SUCCESS)
if (res != _SUCCESS)
{
Status = NDIS_STATUS_NOT_ACCEPTED;
}
@ -2023,13 +2023,13 @@ static u32 mp_query_drv_var(_adapter *padapter, u8 offset, u32 var)
}
#if 0
if(offset <=100){ //For setting data rate and query data rate
if(offset==100){ //For query data rate
if (offset <=100){ //For setting data rate and query data rate
if (offset==100){ //For query data rate
RT_TRACE(_module_mp_, _drv_emerg_, ("\n mp_query_drv_var: offset(%d): query rate=0x%.2x \n",offset,padapter->registrypriv.tx_rate));
var=padapter->registrypriv.tx_rate;
}
else if(offset<0x1d){ //For setting data rate
else if (offset<0x1d){ //For setting data rate
padapter->registrypriv.tx_rate=offset;
var=padapter->registrypriv.tx_rate;
padapter->registrypriv.use_rate=_TRUE;
@ -2042,12 +2042,12 @@ static u32 mp_query_drv_var(_adapter *padapter, u8 offset, u32 var)
}
else if (offset<=110){ //for setting debug level
RT_TRACE(_module_mp_, _drv_emerg_, (" mp_query_drv_var: offset(%d) for set debug level\n",offset));
if(offset==110){ //For query data rate
if (offset==110){ //For query data rate
RT_TRACE(_module_mp_, _drv_emerg_, (" mp_query_drv_var: offset(%d): query dbg level=0x%.2x \n",offset,padapter->registrypriv.dbg_level));
padapter->registrypriv.dbg_level=GlobalDebugLevel;
var=padapter->registrypriv.dbg_level;
}
else if(offset<110 && offset>100){
else if (offset<110 && offset>100){
RT_TRACE(_module_mp_, _drv_emerg_, (" mp_query_drv_var: offset(%d): set dbg level=0x%.2x \n",offset,offset-100));
padapter->registrypriv.dbg_level=GlobalDebugLevel=offset-100;
var=padapter->registrypriv.dbg_level;
@ -2062,13 +2062,13 @@ static u32 mp_query_drv_var(_adapter *padapter, u8 offset, u32 var)
}
}
else if(offset >110 &&offset <116){
if(115==offset){
else if (offset >110 &&offset <116){
if (115==offset){
RT_TRACE(_module_mp_, _drv_emerg_, (" mp_query_drv_var(_drv_emerg_): offset(%d): query TRX access type: [tx_block_mode=%x,rx_block_mode=%x]\n",\
offset, adapter_to_dvobj(padapter)->tx_block_mode, adapter_to_dvobj(padapter)->rx_block_mode));
}
else {
switch(offset){
switch (offset){
case 111:
adapter_to_dvobj(padapter)->tx_block_mode=1;
adapter_to_dvobj(padapter)->rx_block_mode=1;
@ -2105,7 +2105,7 @@ static u32 mp_query_drv_var(_adapter *padapter, u8 offset, u32 var)
}
}
else if(offset>=127){
else if (offset>=127){
u64 prnt_dbg_comp;
u8 chg_idx;
u64 tmp_dbg_comp;
@ -2113,7 +2113,7 @@ static u32 mp_query_drv_var(_adapter *padapter, u8 offset, u32 var)
tmp_dbg_comp=BIT(chg_idx);
prnt_dbg_comp=padapter->registrypriv.dbg_component= GlobalDebugComponents;
RT_TRACE(_module_mp_, _drv_emerg_, (" 1: mp_query_drv_var: offset(%d;0x%x):for dbg conpoment prnt_dbg_comp=0x%.16x GlobalDebugComponents=0x%.16x padapter->registrypriv.dbg_component=0x%.16x\n",offset,offset,prnt_dbg_comp,GlobalDebugComponents,padapter->registrypriv.dbg_component));
if(offset==127){
if (offset==127){
// prnt_dbg_comp=padapter->registrypriv.dbg_component= GlobalDebugComponents;
var=(u32)(padapter->registrypriv.dbg_component);
RT_TRACE(0xffffffff, _drv_emerg_, ("2: mp_query_drv_var: offset(%d;0x%x):for query dbg conpoment=0x%x(l) 0x%x(h) GlobalDebugComponents=0x%x(l) 0x%x(h) \n",offset,offset,padapter->registrypriv.dbg_component,prnt_dbg_comp));
@ -2130,7 +2130,7 @@ static u32 mp_query_drv_var(_adapter *padapter, u8 offset, u32 var)
prnt_dbg_comp=GlobalDebugComponents=padapter->registrypriv.dbg_component;
RT_TRACE(0xffffffff, _drv_emerg_, ("3-2: mp_query_drv_var: offset(%d;0x%x):for query dbg conpoment=0x%x(l) 0x%x(h) GlobalDebugComponents=0x%x(l) 0x%x(h)\n",offset,offset,padapter->registrypriv.dbg_component,prnt_dbg_comp));
if(GlobalDebugComponents&tmp_dbg_comp){
if (GlobalDebugComponents&tmp_dbg_comp){
//this bit is already set, now clear it
GlobalDebugComponents=GlobalDebugComponents&(~tmp_dbg_comp);
}
@ -2619,13 +2619,13 @@ _func_enter_;
rcr_val8 = rtw_read8(Adapter, 0x10250048);//RCR
rcr_val8 &= ~(RCR_AB|RCR_AM|RCR_APM|RCR_AAP);
if(rx_pkt_type == RX_PKT_BROADCAST){
if (rx_pkt_type == RX_PKT_BROADCAST){
rcr_val8 |= (RCR_AB | RCR_ACRC32 );
}
else if(rx_pkt_type == RX_PKT_DEST_ADDR){
else if (rx_pkt_type == RX_PKT_DEST_ADDR){
rcr_val8 |= (RCR_AAP| RCR_AM |RCR_ACRC32);
}
else if(rx_pkt_type == RX_PKT_PHY_MATCH){
else if (rx_pkt_type == RX_PKT_PHY_MATCH){
rcr_val8 |= (RCR_APM|RCR_ACRC32);
}
else{
@ -2636,14 +2636,14 @@ _func_enter_;
rcr_val32 = rtw_read32(padapter, RCR);//RCR = 0x10250048
rcr_val32 &= ~(RCR_CBSSID|RCR_AB|RCR_AM|RCR_APM|RCR_AAP);
#if 0
if(rx_pkt_type == RX_PKT_BROADCAST){
if (rx_pkt_type == RX_PKT_BROADCAST){
rcr_val32 |= (RCR_AB|RCR_AM|RCR_APM|RCR_AAP|RCR_ACRC32);
}
else if(rx_pkt_type == RX_PKT_DEST_ADDR){
else if (rx_pkt_type == RX_PKT_DEST_ADDR){
//rcr_val32 |= (RCR_CBSSID|RCR_AAP|RCR_AM|RCR_ACRC32);
rcr_val32 |= (RCR_CBSSID|RCR_APM|RCR_ACRC32);
}
else if(rx_pkt_type == RX_PKT_PHY_MATCH){
else if (rx_pkt_type == RX_PKT_PHY_MATCH){
rcr_val32 |= (RCR_APM|RCR_ACRC32);
//rcr_val32 |= (RCR_AAP|RCR_ACRC32);
}
@ -2834,7 +2834,7 @@ unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv)
pattrib->nr_frags = 1;
pattrib->priority = 0;
#ifndef CONFIG_MP_LINUX
if(IS_MCAST(pethhdr->h_dest))
if (IS_MCAST(pethhdr->h_dest))
pattrib->mac_id = 4;
else
pattrib->mac_id = 5;

View file

@ -29,7 +29,7 @@ int rtw_p2p_is_channel_list_ok( u8 desired_ch, u8* ch_list, u8 ch_cnt )
{
int found = 0, i = 0;
for( i = 0; i < ch_cnt; i++ )
for ( i = 0; i < ch_cnt; i++ )
{
if ( ch_list[ i ] == desired_ch )
{
@ -103,7 +103,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
plist = get_next(plist);
if(psta->is_p2p_device)
if (psta->is_p2p_device)
{
tmplen = 0;
@ -133,7 +133,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
_rtw_memcpy(pcur, psta->secdev_types_list, psta->num_of_secdev_type*8);
pcur += psta->num_of_secdev_type*8;
if(psta->dev_name_len>0)
if (psta->dev_name_len>0)
{
//*(u16*)(pcur) = cpu_to_be16( WPS_ATTR_DEVICE_NAME );
RTW_PUT_BE16(pcur, WPS_ATTR_DEVICE_NAME);
@ -163,7 +163,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
}
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
if(attr_len>0)
if (attr_len>0)
{
len = rtw_set_p2p_attr_content(pbuf, P2P_ATTR_GROUP_INFO, attr_len, pdata_attr);
}
@ -531,7 +531,7 @@ u32 build_beacon_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
// Group Capability Bitmap, 1 byte
capability = P2P_DEVCAP_INVITATION_PROC|P2P_DEVCAP_CLIENT_DISCOVERABILITY;
capability |= ((P2P_GRPCAP_GO | P2P_GRPCAP_INTRABSS) << 8);
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_PROVISIONING_ING))
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_PROVISIONING_ING))
capability |= (P2P_GRPCAP_GROUP_FORMATION<<8);
capability = cpu_to_le16(capability);
@ -941,7 +941,7 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel
wfdie[ wfdielen++ ] = 0;
wfdie[ wfdielen++ ] = 0;
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
{
// WFD Session Information ATTR
// Type:
@ -993,7 +993,7 @@ u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
struct wifi_display_info *pwfd_info = NULL;
// WFD OUI
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE))
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE))
{
return 0;
}
@ -1948,11 +1948,11 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
p2pie[ p2pielen++ ] = DMP_P2P_DEVCAP_SUPPORT;
// Group Capability Bitmap, 1 byte
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
{
p2pie[ p2pielen ] = (P2P_GRPCAP_GO | P2P_GRPCAP_INTRABSS);
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_PROVISIONING_ING))
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_PROVISIONING_ING))
p2pie[ p2pielen ] |= P2P_GRPCAP_GROUP_FORMATION;
p2pielen++;
@ -1991,7 +1991,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
// Type:
// Length:
// Value:
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
{
//go_add_noa_attr(pwdinfo);
}
@ -2005,7 +2005,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
// + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes)
//*(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len );
#ifdef CONFIG_INTEL_WIDI
if( _rtw_memcmp( pwdinfo->padapter->mlmepriv.sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN ) == _FALSE )
if ( _rtw_memcmp( pwdinfo->padapter->mlmepriv.sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN ) == _FALSE )
{
RTW_PUT_LE16(p2pie + p2pielen, 21 + 8 + pwdinfo->device_name_len);
}
@ -2043,7 +2043,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
// Number of Secondary Device Types
#ifdef CONFIG_INTEL_WIDI
if( _rtw_memcmp( pwdinfo->padapter->mlmepriv.sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN ) == _FALSE )
if ( _rtw_memcmp( pwdinfo->padapter->mlmepriv.sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN ) == _FALSE )
{
p2pie[ p2pielen++ ] = 0x01;
@ -2079,7 +2079,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
// Type:
// Length:
// Value:
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
{
p2pielen += go_add_group_info_attr(pwdinfo, p2pie + p2pielen);
}
@ -2281,7 +2281,7 @@ u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
{
int i, g_rate =0;
for( i = 0; i < rate_cnt; i++ )
for ( i = 0; i < rate_cnt; i++ )
{
if ( ( ( *( p + 2 + i ) & 0xff ) != 0x02 ) &&
( ( *( p + 2 + i ) & 0xff ) != 0x04 ) &&
@ -2318,9 +2318,9 @@ u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_);
ssid_len &= 0xff; // Just last 1 byte is valid for ssid len of the probe request
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE) || rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE) || rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
{
if((p2pie=rtw_get_p2p_ie( pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_ , len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_ , NULL, &p2pielen)))
if ((p2pie=rtw_get_p2p_ie( pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_ , len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_ , NULL, &p2pielen)))
{
if ( (p != NULL) && _rtw_memcmp( ( void * ) ( p+2 ), ( void * ) pwdinfo->p2p_wildcard_ssid , 7 ))
{
@ -2359,7 +2359,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
u8 * p2p_ie;
u32 p2p_ielen = 0;
if(!rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
if (!rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
return P2P_STATUS_FAIL_REQUEST_UNABLE;
frame_type = GetFrameSubType(pframe);
@ -2390,7 +2390,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
while ( p2p_ie )
{
//Check P2P Capability ATTR
if( rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&cap_attr, (uint*) &attr_contentlen) )
if ( rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&cap_attr, (uint*) &attr_contentlen) )
{
DBG_8192C( "[%s] Got P2P Capability Attr!!\n", __FUNCTION__ );
cap_attr = le16_to_cpu(cap_attr);
@ -2401,11 +2401,11 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
//Check P2P Device Info ATTR
if(rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_INFO, NULL, (uint*)&attr_contentlen))
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_INFO, NULL, (uint*)&attr_contentlen))
{
DBG_8192C( "[%s] Got P2P DEVICE INFO Attr!!\n", __FUNCTION__ );
pattr_content = pbuf = rtw_zmalloc(attr_contentlen);
if(pattr_content)
if (pattr_content)
{
u8 num_of_secdev_type;
u16 dev_name_len;
@ -2429,7 +2429,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
num_of_secdev_type = *pattr_content;
pattr_content += 1;
if(num_of_secdev_type==0)
if (num_of_secdev_type==0)
{
psta->num_of_secdev_type = 0;
}
@ -2449,7 +2449,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
//dev_name_len = attr_contentlen - ETH_ALEN - 2 - 8 - 1 - (num_of_secdev_type*8);
psta->dev_name_len=0;
if(WPS_ATTR_DEVICE_NAME == be16_to_cpu(*(u16*)pattr_content))
if (WPS_ATTR_DEVICE_NAME == be16_to_cpu(*(u16*)pattr_content))
{
dev_name_len = be16_to_cpu(*(u16*)(pattr_content+2));
@ -2494,13 +2494,13 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le
u8 dev_addr[ETH_ALEN] = { 0x00 };
u32 attr_contentlen = 0;
if(rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen))
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen))
{
if(_rtw_memcmp(pwdinfo->device_addr, groupid, ETH_ALEN) &&
if (_rtw_memcmp(pwdinfo->device_addr, groupid, ETH_ALEN) &&
_rtw_memcmp(pwdinfo->p2p_group_ssid, groupid+ETH_ALEN, pwdinfo->p2p_group_ssid_len))
{
attr_contentlen=0;
if(rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_ID, dev_addr, &attr_contentlen))
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_ID, dev_addr, &attr_contentlen))
{
_irqL irqL;
_list *phead, *plist;
@ -2516,7 +2516,7 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le
plist = get_next(plist);
if(psta->is_p2p_device && (psta->dev_cap&P2P_DEVCAP_CLIENT_DISCOVERABILITY) &&
if (psta->is_p2p_device && (psta->dev_cap&P2P_DEVCAP_CLIENT_DISCOVERABILITY) &&
_rtw_memcmp(psta->dev_addr, dev_addr, ETH_ALEN))
{
@ -2582,7 +2582,7 @@ u8 process_p2p_provdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
if ( rtw_get_wps_attr_content( wpsie, wps_ielen, WPS_ATTR_CONF_METHOD , ( u8* ) &uconfig_method, &attr_contentlen) )
{
uconfig_method = be16_to_cpu( uconfig_method );
switch( uconfig_method )
switch ( uconfig_method )
{
case WPS_CM_DISPLYA:
{
@ -2627,12 +2627,12 @@ u8 rtw_p2p_get_peer_ch_list(struct wifidirect_info *pwdinfo, u8 *ch_content, u8
ch_content += 3;
ch_cnt -= 3;
while( ch_cnt > 0)
while ( ch_cnt > 0)
{
ch_content += 1;
ch_cnt -= 1;
temp = *ch_content;
for( i = 0 ; i < temp ; i++, j++ )
for ( i = 0 ; i < temp ; i++, j++ )
{
peer_ch_list[j] = *( ch_content + 1 + i );
}
@ -2648,7 +2648,7 @@ u8 rtw_p2p_check_peer_oper_ch(struct mlme_ext_priv *pmlmeext, u8 ch)
{
u8 i = 0;
for( i = 0; i < pmlmeext->max_chan_nums; i++ )
for ( i = 0; i < pmlmeext->max_chan_nums; i++ )
{
if ( pmlmeext->channel_set[ i ].ChannelNum == ch )
{
@ -2664,11 +2664,11 @@ u8 rtw_p2p_ch_inclusion(struct mlme_ext_priv *pmlmeext, u8 *peer_ch_list, u8 pee
int i = 0, j = 0, temp = 0;
u8 ch_no = 0;
for( i = 0; i < peer_ch_num; i++ )
for ( i = 0; i < peer_ch_num; i++ )
{
for( j = temp; j < pmlmeext->max_chan_nums; j++ )
for ( j = temp; j < pmlmeext->max_chan_nums; j++ )
{
if( *( peer_ch_list + i ) == pmlmeext->channel_set[ j ].ChannelNum )
if ( *( peer_ch_list + i ) == pmlmeext->channel_set[ j ].ChannelNum )
{
ch_list_inclusioned[ ch_no++ ] = *( peer_ch_list + i );
temp = j;
@ -2710,7 +2710,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
// Commented by Kurt 20120113
// If some device wants to do p2p handshake without sending prov_disc_req
// We have to get peer_req_cm from here.
if(_rtw_memcmp( pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "000", 3) )
if (_rtw_memcmp( pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "000", 3) )
{
rtw_get_wps_attr_content( wpsie, wps_ielen, WPS_ATTR_DEVICE_PWID, (u8*) &wps_devicepassword_id, &wps_devicepassword_id_len);
wps_devicepassword_id = be16_to_cpu( wps_devicepassword_id );
@ -2771,12 +2771,12 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_ING);
//Check P2P Capability ATTR
if(rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&cap_attr, (uint*)&attr_contentlen) )
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&cap_attr, (uint*)&attr_contentlen) )
{
cap_attr = le16_to_cpu(cap_attr);
#if defined(CONFIG_WFD) && defined(CONFIG_TDLS)
if(!(cap_attr & P2P_GRPCAP_INTRABSS) )
if (!(cap_attr & P2P_GRPCAP_INTRABSS) )
ptdlsinfo->ap_prohibited = _TRUE;
#endif //defined(CONFIG_WFD) && defined(CONFIG_TDLS)
}
@ -2815,7 +2815,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
rtw_p2p_set_role(pwdinfo, P2P_ROLE_CLIENT);
}
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
{
// Store the group id information.
_rtw_memcpy( pwdinfo->groupid_info.go_device_addr, pwdinfo->device_addr, ETH_ALEN );
@ -2838,7 +2838,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
peer_ch_num = rtw_p2p_get_peer_ch_list(pwdinfo, ch_content, ch_cnt, peer_ch_list);
ch_num_inclusioned = rtw_p2p_ch_inclusion(&padapter->mlmeextpriv, peer_ch_list, peer_ch_num, ch_list_inclusioned);
if( ch_num_inclusioned == 0)
if ( ch_num_inclusioned == 0)
{
DBG_871X( "[%s] No common channel in channel list!\n", __FUNCTION__ );
result = P2P_STATUS_FAIL_NO_COMMON_CH;
@ -2846,7 +2846,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
break;
}
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
{
if ( !rtw_p2p_is_channel_list_ok( pwdinfo->operating_channel,
ch_list_inclusioned, ch_num_inclusioned) )
@ -2974,11 +2974,11 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram
{
//Check P2P Capability ATTR
if(rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&cap_attr, (uint*)&attr_contentlen) )
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&cap_attr, (uint*)&attr_contentlen) )
{
cap_attr = le16_to_cpu(cap_attr);
#ifdef CONFIG_TDLS
if(!(cap_attr & P2P_GRPCAP_INTRABSS) )
if (!(cap_attr & P2P_GRPCAP_INTRABSS) )
ptdlsinfo->ap_prohibited = _TRUE;
#endif // CONFIG_TDLS
}
@ -3058,7 +3058,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram
rtw_p2p_set_role(pwdinfo, P2P_ROLE_CLIENT);
}
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
{
// Store the group id information.
_rtw_memcpy( pwdinfo->groupid_info.go_device_addr, pwdinfo->device_addr, ETH_ALEN );
@ -3084,7 +3084,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram
peer_ch_num = rtw_p2p_get_peer_ch_list(pwdinfo, pwdinfo->channel_list_attr, pwdinfo->channel_list_attr_len, peer_ch_list);
ch_num_inclusioned = rtw_p2p_ch_inclusion(&padapter->mlmeextpriv, peer_ch_list, peer_ch_num, ch_list_inclusioned);
if( ch_num_inclusioned == 0)
if ( ch_num_inclusioned == 0)
{
DBG_871X( "[%s] No common channel in channel list!\n", __FUNCTION__ );
result = P2P_STATUS_FAIL_NO_COMMON_CH;
@ -3092,7 +3092,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram
break;
}
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
{
if ( !rtw_p2p_is_channel_list_ok( pwdinfo->operating_channel,
ch_list_inclusioned, ch_num_inclusioned) )
@ -3325,7 +3325,7 @@ void restore_p2p_state_handler( _adapter* padapter )
_func_enter_;
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_FAIL))
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_FAIL))
{
rtw_p2p_set_role(pwdinfo, P2P_ROLE_DEVICE);
}
@ -3337,7 +3337,7 @@ _func_enter_;
struct mlme_priv *pbuddy_mlmepriv = &pbuddy_adapter->mlmepriv;
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_RX_PROVISION_DIS_RSP))
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_RX_PROVISION_DIS_RSP))
{
set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode);
@ -3348,7 +3348,7 @@ _func_enter_;
rtw_p2p_set_state(pwdinfo, rtw_p2p_pre_state(pwdinfo));
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE))
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE))
{
#ifdef CONFIG_CONCURRENT_MODE
p2p_concurrent_handler( padapter );
@ -3429,7 +3429,7 @@ _func_enter_;
issue_nulldata(pbuddy_adapter, NULL, 0, 3, 500);
#else //CONFIG_IOCTL_CFG80211
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE))
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE))
{
// Now, the driver stays on the AP's channel.
// If the pwdinfo->ext_listen_period = 0, that means the P2P listen state is not available on listen channel.
@ -3476,7 +3476,7 @@ _func_enter_;
// Todo: To check the value of pwdinfo->ext_listen_interval is equal to 0 or not.
_set_timer( &pwdinfo->ap_p2p_switch_timer, pwdinfo->ext_listen_interval );
}
else if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_OK))
else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_OK))
{
// The driver had finished the P2P handshake successfully.
val8 = 0;
@ -3484,7 +3484,7 @@ _func_enter_;
set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode);
issue_nulldata(pbuddy_adapter, NULL, 0, 3, 500);
}
else if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ))
else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ))
{
val8 = 1;
set_channel_bwmode(padapter, pwdinfo->tx_prov_disc_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
@ -3492,7 +3492,7 @@ _func_enter_;
issue_probereq_p2p(padapter, NULL);
_set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT );
}
else if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING) && pwdinfo->nego_req_info.benable == _TRUE)
else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING) && pwdinfo->nego_req_info.benable == _TRUE)
{
val8 = 1;
set_channel_bwmode(padapter, pwdinfo->nego_req_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
@ -3500,7 +3500,7 @@ _func_enter_;
issue_probereq_p2p(padapter, NULL);
_set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT );
}
else if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_INVITE_REQ ) && pwdinfo->invitereq_info.benable == _TRUE)
else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_INVITE_REQ ) && pwdinfo->invitereq_info.benable == _TRUE)
{
/*
val8 = 1;
@ -3546,7 +3546,7 @@ _func_enter_;
}else
#endif //CONFIG_CONCURRENT_MODE
if( pcfg80211_wdinfo->restore_channel != pmlmeext->cur_channel )
if ( pcfg80211_wdinfo->restore_channel != pmlmeext->cur_channel )
{
if ( !check_fwstate(&padapter->mlmepriv, _FW_LINKED ) )
pmlmeext->cur_channel = pcfg80211_wdinfo->restore_channel;
@ -3604,7 +3604,7 @@ static void rtw_cfg80211_adjust_p2pie_channel(_adapter *padapter, const u8 *fram
u8 *pattr = NULL;
//Check P2P_ATTR_CH_LIST
if((pattr=rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, NULL, (uint*)&attr_contentlen))!=NULL)
if ((pattr=rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, NULL, (uint*)&attr_contentlen))!=NULL)
{
int i;
u32 num_of_ch;
@ -3612,11 +3612,11 @@ static void rtw_cfg80211_adjust_p2pie_channel(_adapter *padapter, const u8 *fram
attr_contentlen -= 3;
while(attr_contentlen>0)
while (attr_contentlen>0)
{
num_of_ch = *(pattr_temp+1);
for(i=0; i<num_of_ch; i++)
for (i=0; i<num_of_ch; i++)
*(pattr_temp+2+i) = pbuddy_mlmeext->cur_channel;//forcing to the same channel
pattr_temp += (2+num_of_ch);
@ -3627,7 +3627,7 @@ static void rtw_cfg80211_adjust_p2pie_channel(_adapter *padapter, const u8 *fram
//Check P2P_ATTR_OPERATING_CH
attr_contentlen = 0;
pattr = NULL;
if((pattr = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, NULL, (uint*)&attr_contentlen))!=NULL)
if ((pattr = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, NULL, (uint*)&attr_contentlen))!=NULL)
{
*(pattr+4) = pbuddy_mlmeext->cur_channel;//forcing to the same channel
}
@ -3651,7 +3651,7 @@ void rtw_append_wfd_ie(_adapter *padapter, u8 *buf, u32* len)
frame_body = (unsigned char *)(buf + sizeof(struct rtw_ieee80211_hdr_3addr));
category = frame_body[0];
if(category == RTW_WLAN_CATEGORY_PUBLIC)
if (category == RTW_WLAN_CATEGORY_PUBLIC)
{
action = frame_body[1];
if (action == ACT_PUBLIC_VENDOR
@ -3660,7 +3660,7 @@ void rtw_append_wfd_ie(_adapter *padapter, u8 *buf, u32* len)
{
OUI_Subtype = frame_body[6];
dialogToken = frame_body[7];
switch( OUI_Subtype )//OUI Subtype
switch ( OUI_Subtype )//OUI Subtype
{
case P2P_GO_NEGO_REQ:
{
@ -3717,7 +3717,7 @@ void rtw_append_wfd_ie(_adapter *padapter, u8 *buf, u32* len)
}
}
else if(category == RTW_WLAN_CATEGORY_P2P)
else if (category == RTW_WLAN_CATEGORY_P2P)
{
OUI_Subtype = frame_body[5];
dialogToken = frame_body[6];
@ -3727,7 +3727,7 @@ void rtw_append_wfd_ie(_adapter *padapter, u8 *buf, u32* len)
cpu_to_be32( *( ( u32* ) ( frame_body + 1 ) ) ), OUI_Subtype, dialogToken);
#endif
switch(OUI_Subtype)
switch (OUI_Subtype)
{
case P2P_NOTICE_OF_ABSENCE:
@ -3769,7 +3769,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
frame_body = (unsigned char *)(buf + sizeof(struct rtw_ieee80211_hdr_3addr));
category = frame_body[0];
//just for check
if(category == RTW_WLAN_CATEGORY_PUBLIC)
if (category == RTW_WLAN_CATEGORY_PUBLIC)
{
action = frame_body[1];
if (action == ACT_PUBLIC_VENDOR
@ -3789,24 +3789,24 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
len-sizeof(struct rtw_ieee80211_hdr_3addr)-_PUBLIC_ACTION_IE_OFFSET_,
NULL, &p2p_ielen);
switch( OUI_Subtype )//OUI Subtype
switch ( OUI_Subtype )//OUI Subtype
{
u8 *cont;
uint cont_len;
case P2P_GO_NEGO_REQ:
DBG_871X("RTW_%s:P2P_GO_NEGO_REQ, dialogToken=%d\n", (tx==_TRUE)?"Tx":"Rx", dialogToken);
if(tx)
if (tx)
{
#ifdef CONFIG_DRV_ISSUE_PROV_REQ // IOT FOR S2
if(pwdev_priv->provdisc_req_issued == _FALSE)
if (pwdev_priv->provdisc_req_issued == _FALSE)
rtw_cfg80211_issue_p2p_provision_request(padapter, buf, len);
#endif //CONFIG_DRV_ISSUE_PROV_REQ
//pwdev_priv->provdisc_req_issued = _FALSE;
#ifdef CONFIG_CONCURRENT_MODE
if(check_buddy_fwstate(padapter, _FW_LINKED))
if (check_buddy_fwstate(padapter, _FW_LINKED))
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
#endif
}
@ -3816,14 +3816,14 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
cont = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, NULL, &cont_len);
DBG_871X("RTW_%s:P2P_GO_NEGO_RESP, dialogToken=%d, status:%d\n", (tx==_TRUE)?"Tx":"Rx", dialogToken, cont?*cont:-1);
if(!tx)
if (!tx)
{
pwdev_priv->provdisc_req_issued = _FALSE;
}
#ifdef CONFIG_CONCURRENT_MODE
else
{
if(check_buddy_fwstate(padapter, _FW_LINKED))
if (check_buddy_fwstate(padapter, _FW_LINKED))
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
}
#endif
@ -3833,9 +3833,9 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
DBG_871X("RTW_%s:P2P_GO_NEGO_CONF, dialogToken=%d, status:%d\n", (tx==_TRUE)?"Tx":"Rx", dialogToken, cont?*cont:-1);
#ifdef CONFIG_CONCURRENT_MODE
if(tx)
if (tx)
{
if(check_buddy_fwstate(padapter, _FW_LINKED))
if (check_buddy_fwstate(padapter, _FW_LINKED))
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
}
#endif
@ -3846,10 +3846,10 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
int flags = -1;
int op_ch = 0;
if(tx)
if (tx)
{
#ifdef CONFIG_CONCURRENT_MODE
if(check_buddy_fwstate(padapter, _FW_LINKED))
if (check_buddy_fwstate(padapter, _FW_LINKED))
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
#endif
}
@ -3875,10 +3875,10 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
int status = -1;
int op_ch = 0;
if(tx)
if (tx)
{
#ifdef CONFIG_CONCURRENT_MODE
if(check_buddy_fwstate(padapter, _FW_LINKED))
if (check_buddy_fwstate(padapter, _FW_LINKED))
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
#endif
}
@ -3915,14 +3915,14 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
DBG_871X("RTW_%s:P2P_PROVISION_DISC_REQ, dialogToken=%d\n", (tx==_TRUE)?"Tx":"Rx", dialogToken);
//if(tx)
//if (tx)
{
pwdev_priv->provdisc_req_issued = _FALSE;
if( (p2p_ie=rtw_get_p2p_ie( frame_body + _PUBLIC_ACTION_IE_OFFSET_, frame_body_len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &p2p_ielen)))
if ( (p2p_ie=rtw_get_p2p_ie( frame_body + _PUBLIC_ACTION_IE_OFFSET_, frame_body_len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &p2p_ielen)))
{
if(rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, NULL, &contentlen))
if (rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, NULL, &contentlen))
{
pwdev_priv->provdisc_req_issued = _FALSE;//case: p2p_client join p2p GO
}
@ -3949,7 +3949,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
}
}
else if(category == RTW_WLAN_CATEGORY_P2P)
else if (category == RTW_WLAN_CATEGORY_P2P)
{
OUI_Subtype = frame_body[5];
dialogToken = frame_body[6];
@ -3961,7 +3961,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
is_p2p_frame = OUI_Subtype;
switch(OUI_Subtype)
switch (OUI_Subtype)
{
case P2P_NOTICE_OF_ABSENCE:
DBG_871X("RTW_%s:P2P_NOTICE_OF_ABSENCE, dialogToken=%d\n", (tx==_TRUE)?"TX":"RX", dialogToken);
@ -4006,7 +4006,7 @@ void p2p_protocol_wk_hdl(_adapter *padapter, int intCmdType)
_func_enter_;
switch(intCmdType)
switch (intCmdType)
{
case P2P_FIND_PHASE_WK:
{
@ -4104,15 +4104,15 @@ void process_p2p_ps_ie(PADAPTER padapter, u8 *IEs, u32 IELength)
_func_enter_;
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
{
return;
}
#ifdef CONFIG_CONCURRENT_MODE
if(padapter->iface_type != IFACE_PORT0)
if (padapter->iface_type != IFACE_PORT0)
return;
#endif
if(IELength <= _BEACON_IE_OFFSET_)
if (IELength <= _BEACON_IE_OFFSET_)
return;
ies = IEs + _BEACON_IE_OFFSET_;
@ -4120,16 +4120,16 @@ _func_enter_;
p2p_ie = rtw_get_p2p_ie( ies, ies_len, NULL, &p2p_ielen);
while(p2p_ie)
while (p2p_ie)
{
find_p2p = _TRUE;
// Get Notice of Absence IE.
if(rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_NOA, noa_attr, &attr_contentlen))
if (rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_NOA, noa_attr, &attr_contentlen))
{
find_p2p_ps = _TRUE;
noa_index = noa_attr[0];
if( (pwdinfo->p2p_ps_mode == P2P_PS_NONE) ||
if ( (pwdinfo->p2p_ps_mode == P2P_PS_NONE) ||
(noa_index != pwdinfo->noa_index) )// if index change, driver should reconfigure related setting.
{
pwdinfo->noa_index = noa_index;
@ -4139,9 +4139,9 @@ _func_enter_;
noa_offset = 2;
noa_num = 0;
// NoA length should be n*(13) + 2
if(attr_contentlen > 2)
if (attr_contentlen > 2)
{
while(noa_offset < attr_contentlen)
while (noa_offset < attr_contentlen)
{
//_rtw_memcpy(&wifidirect_info->noa_count[noa_num], &noa_attr[noa_offset], 1);
pwdinfo->noa_count[noa_num] = noa_attr[noa_offset];
@ -4161,21 +4161,21 @@ _func_enter_;
}
pwdinfo->noa_num = noa_num;
if( pwdinfo->opp_ps == 1 )
if ( pwdinfo->opp_ps == 1 )
{
pwdinfo->p2p_ps_mode = P2P_PS_CTWINDOW;
// driver should wait LPS for entering CTWindow
if(padapter->pwrctrlpriv.bFwCurrentInPSMode == _TRUE)
if (padapter->pwrctrlpriv.bFwCurrentInPSMode == _TRUE)
{
p2p_ps_wk_cmd(padapter, P2P_PS_ENABLE, 1);
}
}
else if( pwdinfo->noa_num > 0 )
else if ( pwdinfo->noa_num > 0 )
{
pwdinfo->p2p_ps_mode = P2P_PS_NOA;
p2p_ps_wk_cmd(padapter, P2P_PS_ENABLE, 1);
}
else if( pwdinfo->p2p_ps_mode > P2P_PS_NONE)
else if ( pwdinfo->p2p_ps_mode > P2P_PS_NONE)
{
p2p_ps_wk_cmd(padapter, P2P_PS_DISABLE, 1);
}
@ -4189,9 +4189,9 @@ _func_enter_;
}
if(find_p2p == _TRUE)
if (find_p2p == _TRUE)
{
if( (pwdinfo->p2p_ps_mode > P2P_PS_NONE) && (find_p2p_ps == _FALSE) )
if ( (pwdinfo->p2p_ps_mode > P2P_PS_NONE) && (find_p2p_ps == _FALSE) )
{
p2p_ps_wk_cmd(padapter, P2P_PS_DISABLE, 1);
}
@ -4208,7 +4208,7 @@ void p2p_ps_wk_hdl(_adapter *padapter, u8 p2p_ps_state)
_func_enter_;
// Pre action for p2p state
switch(p2p_ps_state)
switch (p2p_ps_state)
{
case P2P_PS_DISABLE:
pwdinfo->p2p_ps_state = p2p_ps_state;
@ -4220,9 +4220,9 @@ _func_enter_;
pwdinfo->opp_ps = 0;
pwdinfo->noa_num = 0;
pwdinfo->p2p_ps_mode = P2P_PS_NONE;
if(padapter->pwrctrlpriv.bFwCurrentInPSMode == _TRUE)
if (padapter->pwrctrlpriv.bFwCurrentInPSMode == _TRUE)
{
if(pwrpriv->smart_ps == 0)
if (pwrpriv->smart_ps == 0)
{
pwrpriv->smart_ps = 2;
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_PWRMODE, (u8 *)(&(padapter->pwrctrlpriv.pwr_mode)));
@ -4233,9 +4233,9 @@ _func_enter_;
if (pwdinfo->p2p_ps_mode > P2P_PS_NONE) {
pwdinfo->p2p_ps_state = p2p_ps_state;
if( pwdinfo->ctwindow > 0 )
if ( pwdinfo->ctwindow > 0 )
{
if(pwrpriv->smart_ps != 0)
if (pwrpriv->smart_ps != 0)
{
pwrpriv->smart_ps = 0;
DBG_871X("%s(): Enter CTW, change SmartPS\n", __FUNCTION__);
@ -4279,16 +4279,16 @@ _func_enter_;
return res;
}
if(enqueue)
if (enqueue)
{
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ph2c==NULL){
if (ph2c==NULL){
res= _FAIL;
goto exit;
}
pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
if(pdrvextra_cmd_parm==NULL){
if (pdrvextra_cmd_parm==NULL){
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
res= _FAIL;
goto exit;
@ -4321,7 +4321,7 @@ static void reset_ch_sitesurvey_timer_process (void *FunctionContext)
_adapter *adapter = (_adapter *)FunctionContext;
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
return;
DBG_871X( "[%s] In\n", __FUNCTION__ );
@ -4335,7 +4335,7 @@ static void reset_ch_sitesurvey_timer_process2 (void *FunctionContext)
_adapter *adapter = (_adapter *)FunctionContext;
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
return;
DBG_871X( "[%s] In\n", __FUNCTION__ );
@ -4349,7 +4349,7 @@ static void restore_p2p_state_timer_process (void *FunctionContext)
_adapter *adapter = (_adapter *)FunctionContext;
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
return;
p2p_protocol_wk_cmd( adapter, P2P_RESTORE_STATE_WK );
@ -4363,13 +4363,13 @@ static void pre_tx_scan_timer_process (void *FunctionContext)
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
u8 _status = 0;
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
return;
_enter_critical_bh(&pmlmepriv->lock, &irqL);
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ))
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ))
{
if ( _TRUE == pwdinfo->tx_prov_disc_info.benable ) // the provision discovery request frame is trigger to send or not
{
@ -4405,7 +4405,7 @@ static void find_phase_timer_process (void *FunctionContext)
_adapter *adapter = (_adapter *)FunctionContext;
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
return;
adapter->wdinfo.find_phase_state_exchange_cnt++;
@ -4422,7 +4422,7 @@ void ap_p2p_switch_timer_process (void *FunctionContext)
struct rtw_wdev_priv *pwdev_priv = wdev_to_priv(adapter->rtw_wdev);
#endif
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
return;
#ifdef CONFIG_IOCTL_CFG80211
@ -4680,7 +4680,7 @@ char * p2p_state_str[] = {
void dbg_rtw_p2p_set_state(struct wifidirect_info *wdinfo, enum P2P_STATE state, const char *caller, int line)
{
if(!_rtw_p2p_chk_state(wdinfo, state)) {
if (!_rtw_p2p_chk_state(wdinfo, state)) {
enum P2P_STATE old_state = _rtw_p2p_state(wdinfo);
_rtw_p2p_set_state(wdinfo, state);
DBG_871X("[CONFIG_DBG_P2P]%s:%d set_state from %s to %s\n", caller, line
@ -4694,7 +4694,7 @@ void dbg_rtw_p2p_set_state(struct wifidirect_info *wdinfo, enum P2P_STATE state,
}
void dbg_rtw_p2p_set_pre_state(struct wifidirect_info *wdinfo, enum P2P_STATE state, const char *caller, int line)
{
if(_rtw_p2p_pre_state(wdinfo) != state) {
if (_rtw_p2p_pre_state(wdinfo) != state) {
enum P2P_STATE old_state = _rtw_p2p_pre_state(wdinfo);
_rtw_p2p_set_pre_state(wdinfo, state);
DBG_871X("[CONFIG_DBG_P2P]%s:%d set_pre_state from %s to %s\n", caller, line
@ -4709,7 +4709,7 @@ void dbg_rtw_p2p_set_pre_state(struct wifidirect_info *wdinfo, enum P2P_STATE st
#if 0
void dbg_rtw_p2p_restore_state(struct wifidirect_info *wdinfo, const char *caller, int line)
{
if(wdinfo->pre_p2p_state != -1) {
if (wdinfo->pre_p2p_state != -1) {
DBG_871X("[CONFIG_DBG_P2P]%s:%d restore from %s to %s\n", caller, line
, p2p_state_str[wdinfo->p2p_state], p2p_state_str[wdinfo->pre_p2p_state]
);
@ -4723,7 +4723,7 @@ void dbg_rtw_p2p_restore_state(struct wifidirect_info *wdinfo, const char *calle
#endif
void dbg_rtw_p2p_set_role(struct wifidirect_info *wdinfo, enum P2P_ROLE role, const char *caller, int line)
{
if(wdinfo->role != role) {
if (wdinfo->role != role) {
enum P2P_ROLE old_role = wdinfo->role;
_rtw_p2p_set_role(wdinfo, role);
DBG_871X("[CONFIG_DBG_P2P]%s:%d set_role from %s to %s\n", caller, line
@ -4755,7 +4755,7 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role)
// Commented by Albert 2011/12/30
// The driver just supports 1 P2P group operation.
// So, this function will do nothing if the buddy adapter had enabled the P2P function.
if(!rtw_p2p_chk_state(pbuddy_wdinfo, P2P_STATE_NONE))
if (!rtw_p2p_chk_state(pbuddy_wdinfo, P2P_STATE_NONE))
{
// The buddy adapter had enabled the P2P function.
return ret;
@ -4790,7 +4790,7 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role)
}
//Disable P2P function
if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
{
_cancel_timer_ex( &pwdinfo->find_phase_timer );
_cancel_timer_ex( &pwdinfo->restore_p2p_state_timer );

View file

@ -60,12 +60,12 @@ void ips_enter(_adapter * padapter)
#ifdef CONFIG_BT_COEXIST
BTDM_TurnOffBtCoexistBeforeEnterIPS(padapter);
#endif
if(rf_off == pwrpriv->change_rfpwrstate )
if (rf_off == pwrpriv->change_rfpwrstate )
{
pwrpriv->bpower_saving = _TRUE;
DBG_871X_LEVEL(_drv_always_, "nolinked power save enter\n");
if(pwrpriv->ips_mode == IPS_LEVEL_2)
if (pwrpriv->ips_mode == IPS_LEVEL_2)
pwrpriv->bkeepfwalive = _TRUE;
rtw_ips_pwr_down(padapter);
@ -88,7 +88,7 @@ int ips_leave(_adapter * padapter)
_enter_pwrlock(&pwrpriv->lock);
if((pwrpriv->rf_pwrstate == rf_off) &&(!pwrpriv->bips_processing))
if ((pwrpriv->rf_pwrstate == rf_off) &&(!pwrpriv->bips_processing))
{
pwrpriv->bips_processing = _TRUE;
pwrpriv->change_rfpwrstate = rf_on;
@ -100,13 +100,13 @@ int ips_leave(_adapter * padapter)
}
DBG_871X_LEVEL(_drv_always_, "nolinked power save leave\n");
if((_WEP40_ == psecuritypriv->dot11PrivacyAlgrthm) ||(_WEP104_ == psecuritypriv->dot11PrivacyAlgrthm))
if ((_WEP40_ == psecuritypriv->dot11PrivacyAlgrthm) ||(_WEP104_ == psecuritypriv->dot11PrivacyAlgrthm))
{
DBG_871X("==>%s,channel(%d),processing(%x)\n",__FUNCTION__,padapter->mlmeextpriv.cur_channel,pwrpriv->bips_processing);
set_channel_bwmode(padapter, padapter->mlmeextpriv.cur_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
for(keyid=0;keyid<4;keyid++){
if(pmlmepriv->key_mask & BIT(keyid)){
if(keyid == psecuritypriv->dot11PrivacyKeyIndex)
for (keyid=0;keyid<4;keyid++){
if (pmlmepriv->key_mask & BIT(keyid)){
if (keyid == psecuritypriv->dot11PrivacyKeyIndex)
result=rtw_set_key(padapter,psecuritypriv, keyid, 1);
else
result=rtw_set_key(padapter,psecuritypriv, keyid, 0);
@ -214,25 +214,25 @@ void rtw_ps_processor(_adapter*padapter)
pwrpriv->ps_processing = _TRUE;
#ifdef SUPPORT_HW_RFOFF_DETECTED
if(pwrpriv->bips_processing == _TRUE)
if (pwrpriv->bips_processing == _TRUE)
goto exit;
//DBG_871X("==> fw report state(0x%x)\n",rtw_read8(padapter,0x1ca));
if(padapter->pwrctrlpriv.bHWPwrPindetect)
if (padapter->pwrctrlpriv.bHWPwrPindetect)
{
#ifdef CONFIG_AUTOSUSPEND
if(padapter->registrypriv.usbss_enable)
if (padapter->registrypriv.usbss_enable)
{
if(pwrpriv->rf_pwrstate == rf_on)
if (pwrpriv->rf_pwrstate == rf_on)
{
if(padapter->net_closed == _TRUE)
if (padapter->net_closed == _TRUE)
pwrpriv->ps_flag = _TRUE;
rfpwrstate = RfOnOffDetect(padapter);
DBG_871X("@@@@- #1 %s==> rfstate:%s \n",__FUNCTION__,(rfpwrstate==rf_on)?"rf_on":"rf_off");
if(rfpwrstate!= pwrpriv->rf_pwrstate)
if (rfpwrstate!= pwrpriv->rf_pwrstate)
{
if(rfpwrstate == rf_off)
if (rfpwrstate == rf_off)
{
pwrpriv->change_rfpwrstate = rf_off;
@ -250,9 +250,9 @@ void rtw_ps_processor(_adapter*padapter)
rfpwrstate = RfOnOffDetect(padapter);
DBG_871X("@@@@- #2 %s==> rfstate:%s \n",__FUNCTION__,(rfpwrstate==rf_on)?"rf_on":"rf_off");
if(rfpwrstate!= pwrpriv->rf_pwrstate)
if (rfpwrstate!= pwrpriv->rf_pwrstate)
{
if(rfpwrstate == rf_off)
if (rfpwrstate == rf_off)
{
pwrpriv->change_rfpwrstate = rf_off;
pwrpriv->brfoffbyhw = _TRUE;
@ -281,7 +281,7 @@ void rtw_ps_processor(_adapter*padapter)
if (rtw_pwr_unassociated_idle(padapter) == _FALSE)
goto exit;
if((pwrpriv->rf_pwrstate == rf_on) && ((pwrpriv->pwr_state_check_cnts%4)==0))
if ((pwrpriv->rf_pwrstate == rf_on) && ((pwrpriv->pwr_state_check_cnts%4)==0))
{
DBG_871X("==>%s .fw_state(%x)\n",__FUNCTION__,get_fwstate(pmlmepriv));
#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
@ -289,12 +289,12 @@ void rtw_ps_processor(_adapter*padapter)
pwrpriv->change_rfpwrstate = rf_off;
#endif
#ifdef CONFIG_AUTOSUSPEND
if(padapter->registrypriv.usbss_enable)
if (padapter->registrypriv.usbss_enable)
{
if(pwrpriv->bHWPwrPindetect)
if (pwrpriv->bHWPwrPindetect)
pwrpriv->bkeepfwalive = _TRUE;
if(padapter->net_closed == _TRUE)
if (padapter->net_closed == _TRUE)
pwrpriv->ps_flag = _TRUE;
#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
@ -311,7 +311,7 @@ void rtw_ps_processor(_adapter*padapter)
autosuspend_enter(padapter);
#endif //if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
}
else if(pwrpriv->bHWPwrPindetect)
else if (pwrpriv->bHWPwrPindetect)
{
}
else
@ -451,7 +451,7 @@ u8 PS_RDY_CHECK(_adapter * padapter)
curr_time = rtw_get_current_time();
delta_time = curr_time -pwrpriv->DelayLPSLastTimeStamp;
if(delta_time < LPS_DELAY_TIME)
if (delta_time < LPS_DELAY_TIME)
{
return _FALSE;
}
@ -463,15 +463,15 @@ u8 PS_RDY_CHECK(_adapter * padapter)
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE) )
return _FALSE;
#ifdef CONFIG_WOWLAN
if(_TRUE == pwrpriv->bInSuspend && pwrpriv->wowlan_mode)
if (_TRUE == pwrpriv->bInSuspend && pwrpriv->wowlan_mode)
return _TRUE;
else
return _FALSE;
#else
if(_TRUE == pwrpriv->bInSuspend )
if (_TRUE == pwrpriv->bInSuspend )
return _FALSE;
#endif
if( (padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) && (padapter->securitypriv.binstallGrpkey == _FALSE) )
if ( (padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) && (padapter->securitypriv.binstallGrpkey == _FALSE) )
{
DBG_871X("Group handshake still in progress !!!\n");
return _FALSE;
@ -504,7 +504,7 @@ _func_enter_;
("%s: PowerMode=%d Smart_PS=%d\n",
__FUNCTION__, ps_mode, smart_ps));
if(ps_mode > PM_Card_Disable) {
if (ps_mode > PM_Card_Disable) {
RT_TRACE(_module_rtl871x_pwrctrl_c_,_drv_err_,("ps_mode:%d error\n", ps_mode));
return;
}
@ -524,11 +524,11 @@ _func_enter_;
_enter_pwrlock(&pwrpriv->lock);
#endif
//if(pwrpriv->pwr_mode == PS_MODE_ACTIVE)
if(ps_mode == PS_MODE_ACTIVE)
//if (pwrpriv->pwr_mode == PS_MODE_ACTIVE)
if (ps_mode == PS_MODE_ACTIVE)
{
#ifdef CONFIG_P2P_PS
if(pwdinfo->opp_ps == 0)
if (pwdinfo->opp_ps == 0)
#endif //CONFIG_P2P_PS
{
DBG_871X("rtw_set_ps_mode: Leave 802.11 power save\n");
@ -536,7 +536,7 @@ _func_enter_;
#ifdef CONFIG_TDLS
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
for(i=0; i< NUM_STA; i++)
for (i=0; i< NUM_STA; i++)
{
phead = &(pstapriv->sta_hash[i]);
plist = get_next(phead);
@ -545,7 +545,7 @@ _func_enter_;
{
ptdls_sta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
if( ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE )
if ( ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE )
issue_nulldata_to_TDLS_peer_STA(padapter, ptdls_sta, 0);
plist = get_next(plist);
}
@ -573,7 +573,7 @@ _func_enter_;
#ifdef CONFIG_TDLS
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
for(i=0; i< NUM_STA; i++)
for (i=0; i< NUM_STA; i++)
{
phead = &(pstapriv->sta_hash[i]);
plist = get_next(phead);
@ -582,7 +582,7 @@ _func_enter_;
{
ptdls_sta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
if( ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE )
if ( ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE )
issue_nulldata_to_TDLS_peer_STA(padapter, ptdls_sta, 1);
plist = get_next(plist);
}
@ -599,7 +599,7 @@ _func_enter_;
#ifdef CONFIG_P2P_PS
// Set CTWindow after LPS
if(pwdinfo->opp_ps == 1)
if (pwdinfo->opp_ps == 1)
p2p_ps_wk_cmd(padapter, P2P_PS_ENABLE, 0);
#endif //CONFIG_P2P_PS
@ -708,9 +708,9 @@ _func_enter_;
if (_TRUE == pwrpriv->bLeisurePs)
{
// Idle for a while if we connect to AP a while ago.
if(pwrpriv->LpsIdleCount >= 2) // 4 Sec
if (pwrpriv->LpsIdleCount >= 2) // 4 Sec
{
if(pwrpriv->pwr_mode == PS_MODE_ACTIVE)
if (pwrpriv->pwr_mode == PS_MODE_ACTIVE)
{
pwrpriv->bpower_saving = _TRUE;
DBG_871X("%s smart_ps:%d\n", __func__, pwrpriv->smart_ps);
@ -750,11 +750,11 @@ _func_enter_;
if (pwrpriv->bLeisurePs)
{
if(pwrpriv->pwr_mode != PS_MODE_ACTIVE)
if (pwrpriv->pwr_mode != PS_MODE_ACTIVE)
{
rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0);
if(pwrpriv->pwr_mode == PS_MODE_ACTIVE)
if (pwrpriv->pwr_mode == PS_MODE_ACTIVE)
LPS_RF_ON_check(padapter, LPS_LEAVE_TIMEOUT_MS);
}
}
@ -799,10 +799,10 @@ _func_enter_;
}
else
{
if(Adapter->pwrctrlpriv.rf_pwrstate== rf_off)
if (Adapter->pwrctrlpriv.rf_pwrstate== rf_off)
{
#ifdef CONFIG_AUTOSUSPEND
if(Adapter->registrypriv.usbss_enable)
if (Adapter->registrypriv.usbss_enable)
{
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
usb_disable_autosuspend(adapter_to_dvobj(Adapter)->pusbdev);
@ -815,7 +815,7 @@ _func_enter_;
{
#if defined(CONFIG_PLATFORM_SPRD) && defined(CONFIG_RTL8188E)
#ifdef CONFIG_IPS
if(_FALSE == ips_leave(Adapter))
if (_FALSE == ips_leave(Adapter))
{
DBG_871X("======> ips_leave fail.............\n");
}
@ -845,7 +845,7 @@ _func_enter_;
rtw_yield_os();
while(1)
while (1)
{
_enter_pwrlock(&pwrpriv->lock);
@ -862,10 +862,10 @@ _func_enter_;
_exit_pwrlock(&pwrpriv->lock);
if(_TRUE == bReady)
if (_TRUE == bReady)
break;
if(rtw_get_passing_time_ms(start_time)>100)
if (rtw_get_passing_time_ms(start_time)>100)
{
DBG_871X("Wait for cpwm event than 100 ms!!!\n");
break;
@ -1488,7 +1488,7 @@ static void rtw_late_resume(struct early_suspend *h)
_adapter *adapter = container_of(pwrpriv, _adapter, pwrctrlpriv);
DBG_871X("%s\n",__FUNCTION__);
if(pwrpriv->do_late_resume) {
if (pwrpriv->do_late_resume) {
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
rtw_resume_process(adapter);
pwrpriv->do_late_resume = _FALSE;
@ -1542,7 +1542,7 @@ static void rtw_late_resume(android_early_suspend_t *h)
_adapter *adapter = container_of(pwrpriv, _adapter, pwrctrlpriv);
DBG_871X("%s\n",__FUNCTION__);
if(pwrpriv->do_late_resume) {
if (pwrpriv->do_late_resume) {
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
rtw_resume_process(adapter);
pwrpriv->do_late_resume = _FALSE;
@ -1631,13 +1631,13 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
}
//System suspend is not allowed to wakeup
if((pwrpriv->bInternalAutoSuspend == _FALSE) && (_TRUE == pwrpriv->bInSuspend )){
if ((pwrpriv->bInternalAutoSuspend == _FALSE) && (_TRUE == pwrpriv->bInSuspend )){
ret = _FAIL;
goto exit;
}
//block???
if((pwrpriv->bInternalAutoSuspend == _TRUE) && (padapter->net_closed == _TRUE)) {
if ((pwrpriv->bInternalAutoSuspend == _TRUE) && (padapter->net_closed == _TRUE)) {
ret = _FAIL;
goto exit;
}
@ -1646,8 +1646,8 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
{
#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
if(_TRUE==pwrpriv->bInternalAutoSuspend){
if(0==pwrpriv->autopm_cnt){
if (_TRUE==pwrpriv->bInternalAutoSuspend){
if (0==pwrpriv->autopm_cnt){
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
if (usb_autopm_get_interface(adapter_to_dvobj(padapter)->pusbintf) < 0)
{
@ -1667,20 +1667,20 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
}
#endif //#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
}
if(rf_off == pwrpriv->rf_pwrstate )
if (rf_off == pwrpriv->rf_pwrstate )
{
#ifdef CONFIG_USB_HCI
#ifdef CONFIG_AUTOSUSPEND
if(pwrpriv->brfoffbyhw==_TRUE)
if (pwrpriv->brfoffbyhw==_TRUE)
{
DBG_8192C("hw still in rf_off state ...........\n");
ret = _FAIL;
goto exit;
}
else if(padapter->registrypriv.usbss_enable)
else if (padapter->registrypriv.usbss_enable)
{
DBG_8192C("%s call autoresume_enter....\n",__FUNCTION__);
if(_FAIL == autoresume_enter(padapter))
if (_FAIL == autoresume_enter(padapter))
{
DBG_8192C("======> autoresume fail.............\n");
ret = _FAIL;
@ -1693,7 +1693,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
{
#ifdef CONFIG_IPS
DBG_8192C("%s call ips_leave....\n",__FUNCTION__);
if(_FAIL == ips_leave(padapter))
if (_FAIL == ips_leave(padapter))
{
DBG_8192C("======> ips_leave fail.............\n");
ret = _FAIL;
@ -1704,7 +1704,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
}
//TODO: the following checking need to be merged...
if(padapter->bDriverStopped
if (padapter->bDriverStopped
|| !padapter->bup
|| !padapter->hw_init_completed
){
@ -1731,9 +1731,9 @@ int rtw_pm_set_lps(_adapter *padapter, u8 mode)
if ( mode < PS_MODE_NUM )
{
if(pwrctrlpriv->power_mgnt !=mode)
if (pwrctrlpriv->power_mgnt !=mode)
{
if(PS_MODE_ACTIVE == mode)
if (PS_MODE_ACTIVE == mode)
{
LeaveAllPowerSaveMode(padapter);
}
@ -1757,15 +1757,15 @@ int rtw_pm_set_ips(_adapter *padapter, u8 mode)
{
struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv;
if( mode == IPS_NORMAL || mode == IPS_LEVEL_2 ) {
if ( mode == IPS_NORMAL || mode == IPS_LEVEL_2 ) {
rtw_ips_mode_req(pwrctrlpriv, mode);
DBG_871X("%s %s\n", __FUNCTION__, mode == IPS_NORMAL?"IPS_NORMAL":"IPS_LEVEL_2");
return 0;
}
else if(mode ==IPS_NONE){
else if (mode ==IPS_NONE){
rtw_ips_mode_req(pwrctrlpriv, mode);
DBG_871X("%s %s\n", __FUNCTION__, "IPS_NONE");
if((padapter->bSurpriseRemoved ==0)&&(_FAIL == rtw_pwr_wakeup(padapter)) )
if ((padapter->bSurpriseRemoved ==0)&&(_FAIL == rtw_pwr_wakeup(padapter)) )
return -EFAULT;
}
else {

File diff suppressed because it is too large Load diff

View file

@ -179,7 +179,7 @@ void rtw_wep_encrypt(_adapter *padapter, u8 *pxmitframe)
_func_enter_;
if(((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
if (((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
return;
#ifdef CONFIG_USB_TX_AGGREGATION
@ -196,18 +196,18 @@ _func_enter_;
pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + hw_hdr_offset;
//start to encrypt each fragment
if((pattrib->encrypt==_WEP40_)||(pattrib->encrypt==_WEP104_))
if ((pattrib->encrypt==_WEP40_)||(pattrib->encrypt==_WEP104_))
{
keylength=psecuritypriv->dot11DefKeylen[psecuritypriv->dot11PrivacyKeyIndex];
for(curfragnum=0;curfragnum<pattrib->nr_frags;curfragnum++)
for (curfragnum=0;curfragnum<pattrib->nr_frags;curfragnum++)
{
iv=pframe+pattrib->hdrlen;
_rtw_memcpy(&wepkey[0], iv, 3);
_rtw_memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0],keylength);
payload=pframe+pattrib->iv_len+pattrib->hdrlen;
if((curfragnum+1)==pattrib->nr_frags)
if ((curfragnum+1)==pattrib->nr_frags)
{ //the last fragment
length=pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len;
@ -257,7 +257,7 @@ _func_enter_;
pframe=(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data;
//start to decrypt recvframe
if((prxattrib->encrypt==_WEP40_)||(prxattrib->encrypt==_WEP104_))
if ((prxattrib->encrypt==_WEP40_)||(prxattrib->encrypt==_WEP104_))
{
iv=pframe+prxattrib->hdrlen;
//keyindex=(iv[3]&0x3);
@ -277,7 +277,7 @@ _func_enter_;
//calculate icv and compare the icv
*((unsigned long *)crc)=le32_to_cpu(getcrc32(payload,length-4));
if(crc[3]!=payload[length-1] || crc[2]!=payload[length-2] || crc[1]!=payload[length-3] || crc[0]!=payload[length-4])
if (crc[3]!=payload[length-1] || crc[2]!=payload[length-2] || crc[1]!=payload[length-3] || crc[0]!=payload[length-4])
{
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_wep_decrypt:icv error crc[3](%x)!=payload[length-1](%x) || crc[2](%x)!=payload[length-2](%x) || crc[1](%x)!=payload[length-3](%x) || crc[0](%x)!=payload[length-4](%x)\n",
crc[3],payload[length-1],crc[2],payload[length-2],crc[1],payload[length-3],crc[0],payload[length-4]));
@ -299,7 +299,7 @@ static u32 secmicgetuint32( u8 * p )
s32 i;
u32 res = 0;
_func_enter_;
for( i=0; i<4; i++ )
for ( i=0; i<4; i++ )
{
res |= ((u32)(*p++)) << (8*i);
}
@ -312,7 +312,7 @@ static void secmicputuint32( u8 * p, u32 val )
{
long i;
_func_enter_;
for( i=0; i<4; i++ )
for ( i=0; i<4; i++ )
{
*p++ = (u8) (val & 0xff);
val >>= 8;
@ -349,7 +349,7 @@ _func_enter_;
pmicdata->M |= ((unsigned long)b) << (8*pmicdata->nBytesInM);
pmicdata->nBytesInM++;
// Process the word if it is full.
if( pmicdata->nBytesInM >= 4 )
if ( pmicdata->nBytesInM >= 4 )
{
pmicdata->L ^= pmicdata->M;
pmicdata->R ^= ROL32( pmicdata->L, 17 );
@ -371,7 +371,7 @@ void rtw_secmicappend(struct mic_data *pmicdata, u8 * src, u32 nbytes )
{
_func_enter_;
// This is simple
while( nbytes > 0 )
while ( nbytes > 0 )
{
rtw_secmicappendbyte(pmicdata, *src++ );
nbytes--;
@ -389,7 +389,7 @@ _func_enter_;
rtw_secmicappendbyte(pmicdata, 0 );
rtw_secmicappendbyte(pmicdata, 0 );
// and then zeroes until the length is a multiple of 4
while( pmicdata->nBytesInM != 0 )
while ( pmicdata->nBytesInM != 0 )
{
rtw_secmicappendbyte(pmicdata, 0 );
}
@ -412,16 +412,16 @@ _func_enter_;
priority[0]=pri;
/* Michael MIC pseudo header: DA, SA, 3 x 0, Priority */
if(header[1]&1){ //ToDS==1
if (header[1]&1){ //ToDS==1
rtw_secmicappend(&micdata, &header[16], 6); //DA
if(header[1]&2) //From Ds==1
if (header[1]&2) //From Ds==1
rtw_secmicappend(&micdata, &header[24], 6);
else
rtw_secmicappend(&micdata, &header[10], 6);
}
else{ //ToDS==0
rtw_secmicappend(&micdata, &header[4], 6); //DA
if(header[1]&2) //From Ds==1
if (header[1]&2) //From Ds==1
rtw_secmicappend(&micdata, &header[16], 6);
else
rtw_secmicappend(&micdata, &header[10], 6);
@ -669,7 +669,7 @@ u32 rtw_tkip_encrypt(_adapter *padapter, u8 *pxmitframe)
u32 res=_SUCCESS;
_func_enter_;
if(((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
if (((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
return _FAIL;
#ifdef CONFIG_USB_TX_AGGREGATION
@ -685,9 +685,9 @@ _func_enter_;
pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + hw_hdr_offset;
//4 start to encrypt each fragment
if(pattrib->encrypt==_TKIP_){
if (pattrib->encrypt==_TKIP_){
if(pattrib->psta)
if (pattrib->psta)
{
stainfo = pattrib->psta;
}
@ -699,7 +699,7 @@ _func_enter_;
if (stainfo!=NULL){
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_tkip_encrypt: stainfo!=NULL!!!\n"));
if(IS_MCAST(pattrib->ra))
if (IS_MCAST(pattrib->ra))
{
prwskey=psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey;
}
@ -710,7 +710,7 @@ _func_enter_;
prwskeylen=16;
for(curfragnum=0;curfragnum<pattrib->nr_frags;curfragnum++){
for (curfragnum=0;curfragnum<pattrib->nr_frags;curfragnum++){
iv=pframe+pattrib->hdrlen;
payload=pframe+pattrib->iv_len+pattrib->hdrlen;
@ -723,7 +723,7 @@ _func_enter_;
phase2(&rc4key[0],prwskey,(u16 *)&ttkey[0],pnl);
if((curfragnum+1)==pattrib->nr_frags){ //4 the last fragment
if ((curfragnum+1)==pattrib->nr_frags){ //4 the last fragment
length=pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len;
RT_TRACE(_module_rtl871x_security_c_,_drv_info_,("pattrib->iv_len =%x, pattrib->icv_len =%x\n", pattrib->iv_len,pattrib->icv_len));
*((u32 *)crc)=cpu_to_le32(getcrc32(payload,length));/* modified by Amy*/
@ -785,14 +785,14 @@ _func_enter_;
pframe=(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data;
//4 start to decrypt recvframe
if(prxattrib->encrypt==_TKIP_){
if (prxattrib->encrypt==_TKIP_){
stainfo=rtw_get_stainfo(&padapter->stapriv ,&prxattrib->ta[0] );
if (stainfo!=NULL){
if(IS_MCAST(prxattrib->ra))
if (IS_MCAST(prxattrib->ra))
{
if(psecuritypriv->binstallGrpkey==_FALSE)
if (psecuritypriv->binstallGrpkey==_FALSE)
{
res=_FAIL;
DBG_8192C("%s:rx bc/mc packets,but didn't install group key!!!!!!!!!!\n",__FUNCTION__);
@ -829,7 +829,7 @@ _func_enter_;
*((u32 *)crc)=le32_to_cpu(getcrc32(payload,length-4));
if(crc[3]!=payload[length-1] || crc[2]!=payload[length-2] || crc[1]!=payload[length-3] || crc[0]!=payload[length-4])
if (crc[3]!=payload[length-1] || crc[2]!=payload[length-2] || crc[1]!=payload[length-3] || crc[0]!=payload[length-4])
{
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_wep_decrypt:icv error crc[3](%x)!=payload[length-1](%x) || crc[2](%x)!=payload[length-2](%x) || crc[1](%x)!=payload[length-3](%x) || crc[0](%x)!=payload[length-4](%x)\n",
crc[3],payload[length-1],crc[2],payload[length-2],crc[1],payload[length-3],crc[0],payload[length-4]));
@ -1109,7 +1109,7 @@ static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext)
u8 intermediateb[16];
u8 round_key[16];
_func_enter_;
for(i=0; i<16; i++) round_key[i] = key[i];
for (i=0; i<16; i++) round_key[i] = key[i];
for (round = 0; round < 11; round++)
{
@ -1359,7 +1359,7 @@ _func_enter_;
(frtype == WIFI_DATA_CFACKPOLL))
{
qc_exists = 1;
if(hdrlen != WLAN_HDR_A3_QOS_LEN){
if (hdrlen != WLAN_HDR_A3_QOS_LEN){
hdrlen += 2;
}
@ -1370,7 +1370,7 @@ _func_enter_;
(frsubtype == 0x0a)||
(frsubtype == 0x0b))
{
if(hdrlen != WLAN_HDR_A3_QOS_LEN){
if (hdrlen != WLAN_HDR_A3_QOS_LEN){
hdrlen += 2;
}
@ -1530,7 +1530,7 @@ u32 rtw_aes_encrypt(_adapter *padapter, u8 *pxmitframe)
u32 res=_SUCCESS;
_func_enter_;
if(((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
if (((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
return _FAIL;
#ifdef CONFIG_USB_TX_AGGREGATION
@ -1547,9 +1547,9 @@ _func_enter_;
pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + hw_hdr_offset;
//4 start to encrypt each fragment
if((pattrib->encrypt==_AES_)){
if ((pattrib->encrypt==_AES_)){
if(pattrib->psta)
if (pattrib->psta)
{
stainfo = pattrib->psta;
}
@ -1561,7 +1561,7 @@ _func_enter_;
if (stainfo!=NULL){
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_aes_encrypt: stainfo!=NULL!!!\n"));
if(IS_MCAST(pattrib->ra))
if (IS_MCAST(pattrib->ra))
{
prwskey=psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey;
}
@ -1574,7 +1574,7 @@ _func_enter_;
{
struct sta_info *ptdls_sta;
ptdls_sta=rtw_get_stainfo(&padapter->stapriv ,&pattrib->dst[0] );
if((ptdls_sta != NULL) && (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) )
if ((ptdls_sta != NULL) && (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) )
{
DBG_871X("[%s] for tdls link\n", __FUNCTION__);
prwskey=&ptdls_sta->tpk.tk[0];
@ -1584,9 +1584,9 @@ _func_enter_;
prwskeylen=16;
for(curfragnum=0;curfragnum<pattrib->nr_frags;curfragnum++){
for (curfragnum=0;curfragnum<pattrib->nr_frags;curfragnum++){
if((curfragnum+1)==pattrib->nr_frags){ //4 the last fragment
if ((curfragnum+1)==pattrib->nr_frags){ //4 the last fragment
length=pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len;
aes_cipher(prwskey,pattrib->hdrlen,pframe, length);
@ -1675,7 +1675,7 @@ _func_enter_;
(frtype == WIFI_DATA_CFACKPOLL))
{
qc_exists = 1;
if(hdrlen != WLAN_HDR_A3_QOS_LEN){
if (hdrlen != WLAN_HDR_A3_QOS_LEN){
hdrlen += 2;
}
@ -1686,7 +1686,7 @@ _func_enter_;
(frsubtype == 0x0a)||
(frsubtype == 0x0b))
{
if(hdrlen != WLAN_HDR_A3_QOS_LEN){
if (hdrlen != WLAN_HDR_A3_QOS_LEN){
hdrlen += 2;
}
@ -1739,7 +1739,7 @@ _func_enter_;
}
//start to calculate the mic
if((hdrlen +plen+8) <= MAX_MSG_SIZE)
if ((hdrlen +plen+8) <= MAX_MSG_SIZE)
_rtw_memcpy((void *)message, pframe, (hdrlen +plen+8)); //8 is for ext iv len
@ -1869,8 +1869,8 @@ _func_enter_;
for (j=0; j<8;j++) message[payload_index++] = chain_buffer[j];
//compare the mic
for(i=0;i<8;i++){
if(pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i])
for (i=0;i<8;i++){
if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i])
{
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("aes_decipher:mic check error mic[%d]: pframe(%x) != message(%x) \n",
i,pframe[hdrlen+8+plen-8+i],message[hdrlen+8+plen-8+i]));
@ -1904,25 +1904,25 @@ u32 rtw_aes_decrypt(_adapter *padapter, u8 *precvframe)
_func_enter_;
pframe=(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data;
//4 start to encrypt each fragment
if((prxattrib->encrypt==_AES_)){
if ((prxattrib->encrypt==_AES_)){
stainfo=rtw_get_stainfo(&padapter->stapriv ,&prxattrib->ta[0] );
if (stainfo!=NULL){
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_aes_decrypt: stainfo!=NULL!!!\n"));
if(IS_MCAST(prxattrib->ra))
if (IS_MCAST(prxattrib->ra))
{
//in concurrent we should use sw descrypt in group key, so we remove this message
//DBG_871X("rx bc/mc packets, to perform sw rtw_aes_decrypt\n");
//prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey;
if(psecuritypriv->binstallGrpkey==_FALSE)
if (psecuritypriv->binstallGrpkey==_FALSE)
{
res=_FAIL;
DBG_8192C("%s:rx bc/mc packets,but didn't install group key!!!!!!!!!!\n",__FUNCTION__);
goto exit;
}
prwskey = psecuritypriv->dot118021XGrpKey[prxattrib->key_index].skey;
if(psecuritypriv->dot118021XGrpKeyid != prxattrib->key_index)
if (psecuritypriv->dot118021XGrpKeyid != prxattrib->key_index)
{
DBG_871X("not match packet_index=%d, install_index=%d \n"
, prxattrib->key_index, psecuritypriv->dot118021XGrpKeyid);
@ -2858,7 +2858,7 @@ _func_enter_;
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("^^^rtw_use_tkipkey_handler ^^^\n"));
/*
if(padapter->bDriverStopped ||padapter->bSurpriseRemoved){
if (padapter->bDriverStopped ||padapter->bSurpriseRemoved){
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("^^^rtw_use_tkipkey_handler (padapter->bDriverStopped %d)(padapter->bSurpriseRemoved %d)^^^\n",padapter->bDriverStopped,padapter->bSurpriseRemoved));
return;

View file

@ -51,20 +51,20 @@ u8 sreset_get_wifi_status(_adapter *padapter)
u8 status = WIFI_STATUS_SUCCESS;
u32 val32 = 0;
_irqL irqL;
if(psrtpriv->silent_reset_inprogress == _TRUE)
if (psrtpriv->silent_reset_inprogress == _TRUE)
{
return status;
}
val32 =rtw_read32(padapter,REG_TXDMA_STATUS);
if(val32==0xeaeaeaea){
if (val32==0xeaeaeaea){
psrtpriv->Wifi_Error_Status = WIFI_IF_NOT_EXIST;
}
else if(val32!=0){
else if (val32!=0){
DBG_8192C("txdmastatu(%x)\n",val32);
psrtpriv->Wifi_Error_Status = WIFI_MAC_TXDMA_ERROR;
}
if(WIFI_STATUS_SUCCESS !=psrtpriv->Wifi_Error_Status)
if (WIFI_STATUS_SUCCESS !=psrtpriv->Wifi_Error_Status)
{
DBG_8192C("==>%s error_status(0x%x) \n",__FUNCTION__,psrtpriv->Wifi_Error_Status);
status = (psrtpriv->Wifi_Error_Status &( ~(USB_READ_PORT_FAIL|USB_WRITE_PORT_FAIL)));

View file

@ -101,7 +101,7 @@ _func_enter_;
pstapriv->pallocated_stainfo_buf = rtw_zvmalloc (sizeof(struct sta_info) * NUM_STA+ 4);
if(!pstapriv->pallocated_stainfo_buf)
if (!pstapriv->pallocated_stainfo_buf)
return _FAIL;
pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 4 -
@ -119,7 +119,7 @@ _func_enter_;
psta = (struct sta_info *)(pstapriv->pstainfo_buf);
for(i = 0; i < NUM_STA; i++)
for (i = 0; i < NUM_STA; i++)
{
_rtw_init_stainfo(psta);
@ -212,7 +212,7 @@ void rtw_mfree_stainfo(struct sta_info *psta)
{
_func_enter_;
if(&psta->lock != NULL)
if (&psta->lock != NULL)
_rtw_spinlock_free(&psta->lock);
_rtw_free_sta_xmit_priv_lock(&psta->sta_xmitpriv);
@ -283,11 +283,11 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
int index;
_func_enter_;
if(pstapriv){
if (pstapriv){
/* delete all reordering_ctrl_timer */
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
for(index = 0; index < NUM_STA; index++)
for (index = 0; index < NUM_STA; index++)
{
phead = &(pstapriv->sta_hash[index]);
plist = get_next(phead);
@ -298,7 +298,7 @@ _func_enter_;
psta = LIST_CONTAINOR(plist, struct sta_info ,hash_list);
plist = get_next(plist);
for(i=0; i < 16 ; i++)
for (i=0; i < 16 ; i++)
{
preorder_ctrl = &psta->recvreorder_ctrl[i];
_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
@ -310,7 +310,7 @@ _func_enter_;
rtw_mfree_sta_priv_lock(pstapriv);
if(pstapriv->pallocated_stainfo_buf) {
if (pstapriv->pallocated_stainfo_buf) {
rtw_vmfree(pstapriv->pallocated_stainfo_buf, sizeof(struct sta_info)*NUM_STA+4);
}
}
@ -362,7 +362,7 @@ _func_enter_;
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_info_,("rtw_alloc_stainfo: index = %x", index));
if(index >= NUM_STA){
if (index >= NUM_STA){
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("ERROR=> rtw_alloc_stainfo: index >= NUM_STA"));
psta= NULL;
goto exit;
@ -382,7 +382,7 @@ _func_enter_;
// In this case, this packet will be dropped by recv_decache function if we use the 0x00 as the default value for tid_rxseq variable.
// So, we initialize the tid_rxseq variable as the 0xffff.
for( i = 0; i < 16; i++ )
for ( i = 0; i < 16; i++ )
{
_rtw_memcpy( &psta->sta_recvpriv.rxcache.tid_rxseq[ i ], &wRxSeqInitialValue, 2 );
}
@ -403,7 +403,7 @@ _func_enter_;
#endif //CONFIG_TDLS
//for A-MPDU Rx reordering buffer control
for(i=0; i < 16 ; i++)
for (i=0; i < 16 ; i++)
{
preorder_ctrl = &psta->recvreorder_ctrl[i];
@ -532,7 +532,7 @@ _func_enter_;
#endif //CONFIG_TDLS
//for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer
for(i=0; i < 16 ; i++)
for (i=0; i < 16 ; i++)
{
_irqL irqL;
_list *phead, *plist;
@ -552,7 +552,7 @@ _func_enter_;
phead = get_list_head(ppending_recvframe_queue);
plist = get_next(phead);
while(!rtw_is_list_empty(phead))
while (!rtw_is_list_empty(phead))
{
prframe = LIST_CONTAINOR(plist, union recv_frame, u);
@ -642,12 +642,12 @@ void rtw_free_all_stainfo(_adapter *padapter)
_func_enter_;
if(pstapriv->asoc_sta_count==1)
if (pstapriv->asoc_sta_count==1)
goto exit;
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
for(index=0; index< NUM_STA; index++)
for (index=0; index< NUM_STA; index++)
{
phead = &(pstapriv->sta_hash[index]);
plist = get_next(phead);
@ -658,7 +658,7 @@ _func_enter_;
plist = get_next(plist);
if(pbcmc_stainfo!=psta)
if (pbcmc_stainfo!=psta)
rtw_free_stainfo(padapter , psta);
}
@ -690,10 +690,10 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
_func_enter_;
if(hwaddr==NULL)
if (hwaddr==NULL)
return NULL;
if(IS_MCAST(hwaddr))
if (IS_MCAST(hwaddr))
{
addr = bc_addr;
}
@ -744,7 +744,7 @@ _func_enter_;
psta = rtw_alloc_stainfo(pstapriv, bcast_addr);
if(psta==NULL){
if (psta==NULL){
res=_FAIL;
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("rtw_alloc_stainfo fail"));
goto exit;
@ -803,9 +803,9 @@ u8 rtw_access_ctrl(_adapter *padapter, u8 *mac_addr)
paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
plist = get_next(plist);
if(_rtw_memcmp(paclnode->addr, mac_addr, ETH_ALEN))
if (_rtw_memcmp(paclnode->addr, mac_addr, ETH_ALEN))
{
if(paclnode->valid == _TRUE)
if (paclnode->valid == _TRUE)
{
match = _TRUE;
break;
@ -815,11 +815,11 @@ u8 rtw_access_ctrl(_adapter *padapter, u8 *mac_addr)
_exit_critical_bh(&(pacl_node_q->lock), &irqL);
if(pacl_list->mode == 1)//accept unless in deny list
if (pacl_list->mode == 1)//accept unless in deny list
{
res = (match == _TRUE) ? _FALSE:_TRUE;
}
else if(pacl_list->mode == 2)//deny unless in accept list
else if (pacl_list->mode == 2)//deny unless in accept list
{
res = (match == _TRUE) ? _TRUE:_FALSE;
}

File diff suppressed because it is too large Load diff

View file

@ -26,14 +26,14 @@ void WapiFreeAllStaInfo(_adapter *padapter)
rtw_wapi_return_all_sta_info(padapter);
//Sta Info List
while(!list_empty(&(pWapiInfo->wapiSTAIdleList)))
while (!list_empty(&(pWapiInfo->wapiSTAIdleList)))
{
pWapiStaInfo = (PRT_WAPI_STA_INFO)list_entry(pWapiInfo->wapiSTAIdleList.next, RT_WAPI_STA_INFO, list);
list_del_init(&pWapiStaInfo->list);
}
//BKID List
while(!list_empty(&(pWapiInfo->wapiBKIDIdleList)))
while (!list_empty(&(pWapiInfo->wapiBKIDIdleList)))
{
pWapiBkid = (PRT_WAPI_BKID)list_entry(pWapiInfo->wapiBKIDIdleList.next, RT_WAPI_BKID, list);
list_del_init(&pWapiBkid->list);
@ -64,7 +64,7 @@ void WapiSetIE(_adapter *padapter)
memcpy(pWapiInfo->wapiIE+pWapiInfo->wapiIELength, &akmCnt, 2);
pWapiInfo->wapiIELength +=2;
if(pWapiInfo->bWapiPSK){
if (pWapiInfo->bWapiPSK){
memcpy(pWapiInfo->wapiIE+pWapiInfo->wapiIELength,OUI, 3);
pWapiInfo->wapiIELength +=3;
pWapiInfo->wapiIE[pWapiInfo->wapiIELength] = 0x2;
@ -112,9 +112,9 @@ u32 WapiComparePN(u8 *PN1, u8 *PN2)
for (i=16; i>0; i--)
{
if(PN1[i-1] == PN2[i-1])
if (PN1[i-1] == PN2[i-1])
continue;
else if(PN1[i-1] > PN2[i-1])
else if (PN1[i-1] > PN2[i-1])
return 1;
else
return 0;
@ -136,9 +136,9 @@ WapiGetEntryForCamWrite(_adapter *padapter,u8 *pMacAddr,u8 KID,BOOLEAN IsMsk)
pWapiInfo = &padapter->wapiInfo;
//exist?
for(i=0;i<WAPI_CAM_ENTRY_NUM;i++)
for (i=0;i<WAPI_CAM_ENTRY_NUM;i++)
{
if(pWapiInfo->wapiCamEntry[i].IsUsed
if (pWapiInfo->wapiCamEntry[i].IsUsed
&& (_rtw_memcmp(pMacAddr, pWapiInfo->wapiCamEntry[i].PeerMacAddr, ETH_ALEN) == _TRUE)
&& pWapiInfo->wapiCamEntry[i].keyidx == KID
&& pWapiInfo->wapiCamEntry[i].type == IsMsk)
@ -148,11 +148,11 @@ WapiGetEntryForCamWrite(_adapter *padapter,u8 *pMacAddr,u8 KID,BOOLEAN IsMsk)
}
}
if(i == WAPI_CAM_ENTRY_NUM) //not found
if (i == WAPI_CAM_ENTRY_NUM) //not found
{
for(i=0;i<WAPI_CAM_ENTRY_NUM;i++)
for (i=0;i<WAPI_CAM_ENTRY_NUM;i++)
{
if(pWapiInfo->wapiCamEntry[i].IsUsed == 0)
if (pWapiInfo->wapiCamEntry[i].IsUsed == 0)
{
pWapiInfo->wapiCamEntry[i].IsUsed = 1;
pWapiInfo->wapiCamEntry[i].type = IsMsk;
@ -168,7 +168,7 @@ WapiGetEntryForCamWrite(_adapter *padapter,u8 *pMacAddr,u8 KID,BOOLEAN IsMsk)
return ret;
/*
if(RTIsListEmpty(&pWapiInfo->wapiCamIdleList)){
if (RTIsListEmpty(&pWapiInfo->wapiCamIdleList)){
RT_TRACE(COMP_SEC,DBG_LOUD,("No Entry for wapi!!!\n"));
return 0;
}
@ -190,9 +190,9 @@ u8 WapiGetEntryForCamClear(_adapter *padapter,u8 *pPeerMac,u8 keyid,u8 IsMsk)
pWapiInfo = &padapter->wapiInfo;
for(i=0;i<WAPI_CAM_ENTRY_NUM;i++)
for (i=0;i<WAPI_CAM_ENTRY_NUM;i++)
{
if(pWapiInfo->wapiCamEntry[i].IsUsed
if (pWapiInfo->wapiCamEntry[i].IsUsed
&& (_rtw_memcmp(pPeerMac, pWapiInfo->wapiCamEntry[i].PeerMacAddr, ETH_ALEN) == _TRUE)
&& pWapiInfo->wapiCamEntry[i].keyidx == keyid
&& pWapiInfo->wapiCamEntry[i].type == IsMsk)
@ -209,16 +209,16 @@ u8 WapiGetEntryForCamClear(_adapter *padapter,u8 *pPeerMac,u8 keyid,u8 IsMsk)
WAPI_TRACE(WAPI_API,"<====WapiGetReturnCamEntry(), No this cam entry.\n");
return 0xff;
/*
if(RTIsListEmpty(&pWapiInfo->wapiCamUsedList)){
if (RTIsListEmpty(&pWapiInfo->wapiCamUsedList)){
RT_TRACE(COMP_SEC,DBG_LOUD,("No Entry for wapi!!!\n"));
return FALSE;
}
pList = &pWapiInfo->wapiCamUsedList;
while(pList->Flink != &pWapiInfo->wapiCamUsedList)
while (pList->Flink != &pWapiInfo->wapiCamUsedList)
{
pEntry = (PRT_WAPI_CAM_ENTRY)pList->Flink;
if(PlatformCompareMemory(pPeerMac,pEntry->PeerMacAddr, ETHER_ADDRLEN)== 0
if (PlatformCompareMemory(pPeerMac,pEntry->PeerMacAddr, ETHER_ADDRLEN)== 0
&& keyid == pEntry->keyidx)
{
RTRemoveEntryList(pList);
@ -270,7 +270,7 @@ u8 WapiWriteOneCamEntry(
WAPI_TRACE(WAPI_API, "===========> %s\n", __FUNCTION__);
if(EntryId >= 32)
if (EntryId >= 32)
{
WAPI_TRACE(WAPI_ERR, "<=== CamAddOneEntry(): ulKeyId exceed!\n");
return retVal;
@ -278,11 +278,11 @@ u8 WapiWriteOneCamEntry(
usConfig=usConfig|(0x01<<15)|((u16)(EncAlg)<<2)|(KeyId);
if(EncAlg == _SMS4_ )
if (EncAlg == _SMS4_ )
{
if(bGroupKey == 1)
if (bGroupKey == 1)
usConfig |= (0x01<<6);
if((EntryId % 2)==1) // ==0 sec key; == 1mic key
if ((EntryId % 2)==1) // ==0 sec key; == 1mic key
usConfig |= (0x01<<5);
}
@ -312,7 +312,7 @@ void rtw_wapi_init(_adapter *padapter)
//Init BKID List
INIT_LIST_HEAD(&pWapiInfo->wapiBKIDIdleList);
INIT_LIST_HEAD(&pWapiInfo->wapiBKIDStoreList);
for(i=0;i<WAPI_MAX_BKID_NUM;i++)
for (i=0;i<WAPI_MAX_BKID_NUM;i++)
{
list_add_tail(&pWapiInfo->wapiBKID[i].list, &pWapiInfo->wapiBKIDIdleList);
}
@ -320,7 +320,7 @@ void rtw_wapi_init(_adapter *padapter)
//Init STA List
INIT_LIST_HEAD(&pWapiInfo->wapiSTAIdleList);
INIT_LIST_HEAD(&pWapiInfo->wapiSTAUsedList);
for(i=0;i<WAPI_MAX_STAINFO_NUM;i++)
for (i=0;i<WAPI_MAX_STAINFO_NUM;i++)
{
list_add_tail(&pWapiInfo->wapiSta[i].list, &pWapiInfo->wapiSTAIdleList);
}
@ -395,7 +395,7 @@ u8 rtw_wapi_is_wai_packet(_adapter* padapter,u8 *pkt_data)
}
pTaddr = GetAddr2Ptr(pkt_data);
if(list_empty(&pWapiInfo->wapiSTAUsedList)){
if (list_empty(&pWapiInfo->wapiSTAUsedList)){
bFind = false;
}else{
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list){
@ -414,7 +414,7 @@ u8 rtw_wapi_is_wai_packet(_adapter* padapter,u8 *pkt_data)
}
// 88b4?
if( (pkt_data[Offset_TypeWAI]==0x88) && (pkt_data[Offset_TypeWAI+1]==0xb4) ){
if ( (pkt_data[Offset_TypeWAI]==0x88) && (pkt_data[Offset_TypeWAI+1]==0xb4) ){
WaiPkt = pkt_data[Offset_TypeWAI+5];
psecuritypriv->hw_decrypted = _TRUE;
@ -494,27 +494,27 @@ u8 rtw_wapi_check_for_drop(
return false;
}
if(precv_hdr->bIsWaiPacket !=0)
if (precv_hdr->bIsWaiPacket !=0)
{
if(precv_hdr->bIsWaiPacket== 0x8)
if (precv_hdr->bIsWaiPacket== 0x8)
{
DBG_871X("rtw_wapi_check_for_drop: dump packet \n");
for(i=0;i<50;i++)
for (i=0;i<50;i++)
{
DBG_871X("%02X ",ptr[i]);
if((i+1) %8 ==0)
if ((i+1) %8 ==0)
DBG_871X("\n");
}
DBG_871X("\n rtw_wapi_check_for_drop: dump packet \n");
for(i=0;i<16;i++)
for (i=0;i<16;i++)
{
if(ptr[i+27] !=0)
if (ptr[i+27] !=0)
break;
}
if(i== 16)
if (i== 16)
{
WAPI_TRACE(WAPI_RX,"rtw_wapi_check_for_drop: drop with zero BKID \n");
return true;
@ -528,7 +528,7 @@ u8 rtw_wapi_check_for_drop(
return false;
}
if(list_empty(&pWapiInfo->wapiSTAUsedList)){
if (list_empty(&pWapiInfo->wapiSTAUsedList)){
bFind = false;
}else{
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
@ -540,9 +540,9 @@ u8 rtw_wapi_check_for_drop(
}
WAPI_TRACE(WAPI_RX, "%s: bFind=%d prxb->WapiSrcAddr="MAC_FMT"\n", __FUNCTION__, bFind, MAC_ARG(precv_hdr->WapiSrcAddr));
if(bFind)
if (bFind)
{
if(IS_MCAST(precv_hdr->attrib.ra))
if (IS_MCAST(precv_hdr->attrib.ra))
{
WAPI_TRACE(WAPI_RX,"rtw_wapi_check_for_drop: multicast case \n");
pLastRecvPN = pWapiSta->lastRxMulticastPN;
@ -550,7 +550,7 @@ u8 rtw_wapi_check_for_drop(
else
{
WAPI_TRACE(WAPI_RX,"rtw_wapi_check_for_drop: unicast case \n");
switch(precv_hdr->UserPriority)
switch (precv_hdr->UserPriority)
{
case 0:
case 3:
@ -574,10 +574,10 @@ u8 rtw_wapi_check_for_drop(
}
}
if(!WapiComparePN(precv_hdr->WapiTempPN,pLastRecvPN))
if (!WapiComparePN(precv_hdr->WapiTempPN,pLastRecvPN))
{
WAPI_TRACE(WAPI_RX,"%s: Equal PN!!\n",__FUNCTION__);
if(IS_MCAST(precv_hdr->attrib.ra))
if (IS_MCAST(precv_hdr->attrib.ra))
_rtw_memcpy(pLastRecvPN,WapiAEMultiCastPNInitialValueSrc,16);
else
_rtw_memcpy(pLastRecvPN,WapiAEPNInitialValueSrc,16);
@ -658,7 +658,7 @@ void rtw_build_assoc_req_wapi_ie(_adapter *padapter, unsigned char *pframe, stru
WapiSetIE(padapter);
WapiIELength = pWapiInfo->wapiIELength;
bkidNum = 0;
if(!list_empty(&(pWapiInfo->wapiBKIDStoreList))){
if (!list_empty(&(pWapiInfo->wapiBKIDStoreList))){
list_for_each_entry(pWapiBKID, &pWapiInfo->wapiBKIDStoreList, list) {
bkidNum ++;
_rtw_memcpy(pWapiInfo->wapiIE+WapiIELength+2, pWapiBKID->bkid,16);
@ -726,9 +726,9 @@ void rtw_wapi_return_one_sta_info(_adapter *padapter, u8 *MacAddr)
return;
}
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE))
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
{
while(!list_empty(&(pWapiInfo->wapiBKIDStoreList)))
while (!list_empty(&(pWapiInfo->wapiBKIDStoreList)))
{
pWapiBkid = (PRT_WAPI_BKID)list_entry(pWapiInfo->wapiBKIDStoreList.next, RT_WAPI_BKID, list);
list_del_init(&pWapiBkid->list);
@ -742,7 +742,7 @@ void rtw_wapi_return_one_sta_info(_adapter *padapter, u8 *MacAddr)
//Remove STA info
if(list_empty(&(pWapiInfo->wapiSTAUsedList))){
if (list_empty(&(pWapiInfo->wapiSTAUsedList))){
WAPI_TRACE(WAPI_API, " %s: wapiSTAUsedList is null \n", __FUNCTION__);
return;
}else{
@ -758,19 +758,19 @@ void rtw_wapi_return_one_sta_info(_adapter *padapter, u8 *MacAddr)
DBG_871X("peer Addr %02x-%02x-%02x-%02x-%02x-%02x \n",pWapiStaInfo->PeerMacAddr[0],pWapiStaInfo->PeerMacAddr[1],pWapiStaInfo->PeerMacAddr[2],pWapiStaInfo->PeerMacAddr[3],pWapiStaInfo->PeerMacAddr[4],pWapiStaInfo->PeerMacAddr[5]);
if(pWapiStaInfo == NULL)
if (pWapiStaInfo == NULL)
{
WAPI_TRACE(WAPI_API, " %s: pWapiStaInfo == NULL Case \n", __FUNCTION__);
return;
}
if(pWapiStaInfo->PeerMacAddr == NULL)
if (pWapiStaInfo->PeerMacAddr == NULL)
{
WAPI_TRACE(WAPI_API, " %s: pWapiStaInfo->PeerMacAddr == NULL Case \n", __FUNCTION__);
return;
}
if(MacAddr == NULL)
if (MacAddr == NULL)
{
WAPI_TRACE(WAPI_API, " %s: MacAddr == NULL Case \n", __FUNCTION__);
return;
@ -788,7 +788,7 @@ void rtw_wapi_return_one_sta_info(_adapter *padapter, u8 *MacAddr)
}
#endif
while(!list_empty(&(pWapiInfo->wapiSTAUsedList)))
while (!list_empty(&(pWapiInfo->wapiSTAUsedList)))
{
pWapiStaInfo = (PRT_WAPI_STA_INFO)list_entry(pWapiInfo->wapiSTAUsedList.next, RT_WAPI_STA_INFO, list);
@ -822,7 +822,7 @@ void rtw_wapi_return_all_sta_info(_adapter *padapter)
}
//Sta Info List
while(!list_empty(&(pWapiInfo->wapiSTAUsedList)))
while (!list_empty(&(pWapiInfo->wapiSTAUsedList)))
{
pWapiStaInfo = (PRT_WAPI_STA_INFO)list_entry(pWapiInfo->wapiSTAUsedList.next, RT_WAPI_STA_INFO, list);
list_del_init(&pWapiStaInfo->list);
@ -832,7 +832,7 @@ void rtw_wapi_return_all_sta_info(_adapter *padapter)
}
//BKID List
while(!list_empty(&(pWapiInfo->wapiBKIDStoreList)))
while (!list_empty(&(pWapiInfo->wapiBKIDStoreList)))
{
pWapiBkid = (PRT_WAPI_BKID)list_entry(pWapiInfo->wapiBKIDStoreList.next, RT_WAPI_BKID, list);
list_del_init(&pWapiBkid->list);
@ -855,25 +855,25 @@ void rtw_wapi_clear_cam_entry(_adapter *padapter, u8 *pMacAddr)
}
UcIndex = WapiGetEntryForCamClear(padapter, pMacAddr, 0, 0);
if(UcIndex != 0xff){
if (UcIndex != 0xff){
//CAM_mark_invalid(Adapter, UcIndex);
CAM_empty_entry(padapter, UcIndex);
}
UcIndex = WapiGetEntryForCamClear(padapter, pMacAddr, 1, 0);
if(UcIndex != 0xff){
if (UcIndex != 0xff){
//CAM_mark_invalid(Adapter, UcIndex);
CAM_empty_entry(padapter, UcIndex);
}
UcIndex = WapiGetEntryForCamClear(padapter, pMacAddr, 0, 1);
if(UcIndex != 0xff){
if (UcIndex != 0xff){
//CAM_mark_invalid(Adapter, UcIndex);
CAM_empty_entry(padapter, UcIndex);
}
UcIndex = WapiGetEntryForCamClear(padapter, pMacAddr, 1, 1);
if(UcIndex != 0xff){
if (UcIndex != 0xff){
//CAM_mark_invalid(padapter, UcIndex);
CAM_empty_entry(padapter, UcIndex);
}
@ -916,7 +916,7 @@ void rtw_wapi_set_key(_adapter *padapter, RT_WAPI_KEY *pWapiKey, RT_WAPI_STA_INF
EncAlgo = _SMS4_;
//For Tx bc/mc pkt,use defualt key entry
if(bUseDefaultKey)
if (bUseDefaultKey)
{
// when WAPI update key, keyid will be 0 or 1 by turns.
if (pWapiKey->keyId == 0)
@ -930,7 +930,7 @@ void rtw_wapi_set_key(_adapter *padapter, RT_WAPI_KEY *pWapiKey, RT_WAPI_STA_INF
EntryId = WapiGetEntryForCamWrite(padapter,pMacAddr,pWapiKey->keyId,bGroupKey);
}
if(EntryId == 0xff){
if (EntryId == 0xff){
WAPI_TRACE(WAPI_API, "===>No entry for WAPI setkey! !!\n");
return;
}
@ -986,8 +986,8 @@ void wapi_test_set_key(struct _adapter *padapter, u8* buf)
bUpdate = data[3];
memcpy(PeerAddr,data+4,6);
if(data[0] == 0x3){
if(!list_empty(&(pWapiInfo->wapiBKIDIdleList))){
if (data[0] == 0x3){
if (!list_empty(&(pWapiInfo->wapiBKIDIdleList))){
pWapiBkid = (PRT_WAPI_BKID)list_entry(pWapiInfo->wapiBKIDIdleList.next, RT_WAPI_BKID, list);
list_del_init(&pWapiBkid->list);
memcpy(pWapiBkid->bkid, data+10, 16);
@ -996,13 +996,13 @@ void wapi_test_set_key(struct _adapter *padapter, u8* buf)
}
}else{
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
if(!memcmp(pWapiSta->PeerMacAddr,PeerAddr,6)){
if (!memcmp(pWapiSta->PeerMacAddr,PeerAddr,6)){
pWapiSta->bAuthenticatorInUpdata = false;
switch(data[0]){
switch (data[0]){
case 1: //usk
if(bAuthenticator){ //authenticator
if (bAuthenticator){ //authenticator
memcpy(pWapiSta->lastTxUnicastPN,WapiAEPNInitialValueSrc,16);
if(!bUpdate) { //first
if (!bUpdate) { //first
WAPI_TRACE(WAPI_INIT,"AE fisrt set usk \n");
pWapiSta->wapiUsk.bSet = true;
memcpy(pWapiSta->wapiUsk.dataKey,data+10,16);
@ -1029,9 +1029,9 @@ void wapi_test_set_key(struct _adapter *padapter, u8* buf)
}
}
else{
if(!bUpdate){
if (!bUpdate){
WAPI_TRACE(WAPI_INIT,"ASUE fisrt set usk \n");
if(bTxEnable){
if (bTxEnable){
pWapiSta->wapiUsk.bTxEnable = true;
memcpy(pWapiSta->lastTxUnicastPN,WapiASUEPNInitialValueSrc,16);
}else{
@ -1043,9 +1043,9 @@ void wapi_test_set_key(struct _adapter *padapter, u8* buf)
}
}else{
WAPI_TRACE(WAPI_INIT,"ASUE update usk \n");
if(bTxEnable){
if (bTxEnable){
pWapiSta->wapiUskUpdate.bTxEnable = true;
if(pWapiSta->wapiUskUpdate.bSet){
if (pWapiSta->wapiUskUpdate.bSet){
memcpy(pWapiSta->wapiUsk.dataKey,pWapiSta->wapiUskUpdate.dataKey,16);
memcpy(pWapiSta->wapiUsk.micKey,pWapiSta->wapiUskUpdate.micKey,16);
pWapiSta->wapiUsk.keyId=pWapiSta->wapiUskUpdate.keyId;
@ -1069,7 +1069,7 @@ void wapi_test_set_key(struct _adapter *padapter, u8* buf)
}
break;
case 2: //msk
if(bAuthenticator){ //authenticator
if (bAuthenticator){ //authenticator
pWapiInfo->wapiTxMsk.bSet = true;
memcpy(pWapiInfo->wapiTxMsk.dataKey,data+10,16);
memcpy(pWapiInfo->wapiTxMsk.micKey,data+26,16);
@ -1077,9 +1077,9 @@ void wapi_test_set_key(struct _adapter *padapter, u8* buf)
pWapiInfo->wapiTxMsk.bTxEnable = true;
memcpy(pWapiInfo->lastTxMulticastPN,WapiAEMultiCastPNInitialValueSrc,16);
if(!bUpdate){ //first
if (!bUpdate){ //first
WAPI_TRACE(WAPI_INIT, "AE fisrt set msk \n");
if(!pWapiSta->bSetkeyOk)
if (!pWapiSta->bSetkeyOk)
pWapiSta->bSetkeyOk = true;
pWapiInfo->bFirstAuthentiateInProgress= false;
}else{ //update
@ -1090,14 +1090,14 @@ void wapi_test_set_key(struct _adapter *padapter, u8* buf)
WAPI_DATA(WAPI_INIT, "SetKey - AE MSK Mic Key", pWapiInfo->wapiTxMsk.micKey, 16);
}
else{
if(!bUpdate){
if (!bUpdate){
WAPI_TRACE(WAPI_INIT,"ASUE fisrt set msk \n");
pWapiSta->wapiMsk.bSet = true;
memcpy(pWapiSta->wapiMsk.dataKey,data+10,16);
memcpy(pWapiSta->wapiMsk.micKey,data+26,16);
pWapiSta->wapiMsk.keyId = *(data+42);
pWapiSta->wapiMsk.bTxEnable = false;
if(!pWapiSta->bSetkeyOk)
if (!pWapiSta->bSetkeyOk)
pWapiSta->bSetkeyOk = true;
pWapiInfo->bFirstAuthentiateInProgress= false;
WAPI_DATA(WAPI_INIT, "SetKey - ASUE MSK Data Key", pWapiSta->wapiMsk.dataKey, 16);
@ -1209,13 +1209,13 @@ void rtw_wapi_get_iv(_adapter *padapter,u8 *pRA, u8*IV)
WAPI_DATA(WAPI_RX,"wapi_get_iv: pra",pRA,6);
if(IS_MCAST(pRA)){
if(!pWapiInfo->wapiTxMsk.bTxEnable){
if (IS_MCAST(pRA)){
if (!pWapiInfo->wapiTxMsk.bTxEnable){
WAPI_TRACE(WAPI_ERR,"%s: bTxEnable = 0!!\n",__FUNCTION__);
return;
}
if(pWapiInfo->wapiTxMsk.keyId <= 1){
if (pWapiInfo->wapiTxMsk.keyId <= 1){
pWapiExt->KeyIdx = pWapiInfo->wapiTxMsk.keyId;
pWapiExt->Reserved = 0;
bPNOverflow = WapiIncreasePN(pWapiInfo->lastTxMulticastPN, 1);
@ -1224,7 +1224,7 @@ void rtw_wapi_get_iv(_adapter *padapter,u8 *pRA, u8*IV)
}
else
{
if(list_empty(&pWapiInfo->wapiSTAUsedList)){
if (list_empty(&pWapiInfo->wapiSTAUsedList)){
WAPI_TRACE(WAPI_RX,"rtw_wapi_get_iv: list is empty \n");
_rtw_memset(IV,10,18);
return;
@ -1242,11 +1242,11 @@ void rtw_wapi_get_iv(_adapter *padapter,u8 *pRA, u8*IV)
WAPI_DATA(WAPI_RX,"Addr",pRA,6);
if (bFindMatchPeer){
if((!pWapiSta->wapiUskUpdate.bTxEnable) && (!pWapiSta->wapiUsk.bTxEnable))
if ((!pWapiSta->wapiUskUpdate.bTxEnable) && (!pWapiSta->wapiUsk.bTxEnable))
return;
if (pWapiSta->wapiUsk.keyId <= 1){
if(pWapiSta->wapiUskUpdate.bTxEnable)
if (pWapiSta->wapiUskUpdate.bTxEnable)
pWapiExt->KeyIdx = pWapiSta->wapiUskUpdate.keyId;
else
pWapiExt->KeyIdx = pWapiSta->wapiUsk.keyId;
@ -1273,20 +1273,20 @@ bool rtw_wapi_drop_for_key_absent(_adapter *padapter,u8 *pRA)
WAPI_DATA(WAPI_RX,"rtw_wapi_drop_for_key_absent: ra ",pRA,6);
if(psecuritypriv->dot11PrivacyAlgrthm == _SMS4_)
if (psecuritypriv->dot11PrivacyAlgrthm == _SMS4_)
{
if ((!padapter->WapiSupport) || (!pWapiInfo->bWapiEnable))
return true;
if(IS_MCAST(pRA)){
if(!pWapiInfo->wapiTxMsk.bTxEnable){
if (IS_MCAST(pRA)){
if (!pWapiInfo->wapiTxMsk.bTxEnable){
bDrop = true;
WAPI_TRACE(WAPI_RX,"rtw_wapi_drop_for_key_absent: multicast key is absent \n");
return bDrop;
}
}
else{
if(!list_empty(&pWapiInfo->wapiSTAUsedList)){
if (!list_empty(&pWapiInfo->wapiSTAUsedList)){
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list){
WAPI_DATA(WAPI_RX,"rtw_wapi_drop_for_key_absent: pWapiSta->PeerMacAddr ",pWapiSta->PeerMacAddr,6);
if (_rtw_memcmp(pRA, pWapiSta->PeerMacAddr, 6) == _TRUE){

View file

@ -163,19 +163,19 @@ void WapiSMS4Cryption(u8 *Key, u8 *IV, u8 *Input, u16 InputLength,
*OutputLength = 0;
remainder = InputLength & 0x0F;
blockNum = InputLength >> 4;
if(remainder !=0)
if (remainder !=0)
blockNum++;
else
remainder = 16;
for(k=0;k<16;k++)
for (k=0;k<16;k++)
tempIV[k] = IV[15-k];
memcpy(blockIn, tempIV, 16);
SMS4KeyExt((u8 *)Key, rk,CryptFlag);
for(i=0; i<blockNum-1; i++)
for (i=0; i<blockNum-1; i++)
{
SMS4Crypt((u8 *)blockIn, blockOut, rk);
xor_block(&Output[i*16], &Input[i*16], blockOut);
@ -186,7 +186,7 @@ void WapiSMS4Cryption(u8 *Key, u8 *IV, u8 *Input, u16 InputLength,
SMS4Crypt((u8 *)blockIn, blockOut, rk);
for(j=0; j<remainder; j++)
for (j=0; j<remainder; j++)
{
Output[i*16+j] = Input[i*16+j] ^ blockOut[j];
}
@ -218,7 +218,7 @@ void WapiSMS4CalculateMic(u8 *Key, u8 *IV, u8 *Input1, u8 Input1Length,
remainder = Input1Length & 0x0F;
blockNum = Input1Length >> 4;
for(k=0;k<16;k++)
for (k=0;k<16;k++)
tempIV[k] = IV[15-k];
memcpy(BlockIn, tempIV, 16);
@ -227,12 +227,12 @@ void WapiSMS4CalculateMic(u8 *Key, u8 *IV, u8 *Input1, u8 Input1Length,
SMS4Crypt((u8 *)BlockIn, BlockOut, rk);
for(i=0; i<blockNum; i++){
for (i=0; i<blockNum; i++){
xor_block(BlockIn, (Input1+i*16), BlockOut);
SMS4Crypt((u8 *)BlockIn, BlockOut, rk);
}
if(remainder !=0){
if (remainder !=0){
memset(TempBlock, 0, 16);
memcpy(TempBlock, (Input1+blockNum*16), remainder);
@ -243,12 +243,12 @@ void WapiSMS4CalculateMic(u8 *Key, u8 *IV, u8 *Input1, u8 Input1Length,
remainder = Input2Length & 0x0F;
blockNum = Input2Length >> 4;
for(i=0; i<blockNum; i++){
for (i=0; i<blockNum; i++){
xor_block(BlockIn, (Input2+i*16), BlockOut);
SMS4Crypt((u8 *)BlockIn, BlockOut, rk);
}
if(remainder !=0){
if (remainder !=0){
memset(TempBlock, 0, 16);
memcpy(TempBlock, (Input2+blockNum*16), remainder);
@ -302,7 +302,7 @@ void SecCalculateMicSMS4(
QosOffset = 24;
}
if((fc & 0x0088) == 0x0088){
if ((fc & 0x0088) == 0x0088){
memcpy((TempBuf+28), (pHeader+QosOffset), 2);
TempLen += 2;
//IV = pHeader + QosOffset + 2 + SNAP_SIZE + sizeof(u16) + 2;
@ -343,9 +343,9 @@ u8 WapiIncreasePN(u8 *PN, u8 AddCount)
return 1;
//YJ,test,091102
/*
if(AddCount == 2){
if (AddCount == 2){
DBG_8192C("############################%s(): PN[0]=0x%x\n", __FUNCTION__, PN[0]);
if(PN[0] == 0x48){
if (PN[0] == 0x48){
PN[0] += AddCount;
return 1;
}else{
@ -380,7 +380,7 @@ void WapiGetLastRxUnicastPNForQoSData(
)
{
WAPI_TRACE(WAPI_RX, "===========> %s\n", __FUNCTION__);
switch(UserPriority)
switch (UserPriority)
{
case 0:
case 3:
@ -413,7 +413,7 @@ void WapiSetLastRxUnicastPNForQoSData(
)
{
WAPI_TRACE(WAPI_RX, "===========> %s\n", __FUNCTION__);
switch(UserPriority)
switch (UserPriority)
{
case 0:
case 3:
@ -461,7 +461,7 @@ u8 WapiCheckPnInSwDecrypt(
pRaddr = header->addr1;
fc = le16_to_cpu(header->frame_ctl);
if(GetToDs(&fc))
if (GetToDs(&fc))
pDaddr = header->addr3;
else
pDaddr = header->addr1;
@ -511,12 +511,12 @@ int SecSMS4HeaderFillIV(_adapter *padapter, u8 *pxmitframe)
WAPI_DATA(WAPI_TX, "FillIV - Before Fill IV", pskb->data, pskb->len);
//Address 1 is always receiver's address
if( IS_MCAST(pRA) ){
if(!pWapiInfo->wapiTxMsk.bTxEnable){
if ( IS_MCAST(pRA) ){
if (!pWapiInfo->wapiTxMsk.bTxEnable){
WAPI_TRACE(WAPI_ERR,"%s: bTxEnable = 0!!\n",__FUNCTION__);
return -2;
}
if(pWapiInfo->wapiTxMsk.keyId <= 1){
if (pWapiInfo->wapiTxMsk.keyId <= 1){
pWapiExt->KeyIdx = pWapiInfo->wapiTxMsk.keyId;
pWapiExt->Reserved = 0;
bPNOverflow = WapiIncreasePN(pWapiInfo->lastTxMulticastPN, 1);
@ -533,18 +533,18 @@ int SecSMS4HeaderFillIV(_adapter *padapter, u8 *pxmitframe)
}
else{
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
if(!memcmp(pWapiSta->PeerMacAddr,pRA,6)){
if (!memcmp(pWapiSta->PeerMacAddr,pRA,6)){
bFindMatchPeer = true;
break;
}
}
if (bFindMatchPeer){
if((!pWapiSta->wapiUskUpdate.bTxEnable) && (!pWapiSta->wapiUsk.bTxEnable)){
if ((!pWapiSta->wapiUskUpdate.bTxEnable) && (!pWapiSta->wapiUsk.bTxEnable)){
WAPI_TRACE(WAPI_ERR,"%s: bTxEnable = 0!!\n",__FUNCTION__);
return -4;
}
if (pWapiSta->wapiUsk.keyId <= 1){
if(pWapiSta->wapiUskUpdate.bTxEnable)
if (pWapiSta->wapiUskUpdate.bTxEnable)
pWapiExt->KeyIdx = pWapiSta->wapiUskUpdate.keyId;
else
pWapiExt->KeyIdx = pWapiSta->wapiUsk.keyId;
@ -600,7 +600,7 @@ void SecSWSMS4Encryption(
pRA = pframe + 4;
if( IS_MCAST(pRA) ){
if ( IS_MCAST(pRA) ){
KeyIdx = pWapiInfo->wapiTxMsk.keyId;
pIV = pWapiInfo->lastTxMulticastPN;
pMicKey = pWapiInfo->wapiTxMsk.micKey;
@ -689,7 +689,7 @@ u8 SecSWSMS4Decryption(
IVOffset += 2;
}
//if(GetHTC())
//if (GetHTC())
// IVOffset += 4;
//IVOffset += SNAP_SIZE + sizeof(u16);
@ -719,7 +719,7 @@ u8 SecSWSMS4Decryption(
return false;
}
if( IS_MCAST(pRA) ){
if ( IS_MCAST(pRA) ){
WAPI_TRACE(WAPI_RX, "%s: Multicast decryption !!!\n", __FUNCTION__);
if (pWapiSta->wapiMsk.keyId == KeyIdx && pWapiSta->wapiMsk.bSet){
pLastRxPN = pWapiSta->lastRxMulticastPN;
@ -748,8 +748,8 @@ u8 SecSWSMS4Decryption(
WAPI_TRACE(WAPI_RX, "%s: Unicast decryption !!!\n", __FUNCTION__);
if (pWapiSta->wapiUsk.keyId == KeyIdx && pWapiSta->wapiUsk.bSet){
WAPI_TRACE(WAPI_RX, "%s: Use USK for Decryption!!!\n", __FUNCTION__);
if(precv_hdr->bWapiCheckPNInDecrypt){
if(GetFrameType(pskb->data) == WIFI_QOS_DATA_TYPE){
if (precv_hdr->bWapiCheckPNInDecrypt){
if (GetFrameType(pskb->data) == WIFI_QOS_DATA_TYPE){
WapiGetLastRxUnicastPNForQoSData(TID, pWapiSta, lastRxPNforQoS);
pLastRxPN = lastRxPNforQoS;
}else{
@ -758,7 +758,7 @@ u8 SecSWSMS4Decryption(
if (!WapiComparePN(pRecvPN, pLastRxPN)){
return false;
}
if(bQosData){
if (bQosData){
WapiSetLastRxUnicastPNForQoSData(TID, pRecvPN, pWapiSta);
}else{
memcpy(pWapiSta->lastRxUnicastPN, pRecvPN, 16);
@ -780,12 +780,12 @@ u8 SecSWSMS4Decryption(
}
else if (pWapiSta->wapiUskUpdate.keyId == KeyIdx && pWapiSta->wapiUskUpdate.bSet ){
WAPI_TRACE(WAPI_RX, "%s: Use Updated USK for Decryption!!!\n", __FUNCTION__);
if(pWapiSta->bAuthenticatorInUpdata)
if (pWapiSta->bAuthenticatorInUpdata)
bUseUpdatedKey = true;
else
bUseUpdatedKey = false;
if(bQosData){
if (bQosData){
WapiSetLastRxUnicastPNForQoSData(TID, pRecvPN, pWapiSta);
}else{
memcpy(pWapiSta->lastRxUnicastPN, pRecvPN, 16);
@ -861,7 +861,7 @@ u32 rtw_sms4_encrypt(_adapter *padapter, u8 *pxmitframe)
return _FAIL;
}
if(((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
if (((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
return _FAIL;
pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + TXDESC_OFFSET;

View file

@ -78,7 +78,7 @@ int cckrates_included(unsigned char *rate, int ratelen)
{
int i;
for(i = 0; i < ratelen; i++)
for (i = 0; i < ratelen; i++)
{
if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
(((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) )
@ -93,7 +93,7 @@ int cckratesonly_included(unsigned char *rate, int ratelen)
{
int i;
for(i = 0; i < ratelen; i++)
for (i = 0; i < ratelen; i++)
{
if ( (((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) &&
(((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22) )
@ -107,7 +107,7 @@ unsigned char networktype_to_raid(unsigned char network_type)
{
unsigned char raid;
switch(network_type)
switch (network_type)
{
case WIRELESS_11B:
raid = RATR_INX_WIRELESS_B;
@ -147,7 +147,7 @@ u8 judge_network_type(_adapter *padapter, unsigned char *rate, int ratelen)
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
if(pmlmeext->cur_channel > 14)
if (pmlmeext->cur_channel > 14)
{
if (pmlmeinfo->HT_enable)
{
@ -167,7 +167,7 @@ u8 judge_network_type(_adapter *padapter, unsigned char *rate, int ratelen)
{
network_type |= WIRELESS_11B;
}
else if((cckrates_included(rate, ratelen)) == _TRUE)
else if ((cckrates_included(rate, ratelen)) == _TRUE)
{
network_type |= WIRELESS_11BG;
}
@ -248,7 +248,7 @@ int is_basicrate(_adapter *padapter, unsigned char rate)
unsigned char val;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
for(i = 0; i < NumRates; i++)
for (i = 0; i < NumRates; i++)
{
val = pmlmeext->basicrate[i];
@ -318,10 +318,10 @@ void UpdateBrateTbl(
u8 rate;
// 1M, 2M, 5.5M, 11M, 6M, 12M, 24M are mandatory.
for(i=0;i<NDIS_802_11_LENGTH_RATES_EX;i++)
for (i=0;i<NDIS_802_11_LENGTH_RATES_EX;i++)
{
rate = mBratesOS[i] & 0x7f;
switch(rate)
switch (rate)
{
case IEEE80211_CCK_RATE_1MB:
case IEEE80211_CCK_RATE_2MB:
@ -342,10 +342,10 @@ void UpdateBrateTblForSoftAP(u8 *bssrateset, u32 bssratelen)
u8 i;
u8 rate;
for(i=0;i<bssratelen;i++)
for (i=0;i<bssratelen;i++)
{
rate = bssrateset[i] & 0x7f;
switch(rate)
switch (rate)
{
case IEEE80211_CCK_RATE_1MB:
case IEEE80211_CCK_RATE_2MB:
@ -364,7 +364,7 @@ void Save_DM_Func_Flag(_adapter *padapter)
#ifdef CONFIG_CONCURRENT_MODE
_adapter *pbuddy_adapter = padapter->pbuddy_adapter;
if(pbuddy_adapter)
if (pbuddy_adapter)
rtw_hal_set_hwreg(pbuddy_adapter, HW_VAR_DM_FUNC_OP, (u8 *)(&bSaveFlag));
#endif
@ -377,7 +377,7 @@ void Restore_DM_Func_Flag(_adapter *padapter)
u8 bSaveFlag = _FALSE;
#ifdef CONFIG_CONCURRENT_MODE
_adapter *pbuddy_adapter = padapter->pbuddy_adapter;
if(pbuddy_adapter)
if (pbuddy_adapter)
rtw_hal_set_hwreg(pbuddy_adapter, HW_VAR_DM_FUNC_OP, (u8 *)(&bSaveFlag));
#endif
rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_OP, (u8 *)(&bSaveFlag));
@ -389,10 +389,10 @@ void Switch_DM_Func(_adapter *padapter, u32 mode, u8 enable)
_adapter *pbuddy_adapter = padapter->pbuddy_adapter;
#endif
if(enable == _TRUE)
if (enable == _TRUE)
{
#ifdef CONFIG_CONCURRENT_MODE
if(pbuddy_adapter)
if (pbuddy_adapter)
rtw_hal_set_hwreg(pbuddy_adapter, HW_VAR_DM_FUNC_SET, (u8 *)(&mode));
#endif
rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_SET, (u8 *)(&mode));
@ -400,7 +400,7 @@ void Switch_DM_Func(_adapter *padapter, u32 mode, u8 enable)
else
{
#ifdef CONFIG_CONCURRENT_MODE
if(pbuddy_adapter)
if (pbuddy_adapter)
rtw_hal_set_hwreg(pbuddy_adapter, HW_VAR_DM_FUNC_CLR, (u8 *)(&mode));
#endif
rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_CLR, (u8 *)(&mode));
@ -411,7 +411,7 @@ void Switch_DM_Func(_adapter *padapter, u32 mode, u8 enable)
val8 = rtw_read8(padapter, FW_DYNAMIC_FUN_SWITCH);
if(enable == _TRUE)
if (enable == _TRUE)
{
rtw_write8(padapter, FW_DYNAMIC_FUN_SWITCH, (val8 | mode));
}
@ -436,7 +436,7 @@ static void Set_NETYPE0_MSR(_adapter *padapter, u8 type)
void Set_MSR(_adapter *padapter, u8 type)
{
#ifdef CONFIG_CONCURRENT_MODE
if(padapter->iface_type == IFACE_PORT1)
if (padapter->iface_type == IFACE_PORT1)
{
Set_NETYPE1_MSR(padapter, type);
}
@ -570,7 +570,7 @@ void set_channel_bwmode(_adapter *padapter, unsigned char channel, unsigned char
DBG_871X( "[%s] ch = %d, offset = %d, bwmode = %d\n", __FUNCTION__, channel, channel_offset, bwmode );
}
if((bwmode == HT_CHANNEL_WIDTH_20)||(channel_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE))
if ((bwmode == HT_CHANNEL_WIDTH_20)||(channel_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE))
{
//SelectChannel(padapter, channel);
center_ch = channel;
@ -657,7 +657,7 @@ int is_client_associated_to_ap(_adapter *padapter)
struct mlme_ext_priv *pmlmeext;
struct mlme_ext_info *pmlmeinfo;
if(!padapter)
if (!padapter)
return _FAIL;
pmlmeext = &padapter->mlmeextpriv;
@ -742,10 +742,10 @@ static u32 _ReadCAM(_adapter *padapter ,u32 addr)
rtw_write32(padapter, RWCAM, cmd);
do{
if(0 == (rtw_read32(padapter,REG_CAMCMD) & CAM_POLLINIG)){
if (0 == (rtw_read32(padapter,REG_CAMCMD) & CAM_POLLINIG)){
break;
}
}while(count++ < 100);
}while (count++ < 100);
return rtw_read32(padapter,REG_CAMREAD);
}
@ -867,25 +867,25 @@ void flush_all_cam_entry(_adapter *padapter)
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
//if(check_buddy_mlmeinfo_state(padapter, _HW_STATE_NOLINK_))
if(check_buddy_fwstate(padapter, _FW_LINKED) == _FALSE)
//if (check_buddy_mlmeinfo_state(padapter, _HW_STATE_NOLINK_))
if (check_buddy_fwstate(padapter, _FW_LINKED) == _FALSE)
{
rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, 0);
}
else
{
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE))
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
{
struct sta_priv *pstapriv = &padapter->stapriv;
struct sta_info *psta;
u8 cam_id;//cam_entry
psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress);
if(psta) {
if(psta->state & WIFI_AP_STATE)
if (psta) {
if (psta->state & WIFI_AP_STATE)
{} //clear cam when ap free per sta_info
else {
if(psta->mac_id==2)
if (psta->mac_id==2)
cam_id = 5;
else
cam_id = 4;
@ -894,7 +894,7 @@ void flush_all_cam_entry(_adapter *padapter)
rtw_clearstakey_cmd(padapter, (u8*)psta, cam_id, _FALSE);
}
}
else if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
{
//clear cam when ap free per sta_info
}
@ -952,7 +952,7 @@ int WMM_param_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
if(pmlmepriv->qospriv.qos_option==0)
if (pmlmepriv->qospriv.qos_option==0)
{
pmlmeinfo->WMM_enable = 0;
return _FAIL;
@ -1004,7 +1004,7 @@ void WMMOnAssocRsp(_adapter *padapter)
acm_mask = 0;
if( pmlmeext->cur_wireless_mode == WIRELESS_11B)
if ( pmlmeext->cur_wireless_mode == WIRELESS_11B)
aSifsTime = 10;
else
aSifsTime = 16;
@ -1053,35 +1053,35 @@ void WMMOnAssocRsp(_adapter *padapter)
DBG_871X("WMM(%x): %x, %x\n", ACI, ACM, acParm);
}
if(padapter->registrypriv.acm_method == 1)
if (padapter->registrypriv.acm_method == 1)
rtw_hal_set_hwreg(padapter, HW_VAR_ACM_CTRL, (u8 *)(&acm_mask));
else
padapter->mlmepriv.acm_mask = acm_mask;
inx[0] = 0; inx[1] = 1; inx[2] = 2; inx[3] = 3;
if(pregpriv->wifi_spec==1)
if (pregpriv->wifi_spec==1)
{
u32 j, tmp, change_inx;
//entry indx: 0->vo, 1->vi, 2->be, 3->bk.
for(i=0; i<4; i++)
for (i=0; i<4; i++)
{
for(j=i+1; j<4; j++)
for (j=i+1; j<4; j++)
{
//compare CW and AIFS
if((edca[j] & 0xFFFF) < (edca[i] & 0xFFFF))
if ((edca[j] & 0xFFFF) < (edca[i] & 0xFFFF))
{
change_inx = _TRUE;
}
else if((edca[j] & 0xFFFF) == (edca[i] & 0xFFFF))
else if ((edca[j] & 0xFFFF) == (edca[i] & 0xFFFF))
{
//compare TXOP
if((edca[j] >> 16) > (edca[i] >> 16))
if ((edca[j] >> 16) > (edca[i] >> 16))
change_inx = _TRUE;
}
if(change_inx)
if (change_inx)
{
tmp = edca[i];
edca[i] = edca[j];
@ -1097,7 +1097,7 @@ void WMMOnAssocRsp(_adapter *padapter)
}
}
for(i=0; i<4; i++) {
for (i=0; i<4; i++) {
pxmitpriv->wmm_para_seq[i] = inx[i];
DBG_871X("wmm_para_seq(%d): %d\n", i, pxmitpriv->wmm_para_seq[i]);
}
@ -1117,17 +1117,17 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI
struct registry_priv *pregistrypriv = &padapter->registrypriv;
struct ht_priv *phtpriv = &pmlmepriv->htpriv;
if(!pIE)
if (!pIE)
return;
if(phtpriv->ht_option == _FALSE) return;
if (phtpriv->ht_option == _FALSE) return;
if(pIE->Length > sizeof(struct HT_info_element))
if (pIE->Length > sizeof(struct HT_info_element))
return;
pHT_info = (struct HT_info_element *)pIE->data;
if((pHT_info->infos[0] & BIT(2)) && pregistrypriv->cbw40_enable )
if ((pHT_info->infos[0] & BIT(2)) && pregistrypriv->cbw40_enable )
{
new_bwmode = HT_CHANNEL_WIDTH_40;
@ -1153,7 +1153,7 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI
}
if((new_bwmode!= pmlmeext->cur_bwmode) || (new_ch_offset!=pmlmeext->cur_ch_offset))
if ((new_bwmode!= pmlmeext->cur_bwmode) || (new_ch_offset!=pmlmeext->cur_ch_offset))
{
pmlmeinfo->bwmode_updated = _TRUE;
@ -1169,7 +1169,7 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI
}
if(_TRUE == pmlmeinfo->bwmode_updated)
if (_TRUE == pmlmeinfo->bwmode_updated)
{
struct sta_info *psta;
WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network);
@ -1180,11 +1180,11 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI
//update ap's stainfo
psta = rtw_get_stainfo(pstapriv, cur_network->MacAddress);
if(psta)
if (psta)
{
struct ht_priv *phtpriv_sta = &psta->htpriv;
if(phtpriv_sta->ht_option)
if (phtpriv_sta->ht_option)
{
// bwmode
phtpriv_sta->bwmode = pmlmeext->cur_bwmode;
@ -1216,9 +1216,9 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
struct ht_priv *phtpriv = &pmlmepriv->htpriv;
struct registry_priv *pregistrypriv = &padapter->registrypriv;
if(pIE==NULL) return;
if (pIE==NULL) return;
if(phtpriv->ht_option == _FALSE) return;
if (phtpriv->ht_option == _FALSE) return;
pmlmeinfo->HT_caps_enable = 1;
@ -1266,14 +1266,14 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
//update the MCS rates
for (i = 0; i < 16; i++)
{
if((rf_type == RF_1T1R) || (rf_type == RF_1T2R))
if ((rf_type == RF_1T1R) || (rf_type == RF_1T2R))
{
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i];
}
else
{
#ifdef CONFIG_DISABLE_MCS13TO15
if(pmlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40 && (pregistrypriv->wifi_spec!=1))
if (pmlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40 && (pregistrypriv->wifi_spec!=1))
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R_MCS13TO15_OFF[i];
else
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R[i];
@ -1299,12 +1299,12 @@ void HT_info_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct ht_priv *phtpriv = &pmlmepriv->htpriv;
if(pIE==NULL) return;
if (pIE==NULL) return;
if(phtpriv->ht_option == _FALSE) return;
if (phtpriv->ht_option == _FALSE) return;
if(pIE->Length > sizeof(struct HT_info_element))
if (pIE->Length > sizeof(struct HT_info_element))
return;
pmlmeinfo->HT_info_enable = 1;
@ -1380,7 +1380,7 @@ void HTOnAssocRsp(_adapter *padapter)
// Config SM Power Save setting
//
pmlmeinfo->SM_PS = (pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info & 0x0C) >> 2;
if(pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC)
if (pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC)
{
/*u8 i;
//update the MCS rates
@ -1404,7 +1404,7 @@ void ERP_IE_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
if(pIE->Length>1)
if (pIE->Length>1)
return;
pmlmeinfo->ERP_enable = 1;
@ -1466,13 +1466,13 @@ int check_ap_tdls_prohibited(u8 *pframe, u8 pkt_len)
{
u8 tdls_prohibited_bit = 0x40; //bit(38); TDLS_prohibited
if(pkt_len < 5)
if (pkt_len < 5)
{
return _FALSE;
}
pframe += 4;
if( (*pframe) & tdls_prohibited_bit )
if ( (*pframe) & tdls_prohibited_bit )
return _TRUE;
return _FALSE;
@ -1521,7 +1521,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
subtype = GetFrameSubType(pframe) >> 4;
if(subtype==WIFI_BEACON)
if (subtype==WIFI_BEACON)
bssid->Reserved[0] = 1;
bssid->Length = sizeof(WLAN_BSSID_EX) - MAX_IE_SZ + len;
@ -1533,7 +1533,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
/* check bw and channel offset */
/* parsing HT_CAP_IE */
p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
if(p && len>0) {
if (p && len>0) {
pht_cap = (struct rtw_ieee80211_ht_cap *)(p + 2);
ht_cap_info = pht_cap->cap_info;
} else {
@ -1541,7 +1541,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
}
/* parsing HT_INFO_IE */
p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_ADD_INFO_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
if(p && len>0) {
if (p && len>0) {
pht_info = (struct HT_info_element *)(p + 2);
ht_info_infos_0 = pht_info->infos[0];
} else {
@ -1569,7 +1569,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
bcn_channel = *(p + 2);
} else {/* In 5G, some ap do not have DSSET IE checking HT info for channel */
p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_ADD_INFO_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
if(pht_info) {
if (pht_info) {
bcn_channel = pht_info->primary_channel;
} else { /* we don't find channel IE, so don't check it */
DBG_871X("Oops: %s we don't find channel IE, so don't check it \n", __func__);
@ -1590,7 +1590,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
hidden_ssid = _FALSE;
}
if((NULL != p) && (_FALSE == hidden_ssid && (*(p + 1)))) {
if ((NULL != p) && (_FALSE == hidden_ssid && (*(p + 1)))) {
_rtw_memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1));
bssid->Ssid.SsidLength = *(p + 1);
} else {
@ -1645,7 +1645,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
if (encryp_protocol == ENCRYP_PROTOCOL_WPA || encryp_protocol == ENCRYP_PROTOCOL_WPA2) {
pbuf = rtw_get_wpa_ie(&bssid->IEs[12], &wpa_ielen, bssid->IELength-12);
if(pbuf && (wpa_ielen>0)) {
if (pbuf && (wpa_ielen>0)) {
if (_SUCCESS == rtw_parse_wpa_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is_8021x)) {
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,
("%s pnetwork->pairwise_cipher: %d, group_cipher is %d, is_8021x is %d\n", __func__,
@ -1654,7 +1654,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
} else {
pbuf = rtw_get_wpa2_ie(&bssid->IEs[12], &wpa_ielen, bssid->IELength-12);
if(pbuf && (wpa_ielen>0)) {
if (pbuf && (wpa_ielen>0)) {
if (_SUCCESS == rtw_parse_wpa2_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is_8021x)) {
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,
("%s pnetwork->pairwise_cipher: %d, pnetwork->group_cipher is %d, is_802x is %d\n",
@ -1729,7 +1729,7 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta
#ifdef CONFIG_TDLS
case _EXT_CAP_IE_:
if( check_ap_tdls_prohibited(pIE->data, pIE->Length) == _TRUE )
if ( check_ap_tdls_prohibited(pIE->data, pIE->Length) == _TRUE )
ptdlsinfo->ap_prohibited = _TRUE;
break;
#endif //CONFIG_TDLS
@ -2029,9 +2029,9 @@ unsigned char get_highest_rate_idx(u32 mask)
int i;
unsigned char rate_idx=0;
for(i=27; i>=0; i--)
for (i=27; i>=0; i--)
{
if(mask & BIT(i))
if (mask & BIT(i))
{
rate_idx = i;
break;
@ -2086,7 +2086,7 @@ void update_tx_basic_rate(_adapter *padapter, u8 wirelessmode)
// Added by Albert 2011/03/22
// In the P2P mode, the driver should not support the b mode.
// So, the Tx packet shouldn't use the CCK rate
if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
return;
#endif //CONFIG_P2P
#ifdef CONFIG_INTEL_WIDI
@ -2172,7 +2172,7 @@ unsigned char check_assoc_AP(u8 *pframe, uint len)
else if (_rtw_memcmp(pIE->data, EPIGRAM_OUI, 3))
{
epigram_vendor_flag = 1;
if(ralink_vendor_flag) {
if (ralink_vendor_flag) {
DBG_871X("link to Tenda W311R AP\n");
return HT_IOT_PEER_TENDA;
} else {
@ -2243,12 +2243,12 @@ void update_capinfo(PADAPTER Adapter, u16 updateCap)
// Check preamble mode, 2005.01.06, by rcnjko.
// Mark to update preamble value forever, 2008.03.18 by lanhsin
//if( pMgntInfo->RegPreambleMode == PREAMBLE_AUTO )
//if ( pMgntInfo->RegPreambleMode == PREAMBLE_AUTO )
{
if(updateCap & cShortPreamble)
if (updateCap & cShortPreamble)
{ // Short Preamble
if(pmlmeinfo->preamble_mode != PREAMBLE_SHORT) // PREAMBLE_LONG or PREAMBLE_AUTO
if (pmlmeinfo->preamble_mode != PREAMBLE_SHORT) // PREAMBLE_LONG or PREAMBLE_AUTO
{
ShortPreamble = _TRUE;
pmlmeinfo->preamble_mode = PREAMBLE_SHORT;
@ -2257,7 +2257,7 @@ void update_capinfo(PADAPTER Adapter, u16 updateCap)
}
else
{ // Long Preamble
if(pmlmeinfo->preamble_mode != PREAMBLE_LONG) // PREAMBLE_SHORT or PREAMBLE_AUTO
if (pmlmeinfo->preamble_mode != PREAMBLE_LONG) // PREAMBLE_SHORT or PREAMBLE_AUTO
{
ShortPreamble = _FALSE;
pmlmeinfo->preamble_mode = PREAMBLE_LONG;
@ -2273,24 +2273,24 @@ void update_capinfo(PADAPTER Adapter, u16 updateCap)
else
{
//Filen: See 802.11-2007 p.90
if( pmlmeext->cur_wireless_mode & (WIRELESS_11G | WIRELESS_11_24N))
if ( pmlmeext->cur_wireless_mode & (WIRELESS_11G | WIRELESS_11_24N))
{
if( (updateCap & cShortSlotTime) /* && (!(pMgntInfo->pHTInfo->RT2RT_HT_Mode & RT_HT_CAP_USE_LONG_PREAMBLE)) */)
if ( (updateCap & cShortSlotTime) /* && (!(pMgntInfo->pHTInfo->RT2RT_HT_Mode & RT_HT_CAP_USE_LONG_PREAMBLE)) */)
{ // Short Slot Time
if(pmlmeinfo->slotTime != SHORT_SLOT_TIME)
if (pmlmeinfo->slotTime != SHORT_SLOT_TIME)
{
pmlmeinfo->slotTime = SHORT_SLOT_TIME;
}
}
else
{ // Long Slot Time
if(pmlmeinfo->slotTime != NON_SHORT_SLOT_TIME)
if (pmlmeinfo->slotTime != NON_SHORT_SLOT_TIME)
{
pmlmeinfo->slotTime = NON_SHORT_SLOT_TIME;
}
}
}
else if( pmlmeext->cur_wireless_mode & (WIRELESS_11A | WIRELESS_11_5N))
else if ( pmlmeext->cur_wireless_mode & (WIRELESS_11A | WIRELESS_11_5N))
{
pmlmeinfo->slotTime = SHORT_SLOT_TIME;
}
@ -2321,7 +2321,7 @@ void update_wireless_mode(_adapter *padapter)
pmlmeinfo->HT_enable = 1;
}
if(pmlmeext->cur_channel > 14)
if (pmlmeext->cur_channel > 14)
{
if (pmlmeinfo->HT_enable)
{
@ -2341,7 +2341,7 @@ void update_wireless_mode(_adapter *padapter)
{
network_type |= WIRELESS_11B;
}
else if((cckrates_included(rate, ratelen)) == _TRUE)
else if ((cckrates_included(rate, ratelen)) == _TRUE)
{
network_type |= WIRELESS_11BG;
}
@ -2353,7 +2353,7 @@ void update_wireless_mode(_adapter *padapter)
pmlmeext->cur_wireless_mode = network_type & padapter->registrypriv.wireless_mode;
/*
if((pmlmeext->cur_wireless_mode==WIRELESS_11G) ||
if ((pmlmeext->cur_wireless_mode==WIRELESS_11G) ||
(pmlmeext->cur_wireless_mode==WIRELESS_11BG))//WIRELESS_MODE_G)
SIFS_Timer = 0x0a0a;//CCK
else
@ -2404,7 +2404,7 @@ void update_bmc_sta_support_rate(_adapter *padapter, u32 mac_id)
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
if(pmlmeext->cur_wireless_mode & WIRELESS_11B)
if (pmlmeext->cur_wireless_mode & WIRELESS_11B)
{
// Only B, B/G, and B/G/N AP could use CCK rate
_rtw_memcpy((pmlmeinfo->FW_sta_info[mac_id].SupportedRates), rtw_basic_rate_cck, 4);
@ -2454,7 +2454,7 @@ void process_addba_req(_adapter *padapter, u8 *paddba_req, u8 *addr)
psta = rtw_get_stainfo(pstapriv, addr);
if(psta)
if (psta)
{
start_seq = le16_to_cpu(preq->BA_starting_seqctrl) >> 4;
@ -2615,7 +2615,7 @@ int rtw_handle_dualmac(_adapter *adapter, bool init)
if (init) {
#if 0
/* For SMSP on 92DU-VC, driver do not probe another Interface. */
if(dvobj->NumInterfaces == 2 && dvobj->InterfaceNumber != 0 &&
if (dvobj->NumInterfaces == 2 && dvobj->InterfaceNumber != 0 &&
adapter->registrypriv.mac_phy_mode == 1) {
DBG_871X("%s(): Do not init another USB Interface because SMSP\n",__FUNCTION__);
status = _FAIL;

File diff suppressed because it is too large Load diff

View file

@ -15,7 +15,7 @@ Major Change History:
--*/
#include "odm_precomp.h"
//#if( DM_ODM_SUPPORT_TYPE == ODM_MP)
//#if ( DM_ODM_SUPPORT_TYPE == ODM_MP)
//#include "Mp_Precomp.h"
//#endif
@ -169,8 +169,8 @@ odm_SetTxRPTTiming_8188E(
{
u1Byte idx = 0;
for(idx=0; idx<5; idx++)
if(DynamicTxRPTTiming[idx] == pRaInfo->RptTime)
for (idx=0; idx<5; idx++)
if (DynamicTxRPTTiming[idx] == pRaInfo->RptTime)
break;
if (extend==0) // back to default timing
@ -181,7 +181,7 @@ odm_SetTxRPTTiming_8188E(
idx=5;
}
else if (extend==2) {// decrease the timing
if(idx!=0)
if (idx!=0)
idx-=1;
}
pRaInfo->RptTime=DynamicTxRPTTiming[idx];
@ -199,7 +199,7 @@ odm_RateDown_8188E(
u1Byte i;
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE, ("=====>odm_RateDown_8188E()\n"));
if(NULL == pRaInfo)
if (NULL == pRaInfo)
{
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD, ("odm_RateDown_8188E(): pRaInfo is NULL\n"));
return -1;
@ -215,7 +215,7 @@ odm_RateDown_8188E(
{
RateID=HighestRate;
}
else if(pRaInfo->RateSGI)
else if (pRaInfo->RateSGI)
{
pRaInfo->RateSGI=0;
}
@ -243,14 +243,14 @@ RateDownFinish:
pRaInfo->RAWaitingCounter+=1;
pRaInfo->RAPendingCounter+=1;
}
else if(pRaInfo->RAWaitingCounter==0){
else if (pRaInfo->RAWaitingCounter==0){
}
else{
pRaInfo->RAWaitingCounter=0;
pRaInfo->RAPendingCounter=0;
}
if(pRaInfo->RAPendingCounter>=4)
if (pRaInfo->RAPendingCounter>=4)
pRaInfo->RAPendingCounter=4;
pRaInfo->DecisionRate=RateID;
@ -272,7 +272,7 @@ odm_RateUp_8188E(
u1Byte i;
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE, ("=====>odm_RateUp_8188E() \n"));
if(NULL == pRaInfo)
if (NULL == pRaInfo)
{
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD, ("odm_RateUp_8188E(): pRaInfo is NULL\n"));
return -1;
@ -304,21 +304,21 @@ odm_RateUp_8188E(
}
}
}
else if(RateID == HighestRate)
else if (RateID == HighestRate)
{
if (pRaInfo->SGIEnable && (pRaInfo->RateSGI != 1))
pRaInfo->RateSGI = 1;
else if((pRaInfo->SGIEnable) !=1 )
else if ((pRaInfo->SGIEnable) !=1 )
pRaInfo->RateSGI = 0;
}
else //if((sta_info_ra->Decision_rate) > (sta_info_ra->Highest_rate))
else //if ((sta_info_ra->Decision_rate) > (sta_info_ra->Highest_rate))
{
RateID = HighestRate;
}
RateUpfinish:
//if(pRaInfo->RAWaitingCounter==10)
if(pRaInfo->RAWaitingCounter==(4+PendingForRateUpFail[pRaInfo->RAPendingCounter]))
//if (pRaInfo->RAWaitingCounter==10)
if (pRaInfo->RAWaitingCounter==(4+PendingForRateUpFail[pRaInfo->RAPendingCounter]))
pRaInfo->RAWaitingCounter=0;
else
pRaInfo->RAWaitingCounter++;
@ -408,7 +408,7 @@ odm_RateDecision_8188E(
else if (pRaInfo->NscUp > N_THRESHOLD_HIGH[RateID])
odm_RateUp_8188E(pDM_Odm,pRaInfo);
if(pRaInfo->DecisionRate > pRaInfo->HighestRate)
if (pRaInfo->DecisionRate > pRaInfo->HighestRate)
pRaInfo->DecisionRate = pRaInfo->HighestRate;
if ((pRaInfo->DecisionRate)==(pRaInfo->PreRate))
@ -438,7 +438,7 @@ odm_ARFBRefresh_8188E(
u4Byte MaskFromReg;
s1Byte i;
switch(pRaInfo->RateID){
switch (pRaInfo->RateID){
case RATR_INX_WIRELESS_NGB:
pRaInfo->RAUseRate=(pRaInfo->RateMask)&0x0f8ff015;
break;
@ -485,7 +485,7 @@ odm_ARFBRefresh_8188E(
if (pRaInfo->RAUseRate){
for (i=RATESIZE;i>=0;i--)
{
if((pRaInfo->RAUseRate)&BIT(i)){
if ((pRaInfo->RAUseRate)&BIT(i)){
pRaInfo->HighestRate=i;
break;
}
@ -498,7 +498,7 @@ odm_ARFBRefresh_8188E(
if (pRaInfo->RAUseRate){
for (i=0;i<RATESIZE;i++)
{
if((pRaInfo->RAUseRate)&BIT(i))
if ((pRaInfo->RAUseRate)&BIT(i))
{
pRaInfo->LowestRate=i;
break;
@ -512,9 +512,9 @@ odm_ARFBRefresh_8188E(
#if POWER_TRAINING_ACTIVE == 1
if (pRaInfo->HighestRate >0x13)
pRaInfo->PTModeSS=3;
else if(pRaInfo->HighestRate >0x0b)
else if (pRaInfo->HighestRate >0x0b)
pRaInfo->PTModeSS=2;
else if(pRaInfo->HighestRate >0x0b)
else if (pRaInfo->HighestRate >0x0b)
pRaInfo->PTModeSS=1;
else
pRaInfo->PTModeSS=0;
@ -523,7 +523,7 @@ odm_ARFBRefresh_8188E(
#endif
if(pRaInfo->DecisionRate > pRaInfo->HighestRate)
if (pRaInfo->DecisionRate > pRaInfo->HighestRate)
pRaInfo->DecisionRate = pRaInfo->HighestRate;
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
@ -572,7 +572,7 @@ odm_PTTryState_8188E(
{
if (pRaInfo->PTStage==0)
pRaInfo->PTStage=1;
else if(pRaInfo->PTStage==1)
else if (pRaInfo->PTStage==1)
pRaInfo->PTStage=3;
else
pRaInfo->PTStage=5;
@ -608,10 +608,10 @@ odm_PTDecision_8188E(
stage_BUF=pRaInfo->PTStage;
numsc = 0;
num_total= pRaInfo->TOTAL* PT_PENALTY[5];
for(j=0;j<=4;j++)
for (j=0;j<=4;j++)
{
numsc += pRaInfo->RTY[j] * PT_PENALTY[j];
if(numsc>num_total)
if (numsc>num_total)
break;
}
@ -645,10 +645,10 @@ odm_RATxRPTTimerSetting(
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,(" =====>odm_RATxRPTTimerSetting()\n"));
if(pDM_Odm->CurrminRptTime != minRptTime){
if (pDM_Odm->CurrminRptTime != minRptTime){
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
(" CurrminRptTime =0x%04x minRptTime=0x%04x\n", pDM_Odm->CurrminRptTime, minRptTime));
#if(DM_ODM_SUPPORT_TYPE & (ODM_MP|ODM_AP))
#if (DM_ODM_SUPPORT_TYPE & (ODM_MP|ODM_AP))
ODM_RA_Set_TxRPT_Time(pDM_Odm,minRptTime);
#else
rtw_rpt_timer_cfg_cmd(pDM_Odm->Adapter,minRptTime);
@ -684,16 +684,16 @@ ODM_RAInfo_Init(
#if 1
u1Byte WirelessMode=0xFF; //invalid value
u1Byte max_rate_idx = 0x13; //MCS7
if(pDM_Odm->pWirelessMode!=NULL){
if (pDM_Odm->pWirelessMode!=NULL){
WirelessMode=*(pDM_Odm->pWirelessMode);
}
if(WirelessMode != 0xFF ){
if(WirelessMode & ODM_WM_N24G)
if (WirelessMode != 0xFF ){
if (WirelessMode & ODM_WM_N24G)
max_rate_idx = 0x13;
else if(WirelessMode & ODM_WM_G)
else if (WirelessMode & ODM_WM_G)
max_rate_idx = 0x0b;
else if(WirelessMode & ODM_WM_B)
else if (WirelessMode & ODM_WM_B)
max_rate_idx = 0x03;
}
@ -755,7 +755,7 @@ ODM_RAInfo_Init_all(
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD, ("=====>\n"));
pDM_Odm->CurrminRptTime = 0;
for(MacID=0; MacID<ODM_ASSOCIATE_ENTRY_NUM; MacID++)
for (MacID=0; MacID<ODM_ASSOCIATE_ENTRY_NUM; MacID++)
ODM_RAInfo_Init(pDM_Odm,MacID);
return 0;
@ -768,7 +768,7 @@ ODM_RA_GetShortGI_8188E(
IN u1Byte MacID
)
{
if((NULL == pDM_Odm) || (MacID >= ASSOCIATE_ENTRY_NUM))
if ((NULL == pDM_Odm) || (MacID >= ASSOCIATE_ENTRY_NUM))
return 0;
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
("MacID=%d SGI=%d\n", MacID, pDM_Odm->RAInfo[MacID].RateSGI));
@ -783,7 +783,7 @@ ODM_RA_GetDecisionRate_8188E(
{
u1Byte DecisionRate = 0;
if((NULL == pDM_Odm) || (MacID >= ASSOCIATE_ENTRY_NUM))
if ((NULL == pDM_Odm) || (MacID >= ASSOCIATE_ENTRY_NUM))
return 0;
DecisionRate = (pDM_Odm->RAInfo[MacID].DecisionRate);
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
@ -798,7 +798,7 @@ ODM_RA_GetHwPwrStatus_8188E(
)
{
u1Byte PTStage = 5;
if((NULL == pDM_Odm) || (MacID >= ASSOCIATE_ENTRY_NUM))
if ((NULL == pDM_Odm) || (MacID >= ASSOCIATE_ENTRY_NUM))
return 0;
PTStage = (pDM_Odm->RAInfo[MacID].PTStage);
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
@ -820,7 +820,7 @@ ODM_RA_UpdateRateInfo_8188E(
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
("MacID=%d RateID=0x%x RateMask=0x%x SGIEnable=%d\n",
MacID, RateID, RateMask, SGIEnable));
if((NULL == pDM_Odm) || (MacID >= ASSOCIATE_ENTRY_NUM))
if ((NULL == pDM_Odm) || (MacID >= ASSOCIATE_ENTRY_NUM))
return;
pRaInfo = &(pDM_Odm->RAInfo[MacID]);
@ -841,7 +841,7 @@ ODM_RA_SetRSSI_8188E(
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_TRACE,
(" MacID=%d Rssi=%d\n", MacID, Rssi));
if((NULL == pDM_Odm) || (MacID >= ASSOCIATE_ENTRY_NUM))
if ((NULL == pDM_Odm) || (MacID >= ASSOCIATE_ENTRY_NUM))
return;
pRaInfo = &(pDM_Odm->RAInfo[MacID]);
@ -854,7 +854,7 @@ ODM_RA_Set_TxRPT_Time(
IN u2Byte minRptTime
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP))
if (minRptTime != 0xffff)
#endif
ODM_Write2Byte(pDM_Odm, REG_TX_RPT_TIME, minRptTime);
@ -884,15 +884,15 @@ ODM_RA_TxRPT2Handle_8188E(
do
{
if(MacId >= ASSOCIATE_ENTRY_NUM)
if (MacId >= ASSOCIATE_ENTRY_NUM)
valid = 0;
else if(MacId >= 32)
else if (MacId >= 32)
valid = (1<<(MacId-32)) & MacIDValidEntry1;
else
valid = (1<<MacId) & MacIDValidEntry0;
pRAInfo = &(pDM_Odm->RAInfo[MacId]);
if(valid)
if (valid)
{
#if (DM_ODM_SUPPORT_TYPE & (ODM_MP|ODM_CE))
@ -916,7 +916,7 @@ ODM_RA_TxRPT2Handle_8188E(
pRAInfo->RTY[3] + \
pRAInfo->RTY[4] + \
pRAInfo->DROP;
if(pRAInfo->TOTAL != 0)
if (pRAInfo->TOTAL != 0)
{
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
("macid=%d Total=%d R0=%d R1=%d R2=%d R3=%d R4=%d D0=%d valid0=%x valid1=%x\n",
@ -932,10 +932,10 @@ ODM_RA_TxRPT2Handle_8188E(
MacIDValidEntry1));
#if POWER_TRAINING_ACTIVE == 1
if (pRAInfo->PTActive){
if(pRAInfo->RAstage<5){
if (pRAInfo->RAstage<5){
odm_RateDecision_8188E(pDM_Odm,pRAInfo);
}
else if(pRAInfo->RAstage==5){ // Power training try state
else if (pRAInfo->RAstage==5){ // Power training try state
odm_PTTryState_8188E(pRAInfo);
}
else {// RAstage==6
@ -981,12 +981,12 @@ ODM_RA_TxRPT2Handle_8188E(
ODM_RT_TRACE(pDM_Odm,ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD, (" TOTAL=0!!!!\n"));
}
if(minRptTime > pRAInfo->RptTime)
if (minRptTime > pRAInfo->RptTime)
minRptTime = pRAInfo->RptTime;
pBuffer += TX_RPT2_ITEM_SIZE;
MacId++;
}while(MacId < ItemNum);
}while (MacId < ItemNum);
odm_RATxRPTTimerSetting(pDM_Odm,minRptTime);

View file

@ -196,7 +196,7 @@ ODM_ReadAndConfig_AGC_TAB_1T_8188E(
IN PDM_ODM_T pDM_Odm
)
{
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while (0)
u4Byte hex = 0;
u4Byte i = 0;
@ -222,8 +222,8 @@ ODM_ReadAndConfig_AGC_TAB_1T_8188E(
#ifdef CONFIG_IOL_IOREG_CFG
biol = rtw_IOL_applied(Adapter);
if(biol){
if((pxmit_frame= rtw_IOL_accquire_xmit_frame(Adapter)) == NULL){
if (biol){
if ((pxmit_frame= rtw_IOL_accquire_xmit_frame(Adapter)) == NULL){
printk("rtw_IOL_accquire_xmit_frame failed\n");
return HAL_STATUS_FAILURE;
}
@ -239,8 +239,8 @@ ODM_ReadAndConfig_AGC_TAB_1T_8188E(
if ( v1 < 0xCDCDCDCD )
{
#ifdef CONFIG_IOL_IOREG_CFG
if(biol){
if(rtw_IOL_cmd_boundary_handle(pxmit_frame))
if (biol){
if (rtw_IOL_cmd_boundary_handle(pxmit_frame))
bndy_cnt++;
rtw_IOL_append_WD_cmd(pxmit_frame,(u2Byte)v1, v2,bMaskDWord);
}
@ -272,8 +272,8 @@ ODM_ReadAndConfig_AGC_TAB_1T_8188E(
v2 != 0xCDCD && i < ArrayLen -2)
{
#ifdef CONFIG_IOL_IOREG_CFG
if(biol){
if(rtw_IOL_cmd_boundary_handle(pxmit_frame))
if (biol){
if (rtw_IOL_cmd_boundary_handle(pxmit_frame))
bndy_cnt++;
rtw_IOL_append_WD_cmd(pxmit_frame,(u2Byte)v1, v2,bMaskDWord);
}
@ -294,9 +294,9 @@ ODM_ReadAndConfig_AGC_TAB_1T_8188E(
}
}
#ifdef CONFIG_IOL_IOREG_CFG
if(biol){
if (biol){
//printk("==> %s, pktlen = %d,bndy_cnt = %d\n",__FUNCTION__,pxmit_frame->attrib.pktlen+4+32,bndy_cnt);
if(rtw_IOL_exec_cmds_sync(pDM_Odm->Adapter, pxmit_frame, 1000, bndy_cnt))
if (rtw_IOL_exec_cmds_sync(pDM_Odm->Adapter, pxmit_frame, 1000, bndy_cnt))
{
#ifdef CONFIG_IOL_IOREG_CFG_DBG
printk("~~~ %s Success !!! \n",__FUNCTION__);
@ -527,7 +527,7 @@ ODM_ReadAndConfig_PHY_REG_1T_8188E(
IN PDM_ODM_T pDM_Odm
)
{
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while (0)
u4Byte hex = 0;
u4Byte i = 0;
@ -556,8 +556,8 @@ ODM_ReadAndConfig_PHY_REG_1T_8188E(
#ifdef CONFIG_IOL_IOREG_CFG
biol = rtw_IOL_applied(Adapter);
if(biol){
if((pxmit_frame=rtw_IOL_accquire_xmit_frame(Adapter)) == NULL)
if (biol){
if ((pxmit_frame=rtw_IOL_accquire_xmit_frame(Adapter)) == NULL)
{
printk("rtw_IOL_accquire_xmit_frame failed\n");
return HAL_STATUS_FAILURE;
@ -575,8 +575,8 @@ ODM_ReadAndConfig_PHY_REG_1T_8188E(
if ( v1 < 0xCDCDCDCD )
{
#ifdef CONFIG_IOL_IOREG_CFG
if(biol){
if(rtw_IOL_cmd_boundary_handle(pxmit_frame))
if (biol){
if (rtw_IOL_cmd_boundary_handle(pxmit_frame))
bndy_cnt++;
@ -638,8 +638,8 @@ ODM_ReadAndConfig_PHY_REG_1T_8188E(
v2 != 0xCDCD && i < ArrayLen -2)
{
#ifdef CONFIG_IOL_IOREG_CFG
if(biol){
if(rtw_IOL_cmd_boundary_handle(pxmit_frame))
if (biol){
if (rtw_IOL_cmd_boundary_handle(pxmit_frame))
bndy_cnt++;
if (v1 == 0xfe){
rtw_IOL_append_DELAY_MS_cmd(pxmit_frame,50);
@ -688,9 +688,9 @@ ODM_ReadAndConfig_PHY_REG_1T_8188E(
}
}
#ifdef CONFIG_IOL_IOREG_CFG
if(biol){
if (biol){
//printk("==> %s, pktlen = %d,bndy_cnt = %d\n",__FUNCTION__,pxmit_frame->attrib.pktlen+4+32,bndy_cnt);
if(rtw_IOL_exec_cmds_sync(pDM_Odm->Adapter, pxmit_frame, 1000, bndy_cnt))
if (rtw_IOL_exec_cmds_sync(pDM_Odm->Adapter, pxmit_frame, 1000, bndy_cnt))
{
#ifdef CONFIG_IOL_IOREG_CFG_DBG
printk("~~~ %s IOL_exec_cmds Success !!! \n",__FUNCTION__);
@ -699,17 +699,17 @@ ODM_ReadAndConfig_PHY_REG_1T_8188E(
u4Byte cdata;
printk(" %s data compare => array_len:%d \n",__FUNCTION__,cmpdata_idx);
printk("### %s data compared !!###\n",__FUNCTION__);
for(idx=0;idx< cmpdata_idx;idx++)
for (idx=0;idx< cmpdata_idx;idx++)
{
cdata = ODM_Read4Byte(pDM_Odm, cmpdata[idx].addr);
if(cdata != cmpdata[idx].value){
if (cdata != cmpdata[idx].value){
printk(" addr:0x%04x, data:(0x%02x : 0x%02x) \n",
cmpdata[idx].addr,cmpdata[idx].value,cdata);
rst = HAL_STATUS_FAILURE;
}
}
printk("### %s data compared !!###\n",__FUNCTION__);
//if(rst == HAL_STATUS_FAILURE)
//if (rst == HAL_STATUS_FAILURE)
{//dump data from TX packet buffer
rtw_IOL_cmd_tx_pkt_buf_dump(pDM_Odm->Adapter,pxmit_frame->attrib.pktlen+32);
}

View file

@ -23,7 +23,7 @@
#include "../odm_precomp.h"
#if (RTL8188E_SUPPORT == 1)
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP))
u1Byte Array_8188E_FW_AP[] = {

View file

@ -156,7 +156,7 @@ ODM_ReadAndConfig_MAC_REG_8188E(
IN PDM_ODM_T pDM_Odm
)
{
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while (0)
u4Byte hex = 0;
u4Byte i = 0;
@ -187,8 +187,8 @@ ODM_ReadAndConfig_MAC_REG_8188E(
#ifdef CONFIG_IOL_IOREG_CFG
biol = rtw_IOL_applied(Adapter);
if(biol){
if((pxmit_frame=rtw_IOL_accquire_xmit_frame(Adapter)) == NULL)
if (biol){
if ((pxmit_frame=rtw_IOL_accquire_xmit_frame(Adapter)) == NULL)
{
printk("rtw_IOL_accquire_xmit_frame failed\n");
return HAL_STATUS_FAILURE;
@ -207,9 +207,9 @@ ODM_ReadAndConfig_MAC_REG_8188E(
{
#ifdef CONFIG_IOL_IOREG_CFG
if(biol){
if (biol){
if(rtw_IOL_cmd_boundary_handle(pxmit_frame))
if (rtw_IOL_cmd_boundary_handle(pxmit_frame))
bndy_cnt++;
rtw_IOL_append_WB_cmd(pxmit_frame,(u2Byte)v1, (u1Byte)v2,0xFF);
#ifdef CONFIG_IOL_IOREG_CFG_DBG
@ -246,8 +246,8 @@ ODM_ReadAndConfig_MAC_REG_8188E(
v2 != 0xCDCD && i < ArrayLen -2)
{
#ifdef CONFIG_IOL_IOREG_CFG
if(biol){
if(rtw_IOL_cmd_boundary_handle(pxmit_frame))
if (biol){
if (rtw_IOL_cmd_boundary_handle(pxmit_frame))
bndy_cnt++;
rtw_IOL_append_WB_cmd(pxmit_frame,(u2Byte)v1, (u1Byte)v2,0xFF);
#ifdef CONFIG_IOL_IOREG_CFG_DBG
@ -275,10 +275,10 @@ ODM_ReadAndConfig_MAC_REG_8188E(
}
#ifdef CONFIG_IOL_IOREG_CFG
if(biol){
if (biol){
//printk("==> %s, pktlen = %d,bndy_cnt = %d\n",__FUNCTION__,pxmit_frame->attrib.pktlen+4+32,bndy_cnt);
if(rtw_IOL_exec_cmds_sync(pDM_Odm->Adapter, pxmit_frame, 1000, bndy_cnt))
if (rtw_IOL_exec_cmds_sync(pDM_Odm->Adapter, pxmit_frame, 1000, bndy_cnt))
{
#ifdef CONFIG_IOL_IOREG_CFG_DBG
printk("~~~ IOL Config MAC Success !!! \n");
@ -288,10 +288,10 @@ ODM_ReadAndConfig_MAC_REG_8188E(
u1Byte cdata;
// HAL_STATUS_FAILURE;
printk(" MAC data compare => array_len:%d \n",cmpdata_idx);
for(idx=0;idx< cmpdata_idx;idx++)
for (idx=0;idx< cmpdata_idx;idx++)
{
cdata = ODM_Read1Byte(pDM_Odm, cmpdata[idx].addr);
if(cdata != cmpdata[idx].value){
if (cdata != cmpdata[idx].value){
printk("### MAC data compared failed !! addr:0x%04x, data:(0x%02x : 0x%02x) ###\n",
cmpdata[idx].addr,cmpdata[idx].value,cdata);
//rst = HAL_STATUS_FAILURE;
@ -300,7 +300,7 @@ ODM_ReadAndConfig_MAC_REG_8188E(
//dump data from TX packet buffer
//if(rst == HAL_STATUS_FAILURE)
//if (rst == HAL_STATUS_FAILURE)
{
rtw_IOL_cmd_tx_pkt_buf_dump(pDM_Odm->Adapter,pxmit_frame->attrib.pktlen+32);
}

View file

@ -167,7 +167,7 @@ ODM_ReadAndConfig_RadioA_1T_8188E(
IN PDM_ODM_T pDM_Odm
)
{
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while (0)
u4Byte hex = 0;
u4Byte i = 0;
@ -197,8 +197,8 @@ ODM_ReadAndConfig_RadioA_1T_8188E(
#ifdef CONFIG_IOL_IOREG_CFG
biol = rtw_IOL_applied(Adapter);
if(biol){
if((pxmit_frame=rtw_IOL_accquire_xmit_frame(Adapter)) == NULL)
if (biol){
if ((pxmit_frame=rtw_IOL_accquire_xmit_frame(Adapter)) == NULL)
{
printk("rtw_IOL_accquire_xmit_frame failed\n");
return HAL_STATUS_FAILURE;
@ -215,11 +215,11 @@ ODM_ReadAndConfig_RadioA_1T_8188E(
if ( v1 < 0xCDCDCDCD )
{
#ifdef CONFIG_IOL_IOREG_CFG
if(biol){
if(rtw_IOL_cmd_boundary_handle(pxmit_frame))
if (biol){
if (rtw_IOL_cmd_boundary_handle(pxmit_frame))
bndy_cnt++;
if(v1 == 0xffe)
if (v1 == 0xffe)
{
rtw_IOL_append_DELAY_MS_cmd(pxmit_frame,50);
}
@ -276,11 +276,11 @@ ODM_ReadAndConfig_RadioA_1T_8188E(
v2 != 0xCDCD && i < ArrayLen -2)
{
#ifdef CONFIG_IOL_IOREG_CFG
if(biol){
if(rtw_IOL_cmd_boundary_handle(pxmit_frame))
if (biol){
if (rtw_IOL_cmd_boundary_handle(pxmit_frame))
bndy_cnt++;
if(v1 == 0xffe)
if (v1 == 0xffe)
{
rtw_IOL_append_DELAY_MS_cmd(pxmit_frame,50);
}
@ -327,9 +327,9 @@ ODM_ReadAndConfig_RadioA_1T_8188E(
}
}
#ifdef CONFIG_IOL_IOREG_CFG
if(biol){
if (biol){
//printk("==> %s, pktlen = %d,bndy_cnt = %d\n",__FUNCTION__,pxmit_frame->attrib.pktlen+4+32,bndy_cnt);
if(rtw_IOL_exec_cmds_sync(pDM_Odm->Adapter, pxmit_frame, 1000, bndy_cnt))
if (rtw_IOL_exec_cmds_sync(pDM_Odm->Adapter, pxmit_frame, 1000, bndy_cnt))
{
#ifdef CONFIG_IOL_IOREG_CFG_DBG
printk("~~~ %s Success !!! \n",__FUNCTION__);
@ -338,17 +338,17 @@ ODM_ReadAndConfig_RadioA_1T_8188E(
u4Byte cdata;
printk(" %s data compare => array_len:%d \n",__FUNCTION__,cmpdata_idx);
printk("### %s data compared !!###\n",__FUNCTION__);
for(idx=0;idx< cmpdata_idx;idx++)
for (idx=0;idx< cmpdata_idx;idx++)
{
cdata = ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A,cmpdata[idx].addr,bRFRegOffsetMask);
if(cdata != cmpdata[idx].value){
if (cdata != cmpdata[idx].value){
printk("addr:0x%04x, data:(0x%02x : 0x%02x) \n",
cmpdata[idx].addr,cmpdata[idx].value,cdata);
rst = HAL_STATUS_FAILURE;
}
}
printk("### %s data compared !!###\n",__FUNCTION__);
//if(rst == HAL_STATUS_FAILURE)
//if (rst == HAL_STATUS_FAILURE)
{//dump data from TX packet buffer
rtw_IOL_cmd_tx_pkt_buf_dump(pDM_Odm->Adapter,pxmit_frame->attrib.pktlen+32);
}

View file

@ -20,7 +20,7 @@
#include "odm_precomp.h"
#if(DM_ODM_SUPPORT_TYPE & ODM_MP)
#if (DM_ODM_SUPPORT_TYPE & ODM_MP)
#include "Mp_Precomp.h"
VOID
@ -54,7 +54,7 @@ phy_PathA_IQK_8192C(
//path-A IQK setting
RTPRINT(FINIT, INIT_IQK, ("Path-A IQK setting!\n"));
if(pAdapter->interfaceIndex == 0)
if (pAdapter->interfaceIndex == 0)
{
PHY_SetBBReg(pAdapter, rTx_IQK_Tone_A, bMaskDWord, 0x10008c1f);
PHY_SetBBReg(pAdapter, rRx_IQK_Tone_A, bMaskDWord, 0x10008c1f);
@ -71,12 +71,12 @@ phy_PathA_IQK_8192C(
IS_81xxC_VENDOR_UMC_B_CUT(pHalData->VersionID)?0x28160202:0x28160502);
//path-B IQK setting
if(configPathB)
if (configPathB)
{
PHY_SetBBReg(pAdapter, rTx_IQK_Tone_B, bMaskDWord, 0x10008c22);
PHY_SetBBReg(pAdapter, rRx_IQK_Tone_B, bMaskDWord, 0x10008c22);
PHY_SetBBReg(pAdapter, rTx_IQK_PI_B, bMaskDWord, 0x82140102);
if(IS_HARDWARE_TYPE_8192D(pAdapter))
if (IS_HARDWARE_TYPE_8192D(pAdapter))
PHY_SetBBReg(pAdapter, rRx_IQK_PI_B, bMaskDWord, 0x28160206);
else
PHY_SetBBReg(pAdapter, rRx_IQK_PI_B, bMaskDWord, 0x28160202);
@ -84,7 +84,7 @@ phy_PathA_IQK_8192C(
//LO calibration setting
RTPRINT(FINIT, INIT_IQK, ("LO calibration setting!\n"));
if(IS_HARDWARE_TYPE_8192D(pAdapter))
if (IS_HARDWARE_TYPE_8192D(pAdapter))
PHY_SetBBReg(pAdapter, rIQK_AGC_Rsp, bMaskDWord, 0x00462911);
else
PHY_SetBBReg(pAdapter, rIQK_AGC_Rsp, bMaskDWord, 0x001028d1);
@ -108,14 +108,14 @@ phy_PathA_IQK_8192C(
regEA4= PHY_QueryBBReg(pAdapter, rRx_Power_Before_IQK_A_2, bMaskDWord);
RTPRINT(FINIT, INIT_IQK, ("0xea4 = 0x%x\n", regEA4));
if(!(regEAC & BIT28) &&
if (!(regEAC & BIT28) &&
(((regE94 & 0x03FF0000)>>16) != 0x142) &&
(((regE9C & 0x03FF0000)>>16) != 0x42) )
result |= 0x01;
else //if Tx not OK, ignore Rx
return result;
if(!(regEAC & BIT27) && //if Tx is OK, check whether Rx is OK
if (!(regEAC & BIT27) && //if Tx is OK, check whether Rx is OK
(((regEA4 & 0x03FF0000)>>16) != 0x132) &&
(((regEAC & 0x03FF0000)>>16) != 0x36))
result |= 0x02;
@ -157,14 +157,14 @@ phy_PathB_IQK_8192C(
regECC= PHY_QueryBBReg(pAdapter, rRx_Power_After_IQK_B_2, bMaskDWord);
RTPRINT(FINIT, INIT_IQK, ("0xecc = 0x%x\n", regECC));
if(!(regEAC & BIT31) &&
if (!(regEAC & BIT31) &&
(((regEB4 & 0x03FF0000)>>16) != 0x142) &&
(((regEBC & 0x03FF0000)>>16) != 0x42))
result |= 0x01;
else
return result;
if(!(regEAC & BIT30) &&
if (!(regEAC & BIT30) &&
(((regEC4 & 0x03FF0000)>>16) != 0x132) &&
(((regECC & 0x03FF0000)>>16) != 0x36))
result |= 0x02;
@ -191,10 +191,10 @@ phy_PathAFillIQKMatrix(
RTPRINT(FINIT, INIT_IQK, ("Path A IQ Calibration %s !\n",(bIQKOK)?"Success":"Failed"));
if(final_candidate == 0xFF)
if (final_candidate == 0xFF)
return;
else if(bIQKOK)
else if (bIQKOK)
{
Oldval_0 = (PHY_QueryBBReg(pAdapter, rOFDM0_XATxIQImbalance, bMaskDWord) >> 22) & 0x3FF;
@ -204,7 +204,7 @@ phy_PathAFillIQKMatrix(
TX0_A = (X * Oldval_0) >> 8;
RTPRINT(FINIT, INIT_IQK, ("X = 0x%x, TX0_A = 0x%x, Oldval_0 0x%x\n", X, TX0_A, Oldval_0));
PHY_SetBBReg(pAdapter, rOFDM0_XATxIQImbalance, 0x3FF, TX0_A);
if(IS_HARDWARE_TYPE_8192D(pAdapter))
if (IS_HARDWARE_TYPE_8192D(pAdapter))
PHY_SetBBReg(pAdapter, rOFDM0_ECCAThreshold, BIT24, ((X* Oldval_0>>7) & 0x1));
else
PHY_SetBBReg(pAdapter, rOFDM0_ECCAThreshold, BIT(31), ((X* Oldval_0>>7) & 0x1));
@ -214,19 +214,19 @@ phy_PathAFillIQKMatrix(
Y = Y | 0xFFFFFC00;
//path B IQK result + 3
if(pAdapter->interfaceIndex == 1 && pHalData->CurrentBandType92D == BAND_ON_5G)
if (pAdapter->interfaceIndex == 1 && pHalData->CurrentBandType92D == BAND_ON_5G)
Y += 3;
TX0_C = (Y * Oldval_0) >> 8;
RTPRINT(FINIT, INIT_IQK, ("Y = 0x%x, TX = 0x%x\n", Y, TX0_C));
PHY_SetBBReg(pAdapter, rOFDM0_XCTxAFE, 0xF0000000, ((TX0_C&0x3C0)>>6));
PHY_SetBBReg(pAdapter, rOFDM0_XATxIQImbalance, 0x003F0000, (TX0_C&0x3F));
if(IS_HARDWARE_TYPE_8192D(pAdapter)/*&&is2T*/)
if (IS_HARDWARE_TYPE_8192D(pAdapter)/*&&is2T*/)
PHY_SetBBReg(pAdapter, rOFDM0_ECCAThreshold, BIT26, ((Y* Oldval_0>>7) & 0x1));
else
PHY_SetBBReg(pAdapter, rOFDM0_ECCAThreshold, BIT(29), ((Y* Oldval_0>>7) & 0x1));
if(bTxOnly)
if (bTxOnly)
{
RTPRINT(FINIT, INIT_IQK, ("phy_PathAFillIQKMatrix only Tx OK\n"));
return;
@ -258,10 +258,10 @@ phy_PathBFillIQKMatrix(
RTPRINT(FINIT, INIT_IQK, ("Path B IQ Calibration %s !\n",(bIQKOK)?"Success":"Failed"));
if(final_candidate == 0xFF)
if (final_candidate == 0xFF)
return;
else if(bIQKOK)
else if (bIQKOK)
{
Oldval_1 = (PHY_QueryBBReg(pAdapter, rOFDM0_XBTxIQImbalance, bMaskDWord) >> 22) & 0x3FF;
@ -271,7 +271,7 @@ phy_PathBFillIQKMatrix(
TX1_A = (X * Oldval_1) >> 8;
RTPRINT(FINIT, INIT_IQK, ("X = 0x%x, TX1_A = 0x%x\n", X, TX1_A));
PHY_SetBBReg(pAdapter, rOFDM0_XBTxIQImbalance, 0x3FF, TX1_A);
if(IS_HARDWARE_TYPE_8192D(pAdapter))
if (IS_HARDWARE_TYPE_8192D(pAdapter))
PHY_SetBBReg(pAdapter, rOFDM0_ECCAThreshold, BIT28, ((X* Oldval_1>>7) & 0x1));
else
PHY_SetBBReg(pAdapter, rOFDM0_ECCAThreshold, BIT(27), ((X* Oldval_1>>7) & 0x1));
@ -279,18 +279,18 @@ phy_PathBFillIQKMatrix(
Y = result[final_candidate][5];
if ((Y & 0x00000200) != 0)
Y = Y | 0xFFFFFC00;
if(pHalData->CurrentBandType92D == BAND_ON_5G)
if (pHalData->CurrentBandType92D == BAND_ON_5G)
Y += 3; //temp modify for preformance
TX1_C = (Y * Oldval_1) >> 8;
RTPRINT(FINIT, INIT_IQK, ("Y = 0x%x, TX1_C = 0x%x\n", Y, TX1_C));
PHY_SetBBReg(pAdapter, rOFDM0_XDTxAFE, 0xF0000000, ((TX1_C&0x3C0)>>6));
PHY_SetBBReg(pAdapter, rOFDM0_XBTxIQImbalance, 0x003F0000, (TX1_C&0x3F));
if(IS_HARDWARE_TYPE_8192D(pAdapter))
if (IS_HARDWARE_TYPE_8192D(pAdapter))
PHY_SetBBReg(pAdapter, rOFDM0_ECCAThreshold, BIT30, ((Y* Oldval_1>>7) & 0x1));
else
PHY_SetBBReg(pAdapter, rOFDM0_ECCAThreshold, BIT(25), ((Y* Oldval_1>>7) & 0x1));
if(bTxOnly)
if (bTxOnly)
return;
reg = result[final_candidate][6];
@ -318,21 +318,21 @@ phy_SimularityCompare_92C(
u1Byte final_candidate[2] = {0xFF, 0xFF}; //for path A and path B
BOOLEAN bResult = TRUE, is2T = IS_92C_SERIAL( pHalData->VersionID);
if(is2T)
if (is2T)
bound = 8;
else
bound = 4;
SimularityBitMap = 0;
for( i = 0; i < bound; i++ )
for ( i = 0; i < bound; i++ )
{
diff = (result[c1][i] > result[c2][i]) ? (result[c1][i] - result[c2][i]) : (result[c2][i] - result[c1][i]);
if (diff > MAX_TOLERANCE)
{
if((i == 2 || i == 6) && !SimularityBitMap)
if ((i == 2 || i == 6) && !SimularityBitMap)
{
if(result[c1][i]+result[c1][i+1] == 0)
if (result[c1][i]+result[c1][i+1] == 0)
final_candidate[(i/4)] = c2;
else if (result[c2][i]+result[c2][i+1] == 0)
final_candidate[(i/4)] = c1;
@ -346,11 +346,11 @@ phy_SimularityCompare_92C(
if ( SimularityBitMap == 0)
{
for( i = 0; i < (bound/4); i++ )
for ( i = 0; i < (bound/4); i++ )
{
if(final_candidate[i] != 0xFF)
if (final_candidate[i] != 0xFF)
{
for( j = i*4; j < (i+1)*4-2; j++)
for ( j = i*4; j < (i+1)*4-2; j++)
result[3][j] = result[final_candidate[i]][j];
bResult = FALSE;
}
@ -359,13 +359,13 @@ phy_SimularityCompare_92C(
}
else if (!(SimularityBitMap & 0x0F)) //path A OK
{
for(i = 0; i < 4; i++)
for (i = 0; i < 4; i++)
result[3][i] = result[c1][i];
return FALSE;
}
else if (!(SimularityBitMap & 0xF0) && is2T) //path B OK
{
for(i = 4; i < 8; i++)
for (i = 4; i < 8; i++)
result[3][i] = result[c1][i];
return FALSE;
}
@ -385,7 +385,7 @@ phy_SimularityCompare(
IN u1Byte c2
)
{
if(IS_HARDWARE_TYPE_8192D(pAdapter))
if (IS_HARDWARE_TYPE_8192D(pAdapter))
return phy_SimularityCompare_92D(pAdapter, result, c1, c2);
else
return phy_SimularityCompare_92C(pAdapter, result, c1, c2);
@ -449,7 +449,7 @@ phy_IQCalibrate_8192C(
u4Byte bbvalue;
if(t==0)
if (t==0)
{
bbvalue = PHY_QueryBBReg(pAdapter, rFPGA0_RFMOD, bMaskDWord);
RTPRINT(FINIT, INIT_IQK, ("phy_IQCalibrate_8192C()==>0x%08x\n",bbvalue));
@ -459,7 +459,7 @@ phy_IQCalibrate_8192C(
// Save ADDA parameters, turn Path A ADDA on
phy_SaveADDARegisters(pAdapter, ADDA_REG, pHalData->ADDA_backup, IQK_ADDA_REG_NUM);
phy_SaveMACRegisters(pAdapter, IQK_MAC_REG, pHalData->IQK_MAC_backup);
if(IS_HARDWARE_TYPE_8192D(pAdapter))
if (IS_HARDWARE_TYPE_8192D(pAdapter))
phy_SaveADDARegisters(pAdapter, IQK_BB_REG_92D, pHalData->IQK_BB_backup, IQK_BB_REG_NUM_92D);
else
phy_SaveADDARegisters(pAdapter, IQK_BB_REG_92C, pHalData->IQK_BB_backup, IQK_BB_REG_NUM);
@ -469,7 +469,7 @@ phy_IQCalibrate_8192C(
if(IS_HARDWARE_TYPE_8192D(pAdapter)){
if (IS_HARDWARE_TYPE_8192D(pAdapter)){
//==============================
//3 Path Diversity
////Neil Chen--2011--05--20
@ -477,7 +477,7 @@ phy_IQCalibrate_8192C(
//rfPathSwitch = (u1Byte) DataB30;
rfPathSwitch = rfPathSwitch&(0x01);
if(rfPathSwitch) // Path Div On
if (rfPathSwitch) // Path Div On
{
phy_PathADDAOn(pAdapter, ADDA_REG, TRUE, is2T);
//DbgPrint("=STEP= change ADDA Path from B to A Path\n");
@ -492,12 +492,12 @@ phy_IQCalibrate_8192C(
PHY_SetBBReg(pAdapter, rPdp_AntA, bMaskDWord, 0x01017038);
}
if(t==0)
if (t==0)
{
pHalData->bRfPiEnable = (u1Byte)PHY_QueryBBReg(pAdapter, rFPGA0_XA_HSSIParameter1, BIT(8));
}
if(!pHalData->bRfPiEnable){
if (!pHalData->bRfPiEnable){
// Switch BB to PI mode to do IQ Calibration.
phy_PIModeSwitch(pAdapter, TRUE);
}
@ -506,7 +506,7 @@ phy_IQCalibrate_8192C(
PHY_SetBBReg(pAdapter, rOFDM0_TRxPathEnable, bMaskDWord, 0x03a05600);
PHY_SetBBReg(pAdapter, rOFDM0_TRMuxPar, bMaskDWord, 0x000800e4);
PHY_SetBBReg(pAdapter, rFPGA0_XCD_RFInterfaceSW, bMaskDWord, 0x22204000);
if(IS_HARDWARE_TYPE_8192D(pAdapter))
if (IS_HARDWARE_TYPE_8192D(pAdapter))
PHY_SetBBReg(pAdapter, rFPGA0_AnalogParameter4, 0xf00000, 0x0f);
else
{
@ -516,7 +516,7 @@ phy_IQCalibrate_8192C(
PHY_SetBBReg(pAdapter, rFPGA0_XB_RFInterfaceOE, BIT10, 0x00);
}
if(is2T)
if (is2T)
{
PHY_SetBBReg(pAdapter, rFPGA0_XA_LSSIParameter, bMaskDWord, 0x00010000);
PHY_SetBBReg(pAdapter, rFPGA0_XB_LSSIParameter, bMaskDWord, 0x00010000);
@ -525,11 +525,11 @@ phy_IQCalibrate_8192C(
//MAC settings
phy_MACSettingCalibration(pAdapter, IQK_MAC_REG, pHalData->IQK_MAC_backup);
if(IS_HARDWARE_TYPE_8192D(pAdapter))
if (IS_HARDWARE_TYPE_8192D(pAdapter))
{
PHY_SetBBReg(pAdapter, rConfig_AntA, bMaskDWord, 0x0f600000);
if(is2T)
if (is2T)
{
PHY_SetBBReg(pAdapter, rConfig_AntB, bMaskDWord, 0x0f600000);
}
@ -539,7 +539,7 @@ phy_IQCalibrate_8192C(
//Page B init
PHY_SetBBReg(pAdapter, rConfig_AntA, bMaskDWord, 0x00080000);
if(is2T)
if (is2T)
{
PHY_SetBBReg(pAdapter, rConfig_AntB, bMaskDWord, 0x00080000);
}
@ -550,9 +550,9 @@ phy_IQCalibrate_8192C(
PHY_SetBBReg(pAdapter, rTx_IQK, bMaskDWord, 0x01007c00);
PHY_SetBBReg(pAdapter, rRx_IQK, bMaskDWord, 0x01004800);
for(i = 0 ; i < retryCount ; i++){
for (i = 0 ; i < retryCount ; i++){
PathAOK = phy_PathA_IQK_8192C(pAdapter, is2T);
if(PathAOK == 0x03){
if (PathAOK == 0x03){
RTPRINT(FINIT, INIT_IQK, ("Path A IQK Success!!\n"));
result[t][0] = (PHY_QueryBBReg(pAdapter, rTx_Power_Before_IQK_A, bMaskDWord)&0x3FF0000)>>16;
result[t][1] = (PHY_QueryBBReg(pAdapter, rTx_Power_After_IQK_A, bMaskDWord)&0x3FF0000)>>16;
@ -569,19 +569,19 @@ phy_IQCalibrate_8192C(
}
}
if(0x00 == PathAOK){
if (0x00 == PathAOK){
RTPRINT(FINIT, INIT_IQK, ("Path A IQK failed!!\n"));
}
if(is2T){
if (is2T){
phy_PathAStandBy(pAdapter);
// Turn Path B ADDA on
phy_PathADDAOn(pAdapter, ADDA_REG, FALSE, is2T);
for(i = 0 ; i < retryCount ; i++){
for (i = 0 ; i < retryCount ; i++){
PathBOK = phy_PathB_IQK_8192C(pAdapter);
if(PathBOK == 0x03){
if (PathBOK == 0x03){
RTPRINT(FINIT, INIT_IQK, ("Path B IQK Success!!\n"));
result[t][4] = (PHY_QueryBBReg(pAdapter, rTx_Power_Before_IQK_B, bMaskDWord)&0x3FF0000)>>16;
result[t][5] = (PHY_QueryBBReg(pAdapter, rTx_Power_After_IQK_B, bMaskDWord)&0x3FF0000)>>16;
@ -597,7 +597,7 @@ phy_IQCalibrate_8192C(
}
}
if(0x00 == PathBOK){
if (0x00 == PathBOK){
RTPRINT(FINIT, INIT_IQK, ("Path B IQK failed!!\n"));
}
}
@ -606,9 +606,9 @@ phy_IQCalibrate_8192C(
RTPRINT(FINIT, INIT_IQK, ("IQK:Back to BB mode, load original value!\n"));
PHY_SetBBReg(pAdapter, rFPGA0_IQK, bMaskDWord, 0);
if(t!=0)
if (t!=0)
{
if(!pHalData->bRfPiEnable){
if (!pHalData->bRfPiEnable){
// Switch back BB to SI mode after finish IQ Calibration.
phy_PIModeSwitch(pAdapter, FALSE);
}
@ -620,9 +620,9 @@ phy_IQCalibrate_8192C(
phy_ReloadMACRegisters(pAdapter, IQK_MAC_REG, pHalData->IQK_MAC_backup);
// Reload BB parameters
if(IS_HARDWARE_TYPE_8192D(pAdapter))
if (IS_HARDWARE_TYPE_8192D(pAdapter))
{
if(is2T)
if (is2T)
phy_ReloadADDARegisters(pAdapter, IQK_BB_REG_92D, pHalData->IQK_BB_backup, IQK_BB_REG_NUM_92D);
else
phy_ReloadADDARegisters(pAdapter, IQK_BB_REG_92D, pHalData->IQK_BB_backup, IQK_BB_REG_NUM_92D -1);
@ -630,11 +630,11 @@ phy_IQCalibrate_8192C(
else
phy_ReloadADDARegisters(pAdapter, IQK_BB_REG_92C, pHalData->IQK_BB_backup, IQK_BB_REG_NUM);
if(!IS_HARDWARE_TYPE_8192D(pAdapter))
if (!IS_HARDWARE_TYPE_8192D(pAdapter))
{
// Restore RX initial gain
PHY_SetBBReg(pAdapter, rFPGA0_XA_LSSIParameter, bMaskDWord, 0x00032ed3);
if(is2T){
if (is2T){
PHY_SetBBReg(pAdapter, rFPGA0_XB_LSSIParameter, bMaskDWord, 0x00032ed3);
}
}
@ -661,19 +661,19 @@ phy_LCCalibrate92C(
//Check continuous TX and Packet TX
tmpReg = PlatformEFIORead1Byte(pAdapter, 0xd03);
if((tmpReg&0x70) != 0) //Deal with contisuous TX case
if ((tmpReg&0x70) != 0) //Deal with contisuous TX case
PlatformEFIOWrite1Byte(pAdapter, 0xd03, tmpReg&0x8F); //disable all continuous TX
else // Deal with Packet TX case
PlatformEFIOWrite1Byte(pAdapter, REG_TXPAUSE, 0xFF); // block all queues
if((tmpReg&0x70) != 0)
if ((tmpReg&0x70) != 0)
{
//1. Read original RF mode
//Path-A
RF_Amode = PHY_QueryRFReg(pAdapter, RF_PATH_A, RF_AC, bMask12Bits);
//Path-B
if(is2T)
if (is2T)
RF_Bmode = PHY_QueryRFReg(pAdapter, RF_PATH_B, RF_AC, bMask12Bits);
//2. Set RF mode = standby mode
@ -681,7 +681,7 @@ phy_LCCalibrate92C(
PHY_SetRFReg(pAdapter, RF_PATH_A, RF_AC, bMask12Bits, (RF_Amode&0x8FFFF)|0x10000);
//Path-B
if(is2T)
if (is2T)
PHY_SetRFReg(pAdapter, RF_PATH_B, RF_AC, bMask12Bits, (RF_Bmode&0x8FFFF)|0x10000);
}
@ -695,14 +695,14 @@ phy_LCCalibrate92C(
//Restore original situation
if((tmpReg&0x70) != 0) //Deal with contisuous TX case
if ((tmpReg&0x70) != 0) //Deal with contisuous TX case
{
//Path-A
PlatformEFIOWrite1Byte(pAdapter, 0xd03, tmpReg);
PHY_SetRFReg(pAdapter, RF_PATH_A, RF_AC, bMask12Bits, RF_Amode);
//Path-B
if(is2T)
if (is2T)
PHY_SetRFReg(pAdapter, RF_PATH_B, RF_AC, bMask12Bits, RF_Bmode);
}
else // Deal with Packet TX case
@ -718,7 +718,7 @@ phy_LCCalibrate(
IN BOOLEAN is2T
)
{
if(IS_HARDWARE_TYPE_8192D(pAdapter))
if (IS_HARDWARE_TYPE_8192D(pAdapter))
{
#if SWLCK == 1
phy_LCCalibrate92DSW(pAdapter, is2T);
@ -858,7 +858,7 @@ if (pAdapter->registrypriv.mp_mode == 1)
RTPRINT(FINIT, INIT_IQK, ("==>phy_APCalibrate_8192C() delta %d\n", delta));
RTPRINT(FINIT, INIT_IQK, ("AP Calibration for %s\n", (is2T ? "2T2R" : "1T1R")));
if(!is2T)
if (!is2T)
pathbound = 1;
//2 FOR NORMAL CHIP SETTINGS
@ -875,16 +875,16 @@ if (pAdapter->registrypriv.mp_mode == 1)
return;
//settings adjust for normal chip
for(index = 0; index < PATH_NUM; index ++)
for (index = 0; index < PATH_NUM; index ++)
{
APK_offset[index] = APK_normal_offset[index];
APK_value[index] = APK_normal_value[index];
AFE_on_off[index] = 0x6fdb25a4;
}
for(index = 0; index < APK_BB_REG_NUM; index ++)
for (index = 0; index < APK_BB_REG_NUM; index ++)
{
for(path = 0; path < pathbound; path++)
for (path = 0; path < pathbound; path++)
{
APK_RF_init_value[path][index] = APK_normal_RF_init_value[path][index];
APK_RF_value_0[path][index] = APK_normal_RF_value_0[path][index];
@ -895,9 +895,9 @@ if (pAdapter->registrypriv.mp_mode == 1)
apkbound = 6;
//save BB default value
for(index = 0; index < APK_BB_REG_NUM ; index++)
for (index = 0; index < APK_BB_REG_NUM ; index++)
{
if(index == 0) //skip
if (index == 0) //skip
continue;
BB_backup[index] = PHY_QueryBBReg(pAdapter, BB_REG[index], bMaskDWord);
}
@ -908,17 +908,17 @@ if (pAdapter->registrypriv.mp_mode == 1)
//save AFE default value
phy_SaveADDARegisters(pAdapter, AFE_REG, AFE_backup, IQK_ADDA_REG_NUM);
for(path = 0; path < pathbound; path++)
for (path = 0; path < pathbound; path++)
{
if(path == RF_PATH_A)
if (path == RF_PATH_A)
{
//path A APK
//load APK setting
//path-A
offset = rPdp_AntA;
for(index = 0; index < 11; index ++)
for (index = 0; index < 11; index ++)
{
PHY_SetBBReg(pAdapter, offset, bMaskDWord, APK_normal_setting_value_1[index]);
RTPRINT(FINIT, INIT_IQK, ("phy_APCalibrate_8192C() offset 0x%x value 0x%x\n", offset, PHY_QueryBBReg(pAdapter, offset, bMaskDWord)));
@ -929,7 +929,7 @@ if (pAdapter->registrypriv.mp_mode == 1)
PHY_SetBBReg(pAdapter, rConfig_Pmpd_AntB, bMaskDWord, 0x12680000);
offset = rConfig_AntA;
for(; index < 13; index ++)
for (; index < 13; index ++)
{
PHY_SetBBReg(pAdapter, offset, bMaskDWord, APK_normal_setting_value_1[index]);
RTPRINT(FINIT, INIT_IQK, ("phy_APCalibrate_8192C() offset 0x%x value 0x%x\n", offset, PHY_QueryBBReg(pAdapter, offset, bMaskDWord)));
@ -942,7 +942,7 @@ if (pAdapter->registrypriv.mp_mode == 1)
//path A
offset = rPdp_AntA;
for(index = 0; index < 16; index++)
for (index = 0; index < 16; index++)
{
PHY_SetBBReg(pAdapter, offset, bMaskDWord, APK_normal_setting_value_2[index]);
RTPRINT(FINIT, INIT_IQK, ("phy_APCalibrate_8192C() offset 0x%x value 0x%x\n", offset, PHY_QueryBBReg(pAdapter, offset, bMaskDWord)));
@ -951,13 +951,13 @@ if (pAdapter->registrypriv.mp_mode == 1)
}
PHY_SetBBReg(pAdapter, rFPGA0_IQK, bMaskDWord, 0x00000000);
}
else if(path == RF_PATH_B)
else if (path == RF_PATH_B)
{
//path B APK
//load APK setting
//path-B
offset = rPdp_AntB;
for(index = 0; index < 10; index ++)
for (index = 0; index < 10; index ++)
{
PHY_SetBBReg(pAdapter, offset, bMaskDWord, APK_normal_setting_value_1[index]);
RTPRINT(FINIT, INIT_IQK, ("phy_APCalibrate_8192C() offset 0x%x value 0x%x\n", offset, PHY_QueryBBReg(pAdapter, offset, bMaskDWord)));
@ -970,7 +970,7 @@ if (pAdapter->registrypriv.mp_mode == 1)
offset = rConfig_AntA;
index = 11;
for(; index < 13; index ++) //offset 0xb68, 0xb6c
for (; index < 13; index ++) //offset 0xb68, 0xb6c
{
PHY_SetBBReg(pAdapter, offset, bMaskDWord, APK_normal_setting_value_1[index]);
RTPRINT(FINIT, INIT_IQK, ("phy_APCalibrate_8192C() offset 0x%x value 0x%x\n", offset, PHY_QueryBBReg(pAdapter, offset, bMaskDWord)));
@ -983,7 +983,7 @@ if (pAdapter->registrypriv.mp_mode == 1)
//path B
offset = 0xb60;
for(index = 0; index < 16; index++)
for (index = 0; index < 16; index++)
{
PHY_SetBBReg(pAdapter, offset, bMaskDWord, APK_normal_setting_value_2[index]);
RTPRINT(FINIT, INIT_IQK, ("phy_APCalibrate_8192C() offset 0x%x value 0x%x\n", offset, PHY_QueryBBReg(pAdapter, offset, bMaskDWord)));
@ -997,17 +997,17 @@ if (pAdapter->registrypriv.mp_mode == 1)
regD[path] = PHY_QueryRFReg(pAdapter, path, RF_TXBIAS_A, bRFRegOffsetMask);
//Path A AFE all on, path B AFE All off or vise versa
for(index = 0; index < IQK_ADDA_REG_NUM ; index++)
for (index = 0; index < IQK_ADDA_REG_NUM ; index++)
PHY_SetBBReg(pAdapter, AFE_REG[index], bMaskDWord, AFE_on_off[path]);
RTPRINT(FINIT, INIT_IQK, ("phy_APCalibrate_8192C() offset 0xe70 %x\n", PHY_QueryBBReg(pAdapter, rRx_Wait_CCA, bMaskDWord)));
//BB to AP mode
if(path == 0)
if (path == 0)
{
for(index = 0; index < APK_BB_REG_NUM ; index++)
for (index = 0; index < APK_BB_REG_NUM ; index++)
{
if(index == 0) //skip
if (index == 0) //skip
continue;
else if (index < 5)
PHY_SetBBReg(pAdapter, BB_REG[index], bMaskDWord, BB_AP_MODE[index]);
@ -1032,7 +1032,7 @@ if (pAdapter->registrypriv.mp_mode == 1)
//MAC settings
phy_MACSettingCalibration(pAdapter, MAC_REG, MAC_backup);
if(path == RF_PATH_A) //Path B to standby mode
if (path == RF_PATH_A) //Path B to standby mode
{
PHY_SetRFReg(pAdapter, RF_PATH_B, RF_AC, bRFRegOffsetMask, 0x10000);
}
@ -1044,24 +1044,24 @@ if (pAdapter->registrypriv.mp_mode == 1)
}
delta_offset = ((delta+14)/2);
if(delta_offset < 0)
if (delta_offset < 0)
delta_offset = 0;
else if (delta_offset > 12)
delta_offset = 12;
//AP calibration
for(index = 0; index < APK_BB_REG_NUM; index++)
for (index = 0; index < APK_BB_REG_NUM; index++)
{
if(index != 1) //only DO PA11+PAD01001, AP RF setting
if (index != 1) //only DO PA11+PAD01001, AP RF setting
continue;
tmpReg = APK_RF_init_value[path][index];
#if 1
if(!pHalData->bAPKThermalMeterIgnore)
if (!pHalData->bAPKThermalMeterIgnore)
{
BB_offset = (tmpReg & 0xF0000) >> 16;
if(!(tmpReg & BIT15)) //sign bit 0
if (!(tmpReg & BIT15)) //sign bit 0
{
BB_offset = -BB_offset;
}
@ -1072,7 +1072,7 @@ if (pAdapter->registrypriv.mp_mode == 1)
RTPRINT(FINIT, INIT_IQK, ("phy_APCalibrate_8192C() APK index %d tmpReg 0x%x delta_V %d delta_offset %d\n", index, tmpReg, delta_V, delta_offset));
if(BB_offset < 0)
if (BB_offset < 0)
{
tmpReg = tmpReg & (~BIT15);
BB_offset = -BB_offset;
@ -1086,7 +1086,7 @@ if (pAdapter->registrypriv.mp_mode == 1)
#endif
#if DEV_BUS_TYPE==RT_PCI_INTERFACE
if(IS_81xxC_VENDOR_UMC_B_CUT(pHalData->VersionID))
if (IS_81xxC_VENDOR_UMC_B_CUT(pHalData->VersionID))
PHY_SetRFReg(pAdapter, path, RF_IPA_A, bRFRegOffsetMask, 0x894ae);
else
#endif
@ -1113,7 +1113,7 @@ if (pAdapter->registrypriv.mp_mode == 1)
}
PHY_SetBBReg(pAdapter, rFPGA0_IQK, bMaskDWord, 0x00000000);
if(path == RF_PATH_A)
if (path == RF_PATH_A)
tmpReg = PHY_QueryBBReg(pAdapter, rAPK, 0x03E00000);
else
tmpReg = PHY_QueryBBReg(pAdapter, rAPK, 0xF8000000);
@ -1122,7 +1122,7 @@ if (pAdapter->registrypriv.mp_mode == 1)
i++;
}
while(tmpReg > apkbound && i < 4);
while (tmpReg > apkbound && i < 4);
APK_result[path][index] = tmpReg;
}
@ -1132,10 +1132,10 @@ if (pAdapter->registrypriv.mp_mode == 1)
phy_ReloadMACRegisters(pAdapter, MAC_REG, MAC_backup);
//reload BB default value
for(index = 0; index < APK_BB_REG_NUM ; index++)
for (index = 0; index < APK_BB_REG_NUM ; index++)
{
if(index == 0) //skip
if (index == 0) //skip
continue;
PHY_SetBBReg(pAdapter, BB_REG[index], bMaskDWord, BB_backup[index]);
}
@ -1144,10 +1144,10 @@ if (pAdapter->registrypriv.mp_mode == 1)
phy_ReloadADDARegisters(pAdapter, AFE_REG, AFE_backup, IQK_ADDA_REG_NUM);
//reload RF path default value
for(path = 0; path < pathbound; path++)
for (path = 0; path < pathbound; path++)
{
PHY_SetRFReg(pAdapter, path, RF_TXBIAS_A, bRFRegOffsetMask, regD[path]);
if(path == RF_PATH_B)
if (path == RF_PATH_B)
{
PHY_SetRFReg(pAdapter, RF_PATH_A, RF_MODE1, bRFRegOffsetMask, 0x1000f);
PHY_SetRFReg(pAdapter, RF_PATH_A, RF_MODE2, bRFRegOffsetMask, 0x20101);
@ -1162,18 +1162,18 @@ if (pAdapter->registrypriv.mp_mode == 1)
RTPRINT(FINIT, INIT_IQK, ("\n"));
for(path = 0; path < pathbound; path++)
for (path = 0; path < pathbound; path++)
{
PHY_SetRFReg(pAdapter, path, RF_BS_PA_APSET_G1_G4, bRFRegOffsetMask,
((APK_result[path][1] << 15) | (APK_result[path][1] << 10) | (APK_result[path][1] << 5) | APK_result[path][1]));
if(path == RF_PATH_A)
if (path == RF_PATH_A)
PHY_SetRFReg(pAdapter, path, RF_BS_PA_APSET_G5_G8, bRFRegOffsetMask,
((APK_result[path][1] << 15) | (APK_result[path][1] << 10) | (0x00 << 5) | 0x05));
else
PHY_SetRFReg(pAdapter, path, RF_BS_PA_APSET_G5_G8, bRFRegOffsetMask,
((APK_result[path][1] << 15) | (APK_result[path][1] << 10) | (0x02 << 5) | 0x05));
if(!IS_HARDWARE_TYPE_8723A(pAdapter))
if (!IS_HARDWARE_TYPE_8723A(pAdapter))
PHY_SetRFReg(pAdapter, path, RF_BS_PA_APSET_G9_G11, bRFRegOffsetMask,
((0x08 << 15) | (0x08 << 10) | (0x08 << 5) | 0x08));
}
@ -1217,18 +1217,18 @@ if (pAdapter->registrypriv.mp_mode == 1)
#endif
//ignore IQK when continuous Tx
if(bStartContTx || bSingleTone || bCarrierSuppression)
if (bStartContTx || bSingleTone || bCarrierSuppression)
return;
#if DISABLE_BB_RF
return;
#endif
if(pAdapter->bSlaveOfDMSP)
if (pAdapter->bSlaveOfDMSP)
return;
if(!IS_HARDWARE_TYPE_8192D(pAdapter))
if (!IS_HARDWARE_TYPE_8192D(pAdapter))
{
if(bReCovery)
if (bReCovery)
{
phy_ReloadADDARegisters(pAdapter, IQK_BB_REG_92C, pHalData->IQK_BB_backup_recover, 9);
return;
@ -1237,7 +1237,7 @@ if (pAdapter->registrypriv.mp_mode == 1)
}
RTPRINT(FINIT, INIT_IQK, ("IQK:Start!!!\n"));
for(i = 0; i < 8; i++)
for (i = 0; i < 8; i++)
{
result[0][i] = 0;
result[1][i] = 0;
@ -1257,10 +1257,10 @@ if (pAdapter->registrypriv.mp_mode == 1)
// RT_TRACE(COMP_INIT,DBG_LOUD,("Acquire Mutex in IQCalibrate \n"));
for (i=0; i<3; i++)
{
// if(IS_HARDWARE_TYPE_8192C(pAdapter) || IS_HARDWARE_TYPE_8723A(pAdapter))
if(!IS_HARDWARE_TYPE_8192D(pAdapter))
// if (IS_HARDWARE_TYPE_8192C(pAdapter) || IS_HARDWARE_TYPE_8723A(pAdapter))
if (!IS_HARDWARE_TYPE_8192D(pAdapter))
{
if(IS_92C_SERIAL( pHalData->VersionID))
if (IS_92C_SERIAL( pHalData->VersionID))
{
phy_IQCalibrate_8192C(pAdapter, result, i, TRUE);
}
@ -1270,49 +1270,49 @@ if (pAdapter->registrypriv.mp_mode == 1)
phy_IQCalibrate_8192C(pAdapter, result, i, FALSE);
}
}
else/* if(IS_HARDWARE_TYPE_8192D(pAdapter))*/
else/* if (IS_HARDWARE_TYPE_8192D(pAdapter))*/
{
if(pHalData->CurrentBandType92D == BAND_ON_5G)
if (pHalData->CurrentBandType92D == BAND_ON_5G)
{
phy_IQCalibrate_5G_Normal(pAdapter, result, i);
}
else if(pHalData->CurrentBandType92D == BAND_ON_2_4G)
else if (pHalData->CurrentBandType92D == BAND_ON_2_4G)
{
if(IS_92D_SINGLEPHY(pHalData->VersionID))
if (IS_92D_SINGLEPHY(pHalData->VersionID))
phy_IQCalibrate_8192C(pAdapter, result, i, TRUE);
else
phy_IQCalibrate_8192C(pAdapter, result, i, FALSE);
}
}
if(i == 1)
if (i == 1)
{
is12simular = phy_SimularityCompare(pAdapter, result, 0, 1);
if(is12simular)
if (is12simular)
{
final_candidate = 0;
break;
}
}
if(i == 2)
if (i == 2)
{
is13simular = phy_SimularityCompare(pAdapter, result, 0, 2);
if(is13simular)
if (is13simular)
{
final_candidate = 0;
break;
}
is23simular = phy_SimularityCompare(pAdapter, result, 1, 2);
if(is23simular)
if (is23simular)
final_candidate = 1;
else
{
for(i = 0; i < 8; i++)
for (i = 0; i < 8; i++)
RegTmp += result[3][i];
if(RegTmp != 0)
if (RegTmp != 0)
final_candidate = 3;
else
final_candidate = 0xFF;
@ -1335,7 +1335,7 @@ if (pAdapter->registrypriv.mp_mode == 1)
RTPRINT(FINIT, INIT_IQK, ("IQK: RegE94=%x RegE9C=%x RegEA4=%x RegEAC=%x RegEB4=%x RegEBC=%x RegEC4=%x RegECC=%x\n ", RegE94, RegE9C, RegEA4, RegEAC, RegEB4, RegEBC, RegEC4, RegECC));
}
if(final_candidate != 0xff)
if (final_candidate != 0xff)
{
pHalData->RegE94 = RegE94 = result[final_candidate][0];
pHalData->RegE9C = RegE9C = result[final_candidate][1];
@ -1355,9 +1355,9 @@ if (pAdapter->registrypriv.mp_mode == 1)
RegE9C = RegEBC = pHalData->RegE9C = pHalData->RegEBC = 0x0; //Y default value
}
if((RegE94 != 0)/*&&(RegEA4 != 0)*/)
if ((RegE94 != 0)/*&&(RegEA4 != 0)*/)
{
if(pHalData->CurrentBandType92D == BAND_ON_5G)
if (pHalData->CurrentBandType92D == BAND_ON_5G)
phy_PathAFillIQKMatrix_5G_Normal(pAdapter, bPathAOK, result, final_candidate, (RegEA4 == 0));
else
phy_PathAFillIQKMatrix(pAdapter, bPathAOK, result, final_candidate, (RegEA4 == 0));
@ -1366,20 +1366,20 @@ if (pAdapter->registrypriv.mp_mode == 1)
if (IS_92C_SERIAL(pHalData->VersionID) || IS_92D_SINGLEPHY(pHalData->VersionID))
{
if((RegEB4 != 0)/*&&(RegEC4 != 0)*/)
if ((RegEB4 != 0)/*&&(RegEC4 != 0)*/)
{
if(pHalData->CurrentBandType92D == BAND_ON_5G)
if (pHalData->CurrentBandType92D == BAND_ON_5G)
phy_PathBFillIQKMatrix_5G_Normal(pAdapter, bPathBOK, result, final_candidate, (RegEC4 == 0));
else
phy_PathBFillIQKMatrix(pAdapter, bPathBOK, result, final_candidate, (RegEC4 == 0));
}
}
if(IS_HARDWARE_TYPE_8192D(pAdapter) && final_candidate != 0xFF)
if (IS_HARDWARE_TYPE_8192D(pAdapter) && final_candidate != 0xFF)
{
Indexforchannel = GetRightChnlPlaceforIQK(pHalData->CurrentChannel);
for(i = 0; i < IQK_Matrix_REG_NUM; i++)
for (i = 0; i < IQK_Matrix_REG_NUM; i++)
pHalData->IQKMatrixRegSetting[Indexforchannel].Value[0][i] =
result[final_candidate][i];
@ -1388,7 +1388,7 @@ if (pAdapter->registrypriv.mp_mode == 1)
RTPRINT(FINIT, INIT_IQK, ("\nIQK OK Indexforchannel %d.\n", Indexforchannel));
}
if(!IS_HARDWARE_TYPE_8192D(pAdapter))
if (!IS_HARDWARE_TYPE_8192D(pAdapter))
phy_SaveADDARegisters(pAdapter, IQK_BB_REG_92C, pHalData->IQK_BB_backup_recover, 9);
}
@ -1420,22 +1420,22 @@ if (pAdapter->registrypriv.mp_mode == 1)
#endif
//ignore LCK when continuous Tx
if(bStartContTx || bSingleTone || bCarrierSuppression)
if (bStartContTx || bSingleTone || bCarrierSuppression)
return;
if(BuddyAdapter != NULL &&
if (BuddyAdapter != NULL &&
((pAdapter->interfaceIndex == 0 && pHalData->CurrentBandType92D == BAND_ON_2_4G) ||
(pAdapter->interfaceIndex == 1 && pHalData->CurrentBandType92D == BAND_ON_5G)))
{
pMgntInfoBuddyAdapter=&BuddyAdapter->MgntInfo;
while(pMgntInfoBuddyAdapter->bScanInProgress && timecount < timeout)
while (pMgntInfoBuddyAdapter->bScanInProgress && timecount < timeout)
{
delay_ms(50);
timecount += 50;
}
}
while(pMgntInfo->bScanInProgress && timecount < timeout)
while (pMgntInfo->bScanInProgress && timecount < timeout)
{
delay_ms(50);
timecount += 50;
@ -1445,8 +1445,8 @@ if (pAdapter->registrypriv.mp_mode == 1)
RTPRINT(FINIT, INIT_IQK, ("LCK:Start!!!interface %d currentband %x delay %d ms\n", pAdapter->interfaceIndex, pHalData->CurrentBandType92D, timecount));
//if(IS_92C_SERIAL(pHalData->VersionID) || IS_92D_SINGLEPHY(pHalData->VersionID))
if(IS_2T2R(pHalData->VersionID))
//if (IS_92C_SERIAL(pHalData->VersionID) || IS_92D_SINGLEPHY(pHalData->VersionID))
if (IS_2T2R(pHalData->VersionID))
{
phy_LCCalibrate(pAdapter, TRUE);
}
@ -1477,15 +1477,15 @@ PHY_APCalibrate_8192C(
return;
#endif
if(IS_HARDWARE_TYPE_8192D(pAdapter) || IS_HARDWARE_TYPE_8723A(pAdapter))
if (IS_HARDWARE_TYPE_8192D(pAdapter) || IS_HARDWARE_TYPE_8723A(pAdapter))
return;
#if FOR_BRAZIL_PRETEST != 1
if(pHalData->bAPKdone)
if (pHalData->bAPKdone)
#endif
return;
if(IS_92C_SERIAL( pHalData->VersionID)){
if (IS_92C_SERIAL( pHalData->VersionID)){
phy_APCalibrate_8192C(pAdapter, delta, TRUE);
}
else{
@ -1517,7 +1517,7 @@ ODM_ResetIQKResult(
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD,("PHY_ResetIQKResult:: settings regs %d default regs %d\n", (u32)(sizeof(pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting)/sizeof(IQK_MATRIX_REGS_SETTING)), IQK_Matrix_Settings_NUM));
//0xe94, 0xe9c, 0xea4, 0xeac, 0xeb4, 0xebc, 0xec4, 0xecc
for(i = 0; i < IQK_Matrix_Settings_NUM; i++)
for (i = 0; i < IQK_Matrix_Settings_NUM; i++)
{
{
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][0] =
@ -1544,11 +1544,11 @@ u1Byte ODM_GetRightChnlPlaceforIQK(u1Byte chnl)
u1Byte place = chnl;
if(chnl > 14)
if (chnl > 14)
{
for(place = 14; place<sizeof(channel_all); place++)
for (place = 14; place<sizeof(channel_all); place++)
{
if(channel_all[place] == chnl)
if (channel_all[place] == chnl)
{
return place-13;
}

File diff suppressed because it is too large Load diff

View file

@ -179,7 +179,7 @@ u8 HalPwrSeqCmdParsing(
}
AryIdx++;//Add Array Index
}while(1);
}while (1);
return _TRUE;
}

View file

@ -45,31 +45,31 @@ void dump_chip_info(HAL_VERSION ChipVersion)
int cnt = 0;
u8 buf[128];
if(IS_81XXC(ChipVersion)){
if (IS_81XXC(ChipVersion)){
cnt += sprintf((buf+cnt), "Chip Version Info: %s_", IS_92C_SERIAL(ChipVersion)?"CHIP_8192C":"CHIP_8188C");
}
else if(IS_92D(ChipVersion)){
else if (IS_92D(ChipVersion)){
cnt += sprintf((buf+cnt), "Chip Version Info: CHIP_8192D_");
}
else if(IS_8723_SERIES(ChipVersion)){
else if (IS_8723_SERIES(ChipVersion)){
cnt += sprintf((buf+cnt), "Chip Version Info: CHIP_8723A_");
}
else if(IS_8188E(ChipVersion)){
else if (IS_8188E(ChipVersion)){
cnt += sprintf((buf+cnt), "Chip Version Info: CHIP_8188E_");
}
cnt += sprintf((buf+cnt), "%s_", IS_NORMAL_CHIP(ChipVersion)?"Normal_Chip":"Test_Chip");
cnt += sprintf((buf+cnt), "%s_", IS_CHIP_VENDOR_TSMC(ChipVersion)?"TSMC":"UMC");
if(IS_A_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "A_CUT_");
else if(IS_B_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "B_CUT_");
else if(IS_C_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "C_CUT_");
else if(IS_D_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "D_CUT_");
else if(IS_E_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "E_CUT_");
if (IS_A_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "A_CUT_");
else if (IS_B_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "B_CUT_");
else if (IS_C_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "C_CUT_");
else if (IS_D_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "D_CUT_");
else if (IS_E_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "E_CUT_");
else cnt += sprintf((buf+cnt), "UNKNOWN_CUT(%d)_", ChipVersion.CUTVersion);
if(IS_1T1R(ChipVersion)) cnt += sprintf((buf+cnt), "1T1R_");
else if(IS_1T2R(ChipVersion)) cnt += sprintf((buf+cnt), "1T2R_");
else if(IS_2T2R(ChipVersion)) cnt += sprintf((buf+cnt), "2T2R_");
if (IS_1T1R(ChipVersion)) cnt += sprintf((buf+cnt), "1T1R_");
else if (IS_1T2R(ChipVersion)) cnt += sprintf((buf+cnt), "1T2R_");
else if (IS_2T2R(ChipVersion)) cnt += sprintf((buf+cnt), "2T2R_");
else cnt += sprintf((buf+cnt), "UNKNOWN_RFTYPE(%d)_", ChipVersion.RFType);
cnt += sprintf((buf+cnt), "RomVer(%d)\n", ChipVersion.ROMVer);
@ -116,7 +116,7 @@ u8 MRateToHwRate(u8 rate)
{
u8 ret = DESC_RATE1M;
switch(rate)
switch (rate)
{
// CCK and OFDM non-HT rates
case IEEE80211_CCK_RATE_1MB: ret = DESC_RATE1M; break;
@ -155,14 +155,14 @@ void HalSetBrateCfg(
{
u8 i, is_brate, brate;
for(i=0;i<NDIS_802_11_LENGTH_RATES_EX;i++)
for (i=0;i<NDIS_802_11_LENGTH_RATES_EX;i++)
{
is_brate = mBratesOS[i] & IEEE80211_BASIC_RATE_MASK;
brate = mBratesOS[i] & 0x7f;
if( is_brate )
if ( is_brate )
{
switch(brate)
switch (brate)
{
case IEEE80211_CCK_RATE_1MB: *pBrateCfg |= RATE_1M; break;
case IEEE80211_CCK_RATE_2MB: *pBrateCfg |= RATE_2M; break;
@ -207,7 +207,7 @@ _TwoOutPipeMapping(
{
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(pAdapter);
if(bWIFICfg){ //WMM
if (bWIFICfg){ //WMM
// BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA
//{ 0, 1, 0, 1, 0, 0, 0, 0, 0 };
@ -252,7 +252,7 @@ static VOID _ThreeOutPipeMapping(
{
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(pAdapter);
if(bWIFICfg){//for WMM
if (bWIFICfg){//for WMM
// BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA
//{ 1, 2, 1, 0, 0, 0, 0, 0, 0 };
@ -301,7 +301,7 @@ Hal_MappingOutPipe(
BOOLEAN result = _TRUE;
switch(NumOutPipe)
switch (NumOutPipe)
{
case 2:
_TwoOutPipeMapping(pAdapter, bWIFICfg);

View file

@ -36,58 +36,58 @@
void rtw_hal_chip_configure(_adapter *padapter)
{
if(padapter->HalFunc.intf_chip_configure)
if (padapter->HalFunc.intf_chip_configure)
padapter->HalFunc.intf_chip_configure(padapter);
}
void rtw_hal_read_chip_info(_adapter *padapter)
{
if(padapter->HalFunc.read_adapter_info)
if (padapter->HalFunc.read_adapter_info)
padapter->HalFunc.read_adapter_info(padapter);
}
void rtw_hal_read_chip_version(_adapter *padapter)
{
if(padapter->HalFunc.read_chip_version)
if (padapter->HalFunc.read_chip_version)
padapter->HalFunc.read_chip_version(padapter);
}
void rtw_hal_def_value_init(_adapter *padapter)
{
if(padapter->HalFunc.init_default_value)
if (padapter->HalFunc.init_default_value)
padapter->HalFunc.init_default_value(padapter);
}
void rtw_hal_free_data(_adapter *padapter)
{
if(padapter->HalFunc.free_hal_data)
if (padapter->HalFunc.free_hal_data)
padapter->HalFunc.free_hal_data(padapter);
}
void rtw_hal_dm_init(_adapter *padapter)
{
if(padapter->HalFunc.dm_init)
if (padapter->HalFunc.dm_init)
padapter->HalFunc.dm_init(padapter);
}
void rtw_hal_dm_deinit(_adapter *padapter)
{
// cancel dm timer
if(padapter->HalFunc.dm_deinit)
if (padapter->HalFunc.dm_deinit)
padapter->HalFunc.dm_deinit(padapter);
}
void rtw_hal_sw_led_init(_adapter *padapter)
{
if(padapter->HalFunc.InitSwLeds)
if (padapter->HalFunc.InitSwLeds)
padapter->HalFunc.InitSwLeds(padapter);
}
void rtw_hal_sw_led_deinit(_adapter *padapter)
{
if(padapter->HalFunc.DeInitSwLeds)
if (padapter->HalFunc.DeInitSwLeds)
padapter->HalFunc.DeInitSwLeds(padapter);
}
u32 rtw_hal_power_on(_adapter *padapter)
{
if(padapter->HalFunc.hal_power_on)
if (padapter->HalFunc.hal_power_on)
return padapter->HalFunc.hal_power_on(padapter);
return _FAIL;
}
@ -98,24 +98,24 @@ uint rtw_hal_init(_adapter *padapter)
uint status = _SUCCESS;
#ifdef CONFIG_DUALMAC_CONCURRENT
if(padapter->hw_init_completed == _TRUE)
if (padapter->hw_init_completed == _TRUE)
{
DBG_871X("rtw_hal_init: hw_init_completed == _TRUE\n");
return status;
}
// before init mac0, driver must init mac1 first to avoid usb rx error.
if((padapter->pbuddy_adapter != NULL) && (padapter->DualMacConcurrent == _TRUE)
if ((padapter->pbuddy_adapter != NULL) && (padapter->DualMacConcurrent == _TRUE)
&& (padapter->adapter_type == PRIMARY_ADAPTER))
{
if(padapter->pbuddy_adapter->hw_init_completed == _TRUE)
if (padapter->pbuddy_adapter->hw_init_completed == _TRUE)
{
DBG_871X("rtw_hal_init: pbuddy_adapter hw_init_completed == _TRUE\n");
}
else
{
status = padapter->HalFunc.hal_init(padapter->pbuddy_adapter);
if(status == _SUCCESS){
if (status == _SUCCESS){
padapter->pbuddy_adapter->hw_init_completed = _TRUE;
}
else{
@ -132,7 +132,7 @@ uint rtw_hal_init(_adapter *padapter)
status = padapter->HalFunc.hal_init(padapter);
if(status == _SUCCESS){
if (status == _SUCCESS){
padapter->hw_init_completed = _TRUE;
if (padapter->registrypriv.notch_filter == 1)
@ -159,7 +159,7 @@ _func_enter_;
status = padapter->HalFunc.hal_deinit(padapter);
if(status == _SUCCESS){
if (status == _SUCCESS){
padapter->hw_init_completed = _FALSE;
}
else
@ -186,25 +186,25 @@ void rtw_hal_get_hwreg(_adapter *padapter, u8 variable, u8 *val)
u8 rtw_hal_set_def_var(_adapter *padapter, HAL_DEF_VARIABLE eVariable, PVOID pValue)
{
if(padapter->HalFunc.SetHalDefVarHandler)
if (padapter->HalFunc.SetHalDefVarHandler)
return padapter->HalFunc.SetHalDefVarHandler(padapter,eVariable,pValue);
return _FAIL;
}
u8 rtw_hal_get_def_var(_adapter *padapter, HAL_DEF_VARIABLE eVariable, PVOID pValue)
{
if(padapter->HalFunc.GetHalDefVarHandler)
if (padapter->HalFunc.GetHalDefVarHandler)
return padapter->HalFunc.GetHalDefVarHandler(padapter,eVariable,pValue);
return _FAIL;
}
void rtw_hal_set_odm_var(_adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,BOOLEAN bSet)
{
if(padapter->HalFunc.SetHalODMVarHandler)
if (padapter->HalFunc.SetHalODMVarHandler)
padapter->HalFunc.SetHalODMVarHandler(padapter,eVariable,pValue1,bSet);
}
void rtw_hal_get_odm_var(_adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,BOOLEAN bSet)
{
if(padapter->HalFunc.GetHalODMVarHandler)
if (padapter->HalFunc.GetHalODMVarHandler)
padapter->HalFunc.GetHalODMVarHandler(padapter,eVariable,pValue1,bSet);
}
@ -229,7 +229,7 @@ void rtw_hal_disable_interrupt(_adapter *padapter)
u32 rtw_hal_inirp_init(_adapter *padapter)
{
u32 rst = _FAIL;
if(padapter->HalFunc.inirp_init)
if (padapter->HalFunc.inirp_init)
rst = padapter->HalFunc.inirp_init(padapter);
else
DBG_871X(" %s HalFunc.inirp_init is NULL!!!\n",__FUNCTION__);
@ -239,7 +239,7 @@ u32 rtw_hal_inirp_init(_adapter *padapter)
u32 rtw_hal_inirp_deinit(_adapter *padapter)
{
if(padapter->HalFunc.inirp_deinit)
if (padapter->HalFunc.inirp_deinit)
return padapter->HalFunc.inirp_deinit(padapter);
return _FAIL;
@ -248,14 +248,14 @@ u32 rtw_hal_inirp_deinit(_adapter *padapter)
u8 rtw_hal_intf_ps_func(_adapter *padapter,HAL_INTF_PS_FUNC efunc_id, u8* val)
{
if(padapter->HalFunc.interface_ps_func)
if (padapter->HalFunc.interface_ps_func)
return padapter->HalFunc.interface_ps_func(padapter,efunc_id,val);
return _FAIL;
}
s32 rtw_hal_xmit(_adapter *padapter, struct xmit_frame *pxmitframe)
{
if(padapter->HalFunc.hal_xmit)
if (padapter->HalFunc.hal_xmit)
return padapter->HalFunc.hal_xmit(padapter, pxmitframe);
return _FALSE;
@ -264,33 +264,33 @@ s32 rtw_hal_xmit(_adapter *padapter, struct xmit_frame *pxmitframe)
s32 rtw_hal_mgnt_xmit(_adapter *padapter, struct xmit_frame *pmgntframe)
{
s32 ret = _FAIL;
if(padapter->HalFunc.mgnt_xmit)
if (padapter->HalFunc.mgnt_xmit)
ret = padapter->HalFunc.mgnt_xmit(padapter, pmgntframe);
return ret;
}
s32 rtw_hal_init_xmit_priv(_adapter *padapter)
{
if(padapter->HalFunc.init_xmit_priv != NULL)
if (padapter->HalFunc.init_xmit_priv != NULL)
return padapter->HalFunc.init_xmit_priv(padapter);
return _FAIL;
}
void rtw_hal_free_xmit_priv(_adapter *padapter)
{
if(padapter->HalFunc.free_xmit_priv != NULL)
if (padapter->HalFunc.free_xmit_priv != NULL)
padapter->HalFunc.free_xmit_priv(padapter);
}
s32 rtw_hal_init_recv_priv(_adapter *padapter)
{
if(padapter->HalFunc.init_recv_priv)
if (padapter->HalFunc.init_recv_priv)
return padapter->HalFunc.init_recv_priv(padapter);
return _FAIL;
}
void rtw_hal_free_recv_priv(_adapter *padapter)
{
if(padapter->HalFunc.free_recv_priv)
if (padapter->HalFunc.free_recv_priv)
padapter->HalFunc.free_recv_priv(padapter);
}
@ -298,91 +298,91 @@ void rtw_hal_update_ra_mask(_adapter *padapter, u32 mac_id, u8 rssi_level)
{
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
{
struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv;
#ifdef CONFIG_NATIVEAP_MLME
if((mac_id-1)>0)
if ((mac_id-1)>0)
psta = pstapriv->sta_aid[(mac_id-1) - 1];
#endif
if(psta)
if (psta)
add_RATid(padapter, psta, 0);//todo: based on rssi_level
}
else
{
if(padapter->HalFunc.UpdateRAMaskHandler)
if (padapter->HalFunc.UpdateRAMaskHandler)
padapter->HalFunc.UpdateRAMaskHandler(padapter,mac_id,rssi_level);
}
}
void rtw_hal_add_ra_tid(_adapter *padapter, u32 bitmap, u8 arg, u8 rssi_level)
{
if(padapter->HalFunc.Add_RateATid)
if (padapter->HalFunc.Add_RateATid)
padapter->HalFunc.Add_RateATid(padapter, bitmap, arg, rssi_level);
}
#ifdef CONFIG_CONCURRENT_MODE
void rtw_hal_clone_data(_adapter *dst_padapter, _adapter *src_padapter)
{
if(dst_padapter->HalFunc.clone_haldata)
if (dst_padapter->HalFunc.clone_haldata)
dst_padapter->HalFunc.clone_haldata(dst_padapter, src_padapter);
}
#endif
/* Start specifical interface thread */
void rtw_hal_start_thread(_adapter *padapter)
{
if(padapter->HalFunc.run_thread)
if (padapter->HalFunc.run_thread)
padapter->HalFunc.run_thread(padapter);
}
/* Start specifical interface thread */
void rtw_hal_stop_thread(_adapter *padapter)
{
if(padapter->HalFunc.cancel_thread)
if (padapter->HalFunc.cancel_thread)
padapter->HalFunc.cancel_thread(padapter);
}
u32 rtw_hal_read_bbreg(_adapter *padapter, u32 RegAddr, u32 BitMask)
{
u32 data = 0;
if(padapter->HalFunc.read_bbreg)
if (padapter->HalFunc.read_bbreg)
data = padapter->HalFunc.read_bbreg(padapter, RegAddr, BitMask);
return data;
}
void rtw_hal_write_bbreg(_adapter *padapter, u32 RegAddr, u32 BitMask, u32 Data)
{
if(padapter->HalFunc.write_bbreg)
if (padapter->HalFunc.write_bbreg)
padapter->HalFunc.write_bbreg(padapter, RegAddr, BitMask, Data);
}
u32 rtw_hal_read_rfreg(_adapter *padapter, u32 eRFPath, u32 RegAddr, u32 BitMask)
{
u32 data = 0;
if( padapter->HalFunc.read_rfreg)
if ( padapter->HalFunc.read_rfreg)
data = padapter->HalFunc.read_rfreg(padapter, eRFPath, RegAddr, BitMask);
return data;
}
void rtw_hal_write_rfreg(_adapter *padapter, u32 eRFPath, u32 RegAddr, u32 BitMask, u32 Data)
{
if(padapter->HalFunc.write_rfreg)
if (padapter->HalFunc.write_rfreg)
padapter->HalFunc.write_rfreg(padapter, eRFPath, RegAddr, BitMask, Data);
}
s32 rtw_hal_interrupt_handler(_adapter *padapter)
{
if(padapter->HalFunc.interrupt_handler)
if (padapter->HalFunc.interrupt_handler)
return padapter->HalFunc.interrupt_handler(padapter);
return _FAIL;
}
void rtw_hal_set_bwmode(_adapter *padapter, HT_CHANNEL_WIDTH Bandwidth, u8 Offset)
{
if(padapter->HalFunc.set_bwmode_handler)
if (padapter->HalFunc.set_bwmode_handler)
padapter->HalFunc.set_bwmode_handler(padapter, Bandwidth, Offset);
}
void rtw_hal_set_chan(_adapter *padapter, u8 channel)
{
if(padapter->HalFunc.set_channel_handler)
if (padapter->HalFunc.set_channel_handler)
padapter->HalFunc.set_channel_handler(padapter, channel);
}
@ -392,13 +392,13 @@ void rtw_hal_dm_watchdog(_adapter *padapter)
if (padapter->adapter_type != PRIMARY_ADAPTER)
return;
#endif
if(padapter->HalFunc.hal_dm_watchdog)
if (padapter->HalFunc.hal_dm_watchdog)
padapter->HalFunc.hal_dm_watchdog(padapter);
}
void rtw_hal_bcn_related_reg_setting(_adapter *padapter)
{
if(padapter->HalFunc.SetBeaconRelatedRegistersHandler)
if (padapter->HalFunc.SetBeaconRelatedRegistersHandler)
padapter->HalFunc.SetBeaconRelatedRegistersHandler(padapter);
}
@ -406,13 +406,13 @@ void rtw_hal_bcn_related_reg_setting(_adapter *padapter)
#ifdef CONFIG_ANTENNA_DIVERSITY
u8 rtw_hal_antdiv_before_linked(_adapter *padapter)
{
if(padapter->HalFunc.AntDivBeforeLinkHandler)
if (padapter->HalFunc.AntDivBeforeLinkHandler)
return padapter->HalFunc.AntDivBeforeLinkHandler(padapter);
return _FALSE;
}
void rtw_hal_antdiv_rssi_compared(_adapter *padapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src)
{
if(padapter->HalFunc.AntDivCompareHandler)
if (padapter->HalFunc.AntDivCompareHandler)
padapter->HalFunc.AntDivCompareHandler(padapter, dst, src);
}
#endif
@ -420,7 +420,7 @@ void rtw_hal_antdiv_rssi_compared(_adapter *padapter, WLAN_BSSID_EX *dst, WLAN_B
#ifdef CONFIG_HOSTAPD_MLME
s32 rtw_hal_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt)
{
if(padapter->HalFunc.hostap_mgnt_xmit_entry)
if (padapter->HalFunc.hostap_mgnt_xmit_entry)
return padapter->HalFunc.hostap_mgnt_xmit_entry(padapter, pkt);
return _FAIL;
}
@ -429,18 +429,18 @@ s32 rtw_hal_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt)
#ifdef DBG_CONFIG_ERROR_DETECT
void rtw_hal_sreset_init(_adapter *padapter)
{
if(padapter->HalFunc.sreset_init_value)
if (padapter->HalFunc.sreset_init_value)
padapter->HalFunc.sreset_init_value(padapter);
}
void rtw_hal_sreset_reset(_adapter *padapter)
{
if(padapter->HalFunc.silentreset)
if (padapter->HalFunc.silentreset)
padapter->HalFunc.silentreset(padapter);
}
void rtw_hal_sreset_reset_value(_adapter *padapter)
{
if(padapter->HalFunc.sreset_reset_value)
if (padapter->HalFunc.sreset_reset_value)
padapter->HalFunc.sreset_reset_value(padapter);
}
@ -450,18 +450,18 @@ void rtw_hal_sreset_xmit_status_check(_adapter *padapter)
if (padapter->adapter_type != PRIMARY_ADAPTER)
return;
#endif
if(padapter->HalFunc.sreset_xmit_status_check)
if (padapter->HalFunc.sreset_xmit_status_check)
padapter->HalFunc.sreset_xmit_status_check(padapter);
}
void rtw_hal_sreset_linked_status_check(_adapter *padapter)
{
if(padapter->HalFunc.sreset_linked_status_check)
if (padapter->HalFunc.sreset_linked_status_check)
padapter->HalFunc.sreset_linked_status_check(padapter);
}
u8 rtw_hal_sreset_get_wifi_status(_adapter *padapter)
{
u8 status = 0;
if(padapter->HalFunc.sreset_get_wifi_status)
if (padapter->HalFunc.sreset_get_wifi_status)
status = padapter->HalFunc.sreset_get_wifi_status(padapter);
return status;
}
@ -471,7 +471,7 @@ u8 rtw_hal_sreset_get_wifi_status(_adapter *padapter)
#ifdef CONFIG_IOL
int rtw_hal_iol_cmd(ADAPTER *adapter, struct xmit_frame *xmit_frame, u32 max_wating_ms, u32 bndy_cnt)
{
if(adapter->HalFunc.IOL_exec_cmds_sync)
if (adapter->HalFunc.IOL_exec_cmds_sync)
return adapter->HalFunc.IOL_exec_cmds_sync(adapter, xmit_frame, max_wating_ms,bndy_cnt);
return _FAIL;
}
@ -480,7 +480,7 @@ int rtw_hal_iol_cmd(ADAPTER *adapter, struct xmit_frame *xmit_frame, u32 max_wat
#ifdef CONFIG_XMIT_THREAD_MODE
s32 rtw_hal_xmit_thread_handler(_adapter *padapter)
{
if(padapter->HalFunc.xmit_thread_handler)
if (padapter->HalFunc.xmit_thread_handler)
return padapter->HalFunc.xmit_thread_handler(padapter);
return _FAIL;
}
@ -488,13 +488,13 @@ s32 rtw_hal_xmit_thread_handler(_adapter *padapter)
void rtw_hal_notch_filter(_adapter *adapter, bool enable)
{
if(adapter->HalFunc.hal_notch_filter)
if (adapter->HalFunc.hal_notch_filter)
adapter->HalFunc.hal_notch_filter(adapter,enable);
}
void rtw_hal_reset_security_engine(_adapter * adapter)
{
if(adapter->HalFunc.hal_reset_security_engine)
if (adapter->HalFunc.hal_reset_security_engine)
adapter->HalFunc.hal_reset_security_engine(adapter);
}

1906
hal/odm.c

File diff suppressed because it is too large Load diff

View file

@ -30,7 +30,7 @@
READ_AND_CONFIG_MP(ic,txt);\
else\
READ_AND_CONFIG_TC(ic,txt);\
} while(0)
} while (0)
#elif (RTL8188E_FOR_TEST_CHIP == 1)
#define READ_AND_CONFIG READ_AND_CONFIG_TC
#else
@ -73,46 +73,46 @@ odm_SignalScaleMapping_92CSeries_patch_RT_CID_819x_Lenovo(
{
s4Byte RetSig;
#if (DM_ODM_SUPPORT_TYPE == ODM_MP)
//if(pDM_Odm->SupportInterface == ODM_ITRF_PCIE)
//if (pDM_Odm->SupportInterface == ODM_ITRF_PCIE)
{
// Step 1. Scale mapping.
// 20100611 Joseph: Re-tunning RSSI presentation for Lenovo.
// 20100426 Joseph: Modify Signal strength mapping.
// This modification makes the RSSI indication similar to Intel solution.
// 20100414 Joseph: Tunning RSSI for Lenovo according to RTL8191SE.
if(CurrSig >= 54 && CurrSig <= 100)
if (CurrSig >= 54 && CurrSig <= 100)
{
RetSig = 100;
}
else if(CurrSig>=42 && CurrSig <= 53 )
else if (CurrSig>=42 && CurrSig <= 53 )
{
RetSig = 95;
}
else if(CurrSig>=36 && CurrSig <= 41 )
else if (CurrSig>=36 && CurrSig <= 41 )
{
RetSig = 74 + ((CurrSig - 36) *20)/6;
}
else if(CurrSig>=33 && CurrSig <= 35 )
else if (CurrSig>=33 && CurrSig <= 35 )
{
RetSig = 65 + ((CurrSig - 33) *8)/2;
}
else if(CurrSig>=18 && CurrSig <= 32 )
else if (CurrSig>=18 && CurrSig <= 32 )
{
RetSig = 62 + ((CurrSig - 18) *2)/15;
}
else if(CurrSig>=15 && CurrSig <= 17 )
else if (CurrSig>=15 && CurrSig <= 17 )
{
RetSig = 33 + ((CurrSig - 15) *28)/2;
}
else if(CurrSig>=10 && CurrSig <= 14 )
else if (CurrSig>=10 && CurrSig <= 14 )
{
RetSig = 39;
}
else if(CurrSig>=8 && CurrSig <= 9 )
else if (CurrSig>=8 && CurrSig <= 9 )
{
RetSig = 33;
}
else if(CurrSig <= 8 )
else if (CurrSig <= 8 )
{
RetSig = 19;
}
@ -129,46 +129,46 @@ odm_SignalScaleMapping_92CSeries_patch_RT_CID_819x_Netcore(
{
s4Byte RetSig;
#if (DM_ODM_SUPPORT_TYPE == ODM_MP)
//if(pDM_Odm->SupportInterface == ODM_ITRF_USB)
//if (pDM_Odm->SupportInterface == ODM_ITRF_USB)
{
// Netcore request this modification because 2009.04.13 SU driver use it.
if(CurrSig >= 31 && CurrSig <= 100)
if (CurrSig >= 31 && CurrSig <= 100)
{
RetSig = 100;
}
else if(CurrSig >= 21 && CurrSig <= 30)
else if (CurrSig >= 21 && CurrSig <= 30)
{
RetSig = 90 + ((CurrSig - 20) / 1);
}
else if(CurrSig >= 11 && CurrSig <= 20)
else if (CurrSig >= 11 && CurrSig <= 20)
{
RetSig = 80 + ((CurrSig - 10) / 1);
}
else if(CurrSig >= 7 && CurrSig <= 10)
else if (CurrSig >= 7 && CurrSig <= 10)
{
RetSig = 69 + (CurrSig - 7);
}
else if(CurrSig == 6)
else if (CurrSig == 6)
{
RetSig = 54;
}
else if(CurrSig == 5)
else if (CurrSig == 5)
{
RetSig = 45;
}
else if(CurrSig == 4)
else if (CurrSig == 4)
{
RetSig = 36;
}
else if(CurrSig == 3)
else if (CurrSig == 3)
{
RetSig = 27;
}
else if(CurrSig == 2)
else if (CurrSig == 2)
{
RetSig = 18;
}
else if(CurrSig == 1)
else if (CurrSig == 1)
{
RetSig = 9;
}
@ -190,42 +190,42 @@ odm_SignalScaleMapping_92CSeries(
{
s4Byte RetSig;
#if (DEV_BUS_TYPE == RT_PCI_INTERFACE)
if(pDM_Odm->SupportInterface == ODM_ITRF_PCIE)
if (pDM_Odm->SupportInterface == ODM_ITRF_PCIE)
{
// Step 1. Scale mapping.
if(CurrSig >= 61 && CurrSig <= 100)
if (CurrSig >= 61 && CurrSig <= 100)
{
RetSig = 90 + ((CurrSig - 60) / 4);
}
else if(CurrSig >= 41 && CurrSig <= 60)
else if (CurrSig >= 41 && CurrSig <= 60)
{
RetSig = 78 + ((CurrSig - 40) / 2);
}
else if(CurrSig >= 31 && CurrSig <= 40)
else if (CurrSig >= 31 && CurrSig <= 40)
{
RetSig = 66 + (CurrSig - 30);
}
else if(CurrSig >= 21 && CurrSig <= 30)
else if (CurrSig >= 21 && CurrSig <= 30)
{
RetSig = 54 + (CurrSig - 20);
}
else if(CurrSig >= 5 && CurrSig <= 20)
else if (CurrSig >= 5 && CurrSig <= 20)
{
RetSig = 42 + (((CurrSig - 5) * 2) / 3);
}
else if(CurrSig == 4)
else if (CurrSig == 4)
{
RetSig = 36;
}
else if(CurrSig == 3)
else if (CurrSig == 3)
{
RetSig = 27;
}
else if(CurrSig == 2)
else if (CurrSig == 2)
{
RetSig = 18;
}
else if(CurrSig == 1)
else if (CurrSig == 1)
{
RetSig = 9;
}
@ -237,33 +237,33 @@ odm_SignalScaleMapping_92CSeries(
#endif
#if ((DEV_BUS_TYPE == RT_USB_INTERFACE) ||(DEV_BUS_TYPE == RT_SDIO_INTERFACE))
if((pDM_Odm->SupportInterface == ODM_ITRF_USB) || (pDM_Odm->SupportInterface == ODM_ITRF_SDIO) )
if ((pDM_Odm->SupportInterface == ODM_ITRF_USB) || (pDM_Odm->SupportInterface == ODM_ITRF_SDIO) )
{
if(CurrSig >= 51 && CurrSig <= 100)
if (CurrSig >= 51 && CurrSig <= 100)
{
RetSig = 100;
}
else if(CurrSig >= 41 && CurrSig <= 50)
else if (CurrSig >= 41 && CurrSig <= 50)
{
RetSig = 80 + ((CurrSig - 40)*2);
}
else if(CurrSig >= 31 && CurrSig <= 40)
else if (CurrSig >= 31 && CurrSig <= 40)
{
RetSig = 66 + (CurrSig - 30);
}
else if(CurrSig >= 21 && CurrSig <= 30)
else if (CurrSig >= 21 && CurrSig <= 30)
{
RetSig = 54 + (CurrSig - 20);
}
else if(CurrSig >= 10 && CurrSig <= 20)
else if (CurrSig >= 10 && CurrSig <= 20)
{
RetSig = 42 + (((CurrSig - 10) * 2) / 3);
}
else if(CurrSig >= 5 && CurrSig <= 9)
else if (CurrSig >= 5 && CurrSig <= 9)
{
RetSig = 22 + (((CurrSig - 5) * 3) / 2);
}
else if(CurrSig >= 1 && CurrSig <= 4)
else if (CurrSig >= 1 && CurrSig <= 4)
{
RetSig = 6 + (((CurrSig - 1) * 3) / 2);
}
@ -281,13 +281,13 @@ odm_SignalScaleMapping(
IN s4Byte CurrSig
)
{
if( (pDM_Odm->SupportPlatform == ODM_MP) &&
if ( (pDM_Odm->SupportPlatform == ODM_MP) &&
(pDM_Odm->SupportInterface != ODM_ITRF_PCIE) && //USB & SDIO
(pDM_Odm->PatchID==10))//pMgntInfo->CustomerID == RT_CID_819x_Netcore
{
return odm_SignalScaleMapping_92CSeries_patch_RT_CID_819x_Netcore(pDM_Odm,CurrSig);
}
else if( (pDM_Odm->SupportPlatform == ODM_MP) &&
else if ( (pDM_Odm->SupportPlatform == ODM_MP) &&
(pDM_Odm->SupportInterface == ODM_ITRF_PCIE) &&
(pDM_Odm->PatchID==19))//pMgntInfo->CustomerID == RT_CID_819x_Lenovo)
{
@ -313,15 +313,15 @@ static u1Byte odm_SQ_process_patch_RT_CID_819x_Lenovo(
#if (DM_ODM_SUPPORT_TYPE & ODM_MP)
// mapping to 5 bars for vista signal strength
// signal quality in driver will be displayed to signal strength
if(isCCKrate){
if (isCCKrate){
// in vista.
if(PWDB_ALL >= 50)
if (PWDB_ALL >= 50)
SQ = 100;
else if(PWDB_ALL >= 35 && PWDB_ALL < 50)
else if (PWDB_ALL >= 35 && PWDB_ALL < 50)
SQ = 80;
else if(PWDB_ALL >= 22 && PWDB_ALL < 35)
else if (PWDB_ALL >= 22 && PWDB_ALL < 35)
SQ = 60;
else if(PWDB_ALL >= 18 && PWDB_ALL < 22)
else if (PWDB_ALL >= 18 && PWDB_ALL < 22)
SQ = 40;
else
SQ = 20;
@ -331,13 +331,13 @@ static u1Byte odm_SQ_process_patch_RT_CID_819x_Lenovo(
// mapping to 5 bars for vista signal strength
// signal quality in driver will be displayed to signal strength
// in vista.
if(RSSI >= 50)
if (RSSI >= 50)
SQ = 100;
else if(RSSI >= 35 && RSSI < 50)
else if (RSSI >= 35 && RSSI < 50)
SQ = 80;
else if(RSSI >= 22 && RSSI < 35)
else if (RSSI >= 22 && RSSI < 35)
SQ = 60;
else if(RSSI >= 18 && RSSI < 22)
else if (RSSI >= 18 && RSSI < 22)
SQ = 40;
else
SQ = 20;
@ -361,15 +361,15 @@ odm_EVMdbToPercentage(
//ODM_RTPRINT(FRX, RX_PHY_SQ, ("EVMdbToPercentage92C Value=%d / %x \n", ret_val, ret_val));
if(ret_val >= 0)
if (ret_val >= 0)
ret_val = 0;
if(ret_val <= -33)
if (ret_val <= -33)
ret_val = -33;
ret_val = 0 - ret_val;
ret_val*=3;
if(ret_val == 99)
if (ret_val == 99)
ret_val = 100;
return(ret_val);
@ -403,7 +403,7 @@ odm_RxPhyStatus92CSeries_Parsing(
pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_B] = -1;
if(isCCKrate)
if (isCCKrate)
{
u1Byte report;
u1Byte cck_agc_rpt;
@ -414,7 +414,7 @@ odm_RxPhyStatus92CSeries_Parsing(
// (2)PWDB, Average PWDB cacluated by hardware (for rate adaptive)
//
//if(pHalData->eRFPowerState == eRfOn)
//if (pHalData->eRFPowerState == eRfOn)
cck_highpwr = pDM_Odm->bCckHighPower;
//else
// cck_highpwr = FALSE;
@ -424,14 +424,14 @@ odm_RxPhyStatus92CSeries_Parsing(
//2011.11.28 LukeLee: 88E use different LNA & VGA gain table
//The RSSI formula should be modified according to the gain table
//In 88E, cck_highpwr is always set to 1
if(pDM_Odm->SupportICType & (ODM_RTL8188E|ODM_RTL8812))
if (pDM_Odm->SupportICType & (ODM_RTL8188E|ODM_RTL8812))
{
LNA_idx = ((cck_agc_rpt & 0xE0) >>5);
VGA_idx = (cck_agc_rpt & 0x1F);
switch(LNA_idx)
switch (LNA_idx)
{
case 7:
if(VGA_idx <= 27)
if (VGA_idx <= 27)
rx_pwr_all = -100 + 2*(27-VGA_idx); //VGA_idx = 27~2
else
rx_pwr_all = -100;
@ -450,7 +450,7 @@ odm_RxPhyStatus92CSeries_Parsing(
rx_pwr_all = -24 + 2*(7-VGA_idx); //VGA_idx = 7~0
break;
case 2:
if(cck_highpwr)
if (cck_highpwr)
rx_pwr_all = -12 + 2*(5-VGA_idx); //VGA_idx = 5~0
else
rx_pwr_all = -6+ 2*(5-VGA_idx);
@ -467,22 +467,22 @@ odm_RxPhyStatus92CSeries_Parsing(
}
rx_pwr_all += 6;
PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all);
if(cck_highpwr == FALSE)
if (cck_highpwr == FALSE)
{
if(PWDB_ALL >= 80)
if (PWDB_ALL >= 80)
PWDB_ALL = ((PWDB_ALL-80)<<1)+((PWDB_ALL-80)>>1)+80;
else if((PWDB_ALL <= 78) && (PWDB_ALL >= 20))
else if ((PWDB_ALL <= 78) && (PWDB_ALL >= 20))
PWDB_ALL += 3;
if(PWDB_ALL>100)
if (PWDB_ALL>100)
PWDB_ALL = 100;
}
}
else
{
if(!cck_highpwr)
if (!cck_highpwr)
{
report =( cck_agc_rpt & 0xc0 )>>6;
switch(report)
switch (report)
{
// 03312009 modified by cosa
// Modify the RF RNA gain value to -40, -20, -2, 14 by Jenyu's suggestion
@ -507,7 +507,7 @@ odm_RxPhyStatus92CSeries_Parsing(
//report = pPhyStaRpt->cck_agc_rpt_ofdm_cfosho_a& 0x60;
report = (cck_agc_rpt & 0x60)>>5;
switch(report)
switch (report)
{
case 0x3:
rx_pwr_all = -46 - ((cck_agc_rpt & 0x1f)<<1) ;
@ -527,30 +527,30 @@ odm_RxPhyStatus92CSeries_Parsing(
PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all);
//Modification for ext-LNA board
if(pDM_Odm->BoardType == ODM_BOARD_HIGHPWR)
if (pDM_Odm->BoardType == ODM_BOARD_HIGHPWR)
{
if((cck_agc_rpt>>7) == 0){
if ((cck_agc_rpt>>7) == 0){
PWDB_ALL = (PWDB_ALL>94)?100:(PWDB_ALL +6);
}
else
{
if(PWDB_ALL > 38)
if (PWDB_ALL > 38)
PWDB_ALL -= 16;
else
PWDB_ALL = (PWDB_ALL<=16)?(PWDB_ALL>>2):(PWDB_ALL -12);
}
//CCK modification
if(PWDB_ALL > 25 && PWDB_ALL <= 60)
if (PWDB_ALL > 25 && PWDB_ALL <= 60)
PWDB_ALL += 6;
//else if (PWDB_ALL <= 25)
// PWDB_ALL += 8;
}
else//Modification for int-LNA board
{
if(PWDB_ALL > 99)
if (PWDB_ALL > 99)
PWDB_ALL -= 8;
else if(PWDB_ALL > 50 && PWDB_ALL <= 68)
else if (PWDB_ALL > 50 && PWDB_ALL <= 68)
PWDB_ALL += 4;
}
}
@ -563,20 +563,20 @@ odm_RxPhyStatus92CSeries_Parsing(
//
// (3) Get Signal Quality (EVM)
//
if(pPktinfo->bPacketMatchBSSID)
if (pPktinfo->bPacketMatchBSSID)
{
u1Byte SQ,SQ_rpt;
if((pDM_Odm->SupportPlatform == ODM_MP) &&(pDM_Odm->PatchID==19)){//pMgntInfo->CustomerID == RT_CID_819x_Lenovo
if ((pDM_Odm->SupportPlatform == ODM_MP) &&(pDM_Odm->PatchID==19)){//pMgntInfo->CustomerID == RT_CID_819x_Lenovo
SQ = odm_SQ_process_patch_RT_CID_819x_Lenovo(pDM_Odm,isCCKrate,PWDB_ALL,0,0);
}
else if(pPhyInfo->RxPWDBAll > 40 && !pDM_Odm->bInHctTest){
else if (pPhyInfo->RxPWDBAll > 40 && !pDM_Odm->bInHctTest){
SQ = 100;
}
else{
SQ_rpt = pPhyStaRpt->cck_sig_qual_ofdm_pwdb_all;
if(SQ_rpt > 64)
if (SQ_rpt > 64)
SQ = 0;
else if (SQ_rpt < 20)
SQ = 100;
@ -599,7 +599,7 @@ odm_RxPhyStatus92CSeries_Parsing(
// (1)Get RSSI for HT rate
//
for(i = ODM_RF_PATH_A; i < ODM_RF_PATH_MAX; i++)
for (i = ODM_RF_PATH_A; i < ODM_RF_PATH_MAX; i++)
{
// 2008/01/30 MH we will judge RF RX path now.
if (pDM_Odm->RFPathRxEnable & BIT(i))
@ -619,14 +619,14 @@ odm_RxPhyStatus92CSeries_Parsing(
//RTPRINT(FRX, RX_PHY_SS, ("RF-%d RXPWR=%x RSSI=%d\n", i, rx_pwr[i], RSSI));
//Modification for ext-LNA board
if(pDM_Odm->BoardType == ODM_BOARD_HIGHPWR)
if (pDM_Odm->BoardType == ODM_BOARD_HIGHPWR)
{
if((pPhyStaRpt->path_agc[i].trsw) == 1)
if ((pPhyStaRpt->path_agc[i].trsw) == 1)
RSSI = (RSSI>94)?100:(RSSI +6);
else
RSSI = (RSSI<=16)?(RSSI>>3):(RSSI -16);
if((RSSI <= 34) && (RSSI >=4))
if ((RSSI <= 34) && (RSSI >=4))
RSSI -= 4;
}
@ -638,11 +638,11 @@ odm_RxPhyStatus92CSeries_Parsing(
#endif
/* Record Signal Strength for next packet */
if(pPktinfo->bPacketMatchBSSID)
if (pPktinfo->bPacketMatchBSSID)
{
if((pDM_Odm->SupportPlatform == ODM_MP) &&(pDM_Odm->PatchID==19))
if ((pDM_Odm->SupportPlatform == ODM_MP) &&(pDM_Odm->PatchID==19))
{
if(i==ODM_RF_PATH_A)
if (i==ODM_RF_PATH_A)
pPhyInfo->SignalQuality = odm_SQ_process_patch_RT_CID_819x_Lenovo(pDM_Odm,isCCKrate,PWDB_ALL,i,RSSI);
}
@ -668,19 +668,19 @@ odm_RxPhyStatus92CSeries_Parsing(
pPhyInfo->RecvSignalPower = rx_pwr_all;
#endif
if((pDM_Odm->SupportPlatform == ODM_MP) &&(pDM_Odm->PatchID==19)){
if ((pDM_Odm->SupportPlatform == ODM_MP) &&(pDM_Odm->PatchID==19)){
//do nothing
}
else{//pMgntInfo->CustomerID != RT_CID_819x_Lenovo
//
// (3)EVM of HT rate
//
if(pPktinfo->Rate >=DESC92C_RATEMCS8 && pPktinfo->Rate <=DESC92C_RATEMCS15)
if (pPktinfo->Rate >=DESC92C_RATEMCS8 && pPktinfo->Rate <=DESC92C_RATEMCS15)
Max_spatial_stream = 2; //both spatial stream make sense
else
Max_spatial_stream = 1; //only spatial stream 1 makes sense
for(i=0; i<Max_spatial_stream; i++)
for (i=0; i<Max_spatial_stream; i++)
{
// Do not use shift operation like "rx_evmX >>= 1" because the compilor of free build environment
// fill most significant bit to "zero" when doing shifting operation which may change a negative
@ -690,9 +690,9 @@ odm_RxPhyStatus92CSeries_Parsing(
//RTPRINT(FRX, RX_PHY_SQ, ("RXRATE=%x RXEVM=%x EVM=%s%d\n",
//GET_RX_STATUS_DESC_RX_MCS(pDesc), pDrvInfo->rxevm[i], "%", EVM));
if(pPktinfo->bPacketMatchBSSID)
if (pPktinfo->bPacketMatchBSSID)
{
if(i==ODM_RF_PATH_A) // Fill value in RFD, Get the first spatial stream only
if (i==ODM_RF_PATH_A) // Fill value in RFD, Get the first spatial stream only
{
pPhyInfo->SignalQuality = (u1Byte)(EVM & 0xff);
}
@ -705,7 +705,7 @@ odm_RxPhyStatus92CSeries_Parsing(
#if (DM_ODM_SUPPORT_TYPE & (ODM_MP|ODM_CE))
//UI BSS List signal strength(in percentage), make it good looking, from 0~100.
//It is assigned to the BSS List in GetValueFromBeaconOrProbeRsp().
if(isCCKrate)
if (isCCKrate)
{
#if (DM_ODM_SUPPORT_TYPE == ODM_MP)
// 2012/01/12 MH Use customeris signal strength from HalComRxdDesc.c/
@ -729,7 +729,7 @@ odm_RxPhyStatus92CSeries_Parsing(
#endif
//For 92C/92D HW (Hybrid) Antenna Diversity
#if(defined(CONFIG_HW_ANTENNA_DIVERSITY))
#if (defined(CONFIG_HW_ANTENNA_DIVERSITY))
pDM_SWAT_Table->antsel = pPhyStaRpt->ant_sel;
//For 88E HW Antenna Diversity
pDM_Odm->DM_FatTable.antsel_rx_keep_0 = pPhyStaRpt->ant_sel;
@ -762,7 +762,7 @@ odm_Process_RSSIForDM(
PSTA_INFO_T pEntry;
if(pPktinfo->StationID == 0xFF)
if (pPktinfo->StationID == 0xFF)
return;
// 2011/11/17 MH Need to debug
@ -772,23 +772,23 @@ odm_Process_RSSIForDM(
}
pEntry = pDM_Odm->pODM_StaInfo[pPktinfo->StationID];
if(!IS_STA_VALID(pEntry) ){
if (!IS_STA_VALID(pEntry) ){
return;
}
if((!pPktinfo->bPacketMatchBSSID) )
if ((!pPktinfo->bPacketMatchBSSID) )
{
return;
}
isCCKrate = ((pPktinfo->Rate >= DESC92C_RATE1M ) && (pPktinfo->Rate <= DESC92C_RATE11M ))?TRUE :FALSE;
#if(defined(CONFIG_HW_ANTENNA_DIVERSITY))
#if (defined(CONFIG_HW_ANTENNA_DIVERSITY))
#if ((RTL8192C_SUPPORT == 1) ||(RTL8192D_SUPPORT == 1))
if(pDM_Odm->SupportICType & ODM_RTL8192C|ODM_RTL8192D)
if (pDM_Odm->SupportICType & ODM_RTL8192C|ODM_RTL8192D)
{
if(pPktinfo->bPacketToSelf || pPktinfo->bPacketBeacon)
if (pPktinfo->bPacketToSelf || pPktinfo->bPacketBeacon)
{
//if(pPktinfo->bPacketBeacon)
//if (pPktinfo->bPacketBeacon)
//{
// DbgPrint("This is beacon, isCCKrate=%d\n", isCCKrate);
//}
@ -798,16 +798,16 @@ odm_Process_RSSIForDM(
#endif
//-----------------Smart Antenna Debug Message------------------//
#if (RTL8188E_SUPPORT == 1)
if(pDM_Odm->SupportICType == ODM_RTL8188E)
if (pDM_Odm->SupportICType == ODM_RTL8188E)
{
u1Byte antsel_tr_mux;
pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable;
if(pDM_Odm->AntDivType == CG_TRX_SMART_ANTDIV)
if (pDM_Odm->AntDivType == CG_TRX_SMART_ANTDIV)
{
if(pDM_FatTable->FAT_State == FAT_TRAINING_STATE)
if (pDM_FatTable->FAT_State == FAT_TRAINING_STATE)
{
if(pPktinfo->bPacketToSelf) //(pPktinfo->bPacketMatchBSSID && (!pPktinfo->bPacketBeacon))
if (pPktinfo->bPacketToSelf) //(pPktinfo->bPacketMatchBSSID && (!pPktinfo->bPacketBeacon))
{
antsel_tr_mux = (pDM_FatTable->antsel_rx_keep_2<<2) |(pDM_FatTable->antsel_rx_keep_1 <<1) |pDM_FatTable->antsel_rx_keep_0;
pDM_FatTable->antSumRSSI[antsel_tr_mux] += pPhyInfo->RxPWDBAll;
@ -819,9 +819,9 @@ odm_Process_RSSIForDM(
}
}
}
else if((pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)||(pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV))
else if ((pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)||(pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV))
{
if(pPktinfo->bPacketToSelf || pPktinfo->bPacketBeacon)
if (pPktinfo->bPacketToSelf || pPktinfo->bPacketBeacon)
{
antsel_tr_mux = (pDM_FatTable->antsel_rx_keep_2<<2) |(pDM_FatTable->antsel_rx_keep_1 <<1) |pDM_FatTable->antsel_rx_keep_0;
//ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("antsel_tr_mux=3'b%d%d%d\n",
@ -833,19 +833,19 @@ odm_Process_RSSIForDM(
}
#endif
#endif //#if(defined(CONFIG_HW_ANTENNA_DIVERSITY))
#endif //#if (defined(CONFIG_HW_ANTENNA_DIVERSITY))
//-----------------Smart Antenna Debug Message------------------//
UndecoratedSmoothedCCK = pEntry->rssi_stat.UndecoratedSmoothedCCK;
UndecoratedSmoothedOFDM = pEntry->rssi_stat.UndecoratedSmoothedOFDM;
UndecoratedSmoothedPWDB = pEntry->rssi_stat.UndecoratedSmoothedPWDB;
if(pPktinfo->bPacketToSelf || pPktinfo->bPacketBeacon)
if (pPktinfo->bPacketToSelf || pPktinfo->bPacketBeacon)
{
if(!isCCKrate)//ofdm rate
if (!isCCKrate)//ofdm rate
{
if(pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_B] == 0){
if (pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_B] == 0){
RSSI_Ave = pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_A];
}
else
@ -854,7 +854,7 @@ odm_Process_RSSIForDM(
//pRfd->Status.RxMIMOSignalStrength[0], pRfd->Status.RxMIMOSignalStrength[1]);
if(pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_A] > pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_B])
if (pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_A] > pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_B])
{
RSSI_max = pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_A];
RSSI_min = pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_B];
@ -864,24 +864,24 @@ odm_Process_RSSIForDM(
RSSI_max = pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_B];
RSSI_min = pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_A];
}
if((RSSI_max -RSSI_min) < 3)
if ((RSSI_max -RSSI_min) < 3)
RSSI_Ave = RSSI_max;
else if((RSSI_max -RSSI_min) < 6)
else if ((RSSI_max -RSSI_min) < 6)
RSSI_Ave = RSSI_max - 1;
else if((RSSI_max -RSSI_min) < 10)
else if ((RSSI_max -RSSI_min) < 10)
RSSI_Ave = RSSI_max - 2;
else
RSSI_Ave = RSSI_max - 3;
}
//1 Process OFDM RSSI
if(UndecoratedSmoothedOFDM <= 0) // initialize
if (UndecoratedSmoothedOFDM <= 0) // initialize
{
UndecoratedSmoothedOFDM = pPhyInfo->RxPWDBAll;
}
else
{
if(pPhyInfo->RxPWDBAll > (u4Byte)UndecoratedSmoothedOFDM)
if (pPhyInfo->RxPWDBAll > (u4Byte)UndecoratedSmoothedOFDM)
{
UndecoratedSmoothedOFDM =
( ((UndecoratedSmoothedOFDM)*(Rx_Smooth_Factor-1)) +
@ -904,13 +904,13 @@ odm_Process_RSSIForDM(
RSSI_Ave = pPhyInfo->RxPWDBAll;
//1 Process CCK RSSI
if(UndecoratedSmoothedCCK <= 0) // initialize
if (UndecoratedSmoothedCCK <= 0) // initialize
{
UndecoratedSmoothedCCK = pPhyInfo->RxPWDBAll;
}
else
{
if(pPhyInfo->RxPWDBAll > (u4Byte)UndecoratedSmoothedCCK)
if (pPhyInfo->RxPWDBAll > (u4Byte)UndecoratedSmoothedCCK)
{
UndecoratedSmoothedCCK =
( ((UndecoratedSmoothedCCK)*(Rx_Smooth_Factor-1)) +
@ -927,25 +927,25 @@ odm_Process_RSSIForDM(
pEntry->rssi_stat.PacketMap = pEntry->rssi_stat.PacketMap<<1;
}
//if(pEntry)
//if (pEntry)
{
//2011.07.28 LukeLee: modified to prevent unstable CCK RSSI
if(pEntry->rssi_stat.ValidBit >= 64)
if (pEntry->rssi_stat.ValidBit >= 64)
pEntry->rssi_stat.ValidBit = 64;
else
pEntry->rssi_stat.ValidBit++;
for(i=0; i<pEntry->rssi_stat.ValidBit; i++)
for (i=0; i<pEntry->rssi_stat.ValidBit; i++)
OFDM_pkt += (u1Byte)(pEntry->rssi_stat.PacketMap>>i)&BIT0;
if(pEntry->rssi_stat.ValidBit == 64)
if (pEntry->rssi_stat.ValidBit == 64)
{
Weighting = ((OFDM_pkt<<4) > 64)?64:(OFDM_pkt<<4);
UndecoratedSmoothedPWDB = (Weighting*UndecoratedSmoothedOFDM+(64-Weighting)*UndecoratedSmoothedCCK)>>6;
}
else
{
if(pEntry->rssi_stat.ValidBit != 0)
if (pEntry->rssi_stat.ValidBit != 0)
UndecoratedSmoothedPWDB = (OFDM_pkt*UndecoratedSmoothedOFDM+(pEntry->rssi_stat.ValidBit-OFDM_pkt)*UndecoratedSmoothedCCK)/pEntry->rssi_stat.ValidBit;
else
UndecoratedSmoothedPWDB = 0;
@ -983,10 +983,10 @@ ODM_PhyStatusQuery_92CSeries(
pPhyStatus,
pPktinfo);
if( pDM_Odm->RSSI_test == TRUE)
if ( pDM_Odm->RSSI_test == TRUE)
{
// Select the packets to do RSSI checking for antenna switching.
if(pPktinfo->bPacketToSelf || pPktinfo->bPacketBeacon )
if (pPktinfo->bPacketToSelf || pPktinfo->bPacketBeacon )
{
/*
#if 0//(DM_ODM_SUPPORT_TYPE == ODM_MP)
@ -1037,7 +1037,7 @@ ODM_PhyStatusQuery(
)
{
#if 0 // How to jaguar jugar series??
if(pDM_Odm->SupportICType >= ODM_RTL8195 )
if (pDM_Odm->SupportICType >= ODM_RTL8195 )
{
ODM_PhyStatusQuery_JaguarSeries(pDM_Odm,pPhyInfo,pPhyStatus,pPktinfo);
}
@ -1079,7 +1079,7 @@ ODM_ConfigRFWithHeaderFile(
#if (RTL8723A_SUPPORT == 1)
if (pDM_Odm->SupportICType == ODM_RTL8723A)
{
if(eRFPath == ODM_RF_PATH_A)
if (eRFPath == ODM_RF_PATH_A)
READ_AND_CONFIG_MP(8723A,_RadioA_1T_);
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, (" ===> ODM_ConfigRFWithHeaderFile() Radio_A:Rtl8723RadioA_1TArray\n"));
@ -1092,9 +1092,9 @@ ODM_ConfigRFWithHeaderFile(
#if (RTL8188E_SUPPORT == 1)
if (pDM_Odm->SupportICType == ODM_RTL8188E)
{
if(eRFPath == ODM_RF_PATH_A)
if (eRFPath == ODM_RF_PATH_A)
READ_AND_CONFIG(8188E,_RadioA_1T_);
//else if(eRFPath == ODM_RF_PATH_B)
//else if (eRFPath == ODM_RF_PATH_B)
// READ_AND_CONFIG(8188E,_RadioB_1T_);
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, (" ===> ODM_ConfigRFWithHeaderFile() Radio_A:Rtl8188ERadioA_1TArray\n"));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, (" ===> ODM_ConfigRFWithHeaderFile() Radio_B:Rtl8188ERadioB_1TArray\n"));
@ -1114,14 +1114,14 @@ ODM_ConfigBBWithHeaderFile(
)
{
#if (RTL8723A_SUPPORT == 1)
if(pDM_Odm->SupportICType == ODM_RTL8723A)
if (pDM_Odm->SupportICType == ODM_RTL8723A)
{
if(ConfigType == CONFIG_BB_PHY_REG)
if (ConfigType == CONFIG_BB_PHY_REG)
{
READ_AND_CONFIG_MP(8723A,_PHY_REG_1T_);
}
else if(ConfigType == CONFIG_BB_AGC_TAB)
else if (ConfigType == CONFIG_BB_AGC_TAB)
{
READ_AND_CONFIG_MP(8723A,_AGC_TAB_1T_);
}
@ -1131,22 +1131,22 @@ ODM_ConfigBBWithHeaderFile(
#endif
#if (RTL8188E_SUPPORT == 1)
if(pDM_Odm->SupportICType == ODM_RTL8188E)
if (pDM_Odm->SupportICType == ODM_RTL8188E)
{
if(ConfigType == CONFIG_BB_PHY_REG)
if (ConfigType == CONFIG_BB_PHY_REG)
{
READ_AND_CONFIG(8188E,_PHY_REG_1T_);
}
// else if(ConfigType == ODM_BaseBand_Config_PHY_REG_MP)
// else if (ConfigType == ODM_BaseBand_Config_PHY_REG_MP)
// {
//READ_AND_CONFIG(8188E,_PHY_REG_MP_);
// }
else if(ConfigType == CONFIG_BB_AGC_TAB)
else if (ConfigType == CONFIG_BB_AGC_TAB)
{
READ_AND_CONFIG(8188E,_AGC_TAB_1T_);
}
else if(ConfigType == CONFIG_BB_PHY_REG_PG)
else if (ConfigType == CONFIG_BB_PHY_REG_PG)
{
READ_AND_CONFIG(8188E,_PHY_REG_PG_);
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_LOUD, (" ===> phy_ConfigBBWithHeaderFile() agc:Rtl8188EPHY_REG_PGArray\n"));

View file

@ -33,7 +33,7 @@ ODM_DIG_LowerBound_88E(
{
pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable;
if(pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)
if (pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)
{
pDM_DigTable->rx_gain_range_min = (u1Byte) pDM_DigTable->AntDiv_RSSI_max;
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_DIG_LowerBound_88E(): pDM_DigTable->AntDiv_RSSI_max=%d \n",pDM_DigTable->AntDiv_RSSI_max));
@ -44,7 +44,7 @@ ODM_DIG_LowerBound_88E(
}
#if(defined(CONFIG_HW_ANTENNA_DIVERSITY))
#if (defined(CONFIG_HW_ANTENNA_DIVERSITY))
VOID
odm_RX_HWAntDivInit(
IN PDM_ODM_T pDM_Odm
@ -122,7 +122,7 @@ odm_TRX_HWAntDivInit(
ODM_UpdateRxIdleAnt_88E(pDM_Odm, MAIN_ANT);
//antenna mapping table
if(!pDM_Odm->bIsMPChip) //testchip
if (!pDM_Odm->bIsMPChip) //testchip
{
ODM_SetBBReg(pDM_Odm, ODM_REG_RX_DEFUALT_A_11N , BIT10|BIT9|BIT8, 1); //Reg858[10:8]=3'b001
ODM_SetBBReg(pDM_Odm, ODM_REG_RX_DEFUALT_A_11N , BIT13|BIT12|BIT11, 2); //Reg858[13:11]=3'b010
@ -153,7 +153,7 @@ odm_FastAntTrainingInit(
}
#endif
for(i=0; i<6; i++)
for (i=0; i<6; i++)
{
pDM_FatTable->Bssid[i] = 0;
pDM_FatTable->antSumRSSI[i] = 0;
@ -182,9 +182,9 @@ odm_FastAntTrainingInit(
ODM_SetBBReg(pDM_Odm, 0xca4 , bMaskDWord, 0x000000a0);
//antenna mapping table
if(AntCombination == 2)
if (AntCombination == 2)
{
if(!pDM_Odm->bIsMPChip) //testchip
if (!pDM_Odm->bIsMPChip) //testchip
{
ODM_SetBBReg(pDM_Odm, 0x858 , BIT10|BIT9|BIT8, 1); //Reg858[10:8]=3'b001
ODM_SetBBReg(pDM_Odm, 0x858 , BIT13|BIT12|BIT11, 2); //Reg858[13:11]=3'b010
@ -195,9 +195,9 @@ odm_FastAntTrainingInit(
ODM_SetBBReg(pDM_Odm, 0x914 , bMaskByte1, 2);
}
}
else if(AntCombination == 7)
else if (AntCombination == 7)
{
if(!pDM_Odm->bIsMPChip) //testchip
if (!pDM_Odm->bIsMPChip) //testchip
{
ODM_SetBBReg(pDM_Odm, 0x858 , BIT10|BIT9|BIT8, 0); //Reg858[10:8]=3'b000
ODM_SetBBReg(pDM_Odm, 0x858 , BIT13|BIT12|BIT11, 1); //Reg858[13:11]=3'b001
@ -259,7 +259,7 @@ ODM_AntennaDiversityInit_88E(
//pHalData->AntDivCfg = 1;
//}
*/
if(pDM_Odm->SupportICType != ODM_RTL8188E)
if (pDM_Odm->SupportICType != ODM_RTL8188E)
return;
//ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("pDM_Odm->AntDivType=%d, pHalData->AntDivCfg=%d\n",
@ -267,11 +267,11 @@ ODM_AntennaDiversityInit_88E(
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("pDM_Odm->AntDivType=%d\n",pDM_Odm->AntDivType));
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("pDM_Odm->bIsMPChip=%s\n",(pDM_Odm->bIsMPChip?"TRUE":"FALSE")));
if(pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV)
if (pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV)
odm_RX_HWAntDivInit(pDM_Odm);
else if(pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)
else if (pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)
odm_TRX_HWAntDivInit(pDM_Odm);
else if(pDM_Odm->AntDivType == CG_TRX_SMART_ANTDIV)
else if (pDM_Odm->AntDivType == CG_TRX_SMART_ANTDIV)
odm_FastAntTrainingInit(pDM_Odm);
}
@ -282,10 +282,10 @@ ODM_UpdateRxIdleAnt_88E(IN PDM_ODM_T pDM_Odm, IN u1Byte Ant)
pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable;
u4Byte DefaultAnt, OptionalAnt;
if(pDM_FatTable->RxIdleAnt != Ant)
if (pDM_FatTable->RxIdleAnt != Ant)
{
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Need to Update Rx Idle Ant\n"));
if(Ant == MAIN_ANT)
if (Ant == MAIN_ANT)
{
DefaultAnt = (pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)?MAIN_ANT_CG_TRX:MAIN_ANT_CGCS_RX;
OptionalAnt = (pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)?AUX_ANT_CG_TRX:AUX_ANT_CGCS_RX;
@ -296,7 +296,7 @@ ODM_UpdateRxIdleAnt_88E(IN PDM_ODM_T pDM_Odm, IN u1Byte Ant)
OptionalAnt = (pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)?MAIN_ANT_CG_TRX:MAIN_ANT_CGCS_RX;
}
if(pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)
if (pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)
{
ODM_SetBBReg(pDM_Odm, ODM_REG_RX_ANT_CTRL_11N , BIT5|BIT4|BIT3, DefaultAnt); //Default RX
ODM_SetBBReg(pDM_Odm, ODM_REG_RX_ANT_CTRL_11N , BIT8|BIT7|BIT6, OptionalAnt); //Optional RX
@ -304,7 +304,7 @@ ODM_UpdateRxIdleAnt_88E(IN PDM_ODM_T pDM_Odm, IN u1Byte Ant)
ODM_SetMACReg(pDM_Odm, ODM_REG_RESP_TX_11N , BIT6|BIT7, DefaultAnt); //Resp Tx
}
else if(pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV)
else if (pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV)
{
ODM_SetBBReg(pDM_Odm, ODM_REG_RX_ANT_CTRL_11N , BIT5|BIT4|BIT3, DefaultAnt); //Default RX
ODM_SetBBReg(pDM_Odm, ODM_REG_RX_ANT_CTRL_11N , BIT8|BIT7|BIT6, OptionalAnt); //Optional RX
@ -322,7 +322,7 @@ odm_UpdateTxAnt_88E(IN PDM_ODM_T pDM_Odm, IN u1Byte Ant, IN u4Byte MacId)
pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable;
u1Byte TargetAnt;
if(Ant == MAIN_ANT)
if (Ant == MAIN_ANT)
TargetAnt = MAIN_ANT_CG_TRX;
else
TargetAnt = AUX_ANT_CG_TRX;
@ -347,7 +347,7 @@ ODM_SetTxAntByTxInfo_88E(
{
pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable;
if((pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)||(pDM_Odm->AntDivType == CG_TRX_SMART_ANTDIV))
if ((pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)||(pDM_Odm->AntDivType == CG_TRX_SMART_ANTDIV))
{
SET_TX_DESC_ANTSEL_A_88E(pDesc, pDM_FatTable->antsel_a[macId]);
SET_TX_DESC_ANTSEL_B_88E(pDesc, pDM_FatTable->antsel_b[macId]);
@ -374,9 +374,9 @@ ODM_AntselStatistics_88E(
)
{
pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable;
if(pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)
if (pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)
{
if(antsel_tr_mux == MAIN_ANT_CG_TRX)
if (antsel_tr_mux == MAIN_ANT_CG_TRX)
{
pDM_FatTable->MainAnt_Sum[MacId]+=RxPWDBAll;
@ -389,9 +389,9 @@ ODM_AntselStatistics_88E(
}
}
else if(pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV)
else if (pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV)
{
if(antsel_tr_mux == MAIN_ANT_CGCS_RX)
if (antsel_tr_mux == MAIN_ANT_CGCS_RX)
{
pDM_FatTable->MainAnt_Sum[MacId]+=RxPWDBAll;
@ -424,7 +424,7 @@ odm_HWAntDiv(
for (i=0; i<ODM_ASSOCIATE_ENTRY_NUM; i++)
{
pEntry = pDM_Odm->pODM_StaInfo[i];
if(IS_STA_VALID(pEntry))
if (IS_STA_VALID(pEntry))
{
//2 Caculate RSSI per Antenna
Main_RSSI = (pDM_FatTable->MainAnt_Cnt[i]!=0)?(pDM_FatTable->MainAnt_Sum[i]/pDM_FatTable->MainAnt_Cnt[i]):0;
@ -436,19 +436,19 @@ odm_HWAntDiv(
//2 Select MaxRSSI for DIG
LocalMaxRSSI = (Main_RSSI>Aux_RSSI)?Main_RSSI:Aux_RSSI;
if((LocalMaxRSSI > AntDivMaxRSSI) && (LocalMaxRSSI < 40))
if ((LocalMaxRSSI > AntDivMaxRSSI) && (LocalMaxRSSI < 40))
AntDivMaxRSSI = LocalMaxRSSI;
if(LocalMaxRSSI > MaxRSSI)
if (LocalMaxRSSI > MaxRSSI)
MaxRSSI = LocalMaxRSSI;
//2 Select RX Idle Antenna
if((pDM_FatTable->RxIdleAnt == MAIN_ANT) && (Main_RSSI == 0))
if ((pDM_FatTable->RxIdleAnt == MAIN_ANT) && (Main_RSSI == 0))
Main_RSSI = Aux_RSSI;
else if((pDM_FatTable->RxIdleAnt == AUX_ANT) && (Aux_RSSI == 0))
else if ((pDM_FatTable->RxIdleAnt == AUX_ANT) && (Aux_RSSI == 0))
Aux_RSSI = Main_RSSI;
LocalMinRSSI = (Main_RSSI>Aux_RSSI)?Aux_RSSI:Main_RSSI;
if(LocalMinRSSI < MinRSSI)
if (LocalMinRSSI < MinRSSI)
{
MinRSSI = LocalMinRSSI;
RxIdleAnt = TargetAnt;
@ -457,7 +457,7 @@ odm_HWAntDiv(
#else
//2 Select TRX Antenna
if(pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)
if (pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)
odm_UpdateTxAnt_88E(pDM_Odm, TargetAnt, i);
#endif
}
@ -490,17 +490,17 @@ odm_SetNextMACAddrTarget(
//2012.03.26 LukeLee: The MAC address is changed according to MACID in turn
//
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_SetNextMACAddrTarget() ==>\n"));
if(pDM_Odm->bLinked)
if (pDM_Odm->bLinked)
{
for (i=0; i<ODM_ASSOCIATE_ENTRY_NUM; i++)
{
if((pDM_FatTable->TrainIdx+1) == ODM_ASSOCIATE_ENTRY_NUM)
if ((pDM_FatTable->TrainIdx+1) == ODM_ASSOCIATE_ENTRY_NUM)
pDM_FatTable->TrainIdx = 0;
else
pDM_FatTable->TrainIdx++;
pEntry = pDM_Odm->pODM_StaInfo[pDM_FatTable->TrainIdx];
if(IS_STA_VALID(pEntry))
if (IS_STA_VALID(pEntry))
{
//Match MAC ADDR
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
@ -535,7 +535,7 @@ odm_SetNextMACAddrTarget(
//
//2012.03.26 LukeLee: This should be removed later, the MAC address is changed according to MACID in turn
//
#if( DM_ODM_SUPPORT_TYPE & ODM_MP)
#if ( DM_ODM_SUPPORT_TYPE & ODM_MP)
{
PADAPTER Adapter = pDM_Odm->Adapter;
PMGNT_INFO pMgntInfo = &Adapter->MgntInfo;
@ -553,13 +553,13 @@ odm_SetNextMACAddrTarget(
//1 Select MAC Address Filter
for (i=0; i<6; i++)
{
if(Bssid[i] != pDM_FatTable->Bssid[i])
if (Bssid[i] != pDM_FatTable->Bssid[i])
{
bMatchBSSID = FALSE;
break;
}
}
if(bMatchBSSID == FALSE)
if (bMatchBSSID == FALSE)
{
//Match MAC ADDR
value32 = (Bssid[5]<<8)|Bssid[4];
@ -588,20 +588,20 @@ odm_FastAntTraining(
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("==>odm_FastAntTraining()\n"));
//1 TRAINING STATE
if(pDM_FatTable->FAT_State == FAT_TRAINING_STATE)
if (pDM_FatTable->FAT_State == FAT_TRAINING_STATE)
{
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Enter FAT_TRAINING_STATE\n"));
//2 Caculate RSSI per Antenna
for (i=0; i<7; i++)
{
if(pDM_FatTable->antRSSIcnt[i] == 0)
if (pDM_FatTable->antRSSIcnt[i] == 0)
pDM_FatTable->antAveRSSI[i] = 0;
else
{
pDM_FatTable->antAveRSSI[i] = pDM_FatTable->antSumRSSI[i] /pDM_FatTable->antRSSIcnt[i];
bPktFilterMacth = TRUE;
}
if(pDM_FatTable->antAveRSSI[i] > MaxRSSI)
if (pDM_FatTable->antAveRSSI[i] > MaxRSSI)
{
MaxRSSI = pDM_FatTable->antAveRSSI[i];
TargetAnt = (u1Byte) i;
@ -612,7 +612,7 @@ odm_FastAntTraining(
}
//2 Select TRX Antenna
if(bPktFilterMacth == FALSE)
if (bPktFilterMacth == FALSE)
{
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("None Packet is matched\n"));
@ -632,7 +632,7 @@ odm_FastAntTraining(
#if 0
pEntry = pDM_Odm->pODM_StaInfo[pDM_FatTable->TrainIdx];
if(IS_STA_VALID(pEntry))
if (IS_STA_VALID(pEntry))
{
pEntry->antsel_a = TargetAnt&BIT0;
pEntry->antsel_b = (TargetAnt&BIT1)>>1;
@ -645,13 +645,13 @@ odm_FastAntTraining(
#endif
if(TargetAnt == 0)
if (TargetAnt == 0)
ODM_SetBBReg(pDM_Odm, 0xc50 , BIT7, 0); //RegC50[7]=1'b0 //disable HW AntDiv
}
//2 Reset Counter
for(i=0; i<7; i++)
for (i=0; i<7; i++)
{
pDM_FatTable->antSumRSSI[i] = 0;
pDM_FatTable->antRSSIcnt[i] = 0;
@ -662,7 +662,7 @@ odm_FastAntTraining(
}
//1 NORMAL STATE
if(pDM_FatTable->FAT_State == FAT_NORMAL_STATE)
if (pDM_FatTable->FAT_State == FAT_NORMAL_STATE)
{
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Enter FAT_NORMAL_STATE\n"));
@ -670,7 +670,7 @@ odm_FastAntTraining(
#if 0
pEntry = pDM_Odm->pODM_StaInfo[pDM_FatTable->TrainIdx];
if(IS_STA_VALID(pEntry))
if (IS_STA_VALID(pEntry))
{
pEntry->antsel_a = TargetAnt&BIT0;
pEntry->antsel_b = (TargetAnt&BIT1)>>1;
@ -697,9 +697,9 @@ odm_FastAntTrainingCallback(
#if (DM_ODM_SUPPORT_TYPE == ODM_CE)
PADAPTER padapter = pDM_Odm->Adapter;
if(padapter->net_closed == _TRUE)
if (padapter->net_closed == _TRUE)
return;
//if(*pDM_Odm->pbNet_closed == TRUE)
//if (*pDM_Odm->pbNet_closed == TRUE)
// return;
#endif
@ -725,14 +725,14 @@ ODM_AntennaDiversity_88E(
)
{
pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable;
if((pDM_Odm->SupportICType != ODM_RTL8188E) || (!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV)))
if ((pDM_Odm->SupportICType != ODM_RTL8188E) || (!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV)))
{
//ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_AntennaDiversity_88E: Not Support 88E AntDiv\n"));
return;
}
#ifdef CONFIG_SPECIAL_SETTING_FOR_FUNAI_TV
if(pDM_Odm->bLinked){
if(pDM_Odm->Adapter->registrypriv.force_ant != 0)
if (pDM_Odm->bLinked){
if (pDM_Odm->Adapter->registrypriv.force_ant != 0)
{
u4Byte Main_RSSI, Aux_RSSI;
u8 i=0;
@ -747,12 +747,12 @@ ODM_AntennaDiversity_88E(
pDM_FatTable->MainAnt_Cnt[i] = 0;
pDM_FatTable->AuxAnt_Cnt[i] = 0;
}
if(pDM_Odm->Adapter->registrypriv.force_ant==1){
if (pDM_Odm->Adapter->registrypriv.force_ant==1){
ODM_UpdateRxIdleAnt_88E(pDM_Odm, MAIN_ANT);
printk("%s fixed antenna in Main ant\n",__FUNCTION__);
return;
}
else if(pDM_Odm->Adapter->registrypriv.force_ant==2){
else if (pDM_Odm->Adapter->registrypriv.force_ant==2){
ODM_UpdateRxIdleAnt_88E(pDM_Odm, AUX_ANT);
printk("%s fixed antenna in AUX ant\n",__FUNCTION__);
return;
@ -762,15 +762,15 @@ ODM_AntennaDiversity_88E(
if(!pDM_Odm->bLinked)
if (!pDM_Odm->bLinked)
{
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("ODM_AntennaDiversity_88E(): No Link.\n"));
if(pDM_FatTable->bBecomeLinked == TRUE)
if (pDM_FatTable->bBecomeLinked == TRUE)
{
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Need to Turn off HW AntDiv\n"));
ODM_SetBBReg(pDM_Odm, ODM_REG_IGI_A_11N , BIT7, 0); //RegC50[7]=1'b1 //enable HW AntDiv
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_ANTDIV_PARA1_11N , BIT15, 0); //Enable CCK AntDiv
if(pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)
if (pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)
ODM_SetBBReg(pDM_Odm, ODM_REG_TX_ANT_CTRL_11N , BIT21, 0); //Reg80c[21]=1'b0 //from TX Reg
pDM_FatTable->bBecomeLinked = pDM_Odm->bLinked;
}
@ -778,14 +778,14 @@ ODM_AntennaDiversity_88E(
}
else
{
if(pDM_FatTable->bBecomeLinked ==FALSE)
if (pDM_FatTable->bBecomeLinked ==FALSE)
{
ODM_RT_TRACE(pDM_Odm,ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Need to Turn on HW AntDiv\n"));
//Because HW AntDiv is disabled before Link, we enable HW AntDiv after link
ODM_SetBBReg(pDM_Odm, ODM_REG_IGI_A_11N , BIT7, 1); //RegC50[7]=1'b1 //enable HW AntDiv
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_ANTDIV_PARA1_11N , BIT15, 1); //Enable CCK AntDiv
//ODM_SetMACReg(pDM_Odm, 0x7B4 , BIT18, 1); //Response Tx by current HW antdiv
if(pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)
if (pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)
{
#if TX_BY_REG
ODM_SetBBReg(pDM_Odm, ODM_REG_TX_ANT_CTRL_11N , BIT21, 0); //Reg80c[21]=1'b0 //from Reg
@ -799,10 +799,10 @@ ODM_AntennaDiversity_88E(
if((pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)||(pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV))
if ((pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)||(pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV))
odm_HWAntDiv(pDM_Odm);
#if (!(DM_ODM_SUPPORT_TYPE == ODM_CE))
else if(pDM_Odm->AntDivType == CG_TRX_SMART_ANTDIV)
else if (pDM_Odm->AntDivType == CG_TRX_SMART_ANTDIV)
odm_FastAntTraining(pDM_Odm);
#endif
}
@ -834,7 +834,7 @@ VOID odm_FastAntTrainingCallback(void *FunctionContext)
{
PDM_ODM_T pDM_Odm= (PDM_ODM_T)FunctionContext;
PADAPTER padapter = pDM_Odm->Adapter;
if(padapter->net_closed == _TRUE)
if (padapter->net_closed == _TRUE)
return;
odm_FastAntTraining(pDM_Odm);
}
@ -848,7 +848,7 @@ VOID odm_FastAntTrainingCallback(void *FunctionContext)
#endif
*/
#else //#if(defined(CONFIG_HW_ANTENNA_DIVERSITY))
#else //#if (defined(CONFIG_HW_ANTENNA_DIVERSITY))
#if (DM_ODM_SUPPORT_TYPE & (ODM_MP|ODM_CE))
VOID
ODM_SetTxAntByTxInfo_88E(
@ -866,7 +866,7 @@ ODM_SetTxAntByTxInfo_88E(
{
}
#endif
#endif //#if(defined(CONFIG_HW_ANTENNA_DIVERSITY))
#endif //#if (defined(CONFIG_HW_ANTENNA_DIVERSITY))
//3============================================================
//3 Dynamic Primary CCA
//3============================================================
@ -923,11 +923,11 @@ odm_DynamicPrimaryCCA(
u1Byte SecCHOffset;
u1Byte i;
#if((DM_ODM_SUPPORT_TYPE==ODM_ADSL) ||( DM_ODM_SUPPORT_TYPE==ODM_CE))
#if ((DM_ODM_SUPPORT_TYPE==ODM_ADSL) ||( DM_ODM_SUPPORT_TYPE==ODM_CE))
return;
#endif
if(pDM_Odm->SupportICType != ODM_RTL8188E)
if (pDM_Odm->SupportICType != ODM_RTL8188E)
return;
Is40MHz = *(pDM_Odm->pBandWidth);
@ -935,7 +935,7 @@ odm_DynamicPrimaryCCA(
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_PRICCA, ODM_DBG_LOUD, ("Second CH Offset = %d\n", SecCHOffset));
#if (DM_ODM_SUPPORT_TYPE == ODM_MP)
if(Is40MHz==1)
if (Is40MHz==1)
SecCHOffset = SecCHOffset%2+1; // NIC's definition is reverse to AP 1:secondary below, 2: secondary above
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_PRICCA, ODM_DBG_LOUD, ("Second CH Offset = %d\n", SecCHOffset));
//3 Check Current WLAN Traffic
@ -970,20 +970,20 @@ odm_DynamicPrimaryCCA(
#if (DM_ODM_SUPPORT_TYPE == ODM_MP)
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_PRICCA, ODM_DBG_LOUD, ("ACTING as AP mode=%d\n", ACTING_AS_AP(Adapter)));
//3 To get entry's connection and BW infomation status.
for(i=0;i<ASSOCIATE_ENTRY_NUM;i++)
for (i=0;i<ASSOCIATE_ENTRY_NUM;i++)
{
if(IsAPModeExist(Adapter)&&GetFirstExtAdapter(Adapter)!=NULL)
if (IsAPModeExist(Adapter)&&GetFirstExtAdapter(Adapter)!=NULL)
pEntry=AsocEntry_EnumStation(GetFirstExtAdapter(Adapter), i);
else
pEntry=AsocEntry_EnumStation(GetDefaultAdapter(Adapter), i);
if(pEntry!=NULL)
if (pEntry!=NULL)
{
Client_tmp = pEntry->HTInfo.bBw40MHz; // client BW
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_PRICCA, ODM_DBG_LOUD, ("Client_BW=%d\n", Client_tmp));
if(Client_tmp>Client_40MHz)
if (Client_tmp>Client_40MHz)
Client_40MHz = Client_tmp; // 40M/20M coexist => 40M priority is High
if(pEntry->bAssociated)
if (pEntry->bAssociated)
{
bConnected=TRUE; // client is connected or not
break;
@ -999,13 +999,13 @@ odm_DynamicPrimaryCCA(
PSTA_INFO_T pstat;
for(i=0; i<ODM_ASSOCIATE_ENTRY_NUM; i++)
for (i=0; i<ODM_ASSOCIATE_ENTRY_NUM; i++)
{
pstat = pDM_Odm->pODM_StaInfo[i];
if(IS_STA_VALID(pstat) )
if (IS_STA_VALID(pstat) )
{
Client_tmp = pstat->tx_bw;
if(Client_tmp>Client_40MHz)
if (Client_tmp>Client_40MHz)
Client_40MHz = Client_tmp; // 40M/20M coexist => 40M priority is High
bConnected = TRUE;
@ -1015,24 +1015,24 @@ odm_DynamicPrimaryCCA(
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_PRICCA, ODM_DBG_LOUD, ("bConnected=%d\n", bConnected));
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_PRICCA, ODM_DBG_LOUD, ("Is Client 40MHz=%d\n", Client_40MHz));
//1 Monitor whether the interference exists or not
if(PrimaryCCA->Monitor_flag == 1)
if (PrimaryCCA->Monitor_flag == 1)
{
if(SecCHOffset == 1) // secondary channel is below the primary channel
if (SecCHOffset == 1) // secondary channel is below the primary channel
{
if((FalseAlmCnt->Cnt_OFDM_CCA > 500)&&(FalseAlmCnt->Cnt_BW_LSC > FalseAlmCnt->Cnt_BW_USC+500))
if ((FalseAlmCnt->Cnt_OFDM_CCA > 500)&&(FalseAlmCnt->Cnt_BW_LSC > FalseAlmCnt->Cnt_BW_USC+500))
{
if(FalseAlmCnt->Cnt_Ofdm_fail > FalseAlmCnt->Cnt_OFDM_CCA>>1)
if (FalseAlmCnt->Cnt_Ofdm_fail > FalseAlmCnt->Cnt_OFDM_CCA>>1)
{
PrimaryCCA->intf_type = 1;
PrimaryCCA->PriCCA_flag = 1;
ODM_SetBBReg(pDM_Odm, 0xc6c, BIT8|BIT7, 2); // USC MF
if(PrimaryCCA->DupRTS_flag == 1)
if (PrimaryCCA->DupRTS_flag == 1)
PrimaryCCA->DupRTS_flag = 0;
}
else
{
PrimaryCCA->intf_type = 2;
if(PrimaryCCA->DupRTS_flag == 0)
if (PrimaryCCA->DupRTS_flag == 0)
PrimaryCCA->DupRTS_flag = 1;
}
@ -1044,22 +1044,22 @@ odm_DynamicPrimaryCCA(
PrimaryCCA->intf_type = 0;
}
}
else if(SecCHOffset == 2) // secondary channel is above the primary channel
else if (SecCHOffset == 2) // secondary channel is above the primary channel
{
if((FalseAlmCnt->Cnt_OFDM_CCA > 500)&&(FalseAlmCnt->Cnt_BW_USC > FalseAlmCnt->Cnt_BW_LSC+500))
if ((FalseAlmCnt->Cnt_OFDM_CCA > 500)&&(FalseAlmCnt->Cnt_BW_USC > FalseAlmCnt->Cnt_BW_LSC+500))
{
if(FalseAlmCnt->Cnt_Ofdm_fail > FalseAlmCnt->Cnt_OFDM_CCA>>1)
if (FalseAlmCnt->Cnt_Ofdm_fail > FalseAlmCnt->Cnt_OFDM_CCA>>1)
{
PrimaryCCA->intf_type = 1;
PrimaryCCA->PriCCA_flag = 1;
ODM_SetBBReg(pDM_Odm, 0xc6c, BIT8|BIT7, 1); // LSC MF
if(PrimaryCCA->DupRTS_flag == 1)
if (PrimaryCCA->DupRTS_flag == 1)
PrimaryCCA->DupRTS_flag = 0;
}
else
{
PrimaryCCA->intf_type = 2;
if(PrimaryCCA->DupRTS_flag == 0)
if (PrimaryCCA->DupRTS_flag == 0)
PrimaryCCA->DupRTS_flag = 1;
}
@ -1077,29 +1077,29 @@ odm_DynamicPrimaryCCA(
}
//1 Dynamic Primary CCA Main Function
if(PrimaryCCA->Monitor_flag == 0)
if (PrimaryCCA->Monitor_flag == 0)
{
if(Is40MHz) // if RFBW==40M mode which require to process primary cca
if (Is40MHz) // if RFBW==40M mode which require to process primary cca
{
//2 STA is NOT Connected
if(!bConnected)
if (!bConnected)
{
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_PRICCA, ODM_DBG_LOUD, ("STA NOT Connected!!!!\n"));
if(PrimaryCCA->PriCCA_flag == 1) // reset primary cca when STA is disconnected
if (PrimaryCCA->PriCCA_flag == 1) // reset primary cca when STA is disconnected
{
PrimaryCCA->PriCCA_flag = 0;
ODM_SetBBReg(pDM_Odm, 0xc6c, BIT8|BIT7, 0);
}
if(PrimaryCCA->DupRTS_flag == 1) // reset Duplicate RTS when STA is disconnected
if (PrimaryCCA->DupRTS_flag == 1) // reset Duplicate RTS when STA is disconnected
PrimaryCCA->DupRTS_flag = 0;
if(SecCHOffset == 1) // secondary channel is below the primary channel
if (SecCHOffset == 1) // secondary channel is below the primary channel
{
if((FalseAlmCnt->Cnt_OFDM_CCA > 800)&&(FalseAlmCnt->Cnt_BW_LSC*5 > FalseAlmCnt->Cnt_BW_USC*9))
if ((FalseAlmCnt->Cnt_OFDM_CCA > 800)&&(FalseAlmCnt->Cnt_BW_LSC*5 > FalseAlmCnt->Cnt_BW_USC*9))
{
PrimaryCCA->intf_flag = 1; // secondary channel interference is detected!!!
if(FalseAlmCnt->Cnt_Ofdm_fail > FalseAlmCnt->Cnt_OFDM_CCA>>1)
if (FalseAlmCnt->Cnt_Ofdm_fail > FalseAlmCnt->Cnt_OFDM_CCA>>1)
PrimaryCCA->intf_type = 1; // interference is shift
else
PrimaryCCA->intf_type = 2; // interference is in-band
@ -1110,12 +1110,12 @@ odm_DynamicPrimaryCCA(
PrimaryCCA->intf_type = 0;
}
}
else if(SecCHOffset == 2) // secondary channel is above the primary channel
else if (SecCHOffset == 2) // secondary channel is above the primary channel
{
if((FalseAlmCnt->Cnt_OFDM_CCA > 800)&&(FalseAlmCnt->Cnt_BW_USC*5 > FalseAlmCnt->Cnt_BW_LSC*9))
if ((FalseAlmCnt->Cnt_OFDM_CCA > 800)&&(FalseAlmCnt->Cnt_BW_USC*5 > FalseAlmCnt->Cnt_BW_LSC*9))
{
PrimaryCCA->intf_flag = 1; // secondary channel interference is detected!!!
if(FalseAlmCnt->Cnt_Ofdm_fail > FalseAlmCnt->Cnt_OFDM_CCA>>1)
if (FalseAlmCnt->Cnt_Ofdm_fail > FalseAlmCnt->Cnt_OFDM_CCA>>1)
PrimaryCCA->intf_type = 1; // interference is shift
else
PrimaryCCA->intf_type = 2; // interference is in-band
@ -1132,60 +1132,60 @@ odm_DynamicPrimaryCCA(
//2 STA is Connected
else
{
if(Client_40MHz == 0) //3 // client BW = 20MHz
if (Client_40MHz == 0) //3 // client BW = 20MHz
{
if(PrimaryCCA->PriCCA_flag == 0)
if (PrimaryCCA->PriCCA_flag == 0)
{
PrimaryCCA->PriCCA_flag = 1;
if(SecCHOffset==1)
if (SecCHOffset==1)
ODM_SetBBReg(pDM_Odm, 0xc6c, BIT8|BIT7, 2);
else if(SecCHOffset==2)
else if (SecCHOffset==2)
ODM_SetBBReg(pDM_Odm, 0xc6c, BIT8|BIT7, 1);
}
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_PRICCA, ODM_DBG_LOUD, ("STA Connected 20M!!! PrimaryCCA=%d\n", PrimaryCCA->PriCCA_flag));
}
else //3 // client BW = 40MHz
{
if(PrimaryCCA->intf_flag == 1) // interference is detected!!
if (PrimaryCCA->intf_flag == 1) // interference is detected!!
{
if(PrimaryCCA->intf_type == 1)
if (PrimaryCCA->intf_type == 1)
{
if(PrimaryCCA->PriCCA_flag!=1)
if (PrimaryCCA->PriCCA_flag!=1)
{
PrimaryCCA->PriCCA_flag = 1;
if(SecCHOffset==1)
if (SecCHOffset==1)
ODM_SetBBReg(pDM_Odm, 0xc6c, BIT8|BIT7, 2);
else if(SecCHOffset==2)
else if (SecCHOffset==2)
ODM_SetBBReg(pDM_Odm, 0xc6c, BIT8|BIT7, 1);
}
}
else if(PrimaryCCA->intf_type == 2)
else if (PrimaryCCA->intf_type == 2)
{
if(PrimaryCCA->DupRTS_flag!=1)
if (PrimaryCCA->DupRTS_flag!=1)
PrimaryCCA->DupRTS_flag = 1;
}
}
else // if intf_flag==0
{
if((curTxOkCnt+curRxOkCnt)<10000) //idle mode or TP traffic is very low
if ((curTxOkCnt+curRxOkCnt)<10000) //idle mode or TP traffic is very low
{
if(SecCHOffset == 1)
if (SecCHOffset == 1)
{
if((FalseAlmCnt->Cnt_OFDM_CCA > 800)&&(FalseAlmCnt->Cnt_BW_LSC*5 > FalseAlmCnt->Cnt_BW_USC*9))
if ((FalseAlmCnt->Cnt_OFDM_CCA > 800)&&(FalseAlmCnt->Cnt_BW_LSC*5 > FalseAlmCnt->Cnt_BW_USC*9))
{
PrimaryCCA->intf_flag = 1;
if(FalseAlmCnt->Cnt_Ofdm_fail > FalseAlmCnt->Cnt_OFDM_CCA>>1)
if (FalseAlmCnt->Cnt_Ofdm_fail > FalseAlmCnt->Cnt_OFDM_CCA>>1)
PrimaryCCA->intf_type = 1; // interference is shift
else
PrimaryCCA->intf_type = 2; // interference is in-band
}
}
else if(SecCHOffset == 2)
else if (SecCHOffset == 2)
{
if((FalseAlmCnt->Cnt_OFDM_CCA > 800)&&(FalseAlmCnt->Cnt_BW_USC*5 > FalseAlmCnt->Cnt_BW_LSC*9))
if ((FalseAlmCnt->Cnt_OFDM_CCA > 800)&&(FalseAlmCnt->Cnt_BW_USC*5 > FalseAlmCnt->Cnt_BW_LSC*9))
{
PrimaryCCA->intf_flag = 1;
if(FalseAlmCnt->Cnt_Ofdm_fail > FalseAlmCnt->Cnt_OFDM_CCA>>1)
if (FalseAlmCnt->Cnt_Ofdm_fail > FalseAlmCnt->Cnt_OFDM_CCA>>1)
PrimaryCCA->intf_type = 1; // interference is shift
else
PrimaryCCA->intf_type = 2; // interference is in-band
@ -1195,14 +1195,14 @@ odm_DynamicPrimaryCCA(
}
else // TP Traffic is High
{
if(SecCHOffset == 1)
if (SecCHOffset == 1)
{
if(FalseAlmCnt->Cnt_BW_LSC > (FalseAlmCnt->Cnt_BW_USC+500))
if (FalseAlmCnt->Cnt_BW_LSC > (FalseAlmCnt->Cnt_BW_USC+500))
{
if(Delay == 0) // add delay to avoid interference occurring abruptly, jump one time
if (Delay == 0) // add delay to avoid interference occurring abruptly, jump one time
{
PrimaryCCA->intf_flag = 1;
if(FalseAlmCnt->Cnt_Ofdm_fail > FalseAlmCnt->Cnt_OFDM_CCA>>1)
if (FalseAlmCnt->Cnt_Ofdm_fail > FalseAlmCnt->Cnt_OFDM_CCA>>1)
PrimaryCCA->intf_type = 1; // interference is shift
else
PrimaryCCA->intf_type = 2; // interference is in-band
@ -1212,14 +1212,14 @@ odm_DynamicPrimaryCCA(
Delay = 0;
}
}
else if(SecCHOffset == 2)
else if (SecCHOffset == 2)
{
if(FalseAlmCnt->Cnt_BW_USC > (FalseAlmCnt->Cnt_BW_LSC+500))
if (FalseAlmCnt->Cnt_BW_USC > (FalseAlmCnt->Cnt_BW_LSC+500))
{
if(Delay == 0) // add delay to avoid interference occurring abruptly
if (Delay == 0) // add delay to avoid interference occurring abruptly
{
PrimaryCCA->intf_flag = 1;
if(FalseAlmCnt->Cnt_Ofdm_fail > FalseAlmCnt->Cnt_OFDM_CCA>>1)
if (FalseAlmCnt->Cnt_Ofdm_fail > FalseAlmCnt->Cnt_OFDM_CCA>>1)
PrimaryCCA->intf_type = 1; // interference is shift
else
PrimaryCCA->intf_type = 2; // interference is in-band
@ -1239,19 +1239,19 @@ odm_DynamicPrimaryCCA(
}
}
//1 Dynamic Primary CCA Monitor Counter
if((PrimaryCCA->PriCCA_flag == 1)||(PrimaryCCA->DupRTS_flag == 1))
if ((PrimaryCCA->PriCCA_flag == 1)||(PrimaryCCA->DupRTS_flag == 1))
{
if(Client_40MHz == 0) // client=20M no need to monitor primary cca flag
if (Client_40MHz == 0) // client=20M no need to monitor primary cca flag
{
Client_40MHz_pre = Client_40MHz;
return;
}
Counter++;
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_PRICCA, ODM_DBG_LOUD, ("Counter=%d\n", Counter));
if((Counter == 30)||((Client_40MHz -Client_40MHz_pre)==1)) // Every 60 sec to monitor one time
if ((Counter == 30)||((Client_40MHz -Client_40MHz_pre)==1)) // Every 60 sec to monitor one time
{
PrimaryCCA->Monitor_flag = 1; // monitor flag is triggered!!!!!
if(PrimaryCCA->PriCCA_flag == 1)
if (PrimaryCCA->PriCCA_flag == 1)
{
PrimaryCCA->PriCCA_flag = 0;
ODM_SetBBReg(pDM_Odm, 0xc6c, BIT8|BIT7, 0);

View file

@ -31,7 +31,7 @@ odm_ConfigRFReg_8188E(
IN u4Byte RegAddr
)
{
if(Addr == 0xffe)
if (Addr == 0xffe)
{
#ifdef CONFIG_LONG_DELAY_ISSUE
ODM_sleep_ms(50);

View file

@ -498,7 +498,7 @@ extern void DBG_PrintAllComp(void)
*---------------------------------------------------------------------------*/
extern void DBG_PrintFlagEvent(u1Byte DbgFlag)
{
switch(DbgFlag)
switch (DbgFlag)
{
case FQoS:
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 QoS_INIT\n"));

View file

@ -33,13 +33,13 @@ ODM_Read1Byte(
IN u4Byte RegAddr
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
prtl8192cd_priv priv = pDM_Odm->priv;
return RTL_R8(RegAddr);
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
PADAPTER Adapter = pDM_Odm->Adapter;
return rtw_read8(Adapter,RegAddr);
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PADAPTER Adapter = pDM_Odm->Adapter;
return PlatformEFIORead1Byte(Adapter, RegAddr);
#endif
@ -53,13 +53,13 @@ ODM_Read2Byte(
IN u4Byte RegAddr
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
prtl8192cd_priv priv = pDM_Odm->priv;
return RTL_R16(RegAddr);
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
PADAPTER Adapter = pDM_Odm->Adapter;
return rtw_read16(Adapter,RegAddr);
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PADAPTER Adapter = pDM_Odm->Adapter;
return PlatformEFIORead2Byte(Adapter, RegAddr);
#endif
@ -73,13 +73,13 @@ ODM_Read4Byte(
IN u4Byte RegAddr
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
prtl8192cd_priv priv = pDM_Odm->priv;
return RTL_R32(RegAddr);
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
PADAPTER Adapter = pDM_Odm->Adapter;
return rtw_read32(Adapter,RegAddr);
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PADAPTER Adapter = pDM_Odm->Adapter;
return PlatformEFIORead4Byte(Adapter, RegAddr);
#endif
@ -94,13 +94,13 @@ ODM_Write1Byte(
IN u1Byte Data
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
prtl8192cd_priv priv = pDM_Odm->priv;
RTL_W8(RegAddr, Data);
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
PADAPTER Adapter = pDM_Odm->Adapter;
rtw_write8(Adapter,RegAddr, Data);
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PADAPTER Adapter = pDM_Odm->Adapter;
PlatformEFIOWrite1Byte(Adapter, RegAddr, Data);
#endif
@ -115,13 +115,13 @@ ODM_Write2Byte(
IN u2Byte Data
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
prtl8192cd_priv priv = pDM_Odm->priv;
RTL_W16(RegAddr, Data);
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
PADAPTER Adapter = pDM_Odm->Adapter;
rtw_write16(Adapter,RegAddr, Data);
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PADAPTER Adapter = pDM_Odm->Adapter;
PlatformEFIOWrite2Byte(Adapter, RegAddr, Data);
#endif
@ -136,13 +136,13 @@ ODM_Write4Byte(
IN u4Byte Data
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
prtl8192cd_priv priv = pDM_Odm->priv;
RTL_W32(RegAddr, Data);
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
PADAPTER Adapter = pDM_Odm->Adapter;
rtw_write32(Adapter,RegAddr, Data);
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PADAPTER Adapter = pDM_Odm->Adapter;
PlatformEFIOWrite4Byte(Adapter, RegAddr, Data);
#endif
@ -158,9 +158,9 @@ ODM_SetMACReg(
IN u4Byte Data
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
PHY_SetBBReg(pDM_Odm->priv, RegAddr, BitMask, Data);
#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
#elif (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
PADAPTER Adapter = pDM_Odm->Adapter;
PHY_SetBBReg(Adapter, RegAddr, BitMask, Data);
#endif
@ -174,9 +174,9 @@ ODM_GetMACReg(
IN u4Byte BitMask
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
return PHY_QueryBBReg(pDM_Odm->priv, RegAddr, BitMask);
#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
#elif (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
PADAPTER Adapter = pDM_Odm->Adapter;
return PHY_QueryBBReg(Adapter, RegAddr, BitMask);
#endif
@ -191,9 +191,9 @@ ODM_SetBBReg(
IN u4Byte Data
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
PHY_SetBBReg(pDM_Odm->priv, RegAddr, BitMask, Data);
#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
#elif (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
PADAPTER Adapter = pDM_Odm->Adapter;
PHY_SetBBReg(Adapter, RegAddr, BitMask, Data);
#endif
@ -207,9 +207,9 @@ ODM_GetBBReg(
IN u4Byte BitMask
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
return PHY_QueryBBReg(pDM_Odm->priv, RegAddr, BitMask);
#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
#elif (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
PADAPTER Adapter = pDM_Odm->Adapter;
return PHY_QueryBBReg(Adapter, RegAddr, BitMask);
#endif
@ -225,9 +225,9 @@ ODM_SetRFReg(
IN u4Byte Data
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
PHY_SetRFReg(pDM_Odm->priv, eRFPath, RegAddr, BitMask, Data);
#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
#elif (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
PADAPTER Adapter = pDM_Odm->Adapter;
PHY_SetRFReg(Adapter, eRFPath, RegAddr, BitMask, Data);
#endif
@ -242,9 +242,9 @@ ODM_GetRFReg(
IN u4Byte BitMask
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
return PHY_QueryRFReg(pDM_Odm->priv, eRFPath, RegAddr, BitMask, 1);
#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
#elif (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
PADAPTER Adapter = pDM_Odm->Adapter;
return PHY_QueryRFReg(Adapter, eRFPath, RegAddr, BitMask);
#endif
@ -263,11 +263,11 @@ ODM_AllocateMemory(
IN u4Byte length
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
*pPtr = kmalloc(length, GFP_ATOMIC);
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE )
*pPtr = rtw_zvmalloc(length);
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PADAPTER Adapter = pDM_Odm->Adapter;
PlatformAllocateMemory(Adapter, pPtr, length);
#endif
@ -281,11 +281,11 @@ ODM_FreeMemory(
IN u4Byte length
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
kfree(pPtr);
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE )
rtw_vmfree(pPtr, length);
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
//PADAPTER Adapter = pDM_Odm->Adapter;
PlatformFreeMemory(pPtr, length);
#endif
@ -297,11 +297,11 @@ s4Byte ODM_CompareMemory(
IN u4Byte length
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
return memcmp(pBuf1,pBuf2,length);
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE )
return _rtw_memcmp(pBuf1,pBuf2,length);
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
return PlatformCompareMemory(pBuf1,pBuf2,length);
#endif
}
@ -317,11 +317,11 @@ ODM_AcquireSpinLock(
IN RT_SPINLOCK_TYPE type
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE )
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PADAPTER Adapter = pDM_Odm->Adapter;
PlatformAcquireSpinLock(Adapter, type);
#endif
@ -332,11 +332,11 @@ ODM_ReleaseSpinLock(
IN RT_SPINLOCK_TYPE type
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE )
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PADAPTER Adapter = pDM_Odm->Adapter;
PlatformReleaseSpinLock(Adapter, type);
#endif
@ -354,11 +354,11 @@ ODM_InitializeWorkItem(
IN const char* szID
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PADAPTER Adapter = pDM_Odm->Adapter;
PlatformInitializeWorkItem(Adapter, pRtWorkItem, RtWorkItemCallback, pContext, szID);
#endif
@ -370,11 +370,11 @@ ODM_StartWorkItem(
IN PRT_WORK_ITEM pRtWorkItem
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PlatformStartWorkItem(pRtWorkItem);
#endif
}
@ -385,11 +385,11 @@ ODM_StopWorkItem(
IN PRT_WORK_ITEM pRtWorkItem
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PlatformStopWorkItem(pRtWorkItem);
#endif
}
@ -400,11 +400,11 @@ ODM_FreeWorkItem(
IN PRT_WORK_ITEM pRtWorkItem
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PlatformFreeWorkItem(pRtWorkItem);
#endif
}
@ -415,11 +415,11 @@ ODM_ScheduleWorkItem(
IN PRT_WORK_ITEM pRtWorkItem
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PlatformScheduleWorkItem(pRtWorkItem);
#endif
}
@ -430,11 +430,11 @@ ODM_IsWorkItemScheduled(
IN PRT_WORK_ITEM pRtWorkItem
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PlatformIsWorkItemScheduled(pRtWorkItem);
#endif
}
@ -449,11 +449,11 @@ ODM_StallExecution(
IN u4Byte usDelay
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
rtw_udelay_os(usDelay);
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PlatformStallExecution(usDelay);
#endif
}
@ -461,11 +461,11 @@ ODM_StallExecution(
VOID
ODM_delay_ms(IN u4Byte ms)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
delay_ms(ms);
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
rtw_mdelay_os(ms);
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
delay_ms(ms);
#endif
}
@ -473,11 +473,11 @@ ODM_delay_ms(IN u4Byte ms)
VOID
ODM_delay_us(IN u4Byte us)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
delay_us(us);
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
rtw_udelay_os(us);
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PlatformStallExecution(us);
#endif
}
@ -485,22 +485,22 @@ ODM_delay_us(IN u4Byte us)
VOID
ODM_sleep_ms(IN u4Byte ms)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
rtw_msleep_os(ms);
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
#endif
}
VOID
ODM_sleep_us(IN u4Byte us)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
rtw_usleep_os(us);
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
#endif
}
@ -511,11 +511,11 @@ ODM_SetTimer(
IN u4Byte msDelay
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
mod_timer(pTimer, jiffies + (msDelay+9)/10);
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
_set_timer(pTimer,msDelay ); //ms
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PADAPTER Adapter = pDM_Odm->Adapter;
PlatformSetTimer(Adapter, pTimer, msDelay);
#endif
@ -531,14 +531,14 @@ ODM_InitializeTimer(
IN const char* szID
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
pTimer->function = CallBackFunc;
pTimer->data = (unsigned long)pDM_Odm;
init_timer(pTimer);
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
PADAPTER Adapter = pDM_Odm->Adapter;
_init_timer(pTimer,Adapter->pnetdev,CallBackFunc,pDM_Odm);
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PADAPTER Adapter = pDM_Odm->Adapter;
PlatformInitializeTimer(Adapter, pTimer, CallBackFunc,pContext,szID);
#endif
@ -551,11 +551,11 @@ ODM_CancelTimer(
IN PRT_TIMER pTimer
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
del_timer_sync(pTimer);
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
_cancel_timer_ex(pTimer);
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PADAPTER Adapter = pDM_Odm->Adapter;
PlatformCancelTimer(Adapter, pTimer);
#endif
@ -568,11 +568,11 @@ ODM_ReleaseTimer(
IN PRT_TIMER pTimer
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
PADAPTER Adapter = pDM_Odm->Adapter;
@ -601,9 +601,9 @@ ODM_FillH2CCmd(
IN pu1Byte pCmdBuffer
)
{
if(IS_HARDWARE_TYPE_JAGUAR(Adapter))
if (IS_HARDWARE_TYPE_JAGUAR(Adapter))
{
switch(ElementID)
switch (ElementID)
{
case ODM_H2C_RSSI_REPORT:
FillH2CCmd8812(Adapter, H2C_8812_RSSI_REPORT, CmdLen, pCmdBuffer);
@ -612,9 +612,9 @@ ODM_FillH2CCmd(
}
}
else if(IS_HARDWARE_TYPE_8188E(Adapter))
else if (IS_HARDWARE_TYPE_8188E(Adapter))
{
switch(ElementID)
switch (ElementID)
{
case ODM_H2C_PSD_RESULT:
FillH2CCmd88E(Adapter, H2C_88E_PSD_RESULT, CmdLen, pCmdBuffer);
@ -624,7 +624,7 @@ ODM_FillH2CCmd(
}
else
{
switch(ElementID)
switch (ElementID)
{
case ODM_H2C_RSSI_REPORT:
FillH2CCmd92C(Adapter, H2C_RSSI_REPORT, CmdLen, pCmdBuffer);
@ -647,11 +647,11 @@ ODM_FillH2CCmd(
IN pu1Byte CmdStartSeq
)
{
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE)
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
//FillH2CCmd(pH2CBuffer, H2CBufferLen, CmdNum, pElementID, pCmdLen, pCmbBuffer, CmdStartSeq);
return FALSE;
#endif

View file

@ -50,13 +50,13 @@ static u8 _is_fw_read_cmd_down(_adapter* padapter, u8 msgbox_num)
do{
valid = rtw_read8(padapter,REG_HMETFR) & BIT(msgbox_num);
if(0 == valid ){
if (0 == valid ){
read_down = _TRUE;
}
#ifdef CONFIG_WOWLAN
rtw_msleep_os(2);
#endif
}while( (!read_down) && (retry_cnts--));
}while ( (!read_down) && (retry_cnts--));
return read_down;
@ -88,7 +88,7 @@ static s32 FillH2CCmd_88E(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdB
_func_enter_;
if(padapter->bFWReady == _FALSE)
if (padapter->bFWReady == _FALSE)
{
DBG_8192C("FillH2CCmd_88E(): return H2C cmd because fw is not ready\n");
return ret;
@ -96,7 +96,7 @@ _func_enter_;
#ifdef CONFIG_CONCURRENT_MODE
if(padapter->adapter_type > PRIMARY_ADAPTER)
if (padapter->adapter_type > PRIMARY_ADAPTER)
{
padapter = padapter->pbuddy_adapter;
}
@ -120,14 +120,14 @@ _func_enter_;
do{
h2c_box_num = pHalData->LastHMEBoxNum;
if(!_is_fw_read_cmd_down(padapter, h2c_box_num)){
if (!_is_fw_read_cmd_down(padapter, h2c_box_num)){
DBG_8192C(" fw read cmd failed...\n");
goto exit;
}
*(u8*)(&h2c_cmd) = ElementID;
if(CmdLen<=3)
if (CmdLen<=3)
{
_rtw_memcpy((u8*)(&h2c_cmd)+1, pCmdBuffer, CmdLen );
}
@ -139,7 +139,7 @@ _func_enter_;
//Write Ext command
msgbox_ex_addr = REG_HMEBOX_EXT_0 + (h2c_box_num *RTL88E_EX_MESSAGE_BOX_SIZE);
#ifdef CONFIG_H2C_EF
for(cmd_idx=0;cmd_idx<ext_cmd_len;cmd_idx++ ){
for (cmd_idx=0;cmd_idx<ext_cmd_len;cmd_idx++ ){
rtw_write8(padapter,msgbox_ex_addr+cmd_idx,*((u8*)(&h2c_cmd_ex)+cmd_idx));
}
#else
@ -150,7 +150,7 @@ _func_enter_;
// Write command
msgbox_addr =REG_HMEBOX_0 + (h2c_box_num *RTL88E_MESSAGE_BOX_SIZE);
#ifdef CONFIG_H2C_EF
for(cmd_idx=0;cmd_idx<RTL88E_MESSAGE_BOX_SIZE;cmd_idx++ ){
for (cmd_idx=0;cmd_idx<RTL88E_MESSAGE_BOX_SIZE;cmd_idx++ ){
rtw_write8(padapter,msgbox_addr+cmd_idx,*((u8*)(&h2c_cmd)+cmd_idx));
}
#else
@ -165,7 +165,7 @@ _func_enter_;
pHalData->LastHMEBoxNum = (h2c_box_num+1) % RTL88E_MAX_H2C_BOX_NUMS;
}while((!bcmd_down) && (retry_cnts--));
}while ((!bcmd_down) && (retry_cnts--));
ret = _SUCCESS;
@ -186,7 +186,7 @@ u8 rtl8192c_h2c_msg_hdl(_adapter *padapter, unsigned char *pbuf)
u8 *pCmdBuffer;
struct cmd_msg_parm *pcmdmsg;
if(!pbuf)
if (!pbuf)
return H2C_PARAMETERS_ERROR;
pcmdmsg = (struct cmd_msg_parm*)pbuf;
@ -218,7 +218,7 @@ u8 rtl8188e_set_rssi_cmd(_adapter*padapter, u8 *param)
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
_func_enter_;
if(pHalData->fw_ractrl == _TRUE){
if (pHalData->fw_ractrl == _TRUE){
#if 0
*((u32*) param ) = cpu_to_le32( *((u32*) param ) );
@ -240,7 +240,7 @@ u8 rtl8188e_set_raid_cmd(_adapter*padapter, u32 mask)
u8 res=_SUCCESS;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
_func_enter_;
if(pHalData->fw_ractrl == _TRUE){
if (pHalData->fw_ractrl == _TRUE){
_rtw_memset(buf, 0, 3);
mask = cpu_to_le32( mask );
_rtw_memcpy(buf, &mask, 3);
@ -269,7 +269,7 @@ void rtl8188e_Add_RateATid(PADAPTER pAdapter, u32 bitmap, u8 arg, u8 rssi_level)
u8 macid, init_rate, raid, shortGIrate=_FALSE;
#ifdef CONFIG_CONCURRENT_MODE
if(rtw_buddy_adapter_up(pAdapter) && pAdapter->adapter_type > PRIMARY_ADAPTER)
if (rtw_buddy_adapter_up(pAdapter) && pAdapter->adapter_type > PRIMARY_ADAPTER)
pHalData = GET_HAL_DATA(pAdapter->pbuddy_adapter);
#endif //CONFIG_CONCURRENT_MODE
@ -279,7 +279,7 @@ void rtl8188e_Add_RateATid(PADAPTER pAdapter, u32 bitmap, u8 arg, u8 rssi_level)
raid = (bitmap>>28) & 0x0f;
bitmap &=0x0fffffff;
if(rssi_level != DM_RATR_STA_INIT)
if (rssi_level != DM_RATR_STA_INIT)
bitmap = ODM_Get_Rate_Bitmap(&pHalData->odmpriv, macid, bitmap, rssi_level);
bitmap |= ((raid<<28)&0xf0000000);
@ -304,7 +304,7 @@ void rtl8188e_Add_RateATid(PADAPTER pAdapter, u32 bitmap, u8 arg, u8 rssi_level)
__FUNCTION__,macid ,raid ,bitmap, shortGIrate);
#if(RATE_ADAPTIVE_SUPPORT == 1)
#if (RATE_ADAPTIVE_SUPPORT == 1)
ODM_RA_UpdateRateInfo_8188E(
&(pHalData->odmpriv),
macid,
@ -326,7 +326,7 @@ _func_enter_;
DBG_871X("%s: Mode=%d SmartPS=%d UAPSD=%d\n", __FUNCTION__,
Mode, pwrpriv->smart_ps, padapter->registrypriv.uapsd_enable);
switch(Mode)
switch (Mode)
{
case PS_MODE_ACTIVE:
H2CSetPwrMode.Mode = 0;
@ -358,7 +358,7 @@ _func_enter_;
H2CSetPwrMode.bAllQueueUAPSD = padapter->registrypriv.uapsd_enable;
if(Mode > 0)
if (Mode > 0)
{
H2CSetPwrMode.PwrState = 0x00;// AllON(0x0C), RFON(0x04), RFOFF(0x00)
#ifdef CONFIG_EXT_CLK
@ -430,7 +430,7 @@ void ConstructBeacon(_adapter *padapter, u8 *pframe, u32 *pLength)
pframe += 2;
pktlen += 2;
if( (pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
if ( (pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
{
//DBG_871X("ie len=%d\n", cur_network->IELength);
pktlen += cur_network->IELength - sizeof(NDIS_802_11_FIXED_IEs);
@ -451,7 +451,7 @@ void ConstructBeacon(_adapter *padapter, u8 *pframe, u32 *pLength)
// DS parameter set
pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pktlen);
if( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE)
if ( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE)
{
u32 ATIMWindow;
// IBSS Parameter Set...
@ -547,7 +547,7 @@ void ConstructNullFunctionData(
SetPwrMgt(fctrl);
}
switch(cur_network->network.InfrastructureMode)
switch (cur_network->network.InfrastructureMode)
{
case Ndis802_11Infrastructure:
SetToDs(fctrl);
@ -620,7 +620,7 @@ void ConstructProbeRsp(_adapter *padapter, u8 *pframe, u32 *pLength, u8 *StaAddr
pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pframe += pktlen;
if(cur_network->IELength>MAX_IE_SZ)
if (cur_network->IELength>MAX_IE_SZ)
return;
_rtw_memcpy(pframe, cur_network->IEs, cur_network->IELength);
@ -640,7 +640,7 @@ CheckFwRsvdPageContent(
HAL_DATA_TYPE* pHalData = GET_HAL_DATA(Adapter);
u32 MaxBcnPageNum;
if(pHalData->FwRsvdPageStartOffset != 0)
if (pHalData->FwRsvdPageStartOffset != 0)
{
/*MaxBcnPageNum = PageNum_128(pMgntInfo->MaxBeaconSize);
RT_ASSERT((MaxBcnPageNum <= pHalData->FwRsvdPageStartOffset),
@ -813,7 +813,7 @@ _func_enter_;
DBG_871X("%s mstatus(%x)\n", __FUNCTION__,mstatus);
if(mstatus == 1)
if (mstatus == 1)
{
// We should set AID, correct TSF, HW seq enable before set JoinBssReport to Fw in 88/92C.
// Suggested by filen. Added by tynli.
@ -836,7 +836,7 @@ _func_enter_;
rtw_write8(padapter, REG_BCN_CTRL, rtw_read8(padapter, REG_BCN_CTRL)&(~BIT(3)));
rtw_write8(padapter, REG_BCN_CTRL, rtw_read8(padapter, REG_BCN_CTRL)|BIT(4));
if(pHalData->RegFwHwTxQCtrl&BIT6)
if (pHalData->RegFwHwTxQCtrl&BIT6)
{
DBG_871X("HalDownloadRSVDPage(): There is an Adapter is sending beacon.\n");
bSendBeacon = _TRUE;
@ -862,15 +862,15 @@ _func_enter_;
// check rsvd page download OK.
rtw_hal_get_hwreg(padapter, HW_VAR_BCN_VALID, (u8*)(&bcn_valid));
poll++;
} while(!bcn_valid && (poll%10)!=0 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
} while (!bcn_valid && (poll%10)!=0 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
}while(!bcn_valid && DLBcnCount<=100 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
}while (!bcn_valid && DLBcnCount<=100 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
//RT_ASSERT(bcn_valid, ("HalDownloadRSVDPage88ES(): 1 Download RSVD page failed!\n"));
if(padapter->bSurpriseRemoved || padapter->bDriverStopped)
if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
{
}
else if(!bcn_valid)
else if (!bcn_valid)
DBG_871X("%s: 1 Download RSVD page failed! DLBcnCount:%u, poll:%u\n", __FUNCTION__ ,DLBcnCount, poll);
else
DBG_871X("%s: 1 Download RSVD success! DLBcnCount:%u, poll:%u\n", __FUNCTION__, DLBcnCount, poll);
@ -880,10 +880,10 @@ _func_enter_;
// At run time, we cannot get the Tx Desc until it is released in TxHandleInterrupt() so we will return
// the beacon TCB in the following code. 2011.11.23. by tynli.
//
//if(bcn_valid && padapter->bEnterPnpSleep)
if(0)
//if (bcn_valid && padapter->bEnterPnpSleep)
if (0)
{
if(bSendBeacon)
if (bSendBeacon)
{
rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
DLBcnCount = 0;
@ -900,14 +900,14 @@ _func_enter_;
// check rsvd page download OK.
rtw_hal_get_hwreg(padapter, HW_VAR_BCN_VALID, (u8*)(&bcn_valid));
poll++;
} while(!bcn_valid && (poll%10)!=0 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
}while(!bcn_valid && DLBcnCount<=100 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
} while (!bcn_valid && (poll%10)!=0 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
}while (!bcn_valid && DLBcnCount<=100 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
//RT_ASSERT(bcn_valid, ("HalDownloadRSVDPage(): 2 Download RSVD page failed!\n"));
if(padapter->bSurpriseRemoved || padapter->bDriverStopped)
if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
{
}
else if(!bcn_valid)
else if (!bcn_valid)
DBG_871X("%s: 2 Download RSVD page failed! DLBcnCount:%u, poll:%u\n", __FUNCTION__ ,DLBcnCount, poll);
else
DBG_871X("%s: 2 Download RSVD success! DLBcnCount:%u, poll:%u\n", __FUNCTION__, DLBcnCount, poll);
@ -925,7 +925,7 @@ _func_enter_;
// prevent from setting 0x422[6] to 0 after download reserved page, or it will cause
// the beacon cannot be sent by HW.
// 2010.06.23. Added by tynli.
if(bSendBeacon)
if (bSendBeacon)
{
rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, (pHalData->RegFwHwTxQCtrl|BIT6));
pHalData->RegFwHwTxQCtrl |= BIT6;
@ -934,7 +934,7 @@ _func_enter_;
//
// Update RSVD page location H2C to Fw.
//
if(bcn_valid)
if (bcn_valid)
{
rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
DBG_871X("Set RSVD page location to Fw.\n");
@ -942,7 +942,7 @@ _func_enter_;
}
// Do not enable HW DMA BCN or it will cause Pcie interface hang by timing issue. 2011.11.24. by tynli.
//if(!padapter->bEnterPnpSleep)
//if (!padapter->bEnterPnpSleep)
{
// Clear CR[8] or beacon packet will not be send to TxBuf anymore.
pHalData->RegCR_1 &= (~BIT0);
@ -974,7 +974,7 @@ void rtl8188e_set_p2p_ps_offload_cmd(_adapter* padapter, u8 p2p_ps_state)
_func_enter_;
#if 1
switch(p2p_ps_state)
switch (p2p_ps_state)
{
case P2P_PS_DISABLE:
DBG_8192C("P2P_PS_DISABLE \n");
@ -983,18 +983,18 @@ _func_enter_;
case P2P_PS_ENABLE:
DBG_8192C("P2P_PS_ENABLE \n");
// update CTWindow value.
if( pwdinfo->ctwindow > 0 )
if ( pwdinfo->ctwindow > 0 )
{
p2p_ps_offload->CTWindow_En = 1;
rtw_write8(padapter, REG_P2P_CTWIN, pwdinfo->ctwindow);
}
// hw only support 2 set of NoA
for( i=0 ; i<pwdinfo->noa_num ; i++)
for ( i=0 ; i<pwdinfo->noa_num ; i++)
{
// To control the register setting for which NOA
rtw_write8(padapter, REG_NOA_DESC_SEL, (i << 4));
if(i == 0)
if (i == 0)
p2p_ps_offload->NoA0_En = 1;
else
p2p_ps_offload->NoA1_En = 1;
@ -1013,14 +1013,14 @@ _func_enter_;
rtw_write8(padapter, REG_NOA_DESC_COUNT, pwdinfo->noa_count[i]);
}
if( (pwdinfo->opp_ps == 1) || (pwdinfo->noa_num > 0) )
if ( (pwdinfo->opp_ps == 1) || (pwdinfo->noa_num > 0) )
{
// rst p2p circuit
rtw_write8(padapter, REG_DUAL_TSF_RST, BIT(4));
p2p_ps_offload->Offload_En = 1;
if(pwdinfo->role == P2P_ROLE_GO)
if (pwdinfo->role == P2P_ROLE_GO)
{
p2p_ps_offload->role= 1;
p2p_ps_offload->AllStaSleep = 0;
@ -1121,26 +1121,26 @@ _func_enter_;
pwowlan_parm.second_mode =0;
pwowlan_parm.reserve=0;
if(enable){
if (enable){
pwowlan_parm.mode |=FW_WOWLAN_FUN_EN;
pwrpriv->wowlan_magic =_TRUE;
pwrpriv->wowlan_unicast =_TRUE;
if(pwrpriv->wowlan_pattern ==_TRUE){
if (pwrpriv->wowlan_pattern ==_TRUE){
pwowlan_parm.mode |= FW_WOWLAN_PATTERN_MATCH;
DBG_871X_LEVEL(_drv_info_, "%s 2.pwowlan_parm.mode=0x%x \n",__FUNCTION__,pwowlan_parm.mode );
}
if(pwrpriv->wowlan_magic ==_TRUE){
if (pwrpriv->wowlan_magic ==_TRUE){
pwowlan_parm.mode |=FW_WOWLAN_MAGIC_PKT;
DBG_871X_LEVEL(_drv_info_, "%s 3.pwowlan_parm.mode=0x%x \n",__FUNCTION__,pwowlan_parm.mode );
}
if(pwrpriv->wowlan_unicast ==_TRUE){
if (pwrpriv->wowlan_unicast ==_TRUE){
pwowlan_parm.mode |=FW_WOWLAN_UNICAST;
DBG_871X_LEVEL(_drv_info_, "%s 4.pwowlan_parm.mode=0x%x \n",__FUNCTION__,pwowlan_parm.mode );
}
if(!(padapter->pwrctrlpriv.wowlan_wake_reason & FWDecisionDisconnect))
if (!(padapter->pwrctrlpriv.wowlan_wake_reason & FWDecisionDisconnect))
rtl8188e_set_FwJoinBssReport_cmd(padapter, 1);
else
DBG_871X_LEVEL(_drv_always_, "%s, disconnected, no FwJoinBssReport\n",__FUNCTION__);

View file

@ -50,12 +50,12 @@ dm_CheckProtection(
PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo);
u1Byte CurRate, RateThreshold;
if(pMgntInfo->pHTInfo->bCurBW40MHz)
if (pMgntInfo->pHTInfo->bCurBW40MHz)
RateThreshold = MGN_MCS1;
else
RateThreshold = MGN_MCS3;
if(Adapter->TxStats.CurrentInitTxRate <= RateThreshold)
if (Adapter->TxStats.CurrentInitTxRate <= RateThreshold)
{
pMgntInfo->bDmDisableProtect = TRUE;
DbgPrint("Forced disable protect: %x\n", Adapter->TxStats.CurrentInitTxRate);
@ -74,7 +74,7 @@ dm_CheckStatistics(
)
{
#if 0
if(!Adapter->MgntInfo.bMediaConnect)
if (!Adapter->MgntInfo.bMediaConnect)
return;
//2008.12.10 tynli Add for getting Current_Tx_Rate_Reg flexibly.
@ -94,7 +94,7 @@ static void dm_CheckPbcGPIO(_adapter *padapter)
u8 tmp1byte;
u8 bPbcPressed = _FALSE;
if(!padapter->registrypriv.hw_wps_pbc)
if (!padapter->registrypriv.hw_wps_pbc)
return;
#ifdef CONFIG_USB_HCI
@ -125,13 +125,13 @@ static void dm_CheckPbcGPIO(_adapter *padapter)
if (tmp1byte == 0xff || padapter->init_adpt_in_progress)
return ;
if((tmp1byte&HAL_8192C_HW_GPIO_WPS_BIT)==0)
if ((tmp1byte&HAL_8192C_HW_GPIO_WPS_BIT)==0)
{
bPbcPressed = _TRUE;
}
#endif
if( _TRUE == bPbcPressed)
if ( _TRUE == bPbcPressed)
{
// Here we only set bPbcPressed to true
// After trigger PBC, the variable will be set to false
@ -187,21 +187,21 @@ dm_InterruptMigration(
// <Roger_Notes> Currently we use busy traffic for reference instead of RxIntOK counts to prevent non-linear Rx statistics
// when interrupt migration is set before. 2010.03.05.
//
if(!Adapter->registrypriv.wifi_spec &&
if (!Adapter->registrypriv.wifi_spec &&
(check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE) &&
pmlmepriv->LinkDetectInfo.bHigherBusyTraffic)
{
IntMtToSet = _TRUE;
// To check whether we should disable Tx interrupt or not.
if(pmlmepriv->LinkDetectInfo.bHigherBusyRxTraffic )
if (pmlmepriv->LinkDetectInfo.bHigherBusyRxTraffic )
ACIntToSet = _TRUE;
}
//Update current settings.
if( bCurrentIntMt != IntMtToSet ){
if ( bCurrentIntMt != IntMtToSet ){
DBG_8192C("%s(): Update interrrupt migration(%d)\n",__FUNCTION__,IntMtToSet);
if(IntMtToSet)
if (IntMtToSet)
{
//
// <Roger_Notes> Set interrrupt migration timer and corresponging Tx/Rx counter.
@ -219,9 +219,9 @@ dm_InterruptMigration(
}
}
/*if( bCurrentACIntDisable != ACIntToSet ){
/*if ( bCurrentACIntDisable != ACIntToSet ){
DBG_8192C("%s(): Update AC interrrupt(%d)\n",__FUNCTION__,ACIntToSet);
if(ACIntToSet) // Disable four ACs interrupts.
if (ACIntToSet) // Disable four ACs interrupts.
{
//
// <Roger_Notes> Disable VO, VI, BE and BK four AC interrupts to gain more efficient CPU utilization.
@ -289,7 +289,7 @@ static void Init_ODM_ComInfo_88E(PADAPTER Adapter)
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_PLATFORM,ODM_CE);
if(Adapter->interface_type == RTW_GSPI )
if (Adapter->interface_type == RTW_GSPI )
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_INTERFACE,ODM_ITRF_SDIO);
else
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_INTERFACE,Adapter->interface_type);//RTL871X_HCI_TYPE
@ -308,7 +308,7 @@ static void Init_ODM_ComInfo_88E(PADAPTER Adapter)
//#ifdef CONFIG_USB_HCI
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_BOARD_TYPE,pHalData->BoardType);
if(pHalData->BoardType == BOARD_USB_High_PA){
if (pHalData->BoardType == BOARD_USB_High_PA){
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_EXT_LNA,_TRUE);
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_EXT_PA,_TRUE);
}
@ -318,13 +318,13 @@ static void Init_ODM_ComInfo_88E(PADAPTER Adapter)
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_BWIFI_TEST,Adapter->registrypriv.wifi_spec);
if(pHalData->rf_type == RF_1T1R){
if (pHalData->rf_type == RF_1T1R){
ODM_CmnInfoUpdate(pDM_Odm,ODM_CMNINFO_RF_TYPE,ODM_1T1R);
}
else if(pHalData->rf_type == RF_2T2R){
else if (pHalData->rf_type == RF_2T2R){
ODM_CmnInfoUpdate(pDM_Odm,ODM_CMNINFO_RF_TYPE,ODM_2T2R);
}
else if(pHalData->rf_type == RF_1T2R){
else if (pHalData->rf_type == RF_1T2R){
ODM_CmnInfoUpdate(pDM_Odm,ODM_CMNINFO_RF_TYPE,ODM_1T2R);
}
@ -336,7 +336,7 @@ static void Init_ODM_ComInfo_88E(PADAPTER Adapter)
pdmpriv->InitODMFlag = ODM_RF_CALIBRATION |
ODM_RF_TX_PWR_TRACK //|
;
//if(pHalData->AntDivCfg)
//if (pHalData->AntDivCfg)
// pdmpriv->InitODMFlag |= ODM_BB_ANT_DIV;
#endif
@ -369,7 +369,7 @@ static void Update_ODM_ComInfo_88E(PADAPTER Adapter)
ODM_RF_CALIBRATION |
ODM_RF_TX_PWR_TRACK
;
if(pHalData->AntDivCfg)
if (pHalData->AntDivCfg)
pdmpriv->InitODMFlag |= ODM_BB_ANT_DIV;
#if (MP_DRIVER==1)
@ -409,7 +409,7 @@ static void Update_ODM_ComInfo_88E(PADAPTER Adapter)
ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_POWER_SAVING,&(pwrctrlpriv->bpower_saving));
ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_RF_ANTENNA_TYPE, pHalData->TRxAntDivType);
for(i=0; i< NUM_STA; i++)
for (i=0; i< NUM_STA; i++)
{
//pDM_Odm->pODM_StaInfo[i] = NULL;
ODM_CmnInfoPtrArrayHook(pDM_Odm, ODM_CMNINFO_STA_STATUS,i,NULL);
@ -486,11 +486,11 @@ rtl8188e_HalDmWatchDog(
#ifdef CONFIG_P2P_PS
// Fw is under p2p powersaving mode, driver should stop dynamic mechanism.
// modifed by thomas. 2011.06.11.
if(Adapter->wdinfo.p2p_ps_mode)
if (Adapter->wdinfo.p2p_ps_mode)
bFwPSAwake = _FALSE;
#endif //CONFIG_P2P_PS
if( (hw_init_completed == _TRUE)
if ( (hw_init_completed == _TRUE)
&& ((!bFwCurrentInPSMode) && bFwPSAwake))
{
//
@ -499,7 +499,7 @@ rtl8188e_HalDmWatchDog(
dm_CheckStatistics(Adapter);
#ifdef CONFIG_CONCURRENT_MODE
if(Adapter->adapter_type > PRIMARY_ADAPTER)
if (Adapter->adapter_type > PRIMARY_ADAPTER)
goto _record_initrate;
#endif
@ -513,7 +513,7 @@ rtl8188e_HalDmWatchDog(
// Tx Migration settings.
//dm_InterruptMigration(Adapter);
//if(Adapter->HalFunc.TxCheckStuckHandler(Adapter))
//if (Adapter->HalFunc.TxCheckStuckHandler(Adapter))
// PlatformScheduleWorkItem(&(GET_HAL_DATA(Adapter)->HalResetWorkItem));
#endif
_record_initrate:
@ -530,19 +530,19 @@ rtl8188e_HalDmWatchDog(
pHalData->odmpriv.SupportAbility = 0;
#endif
if( (check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE) ||
if ( (check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE) == _TRUE))
{
if(Adapter->stapriv.asoc_sta_count > 2)
if (Adapter->stapriv.asoc_sta_count > 2)
bLinked = _TRUE;
}
else{//Station mode
if(check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE)
if (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE)
bLinked = _TRUE;
}
#ifdef CONFIG_CONCURRENT_MODE
if(check_buddy_fw_link(Adapter))
if (check_buddy_fw_link(Adapter))
bLinked = _TRUE;
#endif //CONFIG_CONCURRENT_MODE
@ -556,7 +556,7 @@ skip_dm:
// Check GPIO to determine current RF on/off and Pbc status.
// Check Hardware Radio ON/OFF or not
#ifdef CONFIG_PCI_HCI
if(pHalData->bGpioHwWpsPbc)
if (pHalData->bGpioHwWpsPbc)
#endif
{
//temp removed
@ -602,12 +602,12 @@ void AntDivCompare8188E(PADAPTER Adapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src
//PADAPTER Adapter = pDM_Odm->Adapter ;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
if(0 != pHalData->AntDivCfg )
if (0 != pHalData->AntDivCfg )
{
//DBG_8192C("update_network=> orgRSSI(%d)(%d),newRSSI(%d)(%d)\n",dst->Rssi,query_rx_pwr_percentage(dst->Rssi),
// src->Rssi,query_rx_pwr_percentage(src->Rssi));
//select optimum_antenna for before linked =>For antenna diversity
if(dst->Rssi >= src->Rssi )//keep org parameter
if (dst->Rssi >= src->Rssi )//keep org parameter
{
src->Rssi = dst->Rssi;
src->PhyInfo.Optimum_antenna = dst->PhyInfo.Optimum_antenna;
@ -625,19 +625,19 @@ u8 AntDivBeforeLink8188E(PADAPTER Adapter )
struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv);
// Condition that does not need to use antenna diversity.
if(pHalData->AntDivCfg==0)
if (pHalData->AntDivCfg==0)
{
//DBG_8192C("odm_AntDivBeforeLink8192C(): No AntDiv Mechanism.\n");
return _FALSE;
}
if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
{
return _FALSE;
}
if(pDM_SWAT_Table->SWAS_NoLink_State == 0){
if (pDM_SWAT_Table->SWAS_NoLink_State == 0){
//switch channel
pDM_SWAT_Table->SWAS_NoLink_State = 1;
pDM_SWAT_Table->CurAntenna = (pDM_SWAT_Table->CurAntenna==Antenna_A)?Antenna_B:Antenna_A;

File diff suppressed because it is too large Load diff

View file

@ -226,11 +226,11 @@ void Hal_MPT_CCKTxPowerAdjustbyIndex(PADAPTER pAdapter, BOOLEAN beven)
if (!IS_92C_SERIAL(pHalData->VersionID))
return;
#if 0
while(PlatformAtomicExchange(&Adapter->IntrCCKRefCount, TRUE) == TRUE)
while (PlatformAtomicExchange(&Adapter->IntrCCKRefCount, TRUE) == TRUE)
{
PlatformSleepUs(100);
TimeOut--;
if(TimeOut <= 0)
if (TimeOut <= 0)
{
RTPRINT(FINIT, INIT_TxPower,
("!!!MPT_CCKTxPowerAdjustbyIndex Wait for check CCK gain index too long!!!\n" ));
@ -344,7 +344,7 @@ void Hal_SetChannel(PADAPTER pAdapter)
// set RF channel register
for (eRFPath = 0; eRFPath < pHalData->NumTotalRFPath; eRFPath++)
{
if(IS_HARDWARE_TYPE_8192D(pAdapter))
if (IS_HARDWARE_TYPE_8192D(pAdapter))
_write_rfreg(pAdapter, (RF_RADIO_PATH_E)eRFPath, ODM_CHANNEL, 0xFF, channel);
else
_write_rfreg(pAdapter, eRFPath, ODM_CHANNEL, 0x3FF, channel);
@ -692,7 +692,7 @@ void Hal_SetAntenna(PADAPTER pAdapter)
if (chgTx && chgRx)
{
switch(pHalData->rf_chip)
switch (pHalData->rf_chip)
{
case RF_8225:
case RF_8256:
@ -783,7 +783,7 @@ void Hal_SetSingleCarrierTx(PADAPTER pAdapter, u8 bStart)
{
RT_TRACE(_module_mp_,_drv_alert_, ("SetSingleCarrierTx: test start\n"));
// 1. if OFDM block on?
if(!read_bbreg(pAdapter, rFPGA0_RFMOD, bOFDMEn))
if (!read_bbreg(pAdapter, rFPGA0_RFMOD, bOFDMEn))
write_bbreg(pAdapter, rFPGA0_RFMOD, bOFDMEn, bEnable);//set OFDM block on
{
@ -938,11 +938,11 @@ void Hal_SetCarrierSuppressionTx(PADAPTER pAdapter, u8 bStart)
if (bStart) // Start Carrier Suppression.
{
RT_TRACE(_module_mp_,_drv_alert_, ("SetCarrierSuppressionTx: test start\n"));
//if(pMgntInfo->dot11CurrentWirelessMode == WIRELESS_MODE_B)
//if (pMgntInfo->dot11CurrentWirelessMode == WIRELESS_MODE_B)
if (pAdapter->mppriv.rateidx <= MPT_RATE_11M)
{
// 1. if CCK block on?
if(!read_bbreg(pAdapter, rFPGA0_RFMOD, bCCKEn))
if (!read_bbreg(pAdapter, rFPGA0_RFMOD, bCCKEn))
write_bbreg(pAdapter, rFPGA0_RFMOD, bCCKEn, bEnable);//set CCK block on
//Turn Off All Test Mode
@ -966,7 +966,7 @@ void Hal_SetCarrierSuppressionTx(PADAPTER pAdapter, u8 bStart)
else// Stop Carrier Suppression.
{
RT_TRACE(_module_mp_,_drv_alert_, ("SetCarrierSuppressionTx: test stop\n"));
//if(pMgntInfo->dot11CurrentWirelessMode == WIRELESS_MODE_B)
//if (pMgntInfo->dot11CurrentWirelessMode == WIRELESS_MODE_B)
if (pAdapter->mppriv.rateidx <= MPT_RATE_11M ) {
write_bbreg(pAdapter, rCCK0_System, bCCKBBMode, 0x0); //normal mode
write_bbreg(pAdapter, rCCK0_System, bCCKScramble, 0x1); //turn on scramble setting
@ -994,7 +994,7 @@ void Hal_SetCCKContinuousTx(PADAPTER pAdapter, u8 bStart)
("SetCCKContinuousTx: test start\n"));
// 1. if CCK block on?
if(!read_bbreg(pAdapter, rFPGA0_RFMOD, bCCKEn))
if (!read_bbreg(pAdapter, rFPGA0_RFMOD, bCCKEn))
write_bbreg(pAdapter, rFPGA0_RFMOD, bCCKEn, bEnable);//set CCK block on
//Turn Off All Test Mode
@ -1003,7 +1003,7 @@ void Hal_SetCCKContinuousTx(PADAPTER pAdapter, u8 bStart)
write_bbreg(pAdapter, rOFDM1_LSTF, bOFDMSingleTone, bDisable);
//Set CCK Tx Test Rate
#if 0
switch(pAdapter->mppriv.rateidx)
switch (pAdapter->mppriv.rateidx)
{
case 2:
cckrate = 0;
@ -1067,7 +1067,7 @@ void Hal_SetOFDMContinuousTx(PADAPTER pAdapter, u8 bStart)
if (bStart) {
RT_TRACE(_module_mp_, _drv_info_, ("SetOFDMContinuousTx: test start\n"));
// 1. if OFDM block on?
if(!read_bbreg(pAdapter, rFPGA0_RFMOD, bOFDMEn))
if (!read_bbreg(pAdapter, rFPGA0_RFMOD, bOFDMEn))
write_bbreg(pAdapter, rFPGA0_RFMOD, bOFDMEn, bEnable);//set OFDM block on
{

File diff suppressed because it is too large Load diff

View file

@ -165,7 +165,7 @@ rtl8188e_PHY_RF6052SetBandwidth(
{
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
switch(Bandwidth)
switch (Bandwidth)
{
case HT_CHANNEL_WIDTH_20:
pHalData->RfRegChnlVal[0] = ((pHalData->RfRegChnlVal[0] & 0xfffff3ff) | BIT(10) | BIT(11));
@ -221,16 +221,16 @@ rtl8188e_PHY_RF6052SetCckTxPower(
TurboScanOff = _TRUE;
if(pmlmeext->sitesurvey_res.state == SCAN_PROCESS)
if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS)
{
TxAGC[RF_PATH_A] = 0x3f3f3f3f;
TxAGC[RF_PATH_B] = 0x3f3f3f3f;
TurboScanOff = _TRUE;//disable turbo scan
if(TurboScanOff)
if (TurboScanOff)
{
for(idx1=RF_PATH_A; idx1<=RF_PATH_B; idx1++)
for (idx1=RF_PATH_A; idx1<=RF_PATH_B; idx1++)
{
TxAGC[idx1] =
pPowerlevel[idx1] | (pPowerlevel[idx1]<<8) |
@ -248,26 +248,26 @@ rtl8188e_PHY_RF6052SetCckTxPower(
// 20100427 Joseph: Driver dynamic Tx power shall not affect Tx power. It shall be determined by power training mechanism.
// Currently, we cannot fully disable driver dynamic tx power mechanism because it is referenced by BT coexist mechanism.
// In the future, two mechanism shall be separated from each other and maintained independantly. Thanks for Lanhsin's reminder.
if(pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level1)
if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level1)
{
TxAGC[RF_PATH_A] = 0x10101010;
TxAGC[RF_PATH_B] = 0x10101010;
}
else if(pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level2)
else if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level2)
{
TxAGC[RF_PATH_A] = 0x00000000;
TxAGC[RF_PATH_B] = 0x00000000;
}
else
{
for(idx1=RF_PATH_A; idx1<=RF_PATH_B; idx1++)
for (idx1=RF_PATH_A; idx1<=RF_PATH_B; idx1++)
{
TxAGC[idx1] =
pPowerlevel[idx1] | (pPowerlevel[idx1]<<8) |
(pPowerlevel[idx1]<<16) | (pPowerlevel[idx1]<<24);
}
if(pHalData->EEPROMRegulatory==0)
if (pHalData->EEPROMRegulatory==0)
{
tmpval = (pHalData->MCSTxPowerLevelOriginalOffset[0][6]) +
(pHalData->MCSTxPowerLevelOriginalOffset[0][7]<<8);
@ -280,12 +280,12 @@ rtl8188e_PHY_RF6052SetCckTxPower(
}
}
for(idx1=RF_PATH_A; idx1<=RF_PATH_B; idx1++)
for (idx1=RF_PATH_A; idx1<=RF_PATH_B; idx1++)
{
ptr = (u8*)(&(TxAGC[idx1]));
for(idx2=0; idx2<4; idx2++)
for (idx2=0; idx2<4; idx2++)
{
if(*ptr > RF6052_MAX_TX_PWR)
if (*ptr > RF6052_MAX_TX_PWR)
*ptr = RF6052_MAX_TX_PWR;
ptr++;
}
@ -341,7 +341,7 @@ static void getPowerBase(
u8 Legacy_pwrdiff=0, HT20_pwrdiff=0;
u8 i, powerlevel[2];
for(i=0; i<2; i++)
for (i=0; i<2; i++)
{
powerlevel[i] = pPowerLevel[i];
Legacy_pwrdiff = pHalData->TxPwrLegacyHtDiff[i][Channel-1];
@ -352,10 +352,10 @@ static void getPowerBase(
//RTPRINT(FPHY, PHY_TXPWR, (" [OFDM power base index rf(%c) = 0x%x]\n", ((i==0)?'A':'B'), *(OfdmBase+i)));
}
for(i=0; i<2; i++)
for (i=0; i<2; i++)
{
//Check HT20 to HT40 diff
if(pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20)
if (pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20)
{
HT20_pwrdiff = pHalData->TxPwrHt20Diff[i][Channel-1];
powerlevel[i] += HT20_pwrdiff;
@ -387,7 +387,7 @@ void getPowerBase88E(
s8 HT20_pwrdiff=0;
u8 i, powerlevel[2];
for(i=0; i<2; i++)
for (i=0; i<2; i++)
{
powerBase0 = pPowerLevelOFDM[i];
@ -396,10 +396,10 @@ void getPowerBase88E(
//DBG_871X(" [OFDM power base index rf(%c) = 0x%x]\n", ((i==0)?'A':'B'), *(OfdmBase+i));
}
for(i=0; i<pHalData->NumTotalRFPath; i++)
for (i=0; i<pHalData->NumTotalRFPath; i++)
{
//Check HT20 to HT40 diff
if(pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20)
if (pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20)
{
powerlevel[i] = pPowerLevelBW20[i];
}
@ -431,9 +431,9 @@ static void getTxPowerWriteValByRegulatory(
//
// Index 0 & 1= legacy OFDM, 2-5=HT_MCS rate
//
for(rf=0; rf<2; rf++)
for (rf=0; rf<2; rf++)
{
switch(pHalData->EEPROMRegulatory)
switch (pHalData->EEPROMRegulatory)
{
case 0: // Realtek better performance
// increase power diff defined by Realtek for large power
@ -447,18 +447,18 @@ static void getTxPowerWriteValByRegulatory(
case 1: // Realtek regulatory
// increase power diff defined by Realtek for regulatory
{
if(pHalData->pwrGroupCnt == 1)
if (pHalData->pwrGroupCnt == 1)
chnlGroup = 0;
if(pHalData->pwrGroupCnt >= 3)
if (pHalData->pwrGroupCnt >= 3)
{
if(Channel <= 3)
if (Channel <= 3)
chnlGroup = 0;
else if(Channel >= 4 && Channel <= 9)
else if (Channel >= 4 && Channel <= 9)
chnlGroup = 1;
else if(Channel > 9)
else if (Channel > 9)
chnlGroup = 2;
if(pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20)
if (pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20)
chnlGroup++;
else
chnlGroup+=4;
@ -496,12 +496,12 @@ static void getTxPowerWriteValByRegulatory(
pwr_diff_limit[i] = (u8)((pHalData->MCSTxPowerLevelOriginalOffset[chnlGroup][index+(rf?8:0)]&(0x7f<<(i*8)))>>(i*8));
if (pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_40)
{
if(pwr_diff_limit[i] > pHalData->PwrGroupHT40[rf][Channel-1])
if (pwr_diff_limit[i] > pHalData->PwrGroupHT40[rf][Channel-1])
pwr_diff_limit[i] = pHalData->PwrGroupHT40[rf][Channel-1];
}
else
{
if(pwr_diff_limit[i] > pHalData->PwrGroupHT20[rf][Channel-1])
if (pwr_diff_limit[i] > pHalData->PwrGroupHT20[rf][Channel-1])
pwr_diff_limit[i] = pHalData->PwrGroupHT20[rf][Channel-1];
}
}
@ -524,20 +524,20 @@ static void getTxPowerWriteValByRegulatory(
// Currently, we cannot fully disable driver dynamic tx power mechanism because it is referenced by BT coexist mechanism.
// In the future, two mechanism shall be separated from each other and maintained independantly. Thanks for Lanhsin's reminder.
if(pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level1)
if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level1)
writeVal = 0x14141414;
else if(pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level2)
else if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level2)
writeVal = 0x00000000;
// 20100628 Joseph: High power mode for BT-Coexist mechanism.
// This mechanism is only applied when Driver-Highpower-Mechanism is OFF.
if(pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_BT1)
if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_BT1)
{
//RTPRINT(FBT, BT_TRACE, ("Tx Power (-6)\n"));
writeVal = writeVal - 0x06060606;
}
else if(pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_BT2)
else if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_BT2)
{
//RTPRINT(FBT, BT_TRACE, ("Tx Power (-0)\n"));
writeVal = writeVal;
@ -567,13 +567,13 @@ void getTxPowerWriteValByRegulatory88E(
// Index 0 & 1= legacy OFDM, 2-5=HT_MCS rate
//
#if 0 // (INTEL_PROXIMITY_SUPPORT == 1)
if(pMgntInfo->IntelProximityModeInfo.PowerOutput > 0)
if (pMgntInfo->IntelProximityModeInfo.PowerOutput > 0)
Regulatory = 2;
#endif
for(rf=0; rf<2; rf++)
for (rf=0; rf<2; rf++)
{
switch(Regulatory)
switch (Regulatory)
{
case 0: // Realtek better performance
// increase power diff defined by Realtek for large power
@ -587,33 +587,33 @@ void getTxPowerWriteValByRegulatory88E(
case 1: // Realtek regulatory
// increase power diff defined by Realtek for regulatory
{
if(pHalData->pwrGroupCnt == 1)
if (pHalData->pwrGroupCnt == 1)
chnlGroup = 0;
if(pHalData->pwrGroupCnt >= pHalData->PGMaxGroup)
if (pHalData->pwrGroupCnt >= pHalData->PGMaxGroup)
{
if (Channel < 3) // Chanel 1-2
chnlGroup = 0;
else if (Channel < 6) // Channel 3-5
chnlGroup = 1;
else if(Channel <9) // Channel 6-8
else if (Channel <9) // Channel 6-8
chnlGroup = 2;
else if(Channel <12) // Channel 9-11
else if (Channel <12) // Channel 9-11
chnlGroup = 3;
else if(Channel <14) // Channel 12-13
else if (Channel <14) // Channel 12-13
chnlGroup = 4;
else if(Channel ==14) // Channel 14
else if (Channel ==14) // Channel 14
chnlGroup = 5;
/*
if(Channel <= 3)
if (Channel <= 3)
chnlGroup = 0;
else if(Channel >= 4 && Channel <= 9)
else if (Channel >= 4 && Channel <= 9)
chnlGroup = 1;
else if(Channel > 9)
else if (Channel > 9)
chnlGroup = 2;
if(pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20)
if (pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20)
chnlGroup++;
else
chnlGroup+=4;
@ -649,7 +649,7 @@ void getTxPowerWriteValByRegulatory88E(
((rf==0)?'A':'B'), pHalData->PwrGroupHT20[rf][Channel-1]));
}*/
if(index < 2)
if (index < 2)
pwr_diff = pHalData->TxPwrLegacyHtDiff[rf][Channel-1];
else if (pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20)
pwr_diff = pHalData->TxPwrHt20Diff[rf][Channel-1];
@ -663,7 +663,7 @@ void getTxPowerWriteValByRegulatory88E(
//RTPRINT(FPHY, PHY_TXPWR, ("customer pwr limit rf(%c) = 0x%x\n", ((rf==0)?'A':'B'), customer_pwr_limit));
if(pwr_diff >= customer_pwr_limit)
if (pwr_diff >= customer_pwr_limit)
pwr_diff = 0;
else
pwr_diff = customer_pwr_limit - pwr_diff;
@ -672,7 +672,7 @@ void getTxPowerWriteValByRegulatory88E(
{
pwr_diff_limit[i] = (u1Byte)((pHalData->MCSTxPowerLevelOriginalOffset[chnlGroup][index+(rf?8:0)]&(0x7f<<(i*8)))>>(i*8));
if(pwr_diff_limit[i] > pwr_diff)
if (pwr_diff_limit[i] > pwr_diff)
pwr_diff_limit[i] = pwr_diff;
}
customer_limit = (pwr_diff_limit[3]<<24) | (pwr_diff_limit[2]<<16) |
@ -693,25 +693,25 @@ void getTxPowerWriteValByRegulatory88E(
// Currently, we cannot fully disable driver dynamic tx power mechanism because it is referenced by BT coexist mechanism.
// In the future, two mechanism shall be separated from each other and maintained independantly. Thanks for Lanhsin's reminder.
//92d do not need this
if(pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level1)
if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level1)
writeVal = 0x14141414;
else if(pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level2)
else if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_Level2)
writeVal = 0x00000000;
// 20100628 Joseph: High power mode for BT-Coexist mechanism.
// This mechanism is only applied when Driver-Highpower-Mechanism is OFF.
if(pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_BT1)
if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_BT1)
{
//RTPRINT(FBT, BT_TRACE, ("Tx Power (-6)\n"));
writeVal = writeVal - 0x06060606;
}
else if(pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_BT2)
else if (pdmpriv->DynamicTxHighPowerLvl == TxHighPwrLevel_BT2)
{
//RTPRINT(FBT, BT_TRACE, ("Tx Power (-0)\n"));
writeVal = writeVal ;
}
/*
if(pMgntInfo->bDisableTXPowerByRate)
if (pMgntInfo->bDisableTXPowerByRate)
{
// add for OID_RT_11N_TX_POWER_BY_RATE ,disable tx powre change by rate
writeVal = 0x2c2c2c2c;
@ -738,10 +738,10 @@ static void writeOFDMPowerReg88E(
u32 writeVal;
u16 RegOffset;
for(rf=0; rf<2; rf++)
for (rf=0; rf<2; rf++)
{
writeVal = pValue[rf];
for(i=0; i<4; i++)
for (i=0; i<4; i++)
{
pwr_val[i] = (u8)((writeVal & (0x7f<<(i*8)))>>(i*8));
if (pwr_val[i] > RF6052_MAX_TX_PWR)
@ -749,7 +749,7 @@ static void writeOFDMPowerReg88E(
}
writeVal = (pwr_val[3]<<24) | (pwr_val[2]<<16) |(pwr_val[1]<<8) |pwr_val[0];
if(rf == 0)
if (rf == 0)
RegOffset = RegOffset_A[index];
else
RegOffset = RegOffset_B[index];
@ -758,19 +758,19 @@ static void writeOFDMPowerReg88E(
//RTPRINT(FPHY, PHY_TXPWR, ("Set 0x%x = %08x\n", RegOffset, writeVal));
// 201005115 Joseph: Set Tx Power diff for Tx power training mechanism.
if(((pHalData->rf_type == RF_2T2R) &&
if (((pHalData->rf_type == RF_2T2R) &&
(RegOffset == rTxAGC_A_Mcs15_Mcs12 || RegOffset == rTxAGC_B_Mcs15_Mcs12))||
((pHalData->rf_type != RF_2T2R) &&
(RegOffset == rTxAGC_A_Mcs07_Mcs04 || RegOffset == rTxAGC_B_Mcs07_Mcs04)) )
{
writeVal = pwr_val[3];
if(RegOffset == rTxAGC_A_Mcs15_Mcs12 || RegOffset == rTxAGC_A_Mcs07_Mcs04)
if (RegOffset == rTxAGC_A_Mcs15_Mcs12 || RegOffset == rTxAGC_A_Mcs07_Mcs04)
RegOffset = 0xc90;
if(RegOffset == rTxAGC_B_Mcs15_Mcs12 || RegOffset == rTxAGC_B_Mcs07_Mcs04)
if (RegOffset == rTxAGC_B_Mcs15_Mcs12 || RegOffset == rTxAGC_B_Mcs07_Mcs04)
RegOffset = 0xc98;
for(i=0; i<3; i++)
for (i=0; i<3; i++)
{
if(i!=2)
if (i!=2)
writeVal = (writeVal>8)?(writeVal-8):0;
else
writeVal = (writeVal>6)?(writeVal-6):0;
@ -828,7 +828,7 @@ rtl8188e_PHY_RF6052SetOFDMTxPower(
//
ODM_TxPwrTrackAdjust88E(&pHalData->odmpriv, 0, &direction, &pwrtrac_value);
for(index=0; index<6; index++)
for (index=0; index<6; index++)
{
getTxPowerWriteValByRegulatory88E(Adapter, Channel, index,
&powerBase0[0], &powerBase1[0], &writeVal[0]);
@ -887,14 +887,14 @@ phy_RF6052_Config_ParaFile(
//3//-----------------------------------------------------------------
//3// <2> Initialize RF
//3//-----------------------------------------------------------------
//for(eRFPath = RF_PATH_A; eRFPath <pHalData->NumTotalRFPath; eRFPath++)
for(eRFPath = 0; eRFPath <pHalData->NumTotalRFPath; eRFPath++)
//for (eRFPath = RF_PATH_A; eRFPath <pHalData->NumTotalRFPath; eRFPath++)
for (eRFPath = 0; eRFPath <pHalData->NumTotalRFPath; eRFPath++)
{
pPhyReg = &pHalData->PHYRegDef[eRFPath];
/*----Store original RFENV control type----*/
switch(eRFPath)
switch (eRFPath)
{
case RF_PATH_A:
case RF_PATH_C:
@ -922,12 +922,12 @@ phy_RF6052_Config_ParaFile(
rtw_udelay_os(1);//PlatformStallExecution(1);
/*----Initialize RF fom connfiguration file----*/
switch(eRFPath)
switch (eRFPath)
{
case RF_PATH_A:
#ifdef CONFIG_EMBEDDED_FWIMG
#ifdef CONFIG_PHY_SETTING_WITH_ODM
if(HAL_STATUS_FAILURE ==ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv,(ODM_RF_RADIO_PATH_E)eRFPath, (ODM_RF_RADIO_PATH_E)eRFPath))
if (HAL_STATUS_FAILURE ==ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv,(ODM_RF_RADIO_PATH_E)eRFPath, (ODM_RF_RADIO_PATH_E)eRFPath))
rtStatus= _FAIL;
#else
rtStatus= rtl8188e_PHY_ConfigRFWithHeaderFile(Adapter,(RF_RADIO_PATH_E)eRFPath);
@ -939,7 +939,7 @@ phy_RF6052_Config_ParaFile(
case RF_PATH_B:
#ifdef CONFIG_EMBEDDED_FWIMG
#ifdef CONFIG_PHY_SETTING_WITH_ODM
if(HAL_STATUS_FAILURE ==ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv,(ODM_RF_RADIO_PATH_E)eRFPath, (ODM_RF_RADIO_PATH_E)eRFPath))
if (HAL_STATUS_FAILURE ==ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv,(ODM_RF_RADIO_PATH_E)eRFPath, (ODM_RF_RADIO_PATH_E)eRFPath))
rtStatus= _FAIL;
#else
rtStatus = rtl8188e_PHY_ConfigRFWithHeaderFile(Adapter,(RF_RADIO_PATH_E)eRFPath);
@ -955,7 +955,7 @@ phy_RF6052_Config_ParaFile(
}
/*----Restore RFENV control type----*/;
switch(eRFPath)
switch (eRFPath)
{
case RF_PATH_A:
case RF_PATH_C:
@ -967,7 +967,7 @@ phy_RF6052_Config_ParaFile(
break;
}
if(rtStatus != _SUCCESS){
if (rtStatus != _SUCCESS){
//RT_TRACE(COMP_FPGA, DBG_LOUD, ("phy_RF6052_Config_ParaFile():Radio[%d] Fail!!", eRFPath));
goto phy_RF6052_Config_ParaFile_Fail;
}
@ -993,7 +993,7 @@ PHY_RF6052_Config8188E(
// Initialize general global value
//
// TODO: Extend RF_PATH_C and RF_PATH_D in the future
if(pHalData->rf_type == RF_1T1R)
if (pHalData->rf_type == RF_1T1R)
pHalData->NumTotalRFPath = 1;
else
pHalData->NumTotalRFPath = 2;
@ -1003,7 +1003,7 @@ PHY_RF6052_Config8188E(
//
rtStatus = phy_RF6052_Config_ParaFile(Adapter);
#if 0
switch( Adapter->MgntInfo.bRegHwParaFile )
switch ( Adapter->MgntInfo.bRegHwParaFile )
{
case 0:
phy_RF6052_Config_HardCode(Adapter);

View file

@ -46,11 +46,11 @@ static void process_rssi(_adapter *padapter,union recv_frame *prframe)
#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS
//DBG_8192C("process_rssi=> pattrib->rssil(%d) signal_strength(%d)\n ",pattrib->RecvSignalPower,pattrib->signal_strength);
//if(pRfd->Status.bPacketToSelf || pRfd->Status.bPacketBeacon)
//if (pRfd->Status.bPacketToSelf || pRfd->Status.bPacketBeacon)
{
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
if(signal_stat->update_req) {
if (signal_stat->update_req) {
signal_stat->total_num = 0;
signal_stat->total_val = 0;
signal_stat->update_req = 0;
@ -62,7 +62,7 @@ static void process_rssi(_adapter *padapter,union recv_frame *prframe)
#else //CONFIG_NEW_SIGNAL_STAT_PROCESS
//Adapter->RxStats.RssiCalculateCnt++; //For antenna Test
if(padapter->recvpriv.signal_strength_data.total_num++ >= PHY_RSSI_SLID_WIN_MAX)
if (padapter->recvpriv.signal_strength_data.total_num++ >= PHY_RSSI_SLID_WIN_MAX)
{
padapter->recvpriv.signal_strength_data.total_num = PHY_RSSI_SLID_WIN_MAX;
last_rssi = padapter->recvpriv.signal_strength_data.elements[padapter->recvpriv.signal_strength_data.index];
@ -71,13 +71,13 @@ static void process_rssi(_adapter *padapter,union recv_frame *prframe)
padapter->recvpriv.signal_strength_data.total_val +=pattrib->phy_info.SignalStrength;
padapter->recvpriv.signal_strength_data.elements[padapter->recvpriv.signal_strength_data.index++] = pattrib->phy_info.SignalStrength;
if(padapter->recvpriv.signal_strength_data.index >= PHY_RSSI_SLID_WIN_MAX)
if (padapter->recvpriv.signal_strength_data.index >= PHY_RSSI_SLID_WIN_MAX)
padapter->recvpriv.signal_strength_data.index = 0;
tmp_val = padapter->recvpriv.signal_strength_data.total_val/padapter->recvpriv.signal_strength_data.total_num;
if(padapter->recvpriv.is_signal_dbg) {
if (padapter->recvpriv.is_signal_dbg) {
padapter->recvpriv.signal_strength= padapter->recvpriv.signal_strength_dbg;
padapter->recvpriv.rssi=(s8)translate2dbm((u8)padapter->recvpriv.signal_strength_dbg);
} else {
@ -101,7 +101,7 @@ static void process_link_qual(_adapter *padapter,union recv_frame *prframe)
struct signal_stat * signal_stat;
#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS
if(prframe == NULL || padapter==NULL){
if (prframe == NULL || padapter==NULL){
return;
}
@ -113,7 +113,7 @@ static void process_link_qual(_adapter *padapter,union recv_frame *prframe)
//DBG_8192C("process_link_qual=> pattrib->signal_qual(%d)\n ",pattrib->signal_qual);
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
if(signal_stat->update_req) {
if (signal_stat->update_req) {
signal_stat->total_num = 0;
signal_stat->total_val = 0;
signal_stat->update_req = 0;
@ -124,12 +124,12 @@ static void process_link_qual(_adapter *padapter,union recv_frame *prframe)
signal_stat->avg_val = signal_stat->total_val / signal_stat->total_num;
#else //CONFIG_NEW_SIGNAL_STAT_PROCESS
if(pattrib->phy_info.SignalQuality != 0)
if (pattrib->phy_info.SignalQuality != 0)
{
//
// 1. Record the general EVM to the sliding window.
//
if(padapter->recvpriv.signal_qual_data.total_num++ >= PHY_LINKQUALITY_SLID_WIN_MAX)
if (padapter->recvpriv.signal_qual_data.total_num++ >= PHY_LINKQUALITY_SLID_WIN_MAX)
{
padapter->recvpriv.signal_qual_data.total_num = PHY_LINKQUALITY_SLID_WIN_MAX;
last_evm = padapter->recvpriv.signal_qual_data.elements[padapter->recvpriv.signal_qual_data.index];
@ -138,7 +138,7 @@ static void process_link_qual(_adapter *padapter,union recv_frame *prframe)
padapter->recvpriv.signal_qual_data.total_val += pattrib->phy_info.SignalQuality;
padapter->recvpriv.signal_qual_data.elements[padapter->recvpriv.signal_qual_data.index++] = pattrib->phy_info.SignalQuality;
if(padapter->recvpriv.signal_qual_data.index >= PHY_LINKQUALITY_SLID_WIN_MAX)
if (padapter->recvpriv.signal_qual_data.index >= PHY_LINKQUALITY_SLID_WIN_MAX)
padapter->recvpriv.signal_qual_data.index = 0;
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("Total SQ=%d pattrib->signal_qual= %d\n", padapter->recvpriv.signal_qual_data.total_val, pattrib->phy_info.SignalQuality));
@ -207,7 +207,7 @@ void update_recvframe_attrib_88e(
// update rx report to recv_frame attribute
pattrib->pkt_rpt_type = (u8)((report.rxdw3 >> 14) & 0x3);//prxreport->rpt_sel;
if(pattrib->pkt_rpt_type == NORMAL_RX)//Normal rx packet
if (pattrib->pkt_rpt_type == NORMAL_RX)//Normal rx packet
{
pattrib->pkt_len = (u16)(report.rxdw0 &0x00003fff);//(u16)prxreport->pktlen;
pattrib->drvinfo_sz = (u8)((report.rxdw0 >> 16) & 0xf) * 8;//(u8)(prxreport->drvinfosize << 3);
@ -234,12 +234,12 @@ void update_recvframe_attrib_88e(
pattrib->shift_sz = (u8)((report.rxdw0 >> 24) & 0x3);
}
else if(pattrib->pkt_rpt_type == TX_REPORT1)//CCX
else if (pattrib->pkt_rpt_type == TX_REPORT1)//CCX
{
pattrib->pkt_len = TX_RPT1_PKT_LEN;
pattrib->drvinfo_sz = 0;
}
else if(pattrib->pkt_rpt_type == TX_REPORT2)// TX RPT
else if (pattrib->pkt_rpt_type == TX_REPORT2)// TX RPT
{
pattrib->pkt_len =(u16)(report.rxdw0 & 0x3FF);//Rx length[9:0]
pattrib->drvinfo_sz = 0;
@ -251,7 +251,7 @@ void update_recvframe_attrib_88e(
pattrib->MacIDValidEntry[1] = report.rxdw5;
}
else if(pattrib->pkt_rpt_type == HIS_REPORT)// USB HISR RPT
else if (pattrib->pkt_rpt_type == HIS_REPORT)// USB HISR RPT
{
pattrib->pkt_len = (u16)(report.rxdw0 &0x00003fff);//(u16)prxreport->pktlen;
}
@ -292,8 +292,8 @@ void update_recvframe_phyinfo_88e(
pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && (GetFrameSubType(wlanhdr) == WIFI_BEACON);
if(pkt_info.bPacketBeacon){
if(check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE) == _TRUE){
if (pkt_info.bPacketBeacon){
if (check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE) == _TRUE){
sa = padapter->mlmepriv.cur_network.network.MacAddress;
#if 0
{
@ -321,7 +321,7 @@ void update_recvframe_phyinfo_88e(
#ifdef CONFIG_CONCURRENT_MODE
//get Primary adapter's odmpriv
if(padapter->adapter_type > PRIMARY_ADAPTER){
if (padapter->adapter_type > PRIMARY_ADAPTER){
pHalData = GET_HAL_DATA(padapter->pbuddy_adapter);
}
#endif

View file

@ -41,16 +41,16 @@ static void _restore_security_setting(_adapter *padapter)
( padapter->securitypriv.dot11PrivacyAlgrthm == _WEP104_ ))
{
for(EntryId=0; EntryId<4; EntryId++)
for (EntryId=0; EntryId<4; EntryId++)
{
if(EntryId == psecuritypriv->dot11PrivacyKeyIndex)
if (EntryId == psecuritypriv->dot11PrivacyKeyIndex)
rtw_set_key(padapter,&padapter->securitypriv, EntryId, 1);
else
rtw_set_key(padapter,&padapter->securitypriv, EntryId, 0);
}
}
else if((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
else if ((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_))
{
psta = rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv));
@ -159,7 +159,7 @@ void rtl8188e_silentreset_for_specific_platform(_adapter *padapter)
ips_enter(padapter);
ips_leave(padapter);
#endif
if(check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE)
if (check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE)
{
_restore_network_status(padapter);
_restore_security_setting(padapter);
@ -188,7 +188,7 @@ void rtl8188e_sreset_xmit_status_check(_adapter *padapter)
unsigned int diff_time;
u32 txdma_status;
if( (txdma_status=rtw_read32(padapter, REG_TXDMA_STATUS)) !=0x00){
if ( (txdma_status=rtw_read32(padapter, REG_TXDMA_STATUS)) !=0x00){
DBG_871X("%s REG_TXDMA_STATUS:0x%08x\n", __FUNCTION__, txdma_status);
rtw_write32(padapter,REG_TXDMA_STATUS,txdma_status);
rtl8188e_silentreset_for_specific_platform(padapter);
@ -196,19 +196,19 @@ void rtl8188e_sreset_xmit_status_check(_adapter *padapter)
#ifdef CONFIG_USB_HCI
//total xmit irp = 4
//DBG_8192C("==>%s free_xmitbuf_cnt(%d),txirp_cnt(%d)\n",__FUNCTION__,pxmitpriv->free_xmitbuf_cnt,pxmitpriv->txirp_cnt);
//if(pxmitpriv->txirp_cnt == NR_XMITBUFF+1)
//if (pxmitpriv->txirp_cnt == NR_XMITBUFF+1)
current_time = rtw_get_current_time();
if(0==pxmitpriv->free_xmitbuf_cnt)
if (0==pxmitpriv->free_xmitbuf_cnt)
{
diff_time = jiffies_to_msecs(current_time - psrtpriv->last_tx_time);
if(diff_time > 2000){
if(psrtpriv->last_tx_complete_time==0){
if (diff_time > 2000){
if (psrtpriv->last_tx_complete_time==0){
psrtpriv->last_tx_complete_time = current_time;
}
else{
diff_time = jiffies_to_msecs(current_time - psrtpriv->last_tx_complete_time);
if(diff_time > 4000){
if (diff_time > 4000){
//padapter->Wifi_Error_Status = WIFI_TX_HANG;
DBG_8192C("%s tx hang\n", __FUNCTION__);
rtl8188e_silentreset_for_specific_platform(padapter);
@ -224,16 +224,16 @@ void rtl8188e_sreset_linked_status_check(_adapter *padapter)
u32 rx_dma_status = 0;
u8 fw_status=0;
rx_dma_status = rtw_read32(padapter,REG_RXDMA_STATUS);
if(rx_dma_status!= 0x00){
if (rx_dma_status!= 0x00){
DBG_8192C("%s REG_RXDMA_STATUS:0x%08x \n",__FUNCTION__,rx_dma_status);
rtw_write32(padapter,REG_RXDMA_STATUS,rx_dma_status);
}
fw_status = rtw_read8(padapter,REG_FMETHR);
if(fw_status != 0x00)
if (fw_status != 0x00)
{
if(fw_status == 1)
if (fw_status == 1)
DBG_8192C("%s REG_FW_STATUS (0x%02x), Read_Efuse_Fail !! \n",__FUNCTION__,fw_status);
else if(fw_status == 2)
else if (fw_status == 2)
DBG_8192C("%s REG_FW_STATUS (0x%02x), Condition_No_Match !! \n",__FUNCTION__,fw_status);
}
#if 0
@ -242,7 +242,7 @@ void rtl8188e_sreset_linked_status_check(_adapter *padapter)
regc58 = rtw_read32(padapter,0xc58);
reg824 = rtw_read32(padapter,0x824);
reg800 = rtw_read32(padapter,0x800);
if( ((regc50&0xFFFFFF00)!= 0x69543400)||
if ( ((regc50&0xFFFFFF00)!= 0x69543400)||
((regc58&0xFFFFFF00)!= 0x69543400)||
(((reg824&0xFFFFFF00)!= 0x00390000)&&(((reg824&0xFFFFFF00)!= 0x80390000)))||
( ((reg800&0xFFFFFF00)!= 0x03040000)&&((reg800&0xFFFFFF00)!= 0x83040000)))

View file

@ -70,22 +70,22 @@ void _dbg_dump_tx_info(_adapter *padapter,int frame_tag,struct tx_desc *ptxdesc)
u8 bDumpTxDesc = _FALSE;
rtw_hal_get_def_var(padapter, HAL_DEF_DBG_DUMP_TXPKT, &(bDumpTxPkt));
if(bDumpTxPkt ==1){//dump txdesc for data frame
if (bDumpTxPkt ==1){//dump txdesc for data frame
DBG_871X("dump tx_desc for data frame\n");
if((frame_tag&0x0f) == DATA_FRAMETAG){
if ((frame_tag&0x0f) == DATA_FRAMETAG){
bDumpTxDesc = _TRUE;
}
}
else if(bDumpTxPkt ==2){//dump txdesc for mgnt frame
else if (bDumpTxPkt ==2){//dump txdesc for mgnt frame
DBG_871X("dump tx_desc for mgnt frame\n");
if((frame_tag&0x0f) == MGNT_FRAMETAG){
if ((frame_tag&0x0f) == MGNT_FRAMETAG){
bDumpTxDesc = _TRUE;
}
}
else if(bDumpTxPkt ==3){//dump early info
else if (bDumpTxPkt ==3){//dump early info
}
if(bDumpTxDesc){
if (bDumpTxDesc){
// ptxdesc->txdw4 = cpu_to_le32(0x00001006);//RTS Rate=24M
// ptxdesc->txdw6 = 0x6666f800;
DBG_8192C("=====================================\n");
@ -140,14 +140,14 @@ InsertEMContent_8188E(
#endif
_rtw_memset(VirtualAddress, 0, EARLY_MODE_INFO_SIZE);
if(pEMInfo->EMPktNum==0)
if (pEMInfo->EMPktNum==0)
return;
#ifdef DBG_EMINFO
{
int i;
DBG_8192C("\n%s ==> pEMInfo->EMPktNum =%d\n",__FUNCTION__,pEMInfo->EMPktNum);
for(i=0;i< EARLY_MODE_MAX_PKT_NUM;i++){
for (i=0;i< EARLY_MODE_MAX_PKT_NUM;i++){
DBG_8192C("%s ==> pEMInfo->EMPktLen[%d] =%d\n",__FUNCTION__,i,pEMInfo->EMPktLen[i]);
}
@ -157,7 +157,7 @@ InsertEMContent_8188E(
#if RTL8188E_EARLY_MODE_PKT_NUM_10 == 1
SET_EARLYMODE_PKTNUM(VirtualAddress, pEMInfo->EMPktNum);
if(pEMInfo->EMPktNum == 1){
if (pEMInfo->EMPktNum == 1){
dwtmp = pEMInfo->EMPktLen[0];
}else{
dwtmp = pEMInfo->EMPktLen[0];
@ -165,7 +165,7 @@ InsertEMContent_8188E(
dwtmp += pEMInfo->EMPktLen[1];
}
SET_EARLYMODE_LEN0(VirtualAddress, dwtmp);
if(pEMInfo->EMPktNum <= 3){
if (pEMInfo->EMPktNum <= 3){
dwtmp = pEMInfo->EMPktLen[2];
}else{
dwtmp = pEMInfo->EMPktLen[2];
@ -173,7 +173,7 @@ InsertEMContent_8188E(
dwtmp += pEMInfo->EMPktLen[3];
}
SET_EARLYMODE_LEN1(VirtualAddress, dwtmp);
if(pEMInfo->EMPktNum <= 5){
if (pEMInfo->EMPktNum <= 5){
dwtmp = pEMInfo->EMPktLen[4];
}else{
dwtmp = pEMInfo->EMPktLen[4];
@ -182,7 +182,7 @@ InsertEMContent_8188E(
}
SET_EARLYMODE_LEN2_1(VirtualAddress, dwtmp&0xF);
SET_EARLYMODE_LEN2_2(VirtualAddress, dwtmp>>4);
if(pEMInfo->EMPktNum <= 7){
if (pEMInfo->EMPktNum <= 7){
dwtmp = pEMInfo->EMPktLen[6];
}else{
dwtmp = pEMInfo->EMPktLen[6];
@ -190,7 +190,7 @@ InsertEMContent_8188E(
dwtmp += pEMInfo->EMPktLen[7];
}
SET_EARLYMODE_LEN3(VirtualAddress, dwtmp);
if(pEMInfo->EMPktNum <= 9){
if (pEMInfo->EMPktNum <= 9){
dwtmp = pEMInfo->EMPktLen[8];
}else{
dwtmp = pEMInfo->EMPktLen[8];
@ -229,7 +229,7 @@ void UpdateEarlyModeInfo8188E(struct xmit_priv *pxmitpriv,struct xmit_buf *pxmit
#ifdef DBG_EMINFO
DBG_8192C("\n%s ==> agg_num:%d\n",__FUNCTION__, pframe->agg_num);
for(index=0;index<pframe->agg_num;index++){
for (index=0;index<pframe->agg_num;index++){
offset = pxmitpriv->agg_pkt[index].offset;
pktlen = pxmitpriv->agg_pkt[index].pkt_len;
DBG_8192C("%s ==> agg_pkt[%d].offset=%d\n",__FUNCTION__,index,offset);
@ -237,20 +237,20 @@ void UpdateEarlyModeInfo8188E(struct xmit_priv *pxmitpriv,struct xmit_buf *pxmit
}
#endif
if( pframe->agg_num > EARLY_MODE_MAX_PKT_NUM)
if ( pframe->agg_num > EARLY_MODE_MAX_PKT_NUM)
{
node_num_0 = pframe->agg_num;
node_num_1= EARLY_MODE_MAX_PKT_NUM-1;
}
for(index=0;index<pframe->agg_num;index++){
for (index=0;index<pframe->agg_num;index++){
offset = pxmitpriv->agg_pkt[index].offset;
pktlen = pxmitpriv->agg_pkt[index].pkt_len;
_rtw_memset(&eminfo,0,sizeof(struct EMInfo));
if( pframe->agg_num > EARLY_MODE_MAX_PKT_NUM){
if(node_num_0 > EARLY_MODE_MAX_PKT_NUM){
if ( pframe->agg_num > EARLY_MODE_MAX_PKT_NUM){
if (node_num_0 > EARLY_MODE_MAX_PKT_NUM){
eminfo.EMPktNum = EARLY_MODE_MAX_PKT_NUM;
node_num_0--;
}
@ -262,12 +262,12 @@ void UpdateEarlyModeInfo8188E(struct xmit_priv *pxmitpriv,struct xmit_buf *pxmit
else{
eminfo.EMPktNum = pframe->agg_num-(index+1);
}
for(j=0;j< eminfo.EMPktNum ;j++){
for (j=0;j< eminfo.EMPktNum ;j++){
eminfo.EMPktLen[j] = pxmitpriv->agg_pkt[index+1+j].pkt_len+4;// 4 bytes CRC
}
if(pmem){
if(index==0){
if (pmem){
if (index==0){
ptxdesc = (PTXDESC)(pmem);
pEMInfo_mem = ((u8 *)ptxdesc)+TXDESC_SIZE;
}

View file

@ -50,13 +50,13 @@ SwLedOn(
u8 LedCfg;
//HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
if( (padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE))
if ( (padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE))
{
return;
}
LedCfg = rtw_read8(padapter, REG_LEDCFG2);
switch(pLed->LedPin)
switch (pLed->LedPin)
{
case LED_PIN_LED0:
rtw_write8(padapter, REG_LEDCFG2, (LedCfg&0xf0)|BIT5|BIT6); // SW control led0 on.
@ -87,7 +87,7 @@ SwLedOff(
u8 LedCfg;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
if((padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE))
if ((padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE))
{
goto exit;
}
@ -95,10 +95,10 @@ SwLedOff(
LedCfg = rtw_read8(padapter, REG_LEDCFG2);//0x4E
switch(pLed->LedPin)
switch (pLed->LedPin)
{
case LED_PIN_LED0:
if(pHalData->bLedOpenDrain == _TRUE) // Open-drain arrangement for controlling the LED)
if (pHalData->bLedOpenDrain == _TRUE) // Open-drain arrangement for controlling the LED)
{
LedCfg &= 0x90; // Set to software control.
rtw_write8(padapter, REG_LEDCFG2, (LedCfg|BIT3));

View file

@ -50,7 +50,7 @@ void rtl8188eu_init_recvbuf(_adapter *padapter, struct recv_buf *precvbuf)
precvbuf->ref_cnt = 0;
if(precvbuf->pbuf)
if (precvbuf->pbuf)
{
precvbuf->pdata = precvbuf->phead = precvbuf->ptail = precvbuf->pbuf;
precvbuf->pend = precvbuf->pdata + MAX_RECVBUF_SZ;
@ -78,14 +78,14 @@ int rtl8188eu_init_recv_priv(_adapter *padapter)
#ifdef CONFIG_USB_INTERRUPT_IN_PIPE
#ifdef PLATFORM_LINUX
precvpriv->int_in_urb = usb_alloc_urb(0, GFP_KERNEL);
if(precvpriv->int_in_urb == NULL){
if (precvpriv->int_in_urb == NULL){
res= _FAIL;
DBG_8192C("alloc_urb for interrupt in endpoint fail !!!!\n");
goto exit;
}
#endif
precvpriv->int_in_buf = rtw_zmalloc(INTERRUPT_MSG_FORMAT_LEN);
if(precvpriv->int_in_buf == NULL){
if (precvpriv->int_in_buf == NULL){
res= _FAIL;
DBG_8192C("alloc_mem for interrupt in endpoint fail !!!!\n");
goto exit;
@ -100,7 +100,7 @@ int rtl8188eu_init_recv_priv(_adapter *padapter)
#endif // CONFIG_USE_USB_BUFFER_ALLOC_RX
precvpriv->pallocated_recv_buf = rtw_zmalloc(NR_RECVBUFF *sizeof(struct recv_buf) + 4);
if(precvpriv->pallocated_recv_buf==NULL){
if (precvpriv->pallocated_recv_buf==NULL){
res= _FAIL;
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("alloc recv_buf fail!\n"));
goto exit;
@ -114,7 +114,7 @@ int rtl8188eu_init_recv_priv(_adapter *padapter)
precvbuf = (struct recv_buf*)precvpriv->precv_buf;
for(i=0; i < NR_RECVBUFF ; i++)
for (i=0; i < NR_RECVBUFF ; i++)
{
_rtw_init_listhead(&precvbuf->list);
@ -123,7 +123,7 @@ int rtl8188eu_init_recv_priv(_adapter *padapter)
precvbuf->alloc_sz = MAX_RECVBUF_SZ;
res = rtw_os_recvbuf_resource_alloc(padapter, precvbuf);
if(res==_FAIL)
if (res==_FAIL)
break;
precvbuf->ref_cnt = 0;
@ -151,7 +151,7 @@ int rtl8188eu_init_recv_priv(_adapter *padapter)
skb_queue_head_init(&precvpriv->free_recv_skb_queue);
for(i=0; i<NR_PREALLOC_RECV_SKB; i++)
for (i=0; i<NR_PREALLOC_RECV_SKB; i++)
{
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)) // http://www.mail-archive.com/netdev@vger.kernel.org/msg17214.html
@ -160,7 +160,7 @@ int rtl8188eu_init_recv_priv(_adapter *padapter)
pskb = __netdev_alloc_skb(padapter->pnetdev, MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ, GFP_KERNEL);
#endif
if(pskb)
if (pskb)
{
pskb->dev = padapter->pnetdev;
@ -193,24 +193,24 @@ void rtl8188eu_free_recv_priv (_adapter *padapter)
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
for(i=0; i < NR_RECVBUFF ; i++)
for (i=0; i < NR_RECVBUFF ; i++)
{
rtw_os_recvbuf_resource_free(padapter, precvbuf);
precvbuf++;
}
if(precvpriv->pallocated_recv_buf)
if (precvpriv->pallocated_recv_buf)
rtw_mfree(precvpriv->pallocated_recv_buf, NR_RECVBUFF *sizeof(struct recv_buf) + 4);
#ifdef CONFIG_USB_INTERRUPT_IN_PIPE
#ifdef PLATFORM_LINUX
if(precvpriv->int_in_urb)
if (precvpriv->int_in_urb)
{
usb_free_urb(precvpriv->int_in_urb);
}
#endif//PLATFORM_LINUX
if(precvpriv->int_in_buf)
if (precvpriv->int_in_buf)
rtw_mfree(precvpriv->int_in_buf, INTERRUPT_MSG_FORMAT_LEN);
#endif//CONFIG_USB_INTERRUPT_IN_PIPE

View file

@ -94,7 +94,7 @@ void rtl8188eu_cal_txdesc_chksum(struct tx_desc *ptxdesc)
//Clear first
ptxdesc->txdw7 &= cpu_to_le32(0xffff0000);
for(index = 0 ; index < count ; index++){
for (index = 0 ; index < count ; index++){
checksum = checksum ^ le16_to_cpu(*(usPtr + index));
}
@ -197,7 +197,7 @@ void fill_txdesc_vcs(struct pkt_attrib *pattrib, u32 *pdw)
{
//DBG_8192C("cvs_mode=%d\n", pattrib->vcs_mode);
switch(pattrib->vcs_mode)
switch (pattrib->vcs_mode)
{
case RTS_CTS:
*pdw |= cpu_to_le32(RTS_EN);
@ -210,19 +210,19 @@ void fill_txdesc_vcs(struct pkt_attrib *pattrib, u32 *pdw)
break;
}
if(pattrib->vcs_mode) {
if (pattrib->vcs_mode) {
*pdw |= cpu_to_le32(HW_RTS_EN);
// Set RTS BW
if(pattrib->ht_en)
if (pattrib->ht_en)
{
*pdw |= (pattrib->bwmode&HT_CHANNEL_WIDTH_40)? cpu_to_le32(BIT(27)):0;
if(pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_LOWER)
if (pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_LOWER)
*pdw |= cpu_to_le32((0x01<<28)&0x30000000);
else if(pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_UPPER)
else if (pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_UPPER)
*pdw |= cpu_to_le32((0x02<<28)&0x30000000);
else if(pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE)
else if (pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE)
*pdw |= 0;
else
*pdw |= cpu_to_le32((0x03<<28)&0x30000000);
@ -234,15 +234,15 @@ void fill_txdesc_phy(struct pkt_attrib *pattrib, u32 *pdw)
{
//DBG_8192C("bwmode=%d, ch_off=%d\n", pattrib->bwmode, pattrib->ch_offset);
if(pattrib->ht_en)
if (pattrib->ht_en)
{
*pdw |= (pattrib->bwmode&HT_CHANNEL_WIDTH_40)? cpu_to_le32(BIT(25)):0;
if(pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_LOWER)
if (pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_LOWER)
*pdw |= cpu_to_le32((0x01<<DATA_SC_SHT)&0x003f0000);
else if(pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_UPPER)
else if (pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_UPPER)
*pdw |= cpu_to_le32((0x02<<DATA_SC_SHT)&0x003f0000);
else if(pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE)
else if (pattrib->ch_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE)
*pdw |= 0;
else
*pdw |= cpu_to_le32((0x03<<DATA_SC_SHT)&0x003f0000);
@ -270,15 +270,15 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
#endif //CONFIG_P2P
#ifdef CONFIG_CONCURRENT_MODE
if(rtw_buddy_adapter_up(padapter) && padapter->adapter_type > PRIMARY_ADAPTER)
if (rtw_buddy_adapter_up(padapter) && padapter->adapter_type > PRIMARY_ADAPTER)
pHalData = GET_HAL_DATA(padapter->pbuddy_adapter);
#endif //CONFIG_CONCURRENT_MODE
#ifndef CONFIG_USE_USB_BUFFER_ALLOC_TX
if (padapter->registrypriv.mp_mode == 0)
{
if((!bagg_pkt) &&(urb_zero_packet_chk(padapter, sz)==0))//(sz %512) != 0
//if((!bagg_pkt) &&(rtw_usb_bulk_size_boundary(padapter,TXDESC_SIZE+sz)==_FALSE))
if ((!bagg_pkt) &&(urb_zero_packet_chk(padapter, sz)==0))//(sz %512) != 0
//if ((!bagg_pkt) &&(rtw_usb_bulk_size_boundary(padapter,TXDESC_SIZE+sz)==_FALSE))
{
ptxdesc = (struct tx_desc *)(pmem+PACKET_OFFSET_SZ);
//DBG_8192C("==> non-agg-pkt,shift pointer...\n");
@ -297,7 +297,7 @@ if (padapter->registrypriv.mp_mode == 0)
offset = TXDESC_SIZE + OFFSET_SZ;
#ifdef CONFIG_TX_EARLY_MODE
if(bagg_pkt){
if (bagg_pkt){
offset += EARLY_MODE_INFO_SIZE ;//0x28
}
#endif
@ -309,8 +309,8 @@ if (padapter->registrypriv.mp_mode == 0)
#ifndef CONFIG_USE_USB_BUFFER_ALLOC_TX
if (padapter->registrypriv.mp_mode == 0)
{
if(!bagg_pkt){
if((pull) && (pxmitframe->pkt_offset>0)) {
if (!bagg_pkt){
if ((pull) && (pxmitframe->pkt_offset>0)) {
pxmitframe->pkt_offset = pxmitframe->pkt_offset -1;
}
}
@ -325,7 +325,7 @@ if (padapter->registrypriv.mp_mode == 0)
//driver uses rate
ptxdesc->txdw4 |= cpu_to_le32(USERATE);//rate control always by driver
if((pxmitframe->frame_tag&0x0f) == DATA_FRAMETAG)
if ((pxmitframe->frame_tag&0x0f) == DATA_FRAMETAG)
{
//DBG_8192C("pxmitframe->frame_tag == DATA_FRAMETAG\n");
@ -340,7 +340,7 @@ if (padapter->registrypriv.mp_mode == 0)
fill_txdesc_sectype(pattrib, ptxdesc);
if(pattrib->ampdu_en==_TRUE){
if (pattrib->ampdu_en==_TRUE){
ptxdesc->txdw2 |= cpu_to_le32(AGG_EN);//AGG EN
//SET_TX_DESC_MAX_AGG_NUM_88E(pDesc, 0x1F);
@ -387,8 +387,8 @@ if (padapter->registrypriv.mp_mode == 0)
ptxdesc->txdw5 |= cpu_to_le32(0x0001ff00);//DATA/RTS Rate FB LMT
#if (RATE_ADAPTIVE_SUPPORT == 1)
if(pattrib->ht_en){
if( ODM_RA_GetShortGI_8188E(&pHalData->odmpriv,pattrib->mac_id))
if (pattrib->ht_en){
if ( ODM_RA_GetShortGI_8188E(&pHalData->odmpriv,pattrib->mac_id))
ptxdesc->txdw5 |= cpu_to_le32(SGI);//SGI
}
@ -397,7 +397,7 @@ if (padapter->registrypriv.mp_mode == 0)
//for debug
#if 0
if(padapter->fix_rate!= 0xFF){
if (padapter->fix_rate!= 0xFF){
ptxdesc->datarate = padapter->fix_rate;
}
#endif
@ -408,11 +408,11 @@ if (padapter->registrypriv.mp_mode == 0)
#endif //(POWER_TRAINING_ACTIVE==1)
#else//if (RATE_ADAPTIVE_SUPPORT == 1)
if(pattrib->ht_en)
if (pattrib->ht_en)
ptxdesc->txdw5 |= cpu_to_le32(SGI);//SGI
data_rate = 0x13; //default rate: MCS7
if(padapter->fix_rate!= 0xFF){//rate control by iwpriv
if (padapter->fix_rate!= 0xFF){//rate control by iwpriv
data_rate = padapter->fix_rate;
}
ptxdesc->txdw5 |= cpu_to_le32(data_rate & 0x3F);
@ -444,7 +444,7 @@ if (padapter->registrypriv.mp_mode == 0)
}
#endif
}
else if((pxmitframe->frame_tag&0x0f)== MGNT_FRAMETAG)
else if ((pxmitframe->frame_tag&0x0f)== MGNT_FRAMETAG)
{
//DBG_8192C("pxmitframe->frame_tag == MGNT_FRAMETAG\n");
@ -477,13 +477,13 @@ if (padapter->registrypriv.mp_mode == 0)
//offset 20
ptxdesc->txdw5 |= cpu_to_le32(RTY_LMT_EN);//retry limit enable
if(pattrib->retry_ctrl == _TRUE)
if (pattrib->retry_ctrl == _TRUE)
ptxdesc->txdw5 |= cpu_to_le32(0x00180000);//retry limit = 6
else
ptxdesc->txdw5 |= cpu_to_le32(0x00300000);//retry limit = 12
#ifdef CONFIG_INTEL_PROXIM
if((padapter->proximity.proxim_on==_TRUE)&&(pattrib->intel_proxim==_TRUE)){
if ((padapter->proximity.proxim_on==_TRUE)&&(pattrib->intel_proxim==_TRUE)){
DBG_871X("\n %s pattrib->rate=%d\n",__FUNCTION__,pattrib->rate);
ptxdesc->txdw5 |= cpu_to_le32( pattrib->rate);
}
@ -493,12 +493,12 @@ if (padapter->registrypriv.mp_mode == 0)
ptxdesc->txdw5 |= cpu_to_le32(MRateToHwRate(pmlmeext->tx_rate));
}
}
else if((pxmitframe->frame_tag&0x0f) == TXAGG_FRAMETAG)
else if ((pxmitframe->frame_tag&0x0f) == TXAGG_FRAMETAG)
{
DBG_8192C("pxmitframe->frame_tag == TXAGG_FRAMETAG\n");
}
#ifdef CONFIG_MP_INCLUDED
else if(((pxmitframe->frame_tag&0x0f) == MP_FRAMETAG) &&
else if (((pxmitframe->frame_tag&0x0f) == MP_FRAMETAG) &&
(padapter->registrypriv.mp_mode == 1))
{
fill_txdesc_for_mp(padapter, ptxdesc);
@ -530,7 +530,7 @@ if (padapter->registrypriv.mp_mode == 0)
// (2) Enable HW SEQ control for beacon packet, because we use Hw beacon.
// (3) Use HW Qos SEQ to control the seq num of Ext port non-Qos packets.
// 2010.06.23. Added by tynli.
if(!pattrib->qos_en)
if (!pattrib->qos_en)
{
//ptxdesc->txdw4 |= cpu_to_le32(BIT(7)); // Hw set sequence number
//ptxdesc->txdw3 |= cpu_to_le32((8 <<28)); //set bit3 to 1. Suugested by TimChen. 2009.12.29.
@ -586,7 +586,7 @@ s32 rtl8188eu_xmit_buf_handler(PADAPTER padapter)
return _FAIL;
}
if(check_pending_xmitbuf(pxmitpriv) == _FALSE)
if (check_pending_xmitbuf(pxmitpriv) == _FALSE)
return _SUCCESS;
#ifdef CONFIG_LPS_LCLK
@ -662,7 +662,7 @@ static s32 rtw_dump_xframe(_adapter *padapter, struct xmit_frame *pxmitframe)
pull = update_txdesc(pxmitframe, mem_addr, sz, _FALSE);
if(pull)
if (pull)
{
mem_addr += PACKET_OFFSET_SZ; //pull txdesc head
@ -720,7 +720,7 @@ static u32 xmitframe_need_length(struct xmit_frame *pxmitframe)
pattrib->pktlen +
((pattrib->bswenc) ? pattrib->icv_len : 0);
if(pattrib->encrypt ==_TKIP_)
if (pattrib->encrypt ==_TKIP_)
len += 8;
return len;
@ -972,7 +972,7 @@ s32 rtl8188eu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv
descCount = 0;
bulkPtr = ((pbuf / bulkSize) + 1) * bulkSize;
}
}//end while( aggregate same priority and same DA(AP or STA) frames)
}//end while ( aggregate same priority and same DA(AP or STA) frames)
if (_rtw_queue_empty(&ptxservq->sta_pending) == _TRUE)
@ -1043,10 +1043,10 @@ s32 rtl8188eu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv
RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("xmitframe_complete()\n"));
if(pxmitbuf==NULL)
if (pxmitbuf==NULL)
{
pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv);
if(!pxmitbuf)
if (!pxmitbuf)
{
return _FALSE;
}
@ -1057,7 +1057,7 @@ s32 rtl8188eu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv
{
pxmitframe = rtw_dequeue_xframe(pxmitpriv, phwxmits, hwentry);
if(pxmitframe)
if (pxmitframe)
{
pxmitframe->pxmitbuf = pxmitbuf;
@ -1065,9 +1065,9 @@ s32 rtl8188eu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv
pxmitbuf->priv_data = pxmitframe;
if((pxmitframe->frame_tag&0x0f) == DATA_FRAMETAG)
if ((pxmitframe->frame_tag&0x0f) == DATA_FRAMETAG)
{
if(pxmitframe->attrib.priority<=15)//TID0~15
if (pxmitframe->attrib.priority<=15)//TID0~15
{
res = rtw_xmitframe_coalesce(padapter, pxmitframe->pkt, pxmitframe);
}
@ -1079,7 +1079,7 @@ s32 rtl8188eu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv
RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("xmitframe_complete(): rtw_dump_xframe\n"));
if(res == _SUCCESS)
if (res == _SUCCESS)
{
rtw_dump_xframe(padapter, pxmitframe);
}
@ -1100,7 +1100,7 @@ s32 rtl8188eu_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv
break;
}while(0/*xcnt < (NR_XMITFRAME >> 3)*/);
}while (0/*xcnt < (NR_XMITFRAME >> 3)*/);
return _TRUE;
@ -1259,7 +1259,7 @@ s32 rtl8188eu_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt)
pxmit_skb = netdev_alloc_skb(pnetdev, len + TXDESC_SIZE);
#endif
if(!pxmit_skb)
if (!pxmit_skb)
goto _exit;
pxmitbuf = pxmit_skb->data;
@ -1278,7 +1278,7 @@ s32 rtl8188eu_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt)
ptxdesc->txdw0 |= cpu_to_le32(((TXDESC_SIZE+OFFSET_SZ)<<OFFSET_SHT)&0x00ff0000);//default = 32 bytes for TX Desc
ptxdesc->txdw0 |= cpu_to_le32(OWN | FSG | LSG);
if(bmcst)
if (bmcst)
{
ptxdesc->txdw0 |= cpu_to_le32(BIT(24));
}

File diff suppressed because it is too large Load diff

View file

@ -54,7 +54,7 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u
#endif
#ifdef CONFIG_CONCURRENT_MODE
if(padapter->adapter_type > PRIMARY_ADAPTER)
if (padapter->adapter_type > PRIMARY_ADAPTER)
{
padapter = padapter->pbuddy_adapter;
pdvobjpriv = adapter_to_dvobj(padapter);
@ -64,13 +64,13 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u
//DBG_871X("%s %s:%d\n",__FUNCTION__, current->comm, current->pid);
if((padapter->bSurpriseRemoved) ||(padapter->pwrctrlpriv.pnp_bstop_trx)){
if ((padapter->bSurpriseRemoved) ||(padapter->pwrctrlpriv.pnp_bstop_trx)){
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usbctrl_vendorreq:(padapter->bSurpriseRemoved ||adapter->pwrctrlpriv.pnp_bstop_trx)!!!\n"));
status = -EPERM;
goto exit;
}
if(len>MAX_VENDOR_REQ_CMD_SIZE){
if (len>MAX_VENDOR_REQ_CMD_SIZE){
DBG_8192C( "[%s] Buffer len error ,vendor request failed\n", __FUNCTION__ );
status = -EINVAL;
goto exit;
@ -104,7 +104,7 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u
goto release_mutex;
}
while(++vendorreq_times<= MAX_USBCTRL_VENDORREQ_TIMES)
while (++vendorreq_times<= MAX_USBCTRL_VENDORREQ_TIMES)
{
_rtw_memset(pIo_buf, 0, len);
@ -142,7 +142,7 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u
, value,(requesttype == 0x01)?"read":"write" , len, status, *(u32*)pdata, vendorreq_times);
if (status < 0) {
if(status == (-ESHUTDOWN) || status == -ENODEV )
if (status == (-ESHUTDOWN) || status == -ENODEV )
{
padapter->bSurpriseRemoved = _TRUE;
} else {
@ -156,7 +156,7 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u
}
else // status != len && status >= 0
{
if(status > 0) {
if (status > 0) {
if ( requesttype == 0x01 )
{ // For Control read transfer, we have to copy the read data from pIo_buf to pdata.
_rtw_memcpy( pdata, pIo_buf, len );
@ -164,7 +164,7 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u
}
}
if(rtw_inc_and_chk_continual_urb_error(pdvobjpriv) == _TRUE ){
if (rtw_inc_and_chk_continual_urb_error(pdvobjpriv) == _TRUE ){
padapter->bSurpriseRemoved = _TRUE;
break;
}
@ -172,7 +172,7 @@ static int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u
}
// firmware download is checksumed, don't retry
if( (value >= FW_8188E_START_ADDRESS && value <= FW_8188E_END_ADDRESS) || status == len )
if ( (value >= FW_8188E_START_ADDRESS && value <= FW_8188E_END_ADDRESS) || status == len )
break;
}
@ -408,14 +408,14 @@ void interrupt_handler_8188eu(_adapter *padapter,u16 pkt_len,u8 *pbuf)
_rtw_memcpy(&hisr_ex,&(pHalData->IntArray[1]),4);
hisr_ex = le32_to_cpu(hisr_ex);
if((hisr != 0) || (hisr_ex!=0))
if ((hisr != 0) || (hisr_ex!=0))
DBG_871X("===> %s hisr:0x%08x ,hisr_ex:0x%08x \n",__FUNCTION__,hisr,hisr_ex);
}
#endif
#ifdef CONFIG_LPS_LCLK
if( pHalData->IntArray[0] & IMR_CPWM_88E )
if ( pHalData->IntArray[0] & IMR_CPWM_88E )
{
_rtw_memcpy(&pwr_rpt.state, &(pbuf[USB_INTR_CONTENT_CPWM1_OFFSET]), 1);
//_rtw_memcpy(&pwr_rpt.state2, &(pbuf[USB_INTR_CONTENT_CPWM2_OFFSET]), 1);
@ -437,29 +437,29 @@ void interrupt_handler_8188eu(_adapter *padapter,u16 pkt_len,u8 *pbuf)
{
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
#if 0
if(pHalData->IntArray[0] & IMR_BCNDMAINT0_88E)
if (pHalData->IntArray[0] & IMR_BCNDMAINT0_88E)
DBG_8192C("%s: HISR_BCNERLY_INT\n", __func__);
if(pHalData->IntArray[0] & IMR_TBDOK_88E)
if (pHalData->IntArray[0] & IMR_TBDOK_88E)
DBG_8192C("%s: HISR_TXBCNOK\n", __func__);
if(pHalData->IntArray[0] & IMR_TBDER_88E)
if (pHalData->IntArray[0] & IMR_TBDER_88E)
DBG_8192C("%s: HISR_TXBCNERR\n", __func__);
#endif
if(check_fwstate(pmlmepriv, WIFI_AP_STATE))
if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
{
//send_beacon(padapter);
if(pmlmepriv->update_bcn == _TRUE)
if (pmlmepriv->update_bcn == _TRUE)
{
//tx_beacon_hdl(padapter, NULL);
set_tx_beacon_cmd(padapter);
}
}
#ifdef CONFIG_CONCURRENT_MODE
if(check_buddy_fwstate(padapter, WIFI_AP_STATE))
if (check_buddy_fwstate(padapter, WIFI_AP_STATE))
{
//send_beacon(padapter);
if(padapter->pbuddy_adapter->mlmepriv.update_bcn == _TRUE)
if (padapter->pbuddy_adapter->mlmepriv.update_bcn == _TRUE)
{
//tx_beacon_hdl(padapter, NULL);
set_tx_beacon_cmd(padapter->pbuddy_adapter);
@ -474,19 +474,19 @@ void interrupt_handler_8188eu(_adapter *padapter,u16 pkt_len,u8 *pbuf)
#ifdef DBG_CONFIG_ERROR_DETECT_INT
if( pHalData->IntArray[1] & IMR_TXERR_88E )
if ( pHalData->IntArray[1] & IMR_TXERR_88E )
DBG_871X("===> %s Tx Error Flag Interrupt Status \n",__FUNCTION__);
if( pHalData->IntArray[1] & IMR_RXERR_88E )
if ( pHalData->IntArray[1] & IMR_RXERR_88E )
DBG_871X("===> %s Rx Error Flag INT Status \n",__FUNCTION__);
if( pHalData->IntArray[1] & IMR_TXFOVW_88E )
if ( pHalData->IntArray[1] & IMR_TXFOVW_88E )
DBG_871X("===> %s Transmit FIFO Overflow \n",__FUNCTION__);
if( pHalData->IntArray[1] & IMR_RXFOVW_88E )
if ( pHalData->IntArray[1] & IMR_RXFOVW_88E )
DBG_871X("===> %s Receive FIFO Overflow \n",__FUNCTION__);
#endif//DBG_CONFIG_ERROR_DETECT_INT
// C2H Event
if(pbuf[0]!= 0){
if (pbuf[0]!= 0){
_rtw_memcpy(&(pHalData->C2hArray[0]), &(pbuf[USB_INTR_CONTENT_C2H_OFFSET]), 16);
//rtw_c2h_wk_cmd(padapter); to do..
}
@ -500,7 +500,7 @@ static void usb_read_interrupt_complete(struct urb *purb, struct pt_regs *regs)
int err;
_adapter *padapter = (_adapter *)purb->context;
if(padapter->bSurpriseRemoved || padapter->bDriverStopped||padapter->bReadPortCancel)
if (padapter->bSurpriseRemoved || padapter->bDriverStopped||padapter->bReadPortCancel)
{
DBG_8192C("%s() RX Warning! bDriverStopped(%d) OR bSurpriseRemoved(%d) bReadPortCancel(%d)\n",
__FUNCTION__,padapter->bDriverStopped, padapter->bSurpriseRemoved,padapter->bReadPortCancel);
@ -508,7 +508,7 @@ static void usb_read_interrupt_complete(struct urb *purb, struct pt_regs *regs)
return;
}
if(purb->status==0)//SUCCESS
if (purb->status==0)//SUCCESS
{
if (purb->actual_length > INTERRUPT_MSG_FORMAT_LEN)
{
@ -518,7 +518,7 @@ static void usb_read_interrupt_complete(struct urb *purb, struct pt_regs *regs)
interrupt_handler_8188eu(padapter, purb->actual_length,purb->transfer_buffer );
err = usb_submit_urb(purb, GFP_ATOMIC);
if((err) && (err != (-EPERM)))
if ((err) && (err != (-EPERM)))
{
DBG_8192C("cannot submit interrupt in-token(err = 0x%08x),urb_status = %d\n",err, purb->status);
}
@ -527,7 +527,7 @@ static void usb_read_interrupt_complete(struct urb *purb, struct pt_regs *regs)
{
DBG_8192C("###=> usb_read_interrupt_complete => urb status(%d)\n", purb->status);
switch(purb->status) {
switch (purb->status) {
case -EINVAL:
case -EPIPE:
case -ENODEV:
@ -573,7 +573,7 @@ _func_enter_;
1);
err = usb_submit_urb(precvpriv->int_in_urb, GFP_ATOMIC);
if((err) && (err != (-EPERM)))
if ((err) && (err != (-EPERM)))
{
DBG_8192C("cannot submit interrupt in-token(err = 0x%08x),urb_status = %d\n",err, precvpriv->int_in_urb->status);
ret = _FAIL;
@ -597,17 +597,17 @@ static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_stat *prxsta
_queue *pfree_recv_queue = &precvpriv->free_recv_queue;
u8 *pbuf = precvframe->u.hdr.rx_data;
if(!secondary_padapter)
if (!secondary_padapter)
return ret;
paddr1 = GetAddr1Ptr(precvframe->u.hdr.rx_data);
if(IS_MCAST(paddr1) == _FALSE)//unicast packets
if (IS_MCAST(paddr1) == _FALSE)//unicast packets
{
//primary_myid = myid(&primary_padapter->eeprompriv);
secondary_myid = myid(&secondary_padapter->eeprompriv);
if(_rtw_memcmp(paddr1, secondary_myid, ETH_ALEN))
if (_rtw_memcmp(paddr1, secondary_myid, ETH_ALEN))
{
//change to secondary interface
precvframe->u.hdr.adapter = secondary_padapter;
@ -629,7 +629,7 @@ static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_stat *prxsta
switch (type)
{
case WIFI_MGT_TYPE: //Handle BC/MC mgnt Packets
if(subtype == WIFI_BEACON)
if (subtype == WIFI_BEACON)
{
paddr3 = GetAddr3Ptr(precvframe->u.hdr.rx_data);
@ -641,10 +641,10 @@ static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_stat *prxsta
clone = _FALSE;
}
if(check_fwstate(&primary_padapter->mlmepriv, _FW_LINKED) &&
if (check_fwstate(&primary_padapter->mlmepriv, _FW_LINKED) &&
_rtw_memcmp(paddr3, get_bssid(&primary_padapter->mlmepriv), ETH_ALEN))
{
if(clone==_FALSE)
if (clone==_FALSE)
{
clone = _TRUE;
}
@ -656,7 +656,7 @@ static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_stat *prxsta
precvframe->u.hdr.adapter = primary_padapter;
}
if(check_fwstate(&primary_padapter->mlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) ||
if (check_fwstate(&primary_padapter->mlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) ||
check_fwstate(&secondary_padapter->mlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING))
{
clone = _TRUE;
@ -664,7 +664,7 @@ static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_stat *prxsta
}
}
else if(subtype == WIFI_PROBEREQ)
else if (subtype == WIFI_PROBEREQ)
{
//probe req frame is only for interface2
//change to secondary interface
@ -680,7 +680,7 @@ static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_stat *prxsta
paddr2 = GetAddr2Ptr(precvframe->u.hdr.rx_data);
if(_rtw_memcmp(paddr2, get_bssid(&secondary_padapter->mlmepriv), ETH_ALEN))
if (_rtw_memcmp(paddr2, get_bssid(&secondary_padapter->mlmepriv), ETH_ALEN))
{
//change to secondary interface
precvframe->u.hdr.adapter = secondary_padapter;
@ -694,7 +694,7 @@ static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_stat *prxsta
}
#endif
if(_TRUE == clone)
if (_TRUE == clone)
{
//clone/copy to if2
u8 shift_sz = 0;
@ -703,7 +703,7 @@ static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_stat *prxsta
struct rx_pkt_attrib *pattrib = NULL;
precvframe_if2 = rtw_alloc_recvframe(pfree_recv_queue);
if(precvframe_if2)
if (precvframe_if2)
{
precvframe_if2->u.hdr.adapter = secondary_padapter;
@ -730,9 +730,9 @@ static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_stat *prxsta
// for first fragment packet, driver need allocate 1536+drvinfo_sz+RXDESC_SIZE to defrag packet.
// modify alloc_sz for recvive crc error packet by thomas 2011-06-02
if((pattrib->mfrag == 1)&&(pattrib->frag_num == 0)){
if ((pattrib->mfrag == 1)&&(pattrib->frag_num == 0)){
//alloc_sz = 1664; //1664 is 128 alignment.
if(skb_len <= 1650)
if (skb_len <= 1650)
alloc_sz = 1664;
else
alloc_sz = skb_len + 14;
@ -749,7 +749,7 @@ static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_stat *prxsta
#else
pkt_copy = netdev_alloc_skb(secondary_padapter->pnetdev, alloc_sz);
#endif
if(pkt_copy)
if (pkt_copy)
{
pkt_copy->dev = secondary_padapter->pnetdev;
precvframe_if2->u.hdr.pkt = pkt_copy;
@ -812,7 +812,7 @@ static int recvbuf2recvframe(_adapter *padapter, struct recv_buf *precvbuf)
pkt_cnt = (le32_to_cpu(prxstat->rxdw2)>>16) & 0xff;
#if 0 //temp remove when disable usb rx aggregation
if((pkt_cnt > 10) || (pkt_cnt < 1) || (transfer_len<RXDESC_SIZE) ||(pkt_len<=0))
if ((pkt_cnt > 10) || (pkt_cnt < 1) || (transfer_len<RXDESC_SIZE) ||(pkt_len<=0))
{
return _FAIL;
}
@ -826,7 +826,7 @@ static int recvbuf2recvframe(_adapter *padapter, struct recv_buf *precvbuf)
prxstat = (struct recv_stat *)pbuf;
precvframe = rtw_alloc_recvframe(pfree_recv_queue);
if(precvframe==NULL)
if (precvframe==NULL)
{
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("recvbuf2recvframe: precvframe==NULL\n"));
DBG_8192C("%s()-%d: rtw_alloc_recvframe() failed! RX Drop!\n", __FUNCTION__, __LINE__);
@ -843,13 +843,13 @@ static int recvbuf2recvframe(_adapter *padapter, struct recv_buf *precvbuf)
pattrib = &precvframe->u.hdr.attrib;
#ifdef CONFIG_SPECIAL_SETTING_FOR_FUNAI_TV
//if(pattrib->pkt_len>2000){
//if (pattrib->pkt_len>2000){
// printk("%s: RX Warning!pkt_len= %d, data rate=0x%02x \n", __FUNCTION__,pattrib->pkt_len,pattrib->mcs_rate);
//}
#endif
if ((pattrib->crc_err) || (pattrib->icv_err))
{
if(pattrib->pkt_len>2000){
if (pattrib->pkt_len>2000){
DBG_8192C("%s: RX Warning! crc_err=%d icv_err=%d, skip!\n", __FUNCTION__, pattrib->crc_err, pattrib->icv_err);
#ifdef CONFIG_SPECIAL_SETTING_FOR_FUNAI_TV
printk("%s: RX Warning!pkt_len= %d, data rate=0x%02x \n", __FUNCTION__,pattrib->pkt_len,pattrib->mcs_rate);
@ -860,14 +860,14 @@ static int recvbuf2recvframe(_adapter *padapter, struct recv_buf *precvbuf)
}
if( (pattrib->physt) && (pattrib->pkt_rpt_type == NORMAL_RX))
if ( (pattrib->physt) && (pattrib->pkt_rpt_type == NORMAL_RX))
{
pphy_status = (struct phy_stat *)(pbuf + RXDESC_OFFSET);
}
pkt_offset = RXDESC_SIZE + pattrib->drvinfo_sz + pattrib->shift_sz + pattrib->pkt_len;
if((pattrib->pkt_len<=0) || (pkt_offset>transfer_len))
if ((pattrib->pkt_len<=0) || (pkt_offset>transfer_len))
{
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("recvbuf2recvframe: pkt_len<=0\n"));
DBG_8192C("%s()-%d: RX Warning!\n", __FUNCTION__, __LINE__);
@ -890,9 +890,9 @@ static int recvbuf2recvframe(_adapter *padapter, struct recv_buf *precvbuf)
// for first fragment packet, driver need allocate 1536+drvinfo_sz+RXDESC_SIZE to defrag packet.
// modify alloc_sz for recvive crc error packet by thomas 2011-06-02
if((pattrib->mfrag == 1)&&(pattrib->frag_num == 0)){
if ((pattrib->mfrag == 1)&&(pattrib->frag_num == 0)){
//alloc_sz = 1664; //1664 is 128 alignment.
if(skb_len <= 1650)
if (skb_len <= 1650)
alloc_sz = 1664;
else
alloc_sz = skb_len + 14;
@ -909,7 +909,7 @@ static int recvbuf2recvframe(_adapter *padapter, struct recv_buf *precvbuf)
#else
pkt_copy = netdev_alloc_skb(padapter->pnetdev, alloc_sz);
#endif
if(pkt_copy)
if (pkt_copy)
{
pkt_copy->dev = padapter->pnetdev;
precvframe->u.hdr.pkt = pkt_copy;
@ -937,7 +937,7 @@ static int recvbuf2recvframe(_adapter *padapter, struct recv_buf *precvbuf)
//recvframe_pull(precvframe, drvinfo_sz + RXDESC_SIZE);
#ifdef CONFIG_USB_RX_AGGREGATION
switch(pHalData->UsbRxAggMode)
switch (pHalData->UsbRxAggMode)
{
case USB_RX_AGG_DMA:
case USB_RX_AGG_MIX:
@ -952,12 +952,12 @@ static int recvbuf2recvframe(_adapter *padapter, struct recv_buf *precvbuf)
}
#endif
if(pattrib->pkt_rpt_type == NORMAL_RX)//Normal rx packet
if (pattrib->pkt_rpt_type == NORMAL_RX)//Normal rx packet
{
#ifdef CONFIG_CONCURRENT_MODE
if(rtw_buddy_adapter_up(padapter))
if (rtw_buddy_adapter_up(padapter))
{
if(pre_recv_entry(precvframe, prxstat, pphy_status) != _SUCCESS)
if (pre_recv_entry(precvframe, prxstat, pphy_status) != _SUCCESS)
{
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,
("recvbuf2recvframe: recv_entry(precvframe) != _SUCCESS\n"));
@ -968,7 +968,7 @@ static int recvbuf2recvframe(_adapter *padapter, struct recv_buf *precvbuf)
{
if (pattrib->physt)
update_recvframe_phyinfo_88e(precvframe, (struct phy_stat*)pphy_status);
if(rtw_recv_entry(precvframe) != _SUCCESS)
if (rtw_recv_entry(precvframe) != _SUCCESS)
{
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,
("recvbuf2recvframe: rtw_recv_entry(precvframe) != _SUCCESS\n"));
@ -979,13 +979,13 @@ static int recvbuf2recvframe(_adapter *padapter, struct recv_buf *precvbuf)
else{ // pkt_rpt_type == TX_REPORT1-CCX, TX_REPORT2-TX RTP,HIS_REPORT-USB HISR RTP
//enqueue recvframe to txrtp queue
if(pattrib->pkt_rpt_type == TX_REPORT1){
if (pattrib->pkt_rpt_type == TX_REPORT1){
//DBG_8192C("rx CCX \n");
//CCX-TXRPT ack for xmit mgmt frames.
handle_txrpt_ccx_88e(padapter, precvframe->u.hdr.rx_data);
}
else if(pattrib->pkt_rpt_type == TX_REPORT2){
else if (pattrib->pkt_rpt_type == TX_REPORT2){
//DBG_8192C("rx TX RPT \n");
ODM_RA_TxRPT2Handle_8188E(
&pHalData->odmpriv,
@ -996,7 +996,7 @@ static int recvbuf2recvframe(_adapter *padapter, struct recv_buf *precvbuf)
);
}
else if(pattrib->pkt_rpt_type == HIS_REPORT)
else if (pattrib->pkt_rpt_type == HIS_REPORT)
{
//DBG_8192C("%s , rx USB HISR \n",__FUNCTION__);
#ifdef CONFIG_SUPPORT_USB_INT
@ -1013,10 +1013,10 @@ static int recvbuf2recvframe(_adapter *padapter, struct recv_buf *precvbuf)
precvframe = NULL;
pkt_copy = NULL;
if(transfer_len>0 && pkt_cnt==0)
if (transfer_len>0 && pkt_cnt==0)
pkt_cnt = (le32_to_cpu(prxstat->rxdw2)>>16) & 0xff;
}while((transfer_len>0) && (pkt_cnt>0));
}while ((transfer_len>0) && (pkt_cnt>0));
_exit_recvbuf2recvframe:
@ -1056,7 +1056,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
precvpriv->rx_pending_cnt --;
if(padapter->bSurpriseRemoved || padapter->bDriverStopped||padapter->bReadPortCancel)
if (padapter->bSurpriseRemoved || padapter->bDriverStopped||padapter->bReadPortCancel)
{
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bDriverStopped(%d) OR bSurpriseRemoved(%d)\n", padapter->bDriverStopped, padapter->bSurpriseRemoved));
DBG_8192C("%s() RX Warning! bDriverStopped(%d) OR bSurpriseRemoved(%d) bReadPortCancel(%d)\n",
@ -1064,7 +1064,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
goto exit;
}
if(purb->status==0)//SUCCESS
if (purb->status==0)//SUCCESS
{
if ((purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE))
{
@ -1090,11 +1090,11 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
DBG_8192C("###=> usb_read_port_complete => urb status(%d)\n", purb->status);
if(rtw_inc_and_chk_continual_urb_error(adapter_to_dvobj(padapter)) == _TRUE ){
if (rtw_inc_and_chk_continual_urb_error(adapter_to_dvobj(padapter)) == _TRUE ){
padapter->bSurpriseRemoved = _TRUE;
}
switch(purb->status) {
switch (purb->status) {
case -EINVAL:
case -EPIPE:
case -ENODEV:
@ -1144,17 +1144,17 @@ static u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem)
_func_enter_;
if(adapter->bDriverStopped || adapter->bSurpriseRemoved ||adapter->pwrctrlpriv.pnp_bstop_trx)
if (adapter->bDriverStopped || adapter->bSurpriseRemoved ||adapter->pwrctrlpriv.pnp_bstop_trx)
{
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port:( padapter->bDriverStopped ||padapter->bSurpriseRemoved ||adapter->pwrctrlpriv.pnp_bstop_trx)!!!\n"));
return _FAIL;
}
if(precvbuf !=NULL)
if (precvbuf !=NULL)
{
rtl8188eu_init_recvbuf(adapter, precvbuf);
if(precvbuf->pbuf)
if (precvbuf->pbuf)
{
precvpriv->rx_pending_cnt++;
@ -1173,7 +1173,7 @@ _func_enter_;
purb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
err = usb_submit_urb(purb, GFP_ATOMIC);
if((err) && (err != (-EPERM)))
if ((err) && (err != (-EPERM)))
{
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("cannot submit rx in-token(err=0x%.8x), URB_STATUS =0x%.8x", err, purb->status));
DBG_8192C("cannot submit rx in-token(err = 0x%08x),urb_status = %d\n",err,purb->status);
@ -1218,7 +1218,7 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb)
pkt_cnt = (le32_to_cpu(prxstat->rxdw2)>>16) & 0xff;
#if 0 //temp remove when disable usb rx aggregation
if((pkt_cnt > 10) || (pkt_cnt < 1) || (transfer_len<RXDESC_SIZE) ||(pkt_len<=0))
if ((pkt_cnt > 10) || (pkt_cnt < 1) || (transfer_len<RXDESC_SIZE) ||(pkt_len<=0))
{
return _FAIL;
}
@ -1231,7 +1231,7 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb)
prxstat = (struct recv_stat *)pbuf;
precvframe = rtw_alloc_recvframe(pfree_recv_queue);
if(precvframe==NULL)
if (precvframe==NULL)
{
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("recvbuf2recvframe: precvframe==NULL\n"));
DBG_8192C("%s()-%d: rtw_alloc_recvframe() failed! RX Drop!\n", __FUNCTION__, __LINE__);
@ -1255,14 +1255,14 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb)
goto _exit_recvbuf2recvframe;
}
if( (pattrib->physt) && (pattrib->pkt_rpt_type == NORMAL_RX))
if ( (pattrib->physt) && (pattrib->pkt_rpt_type == NORMAL_RX))
{
pphy_status = (struct phy_stat *)(pbuf + RXDESC_OFFSET);
}
pkt_offset = RXDESC_SIZE + pattrib->drvinfo_sz + pattrib->shift_sz + pattrib->pkt_len;
if((pattrib->pkt_len<=0) || (pkt_offset>transfer_len))
if ((pattrib->pkt_len<=0) || (pkt_offset>transfer_len))
{
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("recvbuf2recvframe: pkt_len<=0\n"));
DBG_8192C("%s()-%d: RX Warning!,pkt_len<=0 or pkt_offset> transfoer_len \n", __FUNCTION__, __LINE__);
@ -1285,9 +1285,9 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb)
// for first fragment packet, driver need allocate 1536+drvinfo_sz+RXDESC_SIZE to defrag packet.
// modify alloc_sz for recvive crc error packet by thomas 2011-06-02
if((pattrib->mfrag == 1)&&(pattrib->frag_num == 0)){
if ((pattrib->mfrag == 1)&&(pattrib->frag_num == 0)){
//alloc_sz = 1664; //1664 is 128 alignment.
if(skb_len <= 1650)
if (skb_len <= 1650)
alloc_sz = 1664;
else
alloc_sz = skb_len + 14;
@ -1304,7 +1304,7 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb)
#else
pkt_copy = netdev_alloc_skb(padapter->pnetdev, alloc_sz);
#endif
if(pkt_copy)
if (pkt_copy)
{
pkt_copy->dev = padapter->pnetdev;
precvframe->u.hdr.pkt = pkt_copy;
@ -1317,7 +1317,7 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb)
}
else
{
if((pattrib->mfrag == 1)&&(pattrib->frag_num == 0))
if ((pattrib->mfrag == 1)&&(pattrib->frag_num == 0))
{
DBG_8192C("recvbuf2recvframe: alloc_skb fail , drop frag frame \n");
rtw_free_recvframe(precvframe, pfree_recv_queue);
@ -1325,7 +1325,7 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb)
}
precvframe->u.hdr.pkt = skb_clone(pskb, GFP_ATOMIC);
if(precvframe->u.hdr.pkt)
if (precvframe->u.hdr.pkt)
{
precvframe->u.hdr.rx_head = precvframe->u.hdr.rx_data = precvframe->u.hdr.rx_tail
= pbuf+ pattrib->drvinfo_sz + RXDESC_SIZE;
@ -1344,7 +1344,7 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb)
//recvframe_pull(precvframe, drvinfo_sz + RXDESC_SIZE);
#ifdef CONFIG_USB_RX_AGGREGATION
switch(pHalData->UsbRxAggMode)
switch (pHalData->UsbRxAggMode)
{
case USB_RX_AGG_DMA:
case USB_RX_AGG_MIX:
@ -1359,12 +1359,12 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb)
}
#endif
if(pattrib->pkt_rpt_type == NORMAL_RX)//Normal rx packet
if (pattrib->pkt_rpt_type == NORMAL_RX)//Normal rx packet
{
#ifdef CONFIG_CONCURRENT_MODE
if(rtw_buddy_adapter_up(padapter))
if (rtw_buddy_adapter_up(padapter))
{
if(pre_recv_entry(precvframe, prxstat, pphy_status) != _SUCCESS)
if (pre_recv_entry(precvframe, prxstat, pphy_status) != _SUCCESS)
{
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,
("recvbuf2recvframe: recv_entry(precvframe) != _SUCCESS\n"));
@ -1375,7 +1375,7 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb)
{
if (pattrib->physt)
update_recvframe_phyinfo_88e(precvframe, (struct phy_stat*)pphy_status);
if(rtw_recv_entry(precvframe) != _SUCCESS)
if (rtw_recv_entry(precvframe) != _SUCCESS)
{
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,
("recvbuf2recvframe: rtw_recv_entry(precvframe) != _SUCCESS\n"));
@ -1385,12 +1385,12 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb)
else{ // pkt_rpt_type == TX_REPORT1-CCX, TX_REPORT2-TX RTP,HIS_REPORT-USB HISR RTP
//enqueue recvframe to txrtp queue
if(pattrib->pkt_rpt_type == TX_REPORT1){
if (pattrib->pkt_rpt_type == TX_REPORT1){
//DBG_8192C("rx CCX \n");
//CCX-TXRPT ack for xmit mgmt frames.
handle_txrpt_ccx_88e(padapter, precvframe->u.hdr.rx_data);
}
else if(pattrib->pkt_rpt_type == TX_REPORT2){
else if (pattrib->pkt_rpt_type == TX_REPORT2){
//DBG_8192C("rx TX RPT \n");
ODM_RA_TxRPT2Handle_8188E(
&pHalData->odmpriv,
@ -1401,7 +1401,7 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb)
);
}
else if(pattrib->pkt_rpt_type == HIS_REPORT)
else if (pattrib->pkt_rpt_type == HIS_REPORT)
{
//DBG_8192C("%s , rx USB HISR \n",__FUNCTION__);
#ifdef CONFIG_SUPPORT_USB_INT
@ -1418,10 +1418,10 @@ static int recvbuf2recvframe(_adapter *padapter, _pkt *pskb)
precvframe = NULL;
pkt_copy = NULL;
if(transfer_len>0 && pkt_cnt==0)
if (transfer_len>0 && pkt_cnt==0)
pkt_cnt = (le32_to_cpu(prxstat->rxdw2)>>16) & 0xff;
}while((transfer_len>0) && (pkt_cnt>0));
}while ((transfer_len>0) && (pkt_cnt>0));
_exit_recvbuf2recvframe:
@ -1479,20 +1479,20 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
precvpriv->rx_pending_cnt --;
//if(precvpriv->rx_pending_cnt== 0)
//if (precvpriv->rx_pending_cnt== 0)
//{
// RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete: rx_pending_cnt== 0, set allrxreturnevt!\n"));
// _rtw_up_sema(&precvpriv->allrxreturnevt);
//}
if(padapter->bSurpriseRemoved || padapter->bDriverStopped||padapter->bReadPortCancel)
if (padapter->bSurpriseRemoved || padapter->bDriverStopped||padapter->bReadPortCancel)
{
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port_complete:bDriverStopped(%d) OR bSurpriseRemoved(%d)\n", padapter->bDriverStopped, padapter->bSurpriseRemoved));
#ifdef CONFIG_PREALLOC_RECV_SKB
precvbuf->reuse = _TRUE;
#else
if(precvbuf->pskb){
if (precvbuf->pskb){
DBG_8192C("==> free skb(%p)\n",precvbuf->pskb);
dev_kfree_skb_any(precvbuf->pskb);
}
@ -1502,7 +1502,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
goto exit;
}
if(purb->status==0)//SUCCESS
if (purb->status==0)//SUCCESS
{
if ((purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE))
{
@ -1533,11 +1533,11 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
DBG_8192C("###=> usb_read_port_complete => urb status(%d)\n", purb->status);
if(rtw_inc_and_chk_continual_urb_error(adapter_to_dvobj(padapter)) == _TRUE ){
if (rtw_inc_and_chk_continual_urb_error(adapter_to_dvobj(padapter)) == _TRUE ){
padapter->bSurpriseRemoved = _TRUE;
}
switch(purb->status) {
switch (purb->status) {
case -EINVAL:
case -EPIPE:
case -ENODEV:
@ -1592,14 +1592,14 @@ static u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem)
_func_enter_;
if(adapter->bDriverStopped || adapter->bSurpriseRemoved ||adapter->pwrctrlpriv.pnp_bstop_trx)
if (adapter->bDriverStopped || adapter->bSurpriseRemoved ||adapter->pwrctrlpriv.pnp_bstop_trx)
{
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_read_port:( padapter->bDriverStopped ||padapter->bSurpriseRemoved ||adapter->pwrctrlpriv.pnp_bstop_trx)!!!\n"));
return _FAIL;
}
#ifdef CONFIG_PREALLOC_RECV_SKB
if((precvbuf->reuse == _FALSE) || (precvbuf->pskb == NULL))
if ((precvbuf->reuse == _FALSE) || (precvbuf->pskb == NULL))
{
if (NULL != (precvbuf->pskb = skb_dequeue(&precvpriv->free_recv_skb_queue)))
{
@ -1609,12 +1609,12 @@ _func_enter_;
#endif
if(precvbuf !=NULL)
if (precvbuf !=NULL)
{
rtl8188eu_init_recvbuf(adapter, precvbuf);
//re-assign for linux based on skb
if((precvbuf->reuse == _FALSE) || (precvbuf->pskb == NULL))
if ((precvbuf->reuse == _FALSE) || (precvbuf->pskb == NULL))
{
//precvbuf->pskb = alloc_skb(MAX_RECVBUF_SZ, GFP_ATOMIC);//don't use this after v2.6.25
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)) // http://www.mail-archive.com/netdev@vger.kernel.org/msg17214.html
@ -1622,7 +1622,7 @@ _func_enter_;
#else
precvbuf->pskb = netdev_alloc_skb(adapter->pnetdev, MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
#endif
if(precvbuf->pskb == NULL)
if (precvbuf->pskb == NULL)
{
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("init_recvbuf(): alloc_skb fail!\n"));
DBG_8192C("#### usb_read_port() alloc_skb fail!#####\n");
@ -1669,7 +1669,7 @@ _func_enter_;
precvbuf);//context is precvbuf
err = usb_submit_urb(purb, GFP_ATOMIC);
if((err) && (err != (-EPERM)))
if ((err) && (err != (-EPERM)))
{
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("cannot submit rx in-token(err=0x%.8x), URB_STATUS =0x%.8x", err, purb->status));
DBG_8192C("cannot submit rx in-token(err = 0x%08x),urb_status = %d\n",err,purb->status);
@ -1694,10 +1694,10 @@ void rtl8188eu_xmit_tasklet(void *priv)
_adapter *padapter = (_adapter*)priv;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
if(check_fwstate(&padapter->mlmepriv, _FW_UNDER_SURVEY) == _TRUE)
if (check_fwstate(&padapter->mlmepriv, _FW_UNDER_SURVEY) == _TRUE)
return;
while(1)
while (1)
{
if ((padapter->bDriverStopped == _TRUE)||(padapter->bSurpriseRemoved== _TRUE) || (padapter->bWritePortCancel == _TRUE))
{
@ -1707,7 +1707,7 @@ void rtl8188eu_xmit_tasklet(void *priv)
ret = rtl8188eu_xmitframe_complete(padapter, pxmitpriv, NULL);
if(ret==_FALSE)
if (ret==_FALSE)
break;
}

View file

@ -376,10 +376,10 @@ storePwrIndexDiffRateOffset(
#define SIC_MAX_POLL_CNT 5
#if(SIC_HW_SUPPORT == 1)
#if (SIC_HW_SUPPORT == 1)
#define SIC_CMD_READY 0
#define SIC_CMD_PREWRITE 0x1
#if(RTL8188E_SUPPORT == 1)
#if (RTL8188E_SUPPORT == 1)
#define SIC_CMD_WRITE 0x40
#define SIC_CMD_PREREAD 0x2
#define SIC_CMD_READ 0x80
@ -407,7 +407,7 @@ storePwrIndexDiffRateOffset(
#define SIC_CMD_WRITE 1
#define SIC_CMD_READ 2
#if(RTL8188E_SUPPORT == 1)
#if (RTL8188E_SUPPORT == 1)
#define SIC_CMD_REG 0x1EB // 1byte
#define SIC_ADDR_REG 0x1E8 // 1b9~1ba, 2 bytes
#define SIC_DATA_REG 0x1EC // 1bc~1bf
@ -418,7 +418,7 @@ storePwrIndexDiffRateOffset(
#endif
#endif
#if(SIC_ENABLE == 1)
#if (SIC_ENABLE == 1)
VOID SIC_Init(IN PADAPTER Adapter);
#endif

View file

@ -132,7 +132,7 @@ typedef enum _WIRELESS_MODE {
} WIRELESS_MODE;
#if(TX_POWER_FOR_5G_BAND == 1)
#if (TX_POWER_FOR_5G_BAND == 1)
#define CHANNEL_MAX_NUMBER 14+24+21 // 14 is the max channel number
#define CHANNEL_GROUP_MAX 3+9 // ch1~3, ch4~9, ch10~14 total three groups
#define MAX_PG_GROUP 13

View file

@ -26,7 +26,7 @@
/******************************************************************************
* FW_AP.TXT
******************************************************************************/
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP))
void
ODM_ReadFirmware_8188E_FW_AP(
IN PDM_ODM_T pDM_Odm,

View file

@ -21,7 +21,7 @@
#ifndef __HAL_PHY_RF_H__
#define __HAL_PHY_RF_H__
#if(DM_ODM_SUPPORT_TYPE & ODM_MP)
#if (DM_ODM_SUPPORT_TYPE & ODM_MP)
#define MAX_TOLERANCE 5
#define IQK_DELAY_TIME 1 //ms

View file

@ -43,9 +43,9 @@
// value: the value to be polled, masked by the msd field.
// note: driver shall implement this cmd by
// do{
// if( (Read(offset) & msk) == (value & msk) )
// if ( (Read(offset) & msk) == (value & msk) )
// break;
// } while(not timeout);
// } while (not timeout);
#define PWR_CMD_DELAY 0x03
// offset: the value to delay

View file

@ -1492,7 +1492,7 @@ enum secondary_ch_offset {
};
u8 secondary_ch_offset_to_hal_ch_offset(u8 ch_offset);
u8 hal_ch_offset_to_secondary_ch_offset(u8 ch_offset);
u8 *rtw_set_ie_ch_switch(u8 *buf, u32 *buf_len, u8 ch_switch_mode, u8 new_ch, u8 ch_switch_cnt);
u8 *rtw_set_ie_ch_switch (u8 *buf, u32 *buf_len, u8 ch_switch_mode, u8 new_ch, u8 ch_switch_cnt);
u8 *rtw_set_ie_secondary_ch_offset(u8 *buf, u32 *buf_len, u8 secondary_ch_offset);
u8 *rtw_set_ie_mesh_ch_switch_parm(u8 *buf, u32 *buf_len, u8 ttl, u8 flags, u16 reason, u16 precedence);

View file

@ -85,7 +85,7 @@
#define Smooth_TH_3 4
#define Smooth_Step_Size 5
#define Adaptive_SIR 1
#if(RTL8723_FPGA_VERIFICATION == 1)
#if (RTL8723_FPGA_VERIFICATION == 1)
#define PSD_RESCAN 1
#else
#define PSD_RESCAN 4
@ -119,7 +119,7 @@
// 2011/09/20 MH Add for AP/ADSLpseudo DM structuer requirement.
// We need to remove to other position???
//
#if(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
#if (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
typedef struct rtl8192cd_priv {
u1Byte temp;
@ -127,7 +127,7 @@ typedef struct rtl8192cd_priv {
#endif
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
typedef struct _ADAPTER{
u1Byte temp;
#ifdef AP_BUILD_WORKAROUND
@ -250,11 +250,11 @@ typedef struct _RX_High_Power_
}RXHP_T, *pRXHP_T;
#if(DM_ODM_SUPPORT_TYPE & (ODM_CE))
#if (DM_ODM_SUPPORT_TYPE & (ODM_CE))
#define ASSOCIATE_ENTRY_NUM 32 // Max size of AsocEntry[].
#define ODM_ASSOCIATE_ENTRY_NUM ASSOCIATE_ENTRY_NUM
#elif(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#elif (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#define ASSOCIATE_ENTRY_NUM NUM_STAT
#define ODM_ASSOCIATE_ENTRY_NUM ASSOCIATE_ENTRY_NUM+1
@ -353,7 +353,7 @@ typedef struct _EDCA_TURBO_
{
BOOLEAN bCurrentTurboEDCA;
BOOLEAN bIsCurRDLState;
#if(DM_ODM_SUPPORT_TYPE == ODM_CE )
#if (DM_ODM_SUPPORT_TYPE == ODM_CE )
u4Byte prv_traffic_idx; // edca turbo
#endif
@ -370,7 +370,7 @@ typedef struct _ODM_RATE_ADAPTIVE
} ODM_RATE_ADAPTIVE, *PODM_RATE_ADAPTIVE;
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#ifdef ADSL_AP_BUILD_WORKAROUND
@ -401,7 +401,7 @@ typedef enum _HT_IOT_PEER
HT_IOT_PEER_REALTEK_WOW = 15,
HT_IOT_PEER_MAX = 16
}HT_IOT_PEER_E, *PHTIOT_PEER_E;
#endif//#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#endif//#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
@ -1070,7 +1070,7 @@ typedef enum _ANT_DIV_TYPE
//
// 2011/09/22 MH Copy from SD4 defined structure. We use to support PHY DM integration.
//
#if(DM_ODM_SUPPORT_TYPE & ODM_MP)
#if (DM_ODM_SUPPORT_TYPE & ODM_MP)
#if (RT_PLATFORM != PLATFORM_LINUX)
typedef
#endif
@ -1088,10 +1088,10 @@ typedef struct DM_Out_Source_Dynamic_Mechanism_Structure
// WHen you use Adapter or priv pointer, you must make sure the pointer is ready.
BOOLEAN odm_ready;
#if(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
#if (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
rtl8192cd_priv fake_priv;
#endif
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
// ADSL_AP_BUILD_WORKAROUND
ADAPTER fake_adapter;
#endif
@ -1332,7 +1332,7 @@ typedef struct DM_Out_Source_Dynamic_Mechanism_Structure
#endif
#endif
#if(DM_ODM_SUPPORT_TYPE & ODM_MP)
#if (DM_ODM_SUPPORT_TYPE & ODM_MP)
#if (RT_PLATFORM != PLATFORM_LINUX)
} DM_ODM_T, *PDM_ODM_T; // DM_Dynamic_Mechanism_Structure
@ -1633,7 +1633,7 @@ ODM_RAStateCheck(
OUT pu1Byte pRATRState
);
#if(DM_ODM_SUPPORT_TYPE & (ODM_MP|ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_MP|ODM_AP|ODM_ADSL))
//============================================================
// function prototype
//============================================================
@ -1664,7 +1664,7 @@ ODM_RateAdaptiveStateApInit(
#define AP_InitRateAdaptiveState ODM_RateAdaptiveStateApInit
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
#ifdef WIFI_WMM
VOID
ODM_IotEdcaSwitch(
@ -1680,7 +1680,7 @@ ODM_ChooseIotMainSTA(
);
#endif
#if(DM_ODM_SUPPORT_TYPE==ODM_AP)
#if (DM_ODM_SUPPORT_TYPE==ODM_AP)
#ifdef HW_ANT_SWITCH
u1Byte
ODM_Diversity_AntennaSelect(
@ -1710,7 +1710,7 @@ VOID ODM_SwAntDivChkPerPktRssi(
IN PODM_PHY_INFO_T pPhyInfo
);
#if((DM_ODM_SUPPORT_TYPE==ODM_MP)||(DM_ODM_SUPPORT_TYPE==ODM_CE))
#if ((DM_ODM_SUPPORT_TYPE==ODM_MP)||(DM_ODM_SUPPORT_TYPE==ODM_CE))
u4Byte ConvertTo_dB(u4Byte Value);
@ -1737,7 +1737,7 @@ u4Byte ODM_Get_Rate_Bitmap(
#endif
#if(DM_ODM_SUPPORT_TYPE & (ODM_MP))
#if (DM_ODM_SUPPORT_TYPE & (ODM_MP))
#define dm_PSDMonitorCallback odm_PSDMonitorCallback
VOID odm_PSDMonitorCallback(PRT_TIMER pTimer);
@ -1962,7 +1962,7 @@ ODM_AntselStatistics_88C(
IN BOOLEAN isCCKrate
);
#if( DM_ODM_SUPPORT_TYPE & (ODM_MP |ODM_CE))
#if ( DM_ODM_SUPPORT_TYPE & (ODM_MP |ODM_CE))
VOID
ODM_SingleDualAntennaDefaultSetting(
@ -1975,7 +1975,7 @@ ODM_SingleDualAntennaDetection(
IN u1Byte mode
);
#endif // #if((DM_ODM_SUPPORT_TYPE==ODM_MP)||(DM_ODM_SUPPORT_TYPE==ODM_CE))
#endif // #if ((DM_ODM_SUPPORT_TYPE==ODM_MP)||(DM_ODM_SUPPORT_TYPE==ODM_CE))
#if (DM_ODM_SUPPORT_TYPE == ODM_CE)
void odm_dtc(PDM_ODM_T pDM_Odm);

View file

@ -112,31 +112,31 @@
#if DBG
#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) \
if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel)) \
if (((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel)) \
{ \
if(pDM_Odm->SupportICType == ODM_RTL8192C) \
if (pDM_Odm->SupportICType == ODM_RTL8192C) \
DbgPrint("[ODM-92C] "); \
else if(pDM_Odm->SupportICType == ODM_RTL8192D) \
else if (pDM_Odm->SupportICType == ODM_RTL8192D) \
DbgPrint("[ODM-92D] "); \
else if(pDM_Odm->SupportICType == ODM_RTL8723A) \
else if (pDM_Odm->SupportICType == ODM_RTL8723A) \
DbgPrint("[ODM-8723A] "); \
else if(pDM_Odm->SupportICType == ODM_RTL8188E) \
else if (pDM_Odm->SupportICType == ODM_RTL8188E) \
DbgPrint("[ODM-8188E] "); \
else if(pDM_Odm->SupportICType == ODM_RTL8812) \
else if (pDM_Odm->SupportICType == ODM_RTL8812) \
DbgPrint("[ODM-8812] "); \
else if(pDM_Odm->SupportICType == ODM_RTL8821) \
else if (pDM_Odm->SupportICType == ODM_RTL8821) \
DbgPrint("[ODM-8821] "); \
RT_PRINTK fmt; \
}
#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt) \
if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel)) \
if (((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel)) \
{ \
RT_PRINTK fmt; \
}
#define ODM_RT_ASSERT(pDM_Odm, expr, fmt) \
if(!(expr)) { \
if (!(expr)) { \
DbgPrint( "Assertion failed! %s at ......\n", #expr); \
DbgPrint( " ......%s,%s,line=%d\n",__FILE__,__FUNCTION__,__LINE__); \
RT_PRINTK fmt; \
@ -147,14 +147,14 @@
#define ODM_dbg_trace(str) { DbgPrint("%s:%s\n", __FUNCTION__, str); }
#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr) \
if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel)) \
if (((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel)) \
{ \
int __i; \
pu1Byte __ptr = (pu1Byte)ptr; \
DbgPrint("[ODM] "); \
DbgPrint(title_str); \
DbgPrint(" "); \
for( __i=0; __i<6; __i++ ) \
for ( __i=0; __i<6; __i++ ) \
DbgPrint("%02X%s", __ptr[__i], (__i==5)?"":"-"); \
DbgPrint("\n"); \
}
@ -201,13 +201,13 @@ ODM_InitDebugSetting(
// RT_PRINT_XXX macros: implemented for debugging purpose.
// Added by Annie, 2005-11-21.
#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen) \
if(((_Comp) & ODM_GlobalDebugComponents) && (_Level <= ODM_GlobalDebugLevel)) \
if (((_Comp) & ODM_GlobalDebugComponents) && (_Level <= ODM_GlobalDebugLevel)) \
{ \
int __i; \
pu1Byte ptr = (pu1Byte)_HexData; \
DbgPrint("Rtl819x: "); \
DbgPrint(_TitleString); \
for( __i=0; __i<(int)_HexDataLen; __i++ ) \
for ( __i=0; __i<(int)_HexDataLen; __i++ ) \
{ \
DbgPrint("%02X%s", ptr[__i], (((__i + 1) % 4) == 0)?" ":" "); \
if (((__i + 1) % 16) == 0) DbgPrint("\n"); \
@ -216,29 +216,29 @@ ODM_InitDebugSetting(
}
#define RT_PRINT_ADDR(_Comp, _Level, _TitleString, _Ptr) \
if(((_Comp) & ODM_GlobalDebugComponents) && (_Level <= ODM_GlobalDebugLevel)) \
if (((_Comp) & ODM_GlobalDebugComponents) && (_Level <= ODM_GlobalDebugLevel)) \
{ \
int __i; \
pu1Byte ptr = (pu1Byte)_Ptr; \
DbgPrint("Rtl819x: "); \
DbgPrint(_TitleString); \
DbgPrint(" "); \
for( __i=0; __i<6; __i++ ) \
for ( __i=0; __i<6; __i++ ) \
DbgPrint("%02X%s", ptr[__i], (__i==5)?"":"-"); \
DbgPrint("\n"); \
}
#define RT_PRINT_ADDRS(_Comp, _Level, _TitleString, _Ptr, _AddNum) \
if(((_Comp) & ODM_GlobalDebugComponents) && (_Level <= ODM_GlobalDebugLevel)) \
if (((_Comp) & ODM_GlobalDebugComponents) && (_Level <= ODM_GlobalDebugLevel)) \
{ \
int __i, __j; \
pu1Byte ptr = (pu1Byte)_Ptr; \
DbgPrint("Rtl819x: "); \
DbgPrint(_TitleString); \
DbgPrint("\n"); \
for( __i=0; __i<(int)_AddNum; __i++ ) \
for ( __i=0; __i<(int)_AddNum; __i++ ) \
{ \
for( __j=0; __j<6; __j++ ) \
for ( __j=0; __j<6; __j++ ) \
DbgPrint("%02X%s", ptr[__i*6+__j], (__j==5)?"":"-"); \
DbgPrint("\n"); \
} \
@ -249,16 +249,16 @@ ODM_InitDebugSetting(
#define PRINTABLE(_ch) (_ch>=' ' &&_ch<='~' ) // I want to see ASCII 33 to 126 only. Otherwise, I print '?'. Annie, 2005-11-22.
#define RT_PRINT_STR(_Comp, _Level, _TitleString, _Ptr, _Len) \
if(((_Comp) & ODM_GlobalDebugComponents) && (_Level <= ODM_GlobalDebugLevel)) \
if (((_Comp) & ODM_GlobalDebugComponents) && (_Level <= ODM_GlobalDebugLevel)) \
{ \
int __i; \
u1Byte buffer[MAX_STR_LEN]; \
int length = (_Len<MAX_STR_LEN)? _Len : (MAX_STR_LEN-1) ; \
PlatformZeroMemory( buffer, MAX_STR_LEN ); \
PlatformMoveMemory( buffer, (pu1Byte)_Ptr, length ); \
for( __i=0; __i<MAX_STR_LEN; __i++ ) \
for ( __i=0; __i<MAX_STR_LEN; __i++ ) \
{ \
if( !PRINTABLE(buffer[__i]) ) buffer[__i] = '?'; \
if ( !PRINTABLE(buffer[__i]) ) buffer[__i] = '?'; \
} \
buffer[length] = '\0'; \
DbgPrint("Rtl819x: "); \
@ -673,19 +673,19 @@ typedef enum tag_DBGP_Flag_Type_Definition
#if DBG
#define ODM_RT_TRACE(pDM_Odm,comp, level, fmt) \
if(((comp) & GlobalDebugComponents) && (level <= GlobalDebugLevel)) \
if (((comp) & GlobalDebugComponents) && (level <= GlobalDebugLevel)) \
{ \
RT_PRINTK fmt; \
}
#define RT_TRACE_F(comp, level, fmt) \
if(((comp) & GlobalDebugComponents) && (level <= GlobalDebugLevel)) \
if (((comp) & GlobalDebugComponents) && (level <= GlobalDebugLevel)) \
{ \
RT_PRINTK fmt; \
}
#define RT_ASSERT(expr,fmt) \
if(!(expr)) { \
if (!(expr)) { \
printk( "Assertion failed! %s at ......\n", #expr); \
printk( " ......%s,%s,line=%d\n",__FILE__,__FUNCTION__,__LINE__); \
}
@ -725,13 +725,13 @@ typedef enum tag_DBGP_Flag_Type_Definition
// RT_PRINT_XXX macros: implemented for debugging purpose.
// Added by Annie, 2005-11-21.
#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen) \
if(((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
if (((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
{ \
int __i; \
pu1Byte ptr = (pu1Byte)_HexData; \
DbgPrint("Rtl819x: "); \
DbgPrint(_TitleString); \
for( __i=0; __i<(int)_HexDataLen; __i++ ) \
for ( __i=0; __i<(int)_HexDataLen; __i++ ) \
{ \
DbgPrint("%02X%s", ptr[__i], (((__i + 1) % 4) == 0)?" ":" "); \
if (((__i + 1) % 16) == 0) DbgPrint("\n"); \
@ -740,29 +740,29 @@ typedef enum tag_DBGP_Flag_Type_Definition
}
#define RT_PRINT_ADDR(_Comp, _Level, _TitleString, _Ptr) \
if(((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
if (((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
{ \
int __i; \
pu1Byte ptr = (pu1Byte)_Ptr; \
DbgPrint("Rtl819x: "); \
DbgPrint(_TitleString); \
DbgPrint(" "); \
for( __i=0; __i<6; __i++ ) \
for ( __i=0; __i<6; __i++ ) \
DbgPrint("%02X%s", ptr[__i], (__i==5)?"":"-"); \
DbgPrint("\n"); \
}
#define RT_PRINT_ADDRS(_Comp, _Level, _TitleString, _Ptr, _AddNum) \
if(((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
if (((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
{ \
int __i, __j; \
pu1Byte ptr = (pu1Byte)_Ptr; \
DbgPrint("Rtl819x: "); \
DbgPrint(_TitleString); \
DbgPrint("\n"); \
for( __i=0; __i<(int)_AddNum; __i++ ) \
for ( __i=0; __i<(int)_AddNum; __i++ ) \
{ \
for( __j=0; __j<6; __j++ ) \
for ( __j=0; __j<6; __j++ ) \
DbgPrint("%02X%s", ptr[__i*6+__j], (__j==5)?"":"-"); \
DbgPrint("\n"); \
} \
@ -773,16 +773,16 @@ typedef enum tag_DBGP_Flag_Type_Definition
#define PRINTABLE(_ch) (_ch>=' ' &&_ch<='~' ) // I want to see ASCII 33 to 126 only. Otherwise, I print '?'. Annie, 2005-11-22.
#define RT_PRINT_STR(_Comp, _Level, _TitleString, _Ptr, _Len) \
if(((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
if (((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
{ \
int __i; \
u1Byte buffer[MAX_STR_LEN]; \
int length = (_Len<MAX_STR_LEN)? _Len : (MAX_STR_LEN-1) ; \
PlatformZeroMemory( buffer, MAX_STR_LEN ); \
PlatformMoveMemory( buffer, (pu1Byte)_Ptr, length ); \
for( __i=0; __i<MAX_STR_LEN; __i++ ) \
for ( __i=0; __i<MAX_STR_LEN; __i++ ) \
{ \
if( !PRINTABLE(buffer[__i]) ) buffer[__i] = '?'; \
if ( !PRINTABLE(buffer[__i]) ) buffer[__i] = '?'; \
} \
buffer[length] = '\0'; \
DbgPrint("Rtl819x: "); \
@ -825,7 +825,7 @@ typedef enum tag_DBGP_Flag_Type_Definition
pu1Byte ptr = (pu1Byte)_Ptr; \
DbgPrint printstr; \
DbgPrint(" "); \
for( __i=0; __i<6; __i++ ) \
for ( __i=0; __i<6; __i++ ) \
DbgPrint("%02X%s", ptr[__i], (__i==5)?"":"-"); \
DbgPrint("\n"); \
}\
@ -838,7 +838,7 @@ typedef enum tag_DBGP_Flag_Type_Definition
int __i; \
pu1Byte ptr = (pu1Byte)_HexData; \
DbgPrint(_TitleString); \
for( __i=0; __i<(int)_HexDataLen; __i++ ) \
for ( __i=0; __i<(int)_HexDataLen; __i++ ) \
{ \
DbgPrint("%02X%s", ptr[__i], (((__i + 1) % 4) == 0)?" ":" ");\
if (((__i + 1) % 16) == 0) DbgPrint("\n");\

View file

@ -55,7 +55,7 @@ typedef enum _HAL_STATUS{
typedef enum _RT_SPINLOCK_TYPE{
RT_TEMP =1,
}RT_SPINLOCK_TYPE;
#elif( (DM_ODM_SUPPORT_TYPE == ODM_AP) ||(DM_ODM_SUPPORT_TYPE == ODM_ADSL))
#elif ( (DM_ODM_SUPPORT_TYPE == ODM_AP) ||(DM_ODM_SUPPORT_TYPE == ODM_ADSL))
#define VISTA_USB_RX_REVISE 0

View file

@ -387,7 +387,7 @@ static inline unsigned char *skb_put(struct sk_buff *skb, unsigned int len)
static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len)
{
skb->len -= len;
if(skb->len < skb->data_len)
if (skb->len < skb->data_len)
printf("%s(),%d,error!\n",__FUNCTION__,__LINE__);
return skb->data += len;
}
@ -560,7 +560,7 @@ int rtw_usb_setup_endpoint(struct usb_device *dev,
struct urb *rtw_usb_alloc_urb(uint16_t iso_packets, uint16_t mem_flags);
struct usb_host_endpoint *rtw_usb_find_host_endpoint(struct usb_device *dev, uint8_t type, uint8_t ep);
struct usb_host_interface *rtw_usb_altnum_to_altsetting(const struct usb_interface *intf, uint8_t alt_index);
struct usb_interface *rtw_usb_ifnum_to_if(struct usb_device *dev, uint8_t iface_no);
struct usb_interface *rtw_usb_ifnum_to_if (struct usb_device *dev, uint8_t iface_no);
void *rtw_usb_buffer_alloc(struct usb_device *dev, usb_size_t size, uint8_t *dma_addr);
void *rtw_usbd_get_intfdata(struct usb_interface *intf);
void rtw_usb_linux_register(void *arg);
@ -699,7 +699,7 @@ __inline static void _init_timer(_timer *ptimer,_nic_hdl padapter,void *pfunc,vo
__inline static void _set_timer(_timer *ptimer,u32 delay_time)
{
// mod_timer(ptimer , (jiffies+(delay_time*HZ/1000)));
if(ptimer->function && ptimer->arg){
if (ptimer->function && ptimer->arg){
rtw_mtx_lock(NULL);
callout_reset(&ptimer->callout, delay_time,ptimer->function, ptimer->arg);
rtw_mtx_unlock(NULL);
@ -1315,7 +1315,7 @@ extern void dbg_rtw_mfree(u8 *pbuf, u32 sz, const char *func, int line);
#define rtw_zmalloc(sz) dbg_rtw_zmalloc((sz), __FUNCTION__, __LINE__)
#define rtw_mfree(pbuf, sz) dbg_rtw_mfree((pbuf), (sz), __FUNCTION__, __LINE__)
#else
#define rtw_update_mem_stat(flag, sz) do {} while(0)
#define rtw_update_mem_stat(flag, sz) do {} while (0)
extern u8* _rtw_vmalloc(u32 sz);
extern u8* _rtw_zvmalloc(u32 sz);
extern void _rtw_vmfree(u8 *pbuf, u32 sz);

View file

@ -300,8 +300,8 @@ void UpdateEarlyModeInfo8188E(struct xmit_priv *pxmitpriv,struct xmit_buf *pxmit
void dump_txrpt_ccx_88e(void *buf);
void handle_txrpt_ccx_88e(_adapter *adapter, u8 *buf);
#else
#define dump_txrpt_ccx_88e(buf) do {} while(0)
#define handle_txrpt_ccx_88e(adapter, buf) do {} while(0)
#define dump_txrpt_ccx_88e(buf) do {} while (0)
#define handle_txrpt_ccx_88e(adapter, buf) do {} while (0)
#endif //CONFIG_XMIT_ACK
void _dbg_dump_tx_info(_adapter *padapter,int frame_tag,struct tx_desc *ptxdesc);

View file

@ -114,8 +114,8 @@ struct txrpt_ccx_8192c {
void dump_txrpt_ccx_8192c(void *buf);
void handle_txrpt_ccx_8192c(_adapter *adapter, void *buf);
#else
#define dump_txrpt_ccx_8192c(buf) do {} while(0)
#define handle_txrpt_ccx_8192c(adapter, buf) do {} while(0)
#define dump_txrpt_ccx_8192c(buf) do {} while (0)
#define handle_txrpt_ccx_8192c(adapter, buf) do {} while (0)
#endif
#ifdef CONFIG_USB_HCI

View file

@ -129,8 +129,8 @@ struct txrpt_ccx_8192d {
void dump_txrpt_ccx_8192d(void *buf);
void handle_txrpt_ccx_8192d(_adapter *adapter, void *buf);
#else
#define dump_txrpt_ccx_8192d(buf) do {} while(0)
#define handle_txrpt_ccx_8192d(adapter, buf) do {} while(0)
#define dump_txrpt_ccx_8192d(buf) do {} while (0)
#define handle_txrpt_ccx_8192d(adapter, buf) do {} while (0)
#endif
#ifdef CONFIG_USB_HCI

View file

@ -142,7 +142,7 @@ typedef struct _CHNL_TXPOWER_TRIPLE
// ===== Below this line is sync from SD7 driver COMMON/bt_hci.h =====
#define BT_THREAD 0
#if(BT_THREAD == 1)
#if (BT_THREAD == 1)
#define SENDTXMEHTOD 2
#else
#define SENDTXMEHTOD 1 // 0=workitem, 1= SendDirectily, 2=thread
@ -1150,14 +1150,14 @@ typedef struct _BT30Info
BT_TRAFFIC BtTraffic;
BT_SECURITY BtSec;
#if(BT_THREAD == 0)
#if (BT_THREAD == 0)
RT_WORK_ITEM HCICmdWorkItem;
RT_TIMER BTHCICmdTimer;
#endif
#if (SENDTXMEHTOD==0)
RT_WORK_ITEM HCISendACLDataWorkItem;
RT_TIMER BTHCISendAclDataTimer;
#elif(SENDTXMEHTOD==2)
#elif (SENDTXMEHTOD==2)
RT_THREAD BTTxThread;
#endif
RT_WORK_ITEM BTPsDisableWorkItem;

View file

@ -211,8 +211,8 @@ struct txrpt_ccx_8723a {
void dump_txrpt_ccx_8723a(void *buf);
void handle_txrpt_ccx_8723a(_adapter *adapter, void *buf);
#else
#define dump_txrpt_ccx_8723a(buf) do {} while(0)
#define handle_txrpt_ccx_8723a(adapter, buf) do {} while(0)
#define dump_txrpt_ccx_8723a(buf) do {} while (0)
#define handle_txrpt_ccx_8723a(adapter, buf) do {} while (0)
#endif //CONFIG_XMIT_ACK
void rtl8723a_update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem);

View file

@ -54,7 +54,7 @@ void sta_info_update(_adapter *padapter, struct sta_info *psta);
void ap_sta_info_defer_update(_adapter *padapter, struct sta_info *psta);
u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reason);
int rtw_sta_flush(_adapter *padapter);
int rtw_ap_inform_ch_switch(_adapter *padapter, u8 new_ch, u8 ch_offset);
int rtw_ap_inform_ch_switch (_adapter *padapter, u8 new_ch, u8 ch_offset);
void start_ap_mode(_adapter *padapter);
void stop_ap_mode(_adapter *padapter);
#endif

View file

@ -26,7 +26,7 @@
#include <rtw_mp.h>
#if(MP_DRIVER == 1)
#if (MP_DRIVER == 1)
#pragma pack(1)
@ -295,7 +295,7 @@ typedef enum _BT_CTRL_OPCODE_LOWER{
#endif /* #if(MP_DRIVER == 1) */
#endif /* #if (MP_DRIVER == 1) */
#endif // #ifndef __INC_MPT_BT_H

View file

@ -127,7 +127,7 @@ do {\
pcmd->cmdsz = sizeof (*pparm);\
pcmd->rsp = NULL;\
pcmd->rspsz = 0;\
} while(0)
} while (0)
struct c2h_evt_hdr {
u8 id:4;

View file

@ -155,21 +155,21 @@
extern void rtl871x_cedbg(const char *fmt, ...);
#endif
#define RT_TRACE(_Comp, _Level, Fmt) do{}while(0)
#define _func_enter_ do{}while(0)
#define _func_exit_ do{}while(0)
#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen) do{}while(0)
#define RT_TRACE(_Comp, _Level, Fmt) do{}while (0)
#define _func_enter_ do{}while (0)
#define _func_exit_ do{}while (0)
#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen) do{}while (0)
#ifdef PLATFORM_WINDOWS
#define DBG_871X do {} while(0)
#define MSG_8192C do {} while(0)
#define DBG_8192C do {} while(0)
#define DBG_871X_LEVEL do {} while(0)
#define DBG_871X do {} while (0)
#define MSG_8192C do {} while (0)
#define DBG_8192C do {} while (0)
#define DBG_871X_LEVEL do {} while (0)
#else
#define DBG_871X(x, ...) do {} while(0)
#define MSG_8192C(x, ...) do {} while(0)
#define DBG_8192C(x,...) do {} while(0)
#define DBG_871X_LEVEL(x,...) do {} while(0)
#define DBG_871X(x, ...) do {} while (0)
#define MSG_8192C(x, ...) do {} while (0)
#define DBG_8192C(x,...) do {} while (0)
#define DBG_871X_LEVEL(x,...) do {} while (0)
#endif
#undef _dbgdump
@ -199,7 +199,7 @@ extern void rtl871x_cedbg(const char *fmt, ...);
else \
_dbgdump(DRIVER_PREFIX fmt, ##arg);\
}\
}while(0)
}while (0)
#endif
#ifdef CONFIG_DEBUG
@ -207,17 +207,17 @@ extern void rtl871x_cedbg(const char *fmt, ...);
#undef DBG_871X
#define DBG_871X(...) do {\
_dbgdump(DRIVER_PREFIX __VA_ARGS__);\
}while(0)
}while (0)
#undef MSG_8192C
#define MSG_8192C(...) do {\
_dbgdump(DRIVER_PREFIX __VA_ARGS__);\
}while(0)
}while (0)
#undef DBG_8192C
#define DBG_8192C(...) do {\
_dbgdump(DRIVER_PREFIX __VA_ARGS__);\
}while(0)
}while (0)
#endif
#endif /* CONFIG_DEBUG */
@ -232,11 +232,11 @@ extern void rtl871x_cedbg(const char *fmt, ...);
#undef RT_TRACE
#define RT_TRACE(_Comp, _Level, Fmt)\
do {\
if((_Comp & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) {\
if ((_Comp & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) {\
_dbgdump("%s [0x%08x,%d]", DRIVER_PREFIX, (unsigned int)_Comp, _Level);\
_dbgdump Fmt;\
}\
}while(0)
}while (0)
#endif
@ -250,7 +250,7 @@ extern void rtl871x_cedbg(const char *fmt, ...);
{ \
_dbgdump("\n %s : %s enters at %d\n", DRIVER_PREFIX, __FUNCTION__, __LINE__);\
} \
} while(0)
} while (0)
#undef _func_exit_
#define _func_exit_ \
@ -259,17 +259,17 @@ extern void rtl871x_cedbg(const char *fmt, ...);
{ \
_dbgdump("\n %s : %s exits at %d\n", DRIVER_PREFIX, __FUNCTION__, __LINE__); \
} \
} while(0)
} while (0)
#undef RT_PRINT_DATA
#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen) \
if(((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
if (((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
{ \
int __i; \
u8 *ptr = (u8 *)_HexData; \
_dbgdump("%s", DRIVER_PREFIX); \
_dbgdump(_TitleString); \
for( __i=0; __i<(int)_HexDataLen; __i++ ) \
for ( __i=0; __i<(int)_HexDataLen; __i++ ) \
{ \
_dbgdump("%02X%s", ptr[__i], (((__i + 1) % 4) == 0)?" ":" "); \
if (((__i + 1) % 16) == 0) _dbgdump("\n"); \

View file

@ -65,7 +65,7 @@
#define OID_MP_SEG4 0xFF011100
#define DEBUG_OID(dbg, str) \
if((!dbg)) \
if ((!dbg)) \
{ \
RT_TRACE(_module_rtl871x_ioctl_c_,_drv_info_,("%s(%d): %s", __FUNCTION__, __LINE__, str)); \
}

View file

@ -206,9 +206,9 @@ struct led_priv{
#ifdef CONFIG_SW_LED
#define rtw_led_control(adapter, LedAction) \
do { \
if((adapter)->ledpriv.LedControlHandler) \
if ((adapter)->ledpriv.LedControlHandler) \
(adapter)->ledpriv.LedControlHandler((adapter), (LedAction)); \
} while(0)
} while (0)
#else //CONFIG_SW_LED
#define rtw_led_control(adapter, LedAction)
#endif //CONFIG_SW_LED

View file

@ -651,7 +651,7 @@ __inline static void set_fwstate(struct mlme_priv *pmlmepriv, sint state)
{
pmlmepriv->fw_state |= state;
//FOR HW integration
if(_FW_UNDER_SURVEY==state){
if (_FW_UNDER_SURVEY==state){
pmlmepriv->bScanInProcess = _TRUE;
}
}
@ -660,7 +660,7 @@ __inline static void _clr_fwstate_(struct mlme_priv *pmlmepriv, sint state)
{
pmlmepriv->fw_state &= ~state;
//FOR HW integration
if(_FW_UNDER_SURVEY==state){
if (_FW_UNDER_SURVEY==state){
pmlmepriv->bScanInProcess = _FALSE;
}
}

View file

@ -692,7 +692,7 @@ int issue_nulldata(_adapter *padapter, unsigned char *da, unsigned int power_mod
int issue_qos_nulldata(_adapter *padapter, unsigned char *da, u16 tid, int try_cnt, int wait_ms);
int issue_deauth(_adapter *padapter, unsigned char *da, unsigned short reason);
int issue_deauth_ex(_adapter *padapter, u8 *da, unsigned short reason, int try_cnt, int wait_ms);
void issue_action_spct_ch_switch(_adapter *padapter, u8 *ra, u8 new_ch, u8 ch_offset);
void issue_action_spct_ch_switch (_adapter *padapter, u8 *ra, u8 new_ch, u8 ch_offset);
void issue_action_BA(_adapter *padapter, unsigned char *raddr, unsigned char action, unsigned short status);
unsigned int send_delba(_adapter *padapter, u8 initiator, u8 *addr);
unsigned int send_beacon(_adapter *padapter);
@ -741,13 +741,13 @@ void addba_timer_hdl(struct sta_info *psta);
do { \
/*DBG_871X("%s set_survey_timer(%p, %d)\n", __FUNCTION__, (mlmeext), (ms));*/ \
_set_timer(&(mlmeext)->survey_timer, (ms)); \
} while(0)
} while (0)
#define set_link_timer(mlmeext, ms) \
do { \
/*DBG_871X("%s set_link_timer(%p, %d)\n", __FUNCTION__, (mlmeext), (ms));*/ \
_set_timer(&(mlmeext)->link_timer, (ms)); \
} while(0)
} while (0)
extern int cckrates_included(unsigned char *rate, int ratelen);
extern int cckratesonly_included(unsigned char *rate, int ratelen);

View file

@ -76,21 +76,21 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role);
static inline void _rtw_p2p_set_state(struct wifidirect_info *wdinfo, enum P2P_STATE state)
{
if(wdinfo->p2p_state != state) {
if (wdinfo->p2p_state != state) {
//wdinfo->pre_p2p_state = wdinfo->p2p_state;
wdinfo->p2p_state = state;
}
}
static inline void _rtw_p2p_set_pre_state(struct wifidirect_info *wdinfo, enum P2P_STATE state)
{
if(wdinfo->pre_p2p_state != state) {
if (wdinfo->pre_p2p_state != state) {
wdinfo->pre_p2p_state = state;
}
}
#if 0
static inline void _rtw_p2p_restore_state(struct wifidirect_info *wdinfo)
{
if(wdinfo->pre_p2p_state != -1) {
if (wdinfo->pre_p2p_state != -1) {
wdinfo->p2p_state = wdinfo->pre_p2p_state;
wdinfo->pre_p2p_state = -1;
}
@ -98,7 +98,7 @@ static inline void _rtw_p2p_restore_state(struct wifidirect_info *wdinfo)
#endif
static inline void _rtw_p2p_set_role(struct wifidirect_info *wdinfo, enum P2P_ROLE role)
{
if(wdinfo->role != role) {
if (wdinfo->role != role) {
wdinfo->role = role;
}
}

View file

@ -307,7 +307,7 @@ struct pwrctrl_priv
do { \
/*DBG_871X("%s _rtw_set_pwr_state_check_timer(%p, %d)\n", __FUNCTION__, (pwrctrlpriv), (ms));*/ \
_set_timer(&(pwrctrlpriv)->pwr_state_check_timer, (ms)); \
} while(0)
} while (0)
#define rtw_set_pwr_state_check_timer(pwrctrlpriv) \
_rtw_set_pwr_state_check_timer((pwrctrlpriv), (pwrctrlpriv)->pwr_state_check_interval)

View file

@ -516,7 +516,7 @@ void rtw_reordering_ctrl_timeout_handler(void *pcontext);
__inline static u8 *get_rxmem(union recv_frame *precvframe)
{
//always return rx_head...
if(precvframe==NULL)
if (precvframe==NULL)
return NULL;
return precvframe->u.hdr.rx_head;
@ -533,7 +533,7 @@ __inline static u8 *get_recvframe_data(union recv_frame *precvframe)
{
//alwasy return rx_data
if(precvframe==NULL)
if (precvframe==NULL)
return NULL;
return precvframe->u.hdr.rx_data;
@ -550,12 +550,12 @@ __inline static u8 *recvframe_push(union recv_frame *precvframe, sint sz)
* start. rx_data must be still larger than rx_head, after pushing.
*/
if(precvframe==NULL)
if (precvframe==NULL)
return NULL;
precvframe->u.hdr.rx_data -= sz ;
if( precvframe->u.hdr.rx_data < precvframe->u.hdr.rx_head )
if ( precvframe->u.hdr.rx_data < precvframe->u.hdr.rx_head )
{
precvframe->u.hdr.rx_data += sz ;
return NULL;
@ -575,13 +575,13 @@ __inline static u8 *recvframe_pull(union recv_frame *precvframe, sint sz)
//used for extract sz bytes from rx_data, update rx_data and return the updated rx_data to the caller
if(precvframe==NULL)
if (precvframe==NULL)
return NULL;
precvframe->u.hdr.rx_data += sz;
if(precvframe->u.hdr.rx_data > precvframe->u.hdr.rx_tail)
if (precvframe->u.hdr.rx_data > precvframe->u.hdr.rx_tail)
{
precvframe->u.hdr.rx_data -= sz;
return NULL;
@ -601,14 +601,14 @@ __inline static u8 *recvframe_put(union recv_frame *precvframe, sint sz)
//after putting, rx_tail must be still larger than rx_end.
unsigned char * prev_rx_tail;
if(precvframe==NULL)
if (precvframe==NULL)
return NULL;
prev_rx_tail = precvframe->u.hdr.rx_tail;
precvframe->u.hdr.rx_tail += sz;
if(precvframe->u.hdr.rx_tail > precvframe->u.hdr.rx_end)
if (precvframe->u.hdr.rx_tail > precvframe->u.hdr.rx_end)
{
precvframe->u.hdr.rx_tail -= sz;
return NULL;
@ -629,12 +629,12 @@ __inline static u8 *recvframe_pull_tail(union recv_frame *precvframe, sint sz)
//used for extract sz bytes from rx_end, update rx_end and return the updated rx_end to the caller
//after pulling, rx_end must be still larger than rx_data.
if(precvframe==NULL)
if (precvframe==NULL)
return NULL;
precvframe->u.hdr.rx_tail -= sz;
if(precvframe->u.hdr.rx_tail < precvframe->u.hdr.rx_data)
if (precvframe->u.hdr.rx_tail < precvframe->u.hdr.rx_data)
{
precvframe->u.hdr.rx_tail += sz;
return NULL;
@ -652,7 +652,7 @@ __inline static _buffer * get_rxbuf_desc(union recv_frame *precvframe)
{
_buffer * buf_desc;
if(precvframe==NULL)
if (precvframe==NULL)
return NULL;
#ifdef PLATFORM_WINDOWS
NdisQueryPacket(precvframe->u.hdr.pkt, NULL, NULL, &buf_desc, NULL);

View file

@ -204,7 +204,7 @@ struct sha256_state {
#define GET_ENCRY_ALGO(psecuritypriv, psta, encry_algo, bmcst)\
do{\
switch(psecuritypriv->dot11AuthAlgrthm)\
switch (psecuritypriv->dot11AuthAlgrthm)\
{\
case dot11AuthAlgrthm_Open:\
case dot11AuthAlgrthm_Shared:\
@ -212,7 +212,7 @@ do{\
encry_algo = (u8)psecuritypriv->dot11PrivacyAlgrthm;\
break;\
case dot11AuthAlgrthm_8021X:\
if(bmcst)\
if (bmcst)\
encry_algo = (u8)psecuritypriv->dot118021XGrpPrivacy;\
else\
encry_algo =(u8) psta->dot118021XPrivacy;\
@ -221,12 +221,12 @@ do{\
encry_algo = (u8)psecuritypriv->dot11PrivacyAlgrthm;\
break;\
}\
}while(0)
}while (0)
#define SET_ICE_IV_LEN( iv_len, icv_len, encrypt)\
do{\
switch(encrypt)\
switch (encrypt)\
{\
case _WEP40_:\
case _WEP104_:\
@ -250,7 +250,7 @@ do{\
icv_len = 0;\
break;\
}\
}while(0)
}while (0)
#define GET_TKIP_PN(iv,dot11txpn)\
@ -261,7 +261,7 @@ do{\
dot11txpn._byte_.TSC3=iv[5];\
dot11txpn._byte_.TSC4=iv[6];\
dot11txpn._byte_.TSC5=iv[7];\
}while(0)
}while (0)
#define ROL32( A, n ) ( ((A) << (n)) | ( ((A)>>(32-(n))) & ( (1UL << (n)) - 1 ) ) )

View file

@ -26,25 +26,25 @@ static inline void dump_buf(u8 *buf, u32 len)
{
u32 i;
printk("-----------------Len %d----------------\n", len);
for(i=0; i<len; i++)
for (i=0; i<len; i++)
printk("%2.2x-", *(buf+i));
printk("\n");
}
#define WAPI_TRACE(component, x, args...) \
do { if(wapi_debug_component & (component)) \
do { if (wapi_debug_component & (component)) \
printk(KERN_DEBUG "WAPI" ":" x "" , \
##args);\
}while(0);
}while (0);
#define WAPI_DATA(component, x, buf, len) \
do { if(wapi_debug_component & (component)){ \
do { if (wapi_debug_component & (component)){ \
printk("%s:\n", x);\
dump_buf((buf), (len));}\
}while(0);
}while (0);
#define RT_ASSERT_RET(_Exp) \
if(!(_Exp)) \
if (!(_Exp)) \
{ \
printk("RTWLAN: "); \
printk( "Assertion failed! %s,%s,line=%d\n", \
@ -52,7 +52,7 @@ do { if(wapi_debug_component & (component)){ \
return; \
}
#define RT_ASSERT_RET_VALUE(_Exp,Ret) \
if(!(_Exp)) \
if (!(_Exp)) \
{ \
printk("RTWLAN: "); \
printk( "Assertion failed! %s,%s,line=%d\n", \
@ -61,10 +61,10 @@ do { if(wapi_debug_component & (component)){ \
}
#else
#define RT_ASSERT_RET(_Exp) do {} while(0)
#define RT_ASSERT_RET_VALUE(_Exp,Ret) do {} while(0)
#define WAPI_TRACE(component, x, args...) do {} while(0)
#define WAPI_DATA(component, x, buf, len) do {} while(0)
#define RT_ASSERT_RET(_Exp) do {} while (0)
#define RT_ASSERT_RET_VALUE(_Exp,Ret) do {} while (0)
#define WAPI_TRACE(component, x, args...) do {} while (0)
#define WAPI_DATA(component, x, buf, len) do {} while (0)
#endif

View file

@ -108,7 +108,7 @@ do{\
pattrib_iv[2] = dot11txpn._byte_.TSC2;\
pattrib_iv[3] = ((keyidx & 0x3)<<6);\
dot11txpn.val = (dot11txpn.val == 0xffffff) ? 0: (dot11txpn.val+1);\
}while(0)
}while (0)
#define TKIP_IV(pattrib_iv, dot11txpn, keyidx)\
@ -122,7 +122,7 @@ do{\
pattrib_iv[6] = dot11txpn._byte_.TSC4;\
pattrib_iv[7] = dot11txpn._byte_.TSC5;\
dot11txpn.val = dot11txpn.val == 0xffffffffffffULL ? 0: (dot11txpn.val+1);\
}while(0)
}while (0)
#define AES_IV(pattrib_iv, dot11txpn, keyidx)\
do{\
@ -135,7 +135,7 @@ do{\
pattrib_iv[6] = dot11txpn._byte_.TSC4;\
pattrib_iv[7] = dot11txpn._byte_.TSC5;\
dot11txpn.val = dot11txpn.val == 0xffffffffffffULL ? 0: (dot11txpn.val+1);\
}while(0)
}while (0)
#define HWXMIT_ENTRY 4

View file

@ -356,7 +356,7 @@ struct sta_info {
sta->sta_stats.last_rx_probersp_uo_pkts = sta->sta_stats.rx_probersp_uo_pkts; \
sta->sta_stats.last_rx_ctrl_pkts = sta->sta_stats.rx_ctrl_pkts; \
sta->sta_stats.last_rx_data_pkts = sta->sta_stats.rx_data_pkts; \
} while(0)
} while (0)
#define STA_RX_PKTS_ARG(sta) \
sta->sta_stats.rx_mgnt_pkts \

View file

@ -112,7 +112,7 @@ static inline int rtw_inc_and_chk_continual_urb_error(struct dvobj_priv *dvobj)
{
int ret = _FALSE;
int value;
if( (value=ATOMIC_INC_RETURN(&dvobj->continual_urb_error)) > MAX_CONTINUAL_URB_ERR) {
if ( (value=ATOMIC_INC_RETURN(&dvobj->continual_urb_error)) > MAX_CONTINUAL_URB_ERR) {
DBG_871X("[dvobj:%p][ERROR] continual_urb_error:%d > %d\n", dvobj, value, MAX_CONTINUAL_URB_ERR);
ret = _TRUE;
} else {

View file

@ -255,26 +255,26 @@ enum WIFI_REG_DOMAIN {
#define SetToDs(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_TO_DS_); \
} while(0)
} while (0)
#define GetToDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_TO_DS_)) != 0)
#define ClearToDs(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_TO_DS_)); \
} while(0)
} while (0)
#define SetFrDs(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_FROM_DS_); \
} while(0)
} while (0)
#define GetFrDs(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_FROM_DS_)) != 0)
#define ClearFrDs(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_FROM_DS_)); \
} while(0)
} while (0)
#define get_tofr_ds(pframe) ((GetToDs(pframe) << 1) | GetFrDs(pframe))
@ -282,62 +282,62 @@ enum WIFI_REG_DOMAIN {
#define SetMFrag(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_MORE_FRAG_); \
} while(0)
} while (0)
#define GetMFrag(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_MORE_FRAG_)) != 0)
#define ClearMFrag(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_MORE_FRAG_)); \
} while(0)
} while (0)
#define SetRetry(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_RETRY_); \
} while(0)
} while (0)
#define GetRetry(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_RETRY_)) != 0)
#define ClearRetry(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_RETRY_)); \
} while(0)
} while (0)
#define SetPwrMgt(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_PWRMGT_); \
} while(0)
} while (0)
#define GetPwrMgt(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_PWRMGT_)) != 0)
#define ClearPwrMgt(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_PWRMGT_)); \
} while(0)
} while (0)
#define SetMData(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_MORE_DATA_); \
} while(0)
} while (0)
#define GetMData(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_MORE_DATA_)) != 0)
#define ClearMData(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_MORE_DATA_)); \
} while(0)
} while (0)
#define SetPrivacy(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_PRIVACY_); \
} while(0)
} while (0)
#define GetPrivacy(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_PRIVACY_)) != 0)
#define ClearPrivacy(pbuf) \
do { \
*(unsigned short *)(pbuf) &= (~cpu_to_le16(_PRIVACY_)); \
} while(0)
} while (0)
#define GetOrder(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_ORDER_)) != 0)
@ -348,7 +348,7 @@ enum WIFI_REG_DOMAIN {
do { \
*(unsigned short *)(pbuf) &= __constant_cpu_to_le16(~(BIT(3) | BIT(2))); \
*(unsigned short *)(pbuf) |= __constant_cpu_to_le16(type); \
} while(0)
} while (0)
#define GetFrameSubType(pbuf) (cpu_to_le16(*(unsigned short *)(pbuf)) & (BIT(7) | BIT(6) | BIT(5) | BIT(4) | BIT(3) | BIT(2)))
@ -356,7 +356,7 @@ enum WIFI_REG_DOMAIN {
do { \
*(unsigned short *)(pbuf) &= cpu_to_le16(~(BIT(7) | BIT(6) | BIT(5) | BIT(4) | BIT(3) | BIT(2))); \
*(unsigned short *)(pbuf) |= cpu_to_le16(type); \
} while(0)
} while (0)
#define GetSequence(pbuf) (cpu_to_le16(*(unsigned short *)((SIZE_PTR)(pbuf) + 22)) >> 4)
@ -369,37 +369,37 @@ enum WIFI_REG_DOMAIN {
*(unsigned short *)((SIZE_PTR)(pbuf) + 22) = \
((*(unsigned short *)((SIZE_PTR)(pbuf) + 22)) & le16_to_cpu(~(0x000f))) | \
cpu_to_le16(0x0f & (num)); \
} while(0)
} while (0)
#define SetSeqNum(pbuf, num) \
do { \
*(unsigned short *)((SIZE_PTR)(pbuf) + 22) = \
((*(unsigned short *)((SIZE_PTR)(pbuf) + 22)) & le16_to_cpu((unsigned short)~0xfff0)) | \
le16_to_cpu((unsigned short)(0xfff0 & (num << 4))); \
} while(0)
} while (0)
#define SetDuration(pbuf, dur) \
do { \
*(unsigned short *)((SIZE_PTR)(pbuf) + 2) = cpu_to_le16(0xffff & (dur)); \
} while(0)
} while (0)
#define SetPriority(pbuf, tid) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(tid & 0xf); \
} while(0)
} while (0)
#define GetPriority(pbuf) ((le16_to_cpu(*(unsigned short *)(pbuf))) & 0xf)
#define SetEOSP(pbuf, eosp) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16( (eosp & 1) << 4); \
} while(0)
} while (0)
#define SetAckpolicy(pbuf, ack) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16( (ack & 3) << 5); \
} while(0)
} while (0)
#define GetAckpolicy(pbuf) (((le16_to_cpu(*(unsigned short *)pbuf)) >> 5) & 0x3)
@ -408,7 +408,7 @@ enum WIFI_REG_DOMAIN {
#define SetAMsdu(pbuf, amsdu) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16( (amsdu & 1) << 7); \
} while(0)
} while (0)
#define GetAid(pbuf) (cpu_to_le16(*(unsigned short *)((SIZE_PTR)(pbuf) + 2)) & 0x3fff)
@ -514,7 +514,7 @@ __inline static unsigned char * get_hdr_bssid(unsigned char *pframe)
__inline static int IsFrameTypeCtrl(unsigned char *pframe)
{
if(WIFI_CTRL_TYPE == GetFrameType(pframe))
if (WIFI_CTRL_TYPE == GetFrameType(pframe))
return _TRUE;
else
return _FALSE;
@ -647,7 +647,7 @@ __inline static int IsFrameTypeCtrl(unsigned char *pframe)
#define SetOrderBit(pbuf) \
do { \
*(unsigned short *)(pbuf) |= cpu_to_le16(_ORDER_); \
} while(0)
} while (0)
#define GetOrderBit(pbuf) (((*(unsigned short *)(pbuf)) & le16_to_cpu(_ORDER_)) != 0)

View file

@ -544,8 +544,8 @@ static void rtw_gspi_if1_deinit(PADAPTER if1)
#endif
#endif
if(if1->DriverState != DRIVER_DISAPPEAR) {
if(pnetdev) {
if (if1->DriverState != DRIVER_DISAPPEAR) {
if (pnetdev) {
unregister_netdev(pnetdev); //will call netdev_close()
rtw_proc_remove_one(pnetdev);
}
@ -565,7 +565,7 @@ static void rtw_gspi_if1_deinit(PADAPTER if1)
rtw_free_drv_sw(if1);
if(pnetdev)
if (pnetdev)
rtw_free_netdev(pnetdev);
}
@ -605,7 +605,7 @@ static int /*__devinit*/ rtw_drv_probe(struct spi_device *spi)
goto free_if2;
#ifdef CONFIG_GLOBAL_UI_PID
if(ui_pid[1]!=0) {
if (ui_pid[1]!=0) {
DBG_871X("ui_pid[1]:%d\n",ui_pid[1]);
rtw_signal_process(ui_pid[1], SIGUSR2);
}
@ -693,7 +693,7 @@ static int rtw_gspi_suspend(struct spi_device *spi, pm_message_t mesg)
while (pwrpriv->bips_processing == _TRUE)
rtw_msleep_os(1);
if((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved))
if ((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved))
{
DBG_871X("%s bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n", __FUNCTION__
,padapter->bup, padapter->bDriverStopped,padapter->bSurpriseRemoved);
@ -705,7 +705,7 @@ static int rtw_gspi_suspend(struct spi_device *spi, pm_message_t mesg)
//padapter->net_closed = _TRUE;
//s1.
if(pnetdev)
if (pnetdev)
{
netif_carrier_off(pnetdev);
rtw_netif_stop_queue(pnetdev);
@ -718,7 +718,7 @@ static int rtw_gspi_suspend(struct spi_device *spi, pm_message_t mesg)
#endif
#ifdef CONFIG_LAYER2_ROAMING_RESUME
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED) )
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED) )
{
DBG_871X("%s %s(" MAC_FMT "), length:%d assoc_ssid.length:%d\n",__FUNCTION__,
pmlmepriv->cur_network.network.Ssid.Ssid,
@ -742,10 +742,10 @@ static int rtw_gspi_suspend(struct spi_device *spi, pm_message_t mesg)
rtw_dev_unload(padapter);
if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
rtw_indicate_scan_done(padapter, 1);
if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
rtw_indicate_disconnect(padapter);
// interface deinit
@ -817,7 +817,7 @@ int rtw_resume_process(_adapter *padapter)
pwrpriv->bkeepfwalive = _FALSE;
DBG_871X("bkeepfwalive(%x)\n",pwrpriv->bkeepfwalive);
if(pm_netdev_open(pnetdev,_TRUE) != 0) {
if (pm_netdev_open(pnetdev,_TRUE) != 0) {
ret = -1;
goto exit;
}
@ -825,7 +825,7 @@ int rtw_resume_process(_adapter *padapter)
netif_device_attach(pnetdev);
netif_carrier_on(pnetdev);
if( padapter->pid[1]!=0) {
if ( padapter->pid[1]!=0) {
DBG_871X("pid[1]:%d\n",padapter->pid[1]);
rtw_signal_process(padapter->pid[1], SIGUSR2);
}
@ -858,13 +858,13 @@ static int rtw_gspi_resume(struct spi_device *spi)
DBG_871X("==> %s (%s:%d)\n",__FUNCTION__, current->comm, current->pid);
if(pwrpriv->bInternalAutoSuspend ){
if (pwrpriv->bInternalAutoSuspend ){
ret = rtw_resume_process(padapter);
} else {
#ifdef CONFIG_RESUME_IN_WORKQUEUE
rtw_resume_in_workqueue(pwrpriv);
#elif defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER)
if(rtw_is_earlysuspend_registered(pwrpriv)) {
if (rtw_is_earlysuspend_registered(pwrpriv)) {
//jeff: bypass resume here, do in late_resume
pwrpriv->do_late_resume = _TRUE;
} else {

View file

@ -137,7 +137,7 @@ int spi_read_write_reg(PADAPTER pAdapter, int write_flag, u32 addr, char * buf,
{
int remainder = addr % 4;
u32 val32 = *(u32 *)buf;
switch(len) {
switch (len) {
case 1:
byte_en = (0x1 << remainder);
data_tmp = (val32& 0xff)<< (remainder*8);
@ -158,7 +158,7 @@ int spi_read_write_reg(PADAPTER pAdapter, int write_flag, u32 addr, char * buf,
}
else //read register
{
switch(len) {
switch (len) {
case 1:
byte_en = 0x1;
break;
@ -380,7 +380,7 @@ _func_enter_;
spi_get_status_info(Adapter, status);
more_data = GET_STATUS_HISR_LOW8BIT(status) & BIT(0);
//if(more_data) {
//if (more_data) {
// rtw_queue_delayed_work(Adapter->recv_wq, &Adapter->recv_work, 0, (void*)Adapter);
//}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -152,7 +152,7 @@ _func_enter_;
rtw_indicate_wx_assoc_event(adapter);
netif_carrier_on(adapter->pnetdev);
if(adapter->pid[2] !=0)
if (adapter->pid[2] !=0)
rtw_signal_process(adapter->pid[2], SIGALRM);
#ifdef RTK_DMP_PLATFORM
@ -179,7 +179,7 @@ void rtw_reset_securitypriv( _adapter *adapter )
u8 backupTKIPCountermeasure = 0x00;
u32 backupTKIPcountermeasure_time = 0;
if(adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)//802.1x
if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)//802.1x
{
// Added by Albert 2009/02/18
// We have to backup the PMK information for WiFi PMK Caching test item.
@ -210,7 +210,7 @@ void rtw_reset_securitypriv( _adapter *adapter )
}
else //reset values in securitypriv
{
//if(adapter->mlmepriv.fw_state & WIFI_STATION_STATE)
//if (adapter->mlmepriv.fw_state & WIFI_STATION_STATE)
//{
struct security_priv *psec_priv=&adapter->securitypriv;
@ -261,7 +261,7 @@ _func_enter_;
RT_TRACE(_module_mlme_osdep_c_,_drv_info_,("+rtw_report_sec_ie, authmode=%d\n", authmode));
buff = NULL;
if(authmode==_WPA_IE_ID_)
if (authmode==_WPA_IE_ID_)
{
RT_TRACE(_module_mlme_osdep_c_,_drv_info_,("rtw_report_sec_ie, authmode=%d\n", authmode));
@ -276,7 +276,7 @@ _func_enter_;
len = sec_ie[1]+2;
len = (len < IW_CUSTOM_MAX) ? len:IW_CUSTOM_MAX;
for(i=0;i<len;i++){
for (i=0;i<len;i++){
p+=sprintf(p,"%02x",sec_ie[i]);
}
@ -292,7 +292,7 @@ _func_enter_;
wireless_send_event(adapter->pnetdev,IWEVCUSTOM,&wrqu,buff);
#endif
if(buff)
if (buff)
rtw_mfree(buff, IW_CUSTOM_MAX);
}
@ -359,13 +359,13 @@ void rtw_indicate_sta_assoc_event(_adapter *padapter, struct sta_info *psta)
union iwreq_data wrqu;
struct sta_priv *pstapriv = &padapter->stapriv;
if(psta==NULL)
if (psta==NULL)
return;
if(psta->aid > NUM_STA)
if (psta->aid > NUM_STA)
return;
if(pstapriv->sta_aid[psta->aid - 1] != psta)
if (pstapriv->sta_aid[psta->aid - 1] != psta)
return;
@ -386,13 +386,13 @@ void rtw_indicate_sta_disassoc_event(_adapter *padapter, struct sta_info *psta)
union iwreq_data wrqu;
struct sta_priv *pstapriv = &padapter->stapriv;
if(psta==NULL)
if (psta==NULL)
return;
if(psta->aid > NUM_STA)
if (psta->aid > NUM_STA)
return;
if(pstapriv->sta_aid[psta->aid - 1] != psta)
if (pstapriv->sta_aid[psta->aid - 1] != psta)
return;
@ -430,7 +430,7 @@ static int mgnt_netdev_open(struct net_device *pnetdev)
init_usb_anchor(&phostapdpriv->anchored);
if(!rtw_netif_queue_stopped(pnetdev))
if (!rtw_netif_queue_stopped(pnetdev))
rtw_netif_start_queue(pnetdev);
else
rtw_netif_wake_queue(pnetdev);
@ -525,7 +525,7 @@ int hostapd_mode_init(_adapter *padapter)
if(dev_alloc_name(pnetdev,"mgnt.wlan%d") < 0)
if (dev_alloc_name(pnetdev,"mgnt.wlan%d") < 0)
{
DBG_871X("hostapd_mode_init(): dev_alloc_name, fail! \n");
}
@ -552,7 +552,7 @@ int hostapd_mode_init(_adapter *padapter)
{
DBG_871X("hostapd_mode_init(): register_netdev fail!\n");
if(pnetdev)
if (pnetdev)
{
rtw_free_netdev(pnetdev);
}

View file

@ -319,21 +319,21 @@ void rtw_proc_init_one(struct net_device *dev)
_adapter *padapter = rtw_netdev_priv(dev);
u8 rf_type;
if(rtw_proc == NULL)
if (rtw_proc == NULL)
{
if(padapter->chip_type == RTL8188C_8192C)
if (padapter->chip_type == RTL8188C_8192C)
{
_rtw_memcpy(rtw_proc_name, RTL8192C_PROC_NAME, sizeof(RTL8192C_PROC_NAME));
}
else if(padapter->chip_type == RTL8192D)
else if (padapter->chip_type == RTL8192D)
{
_rtw_memcpy(rtw_proc_name, RTL8192D_PROC_NAME, sizeof(RTL8192D_PROC_NAME));
}
else if(padapter->chip_type == RTL8723A)
else if (padapter->chip_type == RTL8723A)
{
_rtw_memcpy(rtw_proc_name, RTW_PROC_NAME, sizeof(RTW_PROC_NAME));
}
else if(padapter->chip_type == RTL8188E)
else if (padapter->chip_type == RTL8188E)
{
_rtw_memcpy(rtw_proc_name, RTW_PROC_NAME, sizeof(RTW_PROC_NAME));
}
@ -342,7 +342,7 @@ void rtw_proc_init_one(struct net_device *dev)
_rtw_memcpy(rtw_proc_name, RTW_PROC_NAME, sizeof(RTW_PROC_NAME));
}
#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
rtw_proc=create_proc_entry(rtw_proc_name, S_IFDIR, proc_net);
#else
rtw_proc=create_proc_entry(rtw_proc_name, S_IFDIR, init_net.proc_net);
@ -361,7 +361,7 @@ void rtw_proc_init_one(struct net_device *dev)
if(padapter->dir_dev == NULL)
if (padapter->dir_dev == NULL)
{
padapter->dir_dev = create_proc_entry(dev->name,
S_IFDIR | S_IRUGO | S_IXUGO,
@ -369,12 +369,12 @@ void rtw_proc_init_one(struct net_device *dev)
dir_dev = padapter->dir_dev;
if(dir_dev==NULL)
if (dir_dev==NULL)
{
if(rtw_proc_cnt == 0)
if (rtw_proc_cnt == 0)
{
if(rtw_proc){
#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
if (rtw_proc){
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
remove_proc_entry(rtw_proc_name, proc_net);
#else
remove_proc_entry(rtw_proc_name, init_net.proc_net);
@ -534,7 +534,7 @@ void rtw_proc_init_one(struct net_device *dev)
}
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
if((RF_1T2R == rf_type) ||(RF_1T1R ==rf_type )) {
if ((RF_1T2R == rf_type) ||(RF_1T1R ==rf_type )) {
entry = create_proc_read_entry("rf_reg_dump3", S_IFREG | S_IRUGO,
dir_dev, proc_get_rf_reg_dump3, dev);
if (!entry) {
@ -673,7 +673,7 @@ void rtw_proc_remove_one(struct net_device *dev)
remove_proc_entry("rf_reg_dump1", dir_dev);
remove_proc_entry("rf_reg_dump2", dir_dev);
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
if((RF_1T2R == rf_type) ||(RF_1T1R ==rf_type )) {
if ((RF_1T2R == rf_type) ||(RF_1T1R ==rf_type )) {
remove_proc_entry("rf_reg_dump3", dir_dev);
remove_proc_entry("rf_reg_dump4", dir_dev);
}
@ -717,12 +717,12 @@ void rtw_proc_remove_one(struct net_device *dev)
rtw_proc_cnt--;
if(rtw_proc_cnt == 0)
if (rtw_proc_cnt == 0)
{
if(rtw_proc){
if (rtw_proc){
remove_proc_entry("ver_info", rtw_proc);
#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
remove_proc_entry(rtw_proc_name, proc_net);
#else
remove_proc_entry(rtw_proc_name, init_net.proc_net);
@ -867,7 +867,7 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *p)
_adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev);
struct sockaddr *addr = p;
if(padapter->bup == _FALSE)
if (padapter->bup == _FALSE)
{
//DBG_871X("r8711_net_set_mac_address(), MAC=%x:%x:%x:%x:%x:%x\n", addr->sa_data[0], addr->sa_data[1], addr->sa_data[2], addr->sa_data[3],
//addr->sa_data[4], addr->sa_data[5]);
@ -937,7 +937,7 @@ static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb)
skb->priority = rtw_classify8021d(skb);
if(pmlmepriv->acm_mask != 0)
if (pmlmepriv->acm_mask != 0)
{
skb->priority = qos_acm(pmlmepriv->acm_mask, skb->priority);
}
@ -998,7 +998,7 @@ int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
_adapter *TargetAdapter = NULL;
struct net *devnet = NULL;
if(padapter->bDongle == 1)
if (padapter->bDongle == 1)
{
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24))
TargetNetdev = dev_get_by_name("wlan0");
@ -1010,7 +1010,7 @@ int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
#endif
TargetNetdev = dev_get_by_name(devnet, "wlan0");
#endif
if(TargetNetdev) {
if (TargetNetdev) {
DBG_871X("Force onboard module driver disappear !!!\n");
TargetAdapter = rtw_netdev_priv(TargetNetdev);
TargetAdapter->DriverState = DRIVER_DISAPPEAR;
@ -1022,7 +1022,7 @@ int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
dev_put(TargetNetdev);
unregister_netdev(TargetNetdev);
if(TargetAdapter->chip_type == padapter->chip_type)
if (TargetAdapter->chip_type == padapter->chip_type)
rtw_proc_remove_one(TargetNetdev);
padapter->DriverState = DRIVER_REPLACE_DONGLE;
@ -1030,7 +1030,7 @@ int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
}
#endif
if(dev_alloc_name(pnetdev, ifname) < 0)
if (dev_alloc_name(pnetdev, ifname) < 0)
{
RT_TRACE(_module_os_intfs_c_,_drv_err_,("dev_alloc_name, fail! \n"));
}
@ -1048,7 +1048,7 @@ struct net_device *rtw_init_netdev(_adapter *old_padapter)
RT_TRACE(_module_os_intfs_c_,_drv_info_,("+init_net_dev\n"));
if(old_padapter != NULL)
if (old_padapter != NULL)
pnetdev = rtw_alloc_etherdev_with_old_priv(sizeof(_adapter), (void *)old_padapter);
else
pnetdev = rtw_alloc_etherdev(sizeof(_adapter));
@ -1106,10 +1106,10 @@ u32 rtw_start_drv_threads(_adapter *padapter)
RT_TRACE(_module_os_intfs_c_,_drv_info_,("+rtw_start_drv_threads\n"));
#ifdef CONFIG_XMIT_THREAD_MODE
#if defined(CONFIG_SDIO_HCI) && defined(CONFIG_CONCURRENT_MODE)
if(padapter->adapter_type == PRIMARY_ADAPTER){
if (padapter->adapter_type == PRIMARY_ADAPTER){
#endif
padapter->xmitThread = kthread_run(rtw_xmit_thread, padapter, "RTW_XMIT_THREAD");
if(IS_ERR(padapter->xmitThread))
if (IS_ERR(padapter->xmitThread))
_status = _FAIL;
#if defined(CONFIG_SDIO_HCI) && defined(CONFIG_CONCURRENT_MODE)
}
@ -1118,17 +1118,17 @@ u32 rtw_start_drv_threads(_adapter *padapter)
#ifdef CONFIG_RECV_THREAD_MODE
padapter->recvThread = kthread_run(rtw_recv_thread, padapter, "RTW_RECV_THREAD");
if(IS_ERR(padapter->recvThread))
if (IS_ERR(padapter->recvThread))
_status = _FAIL;
#endif
#ifdef CONFIG_CONCURRENT_MODE
if(padapter->isprimary == _TRUE)
if (padapter->isprimary == _TRUE)
#endif //CONFIG_CONCURRENT_MODE
{
padapter->cmdThread = kthread_run(rtw_cmd_thread, padapter, "RTW_CMD_THREAD");
if(IS_ERR(padapter->cmdThread))
if (IS_ERR(padapter->cmdThread))
_status = _FAIL;
else
_rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema); //wait for cmd_thread to run
@ -1137,7 +1137,7 @@ u32 rtw_start_drv_threads(_adapter *padapter)
#ifdef CONFIG_EVENT_THREAD_MODE
padapter->evtThread = kthread_run(event_thread, padapter, "RTW_EVENT_THREAD");
if(IS_ERR(padapter->evtThread))
if (IS_ERR(padapter->evtThread))
_status = _FAIL;
#endif
@ -1151,20 +1151,20 @@ void rtw_stop_drv_threads (_adapter *padapter)
RT_TRACE(_module_os_intfs_c_,_drv_info_,("+rtw_stop_drv_threads\n"));
#ifdef CONFIG_CONCURRENT_MODE
if(padapter->isprimary == _TRUE)
if (padapter->isprimary == _TRUE)
#endif //CONFIG_CONCURRENT_MODE
{
//Below is to termindate rtw_cmd_thread & event_thread...
_rtw_up_sema(&padapter->cmdpriv.cmd_queue_sema);
//_rtw_up_sema(&padapter->cmdpriv.cmd_done_sema);
if(padapter->cmdThread){
if (padapter->cmdThread){
_rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema);
}
}
#ifdef CONFIG_EVENT_THREAD_MODE
_rtw_up_sema(&padapter->evtpriv.evt_notify);
if(padapter->evtThread){
if (padapter->evtThread){
_rtw_down_sema(&padapter->evtpriv.terminate_evtthread_sema);
}
#endif
@ -1173,7 +1173,7 @@ void rtw_stop_drv_threads (_adapter *padapter)
// Below is to termindate tx_thread...
#if defined(CONFIG_SDIO_HCI) && defined(CONFIG_CONCURRENT_MODE)
// Only wake-up primary adapter
if(padapter->adapter_type == PRIMARY_ADAPTER)
if (padapter->adapter_type == PRIMARY_ADAPTER)
#endif //SDIO_HCI + CONCURRENT
{
_rtw_up_sema(&padapter->xmitpriv.xmit_sema);
@ -1349,12 +1349,12 @@ _func_enter_;
rtw_init_cfg80211_wifidirect_info(padapter);
#endif
#ifdef CONFIG_WFD
if(rtw_init_wifi_display_info(padapter) == _FAIL)
if (rtw_init_wifi_display_info(padapter) == _FAIL)
RT_TRACE(_module_os_intfs_c_,_drv_err_,("\n Can't init init_wifi_display_info\n"));
#endif
#endif /* CONFIG_P2P */
if(init_mlme_ext_priv(padapter) == _FAIL)
if (init_mlme_ext_priv(padapter) == _FAIL)
{
RT_TRACE(_module_os_intfs_c_,_drv_err_,("\n Can't init mlme_ext_priv\n"));
ret8=_FAIL;
@ -1362,7 +1362,7 @@ _func_enter_;
}
#ifdef CONFIG_TDLS
if(rtw_init_tdls_info(padapter) == _FAIL)
if (rtw_init_tdls_info(padapter) == _FAIL)
{
DBG_871X("Can't rtw_init_tdls_info\n");
ret8=_FAIL;
@ -1370,14 +1370,14 @@ _func_enter_;
}
#endif //CONFIG_TDLS
if(_rtw_init_xmit_priv(&padapter->xmitpriv, padapter) == _FAIL)
if (_rtw_init_xmit_priv(&padapter->xmitpriv, padapter) == _FAIL)
{
DBG_871X("Can't _rtw_init_xmit_priv\n");
ret8=_FAIL;
goto exit;
}
if(_rtw_init_recv_priv(&padapter->recvpriv, padapter) == _FAIL)
if (_rtw_init_recv_priv(&padapter->recvpriv, padapter) == _FAIL)
{
DBG_871X("Can't _rtw_init_recv_priv\n");
ret8=_FAIL;
@ -1389,7 +1389,7 @@ _func_enter_;
//_init_timer(&(padapter->securitypriv.tkip_timer), padapter->pifp, rtw_use_tkipkey_handler, padapter);
if(_rtw_init_sta_priv(&padapter->stapriv) == _FAIL)
if (_rtw_init_sta_priv(&padapter->stapriv) == _FAIL)
{
DBG_871X("Can't _rtw_init_sta_priv\n");
ret8=_FAIL;
@ -1420,7 +1420,7 @@ _func_enter_;
#endif
#ifdef CONFIG_INTEL_WIDI
if(rtw_init_intel_widi(padapter) == _FAIL)
if (rtw_init_intel_widi(padapter) == _FAIL)
{
DBG_871X("Can't rtw_init_intel_widi\n");
ret8=_FAIL;
@ -1516,7 +1516,7 @@ u8 rtw_free_drv_sw(_adapter *padapter)
#ifdef CONFIG_P2P
{
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
{
_cancel_timer_ex( &pwdinfo->find_phase_timer );
_cancel_timer_ex( &pwdinfo->restore_p2p_state_timer );
@ -1574,13 +1574,13 @@ u8 rtw_free_drv_sw(_adapter *padapter)
RT_TRACE(_module_os_intfs_c_,_drv_info_,("<==rtw_free_drv_sw\n"));
//free the old_pnetdev
if(padapter->rereg_nd_name_priv.old_pnetdev) {
if (padapter->rereg_nd_name_priv.old_pnetdev) {
free_netdev(padapter->rereg_nd_name_priv.old_pnetdev);
padapter->rereg_nd_name_priv.old_pnetdev = NULL;
}
// clear pbuddy_adapter to avoid access wrong pointer.
if(padapter->pbuddy_adapter != NULL) {
if (padapter->pbuddy_adapter != NULL) {
padapter->pbuddy_adapter->pbuddy_adapter = NULL;
}
@ -1598,12 +1598,12 @@ int _netdev_if2_open(struct net_device *pnetdev)
DBG_871X("+871x_drv - if2_open, bup=%d\n", padapter->bup);
if(primary_padapter->bup == _FALSE || primary_padapter->hw_init_completed == _FALSE)
if (primary_padapter->bup == _FALSE || primary_padapter->hw_init_completed == _FALSE)
{
_netdev_open(primary_padapter->pnetdev);
}
if(padapter->bup == _FALSE && primary_padapter->bup == _TRUE &&
if (padapter->bup == _FALSE && primary_padapter->bup == _TRUE &&
primary_padapter->hw_init_completed == _TRUE)
{
int i;
@ -1621,13 +1621,13 @@ int _netdev_if2_open(struct net_device *pnetdev)
// goto netdev_if2_open_error;
if(rtw_start_drv_threads(padapter) == _FAIL)
if (rtw_start_drv_threads(padapter) == _FAIL)
{
goto netdev_if2_open_error;
}
if(padapter->intf_start)
if (padapter->intf_start)
{
padapter->intf_start(padapter);
}
@ -1652,7 +1652,7 @@ int _netdev_if2_open(struct net_device *pnetdev)
_set_timer(&padapter->mlmepriv.dynamic_chk_timer, 2000);
if(!rtw_netif_queue_stopped(pnetdev))
if (!rtw_netif_queue_stopped(pnetdev))
rtw_netif_start_queue(pnetdev);
else
rtw_netif_wake_queue(pnetdev);
@ -1688,7 +1688,7 @@ static int netdev_if2_close(struct net_device *pnetdev)
padapter->net_closed = _TRUE;
if(pnetdev)
if (pnetdev)
{
if (!rtw_netif_queue_stopped(pnetdev))
rtw_netif_stop_queue(pnetdev);
@ -1812,12 +1812,12 @@ _adapter *rtw_drv_if2_init(_adapter *primary_padapter, char *name,
//init drv data
if(rtw_init_drv_sw(padapter)!= _SUCCESS)
if (rtw_init_drv_sw(padapter)!= _SUCCESS)
goto error_rtw_drv_if2_init;
// alloc dev name after got efuse data.
if(name == NULL)
if (name == NULL)
name = padapter->registrypriv.if2name;
rtw_init_netdev_name(pnetdev, name);
@ -1854,7 +1854,7 @@ _adapter *rtw_drv_if2_init(_adapter *primary_padapter, char *name,
primary_padapter->pbuddy_adapter = padapter;
//prepare concurrent shared data buffer
if(!primary_padapter->pcodatapriv)
if (!primary_padapter->pcodatapriv)
{
struct co_data_priv *pcodatapriv;
@ -1907,7 +1907,7 @@ void rtw_drv_if2_free(_adapter *if2)
#endif /* CONFIG_IOCTL_CFG80211 */
/* free concurrent shared data buffer */
if(padapter->pcodatapriv) {
if (padapter->pcodatapriv) {
rtw_vmfree((u8*)padapter->pcodatapriv, sizeof(struct co_data_priv));
padapter->pcodatapriv = NULL;
}
@ -1942,7 +1942,7 @@ void rtw_drv_if2_stop(_adapter *if2)
rtw_ack_tx_done(&padapter->xmitpriv, RTW_SCTX_DONE_DRV_STOP);
#endif
if(padapter->intf_stop)
if (padapter->intf_stop)
{
padapter->intf_stop(padapter);
}
@ -1971,7 +1971,7 @@ void netdev_br_init(struct net_device *netdev)
rcu_read_lock();
#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 35))
//if(check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == _TRUE)
//if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == _TRUE)
{
//struct net_bridge *br = netdev->br_port->br;//->dev->dev_addr;
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
@ -2020,12 +2020,12 @@ int _netdev_open(struct net_device *pnetdev)
RT_TRACE(_module_os_intfs_c_,_drv_info_,("+871x_drv - dev_open\n"));
DBG_871X("+871x_drv - drv_open, bup=%d\n", padapter->bup);
if(pwrctrlpriv->ps_flag == _TRUE){
if (pwrctrlpriv->ps_flag == _TRUE){
padapter->net_closed = _FALSE;
goto netdev_open_normal_process;
}
if(padapter->bup == _FALSE)
if (padapter->bup == _FALSE)
{
padapter->bDriverStopped = _FALSE;
padapter->bSurpriseRemoved = _FALSE;
@ -2045,7 +2045,7 @@ int _netdev_open(struct net_device *pnetdev)
#endif //CONFIG_RF_GAIN_OFFSET
status=rtw_start_drv_threads(padapter);
if(status ==_FAIL)
if (status ==_FAIL)
{
DBG_871X("Initialize driver software resource Failed!\n");
goto netdev_open_error;
@ -2061,7 +2061,7 @@ int _netdev_open(struct net_device *pnetdev)
init_drvext(padapter);
#endif
if(padapter->intf_start)
if (padapter->intf_start)
{
padapter->intf_start(padapter);
}
@ -2086,7 +2086,7 @@ int _netdev_open(struct net_device *pnetdev)
rtw_set_pwr_state_check_timer(&padapter->pwrctrlpriv);
//netif_carrier_on(pnetdev);//call this func when rtw_joinbss_event_callback return success
if(!rtw_netif_queue_stopped(pnetdev))
if (!rtw_netif_queue_stopped(pnetdev))
rtw_netif_start_queue(pnetdev);
else
rtw_netif_wake_queue(pnetdev);
@ -2100,7 +2100,7 @@ netdev_open_normal_process:
#ifdef CONFIG_CONCURRENT_MODE
{
_adapter *sec_adapter = padapter->pbuddy_adapter;
if(sec_adapter && (sec_adapter->bup == _FALSE || sec_adapter->hw_init_completed == _FALSE))
if (sec_adapter && (sec_adapter->bup == _FALSE || sec_adapter->hw_init_completed == _FALSE))
_netdev_if2_open(sec_adapter->pnetdev);
}
#endif
@ -2156,7 +2156,7 @@ int ips_netdrv_open(_adapter *padapter)
goto netdev_open_error;
}
if(padapter->intf_start)
if (padapter->intf_start)
{
padapter->intf_start(padapter);
}
@ -2213,13 +2213,13 @@ void rtw_ips_dev_unload(_adapter *padapter)
rtw_hal_set_hwreg(padapter, HW_VAR_FIFO_CLEARN_UP, 0);
if(padapter->intf_stop)
if (padapter->intf_stop)
{
padapter->intf_stop(padapter);
}
//s5.
if(padapter->bSurpriseRemoved == _FALSE)
if (padapter->bSurpriseRemoved == _FALSE)
{
rtw_hal_deinit(padapter);
}
@ -2268,15 +2268,15 @@ static int netdev_close(struct net_device *pnetdev)
RT_TRACE(_module_os_intfs_c_,_drv_info_,("+871x_drv - drv_close\n"));
if(padapter->pwrctrlpriv.bInternalAutoSuspend == _TRUE)
if (padapter->pwrctrlpriv.bInternalAutoSuspend == _TRUE)
{
//rtw_pwr_wakeup(padapter);
if(padapter->pwrctrlpriv.rf_pwrstate == rf_off)
if (padapter->pwrctrlpriv.rf_pwrstate == rf_off)
padapter->pwrctrlpriv.ps_flag = _TRUE;
}
padapter->net_closed = _TRUE;
/* if(!padapter->hw_init_completed)
/* if (!padapter->hw_init_completed)
{
DBG_871X("(1)871x_drv - drv_close, bup=%d, hw_init_completed=%d\n", padapter->bup, padapter->hw_init_completed);
@ -2285,11 +2285,11 @@ static int netdev_close(struct net_device *pnetdev)
rtw_dev_unload(padapter);
}
else*/
if(padapter->pwrctrlpriv.rf_pwrstate == rf_on){
if (padapter->pwrctrlpriv.rf_pwrstate == rf_on){
DBG_871X("(2)871x_drv - drv_close, bup=%d, hw_init_completed=%d\n", padapter->bup, padapter->hw_init_completed);
//s1.
if(pnetdev)
if (pnetdev)
{
if (!rtw_netif_queue_stopped(pnetdev))
rtw_netif_stop_queue(pnetdev);
@ -2320,7 +2320,7 @@ static int netdev_close(struct net_device *pnetdev)
#ifdef CONFIG_P2P
#ifdef CONFIG_IOCTL_CFG80211
if(wdev_to_priv(padapter->rtw_wdev)->p2p_enabled == _TRUE)
if (wdev_to_priv(padapter->rtw_wdev)->p2p_enabled == _TRUE)
wdev_to_priv(padapter->rtw_wdev)->p2p_enabled = _FALSE;
#endif
rtw_p2p_enable(padapter, P2P_ROLE_DISABLE);

View file

@ -55,10 +55,10 @@ atomic_t _malloc_size = ATOMIC_INIT(0);
* @return: one of RTW_STATUS_CODE
*/
inline int RTW_STATUS_CODE(int error_code){
if(error_code >=0)
if (error_code >=0)
return _SUCCESS;
switch(error_code) {
switch (error_code) {
//case -ETIMEDOUT:
// return RTW_STATUS_TIMEDOUT;
default:
@ -76,17 +76,17 @@ u32 rtw_atoi(u8* s)
int num=0,flag=0;
int i;
for(i=0;i<=strlen(s);i++)
for (i=0;i<=strlen(s);i++)
{
if(s[i] >= '0' && s[i] <= '9')
if (s[i] >= '0' && s[i] <= '9')
num = num * 10 + s[i] -'0';
else if(s[0] == '-' && i==0)
else if (s[0] == '-' && i==0)
flag =1;
else
break;
}
if(flag == 1)
if (flag == 1)
num = num * -1;
return(num);
@ -166,7 +166,7 @@ u8* _rtw_malloc(u32 sz)
#ifdef PLATFORM_LINUX
#ifdef RTK_DMP_PLATFORM
if(sz > 0x4000)
if (sz > 0x4000)
pbuf = (u8 *)dvr_malloc(sz);
else
#endif
@ -224,7 +224,7 @@ void _rtw_mfree(u8 *pbuf, u32 sz)
#ifdef PLATFORM_LINUX
#ifdef RTK_DMP_PLATFORM
if(sz > 0x4000)
if (sz > 0x4000)
dvr_free(pbuf);
else
#endif
@ -306,7 +306,7 @@ void rtw_update_mem_stat(u8 flag, u32 sz)
static u32 update_time = 0;
int peak, alloc;
if(!update_time) {
if (!update_time) {
ATOMIC_SET(&rtw_dbg_mem_stat.vir_alloc,0);
ATOMIC_SET(&rtw_dbg_mem_stat.vir_peak,0);
ATOMIC_SET(&rtw_dbg_mem_stat.vir_alloc_err,0);
@ -315,7 +315,7 @@ void rtw_update_mem_stat(u8 flag, u32 sz)
ATOMIC_SET(&rtw_dbg_mem_stat.phy_alloc_err,0);
}
switch(flag) {
switch (flag) {
case MEM_STAT_VIR_ALLOC_SUCCESS:
alloc = ATOMIC_ADD_RETURN(&rtw_dbg_mem_stat.vir_alloc, sz);
peak=ATOMIC_READ(&rtw_dbg_mem_stat.vir_peak);
@ -434,7 +434,7 @@ inline u8* dbg_rtw_malloc(u32 sz, const char *func, int line)
{
u8 *p;
if((sz)>4096)
if ((sz)>4096)
DBG_871X("DBG_MEM_ALLOC !!!!!!!!!!!!!! %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
p=_rtw_malloc((sz));
@ -451,7 +451,7 @@ inline u8* dbg_rtw_zmalloc(u32 sz, const char *func, int line)
{
u8 *p;
if((sz)>4096)
if ((sz)>4096)
DBG_871X("DBG_MEM_ALLOC !!!!!!!!!!!!!! %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz));
p = _rtw_zmalloc((sz));
@ -467,7 +467,7 @@ inline u8* dbg_rtw_zmalloc(u32 sz, const char *func, int line)
inline void dbg_rtw_mfree(u8 *pbuf, u32 sz, const char *func, int line)
{
if((sz)>4096)
if ((sz)>4096)
DBG_871X("DBG_MEM_ALLOC !!!!!!!!!!!!!! %s:%d %s(%p,%d)\n", func, line, __FUNCTION__, (pbuf), (sz));
_rtw_mfree((pbuf), (sz));
@ -484,13 +484,13 @@ void* rtw_malloc2d(int h, int w, int size)
int j;
void **a = (void **) rtw_zmalloc( h*sizeof(void *) + h*w*size );
if(a == NULL)
if (a == NULL)
{
DBG_871X("%s: alloc memory fail!\n", __FUNCTION__);
return NULL;
}
for( j=0; j<h; j++ )
for ( j=0; j<h; j++ )
a[j] = ((char *)(a+h)) + j*w*size;
return a;
@ -583,10 +583,10 @@ struct sk_buff * dev_alloc_skb(unsigned int size)
//skb = (struct sk_buff *)_rtw_zmalloc(sizeof(struct sk_buff)); // for skb->len, etc.
skb = (struct sk_buff *)_rtw_malloc(sizeof(struct sk_buff));
if(!skb)
if (!skb)
goto out;
data = _rtw_malloc(size);
if(!data)
if (!data)
goto nodata;
skb->head = (unsigned char*)data;
@ -608,10 +608,10 @@ goto out;
void dev_kfree_skb_any(struct sk_buff *skb)
{
//printf("%s()-%d: skb->head = %p\n", __FUNCTION__, __LINE__, skb->head);
if(skb->head)
if (skb->head)
_rtw_mfree(skb->head, 0);
//printf("%s()-%d: skb = %p\n", __FUNCTION__, __LINE__, skb);
if(skb)
if (skb)
_rtw_mfree((u8 *)skb, 0);
}
struct sk_buff *skb_clone(const struct sk_buff *skb)
@ -745,7 +745,7 @@ void _rtw_init_sema(_sema *sema, int init_val)
#endif
#ifdef PLATFORM_OS_CE
if(*sema == NULL)
if (*sema == NULL)
*sema = CreateSemaphore(NULL, init_val, SEMA_UPBND, NULL);
#endif
@ -801,14 +801,14 @@ u32 _rtw_down_sema(_sema *sema)
#endif
#ifdef PLATFORM_OS_XP
if(STATUS_SUCCESS == KeWaitForSingleObject(sema, Executive, KernelMode, TRUE, NULL))
if (STATUS_SUCCESS == KeWaitForSingleObject(sema, Executive, KernelMode, TRUE, NULL))
return _SUCCESS;
else
return _FAIL;
#endif
#ifdef PLATFORM_OS_CE
if(WAIT_OBJECT_0 == WaitForSingleObject(*sema, INFINITE ))
if (WAIT_OBJECT_0 == WaitForSingleObject(*sema, INFINITE ))
return _SUCCESS;
else
return _FAIL;
@ -903,7 +903,7 @@ void _rtw_spinlock_free(_lock *plock)
extern PADAPTER prtw_lock;
void rtw_mtx_lock(_lock *plock){
if(prtw_lock){
if (prtw_lock){
mtx_lock(&prtw_lock->glock);
}
else{
@ -911,7 +911,7 @@ void rtw_mtx_lock(_lock *plock){
}
}
void rtw_mtx_unlock(_lock *plock){
if(prtw_lock){
if (prtw_lock){
mtx_unlock(&prtw_lock->glock);
}
else{
@ -1182,7 +1182,7 @@ void rtw_usleep_os(int us)
void _rtw_mdelay_os(int ms, const char *func, const int line)
{
#if 0
if(ms>10)
if (ms>10)
DBG_871X("%s:%d %s(%d)\n", func, line, __FUNCTION__, ms);
rtw_msleep_os(ms);
return;
@ -1207,7 +1207,7 @@ void _rtw_udelay_os(int us, const char *func, const int line)
{
#if 0
if(us > 1000) {
if (us > 1000) {
DBG_871X("%s:%d %s(%d)\n", func, line, __FUNCTION__, us);
rtw_usleep_os(us);
return;
@ -1478,7 +1478,7 @@ static int openFile(struct file **fpp, char *path, int flag, int mode)
struct file *fp;
fp=filp_open(path, flag, mode);
if(IS_ERR(fp)) {
if (IS_ERR(fp)) {
*fpp=NULL;
return PTR_ERR(fp);
}
@ -1506,11 +1506,11 @@ static int readFile(struct file *fp,char *buf,int len)
if (!fp->f_op || !fp->f_op->read)
return -EPERM;
while(sum<len) {
while (sum<len) {
rlen=fp->f_op->read(fp,buf+sum,len-sum, &fp->f_pos);
if(rlen>0)
if (rlen>0)
sum+=rlen;
else if(0 != rlen)
else if (0 != rlen)
return rlen;
else
break;
@ -1527,11 +1527,11 @@ static int writeFile(struct file *fp,char *buf,int len)
if (!fp->f_op || !fp->f_op->write)
return -EPERM;
while(sum<len) {
while (sum<len) {
wlen=fp->f_op->write(fp,buf+sum,len-sum, &fp->f_pos);
if(wlen>0)
if (wlen>0)
sum+=wlen;
else if(0 != wlen)
else if (0 != wlen)
return wlen;
else
break;
@ -1554,13 +1554,13 @@ static int isFileReadable(char *path)
char buf;
fp=filp_open(path, O_RDONLY, 0);
if(IS_ERR(fp)) {
if (IS_ERR(fp)) {
ret = PTR_ERR(fp);
}
else {
oldfs = get_fs(); set_fs(get_ds());
if(1!=readFile(fp, &buf, 1))
if (1!=readFile(fp, &buf, 1))
ret = PTR_ERR(fp);
set_fs(oldfs);
@ -1582,8 +1582,8 @@ static int retriveFromFile(char *path, u8* buf, u32 sz)
mm_segment_t oldfs;
struct file *fp;
if(path && buf) {
if( 0 == (ret=openFile(&fp,path, O_RDONLY, 0)) ){
if (path && buf) {
if ( 0 == (ret=openFile(&fp,path, O_RDONLY, 0)) ){
DBG_871X("%s openFile path:%s fp=%p\n",__FUNCTION__, path ,fp);
oldfs = get_fs(); set_fs(get_ds());
@ -1616,8 +1616,8 @@ static int storeToFile(char *path, u8* buf, u32 sz)
mm_segment_t oldfs;
struct file *fp;
if(path && buf) {
if( 0 == (ret=openFile(&fp, path, O_CREAT|O_WRONLY, 0666)) ) {
if (path && buf) {
if ( 0 == (ret=openFile(&fp, path, O_CREAT|O_WRONLY, 0666)) ) {
DBG_871X("%s openFile path:%s fp=%p\n",__FUNCTION__, path ,fp);
oldfs = get_fs(); set_fs(get_ds());
@ -1646,7 +1646,7 @@ static int storeToFile(char *path, u8* buf, u32 sz)
int rtw_is_file_readable(char *path)
{
#ifdef PLATFORM_LINUX
if(isFileReadable(path) == 0)
if (isFileReadable(path) == 0)
return _TRUE;
else
return _FALSE;
@ -1746,12 +1746,12 @@ void rtw_free_netdev(struct net_device * netdev)
{
struct rtw_netdev_priv_indicator *pnpi;
if(!netdev)
if (!netdev)
goto RETURN;
pnpi = netdev_priv(netdev);
if(!pnpi->priv)
if (!pnpi->priv)
goto RETURN;
rtw_vmfree(pnpi->priv, pnpi->sizeof_priv);
@ -1772,19 +1772,19 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname)
struct rereg_nd_name_data *rereg_priv;
int ret;
if(!padapter)
if (!padapter)
goto error;
rereg_priv = &padapter->rereg_nd_name_priv;
//free the old_pnetdev
if(rereg_priv->old_pnetdev) {
if (rereg_priv->old_pnetdev) {
free_netdev(rereg_priv->old_pnetdev);
rereg_priv->old_pnetdev = NULL;
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
if(!rtnl_is_locked())
if (!rtnl_is_locked())
unregister_netdev(cur_pnetdev);
else
#endif
@ -1807,7 +1807,7 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname)
_rtw_memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
if(!rtnl_is_locked())
if (!rtnl_is_locked())
ret = register_netdev(pnetdev);
else
#endif

View file

@ -131,7 +131,7 @@ static u8 rtw_pci_platform_switch_device_pci_aspm(_adapter *padapter, u8 value)
error = pci_write_config_byte(pdvobjpriv->ppcidev, 0x80, value);
if(error != 0)
if (error != 0)
{
bresult = _FALSE;
DBG_871X("rtw_pci_platform_switch_device_pci_aspm error (%d)\n",error);
@ -151,12 +151,12 @@ static u8 rtw_pci_switch_clk_req(_adapter *padapter, u8 value)
buffer = value;
if(!padapter->hw_init_completed)
if (!padapter->hw_init_completed)
return bresult;
error = pci_write_config_byte(pdvobjpriv->ppcidev, 0x81, value);
if(error != 0)
if (error != 0)
{
bresult = _FALSE;
DBG_871X("rtw_pci_switch_clk_req error (%d)\n",error);
@ -746,10 +746,10 @@ void rtw_pci_disable_aspm(_adapter *padapter)
// We do not diable/enable ASPM by driver, in the future, the BIOS will enable host and NIC ASPM.
// Advertised by SD1 victorh. Added by tynli. 2009.11.23.
if(pdvobjpriv->const_pci_aspm == 0)
if (pdvobjpriv->const_pci_aspm == 0)
return;
if(!padapter->hw_init_completed)
if (!padapter->hw_init_completed)
return;
if (pcipriv->pcibridge_vendor == PCI_BRIDGE_VENDOR_UNKNOWN) {
@ -781,7 +781,7 @@ void rtw_pci_disable_aspm(_adapter *padapter)
//When there exists anyone's BusNum, DevNum, and FuncNum that are set to 0xff,
// we do not execute any action and return. Added by tynli.
if( (pcipriv->busnumber == 0xff && pcipriv->devnumber == 0xff && pcipriv->funcnumber == 0xff) ||
if ( (pcipriv->busnumber == 0xff && pcipriv->devnumber == 0xff && pcipriv->funcnumber == 0xff) ||
(pcipriv->pcibridge_busnum == 0xff && pcipriv->pcibridge_devnum == 0xff && pcipriv->pcibridge_funcnum == 0xff) )
{
// Do Nothing!!
@ -821,12 +821,12 @@ void rtw_pci_enable_aspm(_adapter *padapter)
// We do not diable/enable ASPM by driver, in the future, the BIOS will enable host and NIC ASPM.
// Advertised by SD1 victorh. Added by tynli. 2009.11.23.
if(pdvobjpriv->const_pci_aspm == 0)
if (pdvobjpriv->const_pci_aspm == 0)
return;
//When there exists anyone's BusNum, DevNum, and FuncNum that are set to 0xff,
// we do not execute any action and return. Added by tynli.
if( (pcipriv->busnumber == 0xff && pcipriv->devnumber == 0xff && pcipriv->funcnumber == 0xff) ||
if ( (pcipriv->busnumber == 0xff && pcipriv->devnumber == 0xff && pcipriv->funcnumber == 0xff) ||
(pcipriv->pcibridge_busnum == 0xff && pcipriv->pcibridge_devnum == 0xff && pcipriv->pcibridge_funcnum == 0xff) )
{
DBG_871X("rtw_pci_enable_aspm(): Fail to enable ASPM. Cannot find the Bus of PCI(Bridge).\n");
@ -844,24 +844,24 @@ void rtw_pci_enable_aspm(_adapter *padapter)
//NdisRawReadPortUlong((ULONG_PTR)PCI_CONF_DATA,&uDeviceASPMSupportSetting);
pci_read_config_dword(bridge_pdev, (pcipriv->pcibridge_pciehdr_offset+0x0C), &u_device_aspmsupportsetting);
DBG_871X("rtw_pci_enable_aspm(): Bridge ASPM support %x \n",u_device_aspmsupportsetting);
if(((u_device_aspmsupportsetting & BIT(11)) != BIT(11)) || ((u_device_aspmsupportsetting & BIT(10)) != BIT(10)))
if (((u_device_aspmsupportsetting & BIT(11)) != BIT(11)) || ((u_device_aspmsupportsetting & BIT(10)) != BIT(10)))
{
if(pdvobjpriv->const_devicepci_aspm_setting == 3)
if (pdvobjpriv->const_devicepci_aspm_setting == 3)
{
DBG_871X("rtw_pci_enable_aspm(): Bridge not support L0S or L1\n");
return;
}
else if(pdvobjpriv->const_devicepci_aspm_setting == 2)
else if (pdvobjpriv->const_devicepci_aspm_setting == 2)
{
if((u_device_aspmsupportsetting & BIT(11)) != BIT(11))
if ((u_device_aspmsupportsetting & BIT(11)) != BIT(11))
{
DBG_871X("rtw_pci_enable_aspm(): Bridge not support L1 \n");
return;
}
}
else if(pdvobjpriv->const_devicepci_aspm_setting == 1)
else if (pdvobjpriv->const_devicepci_aspm_setting == 1)
{
if((u_device_aspmsupportsetting & BIT(10)) != BIT(10))
if ((u_device_aspmsupportsetting & BIT(10)) != BIT(10))
{
DBG_871X("rtw_pci_enable_aspm(): Bridge not support L0s \n");
return;
@ -1061,7 +1061,7 @@ static void rtw_pci_update_default_setting(_adapter *padapter)
pwrpriv->b_support_aspm = b_support_aspm;
/*if(pAdapter->MgntInfo.CustomerID == RT_CID_TOSHIBA &&
/*if (pAdapter->MgntInfo.CustomerID == RT_CID_TOSHIBA &&
pcipriv->pcibridge_vendor == PCI_BRIDGE_VENDOR_AMD &&
!pcipriv->amd_l1_patch)
b_support_backdoor = _FALSE;*/
@ -1111,7 +1111,7 @@ static irqreturn_t rtw_pci_interrupt(int irq, void *priv, struct pt_regs *regs)
return IRQ_HANDLED;
}
if(rtw_hal_interrupt_handler(adapter) == _FAIL)
if (rtw_hal_interrupt_handler(adapter) == _FAIL)
return IRQ_HANDLED;
//return IRQ_NONE;
@ -1225,7 +1225,7 @@ _func_enter_;
/*find bridge info*/
pcipriv->pcibridge_vendor = PCI_BRIDGE_VENDOR_UNKNOWN;
if(bridge_pdev){
if (bridge_pdev){
pcipriv->pcibridge_vendorid = bridge_pdev->vendor;
for (tmp = 0; tmp < PCI_BRIDGE_VENDOR_MAX; tmp++) {
if (bridge_pdev->vendor == pcibridge_vendors[tmp]) {
@ -1237,7 +1237,7 @@ _func_enter_;
}
//if (pcipriv->pcibridge_vendor != PCI_BRIDGE_VENDOR_UNKNOWN) {
if(bridge_pdev){
if (bridge_pdev){
pcipriv->pcibridge_busnum = bridge_pdev->bus->number;
pcipriv->pcibridge_devnum = PCI_SLOT(bridge_pdev->devfn);
pcipriv->pcibridge_funcnum = PCI_FUNC(bridge_pdev->devfn);
@ -1380,7 +1380,7 @@ static void decide_chip_type_by_pci_device_id(_adapter *padapter, struct pci_dev
//
// Decide hardware type here.
//
if( deviceid == HAL_HW_PCI_8185_DEVICE_ID ||
if ( deviceid == HAL_HW_PCI_8185_DEVICE_ID ||
deviceid == HAL_HW_PCI_8188_DEVICE_ID ||
deviceid == HAL_HW_PCI_8198_DEVICE_ID)
{
@ -1407,7 +1407,7 @@ static void decide_chip_type_by_pci_device_id(_adapter *padapter, struct pci_dev
// 8192e and and 8192se may have the same device ID 8192. However, their Revision
// ID is different
// Added for 92DE. We deferentiate it from SVID,SDID.
if( pdev->subsystem_vendor == 0x10EC && pdev->subsystem_device == 0xE020){
if ( pdev->subsystem_vendor == 0x10EC && pdev->subsystem_device == 0xE020){
padapter->HardwareType = HARDWARE_TYPE_RTL8192DE;
DBG_871X("Adapter(8192DE) is found - VendorID/DeviceID/RID=%X/%X/%X\n", venderid, deviceid, revisionid);
}else{
@ -1427,7 +1427,7 @@ static void decide_chip_type_by_pci_device_id(_adapter *padapter, struct pci_dev
}
}
}
else if(deviceid==HAL_HW_PCI_8723E_DEVICE_ID )
else if (deviceid==HAL_HW_PCI_8723E_DEVICE_ID )
{//RTL8723E may have the same device ID with RTL8192CET
padapter->HardwareType = HARDWARE_TYPE_RTL8723AE;
DBG_871X("Adapter(8723 PCI-E) is found - VendorID/DeviceID=%x/%x\n", venderid, deviceid);
@ -1493,7 +1493,7 @@ static void pci_intf_stop(_adapter *padapter)
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+pci_intf_stop\n"));
//Disable hw interrupt
if(padapter->bSurpriseRemoved == _FALSE)
if (padapter->bSurpriseRemoved == _FALSE)
{
//device still exists, so driver can do i/o operation
rtw_hal_disable_interrupt(padapter);
@ -1530,7 +1530,7 @@ static void rtw_dev_unload(_adapter *padapter)
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+rtw_dev_unload\n"));
if(padapter->bup == _TRUE)
if (padapter->bup == _TRUE)
{
DBG_871X("+rtw_dev_unload\n");
@ -1541,7 +1541,7 @@ static void rtw_dev_unload(_adapter *padapter)
#endif
//s3.
if(padapter->intf_stop)
if (padapter->intf_stop)
{
padapter->intf_stop(padapter);
}
@ -1551,7 +1551,7 @@ static void rtw_dev_unload(_adapter *padapter)
//s5.
if(padapter->bSurpriseRemoved == _FALSE)
if (padapter->bSurpriseRemoved == _FALSE)
{
DBG_871X("r871x_dev_unload()->rtl871x_hal_deinit()\n");
rtw_hal_deinit(padapter);
@ -1581,13 +1581,13 @@ static void disable_ht_for_spec_devid(const struct pci_device_id *pdid)
int i;
int num = sizeof(specific_device_id_tbl)/sizeof(struct specific_device_id);
for(i=0; i<num; i++)
for (i=0; i<num; i++)
{
vid = specific_device_id_tbl[i].idVendor;
pid = specific_device_id_tbl[i].idProduct;
flags = specific_device_id_tbl[i].flags;
if((pdid->vendor==vid) && (pdid->device==pid) && (flags&SPEC_DEV_ID_DISABLE_HT))
if ((pdid->vendor==vid) && (pdid->device==pid) && (flags&SPEC_DEV_ID_DISABLE_HT))
{
rtw_ht_enable = 0;
rtw_cbw40_enable = 0;
@ -1650,7 +1650,7 @@ _adapter *rtw_pci_if1_init(struct dvobj_priv * dvobj, struct pci_dev *pdev, cons
decide_chip_type_by_pci_device_id(padapter, pdev);
#endif
if((pnetdev = rtw_init_netdev(padapter)) == NULL) {
if ((pnetdev = rtw_init_netdev(padapter)) == NULL) {
goto free_adapter;
}
@ -1664,7 +1664,7 @@ _adapter *rtw_pci_if1_init(struct dvobj_priv * dvobj, struct pci_dev *pdev, cons
padapter = rtw_netdev_priv(pnetdev);
#ifdef CONFIG_IOCTL_CFG80211
if(rtw_wdev_alloc(padapter, dvobj_to_dev(dvobj)) != 0) {
if (rtw_wdev_alloc(padapter, dvobj_to_dev(dvobj)) != 0) {
goto free_adapter;
}
#endif //CONFIG_IOCTL_CFG80211
@ -1693,12 +1693,12 @@ _adapter *rtw_pci_if1_init(struct dvobj_priv * dvobj, struct pci_dev *pdev, cons
rtw_hal_read_chip_info(padapter);
//step 5.
if(rtw_init_drv_sw(padapter) ==_FAIL) {
if (rtw_init_drv_sw(padapter) ==_FAIL) {
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("Initialize driver software resource Failed!\n"));
goto free_hal_data;
}
if(rtw_hal_inirp_init(padapter) ==_FAIL) {
if (rtw_hal_inirp_init(padapter) ==_FAIL) {
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("Initialize PCI desc ring Failed!\n"));
goto free_hal_data;
}
@ -1748,11 +1748,11 @@ _adapter *rtw_pci_if1_init(struct dvobj_priv * dvobj, struct pci_dev *pdev, cons
status = _SUCCESS;
free_hal_data:
if(status != _SUCCESS && padapter->HalData)
if (status != _SUCCESS && padapter->HalData)
rtw_mfree(padapter->HalData, sizeof(*(padapter->HalData)));
free_wdev:
if(status != _SUCCESS) {
if (status != _SUCCESS) {
#ifdef CONFIG_IOCTL_CFG80211
rtw_wdev_unregister(padapter->rtw_wdev);
rtw_wdev_free(padapter->rtw_wdev);
@ -1778,7 +1778,7 @@ static void rtw_pci_if1_deinit(_adapter *if1)
// padapter->intf_stop(padapter);
if(check_fwstate(pmlmepriv, _FW_LINKED))
if (check_fwstate(pmlmepriv, _FW_LINKED))
rtw_disassoc_cmd(if1, 0, _FALSE);
#ifdef CONFIG_AP_MODE
@ -1789,7 +1789,7 @@ static void rtw_pci_if1_deinit(_adapter *if1)
#endif
if (if1->DriverState != DRIVER_DISAPPEAR) {
if(pnetdev) {
if (pnetdev) {
unregister_netdev(pnetdev); //will call netdev_close()
rtw_proc_remove_one(pnetdev);
}
@ -1814,7 +1814,7 @@ static void rtw_pci_if1_deinit(_adapter *if1)
rtw_hal_inirp_deinit(if1);
rtw_free_drv_sw(if1);
if(pnetdev)
if (pnetdev)
rtw_free_netdev(pnetdev);
#ifdef CONFIG_PLATFORM_RTD2880B
@ -1858,7 +1858,7 @@ static int rtw_drv_init(struct pci_dev *pdev, const struct pci_device_id *pdid)
/* Initialize if2 */
#ifdef CONFIG_CONCURRENT_MODE
if((if2 = rtw_drv_if2_init(if1, NULL, pci_set_intf_ops)) == NULL) {
if ((if2 = rtw_drv_if2_init(if1, NULL, pci_set_intf_ops)) == NULL) {
goto free_if1;
}
#endif
@ -1873,7 +1873,7 @@ static int rtw_drv_init(struct pci_dev *pdev, const struct pci_device_id *pdid)
status = _SUCCESS;
free_if2:
if(status != _SUCCESS && if2) {
if (status != _SUCCESS && if2) {
#ifdef CONFIG_CONCURRENT_MODE
rtw_drv_if2_stop(if2);
rtw_drv_if2_free(if2);
@ -1913,7 +1913,7 @@ _func_exit_;
padapter->bSurpriseRemoved = _FALSE; // always trate as device exists
// this will let the driver to disable it's interrupt
#else
if(pci_drvpriv.drv_registered == _TRUE)
if (pci_drvpriv.drv_registered == _TRUE)
{
//DBG_871X("r871xu_dev_remove():padapter->bSurpriseRemoved == _TRUE\n");
padapter->bSurpriseRemoved = _TRUE;

View file

@ -70,7 +70,7 @@ int rtw_os_recvbuf_resource_alloc(_adapter *padapter, struct recv_buf *precvbuf)
precvbuf->irp_pending = _FALSE;
precvbuf->purb = usb_alloc_urb(0, GFP_KERNEL);
if(precvbuf->purb == NULL){
if (precvbuf->purb == NULL){
res = _FAIL;
}
@ -89,7 +89,7 @@ int rtw_os_recvbuf_resource_alloc(_adapter *padapter, struct recv_buf *precvbuf)
#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX
precvbuf->pallocated_buf = rtw_usb_buffer_alloc(pusbd, (size_t)precvbuf->alloc_sz, &precvbuf->dma_transfer_addr);
precvbuf->pbuf = precvbuf->pallocated_buf;
if(precvbuf->pallocated_buf == NULL)
if (precvbuf->pallocated_buf == NULL)
return _FAIL;
#endif //CONFIG_USE_USB_BUFFER_ALLOC_RX
@ -116,7 +116,7 @@ int rtw_os_recvbuf_resource_free(_adapter *padapter, struct recv_buf *precvbuf)
#endif //CONFIG_USE_USB_BUFFER_ALLOC_RX
if(precvbuf->purb)
if (precvbuf->purb)
{
//usb_kill_urb(precvbuf->purb);
usb_free_urb(precvbuf->purb);
@ -125,7 +125,7 @@ int rtw_os_recvbuf_resource_free(_adapter *padapter, struct recv_buf *precvbuf)
#endif //CONFIG_USB_HCI
if(precvbuf->pskb)
if (precvbuf->pskb)
dev_kfree_skb_any(precvbuf->pskb);
@ -144,7 +144,7 @@ void rtw_handle_tkip_mic_err(_adapter *padapter,u8 bgroup)
struct security_priv *psecuritypriv = &padapter->securitypriv;
u32 cur_time = 0;
if( psecuritypriv->last_mic_err_time == 0 )
if ( psecuritypriv->last_mic_err_time == 0 )
{
psecuritypriv->last_mic_err_time = rtw_get_current_time();
}
@ -152,7 +152,7 @@ void rtw_handle_tkip_mic_err(_adapter *padapter,u8 bgroup)
{
cur_time = rtw_get_current_time();
if( cur_time - psecuritypriv->last_mic_err_time < 60*HZ )
if ( cur_time - psecuritypriv->last_mic_err_time < 60*HZ )
{
psecuritypriv->btkip_countermeasure = _TRUE;
psecuritypriv->last_mic_err_time = 0;
@ -218,7 +218,7 @@ void rtw_hostapd_mlme_rx(_adapter *padapter, union recv_frame *precv_frame)
skb->len = precv_frame->u.hdr.len;
//pskb_copy = skb_copy(skb, GFP_ATOMIC);
// if(skb == NULL) goto _exit;
// if (skb == NULL) goto _exit;
skb->dev = pmgnt_netdev;
skb->ip_summed = CHECKSUM_NONE;
@ -275,7 +275,7 @@ _func_enter_;
#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;
@ -293,7 +293,7 @@ _func_enter_;
RT_TRACE(_module_recv_osdep_c_,_drv_info_,("\n skb->head=%p skb->data=%p skb->tail=%p skb->end=%p skb->len=%d\n", skb->head, skb->data, skb->tail, skb->end, skb->len));
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
{
_pkt *pskb2=NULL;
struct sta_info *psta = NULL;
@ -303,11 +303,11 @@ _func_enter_;
//DBG_871X("bmcast=%d\n", bmcast);
if(_rtw_memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN)==_FALSE)
if (_rtw_memcmp(pattrib->dst, myid(&padapter->eeprompriv), ETH_ALEN)==_FALSE)
{
//DBG_871X("not ap psta=%p, addr=%pM\n", psta, pattrib->dst);
if(bmcast)
if (bmcast)
{
psta = rtw_get_bcmc_stainfo(padapter);
pskb2 = skb_clone(skb, GFP_ATOMIC);
@ -315,7 +315,7 @@ _func_enter_;
psta = rtw_get_stainfo(pstapriv, pattrib->dst);
}
if(psta)
if (psta)
{
struct net_device *pnetdev= (struct net_device*)padapter->pnetdev;
@ -329,7 +329,7 @@ _func_enter_;
rtw_xmit_entry(skb, pnetdev);
if(bmcast)
if (bmcast)
skb = pskb2;
else
goto _recv_indicatepkt_end;
@ -354,7 +354,7 @@ _func_enter_;
rcu_read_unlock();
#endif // (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
if( br_port && (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == _TRUE) )
if ( br_port && (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == _TRUE) )
{
int nat25_handle_frame(_adapter *priv, struct sk_buff *skb);
if (nat25_handle_frame(padapter, skb) == -1) {
@ -406,7 +406,7 @@ _func_exit_;
_recv_indicatepkt_drop:
//enqueue back to free_recv_queue
if(precv_frame)
if (precv_frame)
rtw_free_recvframe(precv_frame, pfree_recv_queue);
return _FAIL;
@ -429,7 +429,7 @@ void rtw_os_read_port(_adapter *padapter, struct recv_buf *precvbuf)
precvbuf->pskb = NULL;
precvbuf->reuse = _FALSE;
if(precvbuf->irp_pending == _FALSE)
if (precvbuf->irp_pending == _FALSE)
{
rtw_read_port(padapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
}

Some files were not shown because too many files have changed in this diff Show more