rtl8188eu: Change all "if(" to "if ("

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2015-08-15 13:02:34 -05:00
parent aa89a39a09
commit 6ead3e77dc
61 changed files with 3500 additions and 3500 deletions

View file

@ -90,8 +90,8 @@ static void update_BCNTIM(struct 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;
__le16 tim_bitmap_le;
@ -145,16 +145,16 @@ static void update_BCNTIM(struct 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)
memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
}
*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;
@ -164,23 +164,23 @@ static void update_BCNTIM(struct 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)
{
memcpy(dst_ie, &tim_bitmap_le, 2);
dst_ie+=2;
}
/* copy remainder IE */
if(pbackup_remainder_ie)
if (pbackup_remainder_ie)
{
memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
@ -211,7 +211,7 @@ void rtw_add_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork, u8
{
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;
@ -234,16 +234,16 @@ void rtw_add_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork, u8
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)
memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
}
@ -254,7 +254,7 @@ void rtw_add_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork, u8
dst_ie+=len;
/* copy remainder IE */
if(pbackup_remainder_ie)
if (pbackup_remainder_ie)
{
memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
@ -288,15 +288,15 @@ void rtw_remove_bcn_ie(struct adapter *padapter, struct wlan_bssid_ex *pnetwork,
return;
}
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)
memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
}
/* copy remainder IE */
if(pbackup_remainder_ie)
if (pbackup_remainder_ie)
{
memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
@ -311,7 +311,7 @@ u8 chk_sta_is_alive(struct sta_info *psta)
{
u8 ret = false;
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 ((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))
{
}
else
@ -346,7 +346,7 @@ void expire_timeout_chk(struct 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)
@ -414,7 +414,7 @@ void expire_timeout_chk(struct 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;
}
}
@ -465,7 +465,7 @@ void expire_timeout_chk(struct adapter *padapter)
int ret = _FAIL;
psta = rtw_get_stainfo_by_offset(pstapriv, chk_alive_list[i]);
if(!(psta->state &_FW_LINKED))
if (!(psta->state &_FW_LINKED))
continue;
if (psta->state & WIFI_SLEEP_STATE)
@ -519,12 +519,12 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level)
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct wlan_bssid_ex *pcur_network = (struct wlan_bssid_ex *)&pmlmepriv->cur_network.network;
if(psta)
if (psta)
psta_ht = &psta->htpriv;
else
return;
if(!(psta->state & _FW_LINKED))
if (!(psta->state & _FW_LINKED))
return;
/* b/g mode ra_bitmap */
@ -534,10 +534,10 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level)
tx_ra_bitmap |= rtw_get_bit_value_from_ieee_value(psta->bssrateset[i]&0x7f);
}
/* 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,7 +624,7 @@ void update_bmc_sta(struct adapter *padapter)
struct wlan_bssid_ex *pcur_network = (struct 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; */
@ -670,7 +670,7 @@ void update_bmc_sta(struct 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;
@ -736,7 +736,7 @@ void update_sta_info_apmode(struct 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;
@ -747,19 +747,19 @@ void update_sta_info_apmode(struct adapter *padapter, struct sta_info *psta)
/* ERP */
VCS_update(padapter, psta);
/* 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;
@ -824,7 +824,7 @@ static void update_hw_ht_param(struct adapter *padapter)
/* Config SM Power Save setting */
/* */
pmlmeinfo->SM_PS = (le16_to_cpu(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)
DBG_871X("%s(): WLAN_HT_CAP_SM_PS_STATIC\n",__FUNCTION__);
/* */
@ -864,7 +864,7 @@ static void start_bss_network(struct 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;
}
@ -872,9 +872,9 @@ static void start_bss_network(struct 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;
if(pmlmepriv->htpriv.ht_option)
if (pmlmepriv->htpriv.ht_option)
{
pmlmeinfo->WMM_enable = true;
pmlmeinfo->HT_enable = true;
@ -884,7 +884,7 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf)
update_hw_ht_param(padapter);
}
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_))
@ -918,14 +918,14 @@ static void start_bss_network(struct 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 */
{
/* turn on all dynamic functions */
Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true);
}
/* set channel, bwmode */
p = rtw_get_ie((pnetwork->IEs + sizeof(struct ndis_802_11_fixed_ies)), _HT_ADD_INFO_IE_, &ie_len, (pnetwork->IELength - sizeof(struct ndis_802_11_fixed_ies)));
if( p && ie_len)
if ( p && ie_len)
{
pht_info = (struct HT_info_element *)(p+2);
@ -981,12 +981,12 @@ static void start_bss_network(struct 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);
/* issue beacon frame */
if(send_beacon(padapter)==_FAIL)
if (send_beacon(padapter)==_FAIL)
DBG_871X("issue_beacon, fail!\n");
}
@ -1030,11 +1030,11 @@ int rtw_check_beacon_data(struct 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;
@ -1044,7 +1044,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
memcpy(ie, pbuf, pbss_network->IELength);
if(pbss_network->InfrastructureMode!=Ndis802_11APMode)
if (pbss_network->InfrastructureMode!=Ndis802_11APMode)
return _FAIL;
pbss_network->Rssi = 0;
@ -1063,7 +1063,7 @@ int rtw_check_beacon_data(struct 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)
{
memset(&pbss_network->Ssid, 0, sizeof(struct ndis_802_11_ssid));
memcpy(pbss_network->Ssid.Ssid, (p + 2), ie_len);
@ -1074,7 +1074,7 @@ int rtw_check_beacon_data(struct 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;
@ -1105,7 +1105,7 @@ int rtw_check_beacon_data(struct 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, (struct ndis_802_11_variable_ies *)p);
}
@ -1123,9 +1123,9 @@ int rtw_check_beacon_data(struct 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;
@ -1148,7 +1148,7 @@ int rtw_check_beacon_data(struct 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;
@ -1175,12 +1175,12 @@ int rtw_check_beacon_data(struct 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;
@ -1203,7 +1203,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
}
/* 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;
@ -1218,7 +1218,7 @@ int rtw_check_beacon_data(struct 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));
@ -1230,7 +1230,7 @@ int rtw_check_beacon_data(struct 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->mcs.rx_mask[0] = 0xff;
pht_cap->mcs.rx_mask[1] = 0x0;
}
@ -1241,7 +1241,7 @@ int rtw_check_beacon_data(struct 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;
}
@ -1268,7 +1268,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
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: */
@ -1276,12 +1276,12 @@ int rtw_check_beacon_data(struct 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;
}
@ -1298,7 +1298,7 @@ int rtw_check_beacon_data(struct 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)
@ -1341,7 +1341,7 @@ int rtw_acl_add_sta(struct 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);
@ -1355,9 +1355,9 @@ int rtw_acl_add_sta(struct 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__);
@ -1369,7 +1369,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
spin_unlock_bh(&(pacl_node_q->lock));
if(added == true)
if (added == true)
return ret;
@ -1379,7 +1379,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
{
paclnode = &pacl_list->aclnode[i];
if(paclnode->valid == false)
if (paclnode->valid == false)
{
_rtw_init_listhead(&paclnode->list);
@ -1424,9 +1424,9 @@ int rtw_acl_remove_sta(struct 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;
@ -1462,12 +1462,12 @@ static void update_bcn_erpinfo_ie(struct 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)
{
struct ndis_802_11_variable_ies * pIE = (struct ndis_802_11_variable_ies *)p;
@ -1476,7 +1476,7 @@ static void update_bcn_erpinfo_ie(struct 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);
@ -1532,7 +1532,7 @@ static void update_bcn_wps_ie(struct 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);
@ -1541,33 +1541,33 @@ static void update_bcn_wps_ie(struct 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)
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)
{
memcpy(pwps_ie, pwps_ie_src, wps_ielen+2);
pwps_ie += (wps_ielen+2);
if(pbackup_remainder_ie)
if (pbackup_remainder_ie)
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);
}
@ -1581,19 +1581,19 @@ static void update_bcn_vendor_spec_ie(struct 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);
}
@ -1614,14 +1614,14 @@ void update_beacon(struct 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;
spin_lock_bh(&pmlmepriv->bcn_update_lock);
@ -1678,7 +1678,7 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx)
spin_unlock_bh(&pmlmepriv->bcn_update_lock);
if(tx)
if (tx)
set_tx_beacon_cmd(padapter);
}
@ -1701,7 +1701,7 @@ static int rtw_ht_operation_update(struct 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) */
@ -1768,7 +1768,7 @@ static int rtw_ht_operation_update(struct adapter *padapter)
void associated_clients_update(struct adapter *padapter, u8 updated)
{
/* update associcated stations cap. */
if(updated == true)
if (updated == true)
{
unsigned long irqL;
struct list_head *phead, *plist;
@ -1803,8 +1803,8 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta)
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
if(!(psta->flags & WLAN_STA_SHORT_PREAMBLE)) {
if(!psta->no_short_preamble_set) {
if (!(psta->flags & WLAN_STA_SHORT_PREAMBLE)) {
if (!psta->no_short_preamble_set) {
psta->no_short_preamble_set = 1;
pmlmepriv->num_sta_no_short_preamble++;
@ -1817,7 +1817,7 @@ void bss_cap_update_on_sta_join(struct 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;
pmlmepriv->num_sta_no_short_preamble--;
@ -1830,8 +1830,8 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta)
}
}
if(psta->flags & WLAN_STA_NONERP) {
if(!psta->nonerp_set) {
if (psta->flags & WLAN_STA_NONERP) {
if (!psta->nonerp_set) {
psta->nonerp_set = 1;
pmlmepriv->num_sta_non_erp++;
@ -1842,7 +1842,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta)
}
}
} else {
if(psta->nonerp_set) {
if (psta->nonerp_set) {
psta->nonerp_set = 0;
pmlmepriv->num_sta_non_erp--;
@ -1855,9 +1855,9 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta)
}
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;
@ -1874,7 +1874,7 @@ void bss_cap_update_on_sta_join(struct 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;
@ -1930,7 +1930,7 @@ void bss_cap_update_on_sta_join(struct 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),
@ -1957,7 +1957,7 @@ u8 bss_cap_update_on_sta_leave(struct 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) {
@ -2027,7 +2027,7 @@ u8 ap_free_sta(struct adapter *padapter, struct sta_info *psta, bool active, u16
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct sta_priv *pstapriv = &padapter->stapriv;
if(!psta)
if (!psta)
return beacon_updated;
if (active == true)
@ -2079,7 +2079,7 @@ int rtw_ap_inform_ch_switch(struct 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",
@ -2121,7 +2121,7 @@ int rtw_sta_flush(struct 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;
spin_lock_bh(&pstapriv->asoc_list_lock);
@ -2169,16 +2169,16 @@ void sta_info_update(struct 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;
/* update 802.11n ht cap. */
if(WLAN_STA_HT&flags)
if (WLAN_STA_HT&flags)
{
psta->htpriv.ht_option = true;
psta->qos_option = 1;
@ -2188,7 +2188,7 @@ void sta_info_update(struct 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;
update_sta_info_apmode(padapter, psta);
@ -2197,7 +2197,7 @@ void sta_info_update(struct adapter *padapter, struct sta_info *psta)
/* called >= TSR LEVEL for USB or SDIO Interface*/
void ap_sta_info_defer_update(struct 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 */
@ -2224,7 +2224,7 @@ void rtw_ap_restore_network(struct adapter *padapter)
start_bss_network(padapter, (u8*)&mlmepriv->cur_network.network);
if((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
if ((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_))
{
/* restore group key, WEP keys is restored in ips_leave() */
@ -2256,12 +2256,12 @@ void rtw_ap_restore_network(struct adapter *padapter)
if (psta == NULL) {
DBG_871X(FUNC_ADPT_FMT" sta_info is null\n", FUNC_ADPT_ARG(padapter));
}
else if(psta->state &_FW_LINKED)
else if (psta->state &_FW_LINKED)
{
Update_RA_Entry(padapter, psta);
/* pairwise key */
/* per sta pairwise key and settings */
if( (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
if ( (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_))
{
rtw_setstakey_cmd(padapter, (unsigned char *)psta, true,false);
@ -2351,7 +2351,7 @@ void stop_ap_mode(struct 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

@ -81,7 +81,7 @@ static __inline__ unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, un
/* 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;
}
@ -142,7 +142,7 @@ static __inline__ unsigned long __nat25_timeout(struct adapter *priv)
static __inline__ int __nat25_has_expired(struct 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;
@ -317,7 +317,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;
@ -325,7 +325,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;
@ -334,7 +334,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;
@ -342,7 +342,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;
@ -351,7 +351,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;
@ -384,7 +384,7 @@ static __inline__ void __network_hash_link(struct adapter *priv,
/* spin_lock_bh(&priv->br_ext_lock); */
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];
@ -400,7 +400,7 @@ static __inline__ void __network_hash_unlink(struct nat25_network_db_entry *ent)
/* spin_lock_bh(&priv->br_ext_lock); */
*(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;
@ -419,9 +419,9 @@ static int __nat25_db_network_lookup_and_replace(struct 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);
@ -498,7 +498,7 @@ static void __nat25_db_network_insert(struct 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;
@ -510,7 +510,7 @@ static void __nat25_db_network_insert(struct adapter *priv,
}
db = (struct nat25_network_db_entry *) rtw_malloc(sizeof(*db));
if(db == NULL) {
if (db == NULL) {
spin_unlock_bh(&priv->br_ext_lock);
return;
}
@ -548,7 +548,7 @@ void nat25_db_cleanup(struct 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);
@ -571,7 +571,7 @@ void nat25_db_expire(struct adapter *priv)
unsigned long irqL;
spin_lock_bh(&priv->br_ext_lock);
/* if(!priv->ethBrExtInfo.nat25_disable) */
/* if (!priv->ethBrExtInfo.nat25_disable) */
{
for (i=0; i<NAT25_HASH_SIZE; i++)
{
@ -583,11 +583,11 @@ void nat25_db_expire(struct 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))
{
if(priv->scdb_entry == f)
if (priv->scdb_entry == f)
{
memset(priv->scdb_mac, 0, ETH_ALEN);
memset(priv->scdb_ip, 0, 4);
@ -641,10 +641,10 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
unsigned char networkAddr[MAX_NETWORK_ADDR_LEN];
u32 tmp;
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 = be16_to_cpu(*((__be16 *)(skb->data + 2 * ETH_ALEN)));
@ -652,10 +652,10 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
/*---------------------------------------------------*/
/* Handle IP frame */
/*---------------------------------------------------*/
if(protocol == ETH_P_IP) {
if (protocol == 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;
@ -722,13 +722,13 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
/*---------------------------------------------------*/
/* Handle ARP frame */
/*---------------------------------------------------*/
else if(protocol == ETH_P_ARP)
else if (protocol == 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;
@ -786,7 +786,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
/*---------------------------------------------------*/
/* Handle IPX and Apple Talk frame */
/*---------------------------------------------------*/
else if((protocol == ETH_P_IPX) ||
else if ((protocol == ETH_P_IPX) ||
(protocol <= ETH_FRAME_LEN))
{
unsigned char ipx_header[2] = {0xFF, 0xFF};
@ -795,14 +795,14 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
struct ddpehdr *ddp = NULL;
unsigned char *framePtr = skb->data + ETH_HLEN;
if(protocol == ETH_P_IPX)
if (protocol == ETH_P_IPX)
{
DEBUG_INFO("NAT25: Protocol=IPX (Ethernet II)\n");
ipx = (struct ipxhdr *)framePtr;
}
else if(protocol <= ETH_FRAME_LEN)
else if (protocol <= 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;
@ -812,7 +812,7 @@ int nat25_db_handle(struct 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 */
@ -820,20 +820,20 @@ int nat25_db_handle(struct 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 */
@ -846,11 +846,11 @@ int nat25_db_handle(struct 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;
@ -866,12 +866,12 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
return -1;
/* IPX */
if(ipx != NULL)
if (ipx != NULL)
{
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;
@ -898,7 +898,7 @@ int nat25_db_handle(struct 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");
@ -920,7 +920,7 @@ int nat25_db_handle(struct 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");
@ -946,10 +946,10 @@ int nat25_db_handle(struct 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;
@ -1002,7 +1002,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
}
/* DDP */
else if(ddp != NULL)
else if (ddp != NULL)
{
switch(method)
{
@ -1050,7 +1050,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
/*---------------------------------------------------*/
/* Handle PPPoE frame */
/*---------------------------------------------------*/
else if((protocol == ETH_P_PPP_DISC) ||
else if ((protocol == ETH_P_PPP_DISC) ||
(protocol == ETH_P_PPP_SES))
{
struct pppoe_hdr *ph = (struct pppoe_hdr *)(skb->data + ETH_HLEN);
@ -1064,9 +1064,9 @@ int nat25_db_handle(struct 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;
@ -1101,7 +1101,7 @@ int nat25_db_handle(struct 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",
@ -1141,7 +1141,7 @@ int nat25_db_handle(struct 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;
@ -1149,7 +1149,7 @@ int nat25_db_handle(struct 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))) == NULL) {
if ((ptr = __nat25_find_pppoe_tag(ph, ntohs(PTT_RELAY_SID))) == NULL) {
DEBUG_ERR("Fail to find PTT_RELAY_SID in FADO!\n");
return -1;
}
@ -1158,7 +1158,7 @@ int nat25_db_handle(struct 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;
}
@ -1196,7 +1196,7 @@ int nat25_db_handle(struct 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));
@ -1219,7 +1219,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
/*---------------------------------------------------*/
/* Handle EAP frame */
/*---------------------------------------------------*/
else if(protocol == 0x888e)
else if (protocol == 0x888e)
{
switch(method)
{
@ -1240,7 +1240,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
/*---------------------------------------------------*/
/* Handle C-Media proprietary frame */
/*---------------------------------------------------*/
else if((protocol == 0xe2ae) ||
else if ((protocol == 0xe2ae) ||
(protocol == 0xe2af))
{
switch(method)
@ -1263,7 +1263,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
/* Handle IPV6 frame */
/*---------------------------------------------------*/
#ifdef CL_IPV6_PASS
else if(protocol == ETH_P_IPV6)
else if (protocol == ETH_P_IPV6)
{
struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + ETH_HLEN);
@ -1340,7 +1340,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
int nat25_handle_frame(struct adapter *priv, struct sk_buff *skb)
{
if(!(skb->data[0] & 1))
if (!(skb->data[0] & 1))
{
int is_vlan_tag=0, i, retval=0;
unsigned short vlan_hdr=0;
@ -1393,7 +1393,7 @@ int nat25_handle_frame(struct adapter *priv, struct sk_buff *skb)
*((__be16 *)(skb->data+ETH_ALEN*2+2)) = cpu_to_be16(vlan_hdr);
}
if(retval == -1) {
if (retval == -1) {
return -1;
}
}
@ -1427,29 +1427,29 @@ struct dhcpMessage {
void dhcp_flag_bcast(struct 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) {
__be16 protocol = *((__be16 *)(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 == DHCP_MAGIC) /* match magic word */
if (dhcph->cookie == DHCP_MAGIC) /* match magic word */
{
if(!(dhcph->flags & BROADCAST_FLAG)) /* if not broadcast */
if (!(dhcph->flags & BROADCAST_FLAG)) /* if not broadcast */
{
register int sum = 0;
@ -1483,7 +1483,7 @@ void *scdb_findEntry(struct 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)) {
/* spin_unlock_bh(&priv->br_ext_lock); */
return (void *)db;
}

View file

@ -139,7 +139,7 @@ void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv)
{
;
if(pcmdpriv){
if (pcmdpriv){
_rtw_free_sema(&(pcmdpriv->cmd_queue_sema));
_rtw_free_sema(&(pcmdpriv->terminate_cmdthread_sema));
@ -238,14 +238,14 @@ static int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
u8 bAllow = false; /* set to true to allow enqueuing cmd when hw_init_completed is false */
/* To decide allow or not */
if( (adapter_to_pwrctl(pcmdpriv->padapter)->bHWPwrPindetect)
if ( (adapter_to_pwrctl(pcmdpriv->padapter)->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;
@ -253,10 +253,10 @@ static int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
}
}
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 */
)
{
@ -286,14 +286,14 @@ u32 rtw_enqueue_cmd(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
cmd_obj->padapter = padapter;
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:
@ -324,15 +324,15 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd)
{
;
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);
@ -348,7 +348,7 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd)
void rtw_stop_cmd_thread(struct adapter *adapter)
{
if(adapter->cmdThread && adapter->cmdpriv.cmdthd_running == true
if (adapter->cmdThread && adapter->cmdpriv.cmdthd_running == true
&& adapter->cmdpriv.stop_req == 0)
{
adapter->cmdpriv.stop_req = 1;
@ -399,7 +399,7 @@ int rtw_cmd_thread(void * context)
break;
}
if(rtw_is_list_empty(&(pcmdpriv->cmd_queue.queue)))
if (rtw_is_list_empty(&(pcmdpriv->cmd_queue.queue)))
{
/* DBG_871X("%s: cmd queue is empty!\n", __func__); */
continue;
@ -413,11 +413,11 @@ _next:
break;
}
if(!(pcmd = rtw_dequeue_cmd(pcmdpriv))) {
if (!(pcmd = rtw_dequeue_cmd(pcmdpriv))) {
continue;
}
if( _FAIL == rtw_cmd_filter(pcmdpriv, pcmd) )
if ( _FAIL == rtw_cmd_filter(pcmdpriv, pcmd) )
{
pcmd->res = H2C_DROPPED;
goto post_process;
@ -429,7 +429,7 @@ _next:
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;
@ -451,10 +451,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);
@ -482,7 +482,7 @@ post_process:
/* free all cmd_obj resources */
do{
pcmd = rtw_dequeue_cmd(pcmdpriv);
if(pcmd==NULL) {
if (pcmd==NULL) {
break;
}
@ -552,7 +552,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,
struct wifidirect_info *pwdinfo= &(padapter->wdinfo);
#endif /* CONFIG_P2P */
if(check_fwstate(pmlmepriv, _FW_LINKED) == true){
if (check_fwstate(pmlmepriv, _FW_LINKED) == true){
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1);
}
@ -607,7 +607,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
if(res == _SUCCESS) {
if (res == _SUCCESS) {
pmlmepriv->scan_start_time = rtw_get_current_time();
@ -714,13 +714,13 @@ u8 rtw_setphy_cmd(struct adapter *padapter, u8 modem, u8 ch)
;
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;
@ -747,13 +747,13 @@ u8 rtw_setbbreg_cmd(struct adapter*padapter, u8 offset, u8 val)
u8 res=_SUCCESS;
;
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;
@ -779,13 +779,13 @@ u8 rtw_getbbreg_cmd(struct adapter *padapter, u8 offset, u8 *pval)
;
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;
}
@ -813,13 +813,13 @@ u8 rtw_setrfreg_cmd(struct adapter *padapter, u8 offset, u32 val)
u8 res=_SUCCESS;
;
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;
@ -846,13 +846,13 @@ u8 rtw_getrfreg_cmd(struct adapter *padapter, u8 offset, u8 *pval)
;
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;
@ -916,7 +916,7 @@ u8 rtw_createbss_cmd(struct adapter *padapter)
}
pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(pcmd==NULL){
if (pcmd==NULL){
res= _FAIL;
goto exit;
}
@ -948,7 +948,7 @@ u8 rtw_createbss_cmd_ex(struct adapter *padapter, unsigned char *pbss, unsigned
;
pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(pcmd==NULL){
if (pcmd==NULL){
res= _FAIL;
goto exit;
}
@ -996,7 +996,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork)
}
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;
@ -1027,9 +1027,9 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork)
}
psecnetwork=(struct 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;
@ -1046,7 +1046,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork)
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)) {
memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], psecnetwork->IELength-12);
} else {
memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], (256-1));
@ -1068,7 +1068,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork)
pqospriv->qos_option = 0;
if(pregistrypriv->wmm_enable)
if (pregistrypriv->wmm_enable)
{
u32 tmp_len;
@ -1086,7 +1086,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network* pnetwork)
}
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. */
@ -1180,15 +1180,15 @@ u8 rtw_setopmode_cmd(struct adapter *padapter, enum NDIS_802_11_NETWORK_INFRAST
;
psetop = (struct setopmode_parm*)rtw_zmalloc(sizeof(struct setopmode_parm));
if(psetop==NULL){
if (psetop==NULL){
res=_FAIL;
goto exit;
}
psetop->mode = (u8)networktype;
if(enqueue){
if (enqueue){
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if(ph2c==NULL){
if (ph2c==NULL){
rtw_mfree((u8 *)psetop, sizeof(*psetop));
res= _FAIL;
goto exit;
@ -1223,14 +1223,14 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key, bool en
;
psetstakey_para = (struct set_stakey_parm*)rtw_zmalloc(sizeof(struct set_stakey_parm));
if(psetstakey_para==NULL){
if (psetstakey_para==NULL){
res=_FAIL;
goto exit;
}
memcpy(psetstakey_para->addr, sta->hwaddr,ETH_ALEN);
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE)){
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)){
psetstakey_para->algorithm =(unsigned char) psecuritypriv->dot11PrivacyAlgrthm;
}else{
GET_ENCRY_ALGO(psecuritypriv, sta, psetstakey_para->algorithm, false);
@ -1246,7 +1246,7 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key, bool en
/* jeff: set this becasue at least sw key is ready */
padapter->securitypriv.busetkipkey=true;
if(enqueue)
if (enqueue)
{
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
if ( ph2c == NULL){
@ -1256,7 +1256,7 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key, bool en
}
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;
@ -1292,7 +1292,7 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue)
;
if(!enqueue)
if (!enqueue)
{
clear_cam_entry(padapter, entry);
}
@ -1305,14 +1305,14 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue)
}
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;
@ -1349,13 +1349,13 @@ u8 rtw_setrttbl_cmd(struct adapter *padapter, struct setratable_parm *prate_tab
;
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;
@ -1381,13 +1381,13 @@ u8 rtw_getrttbl_cmd(struct adapter *padapter, struct getratable_rsp *pval)
;
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;
@ -1423,20 +1423,20 @@ u8 rtw_setassocsta_cmd(struct adapter *padapter, u8 *mac_addr)
;
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;
@ -1468,13 +1468,13 @@ u8 rtw_addbareq_cmd(struct adapter*padapter, u8 tid, u8 *addr)
;
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;
@ -1507,13 +1507,13 @@ u8 rtw_reset_securitypriv_cmd(struct adapter*padapter)
;
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;
@ -1547,13 +1547,13 @@ u8 rtw_free_assoc_resources_cmd(struct adapter*padapter)
;
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;
@ -1585,13 +1585,13 @@ u8 rtw_dynamic_chk_wk_cmd(struct 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;
@ -1643,7 +1643,7 @@ u8 rtw_set_ch_cmd(struct adapter*padapter, u8 ch, u8 bw, u8 ch_offset, u8 enqueu
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;
@ -1653,7 +1653,7 @@ u8 rtw_set_ch_cmd(struct adapter*padapter, u8 ch, u8 bw, u8 ch_offset, u8 enqueu
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));
@ -1683,24 +1683,24 @@ u8 rtw_set_chplan_cmd(struct adapter*padapter, u8 chplan, u8 enqueue)
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;
@ -1712,14 +1712,14 @@ u8 rtw_set_chplan_cmd(struct adapter*padapter, u8 chplan, u8 enqueue)
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:
@ -1742,13 +1742,13 @@ u8 rtw_led_blink_cmd(struct adapter*padapter, PLED_871x pLed)
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;
@ -1780,13 +1780,13 @@ u8 rtw_set_csa_cmd(struct adapter*padapter, u8 new_ch_no)
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;
@ -1828,11 +1828,11 @@ static void traffic_status_watchdog(struct adapter *padapter)
RT_LINK_DETECT_T * link_detect = &pmlmepriv->LinkDetectInfo;
/* Determine if our traffic is busy now */
if(check_fwstate(pmlmepriv, _FW_LINKED)) {
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
/* if we raise bBusyTraffic in last watchdog, using lower threshold. */
if (pmlmepriv->LinkDetectInfo.bBusyTraffic)
BusyThreshold =180; /* 75; */
if( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > BusyThreshold ||
if ( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > BusyThreshold ||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > BusyThreshold )
{
bBusyTraffic = true;
@ -1844,7 +1844,7 @@ static void traffic_status_watchdog(struct adapter *padapter)
}
/* Higher Tx/Rx data. */
if( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 4000 ||
if ( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 4000 ||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 4000 )
{
bHigherBusyTraffic = true;
@ -1878,7 +1878,7 @@ static void traffic_status_watchdog(struct 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); */
@ -1890,7 +1890,7 @@ static void traffic_status_watchdog(struct adapter *padapter)
}
/* LeisurePS only work in infra mode. */
if(bEnterPS)
if (bEnterPS)
{
LPS_Enter(padapter);
}
@ -1925,7 +1925,7 @@ void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz)
pmlmepriv = &(padapter->mlmepriv);
#ifdef CONFIG_AP_MODE
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
{
expire_timeout_chk(padapter);
}
@ -1954,7 +1954,7 @@ static void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type)
;
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;
@ -2037,15 +2037,15 @@ u8 rtw_lps_ctrl_wk_cmd(struct adapter*padapter, u8 lps_ctrl_type, u8 enqueue)
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
u8 res = _SUCCESS;
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;
@ -2088,13 +2088,13 @@ u8 rtw_rpt_timer_cfg_cmd(struct adapter*padapter, u16 minRptTime)
;
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;
@ -2130,18 +2130,18 @@ u8 rtw_antenna_select_cmd(struct adapter*padapter, u8 antenna,u8 enqueue)
;
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;
@ -2192,19 +2192,19 @@ u8 p2p_protocol_wk_cmd(struct adapter*padapter, int intCmdType )
;
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;
@ -2236,13 +2236,13 @@ u8 rtw_ps_cmd(struct adapter*padapter)
u8 res = _SUCCESS;
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;
@ -2271,10 +2271,10 @@ static void rtw_chk_hi_queue_hdl(struct 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;
@ -2289,13 +2289,13 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
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);
@ -2319,13 +2319,13 @@ u8 rtw_chk_hi_queue_cmd(struct 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;
@ -2452,7 +2452,7 @@ u8 rtw_drvextra_cmd_hdl(struct 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;
@ -2519,7 +2519,7 @@ void rtw_survey_cmd_callback(struct adapter* padapter , struct cmd_obj *pcmd)
;
if(pcmd->res == H2C_DROPPED)
if (pcmd->res == H2C_DROPPED)
{
/* TODO: cancel timer and do timeout handler directly... */
/* need to make timeout handlerOS independent */
@ -2570,13 +2570,13 @@ void rtw_joinbss_cmd_callback(struct adapter* padapter, struct cmd_obj *pcmd)
;
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);
@ -2596,7 +2596,7 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
;
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 );
@ -2626,10 +2626,10 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
spin_lock_bh(&pmlmepriv->lock);
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)
@ -2650,7 +2650,7 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
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"));
spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
@ -2698,7 +2698,7 @@ void rtw_setstaKey_cmdrsp_callback(struct adapter* padapter , struct cmd_obj *p
;
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;
@ -2719,7 +2719,7 @@ void rtw_setassocsta_cmdrsp_callback(struct adapter* padapter, struct cmd_obj *
;
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

@ -119,7 +119,7 @@ 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;
@ -290,7 +290,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;
@ -308,7 +308,7 @@ int proc_get_ap_info(char *page, char **start,
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);
}
@ -385,9 +385,9 @@ int proc_get_mac_reg_dump1(char *page, char **start,
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;
@ -408,9 +408,9 @@ int proc_get_mac_reg_dump2(char *page, char **start,
memset(page, 0, count);
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;
@ -431,9 +431,9 @@ int proc_get_mac_reg_dump3(char *page, char **start,
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;
@ -453,9 +453,9 @@ int proc_get_bb_reg_dump1(char *page, char **start,
len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
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;
@ -473,9 +473,9 @@ int proc_get_bb_reg_dump2(char *page, char **start,
len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
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;
@ -493,9 +493,9 @@ int proc_get_bb_reg_dump3(char *page, char **start,
len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
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;
@ -518,9 +518,9 @@ int proc_get_rf_reg_dump1(char *page, char **start,
{
/* 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;
@ -545,9 +545,9 @@ int proc_get_rf_reg_dump2(char *page, char **start,
{
/* 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;
@ -571,9 +571,9 @@ int proc_get_rf_reg_dump3(char *page, char **start,
{
/* 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;
@ -598,9 +598,9 @@ int proc_get_rf_reg_dump4(char *page, char **start,
{
/* 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;
@ -652,7 +652,7 @@ int proc_set_rx_signal(struct file *file, const char __user *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;
@ -660,7 +660,7 @@ int proc_set_rx_signal(struct file *file, const char __user *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");
@ -681,7 +681,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
@ -707,7 +707,7 @@ int proc_set_ht_enable(struct file *file, const char __user *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);
@ -728,7 +728,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
@ -754,7 +754,7 @@ int proc_set_cbw40_enable(struct file *file, const char __user *buffer,
int num = sscanf(tmp, "%d ", &mode);
if( pregpriv && mode >= 0 && mode < 2 )
if ( pregpriv && mode >= 0 && mode < 2 )
{
pregpriv->cbw40_enable= mode;
@ -777,7 +777,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
@ -803,7 +803,7 @@ int proc_set_ampdu_enable(struct file *file, const char __user *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);
@ -824,7 +824,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],
@ -845,7 +845,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
@ -871,7 +871,7 @@ int proc_set_rx_stbc(struct file *file, const char __user *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);
@ -913,7 +913,7 @@ int proc_set_rssi_disp(struct file *file, const char __user *buffer,
return count;
}
if(enable)
if (enable)
{
DBG_8192C("Turn On Rx RSSI Display Function\n");
padapter->bRxRSSIDisplay = enable ;
@ -962,7 +962,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);
@ -983,7 +983,7 @@ int proc_get_all_sta_info(char *page, char **start,
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);
}
@ -1071,10 +1071,10 @@ int proc_set_best_channel(struct file *file, const char __user *buffer,
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
char tmp[32];
if(count < 1)
if (count < 1)
return -EFAULT;
if(buffer && !copy_from_user(tmp, buffer, sizeof(tmp)))
if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp)))
{
int i;
for(i = 0; pmlmeext->channel_set[i].ChannelNum != 0; i++)
@ -1103,7 +1103,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
@ -1129,7 +1129,7 @@ int proc_set_btcoex_dbg(struct file *file, const char __user *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

@ -61,12 +61,12 @@ Efuse_Read1ByteFromFakeContent(
u16 Offset,
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(
u16 Offset,
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(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;
@ -328,7 +328,7 @@ EFUSE_Read1Byte(
{
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, (void *)&contentLen, false);
if( Address < contentLen) /* E-fuse 512Byte */
if ( Address < contentLen) /* E-fuse 512Byte */
{
rtw_write8(Adapter, EFUSE_CTRL, Value);
@ -402,7 +402,7 @@ EFUSE_Write1Byte(
{
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;
@ -439,7 +439,7 @@ efuse_OneByteRead(
{
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;
@ -485,7 +485,7 @@ efuse_OneByteWrite(
tmpidx++;
}
if(tmpidx<100)
if (tmpidx<100)
{
bResult = true;
}
@ -716,7 +716,7 @@ u8 rtw_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data)
return _FAIL;
map = rtw_zmalloc(mapLen);
if(map == NULL){
if (map == NULL){
return _FAIL;
}
@ -814,7 +814,7 @@ u8 rtw_BT_efuse_map_write(struct adapter *padapter, u16 addr, u16 cnts, u8 *data
return _FAIL;
map = rtw_zmalloc(mapLen);
if(map == NULL){
if (map == NULL){
return _FAIL;
}

View file

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

View file

@ -213,7 +213,7 @@ void _rtw_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
if( (adapter->bDriverStopped) || (adapter->bSurpriseRemoved)) {
if ( (adapter->bDriverStopped) || (adapter->bSurpriseRemoved)) {
RT_TRACE(_module_rtl871x_io_c_, _drv_info_,
("rtw_read_port:bDriverStopped(%d) OR bSurpriseRemoved(%d)",
adapter->bDriverStopped, adapter->bSurpriseRemoved));
@ -233,7 +233,7 @@ void _rtw_read_port_cancel(struct adapter *adapter)
_read_port_cancel = pintfhdl->io_ops._read_port_cancel;
if(_read_port_cancel)
if (_read_port_cancel)
_read_port_cancel(pintfhdl);
}
@ -273,7 +273,7 @@ void _rtw_write_port_cancel(struct adapter *adapter)
_write_port_cancel = pintfhdl->io_ops._write_port_cancel;
if(_write_port_cancel)
if (_write_port_cancel)
_write_port_cancel(pintfhdl);
}
@ -304,7 +304,7 @@ int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj)
{
int ret = false;
int value;
if( (value=ATOMIC_INC_RETURN(&dvobj->continual_io_error)) > MAX_CONTINUAL_IO_ERR) {
if ( (value=ATOMIC_INC_RETURN(&dvobj->continual_io_error)) > MAX_CONTINUAL_IO_ERR) {
DBG_871X("[dvobj:%p][ERROR] continual_io_error:%d > %d\n", dvobj, value, MAX_CONTINUAL_IO_ERR);
ret = true;
} else {

View file

@ -68,7 +68,7 @@ u8 rtw_validate_ssid(struct ndis_802_11_ssid *ssid)
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;
@ -109,7 +109,7 @@ u8 rtw_do_join(struct adapter * padapter)
pmlmepriv->to_join = true;
if(_rtw_queue_empty(queue)== true)
if (_rtw_queue_empty(queue)== true)
{
spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
@ -123,7 +123,7 @@ u8 rtw_do_join(struct adapter * padapter)
{
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."));
}
@ -140,14 +140,14 @@ u8 rtw_do_join(struct adapter * padapter)
{
int select_ret;
spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
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 */
@ -165,7 +165,7 @@ u8 rtw_do_join(struct adapter * padapter)
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;
@ -182,12 +182,12 @@ u8 rtw_do_join(struct adapter * padapter)
/* 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
|| rtw_to_roaming(padapter) > 0
)
{
/* 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."));
}
@ -308,7 +308,7 @@ u8 rtw_set_802_11_ssid(struct adapter* padapter, struct ndis_802_11_ssid *ssid)
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;
@ -332,13 +332,13 @@ u8 rtw_set_802_11_ssid(struct adapter* padapter, struct ndis_802_11_ssid *ssid)
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);
@ -434,7 +434,7 @@ u8 rtw_set_802_11_connect(struct adapter* padapter, u8 *bssid, struct ndis_802_1
goto exit;
}
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;
@ -497,30 +497,30 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter* padapter,
("+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)
{
spin_lock_bh(&pmlmepriv->lock);
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;
stop_ap_mode(padapter);
}
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 */
}
@ -615,7 +615,7 @@ u8 rtw_set_802_11_bssid_list_scan(struct adapter* padapter, struct ndis_802_11_s
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"));
@ -650,12 +650,12 @@ u8 rtw_set_802_11_authentication_mode(struct adapter* padapter, enum NDIS_802_11
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;
res=rtw_set_auth(padapter,psecuritypriv);
if(res==_SUCCESS)
if (res==_SUCCESS)
ret=true;
else
ret=false;
@ -677,7 +677,7 @@ u8 rtw_set_802_11_add_wep(struct adapter* padapter, struct ndis_802_11_wep *wep)
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;
@ -718,7 +718,7 @@ u8 rtw_set_802_11_add_wep(struct adapter* padapter, struct ndis_802_11_wep *wep)
res=rtw_set_key(padapter,psecuritypriv, keyid, 1,true);
if(res==_FAIL)
if (res==_FAIL)
ret= false;
exit:
@ -744,7 +744,7 @@ u8 rtw_set_802_11_remove_wep(struct adapter* padapter, u32 keyindex){
{
int res;
struct security_priv* psecuritypriv=&(padapter->securitypriv);
if( keyindex < 4 ){
if ( keyindex < 4 ){
memset(&psecuritypriv->dot11DefKey[keyindex], 0, 16);
@ -752,7 +752,7 @@ u8 rtw_set_802_11_remove_wep(struct adapter* padapter, u32 keyindex){
psecuritypriv->dot11DefKeylen[keyindex]=0;
if(res==_FAIL)
if (res==_FAIL)
ret=_FAIL;
}
@ -793,7 +793,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key)
goto exit;
}
if(key->KeyIndex & 0x40000000)
if (key->KeyIndex & 0x40000000)
{
/* Pairwise key */
@ -802,7 +802,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key)
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;
}
@ -815,11 +815,11 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key)
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 */
@ -837,8 +837,8 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key)
}
/* 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;
@ -846,9 +846,9 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key)
}
/* 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;
@ -878,7 +878,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key)
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: +++++ Group key +++++\n"));
/* 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));
@ -910,20 +910,20 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key)
}
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. */
@ -933,16 +933,16 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key)
}
/* 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;
}
@ -959,7 +959,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key)
}
/* 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;
@ -987,10 +987,10 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key)
}
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)
{
unsigned long long keysrc=key->KeyRSC & 0x00FFFFFFFFFFFFULL;
memcpy(&padapter->securitypriv.dot11Grprxpn, &keysrc, 8);
@ -1005,16 +1005,16 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key)
/* 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;
}
@ -1023,7 +1023,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key)
memset(&padapter->securitypriv.dot118021XGrptxmickey[(u8)((key->KeyIndex) & 0x03)], 0, 16);
memset(&padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)], 0, 16);
if((key->KeyIndex & 0x10000000))
if ((key->KeyIndex & 0x10000000))
{
memcpy(&padapter->securitypriv.dot118021XGrptxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 16, 8);
memcpy(&padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 24, 8);
@ -1063,7 +1063,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key)
res=rtw_set_key(padapter,&padapter->securitypriv, key->KeyIndex, 1,true);
if(res==_FAIL)
if (res==_FAIL)
ret= _FAIL;
goto exit;
@ -1076,13 +1076,13 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key)
pbssid=get_bssid(&padapter->mlmepriv);
stainfo=rtw_get_stainfo(&padapter->stapriv , pbssid );
if(stainfo!=NULL)
if (stainfo!=NULL)
{
memset( &stainfo->dot118021x_UncstKey, 0, 16);/* clear keybuffer */
memcpy(&stainfo->dot118021x_UncstKey, key->KeyMaterial, 16);
if(encryptionalgo== _TKIP_)
if (encryptionalgo== _TKIP_)
{
padapter->securitypriv.busetkipkey=false;
@ -1091,7 +1091,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key)
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)){
memcpy(&stainfo->dot11tkiptxmickey, key->KeyMaterial + 16, 8);
memcpy(&stainfo->dot11tkiprxmickey, key->KeyMaterial + 24, 8);
@ -1102,14 +1102,14 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key)
}
}
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, true);
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(group)\n"));
@ -1119,7 +1119,7 @@ u8 rtw_set_802_11_add_key(struct adapter* padapter, struct ndis_802_11_key *key)
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;
}
@ -1161,7 +1161,7 @@ u8 rtw_set_802_11_remove_key(struct adapter* padapter, struct ndis_802_11_remove
} else {
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 */
@ -1200,13 +1200,13 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
u16 mcs_rate=0;
u32 ht_ielen = 0;
if((check_fwstate(pmlmepriv, _FW_LINKED) != true)
if ((check_fwstate(pmlmepriv, _FW_LINKED) != true)
&& (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) != true))
return 0;
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 ieee80211_ht_cap *)(p+2);
@ -1235,7 +1235,7 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
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++;
}
@ -1255,7 +1255,7 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
*/
int rtw_set_scan_mode(struct 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;
@ -1294,15 +1294,15 @@ int rtw_set_country(struct 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 if(0 == strcmp(country_code, "IN"))
else if (0 == strcmp(country_code, "IN"))
channel_plan = RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN;
else
DBG_871X("%s unknown country_code:%s\n", __FUNCTION__, country_code);

View file

@ -67,7 +67,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;
@ -83,10 +83,10 @@ int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds, u32 cmd_len
}
bool rtw_IOL_applied(struct adapter *adapter)
{
if(1 == adapter->registrypriv.fw_iol)
if (1 == adapter->registrypriv.fw_iol)
return true;
if((2 == adapter->registrypriv.fw_iol) && (!adapter_to_dvobj(adapter)->ishighspeed))
if ((2 == adapter->registrypriv.fw_iol) && (!adapter_to_dvobj(adapter)->ishighspeed))
return true;
return false;
}
@ -109,7 +109,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); */
@ -130,7 +130,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); */
@ -151,7 +151,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); */
@ -173,7 +173,7 @@ int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr,
cmd.address = cpu_to_le16((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); */
@ -219,7 +219,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 );
@ -239,7 +239,7 @@ void rtw_IOL_cmd_buf_dump(struct adapter *Adapter,int buf_len,u8 *pbuf)
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);

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

@ -75,7 +75,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;
@ -105,7 +105,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
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);
@ -135,7 +135,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
}
spin_unlock_bh(&pstapriv->asoc_list_lock);
if(attr_len>0)
if (attr_len>0)
{
len = rtw_set_p2p_attr_content(pbuf, P2P_ATTR_GROUP_INFO, attr_len, pdata_attr);
}
@ -489,7 +489,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);
le_tmp = cpu_to_le16(capability);
@ -885,7 +885,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: */
@ -915,7 +915,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;
}
@ -1867,11 +1867,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++;
@ -1910,7 +1910,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); */
}
@ -1972,7 +1972,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);
}
@ -2211,9 +2211,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 ))
{
@ -2254,7 +2254,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
__le16 le_tmp;
__be16 be_tmp;
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);
@ -2285,7 +2285,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*)&le_tmp, (uint*) &attr_contentlen) )
if ( rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&le_tmp, (uint*) &attr_contentlen) )
{
DBG_8192C( "[%s] Got P2P Capability Attr!!\n", __FUNCTION__ );
cap_attr = le16_to_cpu(le_tmp);
@ -2296,11 +2296,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;
@ -2322,7 +2322,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;
}
@ -2342,7 +2342,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(*(__be16*)pattr_content))
if (WPS_ATTR_DEVICE_NAME == be16_to_cpu(*(__be16*)pattr_content))
{
dev_name_len = be16_to_cpu(*(__be16*)(pattr_content+2));
@ -2387,13 +2387,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))
{
unsigned long irqL;
struct list_head *phead, *plist;
@ -2409,7 +2409,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))
{
@ -2561,7 +2561,7 @@ static u8 rtw_p2p_ch_inclusion(struct mlme_ext_priv *pmlmeext, u8 *peer_ch_list,
{
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;
@ -2595,7 +2595,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*) &be_tmp, &wps_devicepassword_id_len);
wps_devicepassword_id = be16_to_cpu(be_tmp);
@ -2657,7 +2657,7 @@ 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*)&le_tmp, (uint*)&attr_contentlen) )
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&le_tmp, (uint*)&attr_contentlen) )
cap_attr = le16_to_cpu(le_tmp);
if ( rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GO_INTENT , &attr_content, &attr_contentlen) )
@ -2694,7 +2694,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. */
memcpy( pwdinfo->groupid_info.go_device_addr, pwdinfo->device_addr, ETH_ALEN );
@ -2717,7 +2717,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;
@ -2725,7 +2725,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) )
@ -2840,7 +2840,7 @@ 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*)&le_tmp, (uint*)&attr_contentlen) )
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&le_tmp, (uint*)&attr_contentlen) )
cap_attr = le16_to_cpu(le_tmp);
rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, &attr_content, &attr_contentlen);
@ -2917,7 +2917,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. */
memcpy( pwdinfo->groupid_info.go_device_addr, pwdinfo->device_addr, ETH_ALEN );
@ -2943,7 +2943,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;
@ -2951,7 +2951,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) )
@ -3161,14 +3161,14 @@ static void restore_p2p_state_handler( struct adapter* padapter )
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
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);
}
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))
{
/* In the P2P client mode, the driver should not switch back to its listen channel */
/* because this P2P client should stay at the operating channel of P2P GO. */
@ -3274,7 +3274,7 @@ static void rtw_change_p2pie_op_ch(struct adapter *padapter, const u8 *frame_bod
/* 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) = ch;
}
@ -3351,7 +3351,7 @@ void rtw_append_wfd_ie(struct 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
@ -3417,7 +3417,7 @@ void rtw_append_wfd_ie(struct 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];
@ -3537,7 +3537,7 @@ int rtw_p2p_check_frames(struct 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
@ -3567,7 +3567,7 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 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 */
}
@ -3690,7 +3690,7 @@ int rtw_p2p_check_frames(struct adapter *padapter, const u8 *buf, u32 len, u8 tx
if ((cont = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, NULL, &cont_len)))
{
#ifdef CONFIG_P2P_INVITE_IOT
if(tx && *cont==7)
if (tx && *cont==7)
{
DBG_871X("TX_P2P_INVITE_RESP, status is no common channel, change to unknown group\n");
*cont = 8; /* unknow group status */
@ -3735,14 +3735,14 @@ int rtw_p2p_check_frames(struct 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 */
}
@ -3769,7 +3769,7 @@ int rtw_p2p_check_frames(struct 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];
@ -3868,11 +3868,11 @@ void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength)
u8 noa_offset, noa_num, noa_index;
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
{
return;
}
if(IELength <= _BEACON_IE_OFFSET_)
if (IELength <= _BEACON_IE_OFFSET_)
return;
ies = IEs + _BEACON_IE_OFFSET_;
@ -3884,12 +3884,12 @@ void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength)
{
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;
@ -3899,7 +3899,7 @@ void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength)
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)
{
@ -3921,21 +3921,21 @@ void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength)
}
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(adapter_to_pwrctl(padapter)->bFwCurrentInPSMode == true)
if (adapter_to_pwrctl(padapter)->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);
}
@ -3949,9 +3949,9 @@ void process_p2p_ps_ie(struct adapter *padapter, u8 *IEs, u32 IELength)
}
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);
}
@ -3978,9 +3978,9 @@ void p2p_ps_wk_hdl(struct adapter *padapter, u8 p2p_ps_state)
pwdinfo->opp_ps = 0;
pwdinfo->noa_num = 0;
pwdinfo->p2p_ps_mode = P2P_PS_NONE;
if(pwrpriv->bFwCurrentInPSMode == true)
if (pwrpriv->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 *)(&(pwrpriv->pwr_mode)));
@ -3991,9 +3991,9 @@ void p2p_ps_wk_hdl(struct adapter *padapter, u8 p2p_ps_state)
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__);
@ -4029,16 +4029,16 @@ u8 p2p_ps_wk_cmd(struct adapter*padapter, u8 p2p_ps_state, u8 enqueue)
if ( rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
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;
@ -4068,7 +4068,7 @@ static void reset_ch_sitesurvey_timer_process (void *FunctionContext)
struct adapter *adapter = (struct 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__ );
@ -4087,7 +4087,7 @@ static void reset_ch_sitesurvey_timer_process2 (void *FunctionContext)
struct adapter *adapter = (struct 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__ );
@ -4106,7 +4106,7 @@ static void restore_p2p_state_timer_process (void *FunctionContext)
struct adapter *adapter = (struct 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 );
@ -4120,13 +4120,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;
spin_lock_bh(&pmlmepriv->lock);
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 */
{
@ -4162,7 +4162,7 @@ static void find_phase_timer_process (void *FunctionContext)
struct adapter *adapter = (struct 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++;
@ -4432,7 +4432,7 @@ const char * rtw_p2p_state_txt(enum P2P_STATE state)
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
@ -4446,7 +4446,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
@ -4461,7 +4461,7 @@ void dbg_rtw_p2p_set_pre_state(struct wifidirect_info *wdinfo, enum P2P_STATE st
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
@ -4508,7 +4508,7 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role)
}
else if (role == P2P_ROLE_DISABLE)
{
if( padapter->wdinfo.driver_interface == DRIVER_CFG80211 )
if ( padapter->wdinfo.driver_interface == DRIVER_CFG80211 )
wdev_to_priv(padapter->rtw_wdev)->p2p_enabled = false;
if (_FAIL == rtw_pwr_wakeup(padapter)) {
@ -4517,7 +4517,7 @@ int rtw_p2p_enable(struct 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

@ -49,12 +49,12 @@ void _ips_enter(struct 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);
@ -78,7 +78,7 @@ int _ips_leave(struct adapter * padapter)
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
int result = _SUCCESS;
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;
@ -175,7 +175,7 @@ static bool rtw_pwr_unassociated_idle(struct adapter *adapter)
#endif
#ifdef CONFIG_INTEL_PROXIM
if(adapter->proximity.proxim_on==true){
if (adapter->proximity.proxim_on==true){
return;
}
#endif
@ -205,25 +205,25 @@ void rtw_ps_processor(struct adapter*padapter)
pwrpriv->ps_processing = true;
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(pwrpriv->bHWPwrPindetect)
if (pwrpriv->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;
@ -241,9 +241,9 @@ void rtw_ps_processor(struct 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;
@ -267,7 +267,7 @@ void rtw_ps_processor(struct 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)
@ -275,12 +275,12 @@ void rtw_ps_processor(struct 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)
@ -297,7 +297,7 @@ void rtw_ps_processor(struct adapter*padapter)
autosuspend_enter(padapter);
#endif /* if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) */
}
else if(pwrpriv->bHWPwrPindetect)
else if (pwrpriv->bHWPwrPindetect)
{
}
else
@ -433,13 +433,13 @@ u8 PS_RDY_CHECK(struct adapter * padapter)
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
if(true == pwrpriv->bInSuspend )
if (true == pwrpriv->bInSuspend )
return false;
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;
}
@ -452,7 +452,7 @@ u8 PS_RDY_CHECK(struct adapter * padapter)
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) )
return false;
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;
@ -474,7 +474,7 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a
("%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;
}
@ -490,11 +490,11 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a
}
}
/* 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
if(pwdinfo->opp_ps == 0)
if (pwdinfo->opp_ps == 0)
#endif /* CONFIG_P2P */
{
DBG_871X("rtw_set_ps_mode: Leave 802.11 power save\n");
@ -521,7 +521,7 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a
#ifdef CONFIG_P2P
/* 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 */
@ -584,9 +584,9 @@ void LPS_Enter(struct adapter *padapter)
if (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);
@ -612,10 +612,10 @@ void LPS_Leave(struct adapter *padapter)
u8 bAwake = false;
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, 0x40);
if(pwrpriv->pwr_mode == PS_MODE_ACTIVE)
if (pwrpriv->pwr_mode == PS_MODE_ACTIVE)
LPS_RF_ON_check(padapter, LPS_LEAVE_TIMEOUT_MS);
}
}
@ -643,10 +643,10 @@ void LeaveAllPowerSaveMode(struct adapter *Adapter)
rtw_lps_ctrl_wk_cmd(Adapter, LPS_CTRL_LEAVE, enqueue);
} else {
if(adapter_to_pwrctl(Adapter)->rf_pwrstate== rf_off)
if (adapter_to_pwrctl(Adapter)->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);
@ -762,7 +762,7 @@ static void rtw_late_resume(struct early_suspend *h)
struct adapter *adapter = dvobj->if1;
DBG_871X("%s\n",__FUNCTION__);
if(pwrpriv->do_late_resume) {
if (pwrpriv->do_late_resume) {
rtw_set_do_late_resume(pwrpriv, false);
rtw_resume_process(adapter);
}
@ -810,7 +810,7 @@ static void rtw_late_resume(android_early_suspend_t *h)
struct adapter *adapter = dvobj->if1;
DBG_871X("%s\n",__FUNCTION__);
if(pwrpriv->do_late_resume) {
if (pwrpriv->do_late_resume) {
rtw_set_do_late_resume(pwrpriv, false);
rtw_resume_process(adapter);
}
@ -908,13 +908,13 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
}
/* 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;
}
@ -923,8 +923,8 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
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)
{
@ -945,19 +945,19 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
#endif /* if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND) */
}
if(rf_off == pwrpriv->rf_pwrstate )
if (rf_off == pwrpriv->rf_pwrstate )
{
#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;
@ -968,7 +968,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
#endif
{
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;
@ -978,7 +978,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
}
/* TODO: the following checking need to be merged... */
if(padapter->bDriverStopped
if (padapter->bDriverStopped
|| !padapter->bup
|| !padapter->hw_init_completed
){
@ -1005,9 +1005,9 @@ int rtw_pm_set_lps(struct 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);
}
@ -1031,15 +1031,15 @@ int rtw_pm_set_ips(struct adapter *padapter, u8 mode)
{
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);
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(struct adapter *padapter, u8 *pxmitframe)
;
if(((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
if (((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
return;
hw_hdr_offset = TXDESC_SIZE +
@ -188,7 +188,7 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe)
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];
@ -199,7 +199,7 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe)
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;
@ -240,7 +240,7 @@ void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe)
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); */
@ -260,7 +260,7 @@ void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe)
/* calculate icv and compare the icv */
*((__le32 *)crc)=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]));
@ -332,7 +332,7 @@ void rtw_secmicappendbyte(struct mic_data *pmicdata, u8 b )
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 );
@ -390,15 +390,15 @@ void rtw_seccalctkipmic(u8 * key,u8 *header,u8 *data,u32 data_len,u8 *mic_code,
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);
@ -646,7 +646,7 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
u32 res=_SUCCESS;
;
if(((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
if (((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
return _FAIL;
hw_hdr_offset = TXDESC_SIZE +
@ -654,9 +654,9 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
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;
}
@ -668,7 +668,7 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
if (stainfo!=NULL){
if(!(stainfo->state &_FW_LINKED))
if (!(stainfo->state &_FW_LINKED))
{
DBG_871X("%s, psta->state(0x%x) != _FW_LINKED\n", __func__, stainfo->state);
return _FAIL;
@ -676,7 +676,7 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
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;
}
@ -700,7 +700,7 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
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));
*((__le32 *)crc)=getcrc32(payload,length);/* modified by Amy*/
@ -762,18 +762,18 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
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))
{
static u32 start = 0;
static u32 no_gkey_bc_cnt = 0;
static u32 no_gkey_mc_cnt = 0;
if(psecuritypriv->binstallGrpkey==false)
if (psecuritypriv->binstallGrpkey==false)
{
res=_FAIL;
@ -836,7 +836,7 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
*((__le32 *)crc)=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]));
@ -1172,7 +1172,7 @@ static void construct_mic_iv(
if (!qc_exists) mic_iv[1] = 0x00;
#ifdef CONFIG_IEEE80211W
/* 802.11w management frame should set management bit(4) */
if(frtype == WIFI_MGT_TYPE)
if (frtype == WIFI_MGT_TYPE)
mic_iv[1] |= BIT(4);
#endif /* CONFIG_IEEE80211W */
for (i = 2; i < 8; i++)
@ -1206,7 +1206,7 @@ static void construct_mic_header1(
mic_header1[1] = (u8)((header_length - 2) % 256);
#ifdef CONFIG_IEEE80211W
/* 802.11w management frame don't AND subtype bits 4,5,6 of frame control field */
if(frtype == WIFI_MGT_TYPE)
if (frtype == WIFI_MGT_TYPE)
mic_header1[2] = mpdu[0]; /* Mute CF poll & CF ack bits */
else
#endif /* CONFIG_IEEE80211W */
@ -1310,7 +1310,7 @@ static void construct_ctr_preload(
ctr_preload[1] = mpdu[24] & 0x0f;
#ifdef CONFIG_IEEE80211W
/* 802.11w management frame should set management bit(4) */
if(frtype == WIFI_MGT_TYPE)
if (frtype == WIFI_MGT_TYPE)
ctr_preload[1] |= BIT(4);
#endif /* CONFIG_IEEE80211W */
for (i = 2; i < 8; i++)
@ -1381,7 +1381,7 @@ static sint aes_cipher(u8 *key, uint hdrlen,
((frtype|frsubtype) == WIFI_DATA_CFPOLL)||
((frtype|frsubtype) == WIFI_DATA_CFACKPOLL)) {
qc_exists = 1;
if(hdrlen != WLAN_HDR_A3_QOS_LEN)
if (hdrlen != WLAN_HDR_A3_QOS_LEN)
hdrlen += 2;
}
/* add for CONFIG_IEEE80211W, none 11w also can use */
@ -1390,7 +1390,7 @@ static sint aes_cipher(u8 *key, uint hdrlen,
(frsubtype == 0x09)||
(frsubtype == 0x0a)||
(frsubtype == 0x0b))) {
if(hdrlen != WLAN_HDR_A3_QOS_LEN)
if (hdrlen != WLAN_HDR_A3_QOS_LEN)
hdrlen += 2;
qc_exists = 1;
} else
@ -1543,7 +1543,7 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe)
struct xmit_priv *pxmitpriv=&padapter->xmitpriv;
u32 res=_SUCCESS;
if(((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
if (((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
return _FAIL;
hw_hdr_offset = TXDESC_SIZE +
@ -1552,8 +1552,8 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe)
pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + hw_hdr_offset;
/* 4 start to encrypt each fragment */
if((pattrib->encrypt==_AES_)){
if(pattrib->psta) {
if ((pattrib->encrypt==_AES_)){
if (pattrib->psta) {
stainfo = pattrib->psta;
} else {
DBG_871X("%s, call rtw_get_stainfo()\n", __func__);
@ -1561,14 +1561,14 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe)
}
if (stainfo!=NULL){
if(!(stainfo->state &_FW_LINKED)) {
if (!(stainfo->state &_FW_LINKED)) {
DBG_871X("%s, psta->state(0x%x) != _FW_LINKED\n", __func__, stainfo->state);
return _FAIL;
}
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;
else
prwskey=&stainfo->dot118021x_UncstKey.skey[0];
@ -1576,7 +1576,7 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe)
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);
@ -1656,7 +1656,7 @@ static sint aes_decipher(u8 *key, uint hdrlen,
((frtype|frsubtype) == WIFI_DATA_CFPOLL)||
((frtype|frsubtype) == WIFI_DATA_CFACKPOLL)) {
qc_exists = 1;
if(hdrlen != WLAN_HDR_A3_QOS_LEN){
if (hdrlen != WLAN_HDR_A3_QOS_LEN){
hdrlen += 2;
}
}/* only for data packet . add for CONFIG_IEEE80211W, none 11w also can use */
@ -1665,7 +1665,7 @@ static sint aes_decipher(u8 *key, uint hdrlen,
(frsubtype == 0x09)||
(frsubtype == 0x0a)||
(frsubtype == 0x0b))) {
if(hdrlen != WLAN_HDR_A3_QOS_LEN){
if (hdrlen != WLAN_HDR_A3_QOS_LEN){
hdrlen += 2;
}
qc_exists = 1;
@ -1720,7 +1720,7 @@ static sint aes_decipher(u8 *key, uint hdrlen,
}
/* start to calculate the mic */
if((hdrlen +plen+8) <= MAX_MSG_SIZE)
if ((hdrlen +plen+8) <= MAX_MSG_SIZE)
memcpy((void *)message, pframe, (hdrlen +plen+8)); /* 8 is for ext iv len */
@ -1849,7 +1849,7 @@ static sint aes_decipher(u8 *key, uint hdrlen,
/* compare the mic */
for(i=0;i<8;i++){
if(pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-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]));
@ -1873,12 +1873,12 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)
;
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)) {
static u32 start = 0;
static u32 no_gkey_bc_cnt = 0;
static u32 no_gkey_mc_cnt = 0;
@ -1917,7 +1917,7 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)
no_gkey_mc_cnt = 0;
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);
res=_FAIL;
@ -1954,7 +1954,7 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe)
ori_len = pattrib->pkt_len-WLAN_HDR_A3_LEN+BIP_AAD_SIZE;
BIP_AAD = rtw_zmalloc(ori_len);
if(BIP_AAD == NULL)
if (BIP_AAD == NULL)
{
DBG_871X("BIP AAD allocate fail\n");
return _FAIL;
@ -1968,7 +1968,7 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe)
/* find MME IE pointer */
p = rtw_get_ie(BIP_AAD+BIP_AAD_SIZE, _MME_IE_, &len, pattrib->pkt_len-WLAN_HDR_A3_LEN);
/* Baron */
if(p)
if (p)
{
u16 keyid=0;
u64 temp_ipn=0;
@ -1976,7 +1976,7 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe)
memcpy(&temp_ipn, p+4, 6);
temp_ipn = le64_to_cpu(temp_ipn);
/* BIP packet number should bigger than previous BIP packet */
if(temp_ipn <= pmlmeext->mgnt_80211w_IPN_rx)
if (temp_ipn <= pmlmeext->mgnt_80211w_IPN_rx)
{
DBG_871X("replay BIP packet\n");
goto BIP_exit;
@ -1984,7 +1984,7 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe)
/* copy key index */
memcpy(&keyid, p+2, 2);
keyid = le16_to_cpu(keyid);
if(keyid != padapter->securitypriv.dot11wBIPKeyid)
if (keyid != padapter->securitypriv.dot11wBIPKeyid)
{
DBG_871X("BIP key index error!\n");
goto BIP_exit;
@ -2000,7 +2000,7 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe)
/* conscruct AAD, copy address 1 to address 3 */
memcpy(BIP_AAD+2, pwlanhdr->addr1, 18);
if(omac1_aes_128(padapter->securitypriv.dot11wBIPKey[padapter->securitypriv.dot11wBIPKeyid].skey
if (omac1_aes_128(padapter->securitypriv.dot11wBIPKey[padapter->securitypriv.dot11wBIPKeyid].skey
, BIP_AAD, ori_len, mic))
goto BIP_exit;
@ -2024,7 +2024,7 @@ u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe)
}
*/
/* MIC field should be last 8 bytes of packet (packet without FCS) */
if(_rtw_memcmp(mic, pframe+pattrib->pkt_len-8, 8))
if (_rtw_memcmp(mic, pframe+pattrib->pkt_len-8, 8))
{
pmlmeext->mgnt_80211w_IPN_rx = temp_ipn;
res=_SUCCESS;
@ -2768,10 +2768,10 @@ void rtw_sec_restore_wep_key(struct adapter *adapter)
struct security_priv* securitypriv=&(adapter->securitypriv);
sint keyid;
if((_WEP40_ == securitypriv->dot11PrivacyAlgrthm) ||(_WEP104_ == securitypriv->dot11PrivacyAlgrthm)) {
if ((_WEP40_ == securitypriv->dot11PrivacyAlgrthm) ||(_WEP104_ == securitypriv->dot11PrivacyAlgrthm)) {
for(keyid=0;keyid<4;keyid++){
if(securitypriv->key_mask & BIT(keyid)){
if(keyid == securitypriv->dot11PrivacyKeyIndex)
if (securitypriv->key_mask & BIT(keyid)){
if (keyid == securitypriv->dot11PrivacyKeyIndex)
rtw_set_key(adapter,securitypriv, keyid, 1, true);
else
rtw_set_key(adapter,securitypriv, keyid, 0, true);

View file

@ -50,20 +50,20 @@ u8 sreset_get_wifi_status(struct adapter *padapter)
u8 status = WIFI_STATUS_SUCCESS;
u32 val32 = 0;
unsigned long 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)));
@ -115,7 +115,7 @@ static void sreset_restore_security_station(struct adapter *padapter)
rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8));
}
if((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
if ((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_))
{
psta = rtw_get_stainfo(pstapriv, get_bssid(mlmepriv));
@ -144,8 +144,8 @@ static void sreset_restore_network_station(struct adapter *padapter)
u8 threshold;
/* TH=1 => means that invalidate usb rx aggregation */
/* TH=0 => means that validate usb rx aggregation, use init value. */
if(mlmepriv->htpriv.ht_option) {
if(padapter->registrypriv.wifi_spec==1)
if (mlmepriv->htpriv.ht_option) {
if (padapter->registrypriv.wifi_spec==1)
threshold = 1;
else
threshold = 0;

View file

@ -95,7 +95,7 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
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 -
@ -207,7 +207,7 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
struct recv_reorder_ctrl *preorder_ctrl;
int index;
if(pstapriv){
if (pstapriv){
/* delete all reordering_ctrl_timer */
spin_lock_bh(&pstapriv->sta_hash_lock);
for(index = 0; index < NUM_STA; index++)
@ -233,7 +233,7 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
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);
}
}
@ -278,7 +278,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
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;
@ -505,7 +505,7 @@ void rtw_free_all_stainfo(struct adapter *padapter)
;
if(pstapriv->asoc_sta_count==1)
if (pstapriv->asoc_sta_count==1)
goto exit;
spin_lock_bh(&pstapriv->sta_hash_lock);
@ -521,7 +521,7 @@ void rtw_free_all_stainfo(struct adapter *padapter)
plist = get_next(plist);
if(pbcmc_stainfo!=psta)
if (pbcmc_stainfo!=psta)
rtw_free_stainfo(padapter , psta);
}
@ -553,10 +553,10 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
;
if(hwaddr==NULL)
if (hwaddr==NULL)
return NULL;
if(IS_MCAST(hwaddr))
if (IS_MCAST(hwaddr))
{
addr = bc_addr;
}
@ -606,7 +606,7 @@ u32 rtw_init_bcmc_stainfo(struct adapter* padapter)
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;
@ -649,9 +649,9 @@ u8 rtw_access_ctrl(struct 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;
@ -661,11 +661,11 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)
spin_unlock_bh(&(pacl_node_q->lock));
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;
}

View file

@ -139,7 +139,7 @@ u8 judge_network_type(struct 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)
{
@ -159,7 +159,7 @@ u8 judge_network_type(struct 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;
}
@ -364,7 +364,7 @@ void Restore_DM_Func_Flag(struct adapter *padapter)
void Switch_DM_Func(struct adapter *padapter, u32 mode, u8 enable)
{
if(enable == true)
if (enable == true)
rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_SET, (u8 *)(&mode));
else
rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_CLR, (u8 *)(&mode));
@ -470,7 +470,7 @@ void set_channel_bwmode(struct adapter *padapter, unsigned char channel, unsigne
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;
@ -539,7 +539,7 @@ int is_client_associated_to_ap(struct adapter *padapter)
struct mlme_ext_priv *pmlmeext;
struct mlme_ext_info *pmlmeinfo;
if(!padapter)
if (!padapter)
return _FAIL;
pmlmeext = &padapter->mlmeextpriv;
@ -743,7 +743,7 @@ int WMM_param_handler(struct adapter *padapter, struct ndis_802_11_variable_ies
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;
@ -774,7 +774,7 @@ void WMMOnAssocRsp(struct adapter *padapter)
acm_mask = 0;
if( pmlmeext->cur_wireless_mode == WIRELESS_11B)
if ( pmlmeext->cur_wireless_mode == WIRELESS_11B)
aSifsTime = 10;
else
aSifsTime = 16;
@ -823,14 +823,14 @@ void WMMOnAssocRsp(struct 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;
@ -840,18 +840,18 @@ void WMMOnAssocRsp(struct adapter *padapter)
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];
@ -886,17 +886,17 @@ static void bwmode_update_check(struct adapter *padapter, struct ndis_802_11_var
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;
@ -923,7 +923,7 @@ static void bwmode_update_check(struct adapter *padapter, struct ndis_802_11_var
}
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;
@ -939,7 +939,7 @@ static void bwmode_update_check(struct adapter *padapter, struct ndis_802_11_var
}
if(true == pmlmeinfo->bwmode_updated)
if (true == pmlmeinfo->bwmode_updated)
{
struct sta_info *psta;
struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network);
@ -950,11 +950,11 @@ static void bwmode_update_check(struct adapter *padapter, struct ndis_802_11_var
/* 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;
@ -981,9 +981,9 @@ void HT_caps_handler(struct adapter *padapter, struct ndis_802_11_variable_ies *
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;
@ -1030,7 +1030,7 @@ void HT_caps_handler(struct adapter *padapter, struct ndis_802_11_variable_ies *
/* 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
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R[i];
@ -1044,12 +1044,12 @@ void HT_info_handler(struct adapter *padapter, struct ndis_802_11_variable_ies *
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;
@ -1096,7 +1096,7 @@ void ERP_IE_handler(struct adapter *padapter, struct ndis_802_11_variable_ies *
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;
@ -1197,7 +1197,7 @@ int rtw_check_bcn_info(struct 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(struct wlan_bssid_ex) - MAX_IE_SZ + len;
@ -1209,7 +1209,7 @@ int rtw_check_bcn_info(struct 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 ieee80211_ht_cap *)(p + 2);
ht_cap_info = le16_to_cpu(pht_cap->cap_info);
} else {
@ -1217,7 +1217,7 @@ int rtw_check_bcn_info(struct 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 {
@ -1245,7 +1245,7 @@ int rtw_check_bcn_info(struct 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__);
@ -1266,7 +1266,7 @@ int rtw_check_bcn_info(struct 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)))) {
memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1));
bssid->Ssid.SsidLength = *(p + 1);
} else {
@ -1321,7 +1321,7 @@ int rtw_check_bcn_info(struct 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__,
@ -1330,7 +1330,7 @@ int rtw_check_bcn_info(struct 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",
@ -1672,7 +1672,7 @@ unsigned char get_highest_rate_idx(u32 mask)
for(i=27; i>=0; i--)
{
if(mask & BIT(i))
if (mask & BIT(i))
{
rate_idx = i;
break;
@ -1727,7 +1727,7 @@ void update_tx_basic_rate(struct 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 */
memset(supported_rates, 0, NDIS_802_11_LENGTH_RATES_EX);
@ -1808,7 +1808,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 {
@ -1879,12 +1879,12 @@ void update_capinfo(struct adapter *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;
@ -1893,7 +1893,7 @@ void update_capinfo(struct adapter *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;
@ -1909,24 +1909,24 @@ void update_capinfo(struct adapter *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;
}
@ -1957,7 +1957,7 @@ void update_wireless_mode(struct adapter *padapter)
pmlmeinfo->HT_enable = 1;
}
if(pmlmeext->cur_channel > 14)
if (pmlmeext->cur_channel > 14)
{
if (pmlmeinfo->HT_enable)
{
@ -1977,7 +1977,7 @@ void update_wireless_mode(struct adapter *padapter)
{
network_type |= WIRELESS_11B;
}
else if((cckrates_included(rate, ratelen)) == true)
else if ((cckrates_included(rate, ratelen)) == true)
{
network_type |= WIRELESS_11BG;
}
@ -2004,7 +2004,7 @@ void update_bmc_sta_support_rate(struct 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 */
memcpy((pmlmeinfo->FW_sta_info[mac_id].SupportedRates), rtw_basic_rate_cck, 4);
@ -2054,7 +2054,7 @@ void process_addba_req(struct 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;
param = le16_to_cpu(preq->BA_para_set);
tid = (param>>2)&0x0f;

View file

@ -174,7 +174,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
pxmitbuf->ext_tag = false;
/* Tx buf allocation may fail sometimes, so sleep and retry. */
if((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,(MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ))) == _FAIL) {
if ((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,(MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ))) == _FAIL) {
rtw_msleep_os(10);
res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf,(MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ));
if (res == _FAIL) {
@ -262,7 +262,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
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;
}
@ -329,7 +329,7 @@ void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv)
rtw_mfree_xmit_priv_lock(pxmitpriv);
if(pxmitpriv->pxmit_frame_buf==NULL)
if (pxmitpriv->pxmit_frame_buf==NULL)
goto out;
for(i=0; i<NR_XMITFRAME; i++)
@ -343,18 +343,18 @@ void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv)
{
rtw_os_xmit_resource_free(padapter, pxmitbuf,(MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ));
/* if(pxmitbuf->pallocated_buf) */
/* if (pxmitbuf->pallocated_buf) */
/* rtw_mfree(pxmitbuf->pallocated_buf, MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ); */
pxmitbuf++;
}
if(pxmitpriv->pallocated_frame_buf) {
if (pxmitpriv->pallocated_frame_buf) {
rtw_vmfree(pxmitpriv->pallocated_frame_buf, NR_XMITFRAME * sizeof(struct xmit_frame) + 4);
}
if(pxmitpriv->pallocated_xmitbuf) {
if (pxmitpriv->pallocated_xmitbuf) {
rtw_vmfree(pxmitpriv->pallocated_xmitbuf, NR_XMITBUFF * sizeof(struct xmit_buf) + 4);
}
@ -374,13 +374,13 @@ void _rtw_free_xmit_priv (struct xmit_priv *pxmitpriv)
{
rtw_os_xmit_resource_free(padapter, pxmitbuf,(max_xmit_extbuf_size + XMITBUF_ALIGN_SZ));
/* if(pxmitbuf->pallocated_buf) */
/* if (pxmitbuf->pallocated_buf) */
/* rtw_mfree(pxmitbuf->pallocated_buf, max_xmit_extbuf_size); */
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);
}
@ -402,7 +402,7 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame *
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
if(pattrib->psta)
if (pattrib->psta)
{
psta = pattrib->psta;
}
@ -412,13 +412,13 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame *
psta=rtw_get_stainfo(&padapter->stapriv ,&pattrib->ra[0] );
}
if(psta==NULL)
if (psta==NULL)
{
DBG_871X("%s, psta==NUL\n", __func__);
return;
}
if(!(psta->state &_FW_LINKED))
if (!(psta->state &_FW_LINKED))
{
DBG_871X("%s, psta->state(0x%x) != _FW_LINKED\n", __func__, psta->state);
return;
@ -437,17 +437,17 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame *
/* (2) If there are more than one frag in this MSDU, only the first frag uses protection frame. */
/* Other fragments are protected by previous fragment. */
/* So we only need to check the length of first fragment. */
if(pmlmeext->cur_wireless_mode < WIRELESS_11_24N || padapter->registrypriv.wifi_spec)
if (pmlmeext->cur_wireless_mode < WIRELESS_11_24N || padapter->registrypriv.wifi_spec)
{
if(sz > padapter->registrypriv.rts_thresh)
if (sz > padapter->registrypriv.rts_thresh)
{
pattrib->vcs_mode = RTS_CTS;
}
else
{
if(psta->rtsen)
if (psta->rtsen)
pattrib->vcs_mode = RTS_CTS;
else if(psta->cts2self)
else if (psta->cts2self)
pattrib->vcs_mode = CTS_TO_SELF;
else
pattrib->vcs_mode = NONE_VCS;
@ -458,7 +458,7 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame *
while (true)
{
/* IOT action */
if((pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_ATHEROS) && (pattrib->ampdu_en==true) &&
if ((pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_ATHEROS) && (pattrib->ampdu_en==true) &&
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_ ))
{
pattrib->vcs_mode = CTS_TO_SELF;
@ -467,21 +467,21 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame *
/* check ERP protection */
if(psta->rtsen || psta->cts2self)
if (psta->rtsen || psta->cts2self)
{
if(psta->rtsen)
if (psta->rtsen)
pattrib->vcs_mode = RTS_CTS;
else if(psta->cts2self)
else if (psta->cts2self)
pattrib->vcs_mode = CTS_TO_SELF;
break;
}
/* check HT op mode */
if(pattrib->ht_en)
if (pattrib->ht_en)
{
u8 HTOpMode = pmlmeinfo->HT_protection;
if((pmlmeext->cur_bwmode && (HTOpMode == 2 || HTOpMode == 3)) ||
if ((pmlmeext->cur_bwmode && (HTOpMode == 2 || HTOpMode == 3)) ||
(!pmlmeext->cur_bwmode && HTOpMode == 3) )
{
pattrib->vcs_mode = RTS_CTS;
@ -490,7 +490,7 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame *
}
/* check rts */
if(sz > padapter->registrypriv.rts_thresh)
if (sz > padapter->registrypriv.rts_thresh)
{
pattrib->vcs_mode = RTS_CTS;
break;
@ -499,7 +499,7 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame *
/* to do list: check MIMO power save condition. */
/* check AMPDU aggregation for TXOP */
if(pattrib->ampdu_en==true)
if (pattrib->ampdu_en==true)
{
pattrib->vcs_mode = RTS_CTS;
break;
@ -513,9 +513,9 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame *
static void update_attrib_phy_info(struct pkt_attrib *pattrib, struct sta_info *psta)
{
/*if(psta->rtsen)
/*if (psta->rtsen)
pattrib->vcs_mode = RTS_CTS;
else if(psta->cts2self)
else if (psta->cts2self)
pattrib->vcs_mode = CTS_TO_SELF;
else
pattrib->vcs_mode = NONE_VCS;*/
@ -544,7 +544,7 @@ u8 qos_acm(u8 acm_mask, u8 priority)
{
case 0:
case 3:
if(acm_mask & BIT(1))
if (acm_mask & BIT(1))
change_priority = 1;
break;
case 1:
@ -552,12 +552,12 @@ u8 qos_acm(u8 acm_mask, u8 priority)
break;
case 4:
case 5:
if(acm_mask & BIT(2))
if (acm_mask & BIT(2))
change_priority = 0;
break;
case 6:
case 7:
if(acm_mask & BIT(3))
if (acm_mask & BIT(3))
change_priority = 5;
break;
default:
@ -684,7 +684,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
res =_FAIL;
goto exit;
}
else if((check_fwstate(pmlmepriv, WIFI_AP_STATE)==true)&&(!(psta->state & _FW_LINKED)))
else if ((check_fwstate(pmlmepriv, WIFI_AP_STATE)==true)&&(!(psta->state & _FW_LINKED)))
{
res =_FAIL;
goto exit;
@ -718,16 +718,16 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
if (check_fwstate(pmlmepriv, WIFI_AP_STATE|WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE))
{
if(psta->qos_option)
if (psta->qos_option)
set_qos(&pktfile, pattrib);
}
else
{
if(pqospriv->qos_option)
if (pqospriv->qos_option)
{
set_qos(&pktfile, pattrib);
if(pmlmepriv->acm_mask != 0)
if (pmlmepriv->acm_mask != 0)
{
pattrib->priority = qos_acm(pmlmepriv->acm_mask, pattrib->priority);
}
@ -738,7 +738,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
pattrib->encrypt = 0;
if((pattrib->ether_type != 0x888e) && (check_fwstate(pmlmepriv, WIFI_MP_STATE) == false))
if ((pattrib->ether_type != 0x888e) && (check_fwstate(pmlmepriv, WIFI_MP_STATE) == false))
{
RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("\npsta->ieee8021x_blocked == true, pattrib->ether_type(%.4x) != 0x888e\n",pattrib->ether_type));
#ifdef DBG_TX_DROP_FRAME
@ -760,7 +760,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
pattrib->key_idx = (u8)psecuritypriv->dot11PrivacyKeyIndex;
break;
case dot11AuthAlgrthm_8021X:
if(bmcast)
if (bmcast)
pattrib->key_idx = (u8)psecuritypriv->dot118021XGrpKeyid;
else
pattrib->key_idx = 0;
@ -785,7 +785,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
pattrib->iv_len = 8;
pattrib->icv_len = 4;
if(padapter->securitypriv.busetkipkey==_FAIL)
if (padapter->securitypriv.busetkipkey==_FAIL)
{
RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("\npadapter->securitypriv.busetkipkey(%d)==_FAIL drop packet\n", padapter->securitypriv.busetkipkey));
#ifdef DBG_TX_DROP_FRAME
@ -841,7 +841,7 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr
u8 hw_hdr_offset = 0;
sint bmcst = IS_MCAST(pattrib->ra);
if(pattrib->psta)
if (pattrib->psta)
{
stainfo = pattrib->psta;
}
@ -851,13 +851,13 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr
stainfo=rtw_get_stainfo(&padapter->stapriv ,&pattrib->ra[0]);
}
if(stainfo==NULL)
if (stainfo==NULL)
{
DBG_871X("%s, psta==NUL\n", __func__);
return _FAIL;
}
if(!(stainfo->state &_FW_LINKED))
if (!(stainfo->state &_FW_LINKED))
{
DBG_871X("%s, psta->state(0x%x) != _FW_LINKED\n", __func__, stainfo->state);
return _FAIL;
@ -867,17 +867,17 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr
hw_hdr_offset = TXDESC_SIZE + (pxmitframe->pkt_offset * PACKET_OFFSET_SZ);;
if(pattrib->encrypt ==_TKIP_)/* if(psecuritypriv->dot11PrivacyAlgrthm==_TKIP_PRIVACY_) */
if (pattrib->encrypt ==_TKIP_)/* if (psecuritypriv->dot11PrivacyAlgrthm==_TKIP_PRIVACY_) */
{
/* encode mic code */
if(stainfo!= NULL){
if (stainfo!= NULL){
u8 null_key[16]={0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0};
pframe = pxmitframe->buf_addr + hw_hdr_offset;
if(bmcst)
if (bmcst)
{
if(_rtw_memcmp(psecuritypriv->dot118021XGrptxmickey[psecuritypriv->dot118021XGrpKeyid].skey, null_key, 16)==true){
if (_rtw_memcmp(psecuritypriv->dot118021XGrptxmickey[psecuritypriv->dot118021XGrpKeyid].skey, null_key, 16)==true){
/* DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey==0\n"); */
/* rtw_msleep_os(10); */
return _FAIL;
@ -887,7 +887,7 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr
}
else
{
if(_rtw_memcmp(&stainfo->dot11tkiptxmickey.skey[0],null_key, 16)==true){
if (_rtw_memcmp(&stainfo->dot11tkiptxmickey.skey[0],null_key, 16)==true){
/* DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey==0\n"); */
/* rtw_msleep_os(10); */
return _FAIL;
@ -896,23 +896,23 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr
rtw_secmicsetkey(&micdata, &stainfo->dot11tkiptxmickey.skey[0]);
}
if(pframe[1]&1){ /* ToDS==1 */
if (pframe[1]&1){ /* ToDS==1 */
rtw_secmicappend(&micdata, &pframe[16], 6); /* DA */
if(pframe[1]&2) /* From Ds==1 */
if (pframe[1]&2) /* From Ds==1 */
rtw_secmicappend(&micdata, &pframe[24], 6);
else
rtw_secmicappend(&micdata, &pframe[10], 6);
} else{ /* ToDS==0 */
rtw_secmicappend(&micdata, &pframe[4], 6); /* DA */
if(pframe[1]&2) /* From Ds==1 */
if (pframe[1]&2) /* From Ds==1 */
rtw_secmicappend(&micdata, &pframe[16], 6);
else
rtw_secmicappend(&micdata, &pframe[10], 6);
}
/* if(pqospriv->qos_option==1) */
if(pattrib->qos_en)
/* if (pqospriv->qos_option==1) */
if (pattrib->qos_en)
priority[0]=(u8)pxmitframe->attrib.priority;
@ -927,7 +927,7 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr
payload=payload+pattrib->hdrlen+pattrib->iv_len;
RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("curfragnum=%d pattrib->hdrlen=%d pattrib->iv_len=%d",curfragnum,pattrib->hdrlen,pattrib->iv_len));
if((curfragnum+1)==pattrib->nr_frags){
if ((curfragnum+1)==pattrib->nr_frags){
length=pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len-( (pattrib->bswenc) ? pattrib->icv_len : 0);
rtw_secmicappend(&micdata, payload,length);
payload=payload+length;
@ -974,8 +974,8 @@ static s32 xmitframe_swencrypt(struct adapter *padapter, struct xmit_frame *pxmi
;
/* if((psecuritypriv->sw_encrypt)||(pattrib->bswenc)) */
if(pattrib->bswenc)
/* if ((psecuritypriv->sw_encrypt)||(pattrib->bswenc)) */
if (pattrib->bswenc)
{
/* DBG_871X("start xmitframe_swencrypt\n"); */
RT_TRACE(_module_rtl871x_xmit_c_,_drv_alert_,("### xmitframe_swencrypt\n"));
@ -1025,20 +1025,20 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat
psta = pattrib->psta;
} else {
DBG_871X("%s, call rtw_get_stainfo()\n", __func__);
if(bmcst) {
if (bmcst) {
psta = rtw_get_bcmc_stainfo(padapter);
} else {
psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra);
}
}
if(psta==NULL)
if (psta==NULL)
{
DBG_871X("%s, psta==NUL\n", __func__);
return _FAIL;
}
if(!(psta->state &_FW_LINKED))
if (!(psta->state &_FW_LINKED))
{
DBG_871X("%s, psta->state(0x%x) != _FW_LINKED\n", __func__, psta->state);
return _FAIL;
@ -1069,7 +1069,7 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat
memcpy(pwlanhdr->addr2, get_bssid(pmlmepriv), ETH_ALEN);
memcpy(pwlanhdr->addr3, pattrib->src, ETH_ALEN);
if(psta->qos_option)
if (psta->qos_option)
qos_option = true;
}
else if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) ||
@ -1078,7 +1078,7 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN);
if(psta->qos_option)
if (psta->qos_option)
qos_option = true;
}
else {
@ -1087,7 +1087,7 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat
goto exit;
}
if(pattrib->mdata)
if (pattrib->mdata)
SetMData(fctrl);
if (pattrib->encrypt)
@ -1109,7 +1109,7 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat
/* Update Seq Num will be handled by f/w */
{
if(psta){
if (psta){
psta->sta_xmitpriv.txseq_tid[pattrib->priority]++;
psta->sta_xmitpriv.txseq_tid[pattrib->priority] &= 0xFFF;
@ -1119,26 +1119,26 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat
SetSeqNum(hdr, pattrib->seqnum);
/* check if enable ampdu */
if(pattrib->ht_en && psta->htpriv.ampdu_enable)
if (pattrib->ht_en && psta->htpriv.ampdu_enable)
{
if(psta->htpriv.agg_enable_bitmap & BIT(pattrib->priority))
if (psta->htpriv.agg_enable_bitmap & BIT(pattrib->priority))
pattrib->ampdu_en = true;
}
/* re-check if enable ampdu by BA_starting_seqctrl */
if(pattrib->ampdu_en == true)
if (pattrib->ampdu_en == true)
{
u16 tx_seq;
tx_seq = psta->BA_starting_seqctrl[pattrib->priority & 0x0f];
/* check BA_starting_seqctrl */
if(SN_LESS(pattrib->seqnum, tx_seq))
if (SN_LESS(pattrib->seqnum, tx_seq))
{
/* DBG_871X("tx ampdu seqnum(%d) < tx_seq(%d)\n", pattrib->seqnum, tx_seq); */
pattrib->ampdu_en = false;/* AGG BK */
}
else if(SN_EQUAL(pattrib->seqnum, tx_seq))
else if (SN_EQUAL(pattrib->seqnum, tx_seq))
{
psta->BA_starting_seqctrl[pattrib->priority & 0x0f] = (tx_seq+1)&0xfff;
@ -1184,7 +1184,7 @@ s32 rtw_txframes_sta_ac_pending(struct adapter *padapter, struct pkt_attrib *pat
struct tx_servq *ptxservq;
int priority = pattrib->priority;
if(pattrib->psta)
if (pattrib->psta)
{
psta = pattrib->psta;
}
@ -1194,13 +1194,13 @@ s32 rtw_txframes_sta_ac_pending(struct adapter *padapter, struct pkt_attrib *pat
psta=rtw_get_stainfo(&padapter->stapriv ,&pattrib->ra[0]);
}
if(psta==NULL)
if (psta==NULL)
{
DBG_871X("%s, psta==NUL\n", __func__);
return 0;
}
if(!(psta->state &_FW_LINKED))
if (!(psta->state &_FW_LINKED))
{
DBG_871X("%s, psta->state(0x%x) != _FW_LINKED\n", __func__, psta->state);
return 0;
@ -1294,7 +1294,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra);
}
if(psta==NULL)
if (psta==NULL)
{
DBG_871X("%s, psta==NUL\n", __func__);
@ -1302,7 +1302,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
}
if(!(psta->state &_FW_LINKED))
if (!(psta->state &_FW_LINKED))
{
DBG_871X("%s, psta->state(0x%x) != _FW_LINKED\n", __func__, psta->state);
return _FAIL;
@ -1362,13 +1362,13 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
WEP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx);
break;
case _TKIP_:
if(bmcst)
if (bmcst)
TKIP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx);
else
TKIP_IV(pattrib->iv, psta->dot11txpn, 0);
break;
case _AES_:
if(bmcst)
if (bmcst)
AES_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx);
else
AES_IV(pattrib->iv, psta->dot11txpn, 0);
@ -1445,7 +1445,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
xmitframe_swencrypt(padapter, pxmitframe);
if(bmcst == false)
if (bmcst == false)
update_attrib_vcs_info(padapter, pxmitframe);
else
pattrib->vcs_mode = NONE_VCS;
@ -1490,23 +1490,23 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s
tmp_buf = BIP_AAD = rtw_zmalloc(ori_len);
subtype = GetFrameSubType(pframe); /* bit(7)~bit(2) */
if(BIP_AAD == NULL)
if (BIP_AAD == NULL)
return _FAIL;
spin_lock_bh(&padapter->security_key_mutex);
/* only support station mode */
if(!check_fwstate(pmlmepriv, WIFI_STATION_STATE) || !check_fwstate(pmlmepriv, _FW_LINKED))
if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE) || !check_fwstate(pmlmepriv, _FW_LINKED))
goto xmitframe_coalesce_success;
/* IGTK key is not install, it may not support 802.11w */
if(padapter->securitypriv.binstallBIPkey != true)
if (padapter->securitypriv.binstallBIPkey != true)
{
DBG_871X("no instll BIP key\n");
goto xmitframe_coalesce_success;
}
/* station mode doesn't need TX BIP, just ready the code */
if(bmcst)
if (bmcst)
{
int frame_body_len;
u8 mic[16];
@ -1514,7 +1514,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s
memset(MME, 0, 18);
/* other types doesn't need the BIP */
if(GetFrameSubType(pframe) != WIFI_DEAUTH && GetFrameSubType(pframe) != WIFI_DISASSOC)
if (GetFrameSubType(pframe) != WIFI_DEAUTH && GetFrameSubType(pframe) != WIFI_DISASSOC)
goto xmitframe_coalesce_fail;
MGMT_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr);
@ -1551,7 +1551,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s
printk("\n");
}*/
/* calculate mic */
if(omac1_aes_128(padapter->securitypriv.dot11wBIPKey[padapter->securitypriv.dot11wBIPKeyid].skey
if (omac1_aes_128(padapter->securitypriv.dot11wBIPKey[padapter->securitypriv.dot11wBIPKeyid].skey
, BIP_AAD, BIP_AAD_SIZE+frame_body_len, mic))
goto xmitframe_coalesce_fail;
@ -1577,7 +1577,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s
else /* unicast mgmt frame TX */
{
/* start to encrypt mgmt frame */
if(subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC ||
if (subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC ||
subtype == WIFI_REASSOCREQ || subtype == WIFI_ACTION)
{
if (pattrib->psta)
@ -1587,14 +1587,14 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s
psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra);
}
if(psta==NULL)
if (psta==NULL)
{
DBG_871X("%s, psta==NUL\n", __func__);
goto xmitframe_coalesce_fail;
}
if(!(psta->state & _FW_LINKED) || pxmitframe->buf_addr==NULL)
if (!(psta->state & _FW_LINKED) || pxmitframe->buf_addr==NULL)
{
DBG_871X("%s, not _FW_LINKED or addr null\n", __func__);
goto xmitframe_coalesce_fail;
@ -1602,7 +1602,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, s
/* DBG_871X("%s, action frame category=%d\n", __func__, pframe[WLAN_HDR_A3_LEN]); */
/* according 802.11-2012 standard, these five types are not robust types */
if(subtype == WIFI_ACTION &&
if (subtype == WIFI_ACTION &&
(pframe[WLAN_HDR_A3_LEN] == RTW_WLAN_CATEGORY_PUBLIC ||
pframe[WLAN_HDR_A3_LEN] == RTW_WLAN_CATEGORY_HT ||
pframe[WLAN_HDR_A3_LEN] == RTW_WLAN_CATEGORY_UNPROTECTED_WNM ||
@ -1749,7 +1749,7 @@ void rtw_update_protection(struct adapter *padapter, u8 *ie, uint ie_len)
case AUTO_VCS:
default:
perp = rtw_get_ie(ie, _ERPINFO_IE_, &erp_len, ie_len);
if(perp == NULL)
if (perp == NULL)
{
pxmitpriv->vcs = NONE_VCS;
}
@ -1758,7 +1758,7 @@ void rtw_update_protection(struct adapter *padapter, u8 *ie, uint ie_len)
protection = (*(perp + 2)) & BIT(1);
if (protection)
{
if(pregistrypriv->vcs_type == RTS_CTS)
if (pregistrypriv->vcs_type == RTS_CTS)
pxmitpriv->vcs = RTS_CTS;
else
pxmitpriv->vcs = CTS_TO_SELF;
@ -1804,7 +1804,7 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv)
spin_lock_irqsave(&pfree_queue->lock, flags);
if(_rtw_queue_empty(pfree_queue) == true) {
if (_rtw_queue_empty(pfree_queue) == true) {
pxmitbuf = NULL;
} else {
@ -1845,7 +1845,7 @@ s32 rtw_free_xmitbuf_ext(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)
struct __queue *pfree_queue = &pxmitpriv->free_xmit_extbuf_queue;
unsigned long flags;
if(pxmitbuf==NULL)
if (pxmitbuf==NULL)
return _FAIL;
spin_lock_irqsave(&pfree_queue->lock, flags);
@ -1876,7 +1876,7 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv)
spin_lock_irqsave(&pfree_xmitbuf_queue->lock, flags);
if(_rtw_queue_empty(pfree_xmitbuf_queue) == true) {
if (_rtw_queue_empty(pfree_xmitbuf_queue) == true) {
pxmitbuf = NULL;
} else {
@ -1921,7 +1921,7 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)
struct __queue *pfree_xmitbuf_queue = &pxmitpriv->free_xmitbuf_queue;
unsigned long flags;
if(pxmitbuf==NULL)
if (pxmitbuf==NULL)
return _FAIL;
if (pxmitbuf->sctx) {
@ -1929,7 +1929,7 @@ s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)
rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_FREE);
}
if(pxmitbuf->ext_tag) {
if (pxmitbuf->ext_tag) {
rtw_free_xmitbuf_ext(pxmitpriv, pxmitbuf);
} else {
spin_lock_irqsave(&pfree_xmitbuf_queue->lock, flags);
@ -2110,7 +2110,7 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram
if (pxmitframe->ext_tag == 0)
queue = &pxmitpriv->free_xmit_queue;
else if(pxmitframe->ext_tag == 1)
else if (pxmitframe->ext_tag == 1)
queue = &pxmitpriv->free_xframe_ext_queue;
else
{}
@ -2122,7 +2122,7 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram
if (pxmitframe->ext_tag == 0) {
pxmitpriv->free_xmitframe_cnt++;
RT_TRACE(_module_rtl871x_xmit_c_, _drv_debug_, ("rtw_free_xmitframe():free_xmitframe_cnt=%d\n", pxmitpriv->free_xmitframe_cnt));
} else if(pxmitframe->ext_tag == 1) {
} else if (pxmitframe->ext_tag == 1) {
pxmitpriv->free_xframe_ext_cnt++;
RT_TRACE(_module_rtl871x_xmit_c_, _drv_debug_, ("rtw_free_xmitframe():free_xframe_ext_cnt=%d\n", pxmitpriv->free_xframe_ext_cnt));
} else {
@ -2132,7 +2132,7 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram
check_pkt_complete:
if(pndis_pkt)
if (pndis_pkt)
rtw_os_pkt_complete(padapter, pndis_pkt);
exit:
@ -2220,7 +2220,7 @@ struct xmit_frame* rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi
inx[0] = 0; inx[1] = 1; inx[2] = 2; inx[3] = 3;
if(pregpriv->wifi_spec==1)
if (pregpriv->wifi_spec==1)
{
int j, tmp, acirp_cnt[4];
for(j=0; j<4; j++)
@ -2245,11 +2245,11 @@ struct xmit_frame* rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi
pxmitframe = dequeue_one_xmitframe(pxmitpriv, phwxmit, ptxservq, pframe_queue);
if(pxmitframe) {
if (pxmitframe) {
phwxmit->accnt--;
/* Remove sta node when there is no pending packets. */
if(_rtw_queue_empty(pframe_queue)) /* must be done after get_next and before break */
if (_rtw_queue_empty(pframe_queue)) /* must be done after get_next and before break */
rtw_list_delete(&ptxservq->tx_pending);
goto exit;
}
@ -2342,7 +2342,7 @@ s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmitframe)
goto exit;
}
if(!(psta->state &_FW_LINKED))
if (!(psta->state &_FW_LINKED))
{
DBG_871X("%s, psta->state(0x%x) != _FW_LINKED\n", __func__, psta->state);
return _FAIL;
@ -2374,7 +2374,7 @@ void rtw_alloc_hwxmits(struct adapter *padapter)
hwxmits = pxmitpriv->hwxmits;
if(pxmitpriv->hwxmit_entry == 5)
if (pxmitpriv->hwxmit_entry == 5)
{
/* pxmitpriv->bmc_txqueue.head = 0; */
/* hwxmits[0] .phwtxqueue = &pxmitpriv->bmc_txqueue; */
@ -2397,7 +2397,7 @@ void rtw_alloc_hwxmits(struct adapter *padapter)
hwxmits[4] .sta_queue = &pxmitpriv->be_pending;
}
else if(pxmitpriv->hwxmit_entry == 4)
else if (pxmitpriv->hwxmit_entry == 4)
{
/* pxmitpriv->vo_txqueue.head = 0; */
@ -2431,7 +2431,7 @@ void rtw_free_hwxmits(struct adapter *padapter)
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
hwxmits = pxmitpriv->hwxmits;
if(hwxmits)
if (hwxmits)
rtw_mfree((u8 *)hwxmits, (sizeof (struct hw_xmit) * pxmitpriv->hwxmit_entry));
}
@ -2454,7 +2454,7 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb)
{
struct sk_buff *skb = *pskb;
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
/* if(check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true) */
/* if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) == true) */
{
int res, is_vlan_tag=0, i, do_nat25=1;
unsigned short vlan_hdr=0;
@ -2702,7 +2702,7 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)
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)
{
res = rtw_br_client_tx(padapter, ppkt);
if (res == -1)
@ -2732,7 +2732,7 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)
#ifdef CONFIG_AP_MODE
spin_lock_bh(&pxmitpriv->lock);
if(xmitframe_enqueue_for_sleeping_sta(padapter, pxmitframe) == true)
if (xmitframe_enqueue_for_sleeping_sta(padapter, pxmitframe) == true)
{
spin_unlock_bh(&pxmitpriv->lock);
return 1;
@ -2760,7 +2760,7 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == false)
return ret;
if(pattrib->psta)
if (pattrib->psta)
{
psta = pattrib->psta;
}
@ -2770,25 +2770,25 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr
psta=rtw_get_stainfo(pstapriv, pattrib->ra);
}
if(psta==NULL)
if (psta==NULL)
{
DBG_871X("%s, psta==NUL\n", __func__);
return false;
}
if(!(psta->state &_FW_LINKED))
if (!(psta->state &_FW_LINKED))
{
DBG_871X("%s, psta->state(0x%x) != _FW_LINKED\n", __func__, psta->state);
return false;
}
if(pattrib->triggered==1)
if (pattrib->triggered==1)
{
/* DBG_871X("directly xmit pspoll_triggered packet\n"); */
/* pattrib->triggered=0; */
if(bmcst)
if (bmcst)
pattrib->qsel = 0x11;/* HIQ */
@ -2796,11 +2796,11 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr
}
if(bmcst)
if (bmcst)
{
spin_lock_bh(&psta->sleep_q.lock);
if(pstapriv->sta_dz_bitmap)/* if anyone sta is in ps mode */
if (pstapriv->sta_dz_bitmap)/* if anyone sta is in ps mode */
{
rtw_list_delete(&pxmitframe->list);
@ -2824,11 +2824,11 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr
spin_lock_bh(&psta->sleep_q.lock);
if(psta->state&WIFI_SLEEP_STATE)
if (psta->state&WIFI_SLEEP_STATE)
{
u8 wmmps_ac=0;
if(pstapriv->sta_dz_bitmap&BIT(psta->aid))
if (pstapriv->sta_dz_bitmap&BIT(psta->aid))
{
rtw_list_delete(&pxmitframe->list);
@ -2859,16 +2859,16 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr
break;
}
if(wmmps_ac)
if (wmmps_ac)
psta->sleepq_ac_len++;
if(((psta->has_legacy_ac) && (!wmmps_ac)) ||((!psta->has_legacy_ac)&&(wmmps_ac)))
if (((psta->has_legacy_ac) && (!wmmps_ac)) ||((!psta->has_legacy_ac)&&(wmmps_ac)))
{
pstapriv->tim_bitmap |= BIT(psta->aid);
/* DBG_871X("enqueue, sq_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap); */
if(psta->sleepq_len==1)
if (psta->sleepq_len==1)
{
/* DBG_871X("sleepq_len==1, update BCNTIM\n"); */
/* upate BCN for TIM IE */
@ -2878,7 +2878,7 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr
/* spin_unlock_bh(&psta->sleep_q.lock); */
/* if(psta->sleepq_len > (NR_XMITFRAME>>3)) */
/* if (psta->sleepq_len > (NR_XMITFRAME>>3)) */
/* */
/* wakeup_sta_to_xmit(padapter, psta); */
/* */
@ -2916,7 +2916,7 @@ static void dequeue_xmitframes_to_sleeping_queue(struct adapter *padapter, struc
ret = xmitframe_enqueue_for_sleeping_sta(padapter, pxmitframe);
if(true == ret)
if (true == ret)
{
pattrib = &pxmitframe->attrib;
@ -3023,15 +3023,15 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
}
psta->sleepq_len--;
if(psta->sleepq_len>0)
if (psta->sleepq_len>0)
pxmitframe->attrib.mdata = 1;
else
pxmitframe->attrib.mdata = 0;
if(wmmps_ac)
if (wmmps_ac)
{
psta->sleepq_ac_len--;
if(psta->sleepq_ac_len>0)
if (psta->sleepq_ac_len>0)
{
pxmitframe->attrib.mdata = 1;
pxmitframe->attrib.eosp = 0;
@ -3047,7 +3047,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
/*
spin_unlock_bh(&psta->sleep_q.lock);
if(rtw_hal_xmit(padapter, pxmitframe) == true)
if (rtw_hal_xmit(padapter, pxmitframe) == true)
{
rtw_os_xmit_complete(padapter, pxmitframe);
}
@ -3059,10 +3059,10 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
}
/* for BC/MC Frames */
if(!psta_bmc)
if (!psta_bmc)
goto _exit;
if((pstapriv->sta_dz_bitmap&0xfffe) == 0x0)/* no any sta in ps mode */
if ((pstapriv->sta_dz_bitmap&0xfffe) == 0x0)/* no any sta in ps mode */
{
xmitframe_phead = get_list_head(&psta_bmc->sleep_q);
xmitframe_plist = get_next(xmitframe_phead);
@ -3076,7 +3076,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
rtw_list_delete(&pxmitframe->list);
psta_bmc->sleepq_len--;
if(psta_bmc->sleepq_len>0)
if (psta_bmc->sleepq_len>0)
pxmitframe->attrib.mdata = 1;
else
pxmitframe->attrib.mdata = 0;
@ -3085,7 +3085,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
pxmitframe->attrib.triggered = 1;
/*
spin_unlock_bh(&psta_bmc->sleep_q.lock);
if(rtw_hal_xmit(padapter, pxmitframe) == true)
if (rtw_hal_xmit(padapter, pxmitframe) == true)
{
rtw_os_xmit_complete(padapter, pxmitframe);
}
@ -3096,7 +3096,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
}
if(psta_bmc->sleepq_len==0)
if (psta_bmc->sleepq_len==0)
{
pstapriv->tim_bitmap &= ~BIT(0);
pstapriv->sta_dz_bitmap &= ~BIT(0);
@ -3109,7 +3109,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
}
if(psta->sleepq_len==0)
if (psta->sleepq_len==0)
{
pstapriv->tim_bitmap &= ~BIT(psta->aid);
@ -3118,10 +3118,10 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
/* update_BCNTIM(padapter); */
update_mask = BIT(0);
if(psta->state&WIFI_SLEEP_STATE)
if (psta->state&WIFI_SLEEP_STATE)
psta->state ^= WIFI_SLEEP_STATE;
if(psta->state & WIFI_STA_ALIVE_CHK_STATE)
if (psta->state & WIFI_STA_ALIVE_CHK_STATE)
{
psta->expire_to = pstapriv->expire_to;
psta->state ^= WIFI_STA_ALIVE_CHK_STATE;
@ -3135,7 +3135,7 @@ _exit:
/* spin_unlock_bh(&psta_bmc->sleep_q.lock); */
spin_unlock_bh(&pxmitpriv->lock);
if(update_mask)
if (update_mask)
{
/* update_BCNTIM(padapter); */
/* printk("%s => call update_beacon\n",__FUNCTION__); */
@ -3185,7 +3185,7 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst
break;
}
if(!wmmps_ac)
if (!wmmps_ac)
continue;
rtw_list_delete(&pxmitframe->list);
@ -3193,7 +3193,7 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst
psta->sleepq_len--;
psta->sleepq_ac_len--;
if(psta->sleepq_ac_len>0) {
if (psta->sleepq_ac_len>0) {
pxmitframe->attrib.mdata = 1;
pxmitframe->attrib.eosp = 0;
} else {
@ -3205,7 +3205,7 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst
rtw_hal_xmitframe_enqueue(padapter, pxmitframe);
if((psta->sleepq_ac_len==0) && (!psta->has_legacy_ac) && (wmmps_ac))
if ((psta->sleepq_ac_len==0) && (!psta->has_legacy_ac) && (wmmps_ac))
{
pstapriv->tim_bitmap &= ~BIT(psta->aid);

View file

@ -113,7 +113,7 @@ odm_SetTxRPTTiming_8188E(
u8 idx = 0;
for(idx=0; idx<5; idx++)
if(DynamicTxRPTTiming[idx] == pRaInfo->RptTime)
if (DynamicTxRPTTiming[idx] == pRaInfo->RptTime)
break;
if (extend==0) /* back to default timing */
@ -124,7 +124,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];
@ -142,7 +142,7 @@ odm_RateDown_8188E(
u8 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;
@ -158,7 +158,7 @@ odm_RateDown_8188E(
{
RateID=HighestRate;
}
else if(pRaInfo->RateSGI)
else if (pRaInfo->RateSGI)
{
pRaInfo->RateSGI=0;
}
@ -186,14 +186,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;
@ -215,7 +215,7 @@ odm_RateUp_8188E(
u8 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;
@ -247,21 +247,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++;
@ -351,7 +351,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))
@ -428,7 +428,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;
}
@ -441,7 +441,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;
@ -455,9 +455,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;
@ -466,7 +466,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,
@ -515,7 +515,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;
@ -554,7 +554,7 @@ odm_PTDecision_8188E(
for(j=0;j<=4;j++)
{
numsc += pRaInfo->RTY[j] * PT_PENALTY[j];
if(numsc>num_total)
if (numsc>num_total)
break;
}
@ -588,7 +588,7 @@ 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));
rtw_rpt_timer_cfg_cmd(pDM_Odm->Adapter,minRptTime);
@ -622,16 +622,16 @@ ODM_RAInfo_Init(
PODM_RA_INFO_T pRaInfo = &pDM_Odm->RAInfo[MacID];
u8 WirelessMode=0xFF; /* invalid value */
u8 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;
}
@ -702,7 +702,7 @@ ODM_RA_GetShortGI_8188E(
u8 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));
@ -717,7 +717,7 @@ ODM_RA_GetDecisionRate_8188E(
{
u8 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,
@ -732,7 +732,7 @@ ODM_RA_GetHwPwrStatus_8188E(
)
{
u8 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,
@ -754,7 +754,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]);
@ -775,7 +775,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]);
@ -815,15 +815,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)
{
pRAInfo->RTY[0] = (u16)GET_TX_REPORT_TYPE1_RERTY_0(pBuffer);
@ -839,7 +839,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",
@ -855,10 +855,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 */
@ -895,7 +895,7 @@ 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;

View file

@ -63,11 +63,11 @@ u8 ODM_GetRightChnlPlaceforIQK(u8 chnl)
u8 place = chnl;
if(chnl > 14)
if (chnl > 14)
{
for(place = 14; place<sizeof(channel_all); place++)
{
if(channel_all[place] == chnl)
if (channel_all[place] == chnl)
{
return place-13;
}

View file

@ -31,14 +31,14 @@
do {\
for(_offset = 0; _offset < _size; _offset++)\
{\
if(_deltaThermal < thermalThreshold[_direction][_offset])\
if (_deltaThermal < thermalThreshold[_direction][_offset])\
{\
if(_offset != 0)\
if (_offset != 0)\
_offset--;\
break;\
}\
} \
if(_offset >= _size)\
if (_offset >= _size)\
_offset = _size-1;\
} while(0)
@ -57,14 +57,14 @@ static void setIqkMatrix(
/* printk("%s==> OFDM_index:%d\n",__FUNCTION__,OFDM_index); */
/* if(OFDM_index> OFDM_TABLE_SIZE_92D) */
/* if (OFDM_index> OFDM_TABLE_SIZE_92D) */
/* */
/* printk("%s==> OFDM_index> 43\n",__FUNCTION__); */
/* */
ele_D = (OFDMSwingTable[OFDM_index] & 0xFFC00000)>>22;
/* new element A = element D x X */
if((IqkResult_X != 0) && (*(pDM_Odm->pBandType) == ODM_BAND_2_4G))
if ((IqkResult_X != 0) && (*(pDM_Odm->pBandType) == ODM_BAND_2_4G))
{
if ((IqkResult_X & 0x00000200) != 0) /* consider minus */
IqkResult_X = IqkResult_X | 0xFFFFFC00;
@ -290,7 +290,7 @@ odm_TxPwrTrackSetPwr88E(
}
else if (Method == BBSWING)
{
if(* (pDM_Odm->pChannel) < 14)
if (* (pDM_Odm->pChannel) < 14)
{
ODM_Write1Byte(pDM_Odm, 0xa22, CCKSwingTable_Ch1_Ch13[pDM_Odm->BbSwingIdxCck][0]);
ODM_Write1Byte(pDM_Odm, 0xa23, CCKSwingTable_Ch1_Ch13[pDM_Odm->BbSwingIdxCck][1]);
@ -386,13 +386,13 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
/* 4 3. Initialize ThermalValues of RFCalibrateInfo */
if( ! pDM_Odm->RFCalibrateInfo.ThermalValue)
if ( ! pDM_Odm->RFCalibrateInfo.ThermalValue)
{
pDM_Odm->RFCalibrateInfo.ThermalValue_LCK = ThermalValue;
pDM_Odm->RFCalibrateInfo.ThermalValue_IQK = ThermalValue;
}
if(pDM_Odm->RFCalibrateInfo.bReloadtxpowerindex)
if (pDM_Odm->RFCalibrateInfo.bReloadtxpowerindex)
{
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("reload ofdm index for band switch\n"));
}
@ -401,19 +401,19 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
pDM_Odm->RFCalibrateInfo.ThermalValue_AVG[pDM_Odm->RFCalibrateInfo.ThermalValue_AVG_index] = ThermalValue;
pDM_Odm->RFCalibrateInfo.ThermalValue_AVG_index++;
if(pDM_Odm->RFCalibrateInfo.ThermalValue_AVG_index == AVG_THERMAL_NUM_88E)
if (pDM_Odm->RFCalibrateInfo.ThermalValue_AVG_index == AVG_THERMAL_NUM_88E)
pDM_Odm->RFCalibrateInfo.ThermalValue_AVG_index = 0;
for(i = 0; i < AVG_THERMAL_NUM_88E; i++)
{
if(pDM_Odm->RFCalibrateInfo.ThermalValue_AVG[i])
if (pDM_Odm->RFCalibrateInfo.ThermalValue_AVG[i])
{
ThermalValue_AVG += pDM_Odm->RFCalibrateInfo.ThermalValue_AVG[i];
ThermalValue_AVG_count++;
}
}
if(ThermalValue_AVG_count)
if (ThermalValue_AVG_count)
{
ThermalValue = (u8)(ThermalValue_AVG / ThermalValue_AVG_count);
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("AVG Thermal Meter = 0x%x\n", ThermalValue));
@ -427,7 +427,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
/* 4 6. If necessary, do LCK. */
/* if((delta_LCK > pHalData->Delta_LCK) && (pHalData->Delta_LCK != 0)) */
/* if ((delta_LCK > pHalData->Delta_LCK) && (pHalData->Delta_LCK != 0)) */
if ((delta_LCK >= 8)) /* Delta temperature is equal to or larger than 20 centigrade. */
{
pDM_Odm->RFCalibrateInfo.ThermalValue_LCK = ThermalValue;
@ -442,7 +442,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
/* 4 7.1 The Final Power Index = BaseIndex + PowerIndexOffset */
if(ThermalValue > pHalData->EEPROMThermalMeter) {
if (ThermalValue > pHalData->EEPROMThermalMeter) {
CALCULATE_SWINGTALBE_OFFSET(offset, POWER_INC, index_mapping_NUM_88E, delta);
pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex;
pDM_Odm->RFCalibrateInfo.DeltaPowerIndex = -1 * deltaSwingTableIdx[POWER_INC][offset];
@ -473,7 +473,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
for(i = 0; i < rf; i++) {
if(pDM_Odm->RFCalibrateInfo.OFDM_index[i] > OFDM_TABLE_SIZE_92D-1)
if (pDM_Odm->RFCalibrateInfo.OFDM_index[i] > OFDM_TABLE_SIZE_92D-1)
{
pDM_Odm->RFCalibrateInfo.OFDM_index[i] = OFDM_TABLE_SIZE_92D-1;
}
@ -483,7 +483,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
}
}
if(pDM_Odm->RFCalibrateInfo.CCK_index > CCK_TABLE_SIZE-1)
if (pDM_Odm->RFCalibrateInfo.CCK_index > CCK_TABLE_SIZE-1)
pDM_Odm->RFCalibrateInfo.CCK_index = CCK_TABLE_SIZE-1;
} else {
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
@ -528,7 +528,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
{
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("Temperature(%d) lower than PG value(%d), increases the power by TxAGC\n", ThermalValue, pHalData->EEPROMThermalMeter));
odm_TxPwrTrackSetPwr88E(pDM_Odm, BBSWING, RF_PATH_A, Indexforchannel);
/* if(is2T) */
/* if (is2T) */
/* odm_TxPwrTrackSetPwr88E(pDM_Odm, BBSWING, RF_PATH_B, Indexforchannel); */
}
@ -538,7 +538,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
}
/* if((delta_IQK > pHalData->Delta_IQK) && (pHalData->Delta_IQK != 0)) */
/* if ((delta_IQK > pHalData->Delta_IQK) && (pHalData->Delta_IQK != 0)) */
if ((delta_IQK >= 8)){ /* Delta temperature is equal to or larger than 20 centigrade. */
/* printk("delta_IQK(%d) >=8 do_IQK\n",delta_IQK); */
doIQK(pDM_Odm, delta_IQK, ThermalValue, 8);
@ -602,7 +602,7 @@ phy_PathA_IQK_8188E(
regEA4= ODM_GetBBReg(pDM_Odm, rRx_Power_Before_IQK_A_2, bMaskDWord);
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xea4 = 0x%x\n", regEA4));
if(!(regEAC & BIT28) &&
if (!(regEAC & BIT28) &&
(((regE94 & 0x03FF0000)>>16) != 0x142) &&
(((regE9C & 0x03FF0000)>>16) != 0x42) )
result |= 0x01;
@ -671,7 +671,7 @@ phy_PathA_RxIQK(
regE9C= ODM_GetBBReg(pDM_Odm, rTx_Power_After_IQK_A, bMaskDWord);
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe9c = 0x%x\n", regE9C));
if(!(regEAC & BIT28) &&
if (!(regEAC & BIT28) &&
(((regE94 & 0x03FF0000)>>16) != 0x142) &&
(((regE9C & 0x03FF0000)>>16) != 0x42) )
{
@ -738,7 +738,7 @@ phy_PathA_RxIQK(
ODM_SetBBReg(pDM_Odm, rFPGA0_IQK, bMaskDWord, 0x00000000);
ODM_SetRFReg(pDM_Odm, RF_PATH_A, 0xdf, bRFRegOffsetMask, 0x180 );
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;
@ -781,14 +781,14 @@ phy_PathB_IQK_8188E(
regECC= ODM_GetBBReg(pDM_Odm, rRx_Power_After_IQK_B_2, bMaskDWord);
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("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;
@ -815,10 +815,10 @@ _PHY_PathAFillIQKMatrix(
PDM_ODM_T pDM_Odm = &pHalData->odmpriv;
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("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 = (ODM_GetBBReg(pDM_Odm, rOFDM0_XATxIQImbalance, bMaskDWord) >> 22) & 0x3FF;
@ -843,7 +843,7 @@ _PHY_PathAFillIQKMatrix(
ODM_SetBBReg(pDM_Odm, rOFDM0_ECCAThreshold, BIT(29), ((Y* Oldval_0>>7) & 0x1));
if(bTxOnly)
if (bTxOnly)
{
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("_PHY_PathAFillIQKMatrix only Tx OK\n"));
return;
@ -875,10 +875,10 @@ _PHY_PathBFillIQKMatrix(
PDM_ODM_T pDM_Odm = &pHalData->odmpriv;
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("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 = (ODM_GetBBReg(pDM_Odm, rOFDM0_XBTxIQImbalance, bMaskDWord) >> 22) & 0x3FF;
@ -902,7 +902,7 @@ _PHY_PathBFillIQKMatrix(
ODM_SetBBReg(pDM_Odm, rOFDM0_ECCAThreshold, BIT(25), ((Y* Oldval_1>>7) & 0x1));
if(bTxOnly)
if (bTxOnly)
return;
reg = result[final_candidate][6];
@ -1022,7 +1022,7 @@ _PHY_PathADDAOn(
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("ADDA ON.\n"));
pathOn = isPathAOn ? 0x04db25a4 : 0x0b1b25a4;
if(false == is2T){
if (false == is2T){
pathOn = 0x0bdb25a0;
ODM_SetBBReg(pDM_Odm, ADDAReg[0], bMaskDWord, 0x0b1b25a0);
}
@ -1106,12 +1106,12 @@ phy_SimularityCompare_8188E(
bool is2T;
s32 tmp1 = 0,tmp2 = 0;
if( (pDM_Odm->RFType ==ODM_2T2R )||(pDM_Odm->RFType ==ODM_2T3R )||(pDM_Odm->RFType ==ODM_2T4R ))
if ( (pDM_Odm->RFType ==ODM_2T2R )||(pDM_Odm->RFType ==ODM_2T3R )||(pDM_Odm->RFType ==ODM_2T4R ))
is2T = true;
else
is2T = false;
if(is2T)
if (is2T)
bound = 8;
else
bound = 4;
@ -1126,14 +1126,14 @@ phy_SimularityCompare_8188E(
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((i==1) || (i==3) || (i==5) || (i==7))
if ((i==1) || (i==3) || (i==5) || (i==7))
{
if((result[c1][i]& 0x00000200) != 0)
if ((result[c1][i]& 0x00000200) != 0)
tmp1 = result[c1][i] | 0xFFFFFC00;
else
tmp1 = result[c1][i];
if((result[c2][i]& 0x00000200) != 0)
if ((result[c2][i]& 0x00000200) != 0)
tmp2 = result[c2][i] | 0xFFFFFC00;
else
tmp2 = result[c2][i];
@ -1150,9 +1150,9 @@ phy_SimularityCompare_8188E(
{
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK:phy_SimularityCompare_8188E differnece overflow index %d compare1 0x%x compare2 0x%x!!!\n", i, result[c1][i], result[c2][i]));
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;
@ -1170,7 +1170,7 @@ phy_SimularityCompare_8188E(
{
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++)
result[3][j] = result[final_candidate[i]][j];
@ -1256,7 +1256,7 @@ else
/* Note: IQ calibration must be performed after loading */
/* PHY_REG.txt , and radio_a, radio_b.txt */
if(t==0) {
if (t==0) {
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQ Calibration for %s for %d times\n", (is2T ? "2T2R" : "1T1R"), t));
/* Save ADDA parameters, turn Path A ADDA on */
@ -1268,11 +1268,11 @@ else
_PHY_PathADDAOn(pAdapter, ADDA_REG, true, is2T);
if(t==0) {
if (t==0) {
pDM_Odm->RFCalibrateInfo.bRfPiEnable = (u8)ODM_GetBBReg(pDM_Odm, rFPGA0_XA_HSSIParameter1, BIT(8));
}
if(!pDM_Odm->RFCalibrateInfo.bRfPiEnable){
if (!pDM_Odm->RFCalibrateInfo.bRfPiEnable){
/* Switch BB to PI mode to do IQ Calibration. */
_PHY_PIModeSwitch(pAdapter, true);
}
@ -1290,7 +1290,7 @@ else
ODM_SetBBReg(pDM_Odm, rFPGA0_XB_RFInterfaceOE, BIT10, 0x00);
if(is2T)
if (is2T)
{
ODM_SetBBReg(pDM_Odm, rFPGA0_XA_LSSIParameter, bMaskDWord, 0x00010000);
ODM_SetBBReg(pDM_Odm, rFPGA0_XB_LSSIParameter, bMaskDWord, 0x00010000);
@ -1303,7 +1303,7 @@ else
/* AP or IQK */
ODM_SetBBReg(pDM_Odm, rConfig_AntA, bMaskDWord, 0x0f600000);
if(is2T)
if (is2T)
{
ODM_SetBBReg(pDM_Odm, rConfig_AntB, bMaskDWord, 0x0f600000);
}
@ -1316,7 +1316,7 @@ else
for(i = 0 ; i < retryCount ; i++){
PathAOK = phy_PathA_IQK_8188E(pAdapter, is2T);
if(PathAOK == 0x01){
if (PathAOK == 0x01){
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A Tx IQK Success!!\n"));
result[t][0] = (ODM_GetBBReg(pDM_Odm, rTx_Power_Before_IQK_A, bMaskDWord)&0x3FF0000)>>16;
result[t][1] = (ODM_GetBBReg(pDM_Odm, rTx_Power_After_IQK_A, bMaskDWord)&0x3FF0000)>>16;
@ -1326,7 +1326,7 @@ else
for(i = 0 ; i < retryCount ; i++){
PathAOK = phy_PathA_RxIQK(pAdapter, is2T);
if(PathAOK == 0x03){
if (PathAOK == 0x03){
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A Rx IQK Success!!\n"));
result[t][2] = (ODM_GetBBReg(pDM_Odm, rRx_Power_Before_IQK_A_2, bMaskDWord)&0x3FF0000)>>16;
result[t][3] = (ODM_GetBBReg(pDM_Odm, rRx_Power_After_IQK_A_2, bMaskDWord)&0x3FF0000)>>16;
@ -1336,11 +1336,11 @@ else
}
}
if(0x00 == PathAOK){
if (0x00 == PathAOK){
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A IQK failed!!\n"));
}
if(is2T){
if (is2T){
_PHY_PathAStandBy(pAdapter);
/* Turn Path B ADDA on */
@ -1348,7 +1348,7 @@ else
for(i = 0 ; i < retryCount ; i++){
PathBOK = phy_PathB_IQK_8188E(pAdapter);
if(PathBOK == 0x03){
if (PathBOK == 0x03){
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B IQK Success!!\n"));
result[t][4] = (ODM_GetBBReg(pDM_Odm, rTx_Power_Before_IQK_B, bMaskDWord)&0x3FF0000)>>16;
result[t][5] = (ODM_GetBBReg(pDM_Odm, rTx_Power_After_IQK_B, bMaskDWord)&0x3FF0000)>>16;
@ -1364,7 +1364,7 @@ else
}
}
if(0x00 == PathBOK){
if (0x00 == PathBOK){
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B IQK failed!!\n"));
}
}
@ -1373,8 +1373,8 @@ else
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK:Back to BB mode, load original value!\n"));
ODM_SetBBReg(pDM_Odm, rFPGA0_IQK, bMaskDWord, 0);
if(t!=0) {
if(!pDM_Odm->RFCalibrateInfo.bRfPiEnable){
if (t!=0) {
if (!pDM_Odm->RFCalibrateInfo.bRfPiEnable){
/* Switch back BB to SI mode after finish IQ Calibration. */
_PHY_PIModeSwitch(pAdapter, false);
}
@ -1390,7 +1390,7 @@ else
/* Restore RX initial gain */
ODM_SetBBReg(pDM_Odm, rFPGA0_XA_LSSIParameter, bMaskDWord, 0x00032ed3);
if(is2T){
if (is2T){
ODM_SetBBReg(pDM_Odm, rFPGA0_XB_LSSIParameter, bMaskDWord, 0x00032ed3);
}
@ -1418,19 +1418,19 @@ phy_LCCalibrate_8188E(
/* Check continuous TX and Packet TX */
tmpReg = ODM_Read1Byte(pDM_Odm, 0xd03);
if((tmpReg&0x70) != 0) /* Deal with contisuous TX case */
if ((tmpReg&0x70) != 0) /* Deal with contisuous TX case */
ODM_Write1Byte(pDM_Odm, 0xd03, tmpReg&0x8F); /* disable all continuous TX */
else /* Deal with Packet TX case */
ODM_Write1Byte(pDM_Odm, 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 */
@ -1438,7 +1438,7 @@ phy_LCCalibrate_8188E(
ODM_SetRFReg(pDM_Odm, RF_PATH_A, RF_AC, bMask12Bits, (RF_Amode&0x8FFFF)|0x10000);
/* Path-B */
if(is2T)
if (is2T)
ODM_SetRFReg(pDM_Odm, RF_PATH_B, RF_AC, bMask12Bits, (RF_Bmode&0x8FFFF)|0x10000);
}
@ -1452,14 +1452,14 @@ phy_LCCalibrate_8188E(
/* Restore original situation */
if((tmpReg&0x70) != 0) /* Deal with contisuous TX case */
if ((tmpReg&0x70) != 0) /* Deal with contisuous TX case */
{
/* Path-A */
ODM_Write1Byte(pDM_Odm, 0xd03, tmpReg);
ODM_SetRFReg(pDM_Odm, RF_PATH_A, RF_AC, bMask12Bits, RF_Amode);
/* Path-B */
if(is2T)
if (is2T)
ODM_SetRFReg(pDM_Odm, RF_PATH_B, RF_AC, bMask12Bits, RF_Bmode);
}
else /* Deal with Packet TX case */
@ -1586,7 +1586,7 @@ if ( *(pDM_Odm->mp_mode) == 1)
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("==>phy_APCalibrate_8188E() delta %d\n", delta));
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("AP Calibration for %s\n", (is2T ? "2T2R" : "1T1R")));
if(!is2T)
if (!is2T)
pathbound = 1;
/* 2 FOR NORMAL CHIP SETTINGS */
@ -1616,7 +1616,7 @@ if ( *(pDM_Odm->mp_mode) == 1)
/* save BB default value */
for(index = 0; index < APK_BB_REG_NUM ; index++) {
if(index == 0) /* skip */
if (index == 0) /* skip */
continue;
BB_backup[index] = ODM_GetBBReg(pDM_Odm, BB_REG[index], bMaskDWord);
}
@ -1631,7 +1631,7 @@ if ( *(pDM_Odm->mp_mode) == 1)
{
if(path == RF_PATH_A)
if (path == RF_PATH_A)
{
/* path A APK */
/* load APK setting */
@ -1670,7 +1670,7 @@ if ( *(pDM_Odm->mp_mode) == 1)
}
ODM_SetBBReg(pDM_Odm, rFPGA0_IQK, bMaskDWord, 0x00000000);
}
else if(path == RF_PATH_B)
else if (path == RF_PATH_B)
{
/* path B APK */
/* load APK setting */
@ -1720,12 +1720,12 @@ if ( *(pDM_Odm->mp_mode) == 1)
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("phy_APCalibrate_8188E() offset 0xe70 %x\n", ODM_GetBBReg(pDM_Odm, rRx_Wait_CCA, bMaskDWord)));
/* BB to AP mode */
if(path == 0)
if (path == 0)
{
for(index = 0; index < APK_BB_REG_NUM ; index++)
{
if(index == 0) /* skip */
if (index == 0) /* skip */
continue;
else if (index < 5)
ODM_SetBBReg(pDM_Odm, BB_REG[index], bMaskDWord, BB_AP_MODE[index]);
@ -1750,7 +1750,7 @@ if ( *(pDM_Odm->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 */
{
ODM_SetRFReg(pDM_Odm, RF_PATH_B, RF_AC, bMaskDWord, 0x10000);
}
@ -1762,7 +1762,7 @@ if ( *(pDM_Odm->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;
@ -1770,15 +1770,15 @@ if ( *(pDM_Odm->mp_mode) == 1)
/* AP calibration */
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(!pDM_Odm->RFCalibrateInfo.bAPKThermalMeterIgnore)
if (!pDM_Odm->RFCalibrateInfo.bAPKThermalMeterIgnore)
{
BB_offset = (tmpReg & 0xF0000) >> 16;
if(!(tmpReg & BIT15)) /* sign bit 0 */
if (!(tmpReg & BIT15)) /* sign bit 0 */
{
BB_offset = -BB_offset;
}
@ -1789,7 +1789,7 @@ if ( *(pDM_Odm->mp_mode) == 1)
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("phy_APCalibrate_8188E() 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;
@ -1824,7 +1824,7 @@ if ( *(pDM_Odm->mp_mode) == 1)
}
ODM_SetBBReg(pDM_Odm, rFPGA0_IQK, bMaskDWord, 0x00000000);
if(path == RF_PATH_A)
if (path == RF_PATH_A)
tmpReg = ODM_GetBBReg(pDM_Odm, rAPK, 0x03E00000);
else
tmpReg = ODM_GetBBReg(pDM_Odm, rAPK, 0xF8000000);
@ -1846,7 +1846,7 @@ if ( *(pDM_Odm->mp_mode) == 1)
for(index = 0; index < APK_BB_REG_NUM ; index++)
{
if(index == 0) /* skip */
if (index == 0) /* skip */
continue;
ODM_SetBBReg(pDM_Odm, BB_REG[index], bMaskDWord, BB_backup[index]);
}
@ -1858,7 +1858,7 @@ if ( *(pDM_Odm->mp_mode) == 1)
for(path = 0; path < pathbound; path++)
{
ODM_SetRFReg(pDM_Odm, path, 0xd, bMaskDWord, regD[path]);
if(path == RF_PATH_B)
if (path == RF_PATH_B)
{
ODM_SetRFReg(pDM_Odm, RF_PATH_A, RF_MODE1, bMaskDWord, 0x1000f);
ODM_SetRFReg(pDM_Odm, RF_PATH_A, RF_MODE2, bMaskDWord, 0x20101);
@ -1877,13 +1877,13 @@ if ( *(pDM_Odm->mp_mode) == 1)
{
ODM_SetRFReg(pDM_Odm, path, 0x3, bMaskDWord,
((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)
ODM_SetRFReg(pDM_Odm, path, 0x4, bMaskDWord,
((APK_result[path][1] << 15) | (APK_result[path][1] << 10) | (0x00 << 5) | 0x05));
else
ODM_SetRFReg(pDM_Odm, path, 0x4, bMaskDWord,
((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))
ODM_SetRFReg(pDM_Odm, path, RF_BS_PA_APSET_G9_G11, bMaskDWord,
((0x08 << 15) | (0x08 << 10) | (0x08 << 5) | 0x08));
}
@ -1939,7 +1939,7 @@ PHY_IQCalibrate_8188E(
if (ODM_CheckPowerStatus(pAdapter) == false)
return;
if(!(pDM_Odm->SupportAbility & ODM_RF_CALIBRATION))
if (!(pDM_Odm->SupportAbility & ODM_RF_CALIBRATION))
{
return;
}
@ -1954,14 +1954,14 @@ if (*(pDM_Odm->mp_mode) == 1)
#endif
/* 20120213<Kordan> Turn on when continuous Tx to pass lab testing. (required by Edlu) */
if(bSingleTone || bCarrierSuppression)
if (bSingleTone || bCarrierSuppression)
return;
#if DISABLE_BB_RF
return;
#endif
if(bReCovery)
if (bReCovery)
{
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("PHY_IQCalibrate_8188E: Return due to bReCovery!\n"));
_PHY_ReloadADDARegisters(pAdapter, IQK_BB_REG_92C, pDM_Odm->RFCalibrateInfo.IQK_BB_backup_recover, 9);
@ -1973,7 +1973,7 @@ if (*(pDM_Odm->mp_mode) == 1)
result[0][i] = 0;
result[1][i] = 0;
result[2][i] = 0;
if((i==0) ||(i==2) || (i==4) || (i==6))
if ((i==0) ||(i==2) || (i==4) || (i==6))
result[3][i] = 0x100;
else
result[3][i] = 0;
@ -1992,26 +1992,26 @@ if (*(pDM_Odm->mp_mode) == 1)
{
phy_IQCalibrate_8188E(pAdapter, result, i, is2T);
if(i == 1) {
if (i == 1) {
is12simular = phy_SimularityCompare_8188E(pAdapter, result, 0, 1);
if(is12simular) {
if (is12simular) {
final_candidate = 0;
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: is12simular final_candidate is %x\n",final_candidate));
break;
}
}
if(i == 2)
if (i == 2)
{
is13simular = phy_SimularityCompare_8188E(pAdapter, result, 0, 2);
if(is13simular) {
if (is13simular) {
final_candidate = 0;
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: is13simular final_candidate is %x\n",final_candidate));
break;
}
is23simular = phy_SimularityCompare_8188E(pAdapter, result, 1, 2);
if(is23simular) {
if (is23simular) {
final_candidate = 1;
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: is23simular final_candidate is %x\n",final_candidate));
}
@ -2021,7 +2021,7 @@ if (*(pDM_Odm->mp_mode) == 1)
for(i = 0; i < 8; i++)
RegTmp += result[3][i];
if(RegTmp != 0)
if (RegTmp != 0)
final_candidate = 3;
else
final_candidate = 0xFF;
@ -2045,7 +2045,7 @@ if (*(pDM_Odm->mp_mode) == 1)
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("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)
{
pDM_Odm->RFCalibrateInfo.RegE94 = RegE94 = result[final_candidate][0];
pDM_Odm->RFCalibrateInfo.RegE9C = RegE9C = result[final_candidate][1];
@ -2065,11 +2065,11 @@ if (*(pDM_Odm->mp_mode) == 1)
pDM_Odm->RFCalibrateInfo.RegE9C = pDM_Odm->RFCalibrateInfo.RegEBC = 0x0; /* Y default value */
}
if((RegE94 != 0)/*&&(RegEA4 != 0)*/)
if ((RegE94 != 0)/*&&(RegEA4 != 0)*/)
_PHY_PathAFillIQKMatrix(pAdapter, bPathAOK, result, final_candidate, (RegEA4 == 0));
if (is2T) {
if((RegEB4 != 0)/*&&(RegEC4 != 0)*/)
if ((RegEB4 != 0)/*&&(RegEC4 != 0)*/)
_PHY_PathBFillIQKMatrix(pAdapter, bPathBOK, result, final_candidate, (RegEC4 == 0));
}
@ -2077,7 +2077,7 @@ if (*(pDM_Odm->mp_mode) == 1)
/* To Fix BSOD when final_candidate is 0xff */
/* by sherry 20120321 */
if(final_candidate < 4)
if (final_candidate < 4)
{
for(i = 0; i < IQK_Matrix_REG_NUM; i++)
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[Indexforchannel].Value[0][i] = result[final_candidate][i];
@ -2122,12 +2122,12 @@ if (*(pDM_Odm->mp_mode) == 1)
return;
#endif
if(!(pDM_Odm->SupportAbility & ODM_RF_CALIBRATION))
if (!(pDM_Odm->SupportAbility & ODM_RF_CALIBRATION))
{
return;
}
/* 20120213<Kordan> Turn on when continuous Tx to pass lab testing. (required by Edlu) */
if(bSingleTone || bCarrierSuppression)
if (bSingleTone || bCarrierSuppression)
return;
while(*(pDM_Odm->pbScanInProcess) && timecount < timeout)
@ -2140,7 +2140,7 @@ if (*(pDM_Odm->mp_mode) == 1)
/* ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LCK:Start!!!interface %d currentband %x delay %d ms\n", pDM_Odm->interfaceIndex, pHalData->CurrentBandType92D, timecount)); */
if(pDM_Odm->RFType == ODM_2T2R)
if (pDM_Odm->RFType == ODM_2T2R)
{
phy_LCCalibrate_8188E(pAdapter, true);
}
@ -2173,7 +2173,7 @@ static void phy_SetRFPathSwitch_8188E(
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
PDM_ODM_T pDM_Odm = &pHalData->odmpriv;
if(pAdapter->hw_init_completed == false)
if (pAdapter->hw_init_completed == false)
{
u8 u1bTmp;
u1bTmp = ODM_Read1Byte(pDM_Odm, REG_LEDCFG2) | BIT7;
@ -2181,9 +2181,9 @@ static void phy_SetRFPathSwitch_8188E(
/* ODM_SetBBReg(pDM_Odm, REG_LEDCFG0, BIT23, 0x01); */
ODM_SetBBReg(pDM_Odm, rFPGA0_XAB_RFParameter, BIT13, 0x01);
}
if(is2T) /* 92C */
if (is2T) /* 92C */
{
if(bMain)
if (bMain)
ODM_SetBBReg(pDM_Odm, rFPGA0_XB_RFInterfaceOE, BIT5|BIT6, 0x1); /* 92C_Path_A */
else
ODM_SetBBReg(pDM_Odm, rFPGA0_XB_RFInterfaceOE, BIT5|BIT6, 0x2); /* BT */
@ -2191,7 +2191,7 @@ static void phy_SetRFPathSwitch_8188E(
else /* 88C */
{
if(bMain)
if (bMain)
ODM_SetBBReg(pDM_Odm, rFPGA0_XA_RFInterfaceOE, BIT8|BIT9, 0x2); /* Main */
else
ODM_SetBBReg(pDM_Odm, rFPGA0_XA_RFInterfaceOE, BIT8|BIT9, 0x1); /* Aux */
@ -2209,7 +2209,7 @@ void PHY_SetRFPathSwitch_8188E(
return;
#endif
if(pDM_Odm->RFType == ODM_2T2R)
if (pDM_Odm->RFType == ODM_2T2R)
{
phy_SetRFPathSwitch_8188E(pAdapter, bMain, true);
}

View file

@ -33,34 +33,34 @@ void dump_chip_info(struct 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_");
else if(IS_I_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "I_CUT_");
else if(IS_J_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "J_CUT_");
else if(IS_K_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "K_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 if (IS_I_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "I_CUT_");
else if (IS_J_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "J_CUT_");
else if (IS_K_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "K_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);
@ -151,7 +151,7 @@ void HalSetBrateCfg(
is_brate = mBratesOS[i] & IEEE80211_BASIC_RATE_MASK;
brate = mBratesOS[i] & 0x7f;
if( is_brate )
if ( is_brate )
{
switch(brate)
{
@ -198,7 +198,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 }; */
@ -243,7 +243,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 }; */
@ -389,7 +389,7 @@ SetHalDefVar(struct adapter *adapter, enum HAL_DEF_VARIABLE variable, void *valu
switch(variable) {
case HW_DEF_FA_CNT_DUMP:
if(*((u8*)value))
if (*((u8*)value))
pDM_Odm->DebugComponents |= (ODM_COMP_DIG |ODM_COMP_FA_CNT);
else
pDM_Odm->DebugComponents &= ~(ODM_COMP_DIG |ODM_COMP_FA_CNT);

View file

@ -27,40 +27,40 @@
void rtw_hal_chip_configure(struct 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(struct 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(struct 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(struct adapter *padapter)
{
if (is_primary_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(struct adapter *padapter)
{
if (is_primary_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(struct adapter *padapter)
{
if (is_primary_adapter(padapter))
if(padapter->HalFunc.dm_init)
if (padapter->HalFunc.dm_init)
padapter->HalFunc.dm_init(padapter);
}
@ -68,32 +68,32 @@ void rtw_hal_dm_deinit(struct adapter *padapter)
{
/* cancel dm timer */
if (is_primary_adapter(padapter))
if(padapter->HalFunc.dm_deinit)
if (padapter->HalFunc.dm_deinit)
padapter->HalFunc.dm_deinit(padapter);
}
void rtw_hal_sw_led_init(struct adapter *padapter)
{
if(padapter->HalFunc.InitSwLeds)
if (padapter->HalFunc.InitSwLeds)
padapter->HalFunc.InitSwLeds(padapter);
}
void rtw_hal_sw_led_deinit(struct adapter *padapter)
{
if(padapter->HalFunc.DeInitSwLeds)
if (padapter->HalFunc.DeInitSwLeds)
padapter->HalFunc.DeInitSwLeds(padapter);
}
u32 rtw_hal_power_on(struct adapter *padapter)
{
if(padapter->HalFunc.hal_power_on)
if (padapter->HalFunc.hal_power_on)
return padapter->HalFunc.hal_power_on(padapter);
return _FAIL;
}
void rtw_hal_power_off(struct adapter *padapter)
{
if(padapter->HalFunc.hal_power_off)
if (padapter->HalFunc.hal_power_off)
padapter->HalFunc.hal_power_off(padapter);
}
@ -105,7 +105,7 @@ uint rtw_hal_init(struct adapter *padapter)
status = padapter->HalFunc.hal_init(padapter);
if(status == _SUCCESS){
if (status == _SUCCESS){
for (i = 0; i<dvobj->iface_nums; i++) {
padapter = dvobj->padapters[i];
padapter->hw_init_completed = true;
@ -147,7 +147,7 @@ uint rtw_hal_deinit(struct adapter *padapter)
status = padapter->HalFunc.hal_deinit(padapter);
if(status == _SUCCESS){
if (status == _SUCCESS){
for (i = 0; i<dvobj->iface_nums; i++) {
padapter = dvobj->padapters[i];
padapter->hw_init_completed = false;
@ -174,27 +174,27 @@ void rtw_hal_get_hwreg(struct adapter *padapter, u8 variable, u8 *val)
u8 rtw_hal_set_def_var(struct adapter *padapter, enum HAL_DEF_VARIABLE eVariable, void * pValue)
{
if(padapter->HalFunc.SetHalDefVarHandler)
if (padapter->HalFunc.SetHalDefVarHandler)
return padapter->HalFunc.SetHalDefVarHandler(padapter,eVariable,pValue);
return _FAIL;
}
u8 rtw_hal_get_def_var(struct adapter *padapter, enum HAL_DEF_VARIABLE eVariable, void * pValue)
{
if(padapter->HalFunc.GetHalDefVarHandler)
if (padapter->HalFunc.GetHalDefVarHandler)
return padapter->HalFunc.GetHalDefVarHandler(padapter,eVariable,pValue);
return _FAIL;
}
void rtw_hal_set_odm_var(struct adapter *padapter, enum HAL_ODM_VARIABLE eVariable, void * pValue1,bool bSet)
{
if(padapter->HalFunc.SetHalODMVarHandler)
if (padapter->HalFunc.SetHalODMVarHandler)
padapter->HalFunc.SetHalODMVarHandler(padapter,eVariable,pValue1,bSet);
}
void rtw_hal_get_odm_var(struct adapter *padapter, enum HAL_ODM_VARIABLE eVariable, void * pValue1,bool 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(struct adapter *padapter)
u32 rtw_hal_inirp_init(struct 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(struct adapter *padapter)
u32 rtw_hal_inirp_deinit(struct 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(struct adapter *padapter)
u8 rtw_hal_intf_ps_func(struct adapter *padapter, enum 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_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitframe)
{
if(padapter->HalFunc.hal_xmitframe_enqueue)
if (padapter->HalFunc.hal_xmitframe_enqueue)
return padapter->HalFunc.hal_xmitframe_enqueue(padapter, pxmitframe);
return false;
@ -263,7 +263,7 @@ s32 rtw_hal_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmit
s32 rtw_hal_xmit(struct 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;
@ -280,9 +280,9 @@ s32 rtw_hal_mgnt_xmit(struct adapter *padapter, struct xmit_frame *pmgntframe)
memcpy(pmgntframe->attrib.ra, pwlanhdr->addr1, ETH_ALEN);
#ifdef CONFIG_IEEE80211W
if(padapter->securitypriv.binstallBIPkey == true)
if (padapter->securitypriv.binstallBIPkey == true)
{
if(IS_MCAST(pmgntframe->attrib.ra))
if (IS_MCAST(pmgntframe->attrib.ra))
{
pmgntframe->attrib.encrypt = _BIP_;
/* pmgntframe->attrib.bswenc = true; */
@ -296,27 +296,27 @@ s32 rtw_hal_mgnt_xmit(struct adapter *padapter, struct xmit_frame *pmgntframe)
}
#endif /* CONFIG_IEEE80211W */
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(struct 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(struct 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(struct adapter *padapter)
{
if(padapter->HalFunc.init_recv_priv)
if (padapter->HalFunc.init_recv_priv)
return padapter->HalFunc.init_recv_priv(padapter);
return _FAIL;
@ -324,7 +324,7 @@ s32 rtw_hal_init_recv_priv(struct adapter *padapter)
void rtw_hal_free_recv_priv(struct adapter *padapter)
{
if(padapter->HalFunc.free_recv_priv)
if (padapter->HalFunc.free_recv_priv)
padapter->HalFunc.free_recv_priv(padapter);
}
@ -333,119 +333,119 @@ void rtw_hal_update_ra_mask(struct sta_info *psta, u8 rssi_level)
struct adapter *padapter;
struct mlme_priv *pmlmepriv;
if(!psta)
if (!psta)
return;
padapter = psta->padapter;
pmlmepriv = &(padapter->mlmepriv);
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
{
add_RATid(padapter, psta, rssi_level);
}
else
{
if(padapter->HalFunc.UpdateRAMaskHandler)
if (padapter->HalFunc.UpdateRAMaskHandler)
padapter->HalFunc.UpdateRAMaskHandler(padapter, psta->mac_id, rssi_level);
}
}
void rtw_hal_add_ra_tid(struct 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);
}
/* Start specifical interface thread */
void rtw_hal_start_thread(struct 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(struct adapter *padapter)
{
if(padapter->HalFunc.cancel_thread)
if (padapter->HalFunc.cancel_thread)
padapter->HalFunc.cancel_thread(padapter);
}
u32 rtw_hal_read_bbreg(struct 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(struct 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(struct 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(struct 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(struct 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(struct adapter *padapter, enum 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(struct adapter *padapter, u8 channel)
{
if(padapter->HalFunc.set_channel_handler)
if (padapter->HalFunc.set_channel_handler)
padapter->HalFunc.set_channel_handler(padapter, channel);
}
void rtw_hal_dm_watchdog(struct adapter *padapter)
{
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(struct adapter *padapter)
{
if(padapter->HalFunc.SetBeaconRelatedRegistersHandler)
if (padapter->HalFunc.SetBeaconRelatedRegistersHandler)
padapter->HalFunc.SetBeaconRelatedRegistersHandler(padapter);
}
u8 rtw_hal_antdiv_before_linked(struct adapter *padapter)
{
if(padapter->HalFunc.AntDivBeforeLinkHandler)
if (padapter->HalFunc.AntDivBeforeLinkHandler)
return padapter->HalFunc.AntDivBeforeLinkHandler(padapter);
return false;
}
void rtw_hal_antdiv_rssi_compared(struct adapter *padapter, struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src)
{
if(padapter->HalFunc.AntDivCompareHandler)
if (padapter->HalFunc.AntDivCompareHandler)
padapter->HalFunc.AntDivCompareHandler(padapter, dst, src);
}
#ifdef CONFIG_HOSTAPD_MLME
s32 rtw_hal_hostap_mgnt_xmit_entry(struct 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;
}
@ -453,20 +453,20 @@ s32 rtw_hal_hostap_mgnt_xmit_entry(struct adapter *padapter, _pkt *pkt)
void rtw_hal_sreset_init(struct 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(struct adapter *padapter)
{
padapter = GET_PRIMARY_ADAPTER(padapter);
if(padapter->HalFunc.silentreset)
if (padapter->HalFunc.silentreset)
padapter->HalFunc.silentreset(padapter);
}
void rtw_hal_sreset_reset_value(struct adapter *padapter)
{
if(padapter->HalFunc.sreset_reset_value)
if (padapter->HalFunc.sreset_reset_value)
padapter->HalFunc.sreset_reset_value(padapter);
}
@ -475,7 +475,7 @@ void rtw_hal_sreset_xmit_status_check(struct adapter *padapter)
if (!is_primary_adapter(padapter))
return;
if(padapter->HalFunc.sreset_xmit_status_check)
if (padapter->HalFunc.sreset_xmit_status_check)
padapter->HalFunc.sreset_xmit_status_check(padapter);
}
@ -484,14 +484,14 @@ void rtw_hal_sreset_linked_status_check(struct adapter *padapter)
if (!is_primary_adapter(padapter))
return;
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(struct 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;
}
@ -502,27 +502,27 @@ bool rtw_hal_sreset_inprogress(struct adapter *padapter)
padapter = GET_PRIMARY_ADAPTER(padapter);
if(padapter->HalFunc.sreset_inprogress)
if (padapter->HalFunc.sreset_inprogress)
inprogress = padapter->HalFunc.sreset_inprogress(padapter);
return inprogress;
}
int rtw_hal_iol_cmd(struct 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;
}
void rtw_hal_notch_filter(struct 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(struct adapter * adapter)
{
if(adapter->HalFunc.hal_reset_security_engine)
if (adapter->HalFunc.hal_reset_security_engine)
adapter->HalFunc.hal_reset_security_engine(adapter);
}

492
hal/odm.c

File diff suppressed because it is too large Load diff

View file

@ -82,42 +82,42 @@ odm_SignalScaleMapping_92CSeries(
{
s32 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;
}
@ -129,33 +129,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);
}
@ -173,13 +173,13 @@ odm_SignalScaleMapping(
s32 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) */
{
@ -219,15 +219,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);
@ -261,7 +261,7 @@ odm_RxPhyStatus92CSeries_Parsing(
pPhyInfo->RxMIMOSignalQuality[ODM_RF_PATH_B] = -1;
if(isCCKrate) {
if (isCCKrate) {
u8 report;
u8 cck_agc_rpt;
@ -276,12 +276,12 @@ 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) {
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;
@ -299,7 +299,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);
@ -315,19 +315,19 @@ 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)
@ -375,30 +375,30 @@ odm_RxPhyStatus92CSeries_Parsing(
PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all);
/* Modification for ext-LNA board */
if(pDM_Odm->BoardType & (ODM_BOARD_EXT_LNA | ODM_BOARD_EXT_PA))
if (pDM_Odm->BoardType & (ODM_BOARD_EXT_LNA | ODM_BOARD_EXT_PA))
{
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;
}
}
@ -409,20 +409,20 @@ odm_RxPhyStatus92CSeries_Parsing(
/* */
/* (3) Get Signal Quality (EVM) */
/* */
if(pPktinfo->bPacketMatchBSSID)
if (pPktinfo->bPacketMatchBSSID)
{
u8 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;
@ -460,14 +460,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_EXT_LNA | ODM_BOARD_EXT_PA))
if (pDM_Odm->BoardType & (ODM_BOARD_EXT_LNA | ODM_BOARD_EXT_PA))
{
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;
}
@ -477,11 +477,11 @@ odm_RxPhyStatus92CSeries_Parsing(
pPhyInfo->RxSNR[i] = pDM_Odm->PhyDbgInfo.RxSNRdB[i] = (s32)(pPhyStaRpt->path_rxsnr[i]/2);
/* 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);
}
@ -502,13 +502,13 @@ odm_RxPhyStatus92CSeries_Parsing(
pPhyInfo->RxPower = rx_pwr_all;
pPhyInfo->RecvSignalPower = rx_pwr_all;
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 */
@ -522,9 +522,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 = (u8)(EVM & 0xff);
}
@ -536,7 +536,7 @@ odm_RxPhyStatus92CSeries_Parsing(
}
/* 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)
{
pPhyInfo->SignalStrength = (u8)(odm_SignalScaleMapping(pDM_Odm, PWDB_ALL));/* PWDB_ALL; */
}
@ -580,7 +580,7 @@ odm_Process_RSSIForDM(
PSTA_INFO_T pEntry;
if(pPktinfo->StationID == 0xFF)
if (pPktinfo->StationID == 0xFF)
return;
/* 2011/11/17 MH Need to debug */
@ -590,35 +590,35 @@ 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_RATE11M) ? true : false;
if(pPktinfo->bPacketBeacon)
if (pPktinfo->bPacketBeacon)
pDM_Odm->PhyDbgInfo.NumQryBeaconPkt++;
pDM_Odm->RxRate = pPktinfo->Rate;
/* Smart Antenna Debug Message------------------ */
if(pDM_Odm->SupportICType == ODM_RTL8188E)
if (pDM_Odm->SupportICType == ODM_RTL8188E)
{
u8 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;
pDM_FatTable->antRSSIcnt[antsel_tr_mux]++;
}
}
} else if((pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)||(pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV)) {
if(pPktinfo->bPacketToSelf || pPktinfo->bPacketBeacon) {
} else if ((pDM_Odm->AntDivType == CG_TRX_HW_ANTDIV)||(pDM_Odm->AntDivType == CGCS_RX_HW_ANTDIV)) {
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_AntselStatistics_88E(pDM_Odm, antsel_tr_mux, pPktinfo->StationID, pPhyInfo->RxPWDBAll);
}
@ -631,12 +631,12 @@ odm_Process_RSSIForDM(
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];
pDM_Odm->RSSI_A = pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_A];
pDM_Odm->RSSI_B = 0;
@ -648,7 +648,7 @@ odm_Process_RSSIForDM(
pDM_Odm->RSSI_A = pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_A];
pDM_Odm->RSSI_B = pPhyInfo->RxMIMOSignalStrength[ODM_RF_PATH_B];
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];
@ -658,24 +658,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 > (u32)UndecoratedSmoothedOFDM)
if (pPhyInfo->RxPWDBAll > (u32)UndecoratedSmoothedOFDM)
{
UndecoratedSmoothedOFDM =
( ((UndecoratedSmoothedOFDM)*(Rx_Smooth_Factor-1)) +
@ -700,13 +700,13 @@ odm_Process_RSSIForDM(
pDM_Odm->RSSI_B = 0xFF;
/* 1 Process CCK RSSI */
if(UndecoratedSmoothedCCK <= 0) /* initialize */
if (UndecoratedSmoothedCCK <= 0) /* initialize */
{
UndecoratedSmoothedCCK = pPhyInfo->RxPWDBAll;
}
else
{
if(pPhyInfo->RxPWDBAll > (u32)UndecoratedSmoothedCCK)
if (pPhyInfo->RxPWDBAll > (u32)UndecoratedSmoothedCCK)
{
UndecoratedSmoothedCCK =
( ((UndecoratedSmoothedCCK)*(Rx_Smooth_Factor-1)) +
@ -723,10 +723,10 @@ 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++;
@ -734,14 +734,14 @@ odm_Process_RSSIForDM(
for(i=0; i<pEntry->rssi_stat.ValidBit; i++)
OFDM_pkt += (u8)(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;
@ -778,9 +778,9 @@ 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 )
ODM_SwAntDivChkPerPktRssi(pDM_Odm,pPktinfo->StationID,pPhyInfo);
} else {
odm_Process_RSSIForDM(pDM_Odm,pPhyInfo,pPktinfo);
@ -842,7 +842,7 @@ ODM_ConfigRFWithHeaderFile(
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===>ODM_ConfigRFWithHeaderFile\n"));
if (pDM_Odm->SupportICType == ODM_RTL8188E)
{
if(IS_VENDOR_8188E_I_CUT_SERIES(pDM_Odm->Adapter))
if (IS_VENDOR_8188E_I_CUT_SERIES(pDM_Odm->Adapter))
READ_AND_CONFIG(8188E,_RadioA_1T_ICUT_);
else
READ_AND_CONFIG(8188E,_RadioA_1T_);
@ -863,18 +863,18 @@ ODM_ConfigBBWithHeaderFile(
ODM_BB_Config_Type ConfigType
)
{
if(pDM_Odm->SupportICType == ODM_RTL8188E) {
if(ConfigType == CONFIG_BB_PHY_REG) {
if(IS_VENDOR_8188E_I_CUT_SERIES(pDM_Odm->Adapter))
if (pDM_Odm->SupportICType == ODM_RTL8188E) {
if (ConfigType == CONFIG_BB_PHY_REG) {
if (IS_VENDOR_8188E_I_CUT_SERIES(pDM_Odm->Adapter))
READ_AND_CONFIG(8188E,_PHY_REG_1T_ICUT_);
else
READ_AND_CONFIG(8188E,_PHY_REG_1T_);
} else if(ConfigType == CONFIG_BB_AGC_TAB) {
if(IS_VENDOR_8188E_I_CUT_SERIES(pDM_Odm->Adapter))
} else if (ConfigType == CONFIG_BB_AGC_TAB) {
if (IS_VENDOR_8188E_I_CUT_SERIES(pDM_Odm->Adapter))
READ_AND_CONFIG(8188E,_AGC_TAB_1T_ICUT_);
else
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"));
}
@ -889,7 +889,7 @@ ODM_ConfigMACWithHeaderFile(
{
u8 result = HAL_STATUS_SUCCESS;
if (pDM_Odm->SupportICType == ODM_RTL8188E) {
if(IS_VENDOR_8188E_I_CUT_SERIES(pDM_Odm->Adapter))
if (IS_VENDOR_8188E_I_CUT_SERIES(pDM_Odm->Adapter))
READ_AND_CONFIG(8188E,_MAC_REG_ICUT_);
else
result =READ_AND_CONFIG(8188E,_MAC_REG_);

View file

@ -31,7 +31,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 = (u8) 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));
@ -119,7 +119,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 */
@ -179,9 +179,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 */
@ -192,9 +192,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 */
@ -242,7 +242,7 @@ ODM_AntennaDiversityInit_88E(
PDM_ODM_T pDM_Odm
)
{
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", */
@ -250,11 +250,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);
}
@ -265,10 +265,10 @@ ODM_UpdateRxIdleAnt_88E(PDM_ODM_T pDM_Odm, u8 Ant)
pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable;
u32 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;
@ -279,7 +279,7 @@ ODM_UpdateRxIdleAnt_88E(PDM_ODM_T pDM_Odm, u8 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 */
@ -287,7 +287,7 @@ ODM_UpdateRxIdleAnt_88E(PDM_ODM_T pDM_Odm, u8 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 */
@ -305,7 +305,7 @@ odm_UpdateTxAnt_88E(PDM_ODM_T pDM_Odm, u8 Ant, u32 MacId)
pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable;
u8 TargetAnt;
if(Ant == MAIN_ANT)
if (Ant == MAIN_ANT)
TargetAnt = MAIN_ANT_CG_TRX;
else
TargetAnt = AUX_ANT_CG_TRX;
@ -329,7 +329,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]);
@ -348,9 +348,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;
@ -363,9 +363,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;
@ -398,7 +398,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;
@ -410,19 +410,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;
@ -431,7 +431,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
}
@ -454,32 +454,32 @@ 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;
}
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;
}
return;
} 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 */
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 */
#else
@ -492,7 +492,7 @@ 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);
}

View file

@ -29,7 +29,7 @@ odm_ConfigRFReg_8188E(
u32 RegAddr
)
{
if(Addr == 0xffe)
if (Addr == 0xffe)
{
ODM_sleep_ms(50);
}

View file

@ -104,31 +104,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; \
@ -139,7 +139,7 @@
#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; \
u8 * __ptr = (u8 *)ptr; \

View file

@ -50,7 +50,7 @@ static u8 _is_fw_read_cmd_down(struct adapter* padapter, u8 msgbox_num)
do{
valid = rtw_read8(padapter,REG_HMETFR) & BIT(msgbox_num);
if(0 == valid ){
if (0 == valid ){
read_down = true;
}
}while( (!read_down) && (retry_cnts--));
@ -88,7 +88,7 @@ static s32 FillH2CCmd_88E(struct adapter *padapter, u8 ElementID, u32 CmdLen, u8
padapter = GET_PRIMARY_ADAPTER(padapter);
pHalData = GET_HAL_DATA(padapter);
if(padapter->bFWReady == false)
if (padapter->bFWReady == false)
{
DBG_8192C("FillH2CCmd_88E(): return H2C cmd because fw is not ready\n");
return ret;
@ -109,14 +109,14 @@ static s32 FillH2CCmd_88E(struct adapter *padapter, u8 ElementID, u32 CmdLen, u8
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)
{
memcpy((u8*)(&h2c_cmd)+1, pCmdBuffer, CmdLen );
}
@ -169,7 +169,7 @@ u8 rtl8188e_set_rssi_cmd(struct adapter*padapter, u8 *param)
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
;
if(pHalData->fw_ractrl == true){
if (pHalData->fw_ractrl == true){
}else{
DBG_8192C("==>%s fw dont support RA\n",__FUNCTION__);
res=_FAIL;
@ -183,7 +183,7 @@ u8 rtl8188e_set_raid_cmd(struct adapter*padapter, u32 mask)
u8 res=_SUCCESS;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
;
if(pHalData->fw_ractrl == true){
if (pHalData->fw_ractrl == true){
__le32 lmask;
memset(buf, 0, 3);
@ -212,7 +212,7 @@ void rtl8188e_Add_RateATid(struct adapter *pAdapter, u32 bitmap, u8 arg, u8 rssi
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);
@ -232,7 +232,7 @@ void rtl8188e_Add_RateATid(struct adapter *pAdapter, u32 bitmap, u8 arg, u8 rssi
__FUNCTION__,macid ,raid ,bitmap, shortGIrate);
#if(RATE_ADAPTIVE_SUPPORT == 1)
#if (RATE_ADAPTIVE_SUPPORT == 1)
ODM_RA_UpdateRateInfo_8188E(
&(pHalData->odmpriv),
macid,
@ -286,7 +286,7 @@ void rtl8188e_set_FwPwrMode_cmd(struct adapter *padapter, u8 Mode)
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
@ -312,13 +312,13 @@ void rtl8188e_set_FwMediaStatus_cmd(struct adapter *padapter, __le16 mstatus_rpt
DBG_871X("### %s: MStatus=%x MACID=%d\n", __FUNCTION__,opmode,macid);
FillH2CCmd_88E(padapter, H2C_COM_MEDIA_STATUS_RPT, sizeof(mst_rpt), (u8 *)&mst_rpt);
if(macid > 31){
if (macid > 31){
macid = macid-32;
reg_macid_no_link = REG_MACID_NO_LINK_1;
}
/* Delete select macid (MACID 0~63) from queue list. */
if(opmode == 1)/* 1:connect */
if (opmode == 1)/* 1:connect */
{
rtw_write32(padapter,reg_macid_no_link, (rtw_read32(padapter,reg_macid_no_link) & (~BIT(macid))));
}
@ -376,7 +376,7 @@ static void ConstructBeacon(struct 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(struct ndis_802_11_fixed_ies);
@ -397,7 +397,7 @@ static void ConstructBeacon(struct 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... */
@ -561,7 +561,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),
@ -708,7 +708,7 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *padapter, u8 mstatus)
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. */
rtw_write16(padapter, REG_BCN_PSR_RPT, (0xC000|pmlmeinfo->aid));
@ -730,7 +730,7 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *padapter, u8 mstatus)
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;
@ -761,10 +761,10 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *padapter, u8 mstatus)
}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);
@ -774,10 +774,10 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *padapter, u8 mstatus)
/* 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;
@ -798,10 +798,10 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *padapter, u8 mstatus)
}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);
@ -819,7 +819,7 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *padapter, u8 mstatus)
/* 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;
@ -828,7 +828,7 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *padapter, u8 mstatus)
/* */
/* 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");
@ -836,7 +836,7 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *padapter, u8 mstatus)
}
/* 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);
@ -863,7 +863,7 @@ void rtl8188e_set_p2p_ps_offload_cmd(struct adapter* padapter, u8 p2p_ps_state)
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);
@ -874,7 +874,7 @@ void rtl8188e_set_p2p_ps_offload_cmd(struct adapter* padapter, u8 p2p_ps_state)
{
/* 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;
@ -893,14 +893,14 @@ void rtl8188e_set_p2p_ps_offload_cmd(struct adapter* padapter, u8 p2p_ps_state)
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;

View file

@ -59,7 +59,7 @@ static void dm_CheckPbcGPIO(struct adapter *padapter)
u8 tmp1byte;
u8 bPbcPressed = false;
if(!padapter->registrypriv.hw_wps_pbc)
if (!padapter->registrypriv.hw_wps_pbc)
return;
tmp1byte = rtw_read8(padapter, GPIO_IO_SEL);
@ -82,7 +82,7 @@ static void dm_CheckPbcGPIO(struct adapter *padapter)
{
bPbcPressed = true;
}
if( true == bPbcPressed)
if ( true == bPbcPressed)
{
/* Here we only set bPbcPressed to true */
/* After trigger PBC, the variable will be set to false */
@ -141,7 +141,7 @@ static void Init_ODM_ComInfo_88E(struct adapter *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 */
@ -161,13 +161,13 @@ static void Init_ODM_ComInfo_88E(struct adapter *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);
}
@ -204,7 +204,7 @@ static void Update_ODM_ComInfo_88E(struct adapter *Adapter)
pdmpriv->InitODMFlag |= ODM_MAC_EDCA_TURBO;
}
if(pHalData->AntDivCfg)
if (pHalData->AntDivCfg)
pdmpriv->InitODMFlag |= ODM_BB_ANT_DIV;
#if (MP_DRIVER==1)
@ -288,11 +288,11 @@ rtl8188e_HalDmWatchDog(
#ifdef CONFIG_P2P
/* 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 */
if( (hw_init_completed == true)
if ( (hw_init_completed == true)
&& ((!bFwCurrentInPSMode) && bFwPSAwake))
{
/* */
@ -308,7 +308,7 @@ rtl8188e_HalDmWatchDog(
u8 bLinked=false;
u8 bsta_state = false;
if(rtw_linked_check(Adapter))
if (rtw_linked_check(Adapter))
bLinked = true;
ODM_CmnInfoUpdate(&pHalData->odmpriv ,ODM_CMNINFO_LINK, bLinked);
@ -355,12 +355,12 @@ void AntDivCompare8188E(struct adapter *Adapter, struct wlan_bssid_ex *dst, stru
/* struct adapter *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;
@ -378,19 +378,19 @@ u8 AntDivBeforeLink8188E(struct adapter *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

@ -77,7 +77,7 @@ phy_CalculateBitShift(
return (i);
}
#if(SIC_ENABLE == 1)
#if (SIC_ENABLE == 1)
static bool
sic_IsSICReady(
struct adapter *Adapter
@ -89,22 +89,22 @@ sic_IsSICReady(
while(1)
{
if(retryCnt++ >= SIC_MAX_POLL_CNT)
if (retryCnt++ >= SIC_MAX_POLL_CNT)
{
/* RTPRINT(FPHY, (PHY_SICR|PHY_SICW), ("[SIC], sic_IsSICReady() return false\n")); */
return false;
}
/* if(RT_SDIO_CANNOT_IO(Adapter)) */
/* if (RT_SDIO_CANNOT_IO(Adapter)) */
/* return false; */
sic_cmd = rtw_read8(Adapter, SIC_CMD_REG);
/* sic_cmd = PlatformEFIORead1Byte(Adapter, SIC_CMD_REG); */
#if(SIC_HW_SUPPORT == 1)
#if (SIC_HW_SUPPORT == 1)
sic_cmd &= 0xf0; /* [7:4] */
#endif
/* RTPRINT(FPHY, (PHY_SICR|PHY_SICW), ("[SIC], sic_IsSICReady(), readback 0x%x=0x%x\n", SIC_CMD_REG, sic_cmd)); */
if(sic_cmd == SIC_CMD_READY)
if (sic_cmd == SIC_CMD_READY)
return true;
else
{
@ -127,9 +127,9 @@ sic_Read4Byte(
/* RTPRINT(FPHY, PHY_SICR, ("[SIC], sic_Read4Byte(): read offset(%#x)\n", offset)); */
if(sic_IsSICReady(Adapter))
if (sic_IsSICReady(Adapter))
{
#if(SIC_HW_SUPPORT == 1)
#if (SIC_HW_SUPPORT == 1)
rtw_write8(Adapter, SIC_CMD_REG, SIC_CMD_PREREAD);
/* PlatformEFIOWrite1Byte(Adapter, SIC_CMD_REG, SIC_CMD_PREREAD); */
/* RTPRINT(FPHY, PHY_SICR, ("write cmdreg 0x%x = 0x%x\n", SIC_CMD_REG, SIC_CMD_PREREAD)); */
@ -149,7 +149,7 @@ sic_Read4Byte(
rtw_udelay_os(50);
/* PlatformStallExecution(50); */
}
if(sic_IsSICReady(Adapter))
if (sic_IsSICReady(Adapter))
{
u4ret = rtw_read32(Adapter, SIC_DATA_REG);
/* u4ret = PlatformEFIORead4Byte(Adapter, SIC_DATA_REG); */
@ -170,9 +170,9 @@ sic_Write4Byte(
{
u8 retry = 6;
if(sic_IsSICReady(Adapter))
if (sic_IsSICReady(Adapter))
{
#if(SIC_HW_SUPPORT == 1)
#if (SIC_HW_SUPPORT == 1)
rtw_write8(Adapter, SIC_CMD_REG, SIC_CMD_PREWRITE);
#endif
rtw_write8(Adapter, SIC_ADDR_REG, (u8)(offset&0xff));
@ -205,7 +205,7 @@ SIC_SetBBReg(
/* RTPRINT(FPHY, PHY_SICW, ("[SIC], SIC_SetBBReg(), mask=0x%x, addr[0x%x]=0x%x\n", BitMask, RegAddr, Data)); */
if(BitMask!= bMaskDWord){/* if not "double word" write */
if (BitMask!= bMaskDWord){/* if not "double word" write */
OriginalValue = sic_Read4Byte(Adapter, RegAddr);
/* BitShift = sic_CalculateBitShift(BitMask); */
BitShift = phy_CalculateBitShift(BitMask);
@ -251,7 +251,7 @@ SIC_Init(
/* Here we need to write 0x1b8~0x1bf = 0 after fw is downloaded */
/* because for 8723E at beginning 0x1b8=0x1e, that will cause */
/* sic always not be ready */
#if(SIC_HW_SUPPORT == 1)
#if (SIC_HW_SUPPORT == 1)
/* RTPRINT(FPHY, PHY_SICR, ("[SIC], SIC_Init(), write 0x%x = 0x%x\n", */
/* SIC_INIT_REG, SIC_INIT_VAL)); */
rtw_write8(Adapter, SIC_INIT_REG, SIC_INIT_VAL);
@ -308,7 +308,7 @@ rtl8188e_PHY_QueryBBReg(
return 0;
#endif
#if(SIC_ENABLE == 1)
#if (SIC_ENABLE == 1)
return SIC_QueryBBReg(Adapter, RegAddr, BitMask);
#endif
@ -355,12 +355,12 @@ rtl8188e_PHY_SetBBReg(
return;
#endif
#if(SIC_ENABLE == 1)
#if (SIC_ENABLE == 1)
SIC_SetBBReg(Adapter, RegAddr, BitMask, Data);
return;
#endif
if(BitMask!= bMaskDWord){/* if not "double word" write */
if (BitMask!= bMaskDWord){/* if not "double word" write */
OriginalValue = rtw_read32(Adapter, RegAddr);
BitShift = phy_CalculateBitShift(BitMask);
Data = ((OriginalValue & (~BitMask)) | ((Data << BitShift) & BitMask));
@ -417,7 +417,7 @@ phy_RFSerialRead(
NewOffset = Offset;
/* 2009/06/17 MH We can not execute IO for power save or other accident mode. */
/* if(RT_CANNOT_IO(Adapter)) */
/* if (RT_CANNOT_IO(Adapter)) */
/* */
/* RTPRINT(FPHY, PHY_RFR, ("phy_RFSerialRead return all one\n")); */
/* return 0xFFFFFFFF; */
@ -427,7 +427,7 @@ phy_RFSerialRead(
/* For RF A/B write 0x824/82c(does not work in the future) */
/* We must use 0x824 for RF A and B to execute read trigger */
tmplong = PHY_QueryBBReg(Adapter, rFPGA0_XA_HSSIParameter2, bMaskDWord);
if(eRFPath == RF_PATH_A)
if (eRFPath == RF_PATH_A)
tmplong2 = tmplong;
else
tmplong2 = PHY_QueryBBReg(Adapter, pPhyReg->rfHSSIPara2, bMaskDWord);
@ -443,12 +443,12 @@ phy_RFSerialRead(
/* PHY_SetBBReg(Adapter, rFPGA0_XA_HSSIParameter2, bMaskDWord, tmplong|bLSSIReadEdge); */
rtw_udelay_os(10);/* PlatformStallExecution(10); */
if(eRFPath == RF_PATH_A)
if (eRFPath == RF_PATH_A)
RfPiEnable = (u8)PHY_QueryBBReg(Adapter, rFPGA0_XA_HSSIParameter1, BIT8);
else if(eRFPath == RF_PATH_B)
else if (eRFPath == RF_PATH_B)
RfPiEnable = (u8)PHY_QueryBBReg(Adapter, rFPGA0_XB_HSSIParameter1, BIT8);
if(RfPiEnable)
if (RfPiEnable)
{ /* Read from BBreg8b8, 12 bits for 8190, 20bits for T65 RF */
retValue = PHY_QueryBBReg(Adapter, pPhyReg->rfLSSIReadBackPi, bLSSIReadBackData);
/* DBG_8192C("Readback from RF-PI : 0x%x\n", retValue); */
@ -680,7 +680,7 @@ s32 PHY_MACConfig8188E(struct adapter *Adapter)
pszMACRegFile = sz8188EMACRegFile;
/* Config MAC */
if(HAL_STATUS_FAILURE == ODM_ConfigMACWithHeaderFile(&pHalData->odmpriv))
if (HAL_STATUS_FAILURE == ODM_ConfigMACWithHeaderFile(&pHalData->odmpriv))
rtStatus = _FAIL;
/* 2010.07.13 AMPDU aggregation number B */
@ -863,107 +863,107 @@ storePwrIndexDiffRateOffset(
{
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
if(RegAddr == rTxAGC_A_Rate18_06)
if (RegAddr == rTxAGC_A_Rate18_06)
{
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][0] = Data;
/* printk("MCSTxPowerLevelOriginalOffset[%d][0]-TxAGC_A_Rate18_06 = 0x%x\n", pHalData->pwrGroupCnt, */
/* pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][0]); */
}
if(RegAddr == rTxAGC_A_Rate54_24)
if (RegAddr == rTxAGC_A_Rate54_24)
{
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][1] = Data;
/* printk("MCSTxPowerLevelOriginalOffset[%d][1]-TxAGC_A_Rate54_24 = 0x%x\n", pHalData->pwrGroupCnt, */
/* pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][1]); */
}
if(RegAddr == rTxAGC_A_CCK1_Mcs32)
if (RegAddr == rTxAGC_A_CCK1_Mcs32)
{
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][6] = Data;
/* printk("MCSTxPowerLevelOriginalOffset[%d][6]-TxAGC_A_CCK1_Mcs32 = 0x%x\n", pHalData->pwrGroupCnt, */
/* pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][6]); */
}
if(RegAddr == rTxAGC_B_CCK11_A_CCK2_11 && BitMask == 0xffffff00)
if (RegAddr == rTxAGC_B_CCK11_A_CCK2_11 && BitMask == 0xffffff00)
{
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][7] = Data;
/* printk("MCSTxPowerLevelOriginalOffset[%d][7]-TxAGC_B_CCK11_A_CCK2_11 = 0x%x\n", pHalData->pwrGroupCnt, */
/* pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][7]); */
}
if(RegAddr == rTxAGC_A_Mcs03_Mcs00)
if (RegAddr == rTxAGC_A_Mcs03_Mcs00)
{
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][2] = Data;
/* printk("MCSTxPowerLevelOriginalOffset[%d][2]-TxAGC_A_Mcs03_Mcs00 = 0x%x\n", pHalData->pwrGroupCnt, */
/* pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][2]); */
}
if(RegAddr == rTxAGC_A_Mcs07_Mcs04)
if (RegAddr == rTxAGC_A_Mcs07_Mcs04)
{
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][3] = Data;
/* printk("MCSTxPowerLevelOriginalOffset[%d][3]-TxAGC_A_Mcs07_Mcs04 = 0x%x\n", pHalData->pwrGroupCnt, */
/* pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][3]); */
}
if(RegAddr == rTxAGC_A_Mcs11_Mcs08)
if (RegAddr == rTxAGC_A_Mcs11_Mcs08)
{
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][4] = Data;
/* printk("MCSTxPowerLevelOriginalOffset[%d][4]-TxAGC_A_Mcs11_Mcs08 = 0x%x\n", pHalData->pwrGroupCnt, */
/* pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][4]); */
}
if(RegAddr == rTxAGC_A_Mcs15_Mcs12)
if (RegAddr == rTxAGC_A_Mcs15_Mcs12)
{
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][5] = Data;
/* printk("MCSTxPowerLevelOriginalOffset[%d][5]-TxAGC_A_Mcs15_Mcs12 = 0x%x\n", pHalData->pwrGroupCnt,pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][5]); */
if(pHalData->rf_type== RF_1T1R)
if (pHalData->rf_type== RF_1T1R)
{
/* printk("pwrGroupCnt = %d\n", pHalData->pwrGroupCnt); */
pHalData->pwrGroupCnt++;
}
}
if(RegAddr == rTxAGC_B_Rate18_06)
if (RegAddr == rTxAGC_B_Rate18_06)
{
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][8] = Data;
/* printk("MCSTxPowerLevelOriginalOffset[%d][8]-TxAGC_B_Rate18_06 = 0x%x\n", pHalData->pwrGroupCnt, */
/* pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][8]); */
}
if(RegAddr == rTxAGC_B_Rate54_24)
if (RegAddr == rTxAGC_B_Rate54_24)
{
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][9] = Data;
/* printk("MCSTxPowerLevelOriginalOffset[%d][9]-TxAGC_B_Rate54_24 = 0x%x\n", pHalData->pwrGroupCnt, */
/* pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][9]); */
}
if(RegAddr == rTxAGC_B_CCK1_55_Mcs32)
if (RegAddr == rTxAGC_B_CCK1_55_Mcs32)
{
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][14] = Data;
/* printk("MCSTxPowerLevelOriginalOffset[%d][14]-TxAGC_B_CCK1_55_Mcs32 = 0x%x\n", pHalData->pwrGroupCnt, */
/* pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][14]); */
}
if(RegAddr == rTxAGC_B_CCK11_A_CCK2_11 && BitMask == 0x000000ff)
if (RegAddr == rTxAGC_B_CCK11_A_CCK2_11 && BitMask == 0x000000ff)
{
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][15] = Data;
/* printk("MCSTxPowerLevelOriginalOffset[%d][15]-TxAGC_B_CCK11_A_CCK2_11 = 0x%x\n", pHalData->pwrGroupCnt, */
/* pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][15]); */
}
if(RegAddr == rTxAGC_B_Mcs03_Mcs00)
if (RegAddr == rTxAGC_B_Mcs03_Mcs00)
{
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][10] = Data;
/* printk("MCSTxPowerLevelOriginalOffset[%d][10]-TxAGC_B_Mcs03_Mcs00 = 0x%x\n", pHalData->pwrGroupCnt, */
/* pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][10]); */
}
if(RegAddr == rTxAGC_B_Mcs07_Mcs04)
if (RegAddr == rTxAGC_B_Mcs07_Mcs04)
{
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][11] = Data;
/* printk("MCSTxPowerLevelOriginalOffset[%d][11]-TxAGC_B_Mcs07_Mcs04 = 0x%x\n", pHalData->pwrGroupCnt, */
/* pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][11]); */
}
if(RegAddr == rTxAGC_B_Mcs11_Mcs08)
if (RegAddr == rTxAGC_B_Mcs11_Mcs08)
{
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][12] = Data;
/* printk("MCSTxPowerLevelOriginalOffset[%d][12]-TxAGC_B_Mcs11_Mcs08 = 0x%x\n", pHalData->pwrGroupCnt, */
/* pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][12]); */
}
if(RegAddr == rTxAGC_B_Mcs15_Mcs12)
if (RegAddr == rTxAGC_B_Mcs15_Mcs12)
{
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][13] = Data;
/* printk("MCSTxPowerLevelOriginalOffset[%d][13]-TxAGC_B_Mcs15_Mcs12 = 0x%x\n", pHalData->pwrGroupCnt, */
/* pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][13]); */
if(pHalData->rf_type != RF_1T1R)
if (pHalData->rf_type != RF_1T1R)
{
/* printk("pwrGroupCnt = %d\n", pHalData->pwrGroupCnt); */
pHalData->pwrGroupCnt++;
@ -1063,10 +1063,10 @@ phy_BB8188E_Config_ParaFile(
/* 1. Read PHY_REG.TXT BB INIT!! */
/* We will seperate as 88C / 92C according to chip version */
/* */
if(HAL_STATUS_FAILURE ==ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG))
if (HAL_STATUS_FAILURE ==ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG))
rtStatus = _FAIL;
if(rtStatus != _SUCCESS){
if (rtStatus != _SUCCESS){
/* RT_TRACE(COMP_INIT, DBG_SERIOUS, ("phy_BB8192S_Config_ParaFile():Write BB Reg Fail!!")); */
goto phy_BB8190_Config_ParaFile_Fail;
}
@ -1074,7 +1074,7 @@ phy_BB8188E_Config_ParaFile(
/* */
/* 20100318 Joseph: Config 2T2R to 1T2R if necessary. */
/* */
/* if(pHalData->rf_type == RF_1T2R) */
/* if (pHalData->rf_type == RF_1T2R) */
/* */
/* phy_BB8192C_Config_1T(Adapter); */
/* DBG_8192C("phy_BB8188E_Config_ParaFile():Config to 1T!!\n"); */
@ -1086,19 +1086,19 @@ phy_BB8188E_Config_ParaFile(
if (pEEPROM->bautoload_fail_flag == false) {
pHalData->pwrGroupCnt = 0;
if(HAL_STATUS_FAILURE ==ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG_PG))
if (HAL_STATUS_FAILURE ==ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG_PG))
rtStatus = _FAIL;
}
if(rtStatus != _SUCCESS){
if (rtStatus != _SUCCESS){
/* RT_TRACE(COMP_INIT, DBG_SERIOUS, ("phy_BB8192S_Config_ParaFile():BB_PG Reg Fail!!")); */
goto phy_BB8190_Config_ParaFile_Fail;
}
/* 3. BB AGC table Initialization */
if(HAL_STATUS_FAILURE ==ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_AGC_TAB))
if (HAL_STATUS_FAILURE ==ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_AGC_TAB))
rtStatus = _FAIL;
if(rtStatus != _SUCCESS){
if (rtStatus != _SUCCESS){
/* RT_TRACE(COMP_FPGA, DBG_SERIOUS, ("phy_BB8192S_Config_ParaFile():AGC Table Fail\n")); */
goto phy_BB8190_Config_ParaFile_Fail;
}
@ -1226,7 +1226,7 @@ PHY_ConfigRFExternalPA(
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
u16 i=0;
if(!pHalData->ExternalPA)
if (!pHalData->ExternalPA)
return rtStatus;
return rtStatus;
}
@ -1310,7 +1310,7 @@ PHY_CheckBBAndRFOK(
/* */
/* Check whether readback data is correct */
/* */
if(ulRegRead != WriteData[i])
if (ulRegRead != WriteData[i])
{
/* RT_TRACE(COMP_FPGA, DBG_LOUD, ("ulRegRead: %lx, WriteData: %lx\n", ulRegRead, WriteData[i])); */
rtStatus = _FAIL;
@ -1387,7 +1387,7 @@ phy_DbmToTxPwrIdx(
break;
}
if((PowerInDbm - Offset) > 0)
if ((PowerInDbm - Offset) > 0)
{
TxPwrIdx = (u8)((PowerInDbm - Offset) * 2);
}
@ -1397,7 +1397,7 @@ phy_DbmToTxPwrIdx(
}
/* Tx Power Index is too large. */
if(TxPwrIdx > MAX_TXPWR_IDX_NMODE_92S)
if (TxPwrIdx > MAX_TXPWR_IDX_NMODE_92S)
TxPwrIdx = MAX_TXPWR_IDX_NMODE_92S;
return TxPwrIdx;
@ -1479,14 +1479,14 @@ PHY_GetTxPowerLevel8188E(
TxPwrLevel = pHalData->CurrentOfdm24GTxPwrIdx + pHalData->LegacyHTTxPowerDiff;
/* Compare with Legacy OFDM Tx power. */
if(phy_TxPwrIdxToDbm(Adapter, WIRELESS_MODE_G, TxPwrLevel) > TxPwrDbm)
if (phy_TxPwrIdxToDbm(Adapter, WIRELESS_MODE_G, TxPwrLevel) > TxPwrDbm)
TxPwrDbm = phy_TxPwrIdxToDbm(Adapter, WIRELESS_MODE_G, TxPwrLevel);
/* HT OFDM */
TxPwrLevel = pHalData->CurrentOfdm24GTxPwrIdx;
/* Compare with HT OFDM Tx power. */
if(phy_TxPwrIdxToDbm(Adapter, WIRELESS_MODE_N_24G, TxPwrLevel) > TxPwrDbm)
if (phy_TxPwrIdxToDbm(Adapter, WIRELESS_MODE_N_24G, TxPwrLevel) > TxPwrDbm)
TxPwrDbm = phy_TxPwrIdxToDbm(Adapter, WIRELESS_MODE_N_24G, TxPwrLevel);
*powerlevel = TxPwrDbm;
@ -1507,14 +1507,14 @@ static void getTxPowerIndex88E(
u8 TxCount=0,path_nums;
if((RF_1T2R == pHalData->rf_type) ||(RF_1T1R ==pHalData->rf_type ))
if ((RF_1T2R == pHalData->rf_type) ||(RF_1T1R ==pHalData->rf_type ))
path_nums = 1;
else
path_nums = 2;
for(TxCount=0;TxCount< path_nums ;TxCount++)
{
if(TxCount==RF_PATH_A)
if (TxCount==RF_PATH_A)
{
/* 1. CCK */
cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index];
@ -1531,7 +1531,7 @@ static void getTxPowerIndex88E(
/* pHalData->BW20_24G_Diff[TxCount][RF_PATH_A], */
/* BW20PowerLevel[TxCount])); */
}
else if(TxCount==RF_PATH_B)
else if (TxCount==RF_PATH_B)
{
/* 1. CCK */
cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index];
@ -1596,7 +1596,7 @@ PHY_SetTxPowerLevel8188E(
u8 BW20PowerLevel[MAX_TX_COUNT], BW40PowerLevel[MAX_TX_COUNT];
u8 i=0;
/*
#if(MP_DRIVER == 1)
#if (MP_DRIVER == 1)
if (Adapter->registrypriv.mp_mode == 1)
return;
#endif
@ -1640,7 +1640,7 @@ PHY_UpdateTxPowerDbm8188E(
u8 CckTxPwrIdx = phy_DbmToTxPwrIdx(Adapter, WIRELESS_MODE_B, powerInDbm);
u8 OfdmTxPwrIdx = phy_DbmToTxPwrIdx(Adapter, WIRELESS_MODE_N_24G, powerInDbm);
if(OfdmTxPwrIdx - pHalData->LegacyHTTxPowerDiff > 0)
if (OfdmTxPwrIdx - pHalData->LegacyHTTxPowerDiff > 0)
OfdmTxPwrIdx -= pHalData->LegacyHTTxPowerDiff;
else
OfdmTxPwrIdx = 0;
@ -1711,16 +1711,16 @@ _PHY_SetBWMode92C(
u8 regBwOpMode;
u8 regRRSR_RSC;
if(pHalData->rf_chip == RF_PSEUDO_11N)
if (pHalData->rf_chip == RF_PSEUDO_11N)
{
return;
}
/* There is no 40MHz mode in RF_8225. */
if(pHalData->rf_chip==RF_8225)
if (pHalData->rf_chip==RF_8225)
return;
if(Adapter->bDriverStopped)
if (Adapter->bDriverStopped)
return;
regBwOpMode = rtw_read8(Adapter, REG_BWOPMODE);
@ -1856,7 +1856,7 @@ PHY_SetBWMode8188E(
pHalData->nCur40MhzPrimeSC = Offset;
if((!Adapter->bDriverStopped) && (!Adapter->bSurpriseRemoved))
if ((!Adapter->bDriverStopped) && (!Adapter->bSurpriseRemoved))
_PHY_SetBWMode92C(Adapter);
else
pHalData->CurrentChannelBW = tmpBW;
@ -1899,7 +1899,7 @@ static void phy_SpurCalibration_8188E(
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
/* DbgPrint("===> phy_SpurCalibration_8188E CurrentChannelBW = %d, CurrentChannel = %d\n", pHalData->CurrentChannelBW, pHalData->CurrentChannel); */
if(pHalData->CurrentChannelBW == 0 && pHalData->CurrentChannel == 13){
if (pHalData->CurrentChannelBW == 0 && pHalData->CurrentChannel == 13){
PHY_SetBBReg(Adapter, rOFDM1_CFOTracking, BIT(28), 0x1); /* enable CSI Mask */
PHY_SetBBReg(Adapter, rOFDM1_csi_fix_mask, BIT(26)|BIT(25), 0x3); /* Fix CSI Mask Tone */
}
@ -1920,16 +1920,16 @@ PHY_SwChnl8188E( /* Call after initialization */
u8 tmpchannel = pHalData->CurrentChannel;
bool bResult = true;
if(pHalData->rf_chip == RF_PSEUDO_11N)
if (pHalData->rf_chip == RF_PSEUDO_11N)
{
/* pHalData->SwChnlInProgress=false; */
return; /* return immediately if it is peudo-phy */
}
/* if(pHalData->SwChnlInProgress) */
/* if (pHalData->SwChnlInProgress) */
/* return; */
/* if(pHalData->SetBWModeInProgress) */
/* if (pHalData->SetBWModeInProgress) */
/* return; */
/* */
@ -1956,7 +1956,7 @@ PHY_SwChnl8188E( /* Call after initialization */
/* */
/* pHalData->SwChnlInProgress = true; */
if(channel == 0)
if (channel == 0)
channel = 1;
pHalData->CurrentChannel=channel;
@ -1964,19 +1964,19 @@ PHY_SwChnl8188E( /* Call after initialization */
/* pHalData->SwChnlStage=0; */
/* pHalData->SwChnlStep=0; */
if((!Adapter->bDriverStopped) && (!Adapter->bSurpriseRemoved))
if ((!Adapter->bDriverStopped) && (!Adapter->bSurpriseRemoved))
{
_PHY_SwChnl8192C(Adapter, channel);
if (IS_VENDOR_8188E_I_CUT_SERIES(Adapter))
phy_SpurCalibration_8188E( Adapter);
if(bResult)
if (bResult)
{
/* RT_TRACE(COMP_SCAN, DBG_LOUD, ("PHY_SwChnl8192C SwChnlInProgress true schdule workitem done\n")); */
}
else
{
/* RT_TRACE(COMP_SCAN, DBG_LOUD, ("PHY_SwChnl8192C SwChnlInProgress false schdule workitem error\n")); */
/* if(IS_HARDWARE_TYPE_8192SU(Adapter)) */
/* if (IS_HARDWARE_TYPE_8192SU(Adapter)) */
/* */
/* pHalData->SwChnlInProgress = false; */
pHalData->CurrentChannel = tmpchannel;
@ -1987,7 +1987,7 @@ PHY_SwChnl8188E( /* Call after initialization */
else
{
/* RT_TRACE(COMP_SCAN, DBG_LOUD, ("PHY_SwChnl8192C SwChnlInProgress false driver sleep or unload\n")); */
/* if(IS_HARDWARE_TYPE_8192SU(Adapter)) */
/* if (IS_HARDWARE_TYPE_8192SU(Adapter)) */
/* */
/* pHalData->SwChnlInProgress = false; */
pHalData->CurrentChannel = tmpchannel;
@ -2022,12 +2022,12 @@ phy_SetSwChnlCmdArray(
{
SwChnlCmd* pCmd;
if(CmdTable == NULL)
if (CmdTable == NULL)
{
/* RT_ASSERT(false, ("phy_SetSwChnlCmdArray(): CmdTable cannot be NULL.\n")); */
return false;
}
if(CmdTableIdx >= CmdTableSz)
if (CmdTableIdx >= CmdTableSz)
{
/* RT_ASSERT(false, */
/* ("phy_SetSwChnlCmdArray(): Access invalid index, please check size of the table, CmdTableIdx:%ld, CmdTableSz:%ld\n", */
@ -2073,22 +2073,22 @@ PHY_SwChnlPhy8192C( /* Only called during initialize */
/* RT_TRACE(COMP_SCAN | COMP_RM, DBG_LOUD, ("==>PHY_SwChnlPhy8192S(), switch from channel %d to channel %d.\n", pHalData->CurrentChannel, channel)); */
/* Cannot IO. */
/* if(RT_CANNOT_IO(Adapter)) */
/* if (RT_CANNOT_IO(Adapter)) */
/* return; */
/* Channel Switching is in progress. */
/* if(pHalData->SwChnlInProgress) */
/* if (pHalData->SwChnlInProgress) */
/* return; */
/* return immediately if it is peudo-phy */
if(pHalData->rf_chip == RF_PSEUDO_11N)
if (pHalData->rf_chip == RF_PSEUDO_11N)
{
/* pHalData->SwChnlInProgress=false; */
return;
}
/* pHalData->SwChnlInProgress = true; */
if( channel == 0)
if ( channel == 0)
channel = 1;
pHalData->CurrentChannel=channel;
@ -2154,7 +2154,7 @@ static void _PHY_SetRFPathSwitch(
{
u8 u1bTmp;
if(!pAdapter->hw_init_completed)
if (!pAdapter->hw_init_completed)
{
u1bTmp = rtw_read8(pAdapter, REG_LEDCFG2) | BIT7;
rtw_write8(pAdapter, REG_LEDCFG2, u1bTmp);
@ -2162,9 +2162,9 @@ static void _PHY_SetRFPathSwitch(
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFParameter, BIT13, 0x01);
}
if(is2T)
if (is2T)
{
if(bMain)
if (bMain)
PHY_SetBBReg(pAdapter, rFPGA0_XB_RFInterfaceOE, BIT5|BIT6, 0x1); /* 92C_Path_A */
else
PHY_SetBBReg(pAdapter, rFPGA0_XB_RFInterfaceOE, BIT5|BIT6, 0x2); /* BT */
@ -2172,7 +2172,7 @@ static void _PHY_SetRFPathSwitch(
else
{
if(bMain)
if (bMain)
PHY_SetBBReg(pAdapter, rFPGA0_XA_RFInterfaceOE, 0x300, 0x2); /* Main */
else
PHY_SetBBReg(pAdapter, rFPGA0_XA_RFInterfaceOE, 0x300, 0x1); /* Aux */
@ -2187,25 +2187,25 @@ static bool _PHY_QueryRFPathSwitch(
bool is2T
)
{
/* if(is2T) */
/* if (is2T) */
/* return true; */
if(!pAdapter->hw_init_completed)
if (!pAdapter->hw_init_completed)
{
PHY_SetBBReg(pAdapter, REG_LEDCFG0, BIT23, 0x01);
PHY_SetBBReg(pAdapter, rFPGA0_XAB_RFParameter, BIT13, 0x01);
}
if(is2T)
if (is2T)
{
if(PHY_QueryBBReg(pAdapter, rFPGA0_XB_RFInterfaceOE, BIT5|BIT6) == 0x01)
if (PHY_QueryBBReg(pAdapter, rFPGA0_XB_RFInterfaceOE, BIT5|BIT6) == 0x01)
return true;
else
return false;
}
else
{
if(PHY_QueryBBReg(pAdapter, rFPGA0_XA_RFInterfaceOE, 0x300) == 0x02)
if (PHY_QueryBBReg(pAdapter, rFPGA0_XA_RFInterfaceOE, 0x300) == 0x02)
return true;
else
return false;

View file

@ -173,14 +173,14 @@ 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++)
{
@ -198,12 +198,12 @@ 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;
@ -217,7 +217,7 @@ rtl8188e_PHY_RF6052SetCckTxPower(
(pPowerlevel[idx1]<<16) | (pPowerlevel[idx1]<<24);
}
if(pHalData->EEPROMRegulatory==0)
if (pHalData->EEPROMRegulatory==0)
{
tmpval = (pHalData->MCSTxPowerLevelOriginalOffset[0][6]) +
(pHalData->MCSTxPowerLevelOriginalOffset[0][7]<<8);
@ -252,7 +252,7 @@ rtl8188e_PHY_RF6052SetCckTxPower(
ptr = (u8*)(&(TxAGC[idx1]));
for(idx2=0; idx2<4; idx2++)
{
if(*ptr > RF6052_MAX_TX_PWR)
if (*ptr > RF6052_MAX_TX_PWR)
*ptr = RF6052_MAX_TX_PWR;
ptr++;
}
@ -301,7 +301,7 @@ static void getPowerBase88E(
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];
}
@ -350,24 +350,24 @@ static 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 = 4;
if(pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20)
if (pHalData->CurrentChannelBW == HT_CHANNEL_WIDTH_20)
chnlGroup++;
else
chnlGroup+=6;
@ -383,7 +383,7 @@ static void getTxPowerWriteValByRegulatory88E(
case 3: /* Customer defined power diff. */
/* increase power diff defined by customer. */
chnlGroup = 0;
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];
@ -393,7 +393,7 @@ static void getTxPowerWriteValByRegulatory88E(
else
customer_pwr_limit = pHalData->PwrGroupHT20[rf][Channel-1];
if(pwr_diff >= customer_pwr_limit)
if (pwr_diff >= customer_pwr_limit)
pwr_diff = 0;
else
pwr_diff = customer_pwr_limit - pwr_diff;
@ -402,7 +402,7 @@ static void getTxPowerWriteValByRegulatory88E(
{
pwr_diff_limit[i] = (u8)((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) |
@ -423,19 +423,19 @@ static 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 ;
@ -472,7 +472,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];
@ -481,19 +481,19 @@ static void writeOFDMPowerReg88E(
/* printk("Set OFDM tx pwr- 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++)
{
if(i!=2)
if (i!=2)
writeVal = (writeVal>8)?(writeVal-8):0;
else
writeVal = (writeVal>6)?(writeVal-6):0;
@ -648,11 +648,11 @@ phy_RF6052_Config_ParaFile(
switch(eRFPath)
{
case RF_PATH_A:
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;
break;
case RF_PATH_B:
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;
break;
case RF_PATH_C:
@ -674,7 +674,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;
}
@ -700,7 +700,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;

View file

@ -44,7 +44,7 @@ static void process_rssi(struct adapter *padapter,union recv_frame *prframe)
struct signal_stat * signal_stat = &padapter->recvpriv.signal_strength_data;
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;
@ -61,14 +61,14 @@ static void process_link_qual(struct adapter *padapter,union recv_frame *prframe
struct rx_pkt_attrib *pattrib;
struct signal_stat * signal_stat;
if(prframe == NULL || padapter==NULL){
if (prframe == NULL || padapter==NULL){
return;
}
pattrib = &prframe->u.hdr.attrib;
signal_stat = &padapter->recvpriv.signal_qual_data;
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;
@ -130,7 +130,7 @@ void update_recvframe_attrib_88e(
/* update rx report to recv_frame attribute */
pattrib->pkt_rpt_type = (u8)((le32_to_cpu(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)(le32_to_cpu(report.rxdw0) &0x00003fff);/* u16)prxreport->pktlen; */
pattrib->drvinfo_sz = (u8)((le32_to_cpu(report.rxdw0) >> 16) & 0xf) * 8;/* u8)(prxreport->drvinfosize << 3); */
@ -156,10 +156,10 @@ void update_recvframe_attrib_88e(
pattrib->icv_err = (u8)((le32_to_cpu(report.rxdw0) >> 15) & 0x1);/* u8)prxreport->icverr; */
pattrib->shift_sz = (u8)((le32_to_cpu(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)(le32_to_cpu(report.rxdw0) & 0x3FF);/* Rx length[9:0] */
pattrib->drvinfo_sz = 0;
@ -170,7 +170,7 @@ void update_recvframe_attrib_88e(
pattrib->MacIDValidEntry[1] = le32_to_cpu(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)(le32_to_cpu(report.rxdw0) &0x00003fff);/* u16)prxreport->pktlen; */
}
@ -211,8 +211,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;
}
else

View file

@ -32,13 +32,13 @@ void rtl8188e_sreset_xmit_status_check(struct 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_hal_sreset_reset(padapter);
}
current_time = rtw_get_current_time();
if(0 == pxmitpriv->free_xmitbuf_cnt || 0 == pxmitpriv->free_xmit_extbuf_cnt) {
if (0 == pxmitpriv->free_xmitbuf_cnt || 0 == pxmitpriv->free_xmit_extbuf_cnt) {
diff_time = rtw_get_passing_time_ms(psrtpriv->last_tx_time);
@ -77,16 +77,16 @@ void rtl8188e_sreset_linked_status_check(struct 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 (psrtpriv->dbg_trigger_point == SRESET_TGP_LINK_STATUS) {

View file

@ -67,22 +67,22 @@ void _dbg_dump_tx_info(struct adapter *padapter,int frame_tag,struct tx_desc *pt
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){
DBG_8192C("=====================================\n");
DBG_8192C("txdw0(0x%08x)\n",ptxdesc->txdw0);
DBG_8192C("txdw1(0x%08x)\n",ptxdesc->txdw1);

View file

@ -52,7 +52,7 @@ 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;
}
@ -89,7 +89,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;
}
@ -100,7 +100,7 @@ SwLedOff(
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

@ -44,7 +44,7 @@ void rtl8188eu_init_recvbuf(struct 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;
@ -64,13 +64,13 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter)
#ifdef CONFIG_USB_INTERRUPT_IN_PIPE
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;
}
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;
@ -81,7 +81,7 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter)
_rtw_init_queue(&precvpriv->free_recv_buf_queue);
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;
@ -100,7 +100,7 @@ int rtl8188eu_init_recv_priv(struct 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;
@ -130,7 +130,7 @@ int rtl8188eu_init_recv_priv(struct adapter *padapter)
{
pskb = rtw_skb_alloc(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
if(pskb)
if (pskb)
{
pskb->dev = padapter->pnetdev;
@ -164,14 +164,14 @@ void rtl8188eu_free_recv_priv (struct adapter *padapter)
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
if(precvpriv->int_in_urb)
if (precvpriv->int_in_urb)
usb_free_urb(precvpriv->int_in_urb);
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

@ -163,19 +163,19 @@ static void fill_txdesc_vcs(struct pkt_attrib *pattrib, __le32 *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);
@ -187,15 +187,15 @@ static void fill_txdesc_phy(struct pkt_attrib *pattrib, __le32 *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);
@ -221,7 +221,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
#endif /* CONFIG_P2P */
if (padapter->registrypriv.mp_mode == 0) {
if((!bagg_pkt) &&(urb_zero_packet_chk(padapter, sz)==0)) {
if ((!bagg_pkt) &&(urb_zero_packet_chk(padapter, sz)==0)) {
ptxdesc = (struct tx_desc *)(pmem+PACKET_OFFSET_SZ);
pull = 1;
}
@ -240,8 +240,8 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
if (bmcst) ptxdesc->txdw0 |= cpu_to_le32(BMC);
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;
}
}
@ -252,7 +252,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
/* 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"); */
@ -267,7 +267,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
fill_txdesc_sectype(pattrib, ptxdesc);
if(pattrib->ampdu_en==true){
if (pattrib->ampdu_en==true){
ptxdesc->txdw2 |= cpu_to_le32(AGG_EN);/* AGG EN */
ptxdesc->txdw6 = cpu_to_le32(0x6666f800);
} else{
@ -305,14 +305,14 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
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 */
}
data_rate =ODM_RA_GetDecisionRate_8188E(&pHalData->odmpriv,pattrib->mac_id);
/* for debug */
if(padapter->fix_rate!= 0xFF){
if (padapter->fix_rate!= 0xFF){
data_rate = padapter->fix_rate;
ptxdesc->txdw4 |= cpu_to_le32(DISDATAFB);
@ -326,11 +326,11 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
#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->txdw4 | cpu_to_le32(DISDATAFB);
}
@ -352,7 +352,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
ptxdesc->txdw5 |= cpu_to_le32(MRateToHwRate(pmlmeext->tx_rate));
}
} else if((pxmitframe->frame_tag&0x0f)== MGNT_FRAMETAG) {
} else if ((pxmitframe->frame_tag&0x0f)== MGNT_FRAMETAG) {
/* offset 4 */
ptxdesc->txdw1 |= cpu_to_le32(pattrib->mac_id&0x3f);
@ -378,13 +378,13 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
/* 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);
}
@ -394,7 +394,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
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");
}
@ -424,7 +424,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
/* (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->txdw3 |= cpu_to_le32(EN_HWSEQ); /* Hw set sequence number */
ptxdesc->txdw4 |= cpu_to_le32(HW_SSN); /* Hw set sequence number */
@ -478,7 +478,7 @@ static s32 rtw_dump_xframe(struct adapter *padapter, struct xmit_frame *pxmitfra
pull = update_txdesc(pxmitframe, mem_addr, sz, false);
if(pull)
if (pull)
{
mem_addr += PACKET_OFFSET_SZ; /* pull txdesc head */
@ -525,7 +525,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;
@ -643,13 +643,13 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *padapter, struct xmit_priv *pxm
/* dequeue same priority packet from station tx queue */
/* psta = pfirstframe->attrib.psta; */
psta = rtw_get_stainfo(&padapter->stapriv, pfirstframe->attrib.ra);
if(pfirstframe->attrib.psta != psta){
if (pfirstframe->attrib.psta != psta){
DBG_871X("%s, pattrib->psta(%p) != psta(%p)\n", __func__, pfirstframe->attrib.psta, psta);
}
if (psta == NULL) {
DBG_8192C("rtw_xmit_classifier: psta == NULL\n");
}
if(!(psta->state &_FW_LINKED)){
if (!(psta->state &_FW_LINKED)){
DBG_871X("%s, psta->state(0x%x) != _FW_LINKED\n", __func__, psta->state);
}
@ -956,7 +956,7 @@ s32 rtl8188eu_hostap_mgnt_xmit_entry(struct adapter *padapter, _pkt *pkt)
pxmit_skb = rtw_skb_alloc(len + TXDESC_SIZE);
if(!pxmit_skb)
if (!pxmit_skb)
goto _exit;
pxmitbuf = pxmit_skb->data;
@ -975,7 +975,7 @@ s32 rtl8188eu_hostap_mgnt_xmit_entry(struct 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));
}

View file

@ -83,14 +83,14 @@ static bool HalUsbSetQueuePipeMapping8188EUsb(
_ConfigNormalChipOutEP_8188E(pAdapter, NumOutPipe);
/* Normal chip with one IN and one OUT doesn't have interrupt IN EP. */
if(1 == pHalData->OutEpNumber){
if(1 != NumInPipe){
if (1 == pHalData->OutEpNumber){
if (1 != NumInPipe){
return result;
}
}
/* All config other than above support one Bulk IN and one Interrupt IN. */
/* if(2 != NumInPipe){ */
/* if (2 != NumInPipe){ */
/* return result; */
/* */
@ -137,10 +137,10 @@ static u32 InitPowerOn_rtl8188eu(struct adapter *padapter)
/* HW Power on sequence */
rtw_hal_get_hwreg(padapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn);
if(bMacPwrCtrlOn == true)
if (bMacPwrCtrlOn == true)
return _SUCCESS;
if(!HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, Rtl8188E_NIC_PWR_ON_FLOW))
if (!HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, Rtl8188E_NIC_PWR_ON_FLOW))
{
DBG_871X(KERN_ERR "%s: run power on flow fail\n", __func__);
return _FAIL;
@ -193,7 +193,7 @@ static void _InitPABias(struct adapter *padapter)
/* RT_TRACE(COMP_INIT, DBG_LOUD, ("_InitPABias 0x1FA 0x%x\n",pa_setting)); */
if(!(pa_setting & BIT0))
if (!(pa_setting & BIT0))
{
PHY_SetRFReg(padapter, RF_PATH_A, 0x15, 0x0FFFFF, 0x0F406);
PHY_SetRFReg(padapter, RF_PATH_A, 0x15, 0x0FFFFF, 0x4F406);
@ -202,7 +202,7 @@ static void _InitPABias(struct adapter *padapter)
/* RT_TRACE(COMP_INIT, DBG_LOUD, ("PA BIAS path A\n")); */
}
if(!(pa_setting & BIT1) && is92C)
if (!(pa_setting & BIT1) && is92C)
{
PHY_SetRFReg(padapter,RF_PATH_B, 0x15, 0x0FFFFF, 0x0F406);
PHY_SetRFReg(padapter,RF_PATH_B, 0x15, 0x0FFFFF, 0x4F406);
@ -211,7 +211,7 @@ static void _InitPABias(struct adapter *padapter)
/* RT_TRACE(COMP_INIT, DBG_LOUD, ("PA BIAS path B\n")); */
}
if(!(pa_setting & BIT4))
if (!(pa_setting & BIT4))
{
pa_setting = rtw_read8(padapter, 0x16);
pa_setting &= 0x0F;
@ -226,13 +226,13 @@ static void _InitBTCoexist(struct adapter *padapter)
struct btcoexist_priv *pbtpriv = &(pHalData->bt_coexist);
u8 u1Tmp;
if(pbtpriv->BT_Coexist && pbtpriv->BT_CoexistType == BT_CSR_BC4)
if (pbtpriv->BT_Coexist && pbtpriv->BT_CoexistType == BT_CSR_BC4)
{
/* if MP_DRIVER != 1 */
if (padapter->registrypriv.mp_mode == 0)
{
if(pbtpriv->BT_Ant_isolation)
if (pbtpriv->BT_Ant_isolation)
{
rtw_write8( padapter,REG_GPIO_MUXCFG, 0xa0);
DBG_8192C("BT write 0x%x = 0x%x\n", REG_GPIO_MUXCFG, 0xa0);
@ -329,7 +329,7 @@ _InitInterrupt(
usb_opt = rtw_read8(Adapter, REG_USB_SPECIAL_OPTION);
if(!adapter_to_dvobj(Adapter)->ishighspeed
if (!adapter_to_dvobj(Adapter)->ishighspeed
#ifdef CONFIG_USB_INTERRUPT_IN_PIPE
|| pHalData->RtIntInPipe == 0x05
#endif
@ -357,7 +357,7 @@ _InitQueueReservedPage(
u8 value8;
bool bWiFiConfig = pregistrypriv->wifi_spec;
if((bWiFiConfig)|| (pregistrypriv->qos_opt_enable))
if ((bWiFiConfig)|| (pregistrypriv->qos_opt_enable))
{
if (pHalData->OutEpQueueSel & TX_SELE_HQ)
{
@ -509,7 +509,7 @@ _InitNormalChipTwoOutEpPriority(
break;
}
if(!pregistrypriv->wifi_spec ){
if (!pregistrypriv->wifi_spec ){
beQ = valueLow;
bkQ = valueLow;
viQ = valueHi;
@ -538,7 +538,7 @@ _InitNormalChipThreeOutEpPriority(
struct registry_priv *pregistrypriv = &Adapter->registrypriv;
u16 beQ,bkQ,viQ,voQ,mgtQ,hiQ;
if(!pregistrypriv->wifi_spec ){/* typical setting */
if (!pregistrypriv->wifi_spec ){/* typical setting */
beQ = QUEUE_LOW;
bkQ = QUEUE_LOW;
viQ = QUEUE_NORMAL;
@ -803,10 +803,10 @@ usb_AggSettingTxUpdate(
/* PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo); */
u32 value32;
if(Adapter->registrypriv.wifi_spec)
if (Adapter->registrypriv.wifi_spec)
pHalData->UsbTxAggMode = false;
if(pHalData->UsbTxAggMode){
if (pHalData->UsbTxAggMode){
value32 = rtw_read32(Adapter, REG_TDECTRL);
value32 = value32 & ~(BLK_DESC_NUM_MASK << BLK_DESC_NUM_SHIFT);
value32 |= ((pHalData->UsbTxAggDescNum & BLK_DESC_NUM_MASK) << BLK_DESC_NUM_SHIFT);
@ -1012,7 +1012,7 @@ _InitRFType(
pHalData->rf_chip = RF_6052;
if(false == is92CU){
if (false == is92CU){
pHalData->rf_type = RF_1T1R;
DBG_8192C("Set RF Chip ID to RF_6052 and RF type to 1T1R.\n");
return;
@ -1071,14 +1071,14 @@ _InitAntenna_Selection(struct adapter *Adapter)
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
if(pHalData->AntDivCfg==0)
if (pHalData->AntDivCfg==0)
return;
DBG_8192C("==> %s ....\n",__FUNCTION__);
rtw_write32(Adapter, REG_LEDCFG0, rtw_read32(Adapter, REG_LEDCFG0)|BIT23);
PHY_SetBBReg(Adapter, rFPGA0_XAB_RFParameter, BIT13, 0x01);
if(PHY_QueryBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, 0x300) == Antenna_A)
if (PHY_QueryBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, 0x300) == Antenna_A)
pHalData->CurAntenna = Antenna_A;
else
pHalData->CurAntenna = Antenna_B;
@ -1128,7 +1128,7 @@ rt_rf_power_state RfOnOffDetect(struct adapter *pAdapter )
u8 val8;
rt_rf_power_state rfpowerstate = rf_off;
if(adapter_to_pwrctl(pAdapter)->bHWPowerdown)
if (adapter_to_pwrctl(pAdapter)->bHWPowerdown)
{
val8 = rtw_read8(pAdapter, REG_HSISR);
DBG_8192C("pwrdown, 0x5c(BIT7)=%02x\n", val8);
@ -1238,11 +1238,11 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter)
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_BEGIN);
if(pwrctrlpriv->bkeepfwalive)
if (pwrctrlpriv->bkeepfwalive)
{
_ps_open_RF(Adapter);
if(pHalData->odmpriv.RFCalibrateInfo.bIQKInitialized){
if (pHalData->odmpriv.RFCalibrateInfo.bIQKInitialized){
PHY_IQCalibrate_8188E(Adapter,true);
}
else
@ -1260,7 +1260,7 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter)
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_PW_ON);
status = InitPowerOn_rtl8188eu(Adapter);
if(status == _FAIL){
if (status == _FAIL){
RT_TRACE(_module_hci_hal_init_c_, _drv_err_, ("Failed to init power on!\n"));
goto exit;
}
@ -1269,7 +1269,7 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter)
pHalData->CurrentChannel = 6;/* default set to 6 */
if(pwrctrlpriv->reg_rfoff == true){
if (pwrctrlpriv->reg_rfoff == true){
pwrctrlpriv->rf_pwrstate = rf_off;
}
@ -1315,7 +1315,7 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter)
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MAC);
#if (HAL_MAC_ENABLE == 1)
status = PHY_MACConfig8188E(Adapter);
if(status == _FAIL)
if (status == _FAIL)
{
DBG_871X(" ### Failed to init MAC ......\n ");
goto exit;
@ -1328,7 +1328,7 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter)
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_BB);
#if (HAL_BB_ENABLE == 1)
status = PHY_BBConfig8188E(Adapter);
if(status == _FAIL)
if (status == _FAIL)
{
DBG_871X(" ### Failed to init BB ......\n ");
goto exit;
@ -1339,7 +1339,7 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter)
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_RF);
#if (HAL_RF_ENABLE == 1)
status = PHY_RFConfig8188E(Adapter);
if(status == _FAIL)
if (status == _FAIL)
{
DBG_871X(" ### Failed to init RF ......\n ");
goto exit;
@ -1348,7 +1348,7 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter)
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_EFUSE_PATCH);
status = rtl8188e_iol_efuse_patch(Adapter);
if(status == _FAIL){
if (status == _FAIL){
DBG_871X("%s rtl8188e_iol_efuse_patch failed\n",__FUNCTION__);
goto exit;
}
@ -1357,7 +1357,7 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter)
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_LLTT);
status = InitLLTTable(Adapter, txpktbuf_bndy);
if(status == _FAIL){
if (status == _FAIL){
RT_TRACE(_module_hci_hal_init_c_, _drv_err_, ("Failed to init LLT table\n"));
goto exit;
}
@ -1391,7 +1391,7 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter)
_InitHardwareDropIncorrectBulkOut(Adapter);
if(pHalData->bRDGEnable){
if (pHalData->bRDGEnable){
_InitRDGSetting(Adapter);
}
@ -1449,7 +1449,7 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter)
/* set 0x0 to 0xFF by tynli. Default enable HW SEQ NUM. */
rtw_write8(Adapter,REG_HWSEQ_CTRL, 0xFF);
if(pregistrypriv->wifi_spec)
if (pregistrypriv->wifi_spec)
rtw_write16(Adapter,REG_FAST_EDCA_CTRL ,0);
/* Nav limit , suggest by scott */
@ -1493,9 +1493,9 @@ static u32 rtl8188eu_hal_init(struct adapter *Adapter)
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_IQK);
/* 2010/08/26 MH Merge from 8192CE. */
if(pwrctrlpriv->rf_pwrstate == rf_on)
if (pwrctrlpriv->rf_pwrstate == rf_on)
{
if(pHalData->odmpriv.RFCalibrateInfo.bIQKInitialized){
if (pHalData->odmpriv.RFCalibrateInfo.bIQKInitialized){
PHY_IQCalibrate_8188E(Adapter,true);
} else {
PHY_IQCalibrate_8188E(Adapter,false);
@ -1554,7 +1554,7 @@ static void hal_poweroff_rtl8188eu(
u8 bMacPwrCtrlOn=false;
rtw_hal_get_hwreg(Adapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn);
if(bMacPwrCtrlOn == false)
if (bMacPwrCtrlOn == false)
return ;
RT_TRACE(COMP_INIT, DBG_LOUD, ("%s\n",__FUNCTION__));
@ -1636,14 +1636,14 @@ static u32 rtl8188eu_hal_deinit(struct adapter *Adapter)
rtw_write32(Adapter, REG_HIMRE_88E, IMR_DISABLED_88E);
DBG_8192C("bkeepfwalive(%x)\n", pwrctl->bkeepfwalive);
if(pwrctl->bkeepfwalive) {
if((pwrctl->bHWPwrPindetect) && (pwrctl->bHWPowerdown))
if (pwrctl->bkeepfwalive) {
if ((pwrctl->bHWPwrPindetect) && (pwrctl->bHWPowerdown))
rtl8188eu_hw_power_down(Adapter);
} else {
if(Adapter->hw_init_completed == true){
if (Adapter->hw_init_completed == true){
hal_poweroff_rtl8188eu(Adapter);
if((pwrctl->bHWPwrPindetect ) && (pwrctl->bHWPowerdown))
if ((pwrctl->bHWPwrPindetect ) && (pwrctl->bHWPowerdown))
rtl8188eu_hw_power_down(Adapter);
}
@ -1680,7 +1680,7 @@ static unsigned int rtl8188eu_inirp_init(struct adapter *Adapter)
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
for(i=0; i<NR_RECVBUFF; i++)
{
if(_read_port(pintfhdl, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf) == false )
if (_read_port(pintfhdl, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf) == false )
{
RT_TRACE(_module_hci_hal_init_c_,_drv_err_,("usb_rx_init: usb_read_port error\n"));
status = _FAIL;
@ -1692,14 +1692,14 @@ static unsigned int rtl8188eu_inirp_init(struct adapter *Adapter)
}
#ifdef CONFIG_USB_INTERRUPT_IN_PIPE
if(pHalData->RtIntInPipe != 0x05)
if (pHalData->RtIntInPipe != 0x05)
{
status = _FAIL;
DBG_871X("%s =>Warning !! Have not USB Int-IN pipe, pHalData->RtIntInPipe(%d)!!!\n",__FUNCTION__,pHalData->RtIntInPipe);
goto exit;
}
_read_interrupt = pintfhdl->io_ops._read_interrupt;
if(_read_interrupt(pintfhdl, RECV_INT_IN_ADDR) == false )
if (_read_interrupt(pintfhdl, RECV_INT_IN_ADDR) == false )
{
RT_TRACE(_module_hci_hal_init_c_,_drv_err_,("usb_rx_init: usb_read_interrupt error\n"));
status = _FAIL;
@ -1839,7 +1839,7 @@ Hal_EfuseParsePIDVID_8188EU(
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
if( !AutoLoadFail )
if ( !AutoLoadFail )
{
/* VID, PID */
pHalData->EEPROMVID = EF2BYTE(*(__le16 *)&hwinfo[EEPROM_VID_88EU]);
@ -1981,7 +1981,7 @@ static int _ReadAdapterInfo8188EU(struct adapter *Adapter)
/* Efuse_InitSomeVar(Adapter); */
/* if(IS_HARDWARE_TYPE_8723A(Adapter)) */
/* if (IS_HARDWARE_TYPE_8723A(Adapter)) */
/* _EfuseCellSel(Adapter); */
_ReadRFType(Adapter);/* rf_chip -> _InitRFType() */
@ -2041,7 +2041,7 @@ static void UpdateInterruptMask8188EU(struct adapter *padapter,u8 bHIMR0 ,u32 Ad
u32 *himr;
pHalData = GET_HAL_DATA(padapter);
if(bHIMR0)
if (bHIMR0)
himr = &(pHalData->IntrMask[0]);
else
himr = &(pHalData->IntrMask[1]);
@ -2052,7 +2052,7 @@ static void UpdateInterruptMask8188EU(struct adapter *padapter,u8 bHIMR0 ,u32 Ad
if (RemoveMSR)
*himr &= (~RemoveMSR);
if(bHIMR0)
if (bHIMR0)
rtw_write32(padapter, REG_HIMR_88E, *himr);
else
rtw_write32(padapter, REG_HIMRE_88E, *himr);
@ -2090,20 +2090,20 @@ static void hw_var_set_opmode(struct adapter *Adapter, u8 variable, u8* val)
DBG_871X("%s()-%d mode = %d\n", __FUNCTION__, __LINE__, mode);
if((mode == _HW_STATE_STATION_) || (mode == _HW_STATE_NOLINK_))
if ((mode == _HW_STATE_STATION_) || (mode == _HW_STATE_NOLINK_))
{
StopTxBeacon(Adapter);
rtw_write8(Adapter,REG_BCN_CTRL, 0x19);/* disable atim wnd */
}
else if((mode == _HW_STATE_ADHOC_) /*|| (mode == _HW_STATE_AP_)*/)
else if ((mode == _HW_STATE_ADHOC_) /*|| (mode == _HW_STATE_AP_)*/)
{
ResumeTxBeacon(Adapter);
rtw_write8(Adapter,REG_BCN_CTRL, 0x1a);
/* BIT3 - If set 0, hw will clr bcnq when tx becon ok/fail or port 0 */
rtw_write8(Adapter, REG_MBID_NUM, rtw_read8(Adapter, REG_MBID_NUM)|BIT(3)|BIT(4));
}
else if(mode == _HW_STATE_AP_)
else if (mode == _HW_STATE_AP_)
{
ResumeTxBeacon(Adapter);
@ -2178,7 +2178,7 @@ static void hw_var_set_bcn_func(struct adapter *Adapter, u8 variable, u8* val)
bcn_ctrl_reg = REG_BCN_CTRL;
if(*((u8 *)val))
if (*((u8 *)val))
rtw_write8(Adapter, bcn_ctrl_reg, (EN_BCN_FUNCTION | EN_TXBCN_RPT));
else
rtw_write8(Adapter, bcn_ctrl_reg, rtw_read8(Adapter, bcn_ctrl_reg)&(~(EN_BCN_FUNCTION | EN_TXBCN_RPT)));
@ -2285,7 +2285,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
tsf = pmlmeext->TSFValue - rtw_modular64(pmlmeext->TSFValue, (pmlmeinfo->bcn_interval*1024)) -1024; /* us */
if(((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE))
if (((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE))
{
/* pHalData->RegTxPause |= STOP_BCNQ;BIT(6) */
/* rtw_write8(Adapter, REG_TXPAUSE, (rtw_read8(Adapter, REG_TXPAUSE)|BIT(6))); */
@ -2302,7 +2302,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
rtw_write8(Adapter, REG_BCN_CTRL, rtw_read8(Adapter, REG_BCN_CTRL)|BIT(3));
if(((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE))
if (((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE))
{
/* pHalData->RegTxPause &= (~STOP_BCNQ); */
/* rtw_write8(Adapter, REG_TXPAUSE, (rtw_read8(Adapter, REG_TXPAUSE)&(~BIT(6)))); */
@ -2311,7 +2311,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
}
break;
case HW_VAR_CHECK_BSSID:
if(*((u8 *)val))
if (*((u8 *)val))
{
rtw_write32(Adapter, REG_RCR, rtw_read32(Adapter, REG_RCR)|RCR_CBSSID_DATA|RCR_CBSSID_BCN);
}
@ -2341,7 +2341,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
}
break;
case HW_VAR_MLME_SITESURVEY:
if(*((u8 *)val))/* under sitesurvey */
if (*((u8 *)val))/* under sitesurvey */
{
/* config RCR to receive different BSSID & not to receive data frame */
u32 v = rtw_read32(Adapter, REG_RCR);
@ -2368,7 +2368,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
/* enable update TSF */
rtw_write8(Adapter, REG_BCN_CTRL, rtw_read8(Adapter, REG_BCN_CTRL)&(~BIT(4)));
}
else if((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
else if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
{
/* rtw_write32(Adapter, REG_RCR, rtw_read32(Adapter, REG_RCR)|RCR_ADF); */
rtw_write16(Adapter, REG_RXFLTMAP2,0xFFFF);
@ -2377,11 +2377,11 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
rtw_write8(Adapter, REG_BCN_CTRL, rtw_read8(Adapter, REG_BCN_CTRL)&(~BIT(4)));
}
if((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
rtw_write32(Adapter, REG_RCR, rtw_read32(Adapter, REG_RCR)|RCR_CBSSID_BCN);
else
{
if(Adapter->in_cta_test)
if (Adapter->in_cta_test)
{
u32 v = rtw_read32(Adapter, REG_RCR);
v &= ~(RCR_CBSSID_DATA | RCR_CBSSID_BCN );/* RCR_ADF */
@ -2400,13 +2400,13 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
u8 type = *((u8 *)val);
struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;
if(type == 0) /* prepare to join */
if (type == 0) /* prepare to join */
{
/* enable to rx data frame.Accept all data frame */
/* rtw_write32(padapter, REG_RCR, rtw_read32(padapter, REG_RCR)|RCR_ADF); */
rtw_write16(Adapter, REG_RXFLTMAP2,0xFFFF);
if(Adapter->in_cta_test)
if (Adapter->in_cta_test)
{
u32 v = rtw_read32(Adapter, REG_RCR);
v &= ~(RCR_CBSSID_DATA | RCR_CBSSID_BCN );/* RCR_ADF */
@ -2417,7 +2417,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
rtw_write32(Adapter, REG_RCR, rtw_read32(Adapter, REG_RCR)|RCR_CBSSID_DATA|RCR_CBSSID_BCN);
}
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true)
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true)
{
RetryLimit = (pHalData->CustomerID == RT_CID_CCX) ? 7 : 48;
}
@ -2426,16 +2426,16 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
RetryLimit = 0x7;
}
}
else if(type == 1) /* joinbss_event call back when join res < 0 */
else if (type == 1) /* joinbss_event call back when join res < 0 */
{
rtw_write16(Adapter, REG_RXFLTMAP2,0x00);
}
else if(type == 2) /* sta add event call back */
else if (type == 2) /* sta add event call back */
{
/* enable update TSF */
rtw_write8(Adapter, REG_BCN_CTRL, rtw_read8(Adapter, REG_BCN_CTRL)&(~BIT(4)));
if(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE))
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE))
{
RetryLimit = 0x7;
}
@ -2463,9 +2463,9 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
rtw_write8(Adapter, REG_SLOT, val[0]);
if(pmlmeinfo->WMM_enable == 0)
if (pmlmeinfo->WMM_enable == 0)
{
if( pmlmeext->cur_wireless_mode == WIRELESS_11B)
if ( pmlmeext->cur_wireless_mode == WIRELESS_11B)
aSifsTime = 10;
else
aSifsTime = 16;
@ -2496,7 +2496,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
/* Joseph marked out for Netgear 3500 TKIP channel 7 issue.(Temporarily) */
regTmp = (pHalData->nCur40MhzPrimeSC)<<5;
/* regTmp = 0; */
if(bShortPreamble)
if (bShortPreamble)
regTmp |= 0x80;
rtw_write8(Adapter, REG_RRSR+2, regTmp);
@ -2510,7 +2510,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
/* DBG_871X("HW_VAR_DM_FLAG ==> SupportAbility:0x%08x\n",podmpriv->SupportAbility ); */
break;
case HW_VAR_DM_FUNC_OP:
if(val[0])
if (val[0])
{/* save dm flag */
podmpriv->BK_SupportAbility = podmpriv->SupportAbility;
}
@ -2524,7 +2524,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
/* ); */
break;
case HW_VAR_DM_FUNC_SET:
if(*((u32 *)val) == DYNAMIC_ALL_FUNC_ENABLE){
if (*((u32 *)val) == DYNAMIC_ALL_FUNC_ENABLE){
pdmpriv->DMFlag = pdmpriv->InitDMFlag;
podmpriv->SupportAbility = pdmpriv->InitODMFlag;
}
@ -2548,7 +2548,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
for(i=0;i<CAM_CONTENT_COUNT;i++)
{
/* filled id in CAM config 2 byte */
if( i == 0)
if ( i == 0)
{
ulContent |=(ucIndex & 0x03) | ((u16)(ulEncAlgo)<<2);
/* ulContent |= CAM_VALID; */
@ -2599,20 +2599,20 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
u8 acm_ctrl = *((u8 *)val);
u8 AcmCtrl = rtw_read8( Adapter, REG_ACMHWCTRL);
if(acm_ctrl > 1)
if (acm_ctrl > 1)
AcmCtrl = AcmCtrl | 0x1;
if(acm_ctrl & BIT(3))
if (acm_ctrl & BIT(3))
AcmCtrl |= AcmHw_VoqEn;
else
AcmCtrl &= (~AcmHw_VoqEn);
if(acm_ctrl & BIT(2))
if (acm_ctrl & BIT(2))
AcmCtrl |= AcmHw_ViqEn;
else
AcmCtrl &= (~AcmHw_ViqEn);
if(acm_ctrl & BIT(1))
if (acm_ctrl & BIT(1))
AcmCtrl |= AcmHw_BeqEn;
else
AcmCtrl &= (~AcmHw_BeqEn);
@ -2627,7 +2627,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
u8 SecMinSpace;
MinSpacingToSet = *((u8 *)val);
if(MinSpacingToSet <= 7)
if (MinSpacingToSet <= 7)
{
switch(Adapter->securitypriv.dot11PrivacyAlgrthm)
{
@ -2647,7 +2647,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
break;
}
if(MinSpacingToSet < SecMinSpace){
if (MinSpacingToSet < SecMinSpace){
MinSpacingToSet = SecMinSpace;
}
@ -2665,7 +2665,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
u8 index = 0;
#ifdef CONFIG_BT_COEXIST
if( (pHalData->bt_coexist.BT_Coexist) &&
if ( (pHalData->bt_coexist.BT_Coexist) &&
(pHalData->bt_coexist.BT_CoexistType == BT_CSR_BC4) )
pRegToSet = RegToSet_BT; /* 0x97427431; */
else
@ -2673,18 +2673,18 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
pRegToSet = RegToSet_Normal; /* 0xb972a841; */
FactorToSet = *((u8 *)val);
if(FactorToSet <= 3)
if (FactorToSet <= 3)
{
FactorToSet = (1<<(FactorToSet + 2));
if(FactorToSet>0xf)
if (FactorToSet>0xf)
FactorToSet = 0xf;
for(index=0; index<4; index++)
{
if((pRegToSet[index] & 0xf0) > (FactorToSet<<4))
if ((pRegToSet[index] & 0xf0) > (FactorToSet<<4))
pRegToSet[index] = (pRegToSet[index] & 0x0f) | (FactorToSet<<4);
if((pRegToSet[index] & 0x0f) > FactorToSet)
if ((pRegToSet[index] & 0x0f) > FactorToSet)
pRegToSet[index] = (pRegToSet[index] & 0xf0) | (FactorToSet);
rtw_write8(Adapter, (REG_AGGLEN_LMT+index), pRegToSet[index]);
@ -2697,7 +2697,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
case HW_VAR_RXDMA_AGG_PG_TH:
{
u8 threshold = *((u8 *)val);
if( threshold == 0)
if ( threshold == 0)
{
threshold = pHalData->UsbRxAggPageCount;
}
@ -2712,7 +2712,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
/* Forece leave RF low power mode for 1T1R to prevent conficting setting in Fw power */
/* saving sequence. 2010.06.07. Added by tynli. Suggested by SD3 yschang. */
if( (psmode != PS_MODE_ACTIVE) && (!IS_92C_SERIAL(pHalData->VersionID)))
if ( (psmode != PS_MODE_ACTIVE) && (!IS_92C_SERIAL(pHalData->VersionID)))
{
ODM_RF_Saving(podmpriv, true);
}
@ -2738,7 +2738,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
DIG_T *pDigTable = &podmpriv->DM_DigTable;
u32 rx_gain = ((u32 *)(val))[0];
if(rx_gain == 0xff){/* restore rx gain */
if (rx_gain == 0xff){/* restore rx gain */
ODM_Write_DIG(podmpriv,pDigTable->BackupIGValue);
}
else{
@ -2778,7 +2778,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
u8 Ant ;
/* switch antenna to Optimum_antenna */
/* DBG_8192C("==> HW_VAR_ANTENNA_DIVERSITY_SELECT , Ant_(%s)\n",(Optimum_antenna==2)?"A":"B"); */
if(pHalData->CurAntenna != Optimum_antenna)
if (pHalData->CurAntenna != Optimum_antenna)
{
Ant = (Optimum_antenna==2)?MAIN_ANT:AUX_ANT;
ODM_UpdateRxIdleAnt_88E(&pHalData->odmpriv, Ant);
@ -2802,15 +2802,15 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
/* keep sn */
Adapter->xmitpriv.nqos_ssn = rtw_read16(Adapter,REG_NQOS_SEQ);
if(pwrpriv->bkeepfwalive != true)
if (pwrpriv->bkeepfwalive != true)
{
/* RX DMA stop */
rtw_write32(Adapter,REG_RXPKT_NUM,(rtw_read32(Adapter,REG_RXPKT_NUM)|RW_RELEASE_EN));
do{
if(!(rtw_read32(Adapter,REG_RXPKT_NUM)&RXDMA_IDLE))
if (!(rtw_read32(Adapter,REG_RXPKT_NUM)&RXDMA_IDLE))
break;
}while(trycnt--);
if(trycnt ==0)
if (trycnt ==0)
DBG_8192C("Stop RX DMA failed......\n");
/* RQPN Load 0 */
@ -2879,7 +2879,7 @@ static void GetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
case HW_VAR_FWLPS_RF_ON:
{
/* When we halt NIC, we should check if FW LPS is leave. */
if(adapter_to_pwrctl(Adapter)->rf_pwrstate == rf_off)
if (adapter_to_pwrctl(Adapter)->rf_pwrstate == rf_off)
{
/* If it is in HW/SW Radio OFF or IPS state, we do not check Fw LPS Leave, */
/* because Fw is unload. */
@ -2890,7 +2890,7 @@ static void GetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
u32 valRCR;
valRCR = rtw_read32(Adapter, REG_RCR);
valRCR &= 0x00070000;
if(valRCR)
if (valRCR)
val[0] = false;
else
val[0] = true;
@ -2951,7 +2951,7 @@ static u8 GetHalDefVar8188EUsb(
struct sta_priv * pstapriv = &Adapter->stapriv;
struct sta_info * psta;
psta = rtw_get_stainfo(pstapriv, pmlmepriv->cur_network.network.MacAddress);
if(psta)
if (psta)
{
*((int *)pValue) = psta->rssi_stat.UndecoratedSmoothedPWDB;
}
@ -2990,7 +2990,7 @@ static u8 GetHalDefVar8188EUsb(
case HAL_DEF_PT_PWR_STATUS:
#if(POWER_TRAINING_ACTIVE==1)
#if (POWER_TRAINING_ACTIVE==1)
{
u8 MacID = *((u8*)pValue);
*((u8*)pValue) = ODM_RA_GetHwPwrStatus_8188E(podmpriv, MacID);
@ -3009,14 +3009,14 @@ static u8 GetHalDefVar8188EUsb(
u8 i;
u8 bLinked = false;
/* if(check_fwstate(&Adapter->mlmepriv, _FW_LINKED)== true) */
/* if (check_fwstate(&Adapter->mlmepriv, _FW_LINKED)== true) */
if(rtw_linked_check(Adapter))
if (rtw_linked_check(Adapter))
bLinked = true;
if(bLinked){
if (bLinked){
DBG_871X("============ RA status check ===================\n");
if(Adapter->bRxRSSIDisplay >30)
if (Adapter->bRxRSSIDisplay >30)
Adapter->bRxRSSIDisplay = 1;
for(i=0;i< Adapter->bRxRSSIDisplay;i++){
DBG_8192C("Mac_id:%d ,RSSI:%d,RateID = %d,RAUseRate = 0x%08x,RateSGI = %d, DecisionRate = 0x%02x ,PTStage = %d, RetryOver drop:%d, LifeTimeOver drop:%d\n",
@ -3074,25 +3074,25 @@ static u8 SetHalDefVar8188EUsb(
{
u8 dm_func = *(( u8*)pValue);
if(dm_func == 0){ /* disable all dynamic func */
if (dm_func == 0){ /* disable all dynamic func */
podmpriv->SupportAbility = DYNAMIC_FUNC_DISABLE;
DBG_8192C("==> Disable all dynamic function...\n");
}
else if(dm_func == 1){/* disable DIG */
else if (dm_func == 1){/* disable DIG */
podmpriv->SupportAbility &= (~DYNAMIC_BB_DIG);
DBG_8192C("==> Disable DIG...\n");
}
else if(dm_func == 2){/* disable High power */
else if (dm_func == 2){/* disable High power */
podmpriv->SupportAbility &= (~DYNAMIC_BB_DYNAMIC_TXPWR);
}
else if(dm_func == 3){/* disable tx power tracking */
else if (dm_func == 3){/* disable tx power tracking */
podmpriv->SupportAbility &= (~DYNAMIC_RF_CALIBRATION);
DBG_8192C("==> Disable tx power tracking...\n");
} else if(dm_func == 5){/* disable antenna diversity */
} else if (dm_func == 5){/* disable antenna diversity */
podmpriv->SupportAbility &= (~DYNAMIC_BB_ANT_DIV);
}
else if(dm_func == 6){/* turn on all dynamic func */
if(!(podmpriv->SupportAbility & DYNAMIC_BB_DIG))
else if (dm_func == 6){/* turn on all dynamic func */
if (!(podmpriv->SupportAbility & DYNAMIC_BB_DIG))
{
DIG_T *pDigTable = &podmpriv->DM_DigTable;
pDigTable->CurIGValue= rtw_read8(Adapter,0xc50);
@ -3154,7 +3154,7 @@ static void UpdateHalRAMask8188EUsb(struct adapter *padapter, u32 mac_id, u8 rss
}
psta = pmlmeinfo->FW_sta_info[mac_id].psta;
if(psta == NULL)
if (psta == NULL)
{
return;
}
@ -3180,7 +3180,7 @@ static void UpdateHalRAMask8188EUsb(struct adapter *padapter, u32 mac_id, u8 rss
case 1:/* for broadcast/multicast */
supportRateNum = rtw_get_rateset_len(pmlmeinfo->FW_sta_info[mac_id].SupportedRates);
if(pmlmeext->cur_wireless_mode & WIRELESS_11B)
if (pmlmeext->cur_wireless_mode & WIRELESS_11B)
networkType = WIRELESS_11B;
else
networkType = WIRELESS_11G;
@ -3210,7 +3210,7 @@ static void UpdateHalRAMask8188EUsb(struct adapter *padapter, u32 mac_id, u8 rss
init_rate = get_highest_rate_idx(mask)&0x3f;
if(pHalData->fw_ractrl == true)
if (pHalData->fw_ractrl == true)
{
u8 arg = 0;
@ -3224,7 +3224,7 @@ static void UpdateHalRAMask8188EUsb(struct adapter *padapter, u32 mac_id, u8 rss
DBG_871X("update raid entry, mask=0x%x, arg=0x%x\n", mask, arg);
psta->ra_mask=mask;
#ifdef CONFIG_INTEL_PROXIM
if(padapter->proximity.proxim_on ==true){
if (padapter->proximity.proxim_on ==true){
arg &= ~BIT(6);
}
else {
@ -3244,7 +3244,7 @@ static void UpdateHalRAMask8188EUsb(struct adapter *padapter, u32 mac_id, u8 rss
else
{
#if(RATE_ADAPTIVE_SUPPORT == 1)
#if (RATE_ADAPTIVE_SUPPORT == 1)
ODM_RA_UpdateRateInfo_8188E(
&(pHalData->odmpriv),
@ -3331,7 +3331,7 @@ static void rtl8188eu_init_default_value(struct adapter * padapter)
/* init default value */
pHalData->fw_ractrl = false;
if(!pwrctrlpriv->bkeepfwalive)
if (!pwrctrlpriv->bkeepfwalive)
pHalData->LastHMEBoxNum = 0;
/* init dm default value */
@ -3370,7 +3370,7 @@ void rtl8188eu_set_hal_ops(struct adapter * padapter)
padapter->HalData = rtw_zmalloc(sizeof(HAL_DATA_TYPE));
if(padapter->HalData == NULL){
if (padapter->HalData == NULL){
DBG_8192C("cant not alloc memory for HAL DATA\n");
}

View file

@ -330,7 +330,7 @@ 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
#define SIC_CMD_WRITE 0x40
@ -353,7 +353,7 @@ storePwrIndexDiffRateOffset(
#define SIC_DATA_REG 0x1EC /* 1bc~1bf */
#endif
#if(SIC_ENABLE == 1)
#if (SIC_ENABLE == 1)
void SIC_Init(IN struct adapter *Adapter);
#endif

View file

@ -43,7 +43,7 @@
/* 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); */

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

@ -173,7 +173,7 @@ struct led_priv{
#define rtw_led_control(adapter, LedAction) \
do { \
if((adapter)->ledpriv.LedControlHandler) \
if ((adapter)->ledpriv.LedControlHandler) \
(adapter)->ledpriv.LedControlHandler((adapter), (LedAction)); \
} while(0)

View file

@ -577,7 +577,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;
}
}
@ -586,7 +586,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

@ -74,21 +74,21 @@ int rtw_p2p_enable(struct 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;
}
}
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

@ -352,7 +352,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;
@ -369,7 +369,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;
@ -386,12 +386,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;
@ -411,13 +411,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;
@ -437,14 +437,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;
@ -465,12 +465,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;
@ -488,7 +488,7 @@ __inline static unsigned char *get_rxbuf_desc(union recv_frame *precvframe)
{
unsigned char *buf_desc;
if(precvframe==NULL)
if (precvframe==NULL)
return NULL;
return buf_desc;
}

View file

@ -209,7 +209,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;\

View file

@ -446,7 +446,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;

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -86,7 +86,7 @@ void rtw_os_indicate_connect(struct adapter *adapter)
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);
}
@ -108,7 +108,7 @@ void rtw_reset_securitypriv( struct adapter *adapter )
spin_lock_bh(&adapter->security_key_mutex);
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. */
@ -142,7 +142,7 @@ void rtw_reset_securitypriv( struct 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;
@ -182,7 +182,7 @@ void rtw_report_sec_ie(struct adapter *adapter,u8 authmode,u8 *sec_ie)
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));
buff = rtw_malloc(IW_CUSTOM_MAX);
@ -208,7 +208,7 @@ void rtw_report_sec_ie(struct adapter *adapter,u8 authmode,u8 *sec_ie)
wrqu.data.length = (wrqu.data.length<IW_CUSTOM_MAX) ? wrqu.data.length:IW_CUSTOM_MAX;
if(buff)
if (buff)
rtw_mfree(buff, IW_CUSTOM_MAX);
}
}
@ -282,13 +282,13 @@ void rtw_indicate_sta_assoc_event(struct adapter *padapter, struct sta_info *pst
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;
@ -304,13 +304,13 @@ void rtw_indicate_sta_disassoc_event(struct adapter *padapter, struct sta_info *
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;
@ -342,7 +342,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);
@ -419,7 +419,7 @@ int hostapd_mode_init(struct adapter *padapter)
pnetdev->watchdog_timeo = HZ; /* 1 second timeout */
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");
mac[0]=0x00;
@ -438,7 +438,7 @@ int hostapd_mode_init(struct adapter *padapter)
/* Tell the network stack we exist */
if (register_netdev(pnetdev) != 0) {
DBG_871X("hostapd_mode_init(): register_netdev fail!\n");
if(pnetdev)
if (pnetdev)
rtw_free_netdev(pnetdev);
}
return 0;

View file

@ -358,7 +358,7 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *p)
struct adapter *padapter = (struct 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]); */
@ -435,7 +435,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);
}
@ -500,7 +500,7 @@ int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname)
struct 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");
@ -512,7 +512,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;
@ -524,7 +524,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;
@ -532,7 +532,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"));
}
@ -550,7 +550,7 @@ struct net_device *rtw_init_netdev(struct 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(struct adapter), (void *)old_padapter);
else
pnetdev = rtw_alloc_etherdev(sizeof(struct adapter));
@ -597,7 +597,7 @@ u32 rtw_start_drv_threads(struct adapter *padapter)
RT_TRACE(_module_os_intfs_c_,_drv_info_,("+rtw_start_drv_threads\n"));
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 */
@ -623,7 +623,7 @@ void rtw_unregister_netdevs(struct dvobj_priv *dvobj)
pnetdev = padapter->pnetdev;
if((padapter->DriverState != DRIVER_DISAPPEAR) && pnetdev) {
if ((padapter->DriverState != DRIVER_DISAPPEAR) && pnetdev) {
unregister_netdev(pnetdev); /* will call netdev_close() */
rtw_proc_remove_one(pnetdev);
@ -791,26 +791,26 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
reset_global_wifidirect_info(padapter);
rtw_init_cfg80211_wifidirect_info(padapter);
#ifdef CONFIG_P2P
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;
goto exit;
}
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;
@ -824,7 +824,7 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
/* _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;
@ -904,7 +904,7 @@ u8 rtw_free_drv_sw(struct 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 );
@ -947,13 +947,13 @@ u8 rtw_free_drv_sw(struct 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;
}
@ -972,7 +972,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))
@ -1035,7 +1035,7 @@ static int _rtw_drv_register_netdev(struct adapter *padapter, char *name)
error_register_netdev:
if(padapter->iface_id > IFACE_ID0)
if (padapter->iface_id > IFACE_ID0)
{
rtw_free_drv_sw(padapter);
@ -1050,24 +1050,24 @@ int rtw_drv_register_netdev(struct adapter *if1)
int i, status = _SUCCESS;
struct dvobj_priv *dvobj = if1->dvobj;
if(dvobj->iface_nums < IFACE_ID_MAX)
if (dvobj->iface_nums < IFACE_ID_MAX)
{
for(i=0; i<dvobj->iface_nums; i++)
{
struct adapter *padapter = dvobj->padapters[i];
if(padapter)
if (padapter)
{
char *name;
if(padapter->iface_id == IFACE_ID0)
if (padapter->iface_id == IFACE_ID0)
name = if1->registrypriv.ifname;
else if(padapter->iface_id == IFACE_ID1)
else if (padapter->iface_id == IFACE_ID1)
name = if1->registrypriv.if2name;
else
name = "wlan%d";
if((status = _rtw_drv_register_netdev(padapter, name)) != _SUCCESS) {
if ((status = _rtw_drv_register_netdev(padapter, name)) != _SUCCESS) {
break;
}
}
@ -1086,12 +1086,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;
@ -1107,7 +1107,7 @@ int _netdev_open(struct net_device *pnetdev)
DBG_871X("MAC Address = "MAC_FMT"\n", MAC_ARG(pnetdev->dev_addr));
status=rtw_start_drv_threads(padapter);
if(status ==_FAIL)
if (status ==_FAIL)
{
DBG_871X("Initialize driver software resource Failed!\n");
goto netdev_open_error;
@ -1117,7 +1117,7 @@ int _netdev_open(struct net_device *pnetdev)
init_drvext(padapter);
#endif
if(padapter->intf_start)
if (padapter->intf_start)
{
padapter->intf_start(padapter);
}
@ -1139,7 +1139,7 @@ int _netdev_open(struct net_device *pnetdev)
rtw_set_pwr_state_check_timer(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);
@ -1198,7 +1198,7 @@ static int ips_netdrv_open(struct adapter *padapter)
goto netdev_open_error;
}
if(padapter->intf_start)
if (padapter->intf_start)
padapter->intf_start(padapter);
rtw_set_pwr_state_check_timer(adapter_to_pwrctl(padapter));
@ -1253,13 +1253,13 @@ void rtw_ips_dev_unload(struct adapter *padapter)
rtw_hal_set_hwreg(padapter, HW_VAR_FIFO_CLEARN_UP, NULL);
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);
}
@ -1285,19 +1285,19 @@ static int netdev_close(struct net_device *pnetdev)
RT_TRACE(_module_os_intfs_c_,_drv_info_,("+871x_drv - drv_close\n"));
if(adapter_to_pwrctl(padapter)->bInternalAutoSuspend == true)
if (adapter_to_pwrctl(padapter)->bInternalAutoSuspend == true)
{
/* rtw_pwr_wakeup(padapter); */
if(adapter_to_pwrctl(padapter)->rf_pwrstate == rf_off)
if (adapter_to_pwrctl(padapter)->rf_pwrstate == rf_off)
adapter_to_pwrctl(padapter)->ps_flag = true;
}
padapter->net_closed = true;
if(adapter_to_pwrctl(padapter)->rf_pwrstate == rf_on){
if (adapter_to_pwrctl(padapter)->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);
@ -1498,7 +1498,7 @@ restart:
memset(&rt_info, 0, sizeof(struct route_info));
parse_routes(h, &rt_info);
if(!rt_info.dst_addr.s_addr && rt_info.gateway.s_addr && rt_info.dev_index)
if (!rt_info.dst_addr.s_addr && rt_info.gateway.s_addr && rt_info.dev_index)
{
*gw_addr = rt_info.gateway.s_addr;
*gw_index = rt_info.dev_index;
@ -1574,7 +1574,7 @@ static int get_defaultgw(u32 *ip_addr ,char mac[])
route_dump(ip_addr, &gw_index);
if( !(*ip_addr) || !gw_index )
if ( !(*ip_addr) || !gw_index )
{
/* DBG_871X("No default GW\n"); */
return -1;
@ -1582,13 +1582,13 @@ static int get_defaultgw(u32 *ip_addr ,char mac[])
gw_dev = dev_get_by_index(&init_net, gw_index);
if(gw_dev == NULL)
if (gw_dev == NULL)
{
/* DBG_871X("get Oif Device Fail\n"); */
return -1;
}
if(!arp_query(mac, *ip_addr, gw_dev))
if (!arp_query(mac, *ip_addr, gw_dev))
{
/* DBG_871X( "arp query failed\n"); */
dev_put(gw_dev);
@ -1609,7 +1609,7 @@ int rtw_gw_addr_query(struct adapter *padapter)
int res;
res = get_defaultgw(&gw_addr, gw_mac);
if(!res)
if (!res)
{
pmlmepriv->gw_ip[0] = gw_addr&0xff;
pmlmepriv->gw_ip[1] = (gw_addr&0xff00)>>8;
@ -1637,12 +1637,12 @@ static int rtw_suspend_free_assoc_resource(struct adapter *padapter)
DBG_871X("==> "FUNC_ADPT_FMT" entry....\n", FUNC_ADPT_ARG(padapter));
rtw_cancel_all_timer(padapter);
if(pnetdev){
if (pnetdev){
netif_carrier_off(pnetdev);
rtw_netif_stop_queue(pnetdev);
}
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED) && rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED) && rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
{
DBG_871X("%s %s(" MAC_FMT "), length:%d assoc_ssid.length:%d\n",__FUNCTION__,
pmlmepriv->cur_network.network.Ssid.Ssid,
@ -1652,17 +1652,17 @@ static int rtw_suspend_free_assoc_resource(struct adapter *padapter)
rtw_set_roaming(padapter, 1);
}
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED))
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED))
{
rtw_disassoc_cmd(padapter, 0, false);
}
#ifdef CONFIG_AP_MODE
else if(check_fwstate(pmlmepriv, WIFI_AP_STATE))
else if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
{
rtw_sta_flush(padapter);
}
#endif
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) ){
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) ){
/* s2-2. indicate disconnect to os */
rtw_indicate_disconnect(padapter);
}
@ -1672,11 +1672,11 @@ static int rtw_suspend_free_assoc_resource(struct adapter *padapter)
/* s2-4. */
#ifdef CONFIG_AUTOSUSPEND
if(is_primary_adapter(padapter) && (!adapter_to_pwrctl(padapter)->bInternalAutoSuspend ))
if (is_primary_adapter(padapter) && (!adapter_to_pwrctl(padapter)->bInternalAutoSuspend ))
#endif
rtw_free_network_queue(padapter, true);
if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
rtw_indicate_scan_done(padapter, 1);
DBG_871X("==> "FUNC_ADPT_FMT" exit....\n", FUNC_ADPT_ARG(padapter));
@ -1715,7 +1715,7 @@ int rtw_resume_common(struct 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) {
DBG_871X("%s ==> pm_netdev_open failed\n",__FUNCTION__);
ret = -1;
return ret;

View file

@ -35,7 +35,7 @@
* @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) {
@ -52,15 +52,15 @@ u32 rtw_atoi(u8* s)
int num=0,flag=0;
int 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;
@ -235,7 +235,7 @@ void rtw_mstat_update(const enum mstat_f flags, const MSTAT_STATUS status, u32 s
int i;
/* initialization */
if(!update_time) {
if (!update_time) {
for(i=0;i<mstat_tf_idx(MSTAT_TYPE_MAX);i++) {
ATOMIC_SET(&(rtw_mem_type_stat[i].alloc), 0);
ATOMIC_SET(&(rtw_mem_type_stat[i].peak), 0);
@ -337,10 +337,10 @@ inline u8* dbg_rtw_malloc(u32 sz, const enum mstat_f flags, const char *func, co
{
u8 *p;
/* if(sz>=153 && sz<=306) */
/* if (sz>=153 && sz<=306) */
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); */
/* if((sz)>4096) */
/* if ((sz)>4096) */
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); */
p=_rtw_malloc((sz));
@ -358,10 +358,10 @@ inline u8* dbg_rtw_zmalloc(u32 sz, const enum mstat_f flags, const char *func, c
{
u8 *p;
/* if(sz>=153 && sz<=306) */
/* if (sz>=153 && sz<=306) */
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); */
/* if((sz)>4096) */
/* if ((sz)>4096) */
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); */
p = _rtw_zmalloc((sz));
@ -377,10 +377,10 @@ inline u8* dbg_rtw_zmalloc(u32 sz, const enum mstat_f flags, const char *func, c
inline void dbg_rtw_mfree(u8 *pbuf, u32 sz, const enum mstat_f flags, const char *func, const int line)
{
/* if(sz>=153 && sz<=306) */
/* if (sz>=153 && sz<=306) */
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); */
/* 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));
@ -399,10 +399,10 @@ inline struct sk_buff * dbg_rtw_skb_alloc(unsigned int size, const enum mstat_f
skb = _rtw_skb_alloc(size);
if(skb)
if (skb)
truesize = skb->truesize;
if(!skb || truesize < size /*|| size > 4096*/)
if (!skb || truesize < size /*|| size > 4096*/)
DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d), skb:%p, truesize=%u\n", func, line, __FUNCTION__, size, skb, truesize);
rtw_mstat_update(
@ -418,7 +418,7 @@ inline void dbg_rtw_skb_free(struct sk_buff *skb, const enum mstat_f flags, cons
{
unsigned int truesize = skb->truesize;
/* if(truesize > 4096) */
/* if (truesize > 4096) */
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s, truesize=%u\n", func, line, __FUNCTION__, truesize); */
_rtw_skb_free(skb);
@ -437,10 +437,10 @@ inline struct sk_buff *dbg_rtw_skb_copy(const struct sk_buff *skb, const enum ms
unsigned int cp_truesize = 0;
skb_cp = _rtw_skb_copy(skb);
if(skb_cp)
if (skb_cp)
cp_truesize = skb_cp->truesize;
if(!skb_cp || cp_truesize != truesize /*||cp_truesize > 4096*/)
if (!skb_cp || cp_truesize != truesize /*||cp_truesize > 4096*/)
DBG_871X("DBG_MEM_ALLOC %s:%d %s(%u), skb_cp:%p, cp_truesize=%u\n", func, line, __FUNCTION__, truesize, skb_cp, cp_truesize);
rtw_mstat_update(
@ -459,10 +459,10 @@ inline struct sk_buff *dbg_rtw_skb_clone(struct sk_buff *skb, const enum mstat_f
unsigned int cl_truesize = 0;
skb_cl = _rtw_skb_clone(skb);
if(skb_cl)
if (skb_cl)
cl_truesize = skb_cl->truesize;
if(!skb_cl || cl_truesize != truesize /*|| cl_truesize > 4096*/)
if (!skb_cl || cl_truesize != truesize /*|| cl_truesize > 4096*/)
DBG_871X("DBG_MEM_ALLOC %s:%d %s(%u), skb_cl:%p, cl_truesize=%u\n", func, line, __FUNCTION__, truesize, skb_cl, cl_truesize);
rtw_mstat_update(
@ -479,7 +479,7 @@ inline int dbg_rtw_netif_rx(struct net_device * ndev, struct sk_buff *skb, cons
int ret;
unsigned int truesize = skb->truesize;
/* if(truesize > 4096) */
/* if (truesize > 4096) */
/* DBG_871X("DBG_MEM_ALLOC %s:%d %s, truesize=%u\n", func, line, __FUNCTION__, truesize); */
ret = _rtw_netif_rx(ndev, skb);
@ -536,7 +536,7 @@ 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;
@ -892,7 +892,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);
}
@ -922,9 +922,9 @@ static int readFile(struct file *fp,char *buf,int len)
while(sum<len) {
rlen=fp->f_op->read(fp,(char __user *)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;
@ -943,9 +943,9 @@ static int writeFile(struct file *fp,char *buf,int len)
while(sum<len) {
wlen=fp->f_op->write(fp,(char __user *)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;
@ -968,13 +968,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);
@ -996,8 +996,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());
@ -1030,8 +1030,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());
@ -1058,7 +1058,7 @@ static int storeToFile(char *path, u8* buf, u32 sz)
*/
int rtw_is_file_readable(char *path)
{
if(isFileReadable(path) == 0)
if (isFileReadable(path) == 0)
return true;
else
return false;
@ -1142,12 +1142,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);
@ -1168,20 +1168,20 @@ int rtw_change_ifname(struct adapter *padapter, const char *ifname)
struct rereg_nd_name_data *rereg_priv;
int ret;
if(!padapter)
if (!padapter)
goto error;
cur_pnetdev = padapter->pnetdev;
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
@ -1204,7 +1204,7 @@ int rtw_change_ifname(struct adapter *padapter, const char *ifname)
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

@ -58,7 +58,7 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv)
for(i=0; i < NR_RECVFRAME; i++)
{
if(precvframe->u.hdr.pkt)
if (precvframe->u.hdr.pkt)
{
rtw_skb_free(precvframe->u.hdr.pkt);/* free skb by driver */
precvframe->u.hdr.pkt = NULL;
@ -79,7 +79,7 @@ int rtw_os_recvbuf_resource_alloc(struct adapter *padapter, struct recv_buf *pre
precvbuf->irp_pending = false;
precvbuf->purb = usb_alloc_urb(0, GFP_KERNEL);
if(precvbuf->purb == NULL){
if (precvbuf->purb == NULL){
res = _FAIL;
}
@ -103,9 +103,9 @@ int rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *prec
{
int ret = _SUCCESS;
if(precvbuf->purb)
if (precvbuf->purb)
usb_free_urb(precvbuf->purb);
if(precvbuf->pskb)
if (precvbuf->pskb)
rtw_skb_free(precvbuf->pskb);
return ret;
@ -120,12 +120,12 @@ void rtw_handle_tkip_mic_err(struct 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();
} else {
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;
psecuritypriv->btkip_countermeasure_time = cur_time;
@ -174,7 +174,7 @@ void rtw_hostapd_mlme_rx(struct adapter *padapter, union recv_frame *precv_frame
skb->len = precv_frame->u.hdr.len;
/* pskb_copy = rtw_skb_copy(skb); */
/* if(skb == NULL) goto _exit; */
/* if (skb == NULL) goto _exit; */
skb->dev = pmgnt_netdev;
skb->ip_summed = CHECKSUM_NONE;
@ -214,7 +214,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
if (!precv_frame)
goto _recv_indicatepkt_drop;
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;
@ -232,7 +232,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
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)
{
struct sk_buff *pskb2=NULL;
struct sta_info *psta = NULL;
@ -242,11 +242,11 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
/* 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 = rtw_skb_clone(skb);
@ -254,7 +254,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
psta = rtw_get_stainfo(pstapriv, pattrib->dst);
}
if(psta)
if (psta)
{
struct net_device *pnetdev= (struct net_device*)padapter->pnetdev;
@ -273,7 +273,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
_rtw_xmit_entry(skb, pnetdev);
if(bmcast)
if (bmcast)
skb = pskb2;
else
goto _recv_indicatepkt_end;
@ -298,7 +298,7 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
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(struct adapter *priv, struct sk_buff *skb);
if (nat25_handle_frame(padapter, skb) == -1) {
@ -319,14 +319,14 @@ int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
int bmcast = IS_MCAST(pattrib->dst);
if(bmcast)
if (bmcast)
{
psta = rtw_get_bcmc_stainfo(padapter);
} else {
psta = rtw_get_stainfo(pstapriv, pattrib->src);
}
if(psta)
if (psta)
{
switch(pattrib->priority)
{
@ -369,7 +369,7 @@ _recv_indicatepkt_end:
_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;
@ -390,7 +390,7 @@ void rtw_os_read_port(struct 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);
}

View file

@ -231,7 +231,7 @@ int rtw_android_cmdstr_to_num(char *cmdstr)
if (!strncasecmp(cmdstr, android_wifi_cmd_str[cmd_num],
strlen(android_wifi_cmd_str[cmd_num])))
#else
if(0 == strnicmp(cmdstr, android_wifi_cmd_str[cmd_num],
if (0 == strnicmp(cmdstr, android_wifi_cmd_str[cmd_num],
strlen(android_wifi_cmd_str[cmd_num])))
#endif
break;
@ -246,7 +246,7 @@ static int rtw_android_get_rssi(struct net_device *net, char *command, int total
struct wlan_network *pcur_network = &pmlmepriv->cur_network;
int bytes_written = 0;
if(check_fwstate(pmlmepriv, _FW_LINKED) == true) {
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
bytes_written += snprintf(&command[bytes_written], total_len, "%s rssi %d",
pcur_network->network.Ssid.Ssid, padapter->recvpriv.rssi);
}
@ -470,7 +470,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
/* wpa_cli driver wfd-enable */
pwfd_info = &padapter->wfd_info;
if( padapter->wdinfo.driver_interface == DRIVER_CFG80211 )
if ( padapter->wdinfo.driver_interface == DRIVER_CFG80211 )
pwfd_info->wfd_enable = true;
break;
case ANDROID_WIFI_CMD_WFD_DISABLE:
@ -479,7 +479,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
/* wpa_cli driver wfd-disable */
pwfd_info = &padapter->wfd_info;
if( padapter->wdinfo.driver_interface == DRIVER_CFG80211 )
if ( padapter->wdinfo.driver_interface == DRIVER_CFG80211 )
pwfd_info->wfd_enable = false;
break;
case ANDROID_WIFI_CMD_WFD_SET_TCPPORT:
@ -488,7 +488,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
/* wpa_cli driver wfd-set-tcpport = 554 */
pwfd_info = &padapter->wfd_info;
if( padapter->wdinfo.driver_interface == DRIVER_CFG80211 )
if ( padapter->wdinfo.driver_interface == DRIVER_CFG80211 )
pwfd_info->rtsp_ctrlport = (u16)get_int_from_command(priv_cmd.buf);
break;
case ANDROID_WIFI_CMD_WFD_SET_MAX_TPUT:

View file

@ -234,7 +234,7 @@ static u8 rtw_deinit_intf_priv(struct dvobj_priv *dvobj)
{
u8 rst = _SUCCESS;
if(dvobj->usb_vendor_req_buf)
if (dvobj->usb_vendor_req_buf)
rtw_mfree(dvobj->usb_alloc_vendor_req_buf, MAX_USB_IO_CTL_SIZE);
_rtw_mutex_free(&dvobj->usb_vendor_req_mutex);
@ -415,7 +415,7 @@ static void usb_intf_stop(struct adapter *padapter)
RT_TRACE(_module_hci_intfs_c_,_drv_err_,("+usb_intf_stop\n"));
/* disabel_hw_interrupt */
if(padapter->bSurpriseRemoved == false)
if (padapter->bSurpriseRemoved == false)
{
/* device still exists, so driver can do i/o operation */
/* TODO: */
@ -440,7 +440,7 @@ void rtw_dev_unload(struct adapter *padapter)
u8 val8;
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");
@ -449,18 +449,18 @@ void rtw_dev_unload(struct adapter *padapter)
rtw_ack_tx_done(&padapter->xmitpriv, RTW_SCTX_DONE_DRV_STOP);
/* s3. */
if(padapter->intf_stop)
if (padapter->intf_stop)
{
padapter->intf_stop(padapter);
}
/* s4. */
if(!adapter_to_pwrctl(padapter)->bInternalAutoSuspend )
if (!adapter_to_pwrctl(padapter)->bInternalAutoSuspend )
rtw_stop_drv_threads(padapter);
/* s5. */
if(padapter->bSurpriseRemoved == false)
if (padapter->bSurpriseRemoved == false)
{
rtw_hal_deinit(padapter);
padapter->bSurpriseRemoved = true;
@ -490,7 +490,7 @@ static void process_spec_devid(const struct usb_device_id *pdid)
pid = specific_device_id_tbl[i].idProduct;
flags = specific_device_id_tbl[i].flags;
if((pdid->idVendor==vid) && (pdid->idProduct==pid) && (flags&SPEC_DEV_ID_DISABLE_HT))
if ((pdid->idVendor==vid) && (pdid->idProduct==pid) && (flags&SPEC_DEV_ID_DISABLE_HT))
{
rtw_ht_enable = 0;
rtw_cbw40_enable = 0;
@ -505,7 +505,7 @@ int rtw_hw_suspend(struct adapter *padapter )
struct usb_interface *pusb_intf = adapter_to_dvobj(padapter)->pusbintf;
struct net_device *pnetdev = padapter->pnetdev;
if((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved))
if ((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved))
{
DBG_871X("padapter->bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n",
padapter->bup, padapter->bDriverStopped,padapter->bSurpriseRemoved);
@ -518,7 +518,7 @@ int rtw_hw_suspend(struct adapter *padapter )
_enter_pwrlock(&pwrpriv->lock);
pwrpriv->bips_processing = true;
/* s1. */
if(pnetdev)
if (pnetdev)
{
netif_carrier_off(pnetdev);
rtw_netif_stop_queue(pnetdev);
@ -531,7 +531,7 @@ int rtw_hw_suspend(struct adapter *padapter )
{
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
if(check_fwstate(pmlmepriv, _FW_LINKED))
if (check_fwstate(pmlmepriv, _FW_LINKED))
{
_clr_fwstate_(pmlmepriv, _FW_LINKED);
@ -569,7 +569,7 @@ int rtw_hw_resume(struct adapter *padapter)
struct usb_interface *pusb_intf;
struct net_device *pnetdev;
if(padapter)/* system resume */
if (padapter)/* system resume */
{
pwrpriv = adapter_to_pwrctl(padapter);
pusb_intf = adapter_to_dvobj(padapter)->pusbintf;
@ -579,7 +579,7 @@ int rtw_hw_resume(struct adapter *padapter)
pwrpriv->bips_processing = true;
rtw_reset_drv_sw(padapter);
if(pm_netdev_open(pnetdev,false) != 0) {
if (pm_netdev_open(pnetdev,false) != 0) {
_exit_pwrlock(&pwrpriv->lock);
goto error_exit;
}
@ -587,7 +587,7 @@ int rtw_hw_resume(struct adapter *padapter)
netif_device_attach(pnetdev);
netif_carrier_on(pnetdev);
if(!rtw_netif_queue_stopped(pnetdev))
if (!rtw_netif_queue_stopped(pnetdev))
rtw_netif_start_queue(pnetdev);
else
rtw_netif_wake_queue(pnetdev);
@ -627,25 +627,25 @@ static int rtw_suspend(struct usb_interface *pusb_intf, pm_message_t message)
DBG_871X("==> %s (%s:%d)\n",__FUNCTION__, current->comm, current->pid);
if(!padapter->bup){
if (!padapter->bup){
u8 bMacPwrCtrlOn = false;
rtw_hal_get_hwreg(padapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn);
if(bMacPwrCtrlOn)
if (bMacPwrCtrlOn)
rtw_hal_power_off(padapter);
}
if((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved))
if ((!padapter->bup) || (padapter->bDriverStopped)||(padapter->bSurpriseRemoved))
{
DBG_871X("padapter->bup=%d bDriverStopped=%d bSurpriseRemoved = %d\n",
padapter->bup, padapter->bDriverStopped,padapter->bSurpriseRemoved);
goto exit;
}
if(pwrpriv->bInternalAutoSuspend )
if (pwrpriv->bInternalAutoSuspend )
{
#ifdef CONFIG_AUTOSUSPEND
/* The FW command register update must after MAC and FW init ready. */
if((padapter->bFWReady) && (pwrpriv->bHWPwrPindetect ) && (padapter->registrypriv.usbss_enable ))
if ((padapter->bFWReady) && (pwrpriv->bHWPwrPindetect ) && (padapter->registrypriv.usbss_enable ))
{
u8 bOpen = true;
rtw_interface_ps_func(padapter,HAL_USB_SELECT_SUSPEND,&bOpen);
@ -679,7 +679,7 @@ static int rtw_resume(struct usb_interface *pusb_intf)
struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(dvobj);
int ret = 0;
if(pwrpriv->bInternalAutoSuspend ){
if (pwrpriv->bInternalAutoSuspend ){
ret = rtw_resume_process(padapter);
} else {
if (rtw_is_earlysuspend_registered(pwrpriv)) {
@ -706,7 +706,7 @@ int rtw_resume_process(struct adapter *padapter)
DBG_871X("==> %s (%s:%d)\n",__FUNCTION__, current->comm, current->pid);
if(padapter) {
if (padapter) {
pnetdev= padapter->pnetdev;
pwrpriv = adapter_to_pwrctl(padapter);
} else {
@ -725,7 +725,7 @@ int rtw_resume_process(struct adapter *padapter)
#endif
DBG_871X("pwrpriv->bAutoResume (%x)\n",pwrpriv->bAutoResume );
if( true == pwrpriv->bAutoResume ){
if ( true == pwrpriv->bAutoResume ){
pwrpriv->bInternalAutoSuspend = false;
pwrpriv->bAutoResume=false;
DBG_871X("pwrpriv->bAutoResume (%x) pwrpriv->bInternalAutoSuspend(%x)\n",pwrpriv->bAutoResume,pwrpriv->bInternalAutoSuspend );
@ -735,18 +735,18 @@ int rtw_resume_process(struct adapter *padapter)
#endif /* ifdef CONFIG_BT_COEXIST */
if(rtw_resume_common(padapter)!= 0) {
if (rtw_resume_common(padapter)!= 0) {
DBG_871X("%s rtw_resume_common failed\n",__FUNCTION__);
_exit_pwrlock(&pwrpriv->lock);
goto exit;
}
#ifdef CONFIG_AUTOSUSPEND
if(pwrpriv->bInternalAutoSuspend )
if (pwrpriv->bInternalAutoSuspend )
{
#ifdef CONFIG_AUTOSUSPEND
/* The FW command register update must after MAC and FW init ready. */
if((padapter->bFWReady) && (pwrpriv->bHWPwrPindetect) && (padapter->registrypriv.usbss_enable ))
if ((padapter->bFWReady) && (pwrpriv->bHWPwrPindetect) && (padapter->registrypriv.usbss_enable ))
{
u8 bOpen = false;
rtw_interface_ps_func(padapter,HAL_USB_SELECT_SUSPEND,&bOpen);
@ -754,7 +754,7 @@ int rtw_resume_process(struct adapter *padapter)
#endif
#ifdef CONFIG_BT_COEXIST
DBG_871X("pwrpriv->bAutoResume (%x)\n",pwrpriv->bAutoResume );
if( true == pwrpriv->bAutoResume ){
if ( true == pwrpriv->bAutoResume ){
pwrpriv->bInternalAutoSuspend = false;
pwrpriv->bAutoResume=false;
DBG_871X("pwrpriv->bAutoResume (%x) pwrpriv->bInternalAutoSuspend(%x)\n",pwrpriv->bAutoResume,pwrpriv->bInternalAutoSuspend );
@ -768,7 +768,7 @@ int rtw_resume_process(struct adapter *padapter)
#endif
_exit_pwrlock(&pwrpriv->lock);
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);
}
@ -793,7 +793,7 @@ void autosuspend_enter(struct adapter* padapter)
pwrpriv->bInternalAutoSuspend = true;
pwrpriv->bips_processing = true;
if(rf_off == pwrpriv->change_rfpwrstate )
if (rf_off == pwrpriv->change_rfpwrstate )
{
#ifndef CONFIG_BT_COEXIST
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
@ -810,7 +810,7 @@ void autosuspend_enter(struct adapter* padapter)
usb_autosuspend_device(dvobj->pusbdev, 1);
#endif
#else /* ifndef CONFIG_BT_COEXIST */
if(1==pwrpriv->autopm_cnt){
if (1==pwrpriv->autopm_cnt){
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
usb_enable_autosuspend(dvobj->pusbdev);
#else
@ -849,7 +849,7 @@ int autoresume_enter(struct adapter* padapter)
DBG_871X("====> autoresume_enter\n");
if(rf_off == pwrpriv->rf_pwrstate )
if (rf_off == pwrpriv->rf_pwrstate )
{
pwrpriv->ps_flag = false;
#ifndef CONFIG_BT_COEXIST
@ -873,7 +873,7 @@ int autoresume_enter(struct adapter* padapter)
#endif
#else /* ifndef CONFIG_BT_COEXIST */
pwrpriv->bAutoResume=true;
if(0==pwrpriv->autopm_cnt){
if (0==pwrpriv->autopm_cnt){
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
if (usb_autopm_get_interface(dvobj->pusbintf) < 0)
{
@ -940,13 +940,13 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
if (rtw_handle_dualmac(padapter, 1) != _SUCCESS)
goto free_adapter;
if((pnetdev = rtw_init_netdev(padapter)) == NULL) {
if ((pnetdev = rtw_init_netdev(padapter)) == NULL) {
goto handle_dualmac;
}
SET_NETDEV_DEV(pnetdev, dvobj_to_dev(dvobj));
padapter = rtw_netdev_priv(pnetdev);
if(rtw_wdev_alloc(padapter, dvobj_to_dev(dvobj)) != 0) {
if (rtw_wdev_alloc(padapter, dvobj_to_dev(dvobj)) != 0) {
goto handle_dualmac;
}
@ -969,14 +969,14 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
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;
}
#ifdef CONFIG_PM
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,18))
if(adapter_to_pwrctl(padapter)->bSupportRemoteWakeup)
if (adapter_to_pwrctl(padapter)->bSupportRemoteWakeup)
{
dvobj->pusbdev->do_remote_wakeup=1;
pusb_intf->needs_remote_wakeup = 1;
@ -988,9 +988,9 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
#endif
#ifdef CONFIG_AUTOSUSPEND
if( padapter->registrypriv.power_mgnt != PS_MODE_ACTIVE )
if ( padapter->registrypriv.power_mgnt != PS_MODE_ACTIVE )
{
if(padapter->registrypriv.usbss_enable ){ /* autosuspend (2s delay) */
if (padapter->registrypriv.usbss_enable ){ /* autosuspend (2s delay) */
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,38))
dvobj->pusbdev->dev.power.autosuspend_delay = 0 * HZ;/* 15 * HZ; idle-delay time */
#else
@ -1038,10 +1038,10 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
status = _SUCCESS;
free_hal_data:
if(status != _SUCCESS && padapter->HalData)
if (status != _SUCCESS && padapter->HalData)
kfree(padapter->HalData);
free_wdev:
if(status != _SUCCESS) {
if (status != _SUCCESS) {
rtw_wdev_unregister(padapter->rtw_wdev);
rtw_wdev_free(padapter->rtw_wdev);
}
@ -1066,7 +1066,7 @@ static void rtw_usb_if1_deinit(struct adapter *if1)
struct mlme_priv *pmlmepriv= &if1->mlmepriv;
struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(if1);
if(check_fwstate(pmlmepriv, _FW_LINKED))
if (check_fwstate(pmlmepriv, _FW_LINKED))
rtw_disassoc_cmd(if1, 0, false);
@ -1084,13 +1084,13 @@ static void rtw_usb_if1_deinit(struct adapter *if1)
rtw_handle_dualmac(if1, 0);
if(if1->rtw_wdev) {
if (if1->rtw_wdev) {
/* rtw_wdev_unregister(if1->rtw_wdev); */
rtw_wdev_free(if1->rtw_wdev);
}
#ifdef CONFIG_BT_COEXIST
if(1 == pwrctl->autopm_cnt){
if (1 == pwrctl->autopm_cnt){
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
usb_autopm_put_interface(adapter_to_dvobj(if1)->pusbintf);
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,20))
@ -1104,7 +1104,7 @@ static void rtw_usb_if1_deinit(struct adapter *if1)
rtw_free_drv_sw(if1);
if(pnetdev)
if (pnetdev)
rtw_free_netdev(pnetdev);
}
@ -1234,13 +1234,13 @@ static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device
rtw_sw_export=if1;
#endif
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);
}
/* dev_alloc_name && register_netdev */
if((status = rtw_drv_register_netdev(if1)) != _SUCCESS) {
if ((status = rtw_drv_register_netdev(if1)) != _SUCCESS) {
goto free_if2;
}
@ -1281,7 +1281,7 @@ static void rtw_dev_remove(struct usb_interface *pusb_intf)
dvobj->processing_dev_remove = true;
rtw_unregister_netdevs(dvobj);
if(usb_drv->drv_registered == true)
if (usb_drv->drv_registered == true)
{
/* DBG_871X("r871xu_dev_remove():padapter->bSurpriseRemoved == true\n"); */
padapter->bSurpriseRemoved = true;

View file

@ -190,14 +190,14 @@ static void usb_bulkout_zero_complete(struct urb *purb, struct pt_regs *regs)
/* DBG_8192C("+usb_bulkout_zero_complete\n"); */
if(pcontext)
if (pcontext)
{
if(pcontext->pbuf)
if (pcontext->pbuf)
{
rtw_mfree(pcontext->pbuf, sizeof(int));
}
if(pcontext->purb && (pcontext->purb==purb))
if (pcontext->purb && (pcontext->purb==purb))
{
usb_free_urb(pcontext->purb);
}
@ -223,7 +223,7 @@ static u32 usb_bulkout_zero(struct intf_hdl *pintfhdl, u32 addr)
/* DBG_871X("%s\n", __func__); */
if((padapter->bDriverStopped) || (padapter->bSurpriseRemoved) ||(dvobj_to_pwrctl(pdvobj)->pnp_bstop_trx))
if ((padapter->bDriverStopped) || (padapter->bSurpriseRemoved) ||(dvobj_to_pwrctl(pdvobj)->pnp_bstop_trx))
{
return _FAIL;
}
@ -340,7 +340,7 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
}
if(padapter->bSurpriseRemoved || padapter->bDriverStopped ||padapter->bWritePortCancel)
if (padapter->bSurpriseRemoved || padapter->bDriverStopped ||padapter->bWritePortCancel)
{
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete:bDriverStopped(%d) OR bSurpriseRemoved(%d)", padapter->bDriverStopped, padapter->bSurpriseRemoved));
DBG_8192C("%s(): TX Warning! bDriverStopped(%d) OR bSurpriseRemoved(%d) bWritePortCancel(%d) pxmitbuf->ext_tag(%x)\n",
@ -355,7 +355,7 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
} else {
RT_TRACE(_module_hci_ops_os_c_,_drv_err_,("usb_write_port_complete : purb->status(%d) != 0\n", purb->status));
DBG_871X("###=> urb_write_port_complete status(%d)\n",purb->status);
if((purb->status==-EPIPE)||(purb->status==-EPROTO))
if ((purb->status==-EPIPE)||(purb->status==-EPROTO))
{
/* usb_clear_halt(pusbdev, purb->pipe); */
/* msleep(10); */
@ -402,7 +402,7 @@ check_completion:
rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
/* if(rtw_txframes_pending(padapter)) */
/* if (rtw_txframes_pending(padapter)) */
{
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
}
@ -475,15 +475,15 @@ u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem)
int bmcast = IS_MCAST(pattrib->dst);
u8 agg_num = 1;
if(pxmitframe->agg_num>1)
if (pxmitframe->agg_num>1)
agg_num = pxmitframe->agg_num;
if(bmcast)
if (bmcast)
psta = rtw_get_bcmc_stainfo(padapter);
else
psta = rtw_get_stainfo(pstapriv, pattrib->dst);
if(psta) {
if (psta) {
switch(pattrib->priority) {
case 1:
case 2:
@ -553,7 +553,7 @@ u32 usb_write_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *wmem)
/* Commented by Albert 2009/10/13 */
/* We add the URB_ZERO_PACKET flag to urb so that the host will send the zero packet automatically. */
/*
if(bwritezero == true)
if (bwritezero == true)
{
usb_bulkout_zero(pintfhdl, addr);
}
@ -591,7 +591,7 @@ void usb_write_port_cancel(struct intf_hdl *pintfhdl)
pxmitbuf = (struct xmit_buf*)padapter->xmitpriv.pxmit_extbuf;
for (i = 0; i < NR_XMIT_EXTBUFF; i++) {
for (j=0; j<8; j++) {
if(pxmitbuf->pxmit_urb[j]) {
if (pxmitbuf->pxmit_urb[j]) {
usb_kill_urb(pxmitbuf->pxmit_urb[j]);
}
}

View file

@ -89,7 +89,7 @@ int rtw_os_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *pxmitb
for(i=0; i<8; i++) {
pxmitbuf->pxmit_urb[i] = usb_alloc_urb(0, GFP_KERNEL);
if(pxmitbuf->pxmit_urb[i] == NULL) {
if (pxmitbuf->pxmit_urb[i] == NULL) {
DBG_871X("pxmitbuf->pxmit_urb[i]==NULL");
return _FAIL;
}
@ -107,14 +107,14 @@ void rtw_os_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitb
for(i=0; i<8; i++)
{
if(pxmitbuf->pxmit_urb[i])
if (pxmitbuf->pxmit_urb[i])
{
/* usb_kill_urb(pxmitbuf->pxmit_urb[i]); */
usb_free_urb(pxmitbuf->pxmit_urb[i]);
}
}
if(pxmitbuf->pallocated_buf)
if (pxmitbuf->pallocated_buf)
rtw_mfree(pxmitbuf->pallocated_buf, free_sz);
}
@ -128,13 +128,13 @@ void rtw_os_pkt_complete(struct adapter *padapter, struct sk_buff *pkt)
queue = skb_get_queue_mapping(pkt);
if (padapter->registrypriv.wifi_spec) {
if(__netif_subqueue_stopped(padapter->pnetdev, queue) &&
if (__netif_subqueue_stopped(padapter->pnetdev, queue) &&
(pxmitpriv->hwxmits[queue].accnt < WMM_XMIT_THRESHOLD))
{
netif_wake_subqueue(padapter->pnetdev, queue);
}
} else {
if(__netif_subqueue_stopped(padapter->pnetdev, queue))
if (__netif_subqueue_stopped(padapter->pnetdev, queue))
netif_wake_subqueue(padapter->pnetdev, queue);
}
#else
@ -147,7 +147,7 @@ void rtw_os_pkt_complete(struct adapter *padapter, struct sk_buff *pkt)
void rtw_os_xmit_complete(struct adapter *padapter, struct xmit_frame *pxframe)
{
if(pxframe->pkt)
if (pxframe->pkt)
rtw_os_pkt_complete(padapter, pxframe->pkt);
pxframe->pkt = NULL;
@ -160,14 +160,14 @@ void rtw_os_xmit_schedule(struct adapter *padapter)
unsigned long irqL;
struct xmit_priv *pxmitpriv;
if(!padapter)
if (!padapter)
return;
pxmitpriv = &padapter->xmitpriv;
spin_lock_bh(&pxmitpriv->lock);
if(rtw_txframes_pending(padapter))
if (rtw_txframes_pending(padapter))
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
spin_unlock_bh(&pxmitpriv->lock);
@ -187,13 +187,13 @@ static void rtw_check_xmit_resource(struct adapter *padapter, struct sk_buff *pk
netif_stop_subqueue(padapter->pnetdev, queue);
}
} else {
if(pxmitpriv->free_xmitframe_cnt<=4) {
if (pxmitpriv->free_xmitframe_cnt<=4) {
if (!netif_tx_queue_stopped(netdev_get_tx_queue(padapter->pnetdev, queue)))
netif_stop_subqueue(padapter->pnetdev, queue);
}
}
#else
if(pxmitpriv->free_xmitframe_cnt<=4)
if (pxmitpriv->free_xmitframe_cnt<=4)
{
if (!rtw_netif_queue_stopped(padapter->pnetdev))
rtw_netif_stop_queue(padapter->pnetdev);
@ -235,7 +235,7 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
for (i = 0; i < chk_alive_num; i++) {
psta = rtw_get_stainfo_by_offset(pstapriv, chk_alive_list[i]);
if(!(psta->state &_FW_LINKED))
if (!(psta->state &_FW_LINKED))
continue;
/* avoid come from STA1 and send back STA1 */