mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-08 14:33:05 +00:00
Change "if(" to "if (" and the same changes for "while", "for", "switch" and "do"
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
124abebb96
commit
a55f866a62
105 changed files with 6893 additions and 6893 deletions
278
core/rtw_ap.c
278
core/rtw_ap.c
|
@ -94,8 +94,8 @@ static void update_BCNTIM(_adapter *padapter)
|
|||
//DBG_871X("%s\n", __FUNCTION__);
|
||||
|
||||
//update TIM IE
|
||||
//if(pstapriv->tim_bitmap)
|
||||
if(_TRUE)
|
||||
//if (pstapriv->tim_bitmap)
|
||||
if (_TRUE)
|
||||
{
|
||||
u8 *p, *dst_ie, *premainder_ie=NULL, *pbackup_remainder_ie=NULL;
|
||||
u16 tim_bitmap_le;
|
||||
|
@ -145,10 +145,10 @@ static void update_BCNTIM(_adapter *padapter)
|
|||
}
|
||||
|
||||
|
||||
if(remainder_ielen>0)
|
||||
if (remainder_ielen>0)
|
||||
{
|
||||
pbackup_remainder_ie = rtw_malloc(remainder_ielen);
|
||||
if(pbackup_remainder_ie && premainder_ie)
|
||||
if (pbackup_remainder_ie && premainder_ie)
|
||||
_rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
|
||||
}
|
||||
|
||||
|
@ -156,7 +156,7 @@ static void update_BCNTIM(_adapter *padapter)
|
|||
|
||||
*dst_ie++=_TIM_IE_;
|
||||
|
||||
if((pstapriv->tim_bitmap&0xff00) && (pstapriv->tim_bitmap&0x00fc))
|
||||
if ((pstapriv->tim_bitmap&0xff00) && (pstapriv->tim_bitmap&0x00fc))
|
||||
tim_ielen = 5;
|
||||
else
|
||||
tim_ielen = 4;
|
||||
|
@ -166,23 +166,23 @@ static void update_BCNTIM(_adapter *padapter)
|
|||
*dst_ie++=0;//DTIM count
|
||||
*dst_ie++=1;//DTIM peroid
|
||||
|
||||
if(pstapriv->tim_bitmap&BIT(0))//for bc/mc frames
|
||||
if (pstapriv->tim_bitmap&BIT(0))//for bc/mc frames
|
||||
*dst_ie++ = BIT(0);//bitmap ctrl
|
||||
else
|
||||
*dst_ie++ = 0;
|
||||
|
||||
if(tim_ielen==4)
|
||||
if (tim_ielen==4)
|
||||
{
|
||||
*dst_ie++ = *(u8*)&tim_bitmap_le;
|
||||
}
|
||||
else if(tim_ielen==5)
|
||||
else if (tim_ielen==5)
|
||||
{
|
||||
_rtw_memcpy(dst_ie, &tim_bitmap_le, 2);
|
||||
dst_ie+=2;
|
||||
}
|
||||
|
||||
//copy remainder IE
|
||||
if(pbackup_remainder_ie)
|
||||
if (pbackup_remainder_ie)
|
||||
{
|
||||
_rtw_memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
|
||||
|
||||
|
@ -219,7 +219,7 @@ void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *d
|
|||
{
|
||||
break;
|
||||
}
|
||||
else if(pIE->ElementID == index) // already exist the same IE
|
||||
else if (pIE->ElementID == index) // already exist the same IE
|
||||
{
|
||||
p = (u8 *)pIE;
|
||||
ielen = pIE->Length;
|
||||
|
@ -242,16 +242,16 @@ void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *d
|
|||
|
||||
remainder_ielen = pnetwork->IELength - ie_offset - ielen;
|
||||
|
||||
if(bmatch)
|
||||
if (bmatch)
|
||||
dst_ie = p;
|
||||
else
|
||||
dst_ie = (p+ielen);
|
||||
}
|
||||
|
||||
if(remainder_ielen>0)
|
||||
if (remainder_ielen>0)
|
||||
{
|
||||
pbackup_remainder_ie = rtw_malloc(remainder_ielen);
|
||||
if(pbackup_remainder_ie && premainder_ie)
|
||||
if (pbackup_remainder_ie && premainder_ie)
|
||||
_rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
|
||||
}
|
||||
|
||||
|
@ -262,7 +262,7 @@ void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *d
|
|||
dst_ie+=len;
|
||||
|
||||
//copy remainder IE
|
||||
if(pbackup_remainder_ie)
|
||||
if (pbackup_remainder_ie)
|
||||
{
|
||||
_rtw_memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
|
||||
|
||||
|
@ -293,15 +293,15 @@ void rtw_remove_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index)
|
|||
dst_ie = p;
|
||||
}
|
||||
|
||||
if(remainder_ielen>0)
|
||||
if (remainder_ielen>0)
|
||||
{
|
||||
pbackup_remainder_ie = rtw_malloc(remainder_ielen);
|
||||
if(pbackup_remainder_ie && premainder_ie)
|
||||
if (pbackup_remainder_ie && premainder_ie)
|
||||
_rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
|
||||
}
|
||||
|
||||
//copy remainder IE
|
||||
if(pbackup_remainder_ie)
|
||||
if (pbackup_remainder_ie)
|
||||
{
|
||||
_rtw_memcpy(dst_ie, pbackup_remainder_ie, remainder_ielen);
|
||||
|
||||
|
@ -330,11 +330,11 @@ u8 chk_sta_is_alive(struct sta_info *psta)
|
|||
);
|
||||
#endif
|
||||
|
||||
//if(sta_last_rx_pkts(psta) == sta_rx_pkts(psta))
|
||||
if((psta->sta_stats.last_rx_data_pkts + psta->sta_stats.last_rx_ctrl_pkts) == (psta->sta_stats.rx_data_pkts + psta->sta_stats.rx_ctrl_pkts))
|
||||
//if (sta_last_rx_pkts(psta) == sta_rx_pkts(psta))
|
||||
if ((psta->sta_stats.last_rx_data_pkts + psta->sta_stats.last_rx_ctrl_pkts) == (psta->sta_stats.rx_data_pkts + psta->sta_stats.rx_ctrl_pkts))
|
||||
{
|
||||
#if 0
|
||||
if(psta->state&WIFI_SLEEP_STATE)
|
||||
if (psta->state&WIFI_SLEEP_STATE)
|
||||
ret = _TRUE;
|
||||
#endif
|
||||
}
|
||||
|
@ -376,7 +376,7 @@ void expire_timeout_chk(_adapter *padapter)
|
|||
psta = LIST_CONTAINOR(plist, struct sta_info, auth_list);
|
||||
plist = get_next(plist);
|
||||
|
||||
if(psta->expire_to>0)
|
||||
if (psta->expire_to>0)
|
||||
{
|
||||
psta->expire_to--;
|
||||
if (psta->expire_to == 0)
|
||||
|
@ -479,7 +479,7 @@ void expire_timeout_chk(_adapter *padapter)
|
|||
pstapriv->tim_bitmap |= BIT(psta->aid);
|
||||
update_beacon(padapter, _TIM_IE_, NULL, _FALSE);
|
||||
|
||||
if(!pmlmeext->active_keep_alive_check)
|
||||
if (!pmlmeext->active_keep_alive_check)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -588,13 +588,13 @@ void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level)
|
|||
WLAN_BSSID_EX *pcur_network = (WLAN_BSSID_EX *)&pmlmepriv->cur_network.network;
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
if(psta)
|
||||
if (psta)
|
||||
psta_ht = &psta->htpriv;
|
||||
else
|
||||
return;
|
||||
#endif //CONFIG_80211N_HT
|
||||
|
||||
if(!(psta->state & _FW_LINKED))
|
||||
if (!(psta->state & _FW_LINKED))
|
||||
return;
|
||||
|
||||
//b/g mode ra_bitmap
|
||||
|
@ -605,10 +605,10 @@ void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level)
|
|||
}
|
||||
#ifdef CONFIG_80211N_HT
|
||||
//n mode ra_bitmap
|
||||
if(psta_ht->ht_option)
|
||||
if (psta_ht->ht_option)
|
||||
{
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
if(rf_type == RF_2T2R)
|
||||
if (rf_type == RF_2T2R)
|
||||
limit=16;// 2R
|
||||
else
|
||||
limit=8;// 1R
|
||||
|
@ -624,13 +624,13 @@ void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level)
|
|||
#endif //CONFIG_80211N_HT
|
||||
|
||||
#if 0//gtest
|
||||
if(get_rf_mimo_mode(padapter) == RTL8712_RF_2T2R)
|
||||
if (get_rf_mimo_mode(padapter) == RTL8712_RF_2T2R)
|
||||
{
|
||||
//is this a 2r STA?
|
||||
if((pstat->tx_ra_bitmap & 0x0ff00000) != 0 && !(priv->pshare->has_2r_sta & BIT(pstat->aid)))
|
||||
if ((pstat->tx_ra_bitmap & 0x0ff00000) != 0 && !(priv->pshare->has_2r_sta & BIT(pstat->aid)))
|
||||
{
|
||||
priv->pshare->has_2r_sta |= BIT(pstat->aid);
|
||||
if(rtw_read16(padapter, 0x102501f6) != 0xffff)
|
||||
if (rtw_read16(padapter, 0x102501f6) != 0xffff)
|
||||
{
|
||||
rtw_write16(padapter, 0x102501f6, 0xffff);
|
||||
reset_1r_sta_RA(priv, 0xffff);
|
||||
|
@ -639,9 +639,9 @@ void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level)
|
|||
}
|
||||
else// bg or 1R STA?
|
||||
{
|
||||
if((priv->pmib->dot11BssType.net_work_type & WIRELESS_11N) && pstat->ht_cap_len && priv->pshare->has_2r_sta == 0)
|
||||
if ((priv->pmib->dot11BssType.net_work_type & WIRELESS_11N) && pstat->ht_cap_len && priv->pshare->has_2r_sta == 0)
|
||||
{
|
||||
if(rtw_read16(padapter, 0x102501f6) != 0x7777)
|
||||
if (rtw_read16(padapter, 0x102501f6) != 0x7777)
|
||||
{ // MCS7 SGI
|
||||
rtw_write16(padapter, 0x102501f6,0x7777);
|
||||
reset_1r_sta_RA(priv, 0x7777);
|
||||
|
@ -811,7 +811,7 @@ static void update_bmc_sta(_adapter *padapter)
|
|||
WLAN_BSSID_EX *pcur_network = (WLAN_BSSID_EX *)&pmlmepriv->cur_network.network;
|
||||
struct sta_info *psta = rtw_get_bcmc_stainfo(padapter);
|
||||
|
||||
if(psta)
|
||||
if (psta)
|
||||
{
|
||||
psta->aid = 0;//default set to 0
|
||||
//psta->mac_id = psta->aid+4;
|
||||
|
@ -863,7 +863,7 @@ static void update_bmc_sta(_adapter *padapter)
|
|||
//ap mode
|
||||
rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, _TRUE);
|
||||
|
||||
//if(pHalData->fw_ractrl == _TRUE)
|
||||
//if (pHalData->fw_ractrl == _TRUE)
|
||||
{
|
||||
u8 arg = 0;
|
||||
|
||||
|
@ -931,7 +931,7 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta)
|
|||
//ap mode
|
||||
rtw_hal_set_odm_var(padapter,HAL_ODM_STA_INFO,psta,_TRUE);
|
||||
|
||||
if(psecuritypriv->dot11AuthAlgrthm==dot11AuthAlgrthm_8021X)
|
||||
if (psecuritypriv->dot11AuthAlgrthm==dot11AuthAlgrthm_8021X)
|
||||
psta->ieee8021x_blocked = _TRUE;
|
||||
else
|
||||
psta->ieee8021x_blocked = _FALSE;
|
||||
|
@ -943,19 +943,19 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta)
|
|||
VCS_update(padapter, psta);
|
||||
#ifdef CONFIG_80211N_HT
|
||||
//HT related cap
|
||||
if(phtpriv_sta->ht_option)
|
||||
if (phtpriv_sta->ht_option)
|
||||
{
|
||||
//check if sta supports rx ampdu
|
||||
phtpriv_sta->ampdu_enable = phtpriv_ap->ampdu_enable;
|
||||
|
||||
//check if sta support s Short GI
|
||||
if((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SGI_20|IEEE80211_HT_CAP_SGI_40))
|
||||
if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SGI_20|IEEE80211_HT_CAP_SGI_40))
|
||||
{
|
||||
phtpriv_sta->sgi = _TRUE;
|
||||
}
|
||||
|
||||
// bwmode
|
||||
if((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH))
|
||||
if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH))
|
||||
{
|
||||
//phtpriv_sta->bwmode = HT_CHANNEL_WIDTH_40;
|
||||
phtpriv_sta->bwmode = pmlmeext->cur_bwmode;
|
||||
|
@ -1028,7 +1028,7 @@ static void update_hw_ht_param(_adapter *padapter)
|
|||
// Config SM Power Save setting
|
||||
//
|
||||
pmlmeinfo->SM_PS = (pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info & 0x0C) >> 2;
|
||||
if(pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC)
|
||||
if (pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC)
|
||||
{
|
||||
/*u8 i;
|
||||
//update the MCS rates
|
||||
|
@ -1076,7 +1076,7 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
|
|||
//check if there is wps ie,
|
||||
//if there is wpsie in beacon, the hostapd will update beacon twice when stating hostapd,
|
||||
//and at first time the security ie ( RSN/WPA IE) will not include in beacon.
|
||||
if(NULL == rtw_get_wps_ie(pnetwork->IEs+_FIXED_IE_LENGTH_, pnetwork->IELength-_FIXED_IE_LENGTH_, NULL, NULL))
|
||||
if (NULL == rtw_get_wps_ie(pnetwork->IEs+_FIXED_IE_LENGTH_, pnetwork->IELength-_FIXED_IE_LENGTH_, NULL, NULL))
|
||||
{
|
||||
pmlmeext->bstart_bss = _TRUE;
|
||||
}
|
||||
|
@ -1084,10 +1084,10 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
|
|||
//todo: update wmm, ht cap
|
||||
//pmlmeinfo->WMM_enable;
|
||||
//pmlmeinfo->HT_enable;
|
||||
if(pmlmepriv->qospriv.qos_option)
|
||||
if (pmlmepriv->qospriv.qos_option)
|
||||
pmlmeinfo->WMM_enable = _TRUE;
|
||||
#ifdef CONFIG_80211N_HT
|
||||
if(pmlmepriv->htpriv.ht_option)
|
||||
if (pmlmepriv->htpriv.ht_option)
|
||||
{
|
||||
pmlmeinfo->WMM_enable = _TRUE;
|
||||
pmlmeinfo->HT_enable = _TRUE;
|
||||
|
@ -1099,7 +1099,7 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
|
|||
#endif //#CONFIG_80211N_HT
|
||||
|
||||
|
||||
if(pmlmepriv->cur_network.join_res != _TRUE) //setting only at first time
|
||||
if (pmlmepriv->cur_network.join_res != _TRUE) //setting only at first time
|
||||
{
|
||||
//WEP Key will be set before this function, do not clear CAM.
|
||||
if ((psecuritypriv->dot11PrivacyAlgrthm != _WEP40_) && (psecuritypriv->dot11PrivacyAlgrthm != _WEP104_))
|
||||
|
@ -1138,7 +1138,7 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
|
|||
UpdateBrateTbl(padapter, pnetwork->SupportedRates);
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_BASIC_RATE, pnetwork->SupportedRates);
|
||||
|
||||
if(pmlmepriv->cur_network.join_res != _TRUE) //setting only at first time
|
||||
if (pmlmepriv->cur_network.join_res != _TRUE) //setting only at first time
|
||||
{
|
||||
//u32 initialgain;
|
||||
|
||||
|
@ -1150,9 +1150,9 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
|
|||
//Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE);
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(padapter->adapter_type > PRIMARY_ADAPTER)
|
||||
if (padapter->adapter_type > PRIMARY_ADAPTER)
|
||||
{
|
||||
if(rtw_buddy_adapter_up(padapter))
|
||||
if (rtw_buddy_adapter_up(padapter))
|
||||
{
|
||||
_adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
|
||||
|
@ -1175,7 +1175,7 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
|
|||
#ifdef CONFIG_80211N_HT
|
||||
//set channel, bwmode
|
||||
p = rtw_get_ie((pnetwork->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _HT_ADD_INFO_IE_, &ie_len, (pnetwork->IELength - sizeof(NDIS_802_11_FIXED_IEs)));
|
||||
if( p && ie_len)
|
||||
if ( p && ie_len)
|
||||
{
|
||||
pht_info = (struct HT_info_element *)(p+2);
|
||||
|
||||
|
@ -1212,11 +1212,11 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
|
|||
//TODO: need to judge the phy parameters on concurrent mode for single phy
|
||||
//set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(!check_buddy_fwstate(padapter, _FW_LINKED|_FW_UNDER_LINKING|_FW_UNDER_SURVEY))
|
||||
if (!check_buddy_fwstate(padapter, _FW_LINKED|_FW_UNDER_LINKING|_FW_UNDER_SURVEY))
|
||||
{
|
||||
set_channel_bwmode(padapter, cur_channel, cur_ch_offset, cur_bwmode);
|
||||
}
|
||||
else if(check_buddy_fwstate(padapter, _FW_LINKED)==_TRUE)//only second adapter can enter AP Mode
|
||||
else if (check_buddy_fwstate(padapter, _FW_LINKED)==_TRUE)//only second adapter can enter AP Mode
|
||||
{
|
||||
_adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
|
@ -1227,19 +1227,19 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
|
|||
DBG_871X("second adapter, CH=%d, BW=%d, offset=%d\n", cur_channel, cur_bwmode, cur_ch_offset);
|
||||
|
||||
cur_channel = pbuddy_mlmeext->cur_channel;
|
||||
if(cur_bwmode == HT_CHANNEL_WIDTH_40)
|
||||
if (cur_bwmode == HT_CHANNEL_WIDTH_40)
|
||||
{
|
||||
if(pht_info)
|
||||
if (pht_info)
|
||||
pht_info->infos[0] &= ~(BIT(0)|BIT(1));
|
||||
|
||||
if(pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40)
|
||||
if (pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40)
|
||||
{
|
||||
cur_ch_offset = pbuddy_mlmeext->cur_ch_offset;
|
||||
|
||||
//to update cur_ch_offset value in beacon
|
||||
if(pht_info)
|
||||
if (pht_info)
|
||||
{
|
||||
switch(cur_ch_offset)
|
||||
switch (cur_ch_offset)
|
||||
{
|
||||
case HAL_PRIME_CHNL_OFFSET_LOWER:
|
||||
pht_info->infos[0] |= 0x1;
|
||||
|
@ -1254,23 +1254,23 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
|
|||
}
|
||||
|
||||
}
|
||||
else if(pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_20)
|
||||
else if (pbuddy_mlmeext->cur_bwmode == HT_CHANNEL_WIDTH_20)
|
||||
{
|
||||
cur_bwmode = HT_CHANNEL_WIDTH_20;
|
||||
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
|
||||
if(cur_channel>0 && cur_channel<5)
|
||||
if (cur_channel>0 && cur_channel<5)
|
||||
{
|
||||
if(pht_info)
|
||||
if (pht_info)
|
||||
pht_info->infos[0] |= 0x1;
|
||||
|
||||
cur_bwmode = HT_CHANNEL_WIDTH_40;
|
||||
cur_ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
|
||||
}
|
||||
|
||||
if(cur_channel>7 && cur_channel<(14+1))
|
||||
if (cur_channel>7 && cur_channel<(14+1))
|
||||
{
|
||||
if(pht_info)
|
||||
if (pht_info)
|
||||
pht_info->infos[0] |= 0x3;
|
||||
|
||||
cur_bwmode = HT_CHANNEL_WIDTH_40;
|
||||
|
@ -1285,10 +1285,10 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
|
|||
// to update channel value in beacon
|
||||
pnetwork->Configuration.DSConfig = cur_channel;
|
||||
p = rtw_get_ie((pnetwork->IEs + sizeof(NDIS_802_11_FIXED_IEs)), _DSSET_IE_, &ie_len, (pnetwork->IELength - sizeof(NDIS_802_11_FIXED_IEs)));
|
||||
if(p && ie_len>0)
|
||||
if (p && ie_len>0)
|
||||
*(p + 2) = cur_channel;
|
||||
|
||||
if(pht_info)
|
||||
if (pht_info)
|
||||
pht_info->primary_channel = cur_channel;
|
||||
}
|
||||
#else
|
||||
|
@ -1318,14 +1318,14 @@ static void start_bss_network(_adapter *padapter, u8 *pbuf)
|
|||
pwdinfo->p2p_group_ssid_len = pnetwork->Ssid.SsidLength;
|
||||
#endif //CONFIG_P2P
|
||||
|
||||
if(_TRUE == pmlmeext->bstart_bss)
|
||||
if (_TRUE == pmlmeext->bstart_bss)
|
||||
{
|
||||
update_beacon(padapter, _TIM_IE_, NULL, _FALSE);
|
||||
|
||||
#ifndef CONFIG_INTERRUPT_BASED_TXBCN //other case will tx beacon when bcn interrupt coming in.
|
||||
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
|
||||
//issue beacon frame
|
||||
if(send_beacon(padapter)==_FAIL)
|
||||
if (send_beacon(padapter)==_FAIL)
|
||||
{
|
||||
DBG_871X("issue_beacon, fail!\n");
|
||||
}
|
||||
|
@ -1378,11 +1378,11 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
|
||||
DBG_871X("%s, len=%d\n", __FUNCTION__, len);
|
||||
|
||||
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) != _TRUE)
|
||||
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != _TRUE)
|
||||
return _FAIL;
|
||||
|
||||
|
||||
if(len>MAX_IE_SZ)
|
||||
if (len>MAX_IE_SZ)
|
||||
return _FAIL;
|
||||
|
||||
pbss_network->IELength = len;
|
||||
|
@ -1392,7 +1392,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
_rtw_memcpy(ie, pbuf, pbss_network->IELength);
|
||||
|
||||
|
||||
if(pbss_network->InfrastructureMode!=Ndis802_11APMode)
|
||||
if (pbss_network->InfrastructureMode!=Ndis802_11APMode)
|
||||
return _FAIL;
|
||||
|
||||
pbss_network->Rssi = 0;
|
||||
|
@ -1411,7 +1411,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
|
||||
//SSID
|
||||
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SSID_IE_, &ie_len, (pbss_network->IELength -_BEACON_IE_OFFSET_));
|
||||
if(p && ie_len>0)
|
||||
if (p && ie_len>0)
|
||||
{
|
||||
_rtw_memset(&pbss_network->Ssid, 0, sizeof(NDIS_802_11_SSID));
|
||||
_rtw_memcpy(pbss_network->Ssid.Ssid, (p + 2), ie_len);
|
||||
|
@ -1422,7 +1422,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
channel = 0;
|
||||
pbss_network->Configuration.Length = 0;
|
||||
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _DSSET_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
|
||||
if(p && ie_len>0)
|
||||
if (p && ie_len>0)
|
||||
channel = *(p + 2);
|
||||
|
||||
pbss_network->Configuration.DSConfig = channel;
|
||||
|
@ -1453,7 +1453,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
|
||||
//parsing ERP_IE
|
||||
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _ERPINFO_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
|
||||
if(p && ie_len>0)
|
||||
if (p && ie_len>0)
|
||||
{
|
||||
ERP_IE_handler(padapter, (PNDIS_802_11_VARIABLE_IEs)p);
|
||||
}
|
||||
|
@ -1471,9 +1471,9 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
psecuritypriv->wpa2_group_cipher = _NO_PRIVACY_;
|
||||
psecuritypriv->wpa2_pairwise_cipher = _NO_PRIVACY_;
|
||||
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _RSN_IE_2_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
|
||||
if(p && ie_len>0)
|
||||
if (p && ie_len>0)
|
||||
{
|
||||
if(rtw_parse_wpa2_ie(p, ie_len+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS)
|
||||
if (rtw_parse_wpa2_ie(p, ie_len+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS)
|
||||
{
|
||||
psecuritypriv->dot11AuthAlgrthm= dot11AuthAlgrthm_8021X;
|
||||
|
||||
|
@ -1483,7 +1483,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
psecuritypriv->wpa2_group_cipher = group_cipher;
|
||||
psecuritypriv->wpa2_pairwise_cipher = pairwise_cipher;
|
||||
#if 0
|
||||
switch(group_cipher)
|
||||
switch (group_cipher)
|
||||
{
|
||||
case WPA_CIPHER_NONE:
|
||||
psecuritypriv->wpa2_group_cipher = _NO_PRIVACY_;
|
||||
|
@ -1502,7 +1502,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
break;
|
||||
}
|
||||
|
||||
switch(pairwise_cipher)
|
||||
switch (pairwise_cipher)
|
||||
{
|
||||
case WPA_CIPHER_NONE:
|
||||
psecuritypriv->wpa2_pairwise_cipher = _NO_PRIVACY_;
|
||||
|
@ -1535,7 +1535,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
p = rtw_get_ie(p, _SSN_IE_1_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2)));
|
||||
if ((p) && (_rtw_memcmp(p+2, OUI1, 4)))
|
||||
{
|
||||
if(rtw_parse_wpa_ie(p, ie_len+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS)
|
||||
if (rtw_parse_wpa_ie(p, ie_len+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS)
|
||||
{
|
||||
psecuritypriv->dot11AuthAlgrthm= dot11AuthAlgrthm_8021X;
|
||||
|
||||
|
@ -1547,7 +1547,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
psecuritypriv->wpa_pairwise_cipher = pairwise_cipher;
|
||||
|
||||
#if 0
|
||||
switch(group_cipher)
|
||||
switch (group_cipher)
|
||||
{
|
||||
case WPA_CIPHER_NONE:
|
||||
psecuritypriv->wpa_group_cipher = _NO_PRIVACY_;
|
||||
|
@ -1566,7 +1566,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
break;
|
||||
}
|
||||
|
||||
switch(pairwise_cipher)
|
||||
switch (pairwise_cipher)
|
||||
{
|
||||
case WPA_CIPHER_NONE:
|
||||
psecuritypriv->wpa_pairwise_cipher = _NO_PRIVACY_;
|
||||
|
@ -1601,12 +1601,12 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
//wmm
|
||||
ie_len = 0;
|
||||
pmlmepriv->qospriv.qos_option = 0;
|
||||
if(pregistrypriv->wmm_enable)
|
||||
if (pregistrypriv->wmm_enable)
|
||||
{
|
||||
for (p = ie + _BEACON_IE_OFFSET_; ;p += (ie_len + 2))
|
||||
{
|
||||
p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_ - (ie_len + 2)));
|
||||
if((p) && _rtw_memcmp(p+2, WMM_PARA_IE, 6))
|
||||
if ((p) && _rtw_memcmp(p+2, WMM_PARA_IE, 6))
|
||||
{
|
||||
pmlmepriv->qospriv.qos_option = 1;
|
||||
|
||||
|
@ -1630,7 +1630,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
#ifdef CONFIG_80211N_HT
|
||||
//parsing HT_CAP_IE
|
||||
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_CAPABILITY_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
|
||||
if(p && ie_len>0)
|
||||
if (p && ie_len>0)
|
||||
{
|
||||
u8 rf_type;
|
||||
|
||||
|
@ -1645,7 +1645,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
|
||||
if((psecuritypriv->wpa_pairwise_cipher & WPA_CIPHER_CCMP) ||
|
||||
if ((psecuritypriv->wpa_pairwise_cipher & WPA_CIPHER_CCMP) ||
|
||||
(psecuritypriv->wpa2_pairwise_cipher & WPA_CIPHER_CCMP))
|
||||
{
|
||||
pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&(0x07<<2));
|
||||
|
@ -1657,7 +1657,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
|
||||
pht_cap->ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_FACTOR & 0x03); //set Max Rx AMPDU size to 64K
|
||||
|
||||
if(rf_type == RF_1T1R)
|
||||
if (rf_type == RF_1T1R)
|
||||
{
|
||||
pht_cap->supp_mcs_set[0] = 0xff;
|
||||
pht_cap->supp_mcs_set[1] = 0x0;
|
||||
|
@ -1669,12 +1669,12 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
|
||||
//parsing HT_INFO_IE
|
||||
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_ADD_INFO_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_));
|
||||
if(p && ie_len>0)
|
||||
if (p && ie_len>0)
|
||||
{
|
||||
pHT_info_ie=p;
|
||||
}
|
||||
#endif //CONFIG_80211N_HT
|
||||
switch(network_type)
|
||||
switch (network_type)
|
||||
{
|
||||
case WIRELESS_11B:
|
||||
pbss_network->NetworkTypeInUse = Ndis802_11DS;
|
||||
|
@ -1698,7 +1698,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
#ifdef CONFIG_80211N_HT
|
||||
pmlmepriv->htpriv.ht_option = _FALSE;
|
||||
|
||||
if( (psecuritypriv->wpa2_pairwise_cipher&WPA_CIPHER_TKIP) ||
|
||||
if ( (psecuritypriv->wpa2_pairwise_cipher&WPA_CIPHER_TKIP) ||
|
||||
(psecuritypriv->wpa_pairwise_cipher&WPA_CIPHER_TKIP))
|
||||
{
|
||||
//todo:
|
||||
|
@ -1706,12 +1706,12 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
}
|
||||
|
||||
//ht_cap
|
||||
if(pregistrypriv->ht_enable && ht_cap==_TRUE)
|
||||
if (pregistrypriv->ht_enable && ht_cap==_TRUE)
|
||||
{
|
||||
pmlmepriv->htpriv.ht_option = _TRUE;
|
||||
pmlmepriv->qospriv.qos_option = 1;
|
||||
|
||||
if(pregistrypriv->ampdu_enable==1)
|
||||
if (pregistrypriv->ampdu_enable==1)
|
||||
{
|
||||
pmlmepriv->htpriv.ampdu_enable = _TRUE;
|
||||
}
|
||||
|
@ -1731,7 +1731,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
|
||||
//alloc sta_info for ap itself
|
||||
psta = rtw_get_stainfo(&padapter->stapriv, pbss_network->MacAddress);
|
||||
if(!psta)
|
||||
if (!psta)
|
||||
{
|
||||
psta = rtw_alloc_stainfo(&padapter->stapriv, pbss_network->MacAddress);
|
||||
if (psta == NULL)
|
||||
|
@ -1774,7 +1774,7 @@ int rtw_acl_add_sta(_adapter *padapter, u8 *addr)
|
|||
|
||||
DBG_871X("%s(acl_num=%d)=" MAC_FMT "\n", __func__, pacl_list->num, MAC_ARG(addr));
|
||||
|
||||
if((NUM_ACL-1) < pacl_list->num)
|
||||
if ((NUM_ACL-1) < pacl_list->num)
|
||||
return (-1);
|
||||
|
||||
|
||||
|
@ -1788,9 +1788,9 @@ int rtw_acl_add_sta(_adapter *padapter, u8 *addr)
|
|||
paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
|
||||
plist = get_next(plist);
|
||||
|
||||
if(_rtw_memcmp(paclnode->addr, addr, ETH_ALEN))
|
||||
if (_rtw_memcmp(paclnode->addr, addr, ETH_ALEN))
|
||||
{
|
||||
if(paclnode->valid == _TRUE)
|
||||
if (paclnode->valid == _TRUE)
|
||||
{
|
||||
added = _TRUE;
|
||||
DBG_871X("%s, sta has been added\n", __func__);
|
||||
|
@ -1802,17 +1802,17 @@ int rtw_acl_add_sta(_adapter *padapter, u8 *addr)
|
|||
_exit_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
|
||||
|
||||
if(added == _TRUE)
|
||||
if (added == _TRUE)
|
||||
return ret;
|
||||
|
||||
|
||||
_enter_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
|
||||
for(i=0; i< NUM_ACL; i++)
|
||||
for (i=0; i< NUM_ACL; i++)
|
||||
{
|
||||
paclnode = &pacl_list->aclnode[i];
|
||||
|
||||
if(paclnode->valid == _FALSE)
|
||||
if (paclnode->valid == _FALSE)
|
||||
{
|
||||
_rtw_init_listhead(&paclnode->list);
|
||||
|
||||
|
@ -1857,9 +1857,9 @@ int rtw_acl_remove_sta(_adapter *padapter, u8 *addr)
|
|||
paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
|
||||
plist = get_next(plist);
|
||||
|
||||
if(_rtw_memcmp(paclnode->addr, addr, ETH_ALEN))
|
||||
if (_rtw_memcmp(paclnode->addr, addr, ETH_ALEN))
|
||||
{
|
||||
if(paclnode->valid == _TRUE)
|
||||
if (paclnode->valid == _TRUE)
|
||||
{
|
||||
paclnode->valid = _FALSE;
|
||||
|
||||
|
@ -1897,12 +1897,12 @@ static void update_bcn_erpinfo_ie(_adapter *padapter)
|
|||
|
||||
DBG_871X("%s, ERP_enable=%d\n", __FUNCTION__, pmlmeinfo->ERP_enable);
|
||||
|
||||
if(!pmlmeinfo->ERP_enable)
|
||||
if (!pmlmeinfo->ERP_enable)
|
||||
return;
|
||||
|
||||
//parsing ERP_IE
|
||||
p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _ERPINFO_IE_, &len, (pnetwork->IELength - _BEACON_IE_OFFSET_));
|
||||
if(p && len>0)
|
||||
if (p && len>0)
|
||||
{
|
||||
PNDIS_802_11_VARIABLE_IEs pIE = (PNDIS_802_11_VARIABLE_IEs)p;
|
||||
|
||||
|
@ -1911,7 +1911,7 @@ static void update_bcn_erpinfo_ie(_adapter *padapter)
|
|||
else
|
||||
pIE->data[0] &= ~(RTW_ERP_INFO_NON_ERP_PRESENT|RTW_ERP_INFO_USE_PROTECTION);
|
||||
|
||||
if(pmlmepriv->num_sta_no_short_preamble > 0)
|
||||
if (pmlmepriv->num_sta_no_short_preamble > 0)
|
||||
pIE->data[0] |= RTW_ERP_INFO_BARKER_PREAMBLE_MODE;
|
||||
else
|
||||
pIE->data[0] &= ~(RTW_ERP_INFO_BARKER_PREAMBLE_MODE);
|
||||
|
@ -1967,7 +1967,7 @@ static void update_bcn_wps_ie(_adapter *padapter)
|
|||
|
||||
pwps_ie = rtw_get_wps_ie(ie+_FIXED_IE_LENGTH_, ielen-_FIXED_IE_LENGTH_, NULL, &wps_ielen);
|
||||
|
||||
if(pwps_ie==NULL || wps_ielen==0)
|
||||
if (pwps_ie==NULL || wps_ielen==0)
|
||||
return;
|
||||
|
||||
wps_offset = (uint)(pwps_ie-ie);
|
||||
|
@ -1976,33 +1976,33 @@ static void update_bcn_wps_ie(_adapter *padapter)
|
|||
|
||||
remainder_ielen = ielen - wps_offset - wps_ielen;
|
||||
|
||||
if(remainder_ielen>0)
|
||||
if (remainder_ielen>0)
|
||||
{
|
||||
pbackup_remainder_ie = rtw_malloc(remainder_ielen);
|
||||
if(pbackup_remainder_ie)
|
||||
if (pbackup_remainder_ie)
|
||||
_rtw_memcpy(pbackup_remainder_ie, premainder_ie, remainder_ielen);
|
||||
}
|
||||
|
||||
|
||||
pwps_ie_src = pmlmepriv->wps_beacon_ie;
|
||||
if(pwps_ie_src == NULL)
|
||||
if (pwps_ie_src == NULL)
|
||||
return;
|
||||
|
||||
|
||||
wps_ielen = (uint)pwps_ie_src[1];//to get ie data len
|
||||
if((wps_offset+wps_ielen+2+remainder_ielen)<=MAX_IE_SZ)
|
||||
if ((wps_offset+wps_ielen+2+remainder_ielen)<=MAX_IE_SZ)
|
||||
{
|
||||
_rtw_memcpy(pwps_ie, pwps_ie_src, wps_ielen+2);
|
||||
pwps_ie += (wps_ielen+2);
|
||||
|
||||
if(pbackup_remainder_ie)
|
||||
if (pbackup_remainder_ie)
|
||||
_rtw_memcpy(pwps_ie, pbackup_remainder_ie, remainder_ielen);
|
||||
|
||||
//update IELength
|
||||
pnetwork->IELength = wps_offset + (wps_ielen+2) + remainder_ielen;
|
||||
}
|
||||
|
||||
if(pbackup_remainder_ie)
|
||||
if (pbackup_remainder_ie)
|
||||
rtw_mfree(pbackup_remainder_ie, remainder_ielen);
|
||||
|
||||
}
|
||||
|
@ -2016,19 +2016,19 @@ static void update_bcn_vendor_spec_ie(_adapter *padapter, u8*oui)
|
|||
{
|
||||
DBG_871X("%s\n", __FUNCTION__);
|
||||
|
||||
if(_rtw_memcmp(RTW_WPA_OUI, oui, 4))
|
||||
if (_rtw_memcmp(RTW_WPA_OUI, oui, 4))
|
||||
{
|
||||
update_bcn_wpa_ie(padapter);
|
||||
}
|
||||
else if(_rtw_memcmp(WMM_OUI, oui, 4))
|
||||
else if (_rtw_memcmp(WMM_OUI, oui, 4))
|
||||
{
|
||||
update_bcn_wmm_ie(padapter);
|
||||
}
|
||||
else if(_rtw_memcmp(WPS_OUI, oui, 4))
|
||||
else if (_rtw_memcmp(WPS_OUI, oui, 4))
|
||||
{
|
||||
update_bcn_wps_ie(padapter);
|
||||
}
|
||||
else if(_rtw_memcmp(P2P_OUI, oui, 4))
|
||||
else if (_rtw_memcmp(P2P_OUI, oui, 4))
|
||||
{
|
||||
update_bcn_p2p_ie(padapter);
|
||||
}
|
||||
|
@ -2049,19 +2049,19 @@ void update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx)
|
|||
|
||||
//DBG_871X("%s\n", __FUNCTION__);
|
||||
|
||||
if(!padapter)
|
||||
if (!padapter)
|
||||
return;
|
||||
|
||||
pmlmepriv = &(padapter->mlmepriv);
|
||||
pmlmeext = &(padapter->mlmeextpriv);
|
||||
//pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
if(_FALSE == pmlmeext->bstart_bss)
|
||||
if (_FALSE == pmlmeext->bstart_bss)
|
||||
return;
|
||||
|
||||
_enter_critical_bh(&pmlmepriv->bcn_update_lock, &irqL);
|
||||
|
||||
switch(ie_id)
|
||||
switch (ie_id)
|
||||
{
|
||||
case 0xFF:
|
||||
|
||||
|
@ -2115,7 +2115,7 @@ void update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx)
|
|||
|
||||
#ifndef CONFIG_INTERRUPT_BASED_TXBCN
|
||||
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
|
||||
if(tx)
|
||||
if (tx)
|
||||
{
|
||||
//send_beacon(padapter);//send_beacon must execute on TSR level
|
||||
set_tx_beacon_cmd(padapter);
|
||||
|
@ -2150,7 +2150,7 @@ static int rtw_ht_operation_update(_adapter *padapter)
|
|||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct ht_priv *phtpriv_ap = &pmlmepriv->htpriv;
|
||||
|
||||
if(pmlmepriv->htpriv.ht_option == _TRUE)
|
||||
if (pmlmepriv->htpriv.ht_option == _TRUE)
|
||||
return 0;
|
||||
|
||||
//if (!iface->conf->ieee80211n || iface->conf->ht_op_mode_fixed)
|
||||
|
@ -2219,7 +2219,7 @@ static int rtw_ht_operation_update(_adapter *padapter)
|
|||
void associated_clients_update(_adapter *padapter, u8 updated)
|
||||
{
|
||||
//update associcated stations cap.
|
||||
if(updated == _TRUE)
|
||||
if (updated == _TRUE)
|
||||
{
|
||||
_irqL irqL;
|
||||
_list *phead, *plist;
|
||||
|
@ -2267,9 +2267,9 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
|
|||
#endif
|
||||
|
||||
|
||||
if(!(psta->flags & WLAN_STA_SHORT_PREAMBLE))
|
||||
if (!(psta->flags & WLAN_STA_SHORT_PREAMBLE))
|
||||
{
|
||||
if(!psta->no_short_preamble_set)
|
||||
if (!psta->no_short_preamble_set)
|
||||
{
|
||||
psta->no_short_preamble_set = 1;
|
||||
|
||||
|
@ -2286,7 +2286,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
|
|||
}
|
||||
else
|
||||
{
|
||||
if(psta->no_short_preamble_set)
|
||||
if (psta->no_short_preamble_set)
|
||||
{
|
||||
psta->no_short_preamble_set = 0;
|
||||
|
||||
|
@ -2311,9 +2311,9 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
|
|||
}
|
||||
#endif
|
||||
|
||||
if(psta->flags & WLAN_STA_NONERP)
|
||||
if (psta->flags & WLAN_STA_NONERP)
|
||||
{
|
||||
if(!psta->nonerp_set)
|
||||
if (!psta->nonerp_set)
|
||||
{
|
||||
psta->nonerp_set = 1;
|
||||
|
||||
|
@ -2329,7 +2329,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
|
|||
}
|
||||
else
|
||||
{
|
||||
if(psta->nonerp_set)
|
||||
if (psta->nonerp_set)
|
||||
{
|
||||
psta->nonerp_set = 0;
|
||||
|
||||
|
@ -2356,9 +2356,9 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
|
|||
}
|
||||
#endif
|
||||
|
||||
if(!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT))
|
||||
if (!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT))
|
||||
{
|
||||
if(!psta->no_short_slot_time_set)
|
||||
if (!psta->no_short_slot_time_set)
|
||||
{
|
||||
psta->no_short_slot_time_set = 1;
|
||||
|
||||
|
@ -2375,7 +2375,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
|
|||
}
|
||||
else
|
||||
{
|
||||
if(psta->no_short_slot_time_set)
|
||||
if (psta->no_short_slot_time_set)
|
||||
{
|
||||
psta->no_short_slot_time_set = 0;
|
||||
|
||||
|
@ -2433,7 +2433,7 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
|
|||
psta->no_ht_set = 1;
|
||||
pmlmepriv->num_sta_no_ht++;
|
||||
}
|
||||
if(pmlmepriv->htpriv.ht_option == _TRUE) {
|
||||
if (pmlmepriv->htpriv.ht_option == _TRUE) {
|
||||
DBG_871X("%s STA " MAC_FMT
|
||||
" - no HT, num of non-HT stations %d\n",
|
||||
__FUNCTION__, MAC_ARG(psta->hwaddr),
|
||||
|
@ -2462,7 +2462,7 @@ u8 bss_cap_update_on_sta_leave(_adapter *padapter, struct sta_info *psta)
|
|||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
|
||||
if(!psta)
|
||||
if (!psta)
|
||||
return beacon_updated;
|
||||
|
||||
if (psta->no_short_preamble_set) {
|
||||
|
@ -2539,7 +2539,7 @@ u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reaso
|
|||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
if(!psta)
|
||||
if (!psta)
|
||||
return beacon_updated;
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
|
@ -2594,7 +2594,7 @@ u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reaso
|
|||
|
||||
}
|
||||
|
||||
int rtw_ap_inform_ch_switch(_adapter *padapter, u8 new_ch, u8 ch_offset)
|
||||
int rtw_ap_inform_ch_switch (_adapter *padapter, u8 new_ch, u8 ch_offset)
|
||||
{
|
||||
_irqL irqL;
|
||||
_list *phead, *plist;
|
||||
|
@ -2605,7 +2605,7 @@ int rtw_ap_inform_ch_switch(_adapter *padapter, u8 new_ch, u8 ch_offset)
|
|||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
|
||||
|
||||
if((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
|
||||
if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
|
||||
return ret;
|
||||
|
||||
DBG_871X(FUNC_NDEV_FMT" with ch:%u, offset:%u\n",
|
||||
|
@ -2621,12 +2621,12 @@ int rtw_ap_inform_ch_switch(_adapter *padapter, u8 new_ch, u8 ch_offset)
|
|||
psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
|
||||
plist = get_next(plist);
|
||||
|
||||
issue_action_spct_ch_switch(padapter, psta->hwaddr, new_ch, ch_offset);
|
||||
issue_action_spct_ch_switch (padapter, psta->hwaddr, new_ch, ch_offset);
|
||||
psta->expire_to = ((pstapriv->expire_to * 2) > 5) ? 5 : (pstapriv->expire_to * 2);
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
|
||||
issue_action_spct_ch_switch(padapter, bc_addr, new_ch, ch_offset);
|
||||
issue_action_spct_ch_switch (padapter, bc_addr, new_ch, ch_offset);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -2644,7 +2644,7 @@ int rtw_sta_flush(_adapter *padapter)
|
|||
|
||||
DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(padapter->pnetdev));
|
||||
|
||||
if((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
|
||||
if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
|
||||
return ret;
|
||||
|
||||
|
||||
|
@ -2685,18 +2685,18 @@ void sta_info_update(_adapter *padapter, struct sta_info *psta)
|
|||
|
||||
|
||||
//update wmm cap.
|
||||
if(WLAN_STA_WME&flags)
|
||||
if (WLAN_STA_WME&flags)
|
||||
psta->qos_option = 1;
|
||||
else
|
||||
psta->qos_option = 0;
|
||||
|
||||
if(pmlmepriv->qospriv.qos_option == 0)
|
||||
if (pmlmepriv->qospriv.qos_option == 0)
|
||||
psta->qos_option = 0;
|
||||
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
//update 802.11n ht cap.
|
||||
if(WLAN_STA_HT&flags)
|
||||
if (WLAN_STA_HT&flags)
|
||||
{
|
||||
psta->htpriv.ht_option = _TRUE;
|
||||
psta->qos_option = 1;
|
||||
|
@ -2706,7 +2706,7 @@ void sta_info_update(_adapter *padapter, struct sta_info *psta)
|
|||
psta->htpriv.ht_option = _FALSE;
|
||||
}
|
||||
|
||||
if(pmlmepriv->htpriv.ht_option == _FALSE)
|
||||
if (pmlmepriv->htpriv.ht_option == _FALSE)
|
||||
psta->htpriv.ht_option = _FALSE;
|
||||
#endif
|
||||
|
||||
|
@ -2719,7 +2719,7 @@ void sta_info_update(_adapter *padapter, struct sta_info *psta)
|
|||
/* called >= TSR LEVEL for USB or SDIO Interface*/
|
||||
void ap_sta_info_defer_update(_adapter *padapter, struct sta_info *psta)
|
||||
{
|
||||
if(psta->state & _FW_LINKED)
|
||||
if (psta->state & _FW_LINKED)
|
||||
{
|
||||
//add ratid
|
||||
add_RATid(padapter, psta, 0);//DM_RATR_STA_INIT
|
||||
|
@ -2759,7 +2759,7 @@ void start_ap_mode(_adapter *padapter)
|
|||
pmlmepriv->ht_op_mode = 0;
|
||||
#endif
|
||||
|
||||
for(i=0; i<NUM_STA; i++)
|
||||
for (i=0; i<NUM_STA; i++)
|
||||
pstapriv->sta_aid[i] = NULL;
|
||||
|
||||
pmlmepriv->wps_beacon_ie = NULL;
|
||||
|
@ -2774,7 +2774,7 @@ void start_ap_mode(_adapter *padapter)
|
|||
_rtw_init_listhead(&(pacl_list->acl_node_q.queue));
|
||||
pacl_list->num = 0;
|
||||
pacl_list->mode = 0;
|
||||
for(i = 0; i < NUM_ACL; i++)
|
||||
for (i = 0; i < NUM_ACL; i++)
|
||||
{
|
||||
_rtw_init_listhead(&pacl_list->aclnode[i].list);
|
||||
pacl_list->aclnode[i].valid = _FALSE;
|
||||
|
@ -2812,7 +2812,7 @@ void stop_ap_mode(_adapter *padapter)
|
|||
paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
|
||||
plist = get_next(plist);
|
||||
|
||||
if(paclnode->valid == _TRUE)
|
||||
if (paclnode->valid == _TRUE)
|
||||
{
|
||||
paclnode->valid = _FALSE;
|
||||
|
||||
|
|
|
@ -90,11 +90,11 @@ static __inline__ unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, un
|
|||
unsigned short tagLen, tagType;
|
||||
|
||||
start_ptr = cur_ptr = (unsigned char *)ph->tag;
|
||||
while((cur_ptr - start_ptr) < ntohs(ph->length)) {
|
||||
while ((cur_ptr - start_ptr) < ntohs(ph->length)) {
|
||||
// prevent un-alignment access
|
||||
tagType = (unsigned short)((cur_ptr[0] << 8) + cur_ptr[1]);
|
||||
tagLen = (unsigned short)((cur_ptr[2] << 8) + cur_ptr[3]);
|
||||
if(tagType == type)
|
||||
if (tagType == type)
|
||||
return cur_ptr;
|
||||
cur_ptr = cur_ptr + TAG_HDR_LEN + tagLen;
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ static __inline__ unsigned long __nat25_timeout(_adapter *priv)
|
|||
static __inline__ int __nat25_has_expired(_adapter *priv,
|
||||
struct nat25_network_db_entry *fdb)
|
||||
{
|
||||
if(time_before_eq(fdb->ageing_timer, __nat25_timeout(priv)))
|
||||
if (time_before_eq(fdb->ageing_timer, __nat25_timeout(priv)))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
@ -330,7 +330,7 @@ static void convert_ipv6_mac_to_mc(struct sk_buff *skb)
|
|||
|
||||
static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
|
||||
{
|
||||
if(networkAddr[0] == NAT25_IPV4)
|
||||
if (networkAddr[0] == NAT25_IPV4)
|
||||
{
|
||||
unsigned long x;
|
||||
|
||||
|
@ -338,7 +338,7 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
|
|||
|
||||
return x & (NAT25_HASH_SIZE - 1);
|
||||
}
|
||||
else if(networkAddr[0] == NAT25_IPX)
|
||||
else if (networkAddr[0] == NAT25_IPX)
|
||||
{
|
||||
unsigned long x;
|
||||
|
||||
|
@ -347,7 +347,7 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
|
|||
|
||||
return x & (NAT25_HASH_SIZE - 1);
|
||||
}
|
||||
else if(networkAddr[0] == NAT25_APPLE)
|
||||
else if (networkAddr[0] == NAT25_APPLE)
|
||||
{
|
||||
unsigned long x;
|
||||
|
||||
|
@ -355,7 +355,7 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
|
|||
|
||||
return x & (NAT25_HASH_SIZE - 1);
|
||||
}
|
||||
else if(networkAddr[0] == NAT25_PPPOE)
|
||||
else if (networkAddr[0] == NAT25_PPPOE)
|
||||
{
|
||||
unsigned long x;
|
||||
|
||||
|
@ -364,7 +364,7 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
|
|||
return x & (NAT25_HASH_SIZE - 1);
|
||||
}
|
||||
#ifdef CL_IPV6_PASS
|
||||
else if(networkAddr[0] == NAT25_IPV6)
|
||||
else if (networkAddr[0] == NAT25_IPV6)
|
||||
{
|
||||
unsigned long x;
|
||||
|
||||
|
@ -397,7 +397,7 @@ static __inline__ void __network_hash_link(_adapter *priv,
|
|||
//_enter_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
|
||||
ent->next_hash = priv->nethash[hash];
|
||||
if(ent->next_hash != NULL)
|
||||
if (ent->next_hash != NULL)
|
||||
ent->next_hash->pprev_hash = &ent->next_hash;
|
||||
priv->nethash[hash] = ent;
|
||||
ent->pprev_hash = &priv->nethash[hash];
|
||||
|
@ -413,7 +413,7 @@ static __inline__ void __network_hash_unlink(struct nat25_network_db_entry *ent)
|
|||
//_enter_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
|
||||
*(ent->pprev_hash) = ent->next_hash;
|
||||
if(ent->next_hash != NULL)
|
||||
if (ent->next_hash != NULL)
|
||||
ent->next_hash->pprev_hash = ent->pprev_hash;
|
||||
ent->next_hash = NULL;
|
||||
ent->pprev_hash = NULL;
|
||||
|
@ -432,9 +432,9 @@ static int __nat25_db_network_lookup_and_replace(_adapter *priv,
|
|||
db = priv->nethash[__nat25_network_hash(networkAddr)];
|
||||
while (db != NULL)
|
||||
{
|
||||
if(!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN))
|
||||
if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN))
|
||||
{
|
||||
if(!__nat25_has_expired(priv, db))
|
||||
if (!__nat25_has_expired(priv, db))
|
||||
{
|
||||
// replace the destination mac address
|
||||
memcpy(skb->data, db->macAddr, ETH_ALEN);
|
||||
|
@ -511,7 +511,7 @@ static void __nat25_db_network_insert(_adapter *priv,
|
|||
db = priv->nethash[hash];
|
||||
while (db != NULL)
|
||||
{
|
||||
if(!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN))
|
||||
if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN))
|
||||
{
|
||||
memcpy(db->macAddr, macAddr, ETH_ALEN);
|
||||
db->ageing_timer = jiffies;
|
||||
|
@ -523,7 +523,7 @@ static void __nat25_db_network_insert(_adapter *priv,
|
|||
}
|
||||
|
||||
db = (struct nat25_network_db_entry *) rtw_malloc(sizeof(*db));
|
||||
if(db == NULL) {
|
||||
if (db == NULL) {
|
||||
_exit_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
return;
|
||||
}
|
||||
|
@ -550,10 +550,10 @@ static void __nat25_db_print(_adapter *priv)
|
|||
struct nat25_network_db_entry *db;
|
||||
|
||||
counter++;
|
||||
if((counter % 16) != 0)
|
||||
if ((counter % 16) != 0)
|
||||
return;
|
||||
|
||||
for(i=0, j=0; i<NAT25_HASH_SIZE; i++)
|
||||
for (i=0, j=0; i<NAT25_HASH_SIZE; i++)
|
||||
{
|
||||
db = priv->nethash[i];
|
||||
|
||||
|
@ -634,7 +634,7 @@ void nat25_db_cleanup(_adapter *priv)
|
|||
_irqL irqL;
|
||||
_enter_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
|
||||
for(i=0; i<NAT25_HASH_SIZE; i++)
|
||||
for (i=0; i<NAT25_HASH_SIZE; i++)
|
||||
{
|
||||
struct nat25_network_db_entry *f;
|
||||
f = priv->nethash[i];
|
||||
|
@ -642,7 +642,7 @@ void nat25_db_cleanup(_adapter *priv)
|
|||
struct nat25_network_db_entry *g;
|
||||
|
||||
g = f->next_hash;
|
||||
if(priv->scdb_entry == f)
|
||||
if (priv->scdb_entry == f)
|
||||
{
|
||||
memset(priv->scdb_mac, 0, ETH_ALEN);
|
||||
memset(priv->scdb_ip, 0, 4);
|
||||
|
@ -665,7 +665,7 @@ void nat25_db_expire(_adapter *priv)
|
|||
_irqL irqL;
|
||||
_enter_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
|
||||
//if(!priv->ethBrExtInfo.nat25_disable)
|
||||
//if (!priv->ethBrExtInfo.nat25_disable)
|
||||
{
|
||||
for (i=0; i<NAT25_HASH_SIZE; i++)
|
||||
{
|
||||
|
@ -677,9 +677,9 @@ void nat25_db_expire(_adapter *priv)
|
|||
struct nat25_network_db_entry *g;
|
||||
g = f->next_hash;
|
||||
|
||||
if(__nat25_has_expired(priv, f))
|
||||
if (__nat25_has_expired(priv, f))
|
||||
{
|
||||
if(atomic_dec_and_test(&f->use_count))
|
||||
if (atomic_dec_and_test(&f->use_count))
|
||||
{
|
||||
#ifdef BR_EXT_DEBUG
|
||||
#ifdef CL_IPV6_PASS
|
||||
|
@ -732,7 +732,7 @@ void nat25_db_expire(_adapter *priv)
|
|||
f->networkAddr[10]);
|
||||
#endif
|
||||
#endif
|
||||
if(priv->scdb_entry == f)
|
||||
if (priv->scdb_entry == f)
|
||||
{
|
||||
memset(priv->scdb_mac, 0, ETH_ALEN);
|
||||
memset(priv->scdb_ip, 0, 4);
|
||||
|
@ -785,10 +785,10 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
unsigned short protocol;
|
||||
unsigned char networkAddr[MAX_NETWORK_ADDR_LEN];
|
||||
|
||||
if(skb == NULL)
|
||||
if (skb == NULL)
|
||||
return -1;
|
||||
|
||||
if((method <= NAT25_MIN) || (method >= NAT25_MAX))
|
||||
if ((method <= NAT25_MIN) || (method >= NAT25_MAX))
|
||||
return -1;
|
||||
|
||||
protocol = *((unsigned short *)(skb->data + 2 * ETH_ALEN));
|
||||
|
@ -796,17 +796,17 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
/*---------------------------------------------------*/
|
||||
/* Handle IP frame */
|
||||
/*---------------------------------------------------*/
|
||||
if(protocol == __constant_htons(ETH_P_IP))
|
||||
if (protocol == __constant_htons(ETH_P_IP))
|
||||
{
|
||||
struct iphdr* iph = (struct iphdr *)(skb->data + ETH_HLEN);
|
||||
|
||||
if(((unsigned char*)(iph) + (iph->ihl<<2)) >= (skb->data + ETH_HLEN + skb->len))
|
||||
if (((unsigned char*)(iph) + (iph->ihl<<2)) >= (skb->data + ETH_HLEN + skb->len))
|
||||
{
|
||||
DEBUG_WARN("NAT25: malformed IP packet !\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch(method)
|
||||
switch (method)
|
||||
{
|
||||
case NAT25_CHECK:
|
||||
return -1;
|
||||
|
@ -868,19 +868,19 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
/*---------------------------------------------------*/
|
||||
/* Handle ARP frame */
|
||||
/*---------------------------------------------------*/
|
||||
else if(protocol == __constant_htons(ETH_P_ARP))
|
||||
else if (protocol == __constant_htons(ETH_P_ARP))
|
||||
{
|
||||
struct arphdr *arp = (struct arphdr *)(skb->data + ETH_HLEN);
|
||||
unsigned char *arp_ptr = (unsigned char *)(arp + 1);
|
||||
unsigned int *sender, *target;
|
||||
|
||||
if(arp->ar_pro != __constant_htons(ETH_P_IP))
|
||||
if (arp->ar_pro != __constant_htons(ETH_P_IP))
|
||||
{
|
||||
DEBUG_WARN("NAT25: arp protocol unknown (%4x)!\n", htons(arp->ar_pro));
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch(method)
|
||||
switch (method)
|
||||
{
|
||||
case NAT25_CHECK:
|
||||
return 0; // skb_copy for all ARP frame
|
||||
|
@ -932,7 +932,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
/*---------------------------------------------------*/
|
||||
/* Handle IPX and Apple Talk frame */
|
||||
/*---------------------------------------------------*/
|
||||
else if((protocol == __constant_htons(ETH_P_IPX)) ||
|
||||
else if ((protocol == __constant_htons(ETH_P_IPX)) ||
|
||||
(protocol <= __constant_htons(ETH_FRAME_LEN)))
|
||||
{
|
||||
unsigned char ipx_header[2] = {0xFF, 0xFF};
|
||||
|
@ -941,14 +941,14 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
struct ddpehdr *ddp = NULL;
|
||||
unsigned char *framePtr = skb->data + ETH_HLEN;
|
||||
|
||||
if(protocol == __constant_htons(ETH_P_IPX))
|
||||
if (protocol == __constant_htons(ETH_P_IPX))
|
||||
{
|
||||
DEBUG_INFO("NAT25: Protocol=IPX (Ethernet II)\n");
|
||||
ipx = (struct ipxhdr *)framePtr;
|
||||
}
|
||||
else if(protocol <= __constant_htons(ETH_FRAME_LEN))
|
||||
else if (protocol <= __constant_htons(ETH_FRAME_LEN))
|
||||
{
|
||||
if(!memcmp(ipx_header, framePtr, 2))
|
||||
if (!memcmp(ipx_header, framePtr, 2))
|
||||
{
|
||||
DEBUG_INFO("NAT25: Protocol=IPX (Ethernet 802.3)\n");
|
||||
ipx = (struct ipxhdr *)framePtr;
|
||||
|
@ -958,7 +958,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
unsigned char ipx_8022_type = 0xE0;
|
||||
unsigned char snap_8022_type = 0xAA;
|
||||
|
||||
if(*framePtr == snap_8022_type)
|
||||
if (*framePtr == snap_8022_type)
|
||||
{
|
||||
unsigned char ipx_snap_id[5] = {0x0, 0x0, 0x0, 0x81, 0x37}; // IPX SNAP ID
|
||||
unsigned char aarp_snap_id[5] = {0x00, 0x00, 0x00, 0x80, 0xF3}; // Apple Talk AARP SNAP ID
|
||||
|
@ -966,20 +966,20 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
|
||||
framePtr += 3; // eliminate the 802.2 header
|
||||
|
||||
if(!memcmp(ipx_snap_id, framePtr, 5))
|
||||
if (!memcmp(ipx_snap_id, framePtr, 5))
|
||||
{
|
||||
framePtr += 5; // eliminate the SNAP header
|
||||
|
||||
DEBUG_INFO("NAT25: Protocol=IPX (Ethernet SNAP)\n");
|
||||
ipx = (struct ipxhdr *)framePtr;
|
||||
}
|
||||
else if(!memcmp(aarp_snap_id, framePtr, 5))
|
||||
else if (!memcmp(aarp_snap_id, framePtr, 5))
|
||||
{
|
||||
framePtr += 5; // eliminate the SNAP header
|
||||
|
||||
ea = (struct elapaarp *)framePtr;
|
||||
}
|
||||
else if(!memcmp(ddp_snap_id, framePtr, 5))
|
||||
else if (!memcmp(ddp_snap_id, framePtr, 5))
|
||||
{
|
||||
framePtr += 5; // eliminate the SNAP header
|
||||
|
||||
|
@ -992,11 +992,11 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
else if(*framePtr == ipx_8022_type)
|
||||
else if (*framePtr == ipx_8022_type)
|
||||
{
|
||||
framePtr += 3; // eliminate the 802.2 header
|
||||
|
||||
if(!memcmp(ipx_header, framePtr, 2))
|
||||
if (!memcmp(ipx_header, framePtr, 2))
|
||||
{
|
||||
DEBUG_INFO("NAT25: Protocol=IPX (Ethernet 802.2)\n");
|
||||
ipx = (struct ipxhdr *)framePtr;
|
||||
|
@ -1012,12 +1012,12 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
return -1;
|
||||
|
||||
/* IPX */
|
||||
if(ipx != NULL)
|
||||
if (ipx != NULL)
|
||||
{
|
||||
switch(method)
|
||||
switch (method)
|
||||
{
|
||||
case NAT25_CHECK:
|
||||
if(!memcmp(skb->data+ETH_ALEN, ipx->ipx_source.node, ETH_ALEN))
|
||||
if (!memcmp(skb->data+ETH_ALEN, ipx->ipx_source.node, ETH_ALEN))
|
||||
{
|
||||
DEBUG_INFO("NAT25: Check IPX skb_copy\n");
|
||||
return 0;
|
||||
|
@ -1044,7 +1044,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
ipx->ipx_source.node[5],
|
||||
ipx->ipx_source.sock);
|
||||
|
||||
if(!memcmp(skb->data+ETH_ALEN, ipx->ipx_source.node, ETH_ALEN))
|
||||
if (!memcmp(skb->data+ETH_ALEN, ipx->ipx_source.node, ETH_ALEN))
|
||||
{
|
||||
DEBUG_INFO("NAT25: Use IPX Net, and Socket as network addr\n");
|
||||
|
||||
|
@ -1066,7 +1066,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
|
||||
case NAT25_LOOKUP:
|
||||
{
|
||||
if(!memcmp(GET_MY_HWADDR(priv), ipx->ipx_dest.node, ETH_ALEN))
|
||||
if (!memcmp(GET_MY_HWADDR(priv), ipx->ipx_dest.node, ETH_ALEN))
|
||||
{
|
||||
DEBUG_INFO("NAT25: Lookup IPX, Modify Destination IPX Node addr\n");
|
||||
|
||||
|
@ -1092,16 +1092,16 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
}
|
||||
|
||||
/* AARP */
|
||||
else if(ea != NULL)
|
||||
else if (ea != NULL)
|
||||
{
|
||||
/* Sanity check fields. */
|
||||
if(ea->hw_len != ETH_ALEN || ea->pa_len != AARP_PA_ALEN)
|
||||
if (ea->hw_len != ETH_ALEN || ea->pa_len != AARP_PA_ALEN)
|
||||
{
|
||||
DEBUG_WARN("NAT25: Appletalk AARP Sanity check fail!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch(method)
|
||||
switch (method)
|
||||
{
|
||||
case NAT25_CHECK:
|
||||
return 0;
|
||||
|
@ -1148,9 +1148,9 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
}
|
||||
|
||||
/* DDP */
|
||||
else if(ddp != NULL)
|
||||
else if (ddp != NULL)
|
||||
{
|
||||
switch(method)
|
||||
switch (method)
|
||||
{
|
||||
case NAT25_CHECK:
|
||||
return -1;
|
||||
|
@ -1196,13 +1196,13 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
/*---------------------------------------------------*/
|
||||
/* Handle PPPoE frame */
|
||||
/*---------------------------------------------------*/
|
||||
else if((protocol == __constant_htons(ETH_P_PPP_DISC)) ||
|
||||
else if ((protocol == __constant_htons(ETH_P_PPP_DISC)) ||
|
||||
(protocol == __constant_htons(ETH_P_PPP_SES)))
|
||||
{
|
||||
struct pppoe_hdr *ph = (struct pppoe_hdr *)(skb->data + ETH_HLEN);
|
||||
unsigned short *pMagic;
|
||||
|
||||
switch(method)
|
||||
switch (method)
|
||||
{
|
||||
case NAT25_CHECK:
|
||||
if (ph->sid == 0)
|
||||
|
@ -1210,9 +1210,9 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
return 1;
|
||||
|
||||
case NAT25_INSERT:
|
||||
if(ph->sid == 0) // Discovery phase according to tag
|
||||
if (ph->sid == 0) // Discovery phase according to tag
|
||||
{
|
||||
if(ph->code == PADI_CODE || ph->code == PADR_CODE)
|
||||
if (ph->code == PADI_CODE || ph->code == PADR_CODE)
|
||||
{
|
||||
if (priv->ethBrExtInfo.addPPPoETag) {
|
||||
struct pppoe_tag *tag, *pOldTag;
|
||||
|
@ -1247,7 +1247,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
memcpy(tag->tag_data+MAGIC_CODE_LEN, skb->data+ETH_ALEN, ETH_ALEN);
|
||||
|
||||
//Add relay tag
|
||||
if(__nat25_add_pppoe_tag(skb, tag) < 0)
|
||||
if (__nat25_add_pppoe_tag(skb, tag) < 0)
|
||||
return -1;
|
||||
|
||||
DEBUG_INFO("NAT25: Insert PPPoE, forward %s packet\n",
|
||||
|
@ -1287,7 +1287,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
return 0;
|
||||
|
||||
case NAT25_LOOKUP:
|
||||
if(ph->code == PADO_CODE || ph->code == PADS_CODE)
|
||||
if (ph->code == PADO_CODE || ph->code == PADS_CODE)
|
||||
{
|
||||
if (priv->ethBrExtInfo.addPPPoETag) {
|
||||
struct pppoe_tag *tag;
|
||||
|
@ -1295,7 +1295,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
unsigned short tagType, tagLen;
|
||||
int offset=0;
|
||||
|
||||
if((ptr = __nat25_find_pppoe_tag(ph, ntohs(PTT_RELAY_SID))) == 0) {
|
||||
if ((ptr = __nat25_find_pppoe_tag(ph, ntohs(PTT_RELAY_SID))) == 0) {
|
||||
DEBUG_ERR("Fail to find PTT_RELAY_SID in FADO!\n");
|
||||
return -1;
|
||||
}
|
||||
|
@ -1304,7 +1304,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
tagType = (unsigned short)((ptr[0] << 8) + ptr[1]);
|
||||
tagLen = (unsigned short)((ptr[2] << 8) + ptr[3]);
|
||||
|
||||
if((tagType != ntohs(PTT_RELAY_SID)) || (tagLen < (MAGIC_CODE_LEN+RTL_RELAY_TAG_LEN))) {
|
||||
if ((tagType != ntohs(PTT_RELAY_SID)) || (tagLen < (MAGIC_CODE_LEN+RTL_RELAY_TAG_LEN))) {
|
||||
DEBUG_ERR("Invalid PTT_RELAY_SID tag length [%d]!\n", tagLen);
|
||||
return -1;
|
||||
}
|
||||
|
@ -1342,7 +1342,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
}
|
||||
}
|
||||
else {
|
||||
if(ph->sid != 0)
|
||||
if (ph->sid != 0)
|
||||
{
|
||||
DEBUG_INFO("NAT25: Lookup PPPoE, lookup session packet from %s\n", skb->dev->name);
|
||||
__nat25_generate_pppoe_network_addr(networkAddr, skb->data+ETH_ALEN, &(ph->sid));
|
||||
|
@ -1365,9 +1365,9 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
/*---------------------------------------------------*/
|
||||
/* Handle EAP frame */
|
||||
/*---------------------------------------------------*/
|
||||
else if(protocol == __constant_htons(0x888e))
|
||||
else if (protocol == __constant_htons(0x888e))
|
||||
{
|
||||
switch(method)
|
||||
switch (method)
|
||||
{
|
||||
case NAT25_CHECK:
|
||||
return -1;
|
||||
|
@ -1386,10 +1386,10 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
/*---------------------------------------------------*/
|
||||
/* Handle C-Media proprietary frame */
|
||||
/*---------------------------------------------------*/
|
||||
else if((protocol == __constant_htons(0xe2ae)) ||
|
||||
else if ((protocol == __constant_htons(0xe2ae)) ||
|
||||
(protocol == __constant_htons(0xe2af)))
|
||||
{
|
||||
switch(method)
|
||||
switch (method)
|
||||
{
|
||||
case NAT25_CHECK:
|
||||
return -1;
|
||||
|
@ -1409,7 +1409,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
/* Handle IPV6 frame */
|
||||
/*---------------------------------------------------*/
|
||||
#ifdef CL_IPV6_PASS
|
||||
else if(protocol == __constant_htons(ETH_P_IPV6))
|
||||
else if (protocol == __constant_htons(ETH_P_IPV6))
|
||||
{
|
||||
struct ipv6hdr *iph = (struct ipv6hdr *)(skb->data + ETH_HLEN);
|
||||
|
||||
|
@ -1419,7 +1419,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
return -1;
|
||||
}
|
||||
|
||||
switch(method)
|
||||
switch (method)
|
||||
{
|
||||
case NAT25_CHECK:
|
||||
if (skb->data[0] & 1)
|
||||
|
@ -1487,7 +1487,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
|||
int nat25_handle_frame(_adapter *priv, struct sk_buff *skb)
|
||||
{
|
||||
#ifdef BR_EXT_DEBUG
|
||||
if((!priv->ethBrExtInfo.nat25_disable) && (!(skb->data[0] & 1)))
|
||||
if ((!priv->ethBrExtInfo.nat25_disable) && (!(skb->data[0] & 1)))
|
||||
{
|
||||
panic_printk("NAT25: Input Frame: DA=%02x%02x%02x%02x%02x%02x SA=%02x%02x%02x%02x%02x%02x\n",
|
||||
skb->data[0],
|
||||
|
@ -1505,7 +1505,7 @@ int nat25_handle_frame(_adapter *priv, struct sk_buff *skb)
|
|||
}
|
||||
#endif
|
||||
|
||||
if(!(skb->data[0] & 1))
|
||||
if (!(skb->data[0] & 1))
|
||||
{
|
||||
int is_vlan_tag=0, i, retval=0;
|
||||
unsigned short vlan_hdr=0;
|
||||
|
@ -1558,7 +1558,7 @@ int nat25_handle_frame(_adapter *priv, struct sk_buff *skb)
|
|||
*((unsigned short *)(skb->data+ETH_ALEN*2+2)) = vlan_hdr;
|
||||
}
|
||||
|
||||
if(retval == -1) {
|
||||
if (retval == -1) {
|
||||
//DEBUG_ERR("NAT25: Lookup fail!\n");
|
||||
return -1;
|
||||
}
|
||||
|
@ -1581,11 +1581,11 @@ void mac_clone(_adapter *priv, unsigned char *addr)
|
|||
|
||||
int mac_clone_handle_frame(_adapter *priv, struct sk_buff *skb)
|
||||
{
|
||||
if(priv->ethBrExtInfo.macclone_enable && !priv->macclone_completed)
|
||||
if (priv->ethBrExtInfo.macclone_enable && !priv->macclone_completed)
|
||||
{
|
||||
if(!(skb->data[ETH_ALEN] & 1)) //// check any other particular MAC add
|
||||
if (!(skb->data[ETH_ALEN] & 1)) //// check any other particular MAC add
|
||||
{
|
||||
if(memcmp(skb->data+ETH_ALEN, GET_MY_HWADDR(priv), ETH_ALEN) &&
|
||||
if (memcmp(skb->data+ETH_ALEN, GET_MY_HWADDR(priv), ETH_ALEN) &&
|
||||
((priv->dev->br_port) &&
|
||||
memcmp(skb->data+ETH_ALEN, priv->br_mac, ETH_ALEN)))
|
||||
{
|
||||
|
@ -1625,30 +1625,30 @@ struct dhcpMessage {
|
|||
|
||||
void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb)
|
||||
{
|
||||
if(skb == NULL)
|
||||
if (skb == NULL)
|
||||
return;
|
||||
|
||||
if(!priv->ethBrExtInfo.dhcp_bcst_disable)
|
||||
if (!priv->ethBrExtInfo.dhcp_bcst_disable)
|
||||
{
|
||||
unsigned short protocol = *((unsigned short *)(skb->data + 2 * ETH_ALEN));
|
||||
|
||||
if(protocol == __constant_htons(ETH_P_IP)) // IP
|
||||
if (protocol == __constant_htons(ETH_P_IP)) // IP
|
||||
{
|
||||
struct iphdr* iph = (struct iphdr *)(skb->data + ETH_HLEN);
|
||||
|
||||
if(iph->protocol == IPPROTO_UDP) // UDP
|
||||
if (iph->protocol == IPPROTO_UDP) // UDP
|
||||
{
|
||||
struct udphdr *udph = (struct udphdr *)((SIZE_PTR)iph + (iph->ihl << 2));
|
||||
|
||||
if((udph->source == __constant_htons(CLIENT_PORT))
|
||||
if ((udph->source == __constant_htons(CLIENT_PORT))
|
||||
&& (udph->dest == __constant_htons(SERVER_PORT))) // DHCP request
|
||||
{
|
||||
struct dhcpMessage *dhcph =
|
||||
(struct dhcpMessage *)((SIZE_PTR)udph + sizeof(struct udphdr));
|
||||
|
||||
if(dhcph->cookie == __constant_htonl(DHCP_MAGIC)) // match magic word
|
||||
if (dhcph->cookie == __constant_htonl(DHCP_MAGIC)) // match magic word
|
||||
{
|
||||
if(!(dhcph->flags & htons(BROADCAST_FLAG))) // if not broadcast
|
||||
if (!(dhcph->flags & htons(BROADCAST_FLAG))) // if not broadcast
|
||||
{
|
||||
register int sum = 0;
|
||||
|
||||
|
@ -1658,7 +1658,7 @@ void dhcp_flag_bcast(_adapter *priv, struct sk_buff *skb)
|
|||
// recalculate checksum
|
||||
sum = ~(udph->check) & 0xffff;
|
||||
sum += dhcph->flags;
|
||||
while(sum >> 16)
|
||||
while (sum >> 16)
|
||||
sum = (sum & 0xffff) + (sum >> 16);
|
||||
udph->check = ~sum;
|
||||
}
|
||||
|
@ -1684,7 +1684,7 @@ void *scdb_findEntry(_adapter *priv, unsigned char *macAddr,
|
|||
db = priv->nethash[hash];
|
||||
while (db != NULL)
|
||||
{
|
||||
if(!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) {
|
||||
if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) {
|
||||
//_exit_critical_bh(&priv->br_ext_lock, &irqL);
|
||||
return (void *)db;
|
||||
}
|
||||
|
|
200
core/rtw_bt_mp.c
200
core/rtw_bt_mp.c
|
@ -49,7 +49,7 @@ u32 WaitC2Hevent( PADAPTER pAdapter,BOOLEAN *C2H_event ,u32 delay_time)
|
|||
|
||||
_rtw_down_sema(&pMptCtx->MPh2c_Sema);
|
||||
|
||||
if( pMptCtx->bMPh2c_timeout == _TRUE )
|
||||
if ( pMptCtx->bMPh2c_timeout == _TRUE )
|
||||
{
|
||||
C2H_event =_FALSE;
|
||||
|
||||
|
@ -75,12 +75,12 @@ mptbt_CheckC2hFrame(
|
|||
DBG_8192C("[MPT], retLen = %d\n", pExtC2h->retLen);
|
||||
DBG_8192C("[MPT], opCodeVer : req/rsp=%d/%d\n", pH2c->opCodeVer, pExtC2h->opCodeVer);
|
||||
DBG_8192C("[MPT], reqNum : req/rsp=%d/%d\n", pH2c->reqNum, pExtC2h->reqNum);
|
||||
if(pExtC2h->reqNum != pH2c->reqNum)
|
||||
if (pExtC2h->reqNum != pH2c->reqNum)
|
||||
{
|
||||
c2hStatus = BT_STATUS_C2H_REQNUM_MISMATCH;
|
||||
DBG_8192C("[MPT], Error!! C2H reqNum Mismatch!!\n");
|
||||
}
|
||||
else if(pExtC2h->opCodeVer != pH2c->opCodeVer)
|
||||
else if (pExtC2h->opCodeVer != pH2c->opCodeVer)
|
||||
{
|
||||
c2hStatus = BT_STATUS_OPCODE_L_VERSION_MISMATCH;
|
||||
DBG_8192C("[MPT], Error!! OPCode version L mismatch!!\n");
|
||||
|
@ -108,21 +108,21 @@ mptbt_SendH2c(
|
|||
//PlatformResetEvent(&pMptCtx->MptH2cRspEvent);
|
||||
//PlatformResetEvent(&pMptCtx->MptBtC2hEvent);
|
||||
|
||||
// if(OldIrql == PASSIVE_LEVEL)
|
||||
// if (OldIrql == PASSIVE_LEVEL)
|
||||
// {
|
||||
//RTPRINT_DATA(FMPBT, FMPBT_H2C_CONTENT, ("[MPT], MPT H2C hex: \n"), pH2c, h2cCmdLen);
|
||||
|
||||
for(i=0; i<BT_H2C_MAX_RETRY; i++)
|
||||
for (i=0; i<BT_H2C_MAX_RETRY; i++)
|
||||
{
|
||||
DBG_8192C("[MPT], Send H2C command to wifi!!!\n");
|
||||
FillH2CCmd(Adapter, 70, h2cCmdLen, (pu1Byte)pH2c);
|
||||
pMptCtx->h2cReqNum++;
|
||||
pMptCtx->h2cReqNum %= 16;
|
||||
|
||||
if(WaitC2Hevent(Adapter, &pMptCtx->MptH2cRspEvent, 100))
|
||||
if (WaitC2Hevent(Adapter, &pMptCtx->MptH2cRspEvent, 100))
|
||||
{
|
||||
DBG_8192C("[MPT], Received WiFi MptH2cRspEvent!!!\n");
|
||||
if(WaitC2Hevent(Adapter, &pMptCtx->MptBtC2hEvent, 400))
|
||||
if (WaitC2Hevent(Adapter, &pMptCtx->MptBtC2hEvent, 400))
|
||||
{
|
||||
DBG_8192C("[MPT], Received MptBtC2hEvent!!!\n");
|
||||
break;
|
||||
|
@ -160,7 +160,7 @@ mptbt_CheckBtRspStatus(
|
|||
{
|
||||
BT_CTRL_STATUS retStatus=BT_OP_STATUS_SUCCESS;
|
||||
|
||||
switch(pExtC2h->statusCode)
|
||||
switch (pExtC2h->statusCode)
|
||||
{
|
||||
case BT_OP_STATUS_SUCCESS:
|
||||
retStatus = BT_STATUS_BT_OP_SUCCESS;
|
||||
|
@ -217,21 +217,21 @@ mptbt_BtFwOpCodeProcess(
|
|||
DBG_8192C("[MPT], pH2c->opCodeVer=%d\n", pH2c->opCodeVer);
|
||||
DBG_8192C("[MPT], pH2c->reqNum=%d\n", pH2c->reqNum);
|
||||
DBG_8192C("[MPT], h2c parameter length=%d\n", h2cParaLen);
|
||||
if(h2cParaLen)
|
||||
if (h2cParaLen)
|
||||
{
|
||||
DBG_8192C("[MPT], parameters(hex): \n");
|
||||
for(i=0;i<h2cParaLen;i++)
|
||||
for (i=0;i<h2cParaLen;i++)
|
||||
{
|
||||
DBG_8192C(" 0x%x \n", pH2c->buf[i]);
|
||||
}
|
||||
}
|
||||
|
||||
h2cStatus = mptbt_SendH2c(Adapter, pH2c, h2cParaLen+2);
|
||||
if(BT_STATUS_H2C_SUCCESS == h2cStatus)
|
||||
if (BT_STATUS_H2C_SUCCESS == h2cStatus)
|
||||
{
|
||||
// if reach here, it means H2C get the correct c2h response,
|
||||
c2hStatus = mptbt_CheckC2hFrame(Adapter, pH2c, pExtC2h);
|
||||
if(BT_STATUS_C2H_SUCCESS == c2hStatus)
|
||||
if (BT_STATUS_C2H_SUCCESS == c2hStatus)
|
||||
{
|
||||
retStatus = mptbt_CheckBtRspStatus(Adapter, pExtC2h);
|
||||
}
|
||||
|
@ -280,7 +280,7 @@ mptbt_BtReady(
|
|||
//
|
||||
|
||||
// 1. check upper layer opcode version
|
||||
if(pBtReq->opCodeVer != 1)
|
||||
if (pBtReq->opCodeVer != 1)
|
||||
{
|
||||
DBG_8192C("[MPT], Error!! Upper OP code version not match!!!\n");
|
||||
pBtRsp->status = BT_STATUS_OPCODE_U_VERSION_MISMATCH;
|
||||
|
@ -299,7 +299,7 @@ mptbt_BtReady(
|
|||
// execute h2c and check respond c2h from bt fw is correct or not
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// ckeck bt return status.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -319,7 +319,7 @@ mptbt_BtReady(
|
|||
// execute h2c and check respond c2h from bt fw is correct or not
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// ckeck bt return status.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -337,7 +337,7 @@ mptbt_BtReady(
|
|||
// execute h2c and check respond c2h from bt fw is correct or not
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// ckeck bt return status.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -350,7 +350,7 @@ mptbt_BtReady(
|
|||
bdAddr[0] = pExtC2h->buf[2];
|
||||
}
|
||||
DBG_8192C("[MPT], Local BDAddr:");
|
||||
for(i=0; i<6; i++)
|
||||
for (i=0; i<6; i++)
|
||||
{
|
||||
DBG_8192C(" 0x%x ", bdAddr[i]);
|
||||
}
|
||||
|
@ -359,7 +359,7 @@ mptbt_BtReady(
|
|||
pu2Tmp = (pu2Byte)&pBtRsp->pParamStart[1];
|
||||
*pu2Tmp = btRealFwVer;
|
||||
pBtRsp->pParamStart[3] = btFwVer;
|
||||
for(i=0; i<6; i++)
|
||||
for (i=0; i<6; i++)
|
||||
{
|
||||
pBtRsp->pParamStart[4+i] = bdAddr[5-i];
|
||||
}
|
||||
|
@ -430,14 +430,14 @@ mptbt_BtSetMode(
|
|||
// check upper layer parameters
|
||||
//
|
||||
// 1. check upper layer opcode version
|
||||
if(pBtReq->opCodeVer != 1)
|
||||
if (pBtReq->opCodeVer != 1)
|
||||
{
|
||||
DBG_8192C("[MPT], Error!! Upper OP code version not match!!!\n");
|
||||
pBtRsp->status = BT_STATUS_OPCODE_U_VERSION_MISMATCH;
|
||||
return paraLen;
|
||||
}
|
||||
// 2. check upper layer parameter length
|
||||
if(1 == pBtReq->paraLength)
|
||||
if (1 == pBtReq->paraLength)
|
||||
{
|
||||
btModeToSet = pBtReq->pParamStart[0];
|
||||
DBG_8192C("[MPT], BtTestMode=%d \n", btModeToSet);
|
||||
|
@ -456,7 +456,7 @@ mptbt_BtSetMode(
|
|||
// 1. fill h2c parameters
|
||||
// check bt mode
|
||||
btOpcode = BT_LO_OP_SET_BT_MODE;
|
||||
if(btModeToSet >= MP_BT_MODE_MAX)
|
||||
if (btModeToSet >= MP_BT_MODE_MAX)
|
||||
{
|
||||
pBtRsp->status = BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
|
||||
return paraLen;
|
||||
|
@ -472,7 +472,7 @@ mptbt_BtSetMode(
|
|||
}
|
||||
|
||||
// 3. construct respond status code and data.
|
||||
if(BT_STATUS_BT_OP_SUCCESS == retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS == retStatus)
|
||||
{
|
||||
pBtRsp->status = BT_STATUS_SUCCESS;
|
||||
}
|
||||
|
@ -501,19 +501,19 @@ MPTBT_FwC2hBtMpCtrl(
|
|||
_cancel_timer_ex( &pMptCtx->MPh2c_timeout_timer);
|
||||
|
||||
DBG_8192C("[MPT], MPTBT_FwC2hBtMpCtrl(), hex: \n");
|
||||
for(i=0;i<=length;i++)
|
||||
for (i=0;i<=length;i++)
|
||||
{
|
||||
//DBG_8192C("[MPT], MPTBT_FwC2hBtMpCtrl(), hex: \n",tmpBuf[i], length);
|
||||
DBG_8192C(" 0x%x ",tmpBuf[i]);
|
||||
}
|
||||
DBG_8192C("\n [MPT], pExtC2h->extendId=0x%x\n", pExtC2h->extendId);
|
||||
|
||||
switch(pExtC2h->extendId)
|
||||
switch (pExtC2h->extendId)
|
||||
{
|
||||
case EXT_C2H_WIFI_FW_ACTIVE_RSP:
|
||||
DBG_8192C("[MPT], EXT_C2H_WIFI_FW_ACTIVE_RSP\n");
|
||||
DBG_8192C("[MPT], pExtC2h->buf hex: \n");
|
||||
for(i=0;i<=(length-3);i++)
|
||||
for (i=0;i<=(length-3);i++)
|
||||
DBG_8192C(" 0x%x ",pExtC2h->buf[i]);
|
||||
//PlatformSetEvent(&pMptCtx->MptH2cRspEvent);
|
||||
pMptCtx->MptH2cRspEvent=_TRUE;
|
||||
|
@ -528,7 +528,7 @@ MPTBT_FwC2hBtMpCtrl(
|
|||
DBG_8192C("[MPT], pExtC2h->opCodeVer=0x%x\n", pExtC2h->opCodeVer);
|
||||
DBG_8192C("[MPT], pExtC2h->reqNum=0x%x\n", pExtC2h->reqNum);
|
||||
DBG_8192C("[MPT], pExtC2h->buf hex: \n");
|
||||
for(i=0;i<=(length-3);i++)
|
||||
for (i=0;i<=(length-3);i++)
|
||||
DBG_8192C(" 0x%x ",pExtC2h->buf[0]);
|
||||
//PlatformSetEvent(&pMptCtx->MptBtC2hEvent);
|
||||
pMptCtx->MptBtC2hEvent=_TRUE;
|
||||
|
@ -571,14 +571,14 @@ mptbt_BtGetGeneral(
|
|||
//
|
||||
|
||||
// check upper layer opcode version
|
||||
if(pBtReq->opCodeVer != 1)
|
||||
if (pBtReq->opCodeVer != 1)
|
||||
{
|
||||
DBG_8192C("[MPT], Error!! Upper OP code version not match!!!\n");
|
||||
pBtRsp->status = BT_STATUS_OPCODE_U_VERSION_MISMATCH;
|
||||
return paraLen;
|
||||
}
|
||||
// check upper layer parameter length
|
||||
if(pBtReq->paraLength < 1)
|
||||
if (pBtReq->paraLength < 1)
|
||||
{
|
||||
DBG_8192C("[MPT], Error!! wrong parameter length=%d (should larger than 1)\n", pBtReq->paraLength);
|
||||
pBtRsp->status = BT_STATUS_PARAMETER_FORMAT_ERROR_U;
|
||||
|
@ -590,12 +590,12 @@ mptbt_BtGetGeneral(
|
|||
DBG_8192C("[MPT], getType=%d, getParaLen=%d\n", getType, getParaLen);
|
||||
|
||||
// check parameter first
|
||||
switch(getType)
|
||||
switch (getType)
|
||||
{
|
||||
case BT_GGET_REG:
|
||||
DBG_8192C("[MPT], [BT_GGET_REG]\n");
|
||||
validParaLen = 5;
|
||||
if(getParaLen == validParaLen)
|
||||
if (getParaLen == validParaLen)
|
||||
{
|
||||
btOpcode = BT_LO_OP_READ_REG;
|
||||
regType = pBtReq->pParamStart[1];
|
||||
|
@ -603,14 +603,14 @@ mptbt_BtGetGeneral(
|
|||
regAddr = *pu4Tmp;
|
||||
DBG_8192C("[MPT], BT_GGET_REG regType=0x%x, regAddr=0x%x!!\n",
|
||||
regType, regAddr);
|
||||
if(regType >= BT_REG_MAX)
|
||||
if (regType >= BT_REG_MAX)
|
||||
{
|
||||
pBtRsp->status = (btOpcode<<8)| BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
|
||||
return paraLen;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ((BT_REG_RF==regType)&&(regAddr>0x7f)) ||
|
||||
if ( ((BT_REG_RF==regType)&&(regAddr>0x7f)) ||
|
||||
((BT_REG_MODEM==regType)&&(regAddr>0x1ff)) ||
|
||||
((BT_REG_BLUEWIZE==regType)&&(regAddr>0xfff)) ||
|
||||
((BT_REG_VENDOR==regType)&&(regAddr>0xfff)) ||
|
||||
|
@ -629,11 +629,11 @@ mptbt_BtGetGeneral(
|
|||
case BT_GGET_REPORT:
|
||||
DBG_8192C("[MPT], [BT_GGET_REPORT]\n");
|
||||
validParaLen = 1;
|
||||
if(getParaLen == validParaLen)
|
||||
if (getParaLen == validParaLen)
|
||||
{
|
||||
reportType = pBtReq->pParamStart[1];
|
||||
DBG_8192C("[MPT], BT_GGET_REPORT reportType=0x%x!!\n", reportType);
|
||||
if(reportType >= BT_REPORT_MAX)
|
||||
if (reportType >= BT_REPORT_MAX)
|
||||
{
|
||||
pBtRsp->status = BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
|
||||
return paraLen;
|
||||
|
@ -648,7 +648,7 @@ mptbt_BtGetGeneral(
|
|||
}
|
||||
break;
|
||||
}
|
||||
if(getParaLen != validParaLen)
|
||||
if (getParaLen != validParaLen)
|
||||
{
|
||||
DBG_8192C("[MPT], Error!! wrong parameter length=%d for BT_GET_GEN_CMD cmd id=0x%x, paraLen should=0x%x\n",
|
||||
getParaLen, getType, validParaLen);
|
||||
|
@ -659,7 +659,7 @@ mptbt_BtGetGeneral(
|
|||
//
|
||||
// execute lower layer opcodes
|
||||
//
|
||||
if(BT_GGET_REG == getType)
|
||||
if (BT_GGET_REG == getType)
|
||||
{
|
||||
// fill h2c parameters
|
||||
// here we should write reg value first then write the address, adviced by Austin
|
||||
|
@ -671,7 +671,7 @@ mptbt_BtGetGeneral(
|
|||
// execute h2c and check respond c2h from bt fw is correct or not
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// construct respond status code and data.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -687,14 +687,14 @@ mptbt_BtGetGeneral(
|
|||
*pu4Tmp = regValue;
|
||||
paraLen = 4;
|
||||
}
|
||||
else if(BT_GGET_STATUS == getType)
|
||||
else if (BT_GGET_STATUS == getType)
|
||||
{
|
||||
btOpcode = BT_LO_OP_GET_BT_STATUS;
|
||||
h2cParaLen = 0;
|
||||
// execute h2c and check respond c2h from bt fw is correct or not
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// construct respond status code and data.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -707,9 +707,9 @@ mptbt_BtGetGeneral(
|
|||
pBtRsp->pParamStart[0], pBtRsp->pParamStart[1]);
|
||||
paraLen = 2;
|
||||
}
|
||||
else if(BT_GGET_REPORT == getType)
|
||||
else if (BT_GGET_REPORT == getType)
|
||||
{
|
||||
switch(reportType)
|
||||
switch (reportType)
|
||||
{
|
||||
case BT_REPORT_RX_PACKET_CNT:
|
||||
{
|
||||
|
@ -719,7 +719,7 @@ mptbt_BtGetGeneral(
|
|||
// execute h2c and check respond c2h from bt fw is correct or not
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// construct respond status code and data.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -733,7 +733,7 @@ mptbt_BtGetGeneral(
|
|||
// execute h2c and check respond c2h from bt fw is correct or not
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// construct respond status code and data.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -752,7 +752,7 @@ mptbt_BtGetGeneral(
|
|||
// execute h2c and check respond c2h from bt fw is correct or not
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// construct respond status code and data.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -766,7 +766,7 @@ mptbt_BtGetGeneral(
|
|||
// execute h2c and check respond c2h from bt fw is correct or not
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// construct respond status code and data.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -785,7 +785,7 @@ mptbt_BtGetGeneral(
|
|||
// execute h2c and check respond c2h from bt fw is correct or not
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// construct respond status code and data.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -804,7 +804,7 @@ mptbt_BtGetGeneral(
|
|||
// execute h2c and check respond c2h from bt fw is correct or not
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// construct respond status code and data.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -818,7 +818,7 @@ mptbt_BtGetGeneral(
|
|||
// execute h2c and check respond c2h from bt fw is correct or not
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// construct respond status code and data.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -837,7 +837,7 @@ mptbt_BtGetGeneral(
|
|||
// execute h2c and check respond c2h from bt fw is correct or not
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// construct respond status code and data.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -852,7 +852,7 @@ mptbt_BtGetGeneral(
|
|||
// execute h2c and check respond c2h from bt fw is correct or not
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// construct respond status code and data.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -863,7 +863,7 @@ mptbt_BtGetGeneral(
|
|||
bdAddr[0] = pExtC2h->buf[2];
|
||||
|
||||
DBG_8192C("[MPT], Connected Target BDAddr:%s", bdAddr);
|
||||
for(i=0; i<6; i++)
|
||||
for (i=0; i<6; i++)
|
||||
{
|
||||
pBtRsp->pParamStart[i] = bdAddr[5-i];
|
||||
}
|
||||
|
@ -909,14 +909,14 @@ mptbt_BtSetGeneral(
|
|||
//
|
||||
|
||||
// check upper layer opcode version
|
||||
if(pBtReq->opCodeVer != 1)
|
||||
if (pBtReq->opCodeVer != 1)
|
||||
{
|
||||
DBG_8192C("[MPT], Error!! Upper OP code version not match!!!\n");
|
||||
pBtRsp->status = BT_STATUS_OPCODE_U_VERSION_MISMATCH;
|
||||
return paraLen;
|
||||
}
|
||||
// check upper layer parameter length
|
||||
if(pBtReq->paraLength < 1)
|
||||
if (pBtReq->paraLength < 1)
|
||||
{
|
||||
DBG_8192C("[MPT], Error!! wrong parameter length=%d (should larger than 1)\n", pBtReq->paraLength);
|
||||
pBtRsp->status = BT_STATUS_PARAMETER_FORMAT_ERROR_U;
|
||||
|
@ -928,12 +928,12 @@ mptbt_BtSetGeneral(
|
|||
DBG_8192C("[MPT], setType=%d, setParaLen=%d\n", setType, setParaLen);
|
||||
|
||||
// check parameter first
|
||||
switch(setType)
|
||||
switch (setType)
|
||||
{
|
||||
case BT_GSET_REG:
|
||||
DBG_8192C ("[MPT], [BT_GSET_REG]\n");
|
||||
validParaLen = 9;
|
||||
if(setParaLen == validParaLen)
|
||||
if (setParaLen == validParaLen)
|
||||
{
|
||||
btOpcode = BT_LO_OP_WRITE_REG_VALUE;
|
||||
regType = pBtReq->pParamStart[1];
|
||||
|
@ -943,14 +943,14 @@ mptbt_BtSetGeneral(
|
|||
regValue = *pu4Tmp;
|
||||
DBG_8192C("[MPT], BT_GSET_REG regType=0x%x, regAddr=0x%x, regValue=0x%x!!\n",
|
||||
regType, regAddr, regValue);
|
||||
if(regType >= BT_REG_MAX)
|
||||
if (regType >= BT_REG_MAX)
|
||||
{
|
||||
pBtRsp->status = (btOpcode<<8)| BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
|
||||
return paraLen;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ((BT_REG_RF==regType)&&(regAddr>0x7f)) ||
|
||||
if ( ((BT_REG_RF==regType)&&(regAddr>0x7f)) ||
|
||||
((BT_REG_MODEM==regType)&&(regAddr>0x1ff)) ||
|
||||
((BT_REG_BLUEWIZE==regType)&&(regAddr>0xfff)) ||
|
||||
((BT_REG_VENDOR==regType)&&(regAddr>0xfff)) ||
|
||||
|
@ -969,10 +969,10 @@ mptbt_BtSetGeneral(
|
|||
case BT_GSET_TARGET_BD_ADDR:
|
||||
DBG_8192C("[MPT], [BT_GSET_TARGET_BD_ADDR]\n");
|
||||
validParaLen = 6;
|
||||
if(setParaLen == validParaLen)
|
||||
if (setParaLen == validParaLen)
|
||||
{
|
||||
btOpcode = BT_LO_OP_SET_TARGET_BD_ADDR_H;
|
||||
if( (pBtReq->pParamStart[1]==0) &&
|
||||
if ( (pBtReq->pParamStart[1]==0) &&
|
||||
(pBtReq->pParamStart[2]==0) &&
|
||||
(pBtReq->pParamStart[3]==0) &&
|
||||
(pBtReq->pParamStart[4]==0) &&
|
||||
|
@ -983,7 +983,7 @@ mptbt_BtSetGeneral(
|
|||
pBtRsp->status = (btOpcode<<8)|BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
|
||||
return paraLen;
|
||||
}
|
||||
if( (pBtReq->pParamStart[1]==0xff) &&
|
||||
if ( (pBtReq->pParamStart[1]==0xff) &&
|
||||
(pBtReq->pParamStart[2]==0xff) &&
|
||||
(pBtReq->pParamStart[3]==0xff) &&
|
||||
(pBtReq->pParamStart[4]==0xff) &&
|
||||
|
@ -1006,11 +1006,11 @@ mptbt_BtSetGeneral(
|
|||
case BT_GSET_TX_PWR_FINETUNE:
|
||||
DBG_8192C("[MPT], [BT_GSET_TX_PWR_FINETUNE]\n");
|
||||
validParaLen = 1;
|
||||
if(setParaLen == validParaLen)
|
||||
if (setParaLen == validParaLen)
|
||||
{
|
||||
btOpcode = BT_LO_OP_SET_TX_POWER_CALIBRATION;
|
||||
calVal = pBtReq->pParamStart[1];
|
||||
if( (calVal<1) || (calVal>9) )
|
||||
if ( (calVal<1) || (calVal>9) )
|
||||
{
|
||||
pBtRsp->status = (btOpcode<<8)|BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
|
||||
return paraLen;
|
||||
|
@ -1019,7 +1019,7 @@ mptbt_BtSetGeneral(
|
|||
}
|
||||
break;
|
||||
case BT_GSET_UPDATE_BT_PATCH:
|
||||
if(IS_HARDWARE_TYPE_8723AE(Adapter) && Adapter->bFWReady)
|
||||
if (IS_HARDWARE_TYPE_8723AE(Adapter) && Adapter->bFWReady)
|
||||
{
|
||||
u1Byte i;
|
||||
DBG_8192C ("[MPT], write regs for load patch\n");
|
||||
|
@ -1031,7 +1031,7 @@ mptbt_BtSetGeneral(
|
|||
PlatformEFIOWrite4Byte(Adapter, 0x68, 0xb005000c);
|
||||
rtw_msleep_os(50);
|
||||
PlatformEFIOWrite1Byte(Adapter, 0xCC, 0x29);
|
||||
for(i=0; i<12; i++)
|
||||
for (i=0; i<12; i++)
|
||||
rtw_msleep_os(100);
|
||||
//#if (DEV_BUS_TYPE == RT_PCI_INTERFACE)
|
||||
// BTFwPatch8723A(Adapter);
|
||||
|
@ -1047,7 +1047,7 @@ mptbt_BtSetGeneral(
|
|||
}
|
||||
break;
|
||||
}
|
||||
if(setParaLen != validParaLen)
|
||||
if (setParaLen != validParaLen)
|
||||
{
|
||||
DBG_8192C("[MPT], Error!! wrong parameter length=%d for BT_SET_GEN_CMD cmd id=0x%x, paraLen should=0x%x\n",
|
||||
setParaLen, setType, validParaLen);
|
||||
|
@ -1058,7 +1058,7 @@ mptbt_BtSetGeneral(
|
|||
//
|
||||
// execute lower layer opcodes
|
||||
//
|
||||
if(BT_GSET_REG == setType)
|
||||
if (BT_GSET_REG == setType)
|
||||
{
|
||||
// fill h2c parameters
|
||||
// here we should write reg value first then write the address, adviced by Austin
|
||||
|
@ -1070,7 +1070,7 @@ mptbt_BtSetGeneral(
|
|||
// execute h2c and check respond c2h from bt fw is correct or not
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// construct respond status code and data.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -1086,28 +1086,28 @@ mptbt_BtSetGeneral(
|
|||
// execute h2c and check respond c2h from bt fw is correct or not
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// construct respond status code and data.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
return paraLen;
|
||||
}
|
||||
}
|
||||
else if(BT_GSET_RESET == setType)
|
||||
else if (BT_GSET_RESET == setType)
|
||||
{
|
||||
btOpcode = BT_LO_OP_RESET;
|
||||
h2cParaLen = 0;
|
||||
// execute h2c and check respond c2h from bt fw is correct or not
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// construct respond status code and data.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
return paraLen;
|
||||
}
|
||||
}
|
||||
else if(BT_GSET_TARGET_BD_ADDR == setType)
|
||||
else if (BT_GSET_TARGET_BD_ADDR == setType)
|
||||
{
|
||||
// fill h2c parameters
|
||||
btOpcode = BT_LO_OP_SET_TARGET_BD_ADDR_L;
|
||||
|
@ -1117,7 +1117,7 @@ mptbt_BtSetGeneral(
|
|||
h2cParaLen = 3;
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// ckeck bt return status.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -1131,14 +1131,14 @@ mptbt_BtSetGeneral(
|
|||
h2cParaLen = 3;
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// ckeck bt return status.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
return paraLen;
|
||||
}
|
||||
}
|
||||
else if(BT_GSET_TX_PWR_FINETUNE == setType)
|
||||
else if (BT_GSET_TX_PWR_FINETUNE == setType)
|
||||
{
|
||||
// fill h2c parameters
|
||||
btOpcode = BT_LO_OP_SET_TX_POWER_CALIBRATION;
|
||||
|
@ -1146,7 +1146,7 @@ mptbt_BtSetGeneral(
|
|||
h2cParaLen = 1;
|
||||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
// ckeck bt return status.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -1183,14 +1183,14 @@ mptbt_BtSetTxRxPars(
|
|||
//
|
||||
|
||||
// 1. check upper layer opcode version
|
||||
if(pBtReq->opCodeVer != 1)
|
||||
if (pBtReq->opCodeVer != 1)
|
||||
{
|
||||
DBG_8192C("[MPT], Error!! Upper OP code version not match!!!\n");
|
||||
pBtRsp->status = BT_STATUS_OPCODE_U_VERSION_MISMATCH;
|
||||
return paraLen;
|
||||
}
|
||||
// 2. check upper layer parameter length
|
||||
if(pBtReq->paraLength == sizeof(BT_TXRX_PARAMETERS))
|
||||
if (pBtReq->paraLength == sizeof(BT_TXRX_PARAMETERS))
|
||||
{
|
||||
DBG_8192C ("[MPT], pTxRxPars->txrxChannel=0x%x \n", pTxRxPars->txrxChannel);
|
||||
DBG_8192C ("[MPT], pTxRxPars->txrxTxPktCnt=0x%8x \n", pTxRxPars->txrxTxPktCnt);
|
||||
|
@ -1222,7 +1222,7 @@ mptbt_BtSetTxRxPars(
|
|||
|
||||
// fill h2c parameters
|
||||
btOpcode = BT_LO_OP_SET_PKT_HEADER;
|
||||
if(pTxRxPars->txrxPktHeader > 0x3ffff)
|
||||
if (pTxRxPars->txrxPktHeader > 0x3ffff)
|
||||
{
|
||||
DBG_8192C ("[MPT], Error!! pTxRxPars->txrxPktHeader=0x%x is out of range, (should be between 0x0~0x3ffff)\n", pTxRxPars->txrxPktHeader);
|
||||
pBtRsp->status = (btOpcode<<8)|BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
|
||||
|
@ -1238,7 +1238,7 @@ mptbt_BtSetTxRxPars(
|
|||
}
|
||||
|
||||
// ckeck bt return status.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -1249,7 +1249,7 @@ mptbt_BtSetTxRxPars(
|
|||
btOpcode = BT_LO_OP_SET_PKT_TYPE_LEN;
|
||||
{
|
||||
u2Byte payloadLenLimit=0;
|
||||
switch(pTxRxPars->txrxPktType)
|
||||
switch (pTxRxPars->txrxPktType)
|
||||
{
|
||||
case MP_BT_PKT_DH1:
|
||||
payloadLenLimit = 27*8;
|
||||
|
@ -1290,7 +1290,7 @@ mptbt_BtSetTxRxPars(
|
|||
break;
|
||||
}
|
||||
|
||||
if(pTxRxPars->txrxPayloadLen > payloadLenLimit)
|
||||
if (pTxRxPars->txrxPayloadLen > payloadLenLimit)
|
||||
{
|
||||
DBG_8192C ("[MPT], Error!! pTxRxPars->txrxPayloadLen=0x%x, (should smaller than %d)\n",
|
||||
pTxRxPars->txrxPayloadLen, payloadLenLimit);
|
||||
|
@ -1306,7 +1306,7 @@ mptbt_BtSetTxRxPars(
|
|||
}
|
||||
|
||||
// ckeck bt return status.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -1315,7 +1315,7 @@ mptbt_BtSetTxRxPars(
|
|||
|
||||
// fill h2c parameters
|
||||
btOpcode = BT_LO_OP_SET_PKT_CNT_L_PL_TYPE;
|
||||
if(pTxRxPars->txrxPayloadType > MP_BT_PAYLOAD_MAX)
|
||||
if (pTxRxPars->txrxPayloadType > MP_BT_PAYLOAD_MAX)
|
||||
{
|
||||
DBG_8192C ("[MPT], Error!! pTxRxPars->txrxPayloadType=0x%x, (should be between 0~4)\n", pTxRxPars->txrxPayloadType);
|
||||
pBtRsp->status = (btOpcode<<8)|BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
|
||||
|
@ -1331,7 +1331,7 @@ mptbt_BtSetTxRxPars(
|
|||
}
|
||||
|
||||
// ckeck bt return status.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -1340,7 +1340,7 @@ mptbt_BtSetTxRxPars(
|
|||
|
||||
// fill h2c parameters
|
||||
btOpcode = BT_LO_OP_SET_PKT_CNT_H_PKT_INTV;
|
||||
if(pTxRxPars->txrxTxPktInterval > 15)
|
||||
if (pTxRxPars->txrxTxPktInterval > 15)
|
||||
{
|
||||
DBG_8192C ("[MPT], Error!! pTxRxPars->txrxTxPktInterval=0x%x, (should be between 0~15)\n", pTxRxPars->txrxTxPktInterval);
|
||||
pBtRsp->status = (btOpcode<<8)|BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
|
||||
|
@ -1356,7 +1356,7 @@ mptbt_BtSetTxRxPars(
|
|||
}
|
||||
|
||||
// ckeck bt return status.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -1372,7 +1372,7 @@ mptbt_BtSetTxRxPars(
|
|||
}
|
||||
|
||||
// ckeck bt return status.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -1382,7 +1382,7 @@ mptbt_BtSetTxRxPars(
|
|||
|
||||
// fill h2c parameters
|
||||
btOpcode = BT_LO_OP_SET_CHNL_TX_GAIN;
|
||||
if( (pTxRxPars->txrxChannel > 78) ||
|
||||
if ( (pTxRxPars->txrxChannel > 78) ||
|
||||
(pTxRxPars->txrxTxGainIndex > 7) )
|
||||
{
|
||||
DBG_8192C ("[MPT], Error!! pTxRxPars->txrxChannel=0x%x, (should be between 0~78)\n", pTxRxPars->txrxChannel);
|
||||
|
@ -1399,7 +1399,7 @@ mptbt_BtSetTxRxPars(
|
|||
}
|
||||
|
||||
// ckeck bt return status.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -1408,7 +1408,7 @@ mptbt_BtSetTxRxPars(
|
|||
|
||||
// fill h2c parameters
|
||||
btOpcode = BT_LO_OP_SET_BD_ADDR_L;
|
||||
if( (pTxRxPars->txrxBdaddr[0]==0) &&
|
||||
if ( (pTxRxPars->txrxBdaddr[0]==0) &&
|
||||
(pTxRxPars->txrxBdaddr[1]==0) &&
|
||||
(pTxRxPars->txrxBdaddr[2]==0) &&
|
||||
(pTxRxPars->txrxBdaddr[3]==0) &&
|
||||
|
@ -1419,7 +1419,7 @@ mptbt_BtSetTxRxPars(
|
|||
pBtRsp->status = (btOpcode<<8)|BT_STATUS_PARAMETER_OUT_OF_RANGE_U;
|
||||
return paraLen;
|
||||
}
|
||||
if( (pTxRxPars->txrxBdaddr[0]==0xff) &&
|
||||
if ( (pTxRxPars->txrxBdaddr[0]==0xff) &&
|
||||
(pTxRxPars->txrxBdaddr[1]==0xff) &&
|
||||
(pTxRxPars->txrxBdaddr[2]==0xff) &&
|
||||
(pTxRxPars->txrxBdaddr[3]==0xff) &&
|
||||
|
@ -1439,7 +1439,7 @@ mptbt_BtSetTxRxPars(
|
|||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
}
|
||||
// ckeck bt return status.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -1455,7 +1455,7 @@ mptbt_BtSetTxRxPars(
|
|||
retStatus = mptbt_BtFwOpCodeProcess(Adapter, btOpcode, btOpcodeVer, &h2cParaBuf[0], h2cParaLen);
|
||||
}
|
||||
// ckeck bt return status.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C ("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -1488,14 +1488,14 @@ mptbt_BtTestCtrl(
|
|||
//
|
||||
|
||||
// 1. check upper layer opcode version
|
||||
if(pBtReq->opCodeVer != 1)
|
||||
if (pBtReq->opCodeVer != 1)
|
||||
{
|
||||
DBG_8192C("[MPT], Error!! Upper OP code version not match!!!\n");
|
||||
pBtRsp->status = BT_STATUS_OPCODE_U_VERSION_MISMATCH;
|
||||
return paraLen;
|
||||
}
|
||||
// 2. check upper layer parameter length
|
||||
if(1 == pBtReq->paraLength)
|
||||
if (1 == pBtReq->paraLength)
|
||||
{
|
||||
testCtrl = pBtReq->pParamStart[0];
|
||||
DBG_8192C("[MPT], testCtrl=%d \n", testCtrl);
|
||||
|
@ -1514,7 +1514,7 @@ mptbt_BtTestCtrl(
|
|||
// 1. fill h2c parameters
|
||||
// check bt mode
|
||||
btOpcode = BT_LO_OP_TEST_CTRL;
|
||||
if(testCtrl >= MP_BT_TEST_MAX)
|
||||
if (testCtrl >= MP_BT_TEST_MAX)
|
||||
{
|
||||
DBG_8192C("[MPT], Error!! testCtrl=0x%x, (should be between smaller or equal to 0x%x)\n",
|
||||
testCtrl, MP_BT_TEST_MAX-1);
|
||||
|
@ -1529,7 +1529,7 @@ mptbt_BtTestCtrl(
|
|||
}
|
||||
|
||||
// 3. construct respond status code and data.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -1570,7 +1570,7 @@ mptbt_TestBT(
|
|||
|
||||
|
||||
// 3. construct respond status code and data.
|
||||
if(BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
if (BT_STATUS_BT_OP_SUCCESS != retStatus)
|
||||
{
|
||||
pBtRsp->status = ((btOpcode<<8)|retStatus);
|
||||
DBG_8192C("[MPT], Error!! status code=0x%x \n", pBtRsp->status);
|
||||
|
@ -1599,7 +1599,7 @@ mptbt_BtControlProcess(
|
|||
DBG_8192C("[MPT], input opCodeVer=%d\n", pBtReq->opCodeVer);
|
||||
DBG_8192C("[MPT], input OpCode=%d\n", pBtReq->OpCode);
|
||||
DBG_8192C("[MPT], paraLength=%d \n", pBtReq->paraLength);
|
||||
if(pBtReq->paraLength)
|
||||
if (pBtReq->paraLength)
|
||||
{
|
||||
//DBG_8192C("[MPT], parameters(hex):0x%x %d \n",&pBtReq->pParamStart[0], pBtReq->paraLength);
|
||||
}
|
||||
|
@ -1612,7 +1612,7 @@ mptbt_BtControlProcess(
|
|||
|
||||
_rtw_memset((PVOID)&pMptCtx->mptOutBuf[0], '\0',100);
|
||||
|
||||
switch(pBtReq->OpCode)
|
||||
switch (pBtReq->OpCode)
|
||||
{
|
||||
case BT_UP_OP_BT_READY:
|
||||
DBG_8192C("[MPT], OPcode : [BT_READY]\n");
|
||||
|
|
256
core/rtw_cmd.c
256
core/rtw_cmd.c
|
@ -130,7 +130,7 @@ _func_enter_;
|
|||
#ifdef PLATFORM_OS_XP
|
||||
pevtpriv->pc2h_mdl= IoAllocateMdl((u8 *)pevtpriv->c2h_mem, C2H_MEM_SZ , FALSE, FALSE, NULL);
|
||||
|
||||
if(pevtpriv->pc2h_mdl == NULL){
|
||||
if (pevtpriv->pc2h_mdl == NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ _func_enter_;
|
|||
|
||||
#ifdef CONFIG_C2H_WK
|
||||
_cancel_workitem_sync(&pevtpriv->c2h_wk);
|
||||
while(pevtpriv->c2h_wk_alive)
|
||||
while (pevtpriv->c2h_wk_alive)
|
||||
rtw_msleep_os(10);
|
||||
|
||||
while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
|
||||
|
@ -194,7 +194,7 @@ void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv)
|
|||
{
|
||||
_func_enter_;
|
||||
|
||||
if(pcmdpriv){
|
||||
if (pcmdpriv){
|
||||
_rtw_spinlock_free(&(pcmdpriv->cmd_queue.lock));
|
||||
_rtw_free_sema(&(pcmdpriv->cmd_queue_sema));
|
||||
//_rtw_free_sema(&(pcmdpriv->cmd_done_sema));
|
||||
|
@ -309,14 +309,14 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
|
|||
|
||||
#ifdef SUPPORT_HW_RFOFF_DETECTED
|
||||
//To decide allow or not
|
||||
if( (pcmdpriv->padapter->pwrctrlpriv.bHWPwrPindetect)
|
||||
if ( (pcmdpriv->padapter->pwrctrlpriv.bHWPwrPindetect)
|
||||
&&(!pcmdpriv->padapter->registrypriv.usbss_enable)
|
||||
)
|
||||
{
|
||||
if(cmd_obj->cmdcode == GEN_CMD_CODE(_Set_Drv_Extra) )
|
||||
if (cmd_obj->cmdcode == GEN_CMD_CODE(_Set_Drv_Extra) )
|
||||
{
|
||||
struct drvextra_cmd_parm *pdrvextra_cmd_parm = (struct drvextra_cmd_parm *)cmd_obj->parmbuf;
|
||||
if(pdrvextra_cmd_parm->ec_id == POWER_SAVING_CTRL_WK_CID)
|
||||
if (pdrvextra_cmd_parm->ec_id == POWER_SAVING_CTRL_WK_CID)
|
||||
{
|
||||
//DBG_871X("==>enqueue POWER_SAVING_CTRL_WK_CID\n");
|
||||
bAllow = _TRUE;
|
||||
|
@ -325,10 +325,10 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
|
|||
}
|
||||
#endif
|
||||
|
||||
if(cmd_obj->cmdcode == GEN_CMD_CODE(_SetChannelPlan))
|
||||
if (cmd_obj->cmdcode == GEN_CMD_CODE(_SetChannelPlan))
|
||||
bAllow = _TRUE;
|
||||
|
||||
if( (pcmdpriv->padapter->hw_init_completed ==_FALSE && bAllow == _FALSE)
|
||||
if ( (pcmdpriv->padapter->hw_init_completed ==_FALSE && bAllow == _FALSE)
|
||||
|| pcmdpriv->cmdthd_running== _FALSE //com_thread not running
|
||||
)
|
||||
{
|
||||
|
@ -363,14 +363,14 @@ _func_enter_;
|
|||
pcmdpriv = &(padapter->pbuddy_adapter->cmdpriv);
|
||||
#endif
|
||||
|
||||
if( _FAIL == (res=rtw_cmd_filter(pcmdpriv, cmd_obj)) ) {
|
||||
if ( _FAIL == (res=rtw_cmd_filter(pcmdpriv, cmd_obj)) ) {
|
||||
rtw_free_cmd_obj(cmd_obj);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
res = _rtw_enqueue_cmd(&pcmdpriv->cmd_queue, cmd_obj);
|
||||
|
||||
if(res == _SUCCESS)
|
||||
if (res == _SUCCESS)
|
||||
_rtw_up_sema(&pcmdpriv->cmd_queue_sema);
|
||||
|
||||
exit:
|
||||
|
@ -404,15 +404,15 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd)
|
|||
{
|
||||
_func_enter_;
|
||||
|
||||
if((pcmd->cmdcode!=_JoinBss_CMD_) &&(pcmd->cmdcode!= _CreateBss_CMD_))
|
||||
if ((pcmd->cmdcode!=_JoinBss_CMD_) &&(pcmd->cmdcode!= _CreateBss_CMD_))
|
||||
{
|
||||
//free parmbuf in cmd_obj
|
||||
rtw_mfree((unsigned char*)pcmd->parmbuf, pcmd->cmdsz);
|
||||
}
|
||||
|
||||
if(pcmd->rsp!=NULL)
|
||||
if (pcmd->rsp!=NULL)
|
||||
{
|
||||
if(pcmd->rspsz!= 0)
|
||||
if (pcmd->rspsz!= 0)
|
||||
{
|
||||
//free rsp in cmd_obj
|
||||
rtw_mfree((unsigned char*)pcmd->rsp, pcmd->rspsz);
|
||||
|
@ -447,7 +447,7 @@ _func_enter_;
|
|||
|
||||
RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("start r871x rtw_cmd_thread !!!!\n"));
|
||||
|
||||
while(1)
|
||||
while (1)
|
||||
{
|
||||
if (_rtw_down_sema(&pcmdpriv->cmd_queue_sema) == _FAIL)
|
||||
break;
|
||||
|
@ -476,14 +476,14 @@ _next:
|
|||
break;
|
||||
}
|
||||
|
||||
if(!(pcmd = rtw_dequeue_cmd(pcmdpriv))) {
|
||||
if (!(pcmd = rtw_dequeue_cmd(pcmdpriv))) {
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
rtw_unregister_cmd_alive(padapter);
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
if( _FAIL == rtw_cmd_filter(pcmdpriv, pcmd) )
|
||||
if ( _FAIL == rtw_cmd_filter(pcmdpriv, pcmd) )
|
||||
{
|
||||
pcmd->res = H2C_DROPPED;
|
||||
goto post_process;
|
||||
|
@ -495,7 +495,7 @@ _next:
|
|||
|
||||
_rtw_memcpy(pcmdbuf, pcmd->parmbuf, pcmd->cmdsz);
|
||||
|
||||
if(pcmd->cmdcode <= (sizeof(wlancmds) /sizeof(struct cmd_hdl)))
|
||||
if (pcmd->cmdcode <= (sizeof(wlancmds) /sizeof(struct cmd_hdl)))
|
||||
{
|
||||
cmd_hdl = wlancmds[pcmd->cmdcode].h2cfuns;
|
||||
|
||||
|
@ -517,10 +517,10 @@ _next:
|
|||
post_process:
|
||||
|
||||
//call callback function for post-processed
|
||||
if(pcmd->cmdcode <= (sizeof(rtw_cmd_callback) /sizeof(struct _cmd_callback)))
|
||||
if (pcmd->cmdcode <= (sizeof(rtw_cmd_callback) /sizeof(struct _cmd_callback)))
|
||||
{
|
||||
pcmd_callback = rtw_cmd_callback[pcmd->cmdcode].callback;
|
||||
if(pcmd_callback == NULL)
|
||||
if (pcmd_callback == NULL)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_cmd_c_,_drv_info_,("mlme_cmd_hdl(): pcmd_callback=0x%p, cmdcode=0x%x\n", pcmd_callback, pcmd->cmdcode));
|
||||
rtw_free_cmd_obj(pcmd);
|
||||
|
@ -548,13 +548,13 @@ post_process:
|
|||
// free all cmd_obj resources
|
||||
do{
|
||||
pcmd = rtw_dequeue_cmd(pcmdpriv);
|
||||
if(pcmd==NULL)
|
||||
if (pcmd==NULL)
|
||||
break;
|
||||
|
||||
//DBG_871X("%s: leaving... drop cmdcode:%u\n", __FUNCTION__, pcmd->cmdcode);
|
||||
|
||||
rtw_free_cmd_obj(pcmd);
|
||||
}while(1);
|
||||
}while (1);
|
||||
|
||||
_rtw_up_sema(&pcmdpriv->terminate_cmdthread_sema);
|
||||
|
||||
|
@ -624,7 +624,7 @@ void rtw_free_evt_obj(struct evt_obj *pevtobj)
|
|||
{
|
||||
_func_enter_;
|
||||
|
||||
if(pevtobj->parmbuf)
|
||||
if (pevtobj->parmbuf)
|
||||
rtw_mfree((unsigned char*)pevtobj->parmbuf, pevtobj->evtsz);
|
||||
|
||||
rtw_mfree((unsigned char*)pevtobj, sizeof(struct evt_obj));
|
||||
|
@ -701,7 +701,7 @@ u8 rtw_sitesurvey_cmd(_adapter *padapter, NDIS_802_11_SSID *ssid, int ssid_num,
|
|||
_func_enter_;
|
||||
|
||||
#ifdef CONFIG_LPS
|
||||
if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE){
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE){
|
||||
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1);
|
||||
}
|
||||
#endif
|
||||
|
@ -763,12 +763,12 @@ _func_enter_;
|
|||
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
||||
if(res == _SUCCESS) {
|
||||
if (res == _SUCCESS) {
|
||||
|
||||
pmlmepriv->scan_start_time = rtw_get_current_time();
|
||||
|
||||
#ifdef CONFIG_STA_MODE_SCAN_UNDER_AP_MODE
|
||||
if((padapter->pbuddy_adapter->mlmeextpriv.mlmext_info.state&0x03) == WIFI_FW_AP_STATE)
|
||||
if ((padapter->pbuddy_adapter->mlmeextpriv.mlmext_info.state&0x03) == WIFI_FW_AP_STATE)
|
||||
_set_timer(&pmlmepriv->scan_to_timer, SURVEY_TO * ( 38 + ( 38 / RTW_SCAN_NUM_OF_CH ) * RTW_STAY_AP_CH_MILLISECOND ) + 1000 );
|
||||
else
|
||||
#endif //CONFIG_STA_MODE_SCAN_UNDER_AP_MODE
|
||||
|
@ -878,13 +878,13 @@ u8 rtw_setphy_cmd(_adapter *padapter, u8 modem, u8 ch)
|
|||
_func_enter_;
|
||||
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
if (ph2c==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
psetphypara = (struct setphy_parm*)rtw_zmalloc(sizeof(struct setphy_parm));
|
||||
|
||||
if(psetphypara==NULL){
|
||||
if (psetphypara==NULL){
|
||||
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -911,13 +911,13 @@ u8 rtw_setbbreg_cmd(_adapter*padapter, u8 offset, u8 val)
|
|||
u8 res=_SUCCESS;
|
||||
_func_enter_;
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
if (ph2c==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
pwritebbparm = (struct writeBB_parm*)rtw_zmalloc(sizeof(struct writeBB_parm));
|
||||
|
||||
if(pwritebbparm==NULL){
|
||||
if (pwritebbparm==NULL){
|
||||
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -943,13 +943,13 @@ u8 rtw_getbbreg_cmd(_adapter *padapter, u8 offset, u8 *pval)
|
|||
|
||||
_func_enter_;
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
if (ph2c==NULL){
|
||||
res=_FAIL;
|
||||
goto exit;
|
||||
}
|
||||
prdbbparm = (struct readBB_parm*)rtw_zmalloc(sizeof(struct readBB_parm));
|
||||
|
||||
if(prdbbparm ==NULL){
|
||||
if (prdbbparm ==NULL){
|
||||
rtw_mfree((unsigned char *) ph2c, sizeof(struct cmd_obj));
|
||||
return _FAIL;
|
||||
}
|
||||
|
@ -977,13 +977,13 @@ u8 rtw_setrfreg_cmd(_adapter *padapter, u8 offset, u32 val)
|
|||
u8 res=_SUCCESS;
|
||||
_func_enter_;
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
if (ph2c==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
pwriterfparm = (struct writeRF_parm*)rtw_zmalloc(sizeof(struct writeRF_parm));
|
||||
|
||||
if(pwriterfparm==NULL){
|
||||
if (pwriterfparm==NULL){
|
||||
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -1010,13 +1010,13 @@ u8 rtw_getrfreg_cmd(_adapter *padapter, u8 offset, u8 *pval)
|
|||
_func_enter_;
|
||||
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
if (ph2c==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
prdrfparm = (struct readRF_parm*)rtw_zmalloc(sizeof(struct readRF_parm));
|
||||
if(prdrfparm ==NULL){
|
||||
if (prdrfparm ==NULL){
|
||||
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -1089,7 +1089,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(pcmd==NULL){
|
||||
if (pcmd==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
@ -1128,7 +1128,7 @@ u8 rtw_createbss_cmd_ex(_adapter *padapter, unsigned char *pbss, unsigned int s
|
|||
_func_enter_;
|
||||
|
||||
pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(pcmd==NULL){
|
||||
if (pcmd==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
@ -1178,7 +1178,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
pcmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(pcmd==NULL){
|
||||
if (pcmd==NULL){
|
||||
res=_FAIL;
|
||||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("rtw_joinbss_cmd: memory allocate for cmd_obj fail!!!\n"));
|
||||
goto exit;
|
||||
|
@ -1198,7 +1198,7 @@ _func_enter_;
|
|||
//for hidden ap to set fw_state here
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) != _TRUE)
|
||||
{
|
||||
switch(ndis_network_mode)
|
||||
switch (ndis_network_mode)
|
||||
{
|
||||
case Ndis802_11IBSS:
|
||||
set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
|
||||
|
@ -1217,9 +1217,9 @@ _func_enter_;
|
|||
}
|
||||
|
||||
psecnetwork=(WLAN_BSSID_EX *)&psecuritypriv->sec_bss;
|
||||
if(psecnetwork==NULL)
|
||||
if (psecnetwork==NULL)
|
||||
{
|
||||
if(pcmd !=NULL)
|
||||
if (pcmd !=NULL)
|
||||
rtw_mfree((unsigned char *)pcmd, sizeof(struct cmd_obj));
|
||||
|
||||
res=_FAIL;
|
||||
|
@ -1236,7 +1236,7 @@ _func_enter_;
|
|||
auth=&psecuritypriv->authenticator_ie[0];
|
||||
psecuritypriv->authenticator_ie[0]=(unsigned char)psecnetwork->IELength;
|
||||
|
||||
if((psecnetwork->IELength-12) < (256-1)) {
|
||||
if ((psecnetwork->IELength-12) < (256-1)) {
|
||||
_rtw_memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], psecnetwork->IELength-12);
|
||||
} else {
|
||||
_rtw_memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], (256-1));
|
||||
|
@ -1258,7 +1258,7 @@ _func_enter_;
|
|||
|
||||
pqospriv->qos_option = 0;
|
||||
|
||||
if(pregistrypriv->wmm_enable)
|
||||
if (pregistrypriv->wmm_enable)
|
||||
{
|
||||
u32 tmp_len;
|
||||
|
||||
|
@ -1277,7 +1277,7 @@ _func_enter_;
|
|||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
phtpriv->ht_option = _FALSE;
|
||||
if(pregistrypriv->ht_enable)
|
||||
if (pregistrypriv->ht_enable)
|
||||
{
|
||||
// Added by Albert 2010/06/23
|
||||
// For the WEP mode, we will use the bg mode to do the connection to avoid some IOT issue.
|
||||
|
@ -1306,7 +1306,7 @@ _func_enter_;
|
|||
#if 0
|
||||
psecuritypriv->supplicant_ie[0]=(u8)psecnetwork->IELength;
|
||||
|
||||
if(psecnetwork->IELength < (256-1))
|
||||
if (psecnetwork->IELength < (256-1))
|
||||
{
|
||||
_rtw_memcpy(&psecuritypriv->supplicant_ie[1], &psecnetwork->IEs[0], psecnetwork->IELength);
|
||||
}
|
||||
|
@ -1406,13 +1406,13 @@ u8 rtw_setopmode_cmd(_adapter *padapter, NDIS_802_11_NETWORK_INFRASTRUCTURE net
|
|||
_func_enter_;
|
||||
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
if (ph2c==NULL){
|
||||
res= _FALSE;
|
||||
goto exit;
|
||||
}
|
||||
psetop = (struct setopmode_parm*)rtw_zmalloc(sizeof(struct setopmode_parm));
|
||||
|
||||
if(psetop==NULL){
|
||||
if (psetop==NULL){
|
||||
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
|
||||
res=_FALSE;
|
||||
goto exit;
|
||||
|
@ -1451,14 +1451,14 @@ _func_enter_;
|
|||
}
|
||||
|
||||
psetstakey_para = (struct set_stakey_parm*)rtw_zmalloc(sizeof(struct set_stakey_parm));
|
||||
if(psetstakey_para==NULL){
|
||||
if (psetstakey_para==NULL){
|
||||
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
|
||||
res=_FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
psetstakey_rsp = (struct set_stakey_rsp*)rtw_zmalloc(sizeof(struct set_stakey_rsp));
|
||||
if(psetstakey_rsp == NULL){
|
||||
if (psetstakey_rsp == NULL){
|
||||
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
|
||||
rtw_mfree((u8 *) psetstakey_para, sizeof(struct set_stakey_parm));
|
||||
res=_FAIL;
|
||||
|
@ -1471,9 +1471,9 @@ _func_enter_;
|
|||
|
||||
_rtw_memcpy(psetstakey_para->addr, sta->hwaddr,ETH_ALEN);
|
||||
|
||||
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE)){
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)){
|
||||
#ifdef CONFIG_TDLS
|
||||
if(sta->tdls_sta_state&TDLS_LINKED_STATE)
|
||||
if (sta->tdls_sta_state&TDLS_LINKED_STATE)
|
||||
psetstakey_para->algorithm=(u8)sta->dot118021XPrivacy;
|
||||
else
|
||||
#endif //CONFIG_TDLS
|
||||
|
@ -1484,7 +1484,7 @@ _func_enter_;
|
|||
|
||||
if (unicast_key == _TRUE) {
|
||||
#ifdef CONFIG_TDLS
|
||||
if((sta->tdls_sta_state&TDLS_LINKED_STATE)==TDLS_LINKED_STATE)
|
||||
if ((sta->tdls_sta_state&TDLS_LINKED_STATE)==TDLS_LINKED_STATE)
|
||||
_rtw_memcpy(&psetstakey_para->key, sta->tpk.tk, 16);
|
||||
else
|
||||
#endif //CONFIG_TDLS
|
||||
|
@ -1518,7 +1518,7 @@ u8 rtw_clearstakey_cmd(_adapter *padapter, u8 *psta, u8 entry, u8 enqueue)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if(!enqueue)
|
||||
if (!enqueue)
|
||||
{
|
||||
clear_cam_entry(padapter, entry);
|
||||
}
|
||||
|
@ -1531,14 +1531,14 @@ _func_enter_;
|
|||
}
|
||||
|
||||
psetstakey_para = (struct set_stakey_parm*)rtw_zmalloc(sizeof(struct set_stakey_parm));
|
||||
if(psetstakey_para==NULL){
|
||||
if (psetstakey_para==NULL){
|
||||
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
|
||||
res=_FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
psetstakey_rsp = (struct set_stakey_rsp*)rtw_zmalloc(sizeof(struct set_stakey_rsp));
|
||||
if(psetstakey_rsp == NULL){
|
||||
if (psetstakey_rsp == NULL){
|
||||
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
|
||||
rtw_mfree((u8 *) psetstakey_para, sizeof(struct set_stakey_parm));
|
||||
res=_FAIL;
|
||||
|
@ -1575,13 +1575,13 @@ u8 rtw_setrttbl_cmd(_adapter *padapter, struct setratable_parm *prate_table)
|
|||
_func_enter_;
|
||||
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
if (ph2c==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
psetrttblparm = (struct setratable_parm*)rtw_zmalloc(sizeof(struct setratable_parm));
|
||||
|
||||
if(psetrttblparm==NULL){
|
||||
if (psetrttblparm==NULL){
|
||||
rtw_mfree((unsigned char *) ph2c, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -1607,13 +1607,13 @@ u8 rtw_getrttbl_cmd(_adapter *padapter, struct getratable_rsp *pval)
|
|||
_func_enter_;
|
||||
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
if (ph2c==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
pgetrttblparm = (struct getratable_parm*)rtw_zmalloc(sizeof(struct getratable_parm));
|
||||
|
||||
if(pgetrttblparm==NULL){
|
||||
if (pgetrttblparm==NULL){
|
||||
rtw_mfree((unsigned char *) ph2c, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -1649,20 +1649,20 @@ u8 rtw_setassocsta_cmd(_adapter *padapter, u8 *mac_addr)
|
|||
_func_enter_;
|
||||
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
if (ph2c==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
psetassocsta_para = (struct set_assocsta_parm*)rtw_zmalloc(sizeof(struct set_assocsta_parm));
|
||||
if(psetassocsta_para==NULL){
|
||||
if (psetassocsta_para==NULL){
|
||||
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
|
||||
res=_FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
psetassocsta_rsp = (struct set_stakey_rsp*)rtw_zmalloc(sizeof(struct set_assocsta_rsp));
|
||||
if(psetassocsta_rsp==NULL){
|
||||
if (psetassocsta_rsp==NULL){
|
||||
rtw_mfree((u8 *) ph2c, sizeof(struct cmd_obj));
|
||||
rtw_mfree((u8 *) psetassocsta_para, sizeof(struct set_assocsta_parm));
|
||||
return _FAIL;
|
||||
|
@ -1694,13 +1694,13 @@ u8 rtw_addbareq_cmd(_adapter*padapter, u8 tid, u8 *addr)
|
|||
_func_enter_;
|
||||
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
if (ph2c==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
paddbareq_parm = (struct addBaReq_parm*)rtw_zmalloc(sizeof(struct addBaReq_parm));
|
||||
if(paddbareq_parm==NULL){
|
||||
if (paddbareq_parm==NULL){
|
||||
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -1738,13 +1738,13 @@ _func_enter_;
|
|||
#endif
|
||||
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
if (ph2c==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
|
||||
if(pdrvextra_cmd_parm==NULL){
|
||||
if (pdrvextra_cmd_parm==NULL){
|
||||
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -1796,7 +1796,7 @@ _func_enter_;
|
|||
if (enqueue) {
|
||||
/* need enqueue, prepare cmd_obj and enqueue */
|
||||
pcmdobj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(pcmdobj == NULL){
|
||||
if (pcmdobj == NULL){
|
||||
rtw_mfree((u8 *)set_ch_parm, sizeof(*set_ch_parm));
|
||||
res=_FAIL;
|
||||
goto exit;
|
||||
|
@ -1806,7 +1806,7 @@ _func_enter_;
|
|||
res = rtw_enqueue_cmd(pcmdpriv, pcmdobj);
|
||||
} else {
|
||||
/* no need to enqueue, do the cmd hdl directly and free cmd parameter */
|
||||
if( H2C_SUCCESS !=set_ch_hdl(padapter, (u8 *)set_ch_parm) )
|
||||
if ( H2C_SUCCESS !=set_ch_hdl(padapter, (u8 *)set_ch_parm) )
|
||||
res = _FAIL;
|
||||
|
||||
rtw_mfree((u8 *)set_ch_parm, sizeof(*set_ch_parm));
|
||||
|
@ -1836,24 +1836,24 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+rtw_set_chplan_cmd\n"));
|
||||
|
||||
//check input parameter
|
||||
if(!rtw_is_channel_plan_valid(chplan)) {
|
||||
if (!rtw_is_channel_plan_valid(chplan)) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
//prepare cmd parameter
|
||||
setChannelPlan_param = (struct SetChannelPlan_param *)rtw_zmalloc(sizeof(struct SetChannelPlan_param));
|
||||
if(setChannelPlan_param == NULL) {
|
||||
if (setChannelPlan_param == NULL) {
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
setChannelPlan_param->channel_plan=chplan;
|
||||
|
||||
if(enqueue)
|
||||
if (enqueue)
|
||||
{
|
||||
//need enqueue, prepare cmd_obj and enqueue
|
||||
pcmdobj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(pcmdobj == NULL){
|
||||
if (pcmdobj == NULL){
|
||||
rtw_mfree((u8 *)setChannelPlan_param, sizeof(struct SetChannelPlan_param));
|
||||
res=_FAIL;
|
||||
goto exit;
|
||||
|
@ -1865,14 +1865,14 @@ _func_enter_;
|
|||
else
|
||||
{
|
||||
//no need to enqueue, do the cmd hdl directly and free cmd parameter
|
||||
if( H2C_SUCCESS !=set_chplan_hdl(padapter, (unsigned char *)setChannelPlan_param) )
|
||||
if ( H2C_SUCCESS !=set_chplan_hdl(padapter, (unsigned char *)setChannelPlan_param) )
|
||||
res = _FAIL;
|
||||
|
||||
rtw_mfree((u8 *)setChannelPlan_param, sizeof(struct SetChannelPlan_param));
|
||||
}
|
||||
|
||||
//do something based on res...
|
||||
if(res == _SUCCESS)
|
||||
if (res == _SUCCESS)
|
||||
padapter->mlmepriv.ChannelPlan = chplan;
|
||||
|
||||
exit:
|
||||
|
@ -1895,13 +1895,13 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+rtw_led_blink_cmd\n"));
|
||||
|
||||
pcmdobj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(pcmdobj == NULL){
|
||||
if (pcmdobj == NULL){
|
||||
res=_FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ledBlink_param = (struct LedBlink_param *)rtw_zmalloc(sizeof(struct LedBlink_param));
|
||||
if(ledBlink_param == NULL) {
|
||||
if (ledBlink_param == NULL) {
|
||||
rtw_mfree((u8 *)pcmdobj, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -1933,13 +1933,13 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+rtw_set_csa_cmd\n"));
|
||||
|
||||
pcmdobj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(pcmdobj == NULL){
|
||||
if (pcmdobj == NULL){
|
||||
res=_FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
setChannelSwitch_param = (struct SetChannelSwitch_param *)rtw_zmalloc(sizeof(struct SetChannelSwitch_param));
|
||||
if(setChannelSwitch_param == NULL) {
|
||||
if (setChannelSwitch_param == NULL) {
|
||||
rtw_mfree((u8 *)pcmdobj, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -1973,13 +1973,13 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+rtw_set_tdls_cmd\n"));
|
||||
|
||||
pcmdobj = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(pcmdobj == NULL){
|
||||
if (pcmdobj == NULL){
|
||||
res=_FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
TDLSoption= (struct TDLSoption_param *)rtw_zmalloc(sizeof(struct TDLSoption_param));
|
||||
if(TDLSoption == NULL) {
|
||||
if (TDLSoption == NULL) {
|
||||
rtw_mfree((u8 *)pcmdobj, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -2020,15 +2020,15 @@ static void traffic_status_watchdog(_adapter *padapter)
|
|||
//
|
||||
// Determine if our traffic is busy now
|
||||
//
|
||||
if((check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE)
|
||||
if ((check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE)
|
||||
/*&& !MgntInitAdapterInProgress(pMgntInfo)*/)
|
||||
{
|
||||
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
if( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 50 ||
|
||||
if ( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 50 ||
|
||||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 50 )
|
||||
#else // !CONFIG_BT_COEXIST
|
||||
if( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 100 ||
|
||||
if ( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 100 ||
|
||||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 100 )
|
||||
#endif // !CONFIG_BT_COEXIST
|
||||
{
|
||||
|
@ -2041,7 +2041,7 @@ static void traffic_status_watchdog(_adapter *padapter)
|
|||
}
|
||||
|
||||
// Higher Tx/Rx data.
|
||||
if( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 4000 ||
|
||||
if ( pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 4000 ||
|
||||
pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 4000 )
|
||||
{
|
||||
bHigherBusyTraffic = _TRUE;
|
||||
|
@ -2062,7 +2062,7 @@ static void traffic_status_watchdog(_adapter *padapter)
|
|||
if (bPktCount > 20 && !pmlmepriv->ftp_lock_flag) {
|
||||
pmlmepriv->ftp_lock_flag = 1;
|
||||
rtw_lock_suspend();
|
||||
} else if(bPktCount == 0 && pmlmepriv->ftp_lock_flag) {
|
||||
} else if (bPktCount == 0 && pmlmepriv->ftp_lock_flag) {
|
||||
pmlmepriv->ftp_lock_flag = 0;
|
||||
rtw_unlock_suspend();
|
||||
}
|
||||
|
@ -2070,7 +2070,7 @@ static void traffic_status_watchdog(_adapter *padapter)
|
|||
|
||||
#ifdef CONFIG_TDLS
|
||||
#ifdef CONFIG_TDLS_AUTOSETUP
|
||||
if( ( ptdlsinfo->watchdog_count % TDLS_WATCHDOG_PERIOD ) == 0 ) //10 * 2sec, periodically sending
|
||||
if ( ( ptdlsinfo->watchdog_count % TDLS_WATCHDOG_PERIOD ) == 0 ) //10 * 2sec, periodically sending
|
||||
issue_tdls_dis_req( padapter, NULL );
|
||||
ptdlsinfo->watchdog_count++;
|
||||
#endif //CONFIG_TDLS_AUTOSETUP
|
||||
|
@ -2082,7 +2082,7 @@ static void traffic_status_watchdog(_adapter *padapter)
|
|||
#endif
|
||||
{
|
||||
// check traffic for powersaving.
|
||||
if( ((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod + pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8 ) ||
|
||||
if ( ((pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod + pmlmepriv->LinkDetectInfo.NumTxOkInPeriod) > 8 ) ||
|
||||
(pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod > 2) )
|
||||
{
|
||||
//DBG_871X("Tx = %d, Rx = %d \n",pmlmepriv->LinkDetectInfo.NumTxOkInPeriod,pmlmepriv->LinkDetectInfo.NumRxUnicastOkInPeriod);
|
||||
|
@ -2094,7 +2094,7 @@ static void traffic_status_watchdog(_adapter *padapter)
|
|||
}
|
||||
|
||||
// LeisurePS only work in infra mode.
|
||||
if(bEnterPS)
|
||||
if (bEnterPS)
|
||||
{
|
||||
LPS_Enter(padapter);
|
||||
}
|
||||
|
@ -2133,7 +2133,7 @@ void dynamic_chk_wk_hdl(_adapter *padapter, u8 *pbuf, int sz)
|
|||
|
||||
#ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK
|
||||
#ifdef CONFIG_AP_MODE
|
||||
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
|
||||
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
|
||||
{
|
||||
expire_timeout_chk(padapter);
|
||||
}
|
||||
|
@ -2144,7 +2144,7 @@ void dynamic_chk_wk_hdl(_adapter *padapter, u8 *pbuf, int sz)
|
|||
rtw_hal_sreset_xmit_status_check(padapter);
|
||||
#endif
|
||||
|
||||
//if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING|_FW_UNDER_SURVEY)==_FALSE)
|
||||
//if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING|_FW_UNDER_SURVEY)==_FALSE)
|
||||
{
|
||||
linked_status_chk(padapter);
|
||||
traffic_status_watchdog(padapter);
|
||||
|
@ -2173,13 +2173,13 @@ void lps_ctrl_wk_hdl(_adapter *padapter, u8 lps_ctrl_type)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE)
|
||||
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE)
|
||||
|| (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch(lps_ctrl_type)
|
||||
switch (lps_ctrl_type)
|
||||
{
|
||||
case LPS_CTRL_SCAN:
|
||||
//DBG_871X("LPS_CTRL_SCAN \n");
|
||||
|
@ -2259,19 +2259,19 @@ u8 rtw_lps_ctrl_wk_cmd(_adapter*padapter, u8 lps_ctrl_type, u8 enqueue)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
//if(!pwrctrlpriv->bLeisurePs)
|
||||
//if (!pwrctrlpriv->bLeisurePs)
|
||||
// return res;
|
||||
|
||||
if(enqueue)
|
||||
if (enqueue)
|
||||
{
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
if (ph2c==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
|
||||
if(pdrvextra_cmd_parm==NULL){
|
||||
if (pdrvextra_cmd_parm==NULL){
|
||||
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -2316,13 +2316,13 @@ u8 rtw_rpt_timer_cfg_cmd(_adapter*padapter, u16 minRptTime)
|
|||
|
||||
_func_enter_;
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
if (ph2c==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
|
||||
if(pdrvextra_cmd_parm==NULL){
|
||||
if (pdrvextra_cmd_parm==NULL){
|
||||
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -2359,18 +2359,18 @@ u8 rtw_antenna_select_cmd(_adapter*padapter, u8 antenna,u8 enqueue)
|
|||
|
||||
_func_enter_;
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_IS_SUPPORT_ANT_DIV, &(bSupportAntDiv));
|
||||
if(_FALSE == bSupportAntDiv ) return res;
|
||||
if (_FALSE == bSupportAntDiv ) return res;
|
||||
|
||||
if(_TRUE == enqueue)
|
||||
if (_TRUE == enqueue)
|
||||
{
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
if (ph2c==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
|
||||
if(pdrvextra_cmd_parm==NULL){
|
||||
if (pdrvextra_cmd_parm==NULL){
|
||||
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -2412,19 +2412,19 @@ u8 p2p_protocol_wk_cmd(_adapter*padapter, int intCmdType )
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
{
|
||||
return res;
|
||||
}
|
||||
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
if (ph2c==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
|
||||
if(pdrvextra_cmd_parm==NULL){
|
||||
if (pdrvextra_cmd_parm==NULL){
|
||||
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -2462,13 +2462,13 @@ _func_enter_;
|
|||
#endif
|
||||
|
||||
ppscmd = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ppscmd==NULL){
|
||||
if (ppscmd==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
|
||||
if(pdrvextra_cmd_parm==NULL){
|
||||
if (pdrvextra_cmd_parm==NULL){
|
||||
rtw_mfree((unsigned char *)ppscmd, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -2497,31 +2497,31 @@ static void rtw_chk_hi_queue_hdl(_adapter *padapter)
|
|||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
psta_bmc = rtw_get_bcmc_stainfo(padapter);
|
||||
if(!psta_bmc)
|
||||
if (!psta_bmc)
|
||||
return;
|
||||
|
||||
if(psta_bmc->sleepq_len==0)
|
||||
if (psta_bmc->sleepq_len==0)
|
||||
{
|
||||
u8 val = 0;
|
||||
|
||||
//while((rtw_read32(padapter, 0x414)&0x00ffff00)!=0)
|
||||
//while((rtw_read32(padapter, 0x414)&0x0000ff00)!=0)
|
||||
//while ((rtw_read32(padapter, 0x414)&0x00ffff00)!=0)
|
||||
//while ((rtw_read32(padapter, 0x414)&0x0000ff00)!=0)
|
||||
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &val);
|
||||
|
||||
while(_FALSE == val)
|
||||
while (_FALSE == val)
|
||||
{
|
||||
rtw_msleep_os(100);
|
||||
|
||||
cnt++;
|
||||
|
||||
if(cnt>10)
|
||||
if (cnt>10)
|
||||
break;
|
||||
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &val);
|
||||
}
|
||||
|
||||
if(cnt<=10)
|
||||
if (cnt<=10)
|
||||
{
|
||||
pstapriv->tim_bitmap &= ~BIT(0);
|
||||
pstapriv->sta_dz_bitmap &= ~BIT(0);
|
||||
|
@ -2545,13 +2545,13 @@ u8 rtw_chk_hi_queue_cmd(_adapter*padapter)
|
|||
u8 res = _SUCCESS;
|
||||
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
if (ph2c==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
|
||||
if(pdrvextra_cmd_parm==NULL){
|
||||
if (pdrvextra_cmd_parm==NULL){
|
||||
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -2678,12 +2678,12 @@ u8 rtw_drvextra_cmd_hdl(_adapter *padapter, unsigned char *pbuf)
|
|||
{
|
||||
struct drvextra_cmd_parm *pdrvextra_cmd;
|
||||
|
||||
if(!pbuf)
|
||||
if (!pbuf)
|
||||
return H2C_PARAMETERS_ERROR;
|
||||
|
||||
pdrvextra_cmd = (struct drvextra_cmd_parm*)pbuf;
|
||||
|
||||
switch(pdrvextra_cmd->ec_id)
|
||||
switch (pdrvextra_cmd->ec_id)
|
||||
{
|
||||
case DYNAMIC_CHK_WK_CID:
|
||||
dynamic_chk_wk_hdl(padapter, pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size);
|
||||
|
@ -2749,7 +2749,7 @@ void rtw_survey_cmd_callback(_adapter* padapter , struct cmd_obj *pcmd)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if(pcmd->res == H2C_DROPPED)
|
||||
if (pcmd->res == H2C_DROPPED)
|
||||
{
|
||||
//TODO: cancel timer and do timeout handler directly...
|
||||
//need to make timeout handlerOS independent
|
||||
|
@ -2802,13 +2802,13 @@ void rtw_joinbss_cmd_callback(_adapter* padapter, struct cmd_obj *pcmd)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if(pcmd->res == H2C_DROPPED)
|
||||
if (pcmd->res == H2C_DROPPED)
|
||||
{
|
||||
//TODO: cancel timer and do timeout handler directly...
|
||||
//need to make timeout handlerOS independent
|
||||
_set_timer(&pmlmepriv->assoc_timer, 1);
|
||||
}
|
||||
else if(pcmd->res != H2C_SUCCESS)
|
||||
else if (pcmd->res != H2C_SUCCESS)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("********Error:rtw_select_and_join_from_scanned_queue Wait Sema Fail ************\n"));
|
||||
_set_timer(&pmlmepriv->assoc_timer, 1);
|
||||
|
@ -2831,7 +2831,7 @@ void rtw_createbss_cmd_callback(_adapter *padapter, struct cmd_obj *pcmd)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if((pcmd->res != H2C_SUCCESS))
|
||||
if ((pcmd->res != H2C_SUCCESS))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\n ********Error: rtw_createbss_cmd_callback Fail ************\n\n."));
|
||||
_set_timer(&pmlmepriv->assoc_timer, 1 );
|
||||
|
@ -2861,10 +2861,10 @@ _func_enter_;
|
|||
_enter_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
|
||||
|
||||
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) )
|
||||
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) )
|
||||
{
|
||||
psta = rtw_get_stainfo(&padapter->stapriv, pnetwork->MacAddress);
|
||||
if(!psta)
|
||||
if (!psta)
|
||||
{
|
||||
psta = rtw_alloc_stainfo(&padapter->stapriv, pnetwork->MacAddress);
|
||||
if (psta == NULL)
|
||||
|
@ -2885,7 +2885,7 @@ _func_enter_;
|
|||
if ( pwlan == NULL)
|
||||
{
|
||||
pwlan = rtw_get_oldest_wlan_network(&pmlmepriv->scanned_queue);
|
||||
if( pwlan == NULL)
|
||||
if ( pwlan == NULL)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\n Error: can't get pwlan in rtw_joinbss_event_callback \n"));
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
|
@ -2913,7 +2913,7 @@ _func_enter_;
|
|||
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
|
||||
|
||||
#if 0
|
||||
if((pmlmepriv->fw_state) & WIFI_AP_STATE)
|
||||
if ((pmlmepriv->fw_state) & WIFI_AP_STATE)
|
||||
{
|
||||
psta = rtw_alloc_stainfo(&padapter->stapriv, pnetwork->MacAddress);
|
||||
|
||||
|
@ -2955,7 +2955,7 @@ void rtw_setstaKey_cmdrsp_callback(_adapter* padapter , struct cmd_obj *pcmd)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if(psta==NULL)
|
||||
if (psta==NULL)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\nERROR: rtw_setstaKey_cmdrsp_callback => can't get sta_info \n\n"));
|
||||
goto exit;
|
||||
|
@ -2981,7 +2981,7 @@ void rtw_setassocsta_cmdrsp_callback(_adapter* padapter, struct cmd_obj *pcmd)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if(psta==NULL)
|
||||
if (psta==NULL)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_cmd_c_,_drv_err_,("\nERROR: setassocsta_cmdrsp_callbac => can't get sta_info \n\n"));
|
||||
goto exit;
|
||||
|
|
108
core/rtw_debug.c
108
core/rtw_debug.c
|
@ -107,7 +107,7 @@ int proc_set_write_reg(struct file *file, const char *buffer,
|
|||
return count;
|
||||
}
|
||||
|
||||
switch(len)
|
||||
switch (len)
|
||||
{
|
||||
case 1:
|
||||
rtw_write8(padapter, addr, (u8)val);
|
||||
|
@ -141,13 +141,13 @@ int proc_get_read_reg(char *page, char **start,
|
|||
|
||||
int len = 0;
|
||||
|
||||
if(proc_get_read_addr==0xeeeeeeee)
|
||||
if (proc_get_read_addr==0xeeeeeeee)
|
||||
{
|
||||
*eof = 1;
|
||||
return len;
|
||||
}
|
||||
|
||||
switch(proc_get_read_len)
|
||||
switch (proc_get_read_len)
|
||||
{
|
||||
case 1:
|
||||
len += snprintf(page + len, count - len, "rtw_read8(0x%x)=0x%x\n", proc_get_read_addr, rtw_read8(padapter, proc_get_read_addr));
|
||||
|
@ -314,7 +314,7 @@ int proc_get_ap_info(char *page, char **start,
|
|||
int len = 0;
|
||||
|
||||
psta = rtw_get_stainfo(pstapriv, cur_network->network.MacAddress);
|
||||
if(psta)
|
||||
if (psta)
|
||||
{
|
||||
int i;
|
||||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
|
@ -331,10 +331,10 @@ int proc_get_ap_info(char *page, char **start,
|
|||
len += snprintf(page + len, count - len, "agg_enable_bitmap=%x, candidate_tid_bitmap=%x\n", psta->htpriv.agg_enable_bitmap, psta->htpriv.candidate_tid_bitmap);
|
||||
#endif //CONFIG_80211N_HT
|
||||
|
||||
for(i=0;i<16;i++)
|
||||
for (i=0;i<16;i++)
|
||||
{
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
if(preorder_ctrl->enable)
|
||||
if (preorder_ctrl->enable)
|
||||
{
|
||||
len += snprintf(page + len, count - len, "tid=%d, indicate_seq=%d\n", i, preorder_ctrl->indicate_seq);
|
||||
}
|
||||
|
@ -399,11 +399,11 @@ int proc_get_mac_reg_dump1(char *page, char **start,
|
|||
|
||||
len += snprintf(page + len, count - len, "\n======= MAC REG =======\n");
|
||||
|
||||
for(i=0x0;i<0x300;i+=4)
|
||||
for (i=0x0;i<0x300;i+=4)
|
||||
{
|
||||
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
}
|
||||
|
||||
*eof = 1;
|
||||
|
@ -422,11 +422,11 @@ int proc_get_mac_reg_dump2(char *page, char **start,
|
|||
|
||||
len += snprintf(page + len, count - len, "\n======= MAC REG =======\n");
|
||||
memset(page, 0, count);
|
||||
for(i=0x300;i<0x600;i+=4)
|
||||
for (i=0x300;i<0x600;i+=4)
|
||||
{
|
||||
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
}
|
||||
|
||||
*eof = 1;
|
||||
|
@ -445,11 +445,11 @@ int proc_get_mac_reg_dump3(char *page, char **start,
|
|||
|
||||
len += snprintf(page + len, count - len, "\n======= MAC REG =======\n");
|
||||
|
||||
for(i=0x600;i<0x800;i+=4)
|
||||
for (i=0x600;i<0x800;i+=4)
|
||||
{
|
||||
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
}
|
||||
|
||||
*eof = 1;
|
||||
|
@ -467,11 +467,11 @@ int proc_get_bb_reg_dump1(char *page, char **start,
|
|||
int i,j=1;
|
||||
|
||||
len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
|
||||
for(i=0x800;i<0xB00;i+=4)
|
||||
for (i=0x800;i<0xB00;i+=4)
|
||||
{
|
||||
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
}
|
||||
*eof = 1;
|
||||
return len;
|
||||
|
@ -487,11 +487,11 @@ int proc_get_bb_reg_dump2(char *page, char **start,
|
|||
int i,j=1;
|
||||
|
||||
len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
|
||||
for(i=0xB00;i<0xE00;i+=4)
|
||||
for (i=0xB00;i<0xE00;i+=4)
|
||||
{
|
||||
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
}
|
||||
*eof = 1;
|
||||
return len;
|
||||
|
@ -507,11 +507,11 @@ int proc_get_bb_reg_dump3(char *page, char **start,
|
|||
int i,j=1;
|
||||
|
||||
len += snprintf(page + len, count - len, "\n======= BB REG =======\n");
|
||||
for(i=0xE00;i<0x1000;i+=4)
|
||||
for (i=0xE00;i<0x1000;i+=4)
|
||||
{
|
||||
if(j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
if (j%4==1) len += snprintf(page + len, count - len,"0x%02x",i);
|
||||
len += snprintf(page + len, count - len," 0x%08x ",rtw_read32(padapter,i));
|
||||
if((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
if ((j++)%4 == 0) len += snprintf(page + len, count - len,"\n");
|
||||
}
|
||||
*eof = 1;
|
||||
return len;
|
||||
|
@ -530,13 +530,13 @@ int proc_get_rf_reg_dump1(char *page, char **start,
|
|||
len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
|
||||
path = 1;
|
||||
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
|
||||
for(i=0;i<0xC0;i++)
|
||||
for (i=0;i<0xC0;i++)
|
||||
{
|
||||
//value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
|
||||
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
|
||||
if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
|
||||
if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
|
||||
len += snprintf(page + len, count - len, " 0x%08x ",value);
|
||||
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
if ((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
}
|
||||
|
||||
*eof = 1;
|
||||
|
@ -557,13 +557,13 @@ int proc_get_rf_reg_dump2(char *page, char **start,
|
|||
len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
|
||||
path = 1;
|
||||
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
|
||||
for(i=0xC0;i<0x100;i++)
|
||||
for (i=0xC0;i<0x100;i++)
|
||||
{
|
||||
//value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
|
||||
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
|
||||
if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
|
||||
if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
|
||||
len += snprintf(page + len, count - len, " 0x%08x ",value);
|
||||
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
if ((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
}
|
||||
*eof = 1;
|
||||
return len;
|
||||
|
@ -583,13 +583,13 @@ int proc_get_rf_reg_dump3(char *page, char **start,
|
|||
len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
|
||||
path = 2;
|
||||
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
|
||||
for(i=0;i<0xC0;i++)
|
||||
for (i=0;i<0xC0;i++)
|
||||
{
|
||||
//value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
|
||||
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
|
||||
if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
|
||||
if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
|
||||
len += snprintf(page + len, count - len, " 0x%08x ",value);
|
||||
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
if ((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
}
|
||||
|
||||
*eof = 1;
|
||||
|
@ -610,13 +610,13 @@ int proc_get_rf_reg_dump4(char *page, char **start,
|
|||
len += snprintf(page + len, count - len, "\n======= RF REG =======\n");
|
||||
path = 2;
|
||||
len += snprintf(page + len, count - len, "\nRF_Path(%x)\n",path);
|
||||
for(i=0xC0;i<0x100;i++)
|
||||
for (i=0xC0;i<0x100;i++)
|
||||
{
|
||||
//value = PHY_QueryRFReg(padapter, (RF90_RADIO_PATH_E)path,i, bMaskDWord);
|
||||
value = rtw_hal_read_rfreg(padapter, path, i, 0xffffffff);
|
||||
if(j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
|
||||
if (j%4==1) len += snprintf(page + len, count - len, "0x%02x ",i);
|
||||
len += snprintf(page + len, count - len, " 0x%08x ",value);
|
||||
if((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
if ((j++)%4==0) len += snprintf(page + len, count - len, "\n");
|
||||
}
|
||||
*eof = 1;
|
||||
return len;
|
||||
|
@ -668,7 +668,7 @@ int proc_set_rx_signal(struct file *file, const char *buffer,
|
|||
|
||||
is_signal_dbg = is_signal_dbg==0?0:1;
|
||||
|
||||
if(is_signal_dbg && num!=2)
|
||||
if (is_signal_dbg && num!=2)
|
||||
return count;
|
||||
|
||||
signal_strength = signal_strength>100?100:signal_strength;
|
||||
|
@ -677,7 +677,7 @@ int proc_set_rx_signal(struct file *file, const char *buffer,
|
|||
padapter->recvpriv.is_signal_dbg = is_signal_dbg;
|
||||
padapter->recvpriv.signal_strength_dbg=signal_strength;
|
||||
|
||||
if(is_signal_dbg)
|
||||
if (is_signal_dbg)
|
||||
DBG_871X("set %s %u\n", "DBG_SIGNAL_STRENGTH", signal_strength);
|
||||
else
|
||||
DBG_871X("set %s\n", "HW_SIGNAL_STRENGTH");
|
||||
|
@ -699,7 +699,7 @@ int proc_get_ht_enable(char *page, char **start,
|
|||
|
||||
int len = 0;
|
||||
|
||||
if(pregpriv)
|
||||
if (pregpriv)
|
||||
len += snprintf(page + len, count - len,
|
||||
"%d\n",
|
||||
pregpriv->ht_enable
|
||||
|
@ -725,7 +725,7 @@ int proc_set_ht_enable(struct file *file, const char *buffer,
|
|||
|
||||
int num = sscanf(tmp, "%d ", &mode);
|
||||
|
||||
if( pregpriv && mode >= 0 && mode < 2 )
|
||||
if ( pregpriv && mode >= 0 && mode < 2 )
|
||||
{
|
||||
pregpriv->ht_enable= mode;
|
||||
printk("ht_enable=%d\n", pregpriv->ht_enable);
|
||||
|
@ -746,7 +746,7 @@ int proc_get_cbw40_enable(char *page, char **start,
|
|||
|
||||
int len = 0;
|
||||
|
||||
if(pregpriv)
|
||||
if (pregpriv)
|
||||
len += snprintf(page + len, count - len,
|
||||
"%d\n",
|
||||
pregpriv->cbw40_enable
|
||||
|
@ -772,7 +772,7 @@ int proc_set_cbw40_enable(struct file *file, const char *buffer,
|
|||
|
||||
int num = sscanf(tmp, "%d ", &mode);
|
||||
|
||||
if( pregpriv && mode >= 0 && mode < 2 )
|
||||
if ( pregpriv && mode >= 0 && mode < 2 )
|
||||
{
|
||||
|
||||
pregpriv->cbw40_enable= mode;
|
||||
|
@ -795,7 +795,7 @@ int proc_get_ampdu_enable(char *page, char **start,
|
|||
|
||||
int len = 0;
|
||||
|
||||
if(pregpriv)
|
||||
if (pregpriv)
|
||||
len += snprintf(page + len, count - len,
|
||||
"%d\n",
|
||||
pregpriv->ampdu_enable
|
||||
|
@ -821,7 +821,7 @@ int proc_set_ampdu_enable(struct file *file, const char *buffer,
|
|||
|
||||
int num = sscanf(tmp, "%d ", &mode);
|
||||
|
||||
if( pregpriv && mode >= 0 && mode < 3 )
|
||||
if ( pregpriv && mode >= 0 && mode < 3 )
|
||||
{
|
||||
pregpriv->ampdu_enable= mode;
|
||||
printk("ampdu_enable=%d\n", mode);
|
||||
|
@ -843,7 +843,7 @@ int proc_get_two_path_rssi(char *page, char **start,
|
|||
|
||||
int len = 0;
|
||||
|
||||
if(padapter)
|
||||
if (padapter)
|
||||
len += snprintf(page + len, count - len,
|
||||
"%d %d\n",
|
||||
padapter->recvpriv.RxRssi[0],
|
||||
|
@ -864,7 +864,7 @@ int proc_get_rx_stbc(char *page, char **start,
|
|||
|
||||
int len = 0;
|
||||
|
||||
if(pregpriv)
|
||||
if (pregpriv)
|
||||
len += snprintf(page + len, count - len,
|
||||
"%d\n",
|
||||
pregpriv->rx_stbc
|
||||
|
@ -890,7 +890,7 @@ int proc_set_rx_stbc(struct file *file, const char *buffer,
|
|||
|
||||
int num = sscanf(tmp, "%d ", &mode);
|
||||
|
||||
if( pregpriv && (mode == 0 || mode == 1|| mode == 2|| mode == 3))
|
||||
if ( pregpriv && (mode == 0 || mode == 1|| mode == 2|| mode == 3))
|
||||
{
|
||||
pregpriv->rx_stbc= mode;
|
||||
printk("rx_stbc=%d\n", mode);
|
||||
|
@ -934,7 +934,7 @@ int proc_set_rssi_disp(struct file *file, const char *buffer,
|
|||
return count;
|
||||
}
|
||||
|
||||
if(enable)
|
||||
if (enable)
|
||||
{
|
||||
DBG_8192C("Turn On Rx RSSI Display Function\n");
|
||||
padapter->bRxRSSIDisplay = enable ;
|
||||
|
@ -973,7 +973,7 @@ int proc_get_all_sta_info(char *page, char **start,
|
|||
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
for(i=0; i< NUM_STA; i++)
|
||||
for (i=0; i< NUM_STA; i++)
|
||||
{
|
||||
phead = &(pstapriv->sta_hash[i]);
|
||||
plist = get_next(phead);
|
||||
|
@ -984,7 +984,7 @@ int proc_get_all_sta_info(char *page, char **start,
|
|||
|
||||
plist = get_next(plist);
|
||||
|
||||
//if(extra_arg == psta->aid)
|
||||
//if (extra_arg == psta->aid)
|
||||
{
|
||||
len += snprintf(page + len, count - len, "sta's macaddr:" MAC_FMT "\n", MAC_ARG(psta->hwaddr));
|
||||
len += snprintf(page + len, count - len, "rtsen=%d, cts2slef=%d\n", psta->rtsen, psta->cts2self);
|
||||
|
@ -1004,10 +1004,10 @@ int proc_get_all_sta_info(char *page, char **start,
|
|||
len += snprintf(page + len, count - len, "qos_info=0x%x\n", psta->qos_info);
|
||||
len += snprintf(page + len, count - len, "dot118021XPrivacy=0x%x\n", psta->dot118021XPrivacy);
|
||||
|
||||
for(j=0;j<16;j++)
|
||||
for (j=0;j<16;j++)
|
||||
{
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[j];
|
||||
if(preorder_ctrl->enable)
|
||||
if (preorder_ctrl->enable)
|
||||
{
|
||||
len += snprintf(page + len, count - len, "tid=%d, indicate_seq=%d\n", j, preorder_ctrl->indicate_seq);
|
||||
}
|
||||
|
@ -1124,7 +1124,7 @@ int proc_get_btcoex_dbg(char *page, char **start,
|
|||
|
||||
int len = 0;
|
||||
|
||||
if(pregpriv)
|
||||
if (pregpriv)
|
||||
len += snprintf(page + len, count - len,
|
||||
"%d\n",
|
||||
BTCoexDbgLevel
|
||||
|
@ -1150,7 +1150,7 @@ int proc_set_btcoex_dbg(struct file *file, const char *buffer,
|
|||
|
||||
int num = sscanf(tmp, "%d ", &mode);
|
||||
|
||||
if( pregpriv && (mode == 0 || mode == 1|| mode == 2|| mode == 3))
|
||||
if ( pregpriv && (mode == 0 || mode == 1|| mode == 2|| mode == 3))
|
||||
{
|
||||
BTCoexDbgLevel= mode;
|
||||
printk("btcoex_dbg=%d\n", BTCoexDbgLevel);
|
||||
|
|
|
@ -48,7 +48,7 @@ void shift_out_bits(_adapter * padapter, u16 data, u16 count)
|
|||
u16 x,mask;
|
||||
_func_enter_;
|
||||
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
if (padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
|
@ -60,9 +60,9 @@ _func_enter_;
|
|||
do
|
||||
{
|
||||
x &= ~_EEDI;
|
||||
if(data & mask)
|
||||
if (data & mask)
|
||||
x |= _EEDI;
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
if (padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
|
@ -71,8 +71,8 @@ _func_enter_;
|
|||
up_clk(padapter, &x);
|
||||
down_clk(padapter, &x);
|
||||
mask = mask >> 1;
|
||||
} while(mask);
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
} while (mask);
|
||||
if (padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ u16 shift_in_bits (_adapter * padapter)
|
|||
{
|
||||
u16 x,d=0,i;
|
||||
_func_enter_;
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
if (padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
|
@ -95,18 +95,18 @@ _func_enter_;
|
|||
x &= ~( _EEDO | _EEDI);
|
||||
d = 0;
|
||||
|
||||
for(i=0; i<16; i++)
|
||||
for (i=0; i<16; i++)
|
||||
{
|
||||
d = d << 1;
|
||||
up_clk(padapter, &x);
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
if (padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~(_EEDI);
|
||||
if(x & _EEDO)
|
||||
if (x & _EEDO)
|
||||
d |= 1;
|
||||
|
||||
down_clk(padapter, &x);
|
||||
|
@ -157,23 +157,23 @@ void eeprom_clean(_adapter * padapter)
|
|||
{
|
||||
u16 x;
|
||||
_func_enter_;
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
if (padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
if (padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
x &= ~(_EECS | _EEDI);
|
||||
rtw_write8(padapter, EE_9346CR, (u8)x);
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
if (padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
up_clk(padapter, &x);
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
if (padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
|
@ -189,13 +189,13 @@ void eeprom_write16(_adapter * padapter, u16 reg, u16 data)
|
|||
u8 tmp8_ori,tmp8_new,tmp8_clk_ori,tmp8_clk_new;
|
||||
tmp8_ori=rtw_read8(padapter, 0x102502f1);
|
||||
tmp8_new=tmp8_ori & 0xf7;
|
||||
if(tmp8_ori != tmp8_new){
|
||||
if (tmp8_ori != tmp8_new){
|
||||
rtw_write8(padapter, 0x102502f1, tmp8_new);
|
||||
RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x102502f1=====\n"));
|
||||
}
|
||||
tmp8_clk_ori=rtw_read8(padapter,0x10250003);
|
||||
tmp8_clk_new=tmp8_clk_ori|0x20;
|
||||
if(tmp8_clk_new!=tmp8_clk_ori){
|
||||
if (tmp8_clk_new!=tmp8_clk_ori){
|
||||
RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x10250003=====\n"));
|
||||
rtw_write8(padapter, 0x10250003, tmp8_clk_new);
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ _func_enter_;
|
|||
|
||||
shift_out_bits(padapter, EEPROM_EWEN_OPCODE, 5);
|
||||
|
||||
if(padapter->EepromAddressSize==8) //CF+ and SDIO
|
||||
if (padapter->EepromAddressSize==8) //CF+ and SDIO
|
||||
shift_out_bits(padapter, 0, 6);
|
||||
else //USB
|
||||
shift_out_bits(padapter, 0, 4);
|
||||
|
@ -256,9 +256,9 @@ _func_enter_;
|
|||
eeprom_clean(padapter );
|
||||
exit:
|
||||
#ifdef CONFIG_RTL8712
|
||||
if(tmp8_clk_new!=tmp8_clk_ori)
|
||||
if (tmp8_clk_new!=tmp8_clk_ori)
|
||||
rtw_write8(padapter, 0x10250003, tmp8_clk_ori);
|
||||
if(tmp8_new!=tmp8_ori)
|
||||
if (tmp8_new!=tmp8_ori)
|
||||
rtw_write8(padapter, 0x102502f1, tmp8_ori);
|
||||
|
||||
#endif
|
||||
|
@ -275,27 +275,27 @@ u16 eeprom_read16(_adapter * padapter, u16 reg) //ReadEEprom
|
|||
u8 tmp8_ori,tmp8_new,tmp8_clk_ori,tmp8_clk_new;
|
||||
tmp8_ori= rtw_read8(padapter, 0x102502f1);
|
||||
tmp8_new = tmp8_ori & 0xf7;
|
||||
if(tmp8_ori != tmp8_new){
|
||||
if (tmp8_ori != tmp8_new){
|
||||
rtw_write8(padapter, 0x102502f1, tmp8_new);
|
||||
RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x102502f1=====\n"));
|
||||
}
|
||||
tmp8_clk_ori=rtw_read8(padapter,0x10250003);
|
||||
tmp8_clk_new=tmp8_clk_ori|0x20;
|
||||
if(tmp8_clk_new!=tmp8_clk_ori){
|
||||
if (tmp8_clk_new!=tmp8_clk_ori){
|
||||
RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x10250003=====\n"));
|
||||
rtw_write8(padapter, 0x10250003, tmp8_clk_new);
|
||||
}
|
||||
#endif
|
||||
_func_enter_;
|
||||
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
if (padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
// select EEPROM, reset bits, set _EECS
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
if (padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
|
@ -315,9 +315,9 @@ _func_enter_;
|
|||
eeprom_clean(padapter);
|
||||
out:
|
||||
#ifdef CONFIG_RTL8712
|
||||
if(tmp8_clk_new!=tmp8_clk_ori)
|
||||
if (tmp8_clk_new!=tmp8_clk_ori)
|
||||
rtw_write8(padapter, 0x10250003, tmp8_clk_ori);
|
||||
if(tmp8_new!=tmp8_ori)
|
||||
if (tmp8_new!=tmp8_ori)
|
||||
rtw_write8(padapter, 0x102502f1, tmp8_ori);
|
||||
|
||||
#endif
|
||||
|
@ -337,14 +337,14 @@ void eeprom_read_sz(_adapter * padapter, u16 reg, u8* data, u32 sz)
|
|||
u16 x, data16;
|
||||
u32 i;
|
||||
_func_enter_;
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
if (padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
// select EEPROM, reset bits, set _EECS
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
if (padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
|
@ -359,7 +359,7 @@ _func_enter_;
|
|||
shift_out_bits(padapter, reg, padapter->EepromAddressSize);
|
||||
|
||||
|
||||
for(i=0; i<sz; i+=2)
|
||||
for (i=0; i<sz; i+=2)
|
||||
{
|
||||
data16 = shift_in_bits(padapter);
|
||||
data[i] = data16 & 0xff;
|
||||
|
@ -384,7 +384,7 @@ _func_enter_;
|
|||
reg = (u16)(addr_off >> 1);
|
||||
addr_2align_odd = (u8)(addr_off & 0x1);
|
||||
|
||||
if(addr_2align_odd) //read that start at high part: e.g 1,3,5,7,9,...
|
||||
if (addr_2align_odd) //read that start at high part: e.g 1,3,5,7,9,...
|
||||
{
|
||||
stmp = eeprom_read16(padapter, reg);
|
||||
rbuf[idx++] = (u8) ((stmp>>8)&0xff); //return hogh-part of the short
|
||||
|
@ -394,7 +394,7 @@ _func_enter_;
|
|||
quotient = sz >> 1;
|
||||
remainder = sz & 0x1;
|
||||
|
||||
for( i=0 ; i < quotient; i++)
|
||||
for ( i=0 ; i < quotient; i++)
|
||||
{
|
||||
stmp = eeprom_read16(padapter, reg+i);
|
||||
rbuf[idx++] = (u8) (stmp&0xff);
|
||||
|
@ -402,7 +402,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
reg = reg+i;
|
||||
if(remainder){ //end of read at lower part of short : 0,2,4,6,...
|
||||
if (remainder){ //end of read at lower part of short : 0,2,4,6,...
|
||||
stmp = eeprom_read16(padapter, reg);
|
||||
rbuf[idx] = (u8)(stmp & 0xff);
|
||||
}
|
||||
|
|
|
@ -61,12 +61,12 @@ Efuse_Read1ByteFromFakeContent(
|
|||
IN u16 Offset,
|
||||
IN OUT u8 *Value )
|
||||
{
|
||||
if(Offset >= EFUSE_MAX_HW_SIZE)
|
||||
if (Offset >= EFUSE_MAX_HW_SIZE)
|
||||
{
|
||||
return _FALSE;
|
||||
}
|
||||
//DbgPrint("Read fake content, offset = %d\n", Offset);
|
||||
if(fakeEfuseBank == 0)
|
||||
if (fakeEfuseBank == 0)
|
||||
*Value = fakeEfuseContent[Offset];
|
||||
else
|
||||
*Value = fakeBTEfuseContent[fakeEfuseBank-1][Offset];
|
||||
|
@ -84,11 +84,11 @@ Efuse_Write1ByteToFakeContent(
|
|||
IN u16 Offset,
|
||||
IN u8 Value )
|
||||
{
|
||||
if(Offset >= EFUSE_MAX_HW_SIZE)
|
||||
if (Offset >= EFUSE_MAX_HW_SIZE)
|
||||
{
|
||||
return _FALSE;
|
||||
}
|
||||
if(fakeEfuseBank == 0)
|
||||
if (fakeEfuseBank == 0)
|
||||
fakeEfuseContent[Offset] = Value;
|
||||
else
|
||||
{
|
||||
|
@ -158,10 +158,10 @@ u8
|
|||
Efuse_CalculateWordCnts(IN u8 word_en)
|
||||
{
|
||||
u8 word_cnts = 0;
|
||||
if(!(word_en & BIT(0))) word_cnts++; // 0 : write enable
|
||||
if(!(word_en & BIT(1))) word_cnts++;
|
||||
if(!(word_en & BIT(2))) word_cnts++;
|
||||
if(!(word_en & BIT(3))) word_cnts++;
|
||||
if (!(word_en & BIT(0))) word_cnts++; // 0 : write enable
|
||||
if (!(word_en & BIT(1))) word_cnts++;
|
||||
if (!(word_en & BIT(2))) word_cnts++;
|
||||
if (!(word_en & BIT(3))) word_cnts++;
|
||||
return word_cnts;
|
||||
}
|
||||
|
||||
|
@ -188,7 +188,7 @@ ReadEFuseByte(
|
|||
u16 retry;
|
||||
//u32 start=rtw_get_current_time();
|
||||
|
||||
if(bPseudoTest)
|
||||
if (bPseudoTest)
|
||||
{
|
||||
Efuse_Read1ByteFromFakeContent(Adapter, _offset, pbuf);
|
||||
return;
|
||||
|
@ -206,8 +206,8 @@ ReadEFuseByte(
|
|||
//Check bit 32 read-ready
|
||||
retry = 0;
|
||||
value32 = rtw_read32(Adapter, EFUSE_CTRL);
|
||||
//while(!(((value32 >> 24) & 0xff) & 0x80) && (retry<10))
|
||||
while(!(((value32 >> 24) & 0xff) & 0x80) && (retry<10000))
|
||||
//while (!(((value32 >> 24) & 0xff) & 0x80) && (retry<10))
|
||||
while (!(((value32 >> 24) & 0xff) & 0x80) && (retry<10000))
|
||||
{
|
||||
value32 = rtw_read32(Adapter, EFUSE_CTRL);
|
||||
retry++;
|
||||
|
@ -324,11 +324,11 @@ EFUSE_Read1Byte(
|
|||
|
||||
//Wait Write-ready (0x30[31]=1)
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
while(!(Bytetemp & 0x80))
|
||||
while (!(Bytetemp & 0x80))
|
||||
{
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
k++;
|
||||
if(k==1000)
|
||||
if (k==1000)
|
||||
{
|
||||
k=0;
|
||||
break;
|
||||
|
@ -378,7 +378,7 @@ EFUSE_Write1Byte(
|
|||
//RT_TRACE(COMP_EFUSE, DBG_LOUD, ("Addr=%x Data =%x\n", Address, Value));
|
||||
EFUSE_GetEfuseDefinition(Adapter, EFUSE_WIFI , TYPE_EFUSE_REAL_CONTENT_LEN, (PVOID)&contentLen, _FALSE);
|
||||
|
||||
if( Address < contentLen) //E-fuse 512Byte
|
||||
if ( Address < contentLen) //E-fuse 512Byte
|
||||
{
|
||||
rtw_write8(Adapter, EFUSE_CTRL, Value);
|
||||
|
||||
|
@ -398,11 +398,11 @@ EFUSE_Write1Byte(
|
|||
|
||||
//Wait Write-ready (0x30[31]=0)
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
while(Bytetemp & 0x80)
|
||||
while (Bytetemp & 0x80)
|
||||
{
|
||||
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
|
||||
k++;
|
||||
if(k==100)
|
||||
if (k==100)
|
||||
{
|
||||
k=0;
|
||||
break;
|
||||
|
@ -422,7 +422,7 @@ efuse_OneByteRead(
|
|||
u8 tmpidx = 0;
|
||||
u8 bResult;
|
||||
|
||||
if(bPseudoTest)
|
||||
if (bPseudoTest)
|
||||
{
|
||||
bResult = Efuse_Read1ByteFromFakeContent(pAdapter, addr, data);
|
||||
return bResult;
|
||||
|
@ -435,11 +435,11 @@ efuse_OneByteRead(
|
|||
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+3, 0x72);//read cmd
|
||||
|
||||
while(!(0x80 &rtw_read8(pAdapter, EFUSE_CTRL+3))&&(tmpidx<100))
|
||||
while (!(0x80 &rtw_read8(pAdapter, EFUSE_CTRL+3))&&(tmpidx<100))
|
||||
{
|
||||
tmpidx++;
|
||||
}
|
||||
if(tmpidx<100)
|
||||
if (tmpidx<100)
|
||||
{
|
||||
*data=rtw_read8(pAdapter, EFUSE_CTRL);
|
||||
bResult = _TRUE;
|
||||
|
@ -463,7 +463,7 @@ efuse_OneByteWrite(
|
|||
u8 tmpidx = 0;
|
||||
u8 bResult;
|
||||
|
||||
if(bPseudoTest)
|
||||
if (bPseudoTest)
|
||||
{
|
||||
bResult = Efuse_Write1ByteToFakeContent(pAdapter, addr, data);
|
||||
return bResult;
|
||||
|
@ -481,11 +481,11 @@ efuse_OneByteWrite(
|
|||
|
||||
rtw_write8(pAdapter, EFUSE_CTRL+3, 0xF2);//write cmd
|
||||
|
||||
while((0x80 & rtw_read8(pAdapter, EFUSE_CTRL+3)) && (tmpidx<100) ){
|
||||
while ((0x80 & rtw_read8(pAdapter, EFUSE_CTRL+3)) && (tmpidx<100) ){
|
||||
tmpidx++;
|
||||
}
|
||||
|
||||
if(tmpidx<100)
|
||||
if (tmpidx<100)
|
||||
{
|
||||
bResult = _TRUE;
|
||||
}
|
||||
|
@ -716,7 +716,7 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
|||
return _FAIL;
|
||||
|
||||
map = rtw_zmalloc(mapLen);
|
||||
if(map == NULL){
|
||||
if (map == NULL){
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
|
@ -772,7 +772,7 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
|||
DBG_871X("offset=%x \n",offset);
|
||||
DBG_871X("word_en=%x \n",word_en);
|
||||
|
||||
for(i=0;i<PGPKT_DATA_SIZE;i++)
|
||||
for (i=0;i<PGPKT_DATA_SIZE;i++)
|
||||
{
|
||||
DBG_871X("data=%x \t",newdata[i]);
|
||||
}
|
||||
|
@ -814,7 +814,7 @@ u8 rtw_BT_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
|||
return _FAIL;
|
||||
|
||||
map = rtw_zmalloc(mapLen);
|
||||
if(map == NULL){
|
||||
if (map == NULL){
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
|
@ -1099,7 +1099,7 @@ void EFUSE_ShadowMapUpdate(
|
|||
else
|
||||
{
|
||||
#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
|
||||
if(_SUCCESS != retriveAdaptorInfoFile(pAdapter->registrypriv.adaptor_info_caching_file_path, pEEPROM)) {
|
||||
if (_SUCCESS != retriveAdaptorInfoFile(pAdapter->registrypriv.adaptor_info_caching_file_path, pEEPROM)) {
|
||||
#endif
|
||||
|
||||
Efuse_ReadAllMap(pAdapter, efuseType, pEEPROM->efuse_eeprom_data, bPseudoTest);
|
||||
|
@ -1207,14 +1207,14 @@ Efuse_InitSomeVar(
|
|||
_rtw_memset((PVOID)&fakeEfuseInitMap[0], 0xff, EFUSE_MAX_MAP_LEN);
|
||||
_rtw_memset((PVOID)&fakeEfuseModifiedMap[0], 0xff, EFUSE_MAX_MAP_LEN);
|
||||
|
||||
for(i=0; i<EFUSE_MAX_BT_BANK; i++)
|
||||
for (i=0; i<EFUSE_MAX_BT_BANK; i++)
|
||||
{
|
||||
_rtw_memset((PVOID)&BTEfuseContent[i][0], EFUSE_MAX_HW_SIZE, 0xff);
|
||||
}
|
||||
_rtw_memset((PVOID)&BTEfuseInitMap[0], 0xff, EFUSE_BT_MAX_MAP_LEN);
|
||||
_rtw_memset((PVOID)&BTEfuseModifiedMap[0], 0xff, EFUSE_BT_MAX_MAP_LEN);
|
||||
|
||||
for(i=0; i<EFUSE_MAX_BT_BANK; i++)
|
||||
for (i=0; i<EFUSE_MAX_BT_BANK; i++)
|
||||
{
|
||||
_rtw_memset((PVOID)&fakeBTEfuseContent[i][0], 0xff, EFUSE_MAX_HW_SIZE);
|
||||
}
|
||||
|
@ -1235,9 +1235,9 @@ int storeAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv)
|
|||
{
|
||||
int ret =_SUCCESS;
|
||||
|
||||
if(path && eeprom_priv) {
|
||||
if (path && eeprom_priv) {
|
||||
ret = rtw_store_to_file(path, eeprom_priv->efuse_eeprom_data, EEPROM_MAX_SIZE_512);
|
||||
if(ret == EEPROM_MAX_SIZE)
|
||||
if (ret == EEPROM_MAX_SIZE)
|
||||
ret = _SUCCESS;
|
||||
else
|
||||
ret = _FAIL;
|
||||
|
@ -1254,17 +1254,17 @@ int retriveAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv)
|
|||
mm_segment_t oldfs;
|
||||
struct file *fp;
|
||||
|
||||
if(path && eeprom_priv) {
|
||||
if (path && eeprom_priv) {
|
||||
|
||||
ret = rtw_retrive_from_file(path, eeprom_priv->efuse_eeprom_data, EEPROM_MAX_SIZE);
|
||||
|
||||
if(ret == EEPROM_MAX_SIZE)
|
||||
if (ret == EEPROM_MAX_SIZE)
|
||||
ret = _SUCCESS;
|
||||
else
|
||||
ret = _FAIL;
|
||||
|
||||
#if 0
|
||||
if(isAdaptorInfoFileValid()) {
|
||||
if (isAdaptorInfoFileValid()) {
|
||||
return 0;
|
||||
} else {
|
||||
return _FAIL;
|
||||
|
|
|
@ -72,7 +72,7 @@ int rtw_get_bit_value_from_ieee_value(u8 val)
|
|||
unsigned char dot11_rate_table[]={2,4,11,22,12,18,24,36,48,72,96,108,0}; // last element must be zero!!
|
||||
|
||||
int i=0;
|
||||
while(dot11_rate_table[i] != 0) {
|
||||
while (dot11_rate_table[i] != 0) {
|
||||
if (dot11_rate_table[i] == val)
|
||||
return BIT(i);
|
||||
i++;
|
||||
|
@ -84,7 +84,7 @@ uint rtw_is_cckrates_included(u8 *rate)
|
|||
{
|
||||
u32 i = 0;
|
||||
|
||||
while(rate[i]!=0)
|
||||
while (rate[i]!=0)
|
||||
{
|
||||
if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
|
||||
(((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) )
|
||||
|
@ -100,7 +100,7 @@ uint rtw_is_cckratesonly_included(u8 *rate)
|
|||
u32 i = 0;
|
||||
|
||||
|
||||
while(rate[i]!=0)
|
||||
while (rate[i]!=0)
|
||||
{
|
||||
if ( (((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) &&
|
||||
(((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22) )
|
||||
|
@ -127,7 +127,7 @@ int rtw_check_network_type(unsigned char *rate, int ratelen, int channel)
|
|||
{
|
||||
if ((rtw_is_cckratesonly_included(rate)) == _TRUE)
|
||||
return WIRELESS_11B;
|
||||
else if((rtw_is_cckrates_included(rate)) == _TRUE)
|
||||
else if ((rtw_is_cckrates_included(rate)) == _TRUE)
|
||||
return WIRELESS_11BG;
|
||||
else
|
||||
return WIRELESS_11G;
|
||||
|
@ -167,7 +167,7 @@ _func_enter_;
|
|||
_func_exit_;
|
||||
}
|
||||
|
||||
inline u8 *rtw_set_ie_ch_switch(u8 *buf, u32 *buf_len, u8 ch_switch_mode,
|
||||
inline u8 *rtw_set_ie_ch_switch (u8 *buf, u32 *buf_len, u8 ch_switch_mode,
|
||||
u8 new_ch, u8 ch_switch_cnt)
|
||||
{
|
||||
u8 ie_data[3];
|
||||
|
@ -182,9 +182,9 @@ inline u8 secondary_ch_offset_to_hal_ch_offset(u8 ch_offset)
|
|||
{
|
||||
if (ch_offset == SCN)
|
||||
return HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
else if(ch_offset == SCA)
|
||||
else if (ch_offset == SCA)
|
||||
return HAL_PRIME_CHNL_OFFSET_UPPER;
|
||||
else if(ch_offset == SCB)
|
||||
else if (ch_offset == SCB)
|
||||
return HAL_PRIME_CHNL_OFFSET_LOWER;
|
||||
|
||||
return HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
|
@ -194,9 +194,9 @@ inline u8 hal_ch_offset_to_secondary_ch_offset(u8 ch_offset)
|
|||
{
|
||||
if (ch_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE)
|
||||
return SCN;
|
||||
else if(ch_offset == HAL_PRIME_CHNL_OFFSET_LOWER)
|
||||
else if (ch_offset == HAL_PRIME_CHNL_OFFSET_LOWER)
|
||||
return SCB;
|
||||
else if(ch_offset == HAL_PRIME_CHNL_OFFSET_UPPER)
|
||||
else if (ch_offset == HAL_PRIME_CHNL_OFFSET_UPPER)
|
||||
return SCA;
|
||||
|
||||
return SCN;
|
||||
|
@ -236,7 +236,7 @@ _func_enter_;
|
|||
p = pbuf;
|
||||
i = 0;
|
||||
*len = 0;
|
||||
while(1)
|
||||
while (1)
|
||||
{
|
||||
if (*p == index)
|
||||
{
|
||||
|
@ -274,25 +274,25 @@ u8 *rtw_get_ie_ex(u8 *in_ie, uint in_len, u8 eid, u8 *oui, u8 oui_len, u8 *ie, u
|
|||
u8 *target_ie = NULL;
|
||||
|
||||
|
||||
if(ielen)
|
||||
if (ielen)
|
||||
*ielen = 0;
|
||||
|
||||
if(!in_ie || in_len<=0)
|
||||
if (!in_ie || in_len<=0)
|
||||
return target_ie;
|
||||
|
||||
cnt = 0;
|
||||
|
||||
while(cnt<in_len)
|
||||
while (cnt<in_len)
|
||||
{
|
||||
if(eid == in_ie[cnt]
|
||||
if (eid == in_ie[cnt]
|
||||
&& ( !oui || _rtw_memcmp(&in_ie[cnt+2], oui, oui_len) == _TRUE))
|
||||
{
|
||||
target_ie = &in_ie[cnt];
|
||||
|
||||
if(ie)
|
||||
if (ie)
|
||||
_rtw_memcpy(ie, &in_ie[cnt], in_ie[cnt+1]+2);
|
||||
|
||||
if(ielen)
|
||||
if (ielen)
|
||||
*ielen = in_ie[cnt+1]+2;
|
||||
|
||||
break;
|
||||
|
@ -326,7 +326,7 @@ int rtw_ies_remove_ie(u8 *ies, uint *ies_len, uint offset, u8 eid, u8 *oui, u8 o
|
|||
u8 *start;
|
||||
uint search_len;
|
||||
|
||||
if(!ies || !ies_len || *ies_len <= offset)
|
||||
if (!ies || !ies_len || *ies_len <= offset)
|
||||
goto exit;
|
||||
|
||||
start = ies + offset;
|
||||
|
@ -389,7 +389,7 @@ uint rtw_get_rateset_len(u8 *rateset)
|
|||
{
|
||||
uint i = 0;
|
||||
_func_enter_;
|
||||
while(1)
|
||||
while (1)
|
||||
{
|
||||
if ((rateset[i]) == 0)
|
||||
break;
|
||||
|
@ -426,7 +426,7 @@ _func_enter_;
|
|||
|
||||
*(u16*)ie |= cpu_to_le16(cap_IBSS);
|
||||
|
||||
if(pregistrypriv->preamble == PREAMBLE_SHORT)
|
||||
if (pregistrypriv->preamble == PREAMBLE_SHORT)
|
||||
*(u16*)ie |= cpu_to_le16(cap_ShortPremble);
|
||||
|
||||
if (pdev_network->Privacy)
|
||||
|
@ -439,9 +439,9 @@ _func_enter_;
|
|||
ie = rtw_set_ie(ie, _SSID_IE_, pdev_network->Ssid.SsidLength, pdev_network->Ssid.Ssid, &sz);
|
||||
|
||||
//supported rates
|
||||
if(pregistrypriv->wireless_mode == WIRELESS_11ABGN)
|
||||
if (pregistrypriv->wireless_mode == WIRELESS_11ABGN)
|
||||
{
|
||||
if(pdev_network->Configuration.DSConfig > 14)
|
||||
if (pdev_network->Configuration.DSConfig > 14)
|
||||
wireless_mode = WIRELESS_11A_5N;
|
||||
else
|
||||
wireless_mode = WIRELESS_11BG_24N;
|
||||
|
@ -480,7 +480,7 @@ _func_enter_;
|
|||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
//HT Cap.
|
||||
if(((pregistrypriv->wireless_mode&WIRELESS_11_5N)||(pregistrypriv->wireless_mode&WIRELESS_11_24N))
|
||||
if (((pregistrypriv->wireless_mode&WIRELESS_11_5N)||(pregistrypriv->wireless_mode&WIRELESS_11_24N))
|
||||
&& (pregistrypriv->ht_enable==_TRUE))
|
||||
{
|
||||
//todo:
|
||||
|
@ -505,7 +505,7 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
|
|||
u8 *pbuf = pie;
|
||||
int limit_new = limit;
|
||||
|
||||
while(1)
|
||||
while (1)
|
||||
{
|
||||
pbuf = rtw_get_ie(pbuf, _WPA_IE_ID_, &len, limit_new);
|
||||
|
||||
|
@ -766,18 +766,18 @@ int rtw_get_wapi_ie(u8 *in_ie,uint in_len,u8 *wapi_ie,u16 *wapi_len)
|
|||
|
||||
_func_enter_;
|
||||
cnt = (_TIMESTAMP_ + _BEACON_ITERVAL_ + _CAPABILITY_);
|
||||
while(cnt<in_len)
|
||||
while (cnt<in_len)
|
||||
{
|
||||
authmode=in_ie[cnt];
|
||||
|
||||
//if(authmode==_WAPI_IE_)
|
||||
if(authmode==_WAPI_IE_ && (_rtw_memcmp(&in_ie[cnt+6], wapi_oui1,4)==_TRUE ||
|
||||
//if (authmode==_WAPI_IE_)
|
||||
if (authmode==_WAPI_IE_ && (_rtw_memcmp(&in_ie[cnt+6], wapi_oui1,4)==_TRUE ||
|
||||
_rtw_memcmp(&in_ie[cnt+6], wapi_oui2,4)==_TRUE))
|
||||
{
|
||||
if (wapi_ie) {
|
||||
_rtw_memcpy(wapi_ie, &in_ie[cnt],in_ie[cnt+1]+2);
|
||||
|
||||
for(i=0;i<(in_ie[cnt+1]+2);i=i+8){
|
||||
for (i=0;i<(in_ie[cnt+1]+2);i=i+8){
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n %2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n",
|
||||
wapi_ie[i],wapi_ie[i+1],wapi_ie[i+2],wapi_ie[i+3],wapi_ie[i+4],
|
||||
wapi_ie[i+5],wapi_ie[i+6],wapi_ie[i+7]));
|
||||
|
@ -814,18 +814,18 @@ _func_enter_;
|
|||
|
||||
sec_idx=0;
|
||||
|
||||
while(cnt<in_len)
|
||||
while (cnt<in_len)
|
||||
{
|
||||
authmode=in_ie[cnt];
|
||||
|
||||
if((authmode==_WPA_IE_ID_)&&(_rtw_memcmp(&in_ie[cnt+2], &wpa_oui[0],4)==_TRUE))
|
||||
if ((authmode==_WPA_IE_ID_)&&(_rtw_memcmp(&in_ie[cnt+2], &wpa_oui[0],4)==_TRUE))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n rtw_get_wpa_ie: sec_idx=%d in_ie[cnt+1]+2=%d\n",sec_idx,in_ie[cnt+1]+2));
|
||||
|
||||
if (wpa_ie) {
|
||||
_rtw_memcpy(wpa_ie, &in_ie[cnt],in_ie[cnt+1]+2);
|
||||
|
||||
for(i=0;i<(in_ie[cnt+1]+2);i=i+8){
|
||||
for (i=0;i<(in_ie[cnt+1]+2);i=i+8){
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n %2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n",
|
||||
wpa_ie[i],wpa_ie[i+1],wpa_ie[i+2],wpa_ie[i+3],wpa_ie[i+4],
|
||||
wpa_ie[i+5],wpa_ie[i+6],wpa_ie[i+7]));
|
||||
|
@ -837,14 +837,14 @@ _func_enter_;
|
|||
}
|
||||
else
|
||||
{
|
||||
if(authmode==_WPA2_IE_ID_)
|
||||
if (authmode==_WPA2_IE_ID_)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n get_rsn_ie: sec_idx=%d in_ie[cnt+1]+2=%d\n",sec_idx,in_ie[cnt+1]+2));
|
||||
|
||||
if (rsn_ie) {
|
||||
_rtw_memcpy(rsn_ie, &in_ie[cnt],in_ie[cnt+1]+2);
|
||||
|
||||
for(i=0;i<(in_ie[cnt+1]+2);i=i+8){
|
||||
for (i=0;i<(in_ie[cnt+1]+2);i=i+8){
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("\n %2x,%2x,%2x,%2x,%2x,%2x,%2x,%2x\n",
|
||||
rsn_ie[i],rsn_ie[i+1],rsn_ie[i+2],rsn_ie[i+3],rsn_ie[i+4],
|
||||
rsn_ie[i+5],rsn_ie[i+6],rsn_ie[i+7]));
|
||||
|
@ -873,11 +873,11 @@ u8 rtw_is_wps_ie(u8 *ie_ptr, uint *wps_ielen)
|
|||
u8 match = _FALSE;
|
||||
u8 eid, wps_oui[4]={0x0,0x50,0xf2,0x04};
|
||||
|
||||
if(ie_ptr == NULL) return match;
|
||||
if (ie_ptr == NULL) return match;
|
||||
|
||||
eid = ie_ptr[0];
|
||||
|
||||
if((eid==_WPA_IE_ID_)&&(_rtw_memcmp(&ie_ptr[2], wps_oui, 4)==_TRUE))
|
||||
if ((eid==_WPA_IE_ID_)&&(_rtw_memcmp(&ie_ptr[2], wps_oui, 4)==_TRUE))
|
||||
{
|
||||
//DBG_8192C("==> found WPS_IE.....\n");
|
||||
*wps_ielen = ie_ptr[1]+2;
|
||||
|
@ -901,26 +901,26 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
|
|||
u8 *wpsie_ptr=NULL;
|
||||
u8 eid, wps_oui[4]={0x0,0x50,0xf2,0x04};
|
||||
|
||||
if(wps_ielen)
|
||||
if (wps_ielen)
|
||||
*wps_ielen = 0;
|
||||
|
||||
if(!in_ie || in_len<=0)
|
||||
if (!in_ie || in_len<=0)
|
||||
return wpsie_ptr;
|
||||
|
||||
cnt = 0;
|
||||
|
||||
while(cnt<in_len)
|
||||
while (cnt<in_len)
|
||||
{
|
||||
eid = in_ie[cnt];
|
||||
|
||||
if((eid==_WPA_IE_ID_)&&(_rtw_memcmp(&in_ie[cnt+2], wps_oui, 4)==_TRUE))
|
||||
if ((eid==_WPA_IE_ID_)&&(_rtw_memcmp(&in_ie[cnt+2], wps_oui, 4)==_TRUE))
|
||||
{
|
||||
wpsie_ptr = &in_ie[cnt];
|
||||
|
||||
if(wps_ie)
|
||||
if (wps_ie)
|
||||
_rtw_memcpy(wps_ie, &in_ie[cnt], in_ie[cnt+1]+2);
|
||||
|
||||
if(wps_ielen)
|
||||
if (wps_ielen)
|
||||
*wps_ielen = in_ie[cnt+1]+2;
|
||||
|
||||
cnt+=in_ie[cnt+1]+2;
|
||||
|
@ -953,7 +953,7 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_att
|
|||
u8 * target_attr_ptr = NULL;
|
||||
u8 wps_oui[4]={0x00,0x50,0xF2,0x04};
|
||||
|
||||
if(len_attr)
|
||||
if (len_attr)
|
||||
*len_attr = 0;
|
||||
|
||||
if ( ( wps_ie[0] != _VENDOR_SPECIFIC_IE_ ) ||
|
||||
|
@ -965,7 +965,7 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_att
|
|||
// 6 = 1(Element ID) + 1(Length) + 4(WPS OUI)
|
||||
attr_ptr = wps_ie + 6; //goto first attr
|
||||
|
||||
while(attr_ptr - wps_ie < wps_ielen)
|
||||
while (attr_ptr - wps_ie < wps_ielen)
|
||||
{
|
||||
// 4 = 2(Attribute ID) + 2(Length)
|
||||
u16 attr_id = RTW_GET_BE16(attr_ptr);
|
||||
|
@ -973,14 +973,14 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8 *buf_att
|
|||
u16 attr_len = attr_data_len + 4;
|
||||
|
||||
//DBG_871X("%s attr_ptr:%p, id:%u, length:%u\n", __FUNCTION__, attr_ptr, attr_id, attr_data_len);
|
||||
if( attr_id == target_attr_id )
|
||||
if ( attr_id == target_attr_id )
|
||||
{
|
||||
target_attr_ptr = attr_ptr;
|
||||
|
||||
if(buf_attr)
|
||||
if (buf_attr)
|
||||
_rtw_memcpy(buf_attr, attr_ptr, attr_len);
|
||||
|
||||
if(len_attr)
|
||||
if (len_attr)
|
||||
*len_attr = attr_len;
|
||||
|
||||
break;
|
||||
|
@ -1010,17 +1010,17 @@ u8 *rtw_get_wps_attr_content(u8 *wps_ie, uint wps_ielen, u16 target_attr_id ,u8
|
|||
u8 *attr_ptr;
|
||||
u32 attr_len;
|
||||
|
||||
if(len_content)
|
||||
if (len_content)
|
||||
*len_content = 0;
|
||||
|
||||
attr_ptr = rtw_get_wps_attr(wps_ie, wps_ielen, target_attr_id, NULL, &attr_len);
|
||||
|
||||
if(attr_ptr && attr_len)
|
||||
if (attr_ptr && attr_len)
|
||||
{
|
||||
if(buf_content)
|
||||
if (buf_content)
|
||||
_rtw_memcpy(buf_content, attr_ptr+4, attr_len-4);
|
||||
|
||||
if(len_content)
|
||||
if (len_content)
|
||||
*len_content = attr_len-4;
|
||||
|
||||
return attr_ptr+4;
|
||||
|
@ -1264,7 +1264,7 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
|
|||
static u8 key_char2num(u8 ch);
|
||||
static u8 key_char2num(u8 ch)
|
||||
{
|
||||
if((ch>='0')&&(ch<='9'))
|
||||
if ((ch>='0')&&(ch<='9'))
|
||||
return ch - '0';
|
||||
else if ((ch>='a')&&(ch<='f'))
|
||||
return ch - 'a' + 10;
|
||||
|
@ -1295,13 +1295,13 @@ extern char* rtw_initmac;
|
|||
void rtw_macaddr_cfg(u8 *mac_addr)
|
||||
{
|
||||
u8 mac[ETH_ALEN];
|
||||
if(mac_addr == NULL) return;
|
||||
if (mac_addr == NULL) return;
|
||||
|
||||
if ( rtw_initmac )
|
||||
{ // Users specify the mac address
|
||||
int jj,kk;
|
||||
|
||||
for( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 )
|
||||
for ( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 )
|
||||
{
|
||||
mac[jj] = key_2char2num(rtw_initmac[kk], rtw_initmac[kk+ 1]);
|
||||
}
|
||||
|
@ -1335,7 +1335,7 @@ void dump_ies(u8 *buf, u32 buf_len) {
|
|||
u8* pos = (u8*)buf;
|
||||
u8 id, len;
|
||||
|
||||
while(pos-buf<=buf_len){
|
||||
while (pos-buf<=buf_len){
|
||||
id = *pos;
|
||||
len = *(pos+1);
|
||||
|
||||
|
@ -1358,11 +1358,11 @@ void dump_wps_ie(u8 *ie, u32 ie_len) {
|
|||
uint wps_ielen;
|
||||
|
||||
wps_ie = rtw_get_wps_ie(ie, ie_len, NULL, &wps_ielen);
|
||||
if(wps_ie != ie || wps_ielen == 0)
|
||||
if (wps_ie != ie || wps_ielen == 0)
|
||||
return;
|
||||
|
||||
pos+=6;
|
||||
while(pos-ie < ie_len){
|
||||
while (pos-ie < ie_len){
|
||||
id = RTW_GET_BE16(pos);
|
||||
len = RTW_GET_BE16(pos + 2);
|
||||
|
||||
|
@ -1382,11 +1382,11 @@ void dump_p2p_ie(u8 *ie, u32 ie_len) {
|
|||
uint p2p_ielen;
|
||||
|
||||
p2p_ie = rtw_get_p2p_ie(ie, ie_len, NULL, &p2p_ielen);
|
||||
if(p2p_ie != ie || p2p_ielen == 0)
|
||||
if (p2p_ie != ie || p2p_ielen == 0)
|
||||
return;
|
||||
|
||||
pos+=6;
|
||||
while(pos-ie < ie_len){
|
||||
while (pos-ie < ie_len){
|
||||
id = *pos;
|
||||
len = RTW_GET_LE16(pos+1);
|
||||
|
||||
|
@ -1414,7 +1414,7 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
|
|||
if ( p2p_ielen != NULL )
|
||||
*p2p_ielen = 0;
|
||||
|
||||
while(cnt<in_len)
|
||||
while (cnt<in_len)
|
||||
{
|
||||
eid = in_ie[cnt];
|
||||
if ((in_len < 0) || (cnt > MAX_IE_SZ)) {
|
||||
|
@ -1423,7 +1423,7 @@ u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
|
|||
#endif
|
||||
return NULL;
|
||||
}
|
||||
if( ( eid == _VENDOR_SPECIFIC_IE_ ) && ( _rtw_memcmp( &in_ie[cnt+2], p2p_oui, 4) == _TRUE ) )
|
||||
if ( ( eid == _VENDOR_SPECIFIC_IE_ ) && ( _rtw_memcmp( &in_ie[cnt+2], p2p_oui, 4) == _TRUE ) )
|
||||
{
|
||||
p2p_ie_ptr = in_ie + cnt;
|
||||
|
||||
|
@ -1468,7 +1468,7 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *buf_attr
|
|||
u8 *target_attr_ptr = NULL;
|
||||
u8 p2p_oui[4]={0x50,0x6F,0x9A,0x09};
|
||||
|
||||
if(len_attr)
|
||||
if (len_attr)
|
||||
*len_attr = 0;
|
||||
|
||||
if ( !p2p_ie || ( p2p_ie[0] != _VENDOR_SPECIFIC_IE_ ) ||
|
||||
|
@ -1480,7 +1480,7 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *buf_attr
|
|||
// 6 = 1(Element ID) + 1(Length) + 3 (OUI) + 1(OUI Type)
|
||||
attr_ptr = p2p_ie + 6; //goto first attr
|
||||
|
||||
while(attr_ptr - p2p_ie < p2p_ielen)
|
||||
while (attr_ptr - p2p_ie < p2p_ielen)
|
||||
{
|
||||
// 3 = 1(Attribute ID) + 2(Length)
|
||||
u8 attr_id = *attr_ptr;
|
||||
|
@ -1488,14 +1488,14 @@ u8 *rtw_get_p2p_attr(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *buf_attr
|
|||
u16 attr_len = attr_data_len + 3;
|
||||
|
||||
//DBG_871X("%s attr_ptr:%p, id:%u, length:%u\n", __FUNCTION__, attr_ptr, attr_id, attr_data_len);
|
||||
if( attr_id == target_attr_id )
|
||||
if ( attr_id == target_attr_id )
|
||||
{
|
||||
target_attr_ptr = attr_ptr;
|
||||
|
||||
if(buf_attr)
|
||||
if (buf_attr)
|
||||
_rtw_memcpy(buf_attr, attr_ptr, attr_len);
|
||||
|
||||
if(len_attr)
|
||||
if (len_attr)
|
||||
*len_attr = attr_len;
|
||||
|
||||
break;
|
||||
|
@ -1525,17 +1525,17 @@ u8 *rtw_get_p2p_attr_content(u8 *p2p_ie, uint p2p_ielen, u8 target_attr_id ,u8 *
|
|||
u8 *attr_ptr;
|
||||
u32 attr_len;
|
||||
|
||||
if(len_content)
|
||||
if (len_content)
|
||||
*len_content = 0;
|
||||
|
||||
attr_ptr = rtw_get_p2p_attr(p2p_ie, p2p_ielen, target_attr_id, NULL, &attr_len);
|
||||
|
||||
if(attr_ptr && attr_len)
|
||||
if (attr_ptr && attr_len)
|
||||
{
|
||||
if(buf_content)
|
||||
if (buf_content)
|
||||
_rtw_memcpy(buf_content, attr_ptr+3, attr_len-3);
|
||||
|
||||
if(len_content)
|
||||
if (len_content)
|
||||
*len_content = attr_len-3;
|
||||
|
||||
return attr_ptr+3;
|
||||
|
@ -1553,7 +1553,7 @@ u32 rtw_set_p2p_attr_content(u8 *pbuf, u8 attr_id, u16 attr_len, u8 *pdata_attr)
|
|||
//*(u16*)(pbuf + 1) = cpu_to_le16(attr_len);
|
||||
RTW_PUT_LE16(pbuf + 1, attr_len);
|
||||
|
||||
if(pdata_attr)
|
||||
if (pdata_attr)
|
||||
_rtw_memcpy(pbuf + 3, pdata_attr, attr_len);
|
||||
|
||||
a_len = attr_len + 3;
|
||||
|
@ -1568,9 +1568,9 @@ static uint rtw_p2p_attr_remove(u8 *ie, uint ielen_ori, u8 attr_id)
|
|||
uint ielen = ielen_ori;
|
||||
int index=0;
|
||||
|
||||
while(1) {
|
||||
while (1) {
|
||||
target_attr=rtw_get_p2p_attr(ie, ielen, attr_id, NULL, &target_attr_len);
|
||||
if(target_attr && target_attr_len)
|
||||
if (target_attr && target_attr_len)
|
||||
{
|
||||
u8 *next_attr = target_attr+target_attr_len;
|
||||
uint remain_len = ielen-(next_attr-ie);
|
||||
|
@ -1594,7 +1594,7 @@ static uint rtw_p2p_attr_remove(u8 *ie, uint ielen_ori, u8 attr_id)
|
|||
}
|
||||
else
|
||||
{
|
||||
//if(index>0)
|
||||
//if (index>0)
|
||||
// dump_ies(ie, ielen);
|
||||
break;
|
||||
}
|
||||
|
@ -1609,17 +1609,17 @@ void rtw_WLAN_BSSID_EX_remove_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id)
|
|||
uint p2p_ielen, p2p_ielen_ori;
|
||||
int cnt;
|
||||
|
||||
if( (p2p_ie=rtw_get_p2p_ie(bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_, NULL, &p2p_ielen_ori)) )
|
||||
if ( (p2p_ie=rtw_get_p2p_ie(bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_, NULL, &p2p_ielen_ori)) )
|
||||
{
|
||||
#if 0
|
||||
if(rtw_get_p2p_attr(p2p_ie, p2p_ielen_ori, attr_id, NULL, NULL)) {
|
||||
if (rtw_get_p2p_attr(p2p_ie, p2p_ielen_ori, attr_id, NULL, NULL)) {
|
||||
DBG_871X("rtw_get_p2p_attr: GOT P2P_ATTR:%u!!!!!!!!\n", attr_id);
|
||||
dump_ies(bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_);
|
||||
}
|
||||
#endif
|
||||
|
||||
p2p_ielen=rtw_p2p_attr_remove(p2p_ie, p2p_ielen_ori, attr_id);
|
||||
if(p2p_ielen != p2p_ielen_ori) {
|
||||
if (p2p_ielen != p2p_ielen_ori) {
|
||||
|
||||
u8 *next_ie_ori = p2p_ie+p2p_ielen_ori;
|
||||
u8 *next_ie = p2p_ie+p2p_ielen;
|
||||
|
@ -1654,11 +1654,11 @@ int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
|
|||
return match;
|
||||
}
|
||||
|
||||
while(cnt<in_len)
|
||||
while (cnt<in_len)
|
||||
{
|
||||
eid = in_ie[cnt];
|
||||
|
||||
if( ( eid == _VENDOR_SPECIFIC_IE_ ) && ( _rtw_memcmp( &in_ie[cnt+2], wfd_oui, 4) == _TRUE ) )
|
||||
if ( ( eid == _VENDOR_SPECIFIC_IE_ ) && ( _rtw_memcmp( &in_ie[cnt+2], wfd_oui, 4) == _TRUE ) )
|
||||
{
|
||||
if ( wfd_ie != NULL )
|
||||
{
|
||||
|
@ -1718,18 +1718,18 @@ int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *
|
|||
|
||||
// 1 ( WFD IE ) + 1 ( Length ) + 3 ( OUI ) + 1 ( OUI Type )
|
||||
cnt = 6;
|
||||
while( cnt < wfd_ielen )
|
||||
while ( cnt < wfd_ielen )
|
||||
{
|
||||
u16 attrlen = RTW_GET_BE16(wfd_ie + cnt + 1);
|
||||
|
||||
attr_id = wfd_ie[cnt];
|
||||
if( attr_id == target_attr_id )
|
||||
if ( attr_id == target_attr_id )
|
||||
{
|
||||
// 3 -> 1 byte for attribute ID field, 2 bytes for length field
|
||||
if(attr_content)
|
||||
if (attr_content)
|
||||
_rtw_memcpy( attr_content, &wfd_ie[ cnt + 3 ], attrlen );
|
||||
|
||||
if(attr_contentlen)
|
||||
if (attr_contentlen)
|
||||
*attr_contentlen = attrlen;
|
||||
|
||||
cnt += attrlen + 3;
|
||||
|
@ -1801,7 +1801,7 @@ int rtw_get_cipher_info(struct wlan_network *pnetwork)
|
|||
int ret = _FAIL;
|
||||
pbuf = rtw_get_wpa_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength-12);
|
||||
|
||||
if(pbuf && (wpa_ielen>0)) {
|
||||
if (pbuf && (wpa_ielen>0)) {
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_get_cipher_info: wpa_ielen: %d", wpa_ielen));
|
||||
if (_SUCCESS == rtw_parse_wpa_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is8021x)) {
|
||||
|
||||
|
@ -1816,7 +1816,7 @@ int rtw_get_cipher_info(struct wlan_network *pnetwork)
|
|||
|
||||
pbuf = rtw_get_wpa2_ie(&pnetwork->network.IEs[12], &wpa_ielen, pnetwork->network.IELength-12);
|
||||
|
||||
if(pbuf && (wpa_ielen>0)) {
|
||||
if (pbuf && (wpa_ielen>0)) {
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("get RSN IE\n"));
|
||||
if (_SUCCESS == rtw_parse_wpa2_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is8021x)) {
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("get RSN IE OK!!!\n"));
|
||||
|
@ -1876,7 +1876,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
|
|||
/* get bwmode and ch_offset */
|
||||
/* parsing HT_CAP_IE */
|
||||
p = rtw_get_ie(pnetwork->network.IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pnetwork->network.IELength - _FIXED_IE_LENGTH_);
|
||||
if(p && len>0) {
|
||||
if (p && len>0) {
|
||||
pht_cap = (struct rtw_ieee80211_ht_cap *)(p + 2);
|
||||
pnetwork->BcnInfo.ht_cap_info = pht_cap->cap_info;
|
||||
} else {
|
||||
|
@ -1884,7 +1884,7 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
|
|||
}
|
||||
/* parsing HT_INFO_IE */
|
||||
p = rtw_get_ie(pnetwork->network.IEs + _FIXED_IE_LENGTH_, _HT_ADD_INFO_IE_, &len, pnetwork->network.IELength - _FIXED_IE_LENGTH_);
|
||||
if(p && len>0) {
|
||||
if (p && len>0) {
|
||||
pht_info = (struct HT_info_element *)(p + 2);
|
||||
pnetwork->BcnInfo.ht_info_infos_0 = pht_info->infos[0];
|
||||
} else {
|
||||
|
@ -1897,63 +1897,63 @@ u16 rtw_mcs_rate(u8 rf_type, u8 bw_40MHz, u8 short_GI_20, u8 short_GI_40, unsign
|
|||
{
|
||||
u16 max_rate = 0;
|
||||
|
||||
if(rf_type == RF_1T1R)
|
||||
if (rf_type == RF_1T1R)
|
||||
{
|
||||
if(MCS_rate[0] & BIT(7))
|
||||
if (MCS_rate[0] & BIT(7))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?1500:1350):((short_GI_20)?722:650);
|
||||
else if(MCS_rate[0] & BIT(6))
|
||||
else if (MCS_rate[0] & BIT(6))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?1350:1215):((short_GI_20)?650:585);
|
||||
else if(MCS_rate[0] & BIT(5))
|
||||
else if (MCS_rate[0] & BIT(5))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?1200:1080):((short_GI_20)?578:520);
|
||||
else if(MCS_rate[0] & BIT(4))
|
||||
else if (MCS_rate[0] & BIT(4))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?900:810):((short_GI_20)?433:390);
|
||||
else if(MCS_rate[0] & BIT(3))
|
||||
else if (MCS_rate[0] & BIT(3))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?600:540):((short_GI_20)?289:260);
|
||||
else if(MCS_rate[0] & BIT(2))
|
||||
else if (MCS_rate[0] & BIT(2))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?450:405):((short_GI_20)?217:195);
|
||||
else if(MCS_rate[0] & BIT(1))
|
||||
else if (MCS_rate[0] & BIT(1))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?300:270):((short_GI_20)?144:130);
|
||||
else if(MCS_rate[0] & BIT(0))
|
||||
else if (MCS_rate[0] & BIT(0))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?150:135):((short_GI_20)?72:65);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(MCS_rate[1])
|
||||
if (MCS_rate[1])
|
||||
{
|
||||
if(MCS_rate[1] & BIT(7))
|
||||
if (MCS_rate[1] & BIT(7))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?3000:2700):((short_GI_20)?1444:1300);
|
||||
else if(MCS_rate[1] & BIT(6))
|
||||
else if (MCS_rate[1] & BIT(6))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?2700:2430):((short_GI_20)?1300:1170);
|
||||
else if(MCS_rate[1] & BIT(5))
|
||||
else if (MCS_rate[1] & BIT(5))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?2400:2160):((short_GI_20)?1156:1040);
|
||||
else if(MCS_rate[1] & BIT(4))
|
||||
else if (MCS_rate[1] & BIT(4))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?1800:1620):((short_GI_20)?867:780);
|
||||
else if(MCS_rate[1] & BIT(3))
|
||||
else if (MCS_rate[1] & BIT(3))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?1200:1080):((short_GI_20)?578:520);
|
||||
else if(MCS_rate[1] & BIT(2))
|
||||
else if (MCS_rate[1] & BIT(2))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?900:810):((short_GI_20)?433:390);
|
||||
else if(MCS_rate[1] & BIT(1))
|
||||
else if (MCS_rate[1] & BIT(1))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?600:540):((short_GI_20)?289:260);
|
||||
else if(MCS_rate[1] & BIT(0))
|
||||
else if (MCS_rate[1] & BIT(0))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?300:270):((short_GI_20)?144:130);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(MCS_rate[0] & BIT(7))
|
||||
if (MCS_rate[0] & BIT(7))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?1500:1350):((short_GI_20)?722:650);
|
||||
else if(MCS_rate[0] & BIT(6))
|
||||
else if (MCS_rate[0] & BIT(6))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?1350:1215):((short_GI_20)?650:585);
|
||||
else if(MCS_rate[0] & BIT(5))
|
||||
else if (MCS_rate[0] & BIT(5))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?1200:1080):((short_GI_20)?578:520);
|
||||
else if(MCS_rate[0] & BIT(4))
|
||||
else if (MCS_rate[0] & BIT(4))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?900:810):((short_GI_20)?433:390);
|
||||
else if(MCS_rate[0] & BIT(3))
|
||||
else if (MCS_rate[0] & BIT(3))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?600:540):((short_GI_20)?289:260);
|
||||
else if(MCS_rate[0] & BIT(2))
|
||||
else if (MCS_rate[0] & BIT(2))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?450:405):((short_GI_20)?217:195);
|
||||
else if(MCS_rate[0] & BIT(1))
|
||||
else if (MCS_rate[0] & BIT(1))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?300:270):((short_GI_20)?144:130);
|
||||
else if(MCS_rate[0] & BIT(0))
|
||||
else if (MCS_rate[0] & BIT(0))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40)?150:135):((short_GI_20)?72:65);
|
||||
}
|
||||
}
|
||||
|
@ -1977,7 +1977,7 @@ int rtw_action_frame_parse(const u8 *frame, u32 frame_len, u8* category, u8 *act
|
|||
|
||||
c = frame_body[0];
|
||||
|
||||
switch(c) {
|
||||
switch (c) {
|
||||
case RTW_WLAN_CATEGORY_P2P: /* vendor-specific */
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -251,7 +251,7 @@ void _rtw_read_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if( (adapter->bDriverStopped ==_TRUE) || (adapter->bSurpriseRemoved == _TRUE))
|
||||
if ( (adapter->bDriverStopped ==_TRUE) || (adapter->bSurpriseRemoved == _TRUE))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_mem:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
|
||||
return;
|
||||
|
@ -291,7 +291,7 @@ void _rtw_read_port(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if( (adapter->bDriverStopped ==_TRUE) || (adapter->bSurpriseRemoved == _TRUE))
|
||||
if ( (adapter->bDriverStopped ==_TRUE) || (adapter->bSurpriseRemoved == _TRUE))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_port:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
|
||||
return;
|
||||
|
@ -313,7 +313,7 @@ void _rtw_read_port_cancel(_adapter *adapter)
|
|||
|
||||
_read_port_cancel = pintfhdl->io_ops._read_port_cancel;
|
||||
|
||||
if(_read_port_cancel)
|
||||
if (_read_port_cancel)
|
||||
_read_port_cancel(pintfhdl);
|
||||
|
||||
}
|
||||
|
@ -362,7 +362,7 @@ void _rtw_write_port_cancel(_adapter *adapter)
|
|||
|
||||
_write_port_cancel = pintfhdl->io_ops._write_port_cancel;
|
||||
|
||||
if(_write_port_cancel)
|
||||
if (_write_port_cancel)
|
||||
_write_port_cancel(pintfhdl);
|
||||
|
||||
}
|
||||
|
|
|
@ -60,14 +60,14 @@ query_802_11_capability(
|
|||
|
||||
|
||||
pCap->Length = sizeof(NDIS_802_11_CAPABILITY);
|
||||
if(ulNumOfPairSupported > 1 )
|
||||
if (ulNumOfPairSupported > 1 )
|
||||
pCap->Length += (ulNumOfPairSupported-1) * sizeof(NDIS_802_11_AUTHENTICATION_ENCRYPTION);
|
||||
|
||||
pCap->Version = 2;
|
||||
pCap->NoOfPMKIDs = NUM_PMKID_CACHE;
|
||||
pCap->NoOfAuthEncryptPairsSupported = ulNumOfPairSupported;
|
||||
|
||||
if( sizeof (szAuthEnc) <= 240 ) // 240 = 256 - 4*4 // SecurityInfo.szCapability: only 256 bytes in size.
|
||||
if ( sizeof (szAuthEnc) <= 240 ) // 240 = 256 - 4*4 // SecurityInfo.szCapability: only 256 bytes in size.
|
||||
{
|
||||
_rtw_memcpy( pucAuthEncryptionSupported, (u8*)szAuthEnc, sizeof (szAuthEnc) );
|
||||
*pulOutLen = pCap->Length;
|
||||
|
@ -98,7 +98,7 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
|
|||
// Association Request related information
|
||||
//------------------------------------------------------
|
||||
// Req_1. AvailableRequestFixedIEs
|
||||
if(psecnetwork!=NULL){
|
||||
if (psecnetwork!=NULL){
|
||||
|
||||
pAssocInfo->AvailableRequestFixedIEs |= NDIS_802_11_AI_REQFI_CAPABILITIES|NDIS_802_11_AI_REQFI_CURRENTAPADDRESS;
|
||||
pAssocInfo->RequestFixedIEs.Capabilities = (unsigned short)* & psecnetwork->IEs[10];
|
||||
|
@ -107,25 +107,25 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
|
|||
|
||||
pAssocInfo->OffsetRequestIEs = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
|
||||
|
||||
if(check_fwstate( pmlmepriv, _FW_UNDER_LINKING|_FW_LINKED)==_TRUE)
|
||||
if (check_fwstate( pmlmepriv, _FW_UNDER_LINKING|_FW_LINKED)==_TRUE)
|
||||
{
|
||||
|
||||
if(psecuritypriv->ndisauthtype>=Ndis802_11AuthModeWPA2)
|
||||
if (psecuritypriv->ndisauthtype>=Ndis802_11AuthModeWPA2)
|
||||
pDest[0] =48; //RSN Information Element
|
||||
else
|
||||
pDest[0] =221; //WPA(SSN) Information Element
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n Adapter->ndisauthtype==Ndis802_11AuthModeWPA)?0xdd:0x30 [%d]",pDest[0]));
|
||||
supp_ie=&psecuritypriv->supplicant_ie[0];
|
||||
for(i=0;i<supp_ie[0];i++)
|
||||
for (i=0;i<supp_ie[0];i++)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("IEs [%d] = 0x%x \n\n", i,supp_ie[i]));
|
||||
}
|
||||
|
||||
i=13; //0~11 is fixed information element
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("i= %d tgt_network->network.IELength=%d\n\n", i,(int)psecnetwork->IELength));
|
||||
while((i<supp_ie[0]) && (i<256)){
|
||||
if((unsigned char)supp_ie[i]==pDest[0]){
|
||||
while ((i<supp_ie[0]) && (i<256)){
|
||||
if ((unsigned char)supp_ie[i]==pDest[0]){
|
||||
_rtw_memcpy((u8 *)(pDest),
|
||||
&supp_ie[i],
|
||||
supp_ie[1+i]+2);
|
||||
|
@ -134,7 +134,7 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
|
|||
}
|
||||
|
||||
i=i+supp_ie[i+1]+2;
|
||||
if(supp_ie[1+i]==0)
|
||||
if (supp_ie[1+i]==0)
|
||||
i=i+1;
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("iteration i=%d IEs [%d] = 0x%x \n\n", i,i,supp_ie[i+1]));
|
||||
|
||||
|
@ -155,10 +155,10 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
|
|||
// Association Response related information
|
||||
//------------------------------------------------------
|
||||
|
||||
if(check_fwstate( pmlmepriv, _FW_LINKED)==_TRUE)
|
||||
if (check_fwstate( pmlmepriv, _FW_LINKED)==_TRUE)
|
||||
{
|
||||
tgt_network =&(pmlmepriv->cur_network);
|
||||
if(tgt_network!=NULL){
|
||||
if (tgt_network!=NULL){
|
||||
pAssocInfo->AvailableResponseFixedIEs =
|
||||
NDIS_802_11_AI_RESFI_CAPABILITIES
|
||||
|NDIS_802_11_AI_RESFI_ASSOCIATIONID
|
||||
|
@ -171,11 +171,11 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
|
|||
pDest = (u8 *)pAssocInfo + sizeof(NDIS_802_11_ASSOCIATION_INFORMATION)+pAssocInfo->RequestIELength;
|
||||
auth_ie=&psecuritypriv->authenticator_ie[0];
|
||||
|
||||
for(i=0;i<auth_ie[0];i++)
|
||||
for (i=0;i<auth_ie[0];i++)
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("IEs [%d] = 0x%x \n\n", i,auth_ie[i]));
|
||||
|
||||
i=auth_ie[0]-12;
|
||||
if(i>0){
|
||||
if (i>0){
|
||||
_rtw_memcpy((u8 *)&pDest[0],&auth_ie[1],i);
|
||||
pAssocInfo->ResponseIELength =i;
|
||||
}
|
||||
|
|
|
@ -169,17 +169,17 @@ NDIS_STATUS oid_rt_pro_set_fw_dig_state_hdl(struct oid_par_priv* poid_par_priv)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
if (poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
_irqlevel_changed_(&oldirql,LOWER);
|
||||
if(poid_par_priv->information_buf_len >= sizeof(struct setdig_parm))
|
||||
if (poid_par_priv->information_buf_len >= sizeof(struct setdig_parm))
|
||||
{
|
||||
//DEBUG_ERR(("===> oid_rt_pro_set_fw_dig_state_hdl. type:0x%02x.\n",*((unsigned char*)poid_par_priv->information_buf )));
|
||||
if(!rtw_setfwdig_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
|
||||
if (!rtw_setfwdig_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ NDIS_STATUS oid_rt_pro_set_fw_ra_state_hdl(struct oid_par_priv* poid_par_priv)
|
|||
_irqL oldirql;
|
||||
|
||||
_func_enter_;
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
if (poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -212,10 +212,10 @@ NDIS_STATUS oid_rt_pro_set_fw_ra_state_hdl(struct oid_par_priv* poid_par_priv)
|
|||
|
||||
_irqlevel_changed_(&oldirql,LOWER);
|
||||
|
||||
if(poid_par_priv->information_buf_len >= sizeof(struct setra_parm))
|
||||
if (poid_par_priv->information_buf_len >= sizeof(struct setra_parm))
|
||||
{
|
||||
//DEBUG_ERR(("===> oid_rt_pro_set_fw_ra_state_hdl. type:0x%02x.\n",*((unsigned char*)poid_par_priv->information_buf )));
|
||||
if(!rtw_setfwra_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
|
||||
if (!rtw_setfwra_cmd(Adapter,*((unsigned char*)poid_par_priv->information_buf )))
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
}
|
||||
|
@ -236,14 +236,14 @@ NDIS_STATUS oid_rt_get_signal_quality_hdl(struct oid_par_priv* poid_par_priv)
|
|||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
//DEBUG_ERR(("<**********************oid_rt_get_signal_quality_hdl \n"));
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if(pMgntInfo->mAssoc || pMgntInfo->mIbss)
|
||||
if (pMgntInfo->mAssoc || pMgntInfo->mIbss)
|
||||
{
|
||||
ulInfo = pAdapter->RxStats.SignalQuality;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
|
@ -265,13 +265,13 @@ NDIS_STATUS oid_rt_get_small_packet_crc_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
|
||||
if (poid_par_priv->information_buf_len >= sizeof(ULONG) )
|
||||
{
|
||||
*(ULONG *)poid_par_priv->information_buf = padapter->recvpriv.rx_smallpacket_crcerr;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
|
@ -289,13 +289,13 @@ NDIS_STATUS oid_rt_get_middle_packet_crc_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
|
||||
if (poid_par_priv->information_buf_len >= sizeof(ULONG) )
|
||||
{
|
||||
*(ULONG *)poid_par_priv->information_buf = padapter->recvpriv.rx_middlepacket_crcerr;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
|
@ -314,13 +314,13 @@ NDIS_STATUS oid_rt_get_large_packet_crc_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
|
||||
if (poid_par_priv->information_buf_len >= sizeof(ULONG) )
|
||||
{
|
||||
*(ULONG *)poid_par_priv->information_buf = padapter->recvpriv.rx_largepacket_crcerr;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
|
@ -340,7 +340,7 @@ NDIS_STATUS oid_rt_get_tx_retry_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -353,7 +353,7 @@ NDIS_STATUS oid_rt_get_rx_retry_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -367,12 +367,12 @@ NDIS_STATUS oid_rt_get_rx_total_packet_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
if(poid_par_priv->information_buf_len >= sizeof(ULONG) )
|
||||
if (poid_par_priv->information_buf_len >= sizeof(ULONG) )
|
||||
{
|
||||
*(u64 *)poid_par_priv->information_buf = padapter->recvpriv.rx_pkts + padapter->recvpriv.rx_drop;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
|
@ -391,7 +391,7 @@ NDIS_STATUS oid_rt_get_tx_beacon_ok_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -404,7 +404,7 @@ NDIS_STATUS oid_rt_get_tx_beacon_err_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -418,12 +418,12 @@ NDIS_STATUS oid_rt_get_rx_icv_err_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
if(poid_par_priv->information_buf_len>= sizeof(u32))
|
||||
if (poid_par_priv->information_buf_len>= sizeof(u32))
|
||||
{
|
||||
//_rtw_memcpy(*(uint *)poid_par_priv->information_buf,padapter->recvpriv.rx_icv_err,sizeof(u32));
|
||||
*(uint *)poid_par_priv->information_buf = padapter->recvpriv.rx_icv_err;
|
||||
|
@ -443,7 +443,7 @@ NDIS_STATUS oid_rt_set_encryption_algorithm_hdl(struct oid_par_priv* poid_par_pr
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
if (poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -458,14 +458,14 @@ NDIS_STATUS oid_rt_get_preamble_mode_hdl(struct oid_par_priv* poid_par_priv)
|
|||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
ULONG preamblemode = 0 ;
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
if(poid_par_priv->information_buf_len>= sizeof(ULONG))
|
||||
if (poid_par_priv->information_buf_len>= sizeof(ULONG))
|
||||
{
|
||||
if(padapter->registrypriv.preamble == PREAMBLE_LONG)
|
||||
if (padapter->registrypriv.preamble == PREAMBLE_LONG)
|
||||
preamblemode = 0;
|
||||
else if (padapter->registrypriv.preamble == PREAMBLE_AUTO)
|
||||
preamblemode = 1;
|
||||
|
@ -488,7 +488,7 @@ NDIS_STATUS oid_rt_get_ap_ip_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -503,7 +503,7 @@ NDIS_STATUS oid_rt_get_channelplan_hdl(struct oid_par_priv* poid_par_priv)
|
|||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
struct eeprom_priv* peeprompriv = &padapter->eeprompriv;
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -519,7 +519,7 @@ NDIS_STATUS oid_rt_set_channelplan_hdl(struct oid_par_priv* poid_par_priv)
|
|||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
struct eeprom_priv* peeprompriv = &padapter->eeprompriv;
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
if (poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -535,16 +535,16 @@ NDIS_STATUS oid_rt_set_preamble_mode_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
ULONG preamblemode = 0;
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
if (poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
if(poid_par_priv->information_buf_len>= sizeof(ULONG))
|
||||
if (poid_par_priv->information_buf_len>= sizeof(ULONG))
|
||||
{
|
||||
preamblemode = *(ULONG *)poid_par_priv->information_buf ;
|
||||
if( preamblemode == 0)
|
||||
if ( preamblemode == 0)
|
||||
padapter->registrypriv.preamble = PREAMBLE_LONG;
|
||||
else if (preamblemode==1 )
|
||||
padapter->registrypriv.preamble = PREAMBLE_AUTO;
|
||||
|
@ -567,7 +567,7 @@ NDIS_STATUS oid_rt_set_bcn_intvl_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
if (poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -588,12 +588,12 @@ NDIS_STATUS oid_rt_get_total_tx_bytes_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
if(poid_par_priv->information_buf_len>= sizeof(ULONG))
|
||||
if (poid_par_priv->information_buf_len>= sizeof(ULONG))
|
||||
{
|
||||
*(u64 *)poid_par_priv->information_buf = padapter->xmitpriv.tx_bytes;
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
|
@ -612,12 +612,12 @@ NDIS_STATUS oid_rt_get_total_rx_bytes_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
if(poid_par_priv->information_buf_len>= sizeof(ULONG))
|
||||
if (poid_par_priv->information_buf_len>= sizeof(ULONG))
|
||||
{
|
||||
//_rtw_memcpy(*(uint *)poid_par_priv->information_buf,padapter->recvpriv.rx_icv_err,sizeof(u32));
|
||||
*(u64 *)poid_par_priv->information_buf = padapter->recvpriv.rx_bytes;
|
||||
|
@ -642,7 +642,7 @@ NDIS_STATUS oid_rt_get_enc_key_mismatch_count_hdl(struct oid_par_priv* poid_par_
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -655,7 +655,7 @@ NDIS_STATUS oid_rt_get_enc_key_match_count_hdl(struct oid_par_priv* poid_par_pri
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -673,7 +673,7 @@ NDIS_STATUS oid_rt_get_channel_hdl(struct oid_par_priv* poid_par_priv)
|
|||
ULONG channelnum;
|
||||
|
||||
_func_enter_;
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -701,7 +701,7 @@ NDIS_STATUS oid_rt_get_hardware_radio_off_hdl(struct oid_par_priv* poid_par_priv
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -714,7 +714,7 @@ NDIS_STATUS oid_rt_get_key_mismatch_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -728,12 +728,12 @@ NDIS_STATUS oid_rt_supported_wireless_mode_hdl(struct oid_par_priv* poid_par_pri
|
|||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
ULONG ulInfo = 0 ;
|
||||
//DEBUG_ERR(("<**********************oid_rt_supported_wireless_mode_hdl \n"));
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
if(poid_par_priv->information_buf_len >= sizeof(ULONG)){
|
||||
if (poid_par_priv->information_buf_len >= sizeof(ULONG)){
|
||||
ulInfo |= 0x0100; //WIRELESS_MODE_B
|
||||
ulInfo |= 0x0200; //WIRELESS_MODE_G
|
||||
ulInfo |= 0x0400; //WIRELESS_MODE_A
|
||||
|
@ -753,7 +753,7 @@ NDIS_STATUS oid_rt_get_channel_list_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -766,7 +766,7 @@ NDIS_STATUS oid_rt_get_scan_in_progress_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -795,7 +795,7 @@ NDIS_STATUS oid_rt_get_bss_wireless_mode_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -819,7 +819,7 @@ NDIS_STATUS oid_rt_ap_get_associated_station_list_hdl(struct oid_par_priv* poid_
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -846,7 +846,7 @@ NDIS_STATUS oid_rt_ap_set_passphrase_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
if (poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -865,14 +865,14 @@ NDIS_STATUS oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv* poid_par_priv)
|
|||
_irqL oldirql;
|
||||
_func_enter_;
|
||||
//DEBUG_ERR(("<**********************oid_rt_pro_rf_write_registry_hdl \n"));
|
||||
if(poid_par_priv->type_of_oid != SET_OID) //QUERY_OID
|
||||
if (poid_par_priv->type_of_oid != SET_OID) //QUERY_OID
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
_irqlevel_changed_(&oldirql,LOWER);
|
||||
if(poid_par_priv->information_buf_len== (sizeof(unsigned long)*3))
|
||||
if (poid_par_priv->information_buf_len== (sizeof(unsigned long)*3))
|
||||
{
|
||||
//RegOffsetValue - The offset of RF register to write.
|
||||
//RegDataWidth - The data width of RF register to write.
|
||||
|
@ -880,7 +880,7 @@ NDIS_STATUS oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//RegOffsetValue = *((unsigned long*)InformationBuffer);
|
||||
//RegDataWidth = *((unsigned long*)InformationBuffer+1);
|
||||
//RegDataValue = *((unsigned long*)InformationBuffer+2);
|
||||
if(!rtw_setrfreg_cmd(Adapter,
|
||||
if (!rtw_setrfreg_cmd(Adapter,
|
||||
*(unsigned char*)poid_par_priv->information_buf,
|
||||
(unsigned long)(*((unsigned long*)poid_par_priv->information_buf+2))))
|
||||
{
|
||||
|
@ -907,16 +907,16 @@ NDIS_STATUS oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv* poid_par_priv)
|
|||
_func_enter_;
|
||||
|
||||
//DEBUG_ERR(("<**********************oid_rt_pro_rf_read_registry_hdl \n"));
|
||||
if(poid_par_priv->type_of_oid != SET_OID) //QUERY_OID
|
||||
if (poid_par_priv->type_of_oid != SET_OID) //QUERY_OID
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
}
|
||||
|
||||
_irqlevel_changed_(&oldirql,LOWER);
|
||||
if(poid_par_priv->information_buf_len== (sizeof(unsigned long)*3))
|
||||
if (poid_par_priv->information_buf_len== (sizeof(unsigned long)*3))
|
||||
{
|
||||
if(Adapter->mppriv.act_in_progress == _TRUE)
|
||||
if (Adapter->mppriv.act_in_progress == _TRUE)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
}
|
||||
|
@ -935,7 +935,7 @@ NDIS_STATUS oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv* poid_par_priv)
|
|||
//RegOffsetValue = *((unsigned long*)InformationBuffer);
|
||||
//RegDataWidth = *((unsigned long*)InformationBuffer+1);
|
||||
//RegDataValue = *((unsigned long*)InformationBuffer+2);
|
||||
if(!rtw_getrfreg_cmd(Adapter,
|
||||
if (!rtw_getrfreg_cmd(Adapter,
|
||||
*(unsigned char*)poid_par_priv->information_buf,
|
||||
(unsigned char*)&Adapter->mppriv.workparam.io_value))
|
||||
{
|
||||
|
@ -974,7 +974,7 @@ NDIS_STATUS oid_rt_get_connect_state_hdl(struct oid_par_priv* poid_par_priv)
|
|||
|
||||
ULONG ulInfo;
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
if (poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
@ -985,11 +985,11 @@ NDIS_STATUS oid_rt_get_connect_state_hdl(struct oid_par_priv* poid_par_priv)
|
|||
// nStatus==2 AdHocMode
|
||||
// nStatus==3 NotAssociated
|
||||
|
||||
if(check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == _TRUE)
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == _TRUE)
|
||||
ulInfo = CHECKINGSTATUS;
|
||||
else if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
|
||||
else if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
|
||||
ulInfo = ASSOCIATED;
|
||||
else if(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)== _TRUE)
|
||||
else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)== _TRUE)
|
||||
ulInfo = ADHOCMODE;
|
||||
else
|
||||
ulInfo = NOTASSOCIATED ;
|
||||
|
@ -1000,11 +1000,11 @@ NDIS_STATUS oid_rt_get_connect_state_hdl(struct oid_par_priv* poid_par_priv)
|
|||
#if 0
|
||||
// Rearrange the order to let the UI still shows connection when scan is in progress
|
||||
RT_TRACE(COMP_OID_QUERY, DBG_LOUD, ("===> Query OID_RT_GET_CONNECT_STATE.\n"));
|
||||
if(pMgntInfo->mAssoc)
|
||||
if (pMgntInfo->mAssoc)
|
||||
ulInfo = 1;
|
||||
else if(pMgntInfo->mIbss)
|
||||
else if (pMgntInfo->mIbss)
|
||||
ulInfo = 2;
|
||||
else if(pMgntInfo->bScanInProgress)
|
||||
else if (pMgntInfo->bScanInProgress)
|
||||
ulInfo = 0;
|
||||
else
|
||||
ulInfo = 3;
|
||||
|
@ -1020,7 +1020,7 @@ NDIS_STATUS oid_rt_set_default_key_id_hdl(struct oid_par_priv* poid_par_priv)
|
|||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
if (poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
return status;
|
||||
|
|
|
@ -60,10 +60,10 @@ _func_enter_;
|
|||
goto exit;
|
||||
}
|
||||
|
||||
for(i = 0; i < ssid->SsidLength; i++)
|
||||
for (i = 0; i < ssid->SsidLength; i++)
|
||||
{
|
||||
//wifi, printable ascii code must be supported
|
||||
if(!( (ssid->Ssid[i] >= 0x20) && (ssid->Ssid[i] <= 0x7e) )){
|
||||
if (!( (ssid->Ssid[i] >= 0x20) && (ssid->Ssid[i] <= 0x7e) )){
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("ssid has nonprintabl ascii\n"));
|
||||
ret= _FALSE;
|
||||
break;
|
||||
|
@ -103,7 +103,7 @@ _func_enter_;
|
|||
|
||||
pmlmepriv->to_join = _TRUE;
|
||||
|
||||
if(_rtw_queue_empty(queue)== _TRUE)
|
||||
if (_rtw_queue_empty(queue)== _TRUE)
|
||||
{
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
|
||||
|
@ -111,7 +111,7 @@ _func_enter_;
|
|||
//when set_ssid/set_bssid for rtw_do_join(), but scanning queue is empty
|
||||
//we try to issue sitesurvey firstly
|
||||
|
||||
if(pmlmepriv->LinkDetectInfo.bBusyTraffic==_FALSE
|
||||
if (pmlmepriv->LinkDetectInfo.bBusyTraffic==_FALSE
|
||||
#ifdef CONFIG_LAYER2_ROAMING
|
||||
|| pmlmepriv->to_roaming >0
|
||||
#endif
|
||||
|
@ -119,7 +119,7 @@ _func_enter_;
|
|||
{
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_do_join(): site survey if scanned_queue is empty\n."));
|
||||
// submit site_survey_cmd
|
||||
if(_SUCCESS!=(ret=rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)) ) {
|
||||
if (_SUCCESS!=(ret=rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)) ) {
|
||||
pmlmepriv->to_join = _FALSE;
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_do_join(): site survey return error\n."));
|
||||
}
|
||||
|
@ -136,14 +136,14 @@ _func_enter_;
|
|||
{
|
||||
int select_ret;
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
if((select_ret=rtw_select_and_join_from_scanned_queue(pmlmepriv))==_SUCCESS)
|
||||
if ((select_ret=rtw_select_and_join_from_scanned_queue(pmlmepriv))==_SUCCESS)
|
||||
{
|
||||
pmlmepriv->to_join = _FALSE;
|
||||
_set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)==_TRUE)
|
||||
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)==_TRUE)
|
||||
{
|
||||
// submit createbss_cmd to change to a ADHOC_MASTER
|
||||
|
||||
|
@ -161,7 +161,7 @@ _func_enter_;
|
|||
|
||||
rtw_generate_random_ibss(pibss);
|
||||
|
||||
if(rtw_createbss_cmd(padapter)!=_SUCCESS)
|
||||
if (rtw_createbss_cmd(padapter)!=_SUCCESS)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("***Error=>do_goin: rtw_createbss_cmd status FAIL*** \n "));
|
||||
ret = _FALSE;
|
||||
|
@ -179,14 +179,14 @@ _func_enter_;
|
|||
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
|
||||
|
||||
#if 0
|
||||
if((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE))
|
||||
if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE))
|
||||
{
|
||||
if(_rtw_memcmp(pmlmepriv->cur_network.network.Ssid.Ssid, pmlmepriv->assoc_ssid.Ssid, pmlmepriv->assoc_ssid.SsidLength))
|
||||
if (_rtw_memcmp(pmlmepriv->cur_network.network.Ssid.Ssid, pmlmepriv->assoc_ssid.Ssid, pmlmepriv->assoc_ssid.SsidLength))
|
||||
{
|
||||
// for funk to do roaming
|
||||
// funk will reconnect, but funk will not sitesurvey before reconnect
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("for funk to do roaming"));
|
||||
if(pmlmepriv->sitesurveyctrl.traffic_busy==_FALSE)
|
||||
if (pmlmepriv->sitesurveyctrl.traffic_busy==_FALSE)
|
||||
rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0);
|
||||
}
|
||||
|
||||
|
@ -195,14 +195,14 @@ _func_enter_;
|
|||
|
||||
//when set_ssid/set_bssid for rtw_do_join(), but there are no desired bss in scanning queue
|
||||
//we try to issue sitesurvey firstly
|
||||
if(pmlmepriv->LinkDetectInfo.bBusyTraffic==_FALSE
|
||||
if (pmlmepriv->LinkDetectInfo.bBusyTraffic==_FALSE
|
||||
#ifdef CONFIG_LAYER2_ROAMING
|
||||
|| pmlmepriv->to_roaming >0
|
||||
#endif
|
||||
)
|
||||
{
|
||||
//DBG_871X("rtw_do_join() when no desired bss in scanning queue \n");
|
||||
if( _SUCCESS!=(ret=rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)) ){
|
||||
if ( _SUCCESS!=(ret=rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)) ){
|
||||
pmlmepriv->to_join = _FALSE;
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("do_join(): site survey return error\n."));
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ u8 rtw_set_802_11_reload_defaults(_adapter * padapter, NDIS_802_11_RELOAD_DEFAUL
|
|||
{
|
||||
_func_enter_;
|
||||
|
||||
switch( reloadDefaults)
|
||||
switch ( reloadDefaults)
|
||||
{
|
||||
case Ndis802_11ReloadWEPKeys:
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("SetInfo OID_802_11_RELOAD_DEFAULTS : Ndis802_11ReloadWEPKeys\n"));
|
||||
|
@ -290,7 +290,7 @@ u8 set_802_11_test(_adapter* padapter, NDIS_802_11_TEST *test)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
switch(test->Type)
|
||||
switch (test->Type)
|
||||
{
|
||||
case 1:
|
||||
NdisMIndicateStatus(padapter->hndis_adapter, NDIS_STATUS_MEDIA_SPECIFIC_INDICATION, (PVOID)&test->AuthenticationEvent, test->Length - 8);
|
||||
|
@ -384,7 +384,7 @@ handle_tkip_countermeasure:
|
|||
if (padapter->securitypriv.btkip_countermeasure == _TRUE) {
|
||||
cur_time = rtw_get_current_time();
|
||||
|
||||
if( (cur_time - padapter->securitypriv.btkip_countermeasure_time) > 60 * HZ )
|
||||
if ( (cur_time - padapter->securitypriv.btkip_countermeasure_time) > 60 * HZ )
|
||||
{
|
||||
padapter->securitypriv.btkip_countermeasure = _FALSE;
|
||||
padapter->securitypriv.btkip_countermeasure_time = 0;
|
||||
|
@ -433,7 +433,7 @@ _func_enter_;
|
|||
DBG_871X_LEVEL(_drv_always_, "set ssid [%s] fw_state=0x%08x\n",
|
||||
ssid->Ssid, get_fwstate(pmlmepriv));
|
||||
|
||||
if(padapter->hw_init_completed==_FALSE){
|
||||
if (padapter->hw_init_completed==_FALSE){
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
|
||||
("set_ssid: hw_init_completed==_FALSE=>exit!!!\n"));
|
||||
status = _FAIL;
|
||||
|
@ -457,13 +457,13 @@ _func_enter_;
|
|||
if ((pmlmepriv->assoc_ssid.SsidLength == ssid->SsidLength) &&
|
||||
(_rtw_memcmp(&pmlmepriv->assoc_ssid.Ssid, ssid->Ssid, ssid->SsidLength) == _TRUE))
|
||||
{
|
||||
if((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _FALSE))
|
||||
if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _FALSE))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
|
||||
("Set SSID is the same ssid, fw_state=0x%08x\n",
|
||||
get_fwstate(pmlmepriv)));
|
||||
|
||||
if(rtw_is_same_ibss(padapter, pnetwork) == _FALSE)
|
||||
if (rtw_is_same_ibss(padapter, pnetwork) == _FALSE)
|
||||
{
|
||||
//if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again
|
||||
rtw_disassoc_cmd(padapter, 0, _TRUE);
|
||||
|
@ -541,7 +541,7 @@ handle_tkip_countermeasure:
|
|||
if (padapter->securitypriv.btkip_countermeasure == _TRUE) {
|
||||
cur_time = rtw_get_current_time();
|
||||
|
||||
if( (cur_time - padapter->securitypriv.btkip_countermeasure_time) > 60 * HZ )
|
||||
if ( (cur_time - padapter->securitypriv.btkip_countermeasure_time) > 60 * HZ )
|
||||
{
|
||||
padapter->securitypriv.btkip_countermeasure = _FALSE;
|
||||
padapter->securitypriv.btkip_countermeasure_time = 0;
|
||||
|
@ -598,14 +598,14 @@ _func_enter_;
|
|||
("+rtw_set_802_11_infrastructure_mode: old=%d new=%d fw_state=0x%08x\n",
|
||||
*pold_state, networktype, get_fwstate(pmlmepriv)));
|
||||
|
||||
if(*pold_state != networktype)
|
||||
if (*pold_state != networktype)
|
||||
{
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,(" change mode!"));
|
||||
//DBG_871X("change mode, old_mode=%d, new_mode=%d, fw_state=0x%x\n", *pold_state, networktype, get_fwstate(pmlmepriv));
|
||||
|
||||
if(*pold_state==Ndis802_11APMode)
|
||||
if (*pold_state==Ndis802_11APMode)
|
||||
{
|
||||
//change to other mode from Ndis802_11APMode
|
||||
cur_network->join_res = -1;
|
||||
|
@ -615,16 +615,16 @@ _func_enter_;
|
|||
#endif
|
||||
}
|
||||
|
||||
if((check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE) ||(*pold_state==Ndis802_11IBSS))
|
||||
if ((check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE) ||(*pold_state==Ndis802_11IBSS))
|
||||
rtw_disassoc_cmd(padapter, 0, _TRUE);
|
||||
|
||||
if((check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE) ||
|
||||
if ((check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE) ||
|
||||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)== _TRUE) )
|
||||
rtw_free_assoc_resources(padapter, 1);
|
||||
|
||||
if((*pold_state == Ndis802_11Infrastructure) ||(*pold_state == Ndis802_11IBSS))
|
||||
if ((*pold_state == Ndis802_11Infrastructure) ||(*pold_state == Ndis802_11IBSS))
|
||||
{
|
||||
if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
|
||||
{
|
||||
rtw_indicate_disconnect(padapter); //will clr Linked_state; before this function, we must have chked whether issue dis-assoc_cmd or not
|
||||
}
|
||||
|
@ -634,7 +634,7 @@ _func_enter_;
|
|||
|
||||
_clr_fwstate_(pmlmepriv, ~WIFI_NULL_STATE);
|
||||
|
||||
switch(networktype)
|
||||
switch (networktype)
|
||||
{
|
||||
case Ndis802_11IBSS:
|
||||
set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
|
||||
|
@ -725,7 +725,7 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_set_802_11_bssid_list_scan fail since fw_state = %x\n", get_fwstate(pmlmepriv)));
|
||||
res = _TRUE;
|
||||
|
||||
if(check_fwstate(pmlmepriv, (_FW_UNDER_SURVEY|_FW_UNDER_LINKING))== _TRUE){
|
||||
if (check_fwstate(pmlmepriv, (_FW_UNDER_SURVEY|_FW_UNDER_LINKING))== _TRUE){
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n###_FW_UNDER_SURVEY|_FW_UNDER_LINKING\n\n"));
|
||||
} else {
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n###pmlmepriv->sitesurveyctrl.traffic_busy==_TRUE\n\n"));
|
||||
|
@ -764,17 +764,17 @@ _func_enter_;
|
|||
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("rtw_set_802_11_authentication_mode:psecuritypriv->ndisauthtype=%d", psecuritypriv->ndisauthtype));
|
||||
|
||||
if(psecuritypriv->ndisauthtype>3)
|
||||
if (psecuritypriv->ndisauthtype>3)
|
||||
psecuritypriv->dot11AuthAlgrthm=dot11AuthAlgrthm_8021X;
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
if(psecuritypriv->ndisauthtype == 6)
|
||||
if (psecuritypriv->ndisauthtype == 6)
|
||||
psecuritypriv->dot11AuthAlgrthm=dot11AuthAlgrthm_WAPI;
|
||||
#endif
|
||||
|
||||
res=rtw_set_auth(padapter,psecuritypriv);
|
||||
|
||||
if(res==_SUCCESS)
|
||||
if (res==_SUCCESS)
|
||||
ret=_TRUE;
|
||||
else
|
||||
ret=_FALSE;
|
||||
|
@ -798,14 +798,14 @@ _func_enter_;
|
|||
btransmitkey= (wep->KeyIndex & 0x80000000) > 0 ? _TRUE : _FALSE; //for ???
|
||||
keyid=wep->KeyIndex & 0x3fffffff;
|
||||
|
||||
if(keyid>4)
|
||||
if (keyid>4)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("MgntActrtw_set_802_11_add_wep:keyid>4=>fail\n"));
|
||||
ret=_FALSE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
switch(wep->KeyLength)
|
||||
switch (wep->KeyLength)
|
||||
{
|
||||
case 5:
|
||||
psecuritypriv->dot11PrivacyAlgrthm=_WEP40_;
|
||||
|
@ -838,7 +838,7 @@ _func_enter_;
|
|||
|
||||
res=rtw_set_key(padapter,psecuritypriv, keyid, 1);
|
||||
|
||||
if(res==_FAIL)
|
||||
if (res==_FAIL)
|
||||
ret= _FALSE;
|
||||
exit:
|
||||
|
||||
|
@ -864,7 +864,7 @@ _func_enter_;
|
|||
{
|
||||
int res;
|
||||
struct security_priv* psecuritypriv=&(padapter->securitypriv);
|
||||
if( keyindex < 4 ){
|
||||
if ( keyindex < 4 ){
|
||||
|
||||
_rtw_memset(&psecuritypriv->dot11DefKey[keyindex], 0, 16);
|
||||
|
||||
|
@ -872,7 +872,7 @@ _func_enter_;
|
|||
|
||||
psecuritypriv->dot11DefKeylen[keyindex]=0;
|
||||
|
||||
if(res==_FAIL)
|
||||
if (res==_FAIL)
|
||||
ret=_FAIL;
|
||||
|
||||
}
|
||||
|
@ -913,7 +913,7 @@ _func_enter_;
|
|||
goto exit;
|
||||
}
|
||||
|
||||
if(key->KeyIndex & 0x40000000)
|
||||
if (key->KeyIndex & 0x40000000)
|
||||
{
|
||||
// Pairwise key
|
||||
|
||||
|
@ -922,7 +922,7 @@ _func_enter_;
|
|||
pbssid=get_bssid(&padapter->mlmepriv);
|
||||
stainfo=rtw_get_stainfo(&padapter->stapriv, pbssid);
|
||||
|
||||
if((stainfo!=NULL)&&(padapter->securitypriv.dot11AuthAlgrthm==dot11AuthAlgrthm_8021X)){
|
||||
if ((stainfo!=NULL)&&(padapter->securitypriv.dot11AuthAlgrthm==dot11AuthAlgrthm_8021X)){
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY:( stainfo!=NULL)&&(Adapter->securitypriv.dot11AuthAlgrthm==dot11AuthAlgrthm_8021X)\n"));
|
||||
encryptionalgo=stainfo->dot118021XPrivacy;
|
||||
}
|
||||
|
@ -935,11 +935,11 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_set_802_11_add_key: (Adapter->securitypriv.dot11PrivacyAlgrthm ==%d)!\n",padapter->securitypriv.dot11PrivacyAlgrthm));
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_set_802_11_add_key: (Adapter->securitypriv.dot11AuthAlgrthm ==%d)!\n",padapter->securitypriv.dot11AuthAlgrthm));
|
||||
|
||||
if((stainfo!=NULL)){
|
||||
if ((stainfo!=NULL)){
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("rtw_set_802_11_add_key: (stainfo->dot118021XPrivacy ==%d)!\n", stainfo->dot118021XPrivacy));
|
||||
}
|
||||
|
||||
if(key->KeyIndex & 0x000000FF){
|
||||
if (key->KeyIndex & 0x000000FF){
|
||||
// The key index is specified in the lower 8 bits by values of zero to 255.
|
||||
// The key index should be set to zero for a Pairwise key, and the driver should fail with
|
||||
// NDIS_STATUS_INVALID_DATA if the lower 8 bits is not zero
|
||||
|
@ -957,8 +957,8 @@ _func_enter_;
|
|||
}
|
||||
|
||||
// Check key length for TKIP.
|
||||
//if(encryptionAlgorithm == RT_ENC_TKIP_ENCRYPTION && key->KeyLength != 32)
|
||||
if((encryptionalgo== _TKIP_)&& (key->KeyLength != 32)){
|
||||
//if (encryptionAlgorithm == RT_ENC_TKIP_ENCRYPTION && key->KeyLength != 32)
|
||||
if ((encryptionalgo== _TKIP_)&& (key->KeyLength != 32)){
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("TKIP KeyLength:0x%x != 32\n", key->KeyLength));
|
||||
ret=_FAIL;
|
||||
goto exit;
|
||||
|
@ -966,9 +966,9 @@ _func_enter_;
|
|||
}
|
||||
|
||||
// Check key length for AES.
|
||||
if((encryptionalgo== _AES_)&& (key->KeyLength != 16)) {
|
||||
if ((encryptionalgo== _AES_)&& (key->KeyLength != 16)) {
|
||||
// For our supplicant, EAPPkt9x.vxd, cannot differentiate TKIP and AES case.
|
||||
if(key->KeyLength == 32) {
|
||||
if (key->KeyLength == 32) {
|
||||
key->KeyLength = 16;
|
||||
} else {
|
||||
ret= _FAIL;
|
||||
|
@ -977,7 +977,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
// Check key length for WEP. For NDTEST, 2005.01.27, by rcnjko.
|
||||
if( (encryptionalgo== _WEP40_|| encryptionalgo== _WEP104_) && (key->KeyLength != 5 || key->KeyLength != 13)) {
|
||||
if ( (encryptionalgo== _WEP40_|| encryptionalgo== _WEP104_) && (key->KeyLength != 5 || key->KeyLength != 13)) {
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("WEP KeyLength:0x%x != 5 or 13\n", key->KeyLength));
|
||||
ret=_FAIL;
|
||||
goto exit;
|
||||
|
@ -1001,11 +1001,11 @@ _func_enter_;
|
|||
|
||||
|
||||
// when add wep key through add key and didn't assigned encryption type before
|
||||
if((padapter->securitypriv.ndisauthtype<=3)&&(padapter->securitypriv.dot118021XGrpPrivacy==0))
|
||||
if ((padapter->securitypriv.ndisauthtype<=3)&&(padapter->securitypriv.dot118021XGrpPrivacy==0))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("keylen=%d( Adapter->securitypriv.dot11PrivacyAlgrthm=%x )padapter->securitypriv.dot118021XGrpPrivacy(%x)\n", key->KeyLength,padapter->securitypriv.dot11PrivacyAlgrthm,padapter->securitypriv.dot118021XGrpPrivacy));
|
||||
|
||||
switch(key->KeyLength)
|
||||
switch (key->KeyLength)
|
||||
{
|
||||
case 5:
|
||||
padapter->securitypriv.dot11PrivacyAlgrthm=_WEP40_;
|
||||
|
@ -1033,20 +1033,20 @@ _func_enter_;
|
|||
|
||||
}
|
||||
|
||||
if((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE)==_TRUE) && (IS_MAC_ADDRESS_BROADCAST(key->BSSID) == _FALSE)) {
|
||||
if ((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE)==_TRUE) && (IS_MAC_ADDRESS_BROADCAST(key->BSSID) == _FALSE)) {
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,(" IBSS but BSSID is not Broadcast Address.\n"));
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
// Check key length for TKIP
|
||||
if((encryptionalgo== _TKIP_) && (key->KeyLength != 32)) {
|
||||
if ((encryptionalgo== _TKIP_) && (key->KeyLength != 32)) {
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,(" TKIP GTK KeyLength:%u != 32\n", key->KeyLength));
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
|
||||
} else if(encryptionalgo== _AES_ && (key->KeyLength != 16 && key->KeyLength != 32) ) {
|
||||
} else if (encryptionalgo== _AES_ && (key->KeyLength != 16 && key->KeyLength != 32) ) {
|
||||
|
||||
// Check key length for AES
|
||||
// For NDTEST, we allow keylen=32 in this case. 2005.01.27, by rcnjko.
|
||||
|
@ -1056,16 +1056,16 @@ _func_enter_;
|
|||
}
|
||||
|
||||
// Change the key length for EAPPkt9x.vxd. Added by Annie, 2005-11-03.
|
||||
if((encryptionalgo== _AES_) && (key->KeyLength == 32) ) {
|
||||
if ((encryptionalgo== _AES_) && (key->KeyLength == 32) ) {
|
||||
key->KeyLength = 16;
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("AES key length changed: %u\n", key->KeyLength) );
|
||||
}
|
||||
|
||||
if(key->KeyIndex & 0x8000000) {//error ??? 0x8000_0000
|
||||
if (key->KeyIndex & 0x8000000) {//error ??? 0x8000_0000
|
||||
bgrouptkey = _TRUE;
|
||||
}
|
||||
|
||||
if((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE)==_TRUE)&&(check_fwstate(&padapter->mlmepriv, _FW_LINKED)==_TRUE))
|
||||
if ((check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE)==_TRUE)&&(check_fwstate(&padapter->mlmepriv, _FW_LINKED)==_TRUE))
|
||||
{
|
||||
bgrouptkey = _TRUE;
|
||||
}
|
||||
|
@ -1082,7 +1082,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
// If WEP encryption algorithm, just call rtw_set_802_11_add_wep().
|
||||
if((padapter->securitypriv.dot11AuthAlgrthm !=dot11AuthAlgrthm_8021X)&&(encryptionalgo== _WEP40_ || encryptionalgo== _WEP104_))
|
||||
if ((padapter->securitypriv.dot11AuthAlgrthm !=dot11AuthAlgrthm_8021X)&&(encryptionalgo== _WEP40_ || encryptionalgo== _WEP104_))
|
||||
{
|
||||
u8 ret;
|
||||
u32 keyindex;
|
||||
|
@ -1110,10 +1110,10 @@ _func_enter_;
|
|||
|
||||
}
|
||||
|
||||
if(key->KeyIndex & 0x20000000){
|
||||
if (key->KeyIndex & 0x20000000){
|
||||
// SetRSC
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("OID_802_11_ADD_KEY: +++++ SetRSC+++++\n"));
|
||||
if(bgroup == _TRUE)
|
||||
if (bgroup == _TRUE)
|
||||
{
|
||||
NDIS_802_11_KEY_RSC keysrc=key->KeyRSC & 0x00FFFFFFFFFFFFULL;
|
||||
_rtw_memcpy(&padapter->securitypriv.dot11Grprxpn, &keysrc, 8);
|
||||
|
@ -1128,16 +1128,16 @@ _func_enter_;
|
|||
|
||||
// Indicate this key idx is used for TX
|
||||
// Save the key in KeyMaterial
|
||||
if(bgroup == _TRUE) // Group transmit key
|
||||
if (bgroup == _TRUE) // Group transmit key
|
||||
{
|
||||
int res;
|
||||
|
||||
if(bgrouptkey == _TRUE)
|
||||
if (bgrouptkey == _TRUE)
|
||||
{
|
||||
padapter->securitypriv.dot118021XGrpKeyid=(u8)key->KeyIndex;
|
||||
}
|
||||
|
||||
if((key->KeyIndex&0x3) == 0){
|
||||
if ((key->KeyIndex&0x3) == 0){
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
@ -1146,7 +1146,7 @@ _func_enter_;
|
|||
_rtw_memset(&padapter->securitypriv.dot118021XGrptxmickey[(u8)((key->KeyIndex) & 0x03)], 0, 16);
|
||||
_rtw_memset(&padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)], 0, 16);
|
||||
|
||||
if((key->KeyIndex & 0x10000000))
|
||||
if ((key->KeyIndex & 0x10000000))
|
||||
{
|
||||
_rtw_memcpy(&padapter->securitypriv.dot118021XGrptxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 16, 8);
|
||||
_rtw_memcpy(&padapter->securitypriv.dot118021XGrprxmickey[(u8)((key->KeyIndex) & 0x03)], key->KeyMaterial + 24, 8);
|
||||
|
@ -1186,7 +1186,7 @@ _func_enter_;
|
|||
|
||||
res=rtw_set_key(padapter,&padapter->securitypriv, key->KeyIndex, 1);
|
||||
|
||||
if(res==_FAIL)
|
||||
if (res==_FAIL)
|
||||
ret= _FAIL;
|
||||
|
||||
goto exit;
|
||||
|
@ -1199,13 +1199,13 @@ _func_enter_;
|
|||
pbssid=get_bssid(&padapter->mlmepriv);
|
||||
stainfo=rtw_get_stainfo(&padapter->stapriv , pbssid );
|
||||
|
||||
if(stainfo!=NULL)
|
||||
if (stainfo!=NULL)
|
||||
{
|
||||
_rtw_memset( &stainfo->dot118021x_UncstKey, 0, 16);// clear keybuffer
|
||||
|
||||
_rtw_memcpy(&stainfo->dot118021x_UncstKey, key->KeyMaterial, 16);
|
||||
|
||||
if(encryptionalgo== _TKIP_)
|
||||
if (encryptionalgo== _TKIP_)
|
||||
{
|
||||
padapter->securitypriv.busetkipkey=_FALSE;
|
||||
|
||||
|
@ -1214,7 +1214,7 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n ==========_set_timer\n"));
|
||||
|
||||
// if TKIP, save the Receive/Transmit MIC key in KeyMaterial[128-255]
|
||||
if((key->KeyIndex & 0x10000000)){
|
||||
if ((key->KeyIndex & 0x10000000)){
|
||||
_rtw_memcpy(&stainfo->dot11tkiptxmickey, key->KeyMaterial + 16, 8);
|
||||
_rtw_memcpy(&stainfo->dot11tkiprxmickey, key->KeyMaterial + 24, 8);
|
||||
|
||||
|
@ -1225,14 +1225,14 @@ _func_enter_;
|
|||
}
|
||||
|
||||
}
|
||||
else if(encryptionalgo == _AES_)
|
||||
else if (encryptionalgo == _AES_)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
//Set key to CAM through H2C command
|
||||
if(bgrouptkey)//never go to here
|
||||
if (bgrouptkey)//never go to here
|
||||
{
|
||||
res=rtw_setstakey_cmd(padapter, (unsigned char *)stainfo, _FALSE);
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(group)\n"));
|
||||
|
@ -1242,7 +1242,7 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(unicast)\n"));
|
||||
}
|
||||
|
||||
if(res ==_FALSE)
|
||||
if (res ==_FALSE)
|
||||
ret= _FAIL;
|
||||
|
||||
}
|
||||
|
@ -1286,7 +1286,7 @@ _func_enter_;
|
|||
|
||||
pbssid=get_bssid(&padapter->mlmepriv);
|
||||
stainfo=rtw_get_stainfo(&padapter->stapriv , pbssid );
|
||||
if(stainfo !=NULL){
|
||||
if (stainfo !=NULL){
|
||||
encryptionalgo=stainfo->dot118021XPrivacy;
|
||||
|
||||
// clear key by BSSID
|
||||
|
@ -1341,14 +1341,14 @@ u16 rtw_get_cur_max_rate(_adapter *adapter)
|
|||
}
|
||||
#endif
|
||||
|
||||
if((check_fwstate(pmlmepriv, _FW_LINKED) != _TRUE)
|
||||
if ((check_fwstate(pmlmepriv, _FW_LINKED) != _TRUE)
|
||||
&& (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) != _TRUE))
|
||||
return 0;
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
if (pmlmeext->cur_wireless_mode & (WIRELESS_11_24N|WIRELESS_11_5N)) {
|
||||
p = rtw_get_ie(&pcur_bss->IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pcur_bss->IELength-12);
|
||||
if(p && ht_ielen>0)
|
||||
if (p && ht_ielen>0)
|
||||
{
|
||||
pht_capie = (struct rtw_ieee80211_ht_cap *)(p+2);
|
||||
|
||||
|
@ -1375,10 +1375,10 @@ u16 rtw_get_cur_max_rate(_adapter *adapter)
|
|||
else
|
||||
#endif //CONFIG_80211N_HT
|
||||
{
|
||||
while( (pcur_bss->SupportedRates[i]!=0) && (pcur_bss->SupportedRates[i]!=0xFF))
|
||||
while ( (pcur_bss->SupportedRates[i]!=0) && (pcur_bss->SupportedRates[i]!=0xFF))
|
||||
{
|
||||
rate = pcur_bss->SupportedRates[i]&0x7F;
|
||||
if(rate>max_rate)
|
||||
if (rate>max_rate)
|
||||
max_rate = rate;
|
||||
i++;
|
||||
}
|
||||
|
@ -1398,7 +1398,7 @@ u16 rtw_get_cur_max_rate(_adapter *adapter)
|
|||
*/
|
||||
int rtw_set_scan_mode(_adapter *adapter, RT_SCAN_TYPE scan_mode)
|
||||
{
|
||||
if(scan_mode != SCAN_ACTIVE && scan_mode != SCAN_PASSIVE)
|
||||
if (scan_mode != SCAN_ACTIVE && scan_mode != SCAN_PASSIVE)
|
||||
return _FAIL;
|
||||
|
||||
adapter->mlmepriv.scan_mode = scan_mode;
|
||||
|
@ -1437,13 +1437,13 @@ int rtw_set_country(_adapter *adapter, const char *country_code)
|
|||
|
||||
//TODO: should have a table to match country code and RT_CHANNEL_DOMAIN
|
||||
//TODO: should consider 2-character and 3-character country code
|
||||
if(0 == strcmp(country_code, "US"))
|
||||
if (0 == strcmp(country_code, "US"))
|
||||
channel_plan = RT_CHANNEL_DOMAIN_FCC;
|
||||
else if(0 == strcmp(country_code, "EU"))
|
||||
else if (0 == strcmp(country_code, "EU"))
|
||||
channel_plan = RT_CHANNEL_DOMAIN_ETSI;
|
||||
else if(0 == strcmp(country_code, "JP"))
|
||||
else if (0 == strcmp(country_code, "JP"))
|
||||
channel_plan = RT_CHANNEL_DOMAIN_MKK;
|
||||
else if(0 == strcmp(country_code, "CN"))
|
||||
else if (0 == strcmp(country_code, "CN"))
|
||||
channel_plan = RT_CHANNEL_DOMAIN_CHINA;
|
||||
else
|
||||
DBG_871X("%s unknown country_code:%s\n", __FUNCTION__, country_code);
|
||||
|
|
|
@ -82,7 +82,7 @@ int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds, u32 cmd_len
|
|||
ori_len = buf_offset+pattrib->pktlen;
|
||||
|
||||
//check if the io_buf can accommodate new cmds
|
||||
if(ori_len + cmd_len + 8 > MAX_XMITBUF_SZ) {
|
||||
if (ori_len + cmd_len + 8 > MAX_XMITBUF_SZ) {
|
||||
DBG_871X("%s %u is large than MAX_XMITBUF_SZ:%u, can't accommodate new cmds\n", __FUNCTION__
|
||||
, ori_len + cmd_len + 8, MAX_XMITBUF_SZ);
|
||||
return _FAIL;
|
||||
|
@ -98,11 +98,11 @@ int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds, u32 cmd_len
|
|||
}
|
||||
bool rtw_IOL_applied(ADAPTER *adapter)
|
||||
{
|
||||
if(1 == adapter->registrypriv.fw_iol)
|
||||
if (1 == adapter->registrypriv.fw_iol)
|
||||
return _TRUE;
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
if((2 == adapter->registrypriv.fw_iol) && (!adapter_to_dvobj(adapter)->ishighspeed))
|
||||
if ((2 == adapter->registrypriv.fw_iol) && (!adapter_to_dvobj(adapter)->ishighspeed))
|
||||
return _TRUE;
|
||||
#endif
|
||||
|
||||
|
@ -111,11 +111,11 @@ bool rtw_IOL_applied(ADAPTER *adapter)
|
|||
/*
|
||||
bool rtw_IOL_applied(ADAPTER *adapter)
|
||||
{
|
||||
if(adapter->registrypriv.fw_iol)
|
||||
if (adapter->registrypriv.fw_iol)
|
||||
return _TRUE;
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
if(!adapter_to_dvobj(adapter)->ishighspeed)
|
||||
if (!adapter_to_dvobj(adapter)->ishighspeed)
|
||||
return _TRUE;
|
||||
#endif
|
||||
|
||||
|
@ -142,7 +142,7 @@ int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, u8
|
|||
cmd.address = cpu_to_le16(addr);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
if(mask!=0xFF)
|
||||
if (mask!=0xFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
|
@ -163,7 +163,7 @@ int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, u
|
|||
cmd.address = cpu_to_le16(addr);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
if(mask!=0xFFFF)
|
||||
if (mask!=0xFFFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
|
@ -184,7 +184,7 @@ int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, u
|
|||
cmd.address = cpu_to_le16(addr);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
if(mask!=0xFFFFFFFF)
|
||||
if (mask!=0xFFFFFFFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
|
@ -206,7 +206,7 @@ int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr,
|
|||
cmd.address = (rf_path<<8) |((addr) &0xFF);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
if(mask!=0x000FFFFF)
|
||||
if (mask!=0x000FFFFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
|
@ -251,7 +251,7 @@ int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame)
|
|||
u8 rtw_IOL_cmd_boundary_handle(struct xmit_frame *pxmit_frame)
|
||||
{
|
||||
u8 is_cmd_bndy = _FALSE;
|
||||
if(((pxmit_frame->attrib.pktlen+32)%256) + 8 >= 256){
|
||||
if (((pxmit_frame->attrib.pktlen+32)%256) + 8 >= 256){
|
||||
rtw_IOL_append_END_cmd(pxmit_frame);
|
||||
pxmit_frame->attrib.pktlen = ((((pxmit_frame->attrib.pktlen+32)/256)+1)*256 );
|
||||
|
||||
|
@ -268,10 +268,10 @@ void rtw_IOL_cmd_buf_dump(ADAPTER *Adapter,int buf_len,u8 *pbuf)
|
|||
int j=1;
|
||||
|
||||
printk("###### %s ######\n",__FUNCTION__);
|
||||
for(i=0;i< buf_len;i++){
|
||||
for (i=0;i< buf_len;i++){
|
||||
printk("%02x-",*(pbuf+i));
|
||||
|
||||
if(j%32 ==0) printk("\n");j++;
|
||||
if (j%32 ==0) printk("\n");j++;
|
||||
}
|
||||
printk("\n");
|
||||
printk("============= ioreg_cmd len = %d =============== \n",buf_len);
|
||||
|
@ -380,10 +380,10 @@ int rtw_IOL_exec_cmd_array_sync(PADAPTER adapter, u8 *IOL_cmds, u32 cmd_num, u32
|
|||
{
|
||||
struct xmit_frame *xmit_frame;
|
||||
|
||||
if((xmit_frame=rtw_IOL_accquire_xmit_frame(adapter)) == NULL)
|
||||
if ((xmit_frame=rtw_IOL_accquire_xmit_frame(adapter)) == NULL)
|
||||
return _FAIL;
|
||||
|
||||
if(rtw_IOL_append_cmds(xmit_frame, IOL_cmds, cmd_num<<3) == _FAIL)
|
||||
if (rtw_IOL_append_cmds(xmit_frame, IOL_cmds, cmd_num<<3) == _FAIL)
|
||||
return _FAIL;
|
||||
|
||||
return rtw_IOL_exec_cmds_sync(adapter, xmit_frame, max_wating_ms,0);
|
||||
|
|
582
core/rtw_led.c
582
core/rtw_led.c
File diff suppressed because it is too large
Load diff
436
core/rtw_mlme.c
436
core/rtw_mlme.c
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -50,7 +50,7 @@ u32 read_macreg(_adapter *padapter, u32 addr, u32 sz)
|
|||
{
|
||||
u32 val = 0;
|
||||
|
||||
switch(sz)
|
||||
switch (sz)
|
||||
{
|
||||
case 1:
|
||||
val = rtw_read8(padapter, addr);
|
||||
|
@ -72,7 +72,7 @@ u32 read_macreg(_adapter *padapter, u32 addr, u32 sz)
|
|||
|
||||
void write_macreg(_adapter *padapter, u32 addr, u32 val, u32 sz)
|
||||
{
|
||||
switch(sz)
|
||||
switch (sz)
|
||||
{
|
||||
case 1:
|
||||
rtw_write8(padapter, addr, (u8)val);
|
||||
|
@ -169,7 +169,7 @@ void mp_wi_callback(
|
|||
struct mp_wi_cntx *pmp_wi_cntx=&pmppriv->wi_cntx;
|
||||
|
||||
// Execute specified action.
|
||||
if(pmp_wi_cntx->curractfunc != NULL)
|
||||
if (pmp_wi_cntx->curractfunc != NULL)
|
||||
{
|
||||
LARGE_INTEGER cur_time;
|
||||
ULONGLONG start_time, end_time;
|
||||
|
@ -426,7 +426,7 @@ MPT_InitializeAdapter(
|
|||
//ledsetting = rtw_read32(pAdapter, REG_LEDCFG0);
|
||||
//rtw_write32(pAdapter, REG_LEDCFG0, ledsetting & ~LED0DIS);
|
||||
|
||||
if(IS_HARDWARE_TYPE_8192DU(pAdapter))
|
||||
if (IS_HARDWARE_TYPE_8192DU(pAdapter))
|
||||
{
|
||||
rtw_write32(pAdapter, REG_LEDCFG0, 0x8888);
|
||||
}
|
||||
|
@ -505,9 +505,9 @@ MPT_DeInitAdapter(
|
|||
#if 0 // for Windows
|
||||
PlatformFreeWorkItem( &(pMptCtx->MptWorkItem) );
|
||||
|
||||
while(pMptCtx->bMptWorkItemInProgress)
|
||||
while (pMptCtx->bMptWorkItemInProgress)
|
||||
{
|
||||
if(NdisWaitEvent(&(pMptCtx->MptWorkItemEvent), 50))
|
||||
if (NdisWaitEvent(&(pMptCtx->MptWorkItemEvent), 50))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -727,7 +727,7 @@ void mp_stop_test(PADAPTER padapter)
|
|||
|
||||
_irqL irqL;
|
||||
|
||||
if(pmppriv->mode==MP_ON)
|
||||
if (pmppriv->mode==MP_ON)
|
||||
{
|
||||
pmppriv->bSetTxPower=0;
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
|
@ -1200,7 +1200,7 @@ void SetPacketTx(PADAPTER padapter)
|
|||
desc->txdw4 |= cpu_to_le32(USERATE);
|
||||
desc->txdw4 |= cpu_to_le32(DISDATAFB);
|
||||
|
||||
if( pmp_priv->preamble ){
|
||||
if ( pmp_priv->preamble ){
|
||||
if (pmp_priv->rateidx <= MPT_RATE_54M)
|
||||
desc->txdw4 |= cpu_to_le32(DATA_SHORT); // CCK Short Preamble
|
||||
}
|
||||
|
@ -1210,7 +1210,7 @@ void SetPacketTx(PADAPTER padapter)
|
|||
// offset 20
|
||||
desc->txdw5 |= cpu_to_le32(pmp_priv->rateidx & 0x0000001F);
|
||||
|
||||
if( pmp_priv->preamble ){
|
||||
if ( pmp_priv->preamble ){
|
||||
if (pmp_priv->rateidx > MPT_RATE_54M)
|
||||
desc->txdw5 |= cpu_to_le32(SGI); // MCS Short Guard Interval
|
||||
}
|
||||
|
@ -1274,7 +1274,7 @@ void SetPacketRx(PADAPTER pAdapter, u8 bStartRx)
|
|||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
|
||||
if(bStartRx)
|
||||
if (bStartRx)
|
||||
{
|
||||
// Accept CRC error and destination address
|
||||
#if 1
|
||||
|
@ -1438,7 +1438,7 @@ void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv)
|
|||
|
||||
u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ;
|
||||
u32 num_xmit_extbuf = NR_XMIT_EXTBUFF;
|
||||
if(padapter->registrypriv.mp_mode ==0)
|
||||
if (padapter->registrypriv.mp_mode ==0)
|
||||
{
|
||||
max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ;
|
||||
num_xmit_extbuf = NR_XMIT_EXTBUFF;
|
||||
|
@ -1450,18 +1450,18 @@ void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv)
|
|||
}
|
||||
|
||||
pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf;
|
||||
for(i=0; i<num_xmit_extbuf; i++)
|
||||
for (i=0; i<num_xmit_extbuf; i++)
|
||||
{
|
||||
rtw_os_xmit_resource_free(padapter, pxmitbuf,(max_xmit_extbuf_size + XMITBUF_ALIGN_SZ));
|
||||
|
||||
pxmitbuf++;
|
||||
}
|
||||
|
||||
if(pxmitpriv->pallocated_xmit_extbuf) {
|
||||
if (pxmitpriv->pallocated_xmit_extbuf) {
|
||||
rtw_vmfree(pxmitpriv->pallocated_xmit_extbuf, num_xmit_extbuf * sizeof(struct xmit_buf) + 4);
|
||||
}
|
||||
|
||||
if(padapter->registrypriv.mp_mode ==0)
|
||||
if (padapter->registrypriv.mp_mode ==0)
|
||||
{
|
||||
max_xmit_extbuf_size = 20000;
|
||||
num_xmit_extbuf = 1;
|
||||
|
@ -1506,7 +1506,7 @@ void _rtw_mp_xmit_priv (struct xmit_priv *pxmitpriv)
|
|||
pxmitbuf->pbuf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pxmitbuf->pallocated_buf), 4);
|
||||
*/
|
||||
|
||||
if((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,max_xmit_extbuf_size + XMITBUF_ALIGN_SZ)) == _FAIL) {
|
||||
if ((res=rtw_os_xmit_resource_alloc(padapter, pxmitbuf,max_xmit_extbuf_size + XMITBUF_ALIGN_SZ)) == _FAIL) {
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
|
|
@ -1783,7 +1783,7 @@ _func_enter_;
|
|||
u8 res=_SUCCESS;
|
||||
DEBUG_INFO(("===> Set OID_RT_PRO_H2C_GET_RATE_TABLE.\n"));
|
||||
|
||||
if(pmp_wi_cntx->bmp_wi_progress ==_TRUE){
|
||||
if (pmp_wi_cntx->bmp_wi_progress ==_TRUE){
|
||||
DEBUG_ERR(("\n mp workitem is progressing, not allow to set another workitem right now!!!\n"));
|
||||
Status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
break;
|
||||
|
@ -1798,7 +1798,7 @@ _func_enter_;
|
|||
|
||||
res=rtw_getrttbl_cmd(Adapter,(struct getratable_rsp *)pmp_wi_cntx->param.data);
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
if(res != _SUCCESS)
|
||||
if (res != _SUCCESS)
|
||||
{
|
||||
Status = NDIS_STATUS_NOT_ACCEPTED;
|
||||
}
|
||||
|
@ -2023,13 +2023,13 @@ static u32 mp_query_drv_var(_adapter *padapter, u8 offset, u32 var)
|
|||
}
|
||||
|
||||
#if 0
|
||||
if(offset <=100){ //For setting data rate and query data rate
|
||||
if(offset==100){ //For query data rate
|
||||
if (offset <=100){ //For setting data rate and query data rate
|
||||
if (offset==100){ //For query data rate
|
||||
RT_TRACE(_module_mp_, _drv_emerg_, ("\n mp_query_drv_var: offset(%d): query rate=0x%.2x \n",offset,padapter->registrypriv.tx_rate));
|
||||
var=padapter->registrypriv.tx_rate;
|
||||
|
||||
}
|
||||
else if(offset<0x1d){ //For setting data rate
|
||||
else if (offset<0x1d){ //For setting data rate
|
||||
padapter->registrypriv.tx_rate=offset;
|
||||
var=padapter->registrypriv.tx_rate;
|
||||
padapter->registrypriv.use_rate=_TRUE;
|
||||
|
@ -2042,12 +2042,12 @@ static u32 mp_query_drv_var(_adapter *padapter, u8 offset, u32 var)
|
|||
}
|
||||
else if (offset<=110){ //for setting debug level
|
||||
RT_TRACE(_module_mp_, _drv_emerg_, (" mp_query_drv_var: offset(%d) for set debug level\n",offset));
|
||||
if(offset==110){ //For query data rate
|
||||
if (offset==110){ //For query data rate
|
||||
RT_TRACE(_module_mp_, _drv_emerg_, (" mp_query_drv_var: offset(%d): query dbg level=0x%.2x \n",offset,padapter->registrypriv.dbg_level));
|
||||
padapter->registrypriv.dbg_level=GlobalDebugLevel;
|
||||
var=padapter->registrypriv.dbg_level;
|
||||
}
|
||||
else if(offset<110 && offset>100){
|
||||
else if (offset<110 && offset>100){
|
||||
RT_TRACE(_module_mp_, _drv_emerg_, (" mp_query_drv_var: offset(%d): set dbg level=0x%.2x \n",offset,offset-100));
|
||||
padapter->registrypriv.dbg_level=GlobalDebugLevel=offset-100;
|
||||
var=padapter->registrypriv.dbg_level;
|
||||
|
@ -2062,13 +2062,13 @@ static u32 mp_query_drv_var(_adapter *padapter, u8 offset, u32 var)
|
|||
|
||||
}
|
||||
}
|
||||
else if(offset >110 &&offset <116){
|
||||
if(115==offset){
|
||||
else if (offset >110 &&offset <116){
|
||||
if (115==offset){
|
||||
RT_TRACE(_module_mp_, _drv_emerg_, (" mp_query_drv_var(_drv_emerg_): offset(%d): query TRX access type: [tx_block_mode=%x,rx_block_mode=%x]\n",\
|
||||
offset, adapter_to_dvobj(padapter)->tx_block_mode, adapter_to_dvobj(padapter)->rx_block_mode));
|
||||
}
|
||||
else {
|
||||
switch(offset){
|
||||
switch (offset){
|
||||
case 111:
|
||||
adapter_to_dvobj(padapter)->tx_block_mode=1;
|
||||
adapter_to_dvobj(padapter)->rx_block_mode=1;
|
||||
|
@ -2105,7 +2105,7 @@ static u32 mp_query_drv_var(_adapter *padapter, u8 offset, u32 var)
|
|||
}
|
||||
|
||||
}
|
||||
else if(offset>=127){
|
||||
else if (offset>=127){
|
||||
u64 prnt_dbg_comp;
|
||||
u8 chg_idx;
|
||||
u64 tmp_dbg_comp;
|
||||
|
@ -2113,7 +2113,7 @@ static u32 mp_query_drv_var(_adapter *padapter, u8 offset, u32 var)
|
|||
tmp_dbg_comp=BIT(chg_idx);
|
||||
prnt_dbg_comp=padapter->registrypriv.dbg_component= GlobalDebugComponents;
|
||||
RT_TRACE(_module_mp_, _drv_emerg_, (" 1: mp_query_drv_var: offset(%d;0x%x):for dbg conpoment prnt_dbg_comp=0x%.16x GlobalDebugComponents=0x%.16x padapter->registrypriv.dbg_component=0x%.16x\n",offset,offset,prnt_dbg_comp,GlobalDebugComponents,padapter->registrypriv.dbg_component));
|
||||
if(offset==127){
|
||||
if (offset==127){
|
||||
// prnt_dbg_comp=padapter->registrypriv.dbg_component= GlobalDebugComponents;
|
||||
var=(u32)(padapter->registrypriv.dbg_component);
|
||||
RT_TRACE(0xffffffff, _drv_emerg_, ("2: mp_query_drv_var: offset(%d;0x%x):for query dbg conpoment=0x%x(l) 0x%x(h) GlobalDebugComponents=0x%x(l) 0x%x(h) \n",offset,offset,padapter->registrypriv.dbg_component,prnt_dbg_comp));
|
||||
|
@ -2130,7 +2130,7 @@ static u32 mp_query_drv_var(_adapter *padapter, u8 offset, u32 var)
|
|||
prnt_dbg_comp=GlobalDebugComponents=padapter->registrypriv.dbg_component;
|
||||
RT_TRACE(0xffffffff, _drv_emerg_, ("3-2: mp_query_drv_var: offset(%d;0x%x):for query dbg conpoment=0x%x(l) 0x%x(h) GlobalDebugComponents=0x%x(l) 0x%x(h)\n",offset,offset,padapter->registrypriv.dbg_component,prnt_dbg_comp));
|
||||
|
||||
if(GlobalDebugComponents&tmp_dbg_comp){
|
||||
if (GlobalDebugComponents&tmp_dbg_comp){
|
||||
//this bit is already set, now clear it
|
||||
GlobalDebugComponents=GlobalDebugComponents&(~tmp_dbg_comp);
|
||||
}
|
||||
|
@ -2619,13 +2619,13 @@ _func_enter_;
|
|||
rcr_val8 = rtw_read8(Adapter, 0x10250048);//RCR
|
||||
rcr_val8 &= ~(RCR_AB|RCR_AM|RCR_APM|RCR_AAP);
|
||||
|
||||
if(rx_pkt_type == RX_PKT_BROADCAST){
|
||||
if (rx_pkt_type == RX_PKT_BROADCAST){
|
||||
rcr_val8 |= (RCR_AB | RCR_ACRC32 );
|
||||
}
|
||||
else if(rx_pkt_type == RX_PKT_DEST_ADDR){
|
||||
else if (rx_pkt_type == RX_PKT_DEST_ADDR){
|
||||
rcr_val8 |= (RCR_AAP| RCR_AM |RCR_ACRC32);
|
||||
}
|
||||
else if(rx_pkt_type == RX_PKT_PHY_MATCH){
|
||||
else if (rx_pkt_type == RX_PKT_PHY_MATCH){
|
||||
rcr_val8 |= (RCR_APM|RCR_ACRC32);
|
||||
}
|
||||
else{
|
||||
|
@ -2636,14 +2636,14 @@ _func_enter_;
|
|||
rcr_val32 = rtw_read32(padapter, RCR);//RCR = 0x10250048
|
||||
rcr_val32 &= ~(RCR_CBSSID|RCR_AB|RCR_AM|RCR_APM|RCR_AAP);
|
||||
#if 0
|
||||
if(rx_pkt_type == RX_PKT_BROADCAST){
|
||||
if (rx_pkt_type == RX_PKT_BROADCAST){
|
||||
rcr_val32 |= (RCR_AB|RCR_AM|RCR_APM|RCR_AAP|RCR_ACRC32);
|
||||
}
|
||||
else if(rx_pkt_type == RX_PKT_DEST_ADDR){
|
||||
else if (rx_pkt_type == RX_PKT_DEST_ADDR){
|
||||
//rcr_val32 |= (RCR_CBSSID|RCR_AAP|RCR_AM|RCR_ACRC32);
|
||||
rcr_val32 |= (RCR_CBSSID|RCR_APM|RCR_ACRC32);
|
||||
}
|
||||
else if(rx_pkt_type == RX_PKT_PHY_MATCH){
|
||||
else if (rx_pkt_type == RX_PKT_PHY_MATCH){
|
||||
rcr_val32 |= (RCR_APM|RCR_ACRC32);
|
||||
//rcr_val32 |= (RCR_AAP|RCR_ACRC32);
|
||||
}
|
||||
|
@ -2834,7 +2834,7 @@ unsigned int mp_ioctl_xmit_packet_hdl(struct oid_par_priv *poid_par_priv)
|
|||
pattrib->nr_frags = 1;
|
||||
pattrib->priority = 0;
|
||||
#ifndef CONFIG_MP_LINUX
|
||||
if(IS_MCAST(pethhdr->h_dest))
|
||||
if (IS_MCAST(pethhdr->h_dest))
|
||||
pattrib->mac_id = 4;
|
||||
else
|
||||
pattrib->mac_id = 5;
|
||||
|
|
230
core/rtw_p2p.c
230
core/rtw_p2p.c
|
@ -29,7 +29,7 @@ int rtw_p2p_is_channel_list_ok( u8 desired_ch, u8* ch_list, u8 ch_cnt )
|
|||
{
|
||||
int found = 0, i = 0;
|
||||
|
||||
for( i = 0; i < ch_cnt; i++ )
|
||||
for ( i = 0; i < ch_cnt; i++ )
|
||||
{
|
||||
if ( ch_list[ i ] == desired_ch )
|
||||
{
|
||||
|
@ -103,7 +103,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
|||
plist = get_next(plist);
|
||||
|
||||
|
||||
if(psta->is_p2p_device)
|
||||
if (psta->is_p2p_device)
|
||||
{
|
||||
tmplen = 0;
|
||||
|
||||
|
@ -133,7 +133,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
|||
_rtw_memcpy(pcur, psta->secdev_types_list, psta->num_of_secdev_type*8);
|
||||
pcur += psta->num_of_secdev_type*8;
|
||||
|
||||
if(psta->dev_name_len>0)
|
||||
if (psta->dev_name_len>0)
|
||||
{
|
||||
//*(u16*)(pcur) = cpu_to_be16( WPS_ATTR_DEVICE_NAME );
|
||||
RTW_PUT_BE16(pcur, WPS_ATTR_DEVICE_NAME);
|
||||
|
@ -163,7 +163,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
|||
}
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
|
||||
if(attr_len>0)
|
||||
if (attr_len>0)
|
||||
{
|
||||
len = rtw_set_p2p_attr_content(pbuf, P2P_ATTR_GROUP_INFO, attr_len, pdata_attr);
|
||||
}
|
||||
|
@ -531,7 +531,7 @@ u32 build_beacon_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
|||
// Group Capability Bitmap, 1 byte
|
||||
capability = P2P_DEVCAP_INVITATION_PROC|P2P_DEVCAP_CLIENT_DISCOVERABILITY;
|
||||
capability |= ((P2P_GRPCAP_GO | P2P_GRPCAP_INTRABSS) << 8);
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_PROVISIONING_ING))
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_PROVISIONING_ING))
|
||||
capability |= (P2P_GRPCAP_GROUP_FORMATION<<8);
|
||||
|
||||
capability = cpu_to_le16(capability);
|
||||
|
@ -941,7 +941,7 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel
|
|||
wfdie[ wfdielen++ ] = 0;
|
||||
wfdie[ wfdielen++ ] = 0;
|
||||
|
||||
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
{
|
||||
// WFD Session Information ATTR
|
||||
// Type:
|
||||
|
@ -993,7 +993,7 @@ u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
|||
struct wifi_display_info *pwfd_info = NULL;
|
||||
|
||||
// WFD OUI
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE))
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -1948,11 +1948,11 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
|||
p2pie[ p2pielen++ ] = DMP_P2P_DEVCAP_SUPPORT;
|
||||
|
||||
// Group Capability Bitmap, 1 byte
|
||||
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
{
|
||||
p2pie[ p2pielen ] = (P2P_GRPCAP_GO | P2P_GRPCAP_INTRABSS);
|
||||
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_PROVISIONING_ING))
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_PROVISIONING_ING))
|
||||
p2pie[ p2pielen ] |= P2P_GRPCAP_GROUP_FORMATION;
|
||||
|
||||
p2pielen++;
|
||||
|
@ -1991,7 +1991,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
|||
// Type:
|
||||
// Length:
|
||||
// Value:
|
||||
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
{
|
||||
//go_add_noa_attr(pwdinfo);
|
||||
}
|
||||
|
@ -2005,7 +2005,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
|||
// + NumofSecondDevType (1byte) + WPS Device Name ID field (2bytes) + WPS Device Name Len field (2bytes)
|
||||
//*(u16*) ( p2pie + p2pielen ) = cpu_to_le16( 21 + pwdinfo->device_name_len );
|
||||
#ifdef CONFIG_INTEL_WIDI
|
||||
if( _rtw_memcmp( pwdinfo->padapter->mlmepriv.sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN ) == _FALSE )
|
||||
if ( _rtw_memcmp( pwdinfo->padapter->mlmepriv.sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN ) == _FALSE )
|
||||
{
|
||||
RTW_PUT_LE16(p2pie + p2pielen, 21 + 8 + pwdinfo->device_name_len);
|
||||
}
|
||||
|
@ -2043,7 +2043,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
|||
|
||||
// Number of Secondary Device Types
|
||||
#ifdef CONFIG_INTEL_WIDI
|
||||
if( _rtw_memcmp( pwdinfo->padapter->mlmepriv.sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN ) == _FALSE )
|
||||
if ( _rtw_memcmp( pwdinfo->padapter->mlmepriv.sa_ext, zero_array_check, L2SDTA_SERVICE_VE_LEN ) == _FALSE )
|
||||
{
|
||||
p2pie[ p2pielen++ ] = 0x01;
|
||||
|
||||
|
@ -2079,7 +2079,7 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
|||
// Type:
|
||||
// Length:
|
||||
// Value:
|
||||
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
{
|
||||
p2pielen += go_add_group_info_attr(pwdinfo, p2pie + p2pielen);
|
||||
}
|
||||
|
@ -2281,7 +2281,7 @@ u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
|
|||
{
|
||||
int i, g_rate =0;
|
||||
|
||||
for( i = 0; i < rate_cnt; i++ )
|
||||
for ( i = 0; i < rate_cnt; i++ )
|
||||
{
|
||||
if ( ( ( *( p + 2 + i ) & 0xff ) != 0x02 ) &&
|
||||
( ( *( p + 2 + i ) & 0xff ) != 0x04 ) &&
|
||||
|
@ -2318,9 +2318,9 @@ u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
|
|||
len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_);
|
||||
|
||||
ssid_len &= 0xff; // Just last 1 byte is valid for ssid len of the probe request
|
||||
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE) || rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE) || rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
{
|
||||
if((p2pie=rtw_get_p2p_ie( pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_ , len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_ , NULL, &p2pielen)))
|
||||
if ((p2pie=rtw_get_p2p_ie( pframe + WLAN_HDR_A3_LEN + _PROBEREQ_IE_OFFSET_ , len - WLAN_HDR_A3_LEN - _PROBEREQ_IE_OFFSET_ , NULL, &p2pielen)))
|
||||
{
|
||||
if ( (p != NULL) && _rtw_memcmp( ( void * ) ( p+2 ), ( void * ) pwdinfo->p2p_wildcard_ssid , 7 ))
|
||||
{
|
||||
|
@ -2359,7 +2359,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
|
|||
u8 * p2p_ie;
|
||||
u32 p2p_ielen = 0;
|
||||
|
||||
if(!rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
if (!rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
return P2P_STATUS_FAIL_REQUEST_UNABLE;
|
||||
|
||||
frame_type = GetFrameSubType(pframe);
|
||||
|
@ -2390,7 +2390,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
|
|||
while ( p2p_ie )
|
||||
{
|
||||
//Check P2P Capability ATTR
|
||||
if( rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&cap_attr, (uint*) &attr_contentlen) )
|
||||
if ( rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&cap_attr, (uint*) &attr_contentlen) )
|
||||
{
|
||||
DBG_8192C( "[%s] Got P2P Capability Attr!!\n", __FUNCTION__ );
|
||||
cap_attr = le16_to_cpu(cap_attr);
|
||||
|
@ -2401,11 +2401,11 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
|
|||
|
||||
|
||||
//Check P2P Device Info ATTR
|
||||
if(rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_INFO, NULL, (uint*)&attr_contentlen))
|
||||
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_INFO, NULL, (uint*)&attr_contentlen))
|
||||
{
|
||||
DBG_8192C( "[%s] Got P2P DEVICE INFO Attr!!\n", __FUNCTION__ );
|
||||
pattr_content = pbuf = rtw_zmalloc(attr_contentlen);
|
||||
if(pattr_content)
|
||||
if (pattr_content)
|
||||
{
|
||||
u8 num_of_secdev_type;
|
||||
u16 dev_name_len;
|
||||
|
@ -2429,7 +2429,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
|
|||
num_of_secdev_type = *pattr_content;
|
||||
pattr_content += 1;
|
||||
|
||||
if(num_of_secdev_type==0)
|
||||
if (num_of_secdev_type==0)
|
||||
{
|
||||
psta->num_of_secdev_type = 0;
|
||||
}
|
||||
|
@ -2449,7 +2449,7 @@ u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
|
|||
|
||||
//dev_name_len = attr_contentlen - ETH_ALEN - 2 - 8 - 1 - (num_of_secdev_type*8);
|
||||
psta->dev_name_len=0;
|
||||
if(WPS_ATTR_DEVICE_NAME == be16_to_cpu(*(u16*)pattr_content))
|
||||
if (WPS_ATTR_DEVICE_NAME == be16_to_cpu(*(u16*)pattr_content))
|
||||
{
|
||||
dev_name_len = be16_to_cpu(*(u16*)(pattr_content+2));
|
||||
|
||||
|
@ -2494,13 +2494,13 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le
|
|||
u8 dev_addr[ETH_ALEN] = { 0x00 };
|
||||
u32 attr_contentlen = 0;
|
||||
|
||||
if(rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen))
|
||||
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen))
|
||||
{
|
||||
if(_rtw_memcmp(pwdinfo->device_addr, groupid, ETH_ALEN) &&
|
||||
if (_rtw_memcmp(pwdinfo->device_addr, groupid, ETH_ALEN) &&
|
||||
_rtw_memcmp(pwdinfo->p2p_group_ssid, groupid+ETH_ALEN, pwdinfo->p2p_group_ssid_len))
|
||||
{
|
||||
attr_contentlen=0;
|
||||
if(rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_ID, dev_addr, &attr_contentlen))
|
||||
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_ID, dev_addr, &attr_contentlen))
|
||||
{
|
||||
_irqL irqL;
|
||||
_list *phead, *plist;
|
||||
|
@ -2516,7 +2516,7 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le
|
|||
|
||||
plist = get_next(plist);
|
||||
|
||||
if(psta->is_p2p_device && (psta->dev_cap&P2P_DEVCAP_CLIENT_DISCOVERABILITY) &&
|
||||
if (psta->is_p2p_device && (psta->dev_cap&P2P_DEVCAP_CLIENT_DISCOVERABILITY) &&
|
||||
_rtw_memcmp(psta->dev_addr, dev_addr, ETH_ALEN))
|
||||
{
|
||||
|
||||
|
@ -2582,7 +2582,7 @@ u8 process_p2p_provdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint l
|
|||
if ( rtw_get_wps_attr_content( wpsie, wps_ielen, WPS_ATTR_CONF_METHOD , ( u8* ) &uconfig_method, &attr_contentlen) )
|
||||
{
|
||||
uconfig_method = be16_to_cpu( uconfig_method );
|
||||
switch( uconfig_method )
|
||||
switch ( uconfig_method )
|
||||
{
|
||||
case WPS_CM_DISPLYA:
|
||||
{
|
||||
|
@ -2627,12 +2627,12 @@ u8 rtw_p2p_get_peer_ch_list(struct wifidirect_info *pwdinfo, u8 *ch_content, u8
|
|||
ch_content += 3;
|
||||
ch_cnt -= 3;
|
||||
|
||||
while( ch_cnt > 0)
|
||||
while ( ch_cnt > 0)
|
||||
{
|
||||
ch_content += 1;
|
||||
ch_cnt -= 1;
|
||||
temp = *ch_content;
|
||||
for( i = 0 ; i < temp ; i++, j++ )
|
||||
for ( i = 0 ; i < temp ; i++, j++ )
|
||||
{
|
||||
peer_ch_list[j] = *( ch_content + 1 + i );
|
||||
}
|
||||
|
@ -2648,7 +2648,7 @@ u8 rtw_p2p_check_peer_oper_ch(struct mlme_ext_priv *pmlmeext, u8 ch)
|
|||
{
|
||||
u8 i = 0;
|
||||
|
||||
for( i = 0; i < pmlmeext->max_chan_nums; i++ )
|
||||
for ( i = 0; i < pmlmeext->max_chan_nums; i++ )
|
||||
{
|
||||
if ( pmlmeext->channel_set[ i ].ChannelNum == ch )
|
||||
{
|
||||
|
@ -2664,11 +2664,11 @@ u8 rtw_p2p_ch_inclusion(struct mlme_ext_priv *pmlmeext, u8 *peer_ch_list, u8 pee
|
|||
int i = 0, j = 0, temp = 0;
|
||||
u8 ch_no = 0;
|
||||
|
||||
for( i = 0; i < peer_ch_num; i++ )
|
||||
for ( i = 0; i < peer_ch_num; i++ )
|
||||
{
|
||||
for( j = temp; j < pmlmeext->max_chan_nums; j++ )
|
||||
for ( j = temp; j < pmlmeext->max_chan_nums; j++ )
|
||||
{
|
||||
if( *( peer_ch_list + i ) == pmlmeext->channel_set[ j ].ChannelNum )
|
||||
if ( *( peer_ch_list + i ) == pmlmeext->channel_set[ j ].ChannelNum )
|
||||
{
|
||||
ch_list_inclusioned[ ch_no++ ] = *( peer_ch_list + i );
|
||||
temp = j;
|
||||
|
@ -2710,7 +2710,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
|
|||
// Commented by Kurt 20120113
|
||||
// If some device wants to do p2p handshake without sending prov_disc_req
|
||||
// We have to get peer_req_cm from here.
|
||||
if(_rtw_memcmp( pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "000", 3) )
|
||||
if (_rtw_memcmp( pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, "000", 3) )
|
||||
{
|
||||
rtw_get_wps_attr_content( wpsie, wps_ielen, WPS_ATTR_DEVICE_PWID, (u8*) &wps_devicepassword_id, &wps_devicepassword_id_len);
|
||||
wps_devicepassword_id = be16_to_cpu( wps_devicepassword_id );
|
||||
|
@ -2771,12 +2771,12 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
|
|||
rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_ING);
|
||||
|
||||
//Check P2P Capability ATTR
|
||||
if(rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&cap_attr, (uint*)&attr_contentlen) )
|
||||
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&cap_attr, (uint*)&attr_contentlen) )
|
||||
{
|
||||
cap_attr = le16_to_cpu(cap_attr);
|
||||
|
||||
#if defined(CONFIG_WFD) && defined(CONFIG_TDLS)
|
||||
if(!(cap_attr & P2P_GRPCAP_INTRABSS) )
|
||||
if (!(cap_attr & P2P_GRPCAP_INTRABSS) )
|
||||
ptdlsinfo->ap_prohibited = _TRUE;
|
||||
#endif //defined(CONFIG_WFD) && defined(CONFIG_TDLS)
|
||||
}
|
||||
|
@ -2815,7 +2815,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
|
|||
rtw_p2p_set_role(pwdinfo, P2P_ROLE_CLIENT);
|
||||
}
|
||||
|
||||
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
{
|
||||
// Store the group id information.
|
||||
_rtw_memcpy( pwdinfo->groupid_info.go_device_addr, pwdinfo->device_addr, ETH_ALEN );
|
||||
|
@ -2838,7 +2838,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
|
|||
peer_ch_num = rtw_p2p_get_peer_ch_list(pwdinfo, ch_content, ch_cnt, peer_ch_list);
|
||||
ch_num_inclusioned = rtw_p2p_ch_inclusion(&padapter->mlmeextpriv, peer_ch_list, peer_ch_num, ch_list_inclusioned);
|
||||
|
||||
if( ch_num_inclusioned == 0)
|
||||
if ( ch_num_inclusioned == 0)
|
||||
{
|
||||
DBG_871X( "[%s] No common channel in channel list!\n", __FUNCTION__ );
|
||||
result = P2P_STATUS_FAIL_NO_COMMON_CH;
|
||||
|
@ -2846,7 +2846,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
|
|||
break;
|
||||
}
|
||||
|
||||
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
{
|
||||
if ( !rtw_p2p_is_channel_list_ok( pwdinfo->operating_channel,
|
||||
ch_list_inclusioned, ch_num_inclusioned) )
|
||||
|
@ -2974,11 +2974,11 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram
|
|||
{
|
||||
|
||||
//Check P2P Capability ATTR
|
||||
if(rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&cap_attr, (uint*)&attr_contentlen) )
|
||||
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&cap_attr, (uint*)&attr_contentlen) )
|
||||
{
|
||||
cap_attr = le16_to_cpu(cap_attr);
|
||||
#ifdef CONFIG_TDLS
|
||||
if(!(cap_attr & P2P_GRPCAP_INTRABSS) )
|
||||
if (!(cap_attr & P2P_GRPCAP_INTRABSS) )
|
||||
ptdlsinfo->ap_prohibited = _TRUE;
|
||||
#endif // CONFIG_TDLS
|
||||
}
|
||||
|
@ -3058,7 +3058,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram
|
|||
rtw_p2p_set_role(pwdinfo, P2P_ROLE_CLIENT);
|
||||
}
|
||||
|
||||
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
{
|
||||
// Store the group id information.
|
||||
_rtw_memcpy( pwdinfo->groupid_info.go_device_addr, pwdinfo->device_addr, ETH_ALEN );
|
||||
|
@ -3084,7 +3084,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram
|
|||
peer_ch_num = rtw_p2p_get_peer_ch_list(pwdinfo, pwdinfo->channel_list_attr, pwdinfo->channel_list_attr_len, peer_ch_list);
|
||||
ch_num_inclusioned = rtw_p2p_ch_inclusion(&padapter->mlmeextpriv, peer_ch_list, peer_ch_num, ch_list_inclusioned);
|
||||
|
||||
if( ch_num_inclusioned == 0)
|
||||
if ( ch_num_inclusioned == 0)
|
||||
{
|
||||
DBG_871X( "[%s] No common channel in channel list!\n", __FUNCTION__ );
|
||||
result = P2P_STATUS_FAIL_NO_COMMON_CH;
|
||||
|
@ -3092,7 +3092,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram
|
|||
break;
|
||||
}
|
||||
|
||||
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO))
|
||||
{
|
||||
if ( !rtw_p2p_is_channel_list_ok( pwdinfo->operating_channel,
|
||||
ch_list_inclusioned, ch_num_inclusioned) )
|
||||
|
@ -3325,7 +3325,7 @@ void restore_p2p_state_handler( _adapter* padapter )
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_FAIL))
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_FAIL))
|
||||
{
|
||||
rtw_p2p_set_role(pwdinfo, P2P_ROLE_DEVICE);
|
||||
}
|
||||
|
@ -3337,7 +3337,7 @@ _func_enter_;
|
|||
struct mlme_priv *pbuddy_mlmepriv = &pbuddy_adapter->mlmepriv;
|
||||
struct mlme_ext_priv *pbuddy_mlmeext = &pbuddy_adapter->mlmeextpriv;
|
||||
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_RX_PROVISION_DIS_RSP))
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_RX_PROVISION_DIS_RSP))
|
||||
{
|
||||
set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode);
|
||||
|
||||
|
@ -3348,7 +3348,7 @@ _func_enter_;
|
|||
|
||||
rtw_p2p_set_state(pwdinfo, rtw_p2p_pre_state(pwdinfo));
|
||||
|
||||
if(rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE))
|
||||
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_DEVICE))
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
p2p_concurrent_handler( padapter );
|
||||
|
@ -3429,7 +3429,7 @@ _func_enter_;
|
|||
issue_nulldata(pbuddy_adapter, NULL, 0, 3, 500);
|
||||
|
||||
#else //CONFIG_IOCTL_CFG80211
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE))
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE))
|
||||
{
|
||||
// Now, the driver stays on the AP's channel.
|
||||
// If the pwdinfo->ext_listen_period = 0, that means the P2P listen state is not available on listen channel.
|
||||
|
@ -3476,7 +3476,7 @@ _func_enter_;
|
|||
// Todo: To check the value of pwdinfo->ext_listen_interval is equal to 0 or not.
|
||||
_set_timer( &pwdinfo->ap_p2p_switch_timer, pwdinfo->ext_listen_interval );
|
||||
}
|
||||
else if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_OK))
|
||||
else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_OK))
|
||||
{
|
||||
// The driver had finished the P2P handshake successfully.
|
||||
val8 = 0;
|
||||
|
@ -3484,7 +3484,7 @@ _func_enter_;
|
|||
set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode);
|
||||
issue_nulldata(pbuddy_adapter, NULL, 0, 3, 500);
|
||||
}
|
||||
else if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ))
|
||||
else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ))
|
||||
{
|
||||
val8 = 1;
|
||||
set_channel_bwmode(padapter, pwdinfo->tx_prov_disc_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
|
@ -3492,7 +3492,7 @@ _func_enter_;
|
|||
issue_probereq_p2p(padapter, NULL);
|
||||
_set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT );
|
||||
}
|
||||
else if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING) && pwdinfo->nego_req_info.benable == _TRUE)
|
||||
else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_GONEGO_ING) && pwdinfo->nego_req_info.benable == _TRUE)
|
||||
{
|
||||
val8 = 1;
|
||||
set_channel_bwmode(padapter, pwdinfo->nego_req_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
|
@ -3500,7 +3500,7 @@ _func_enter_;
|
|||
issue_probereq_p2p(padapter, NULL);
|
||||
_set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT );
|
||||
}
|
||||
else if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_INVITE_REQ ) && pwdinfo->invitereq_info.benable == _TRUE)
|
||||
else if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_INVITE_REQ ) && pwdinfo->invitereq_info.benable == _TRUE)
|
||||
{
|
||||
/*
|
||||
val8 = 1;
|
||||
|
@ -3546,7 +3546,7 @@ _func_enter_;
|
|||
|
||||
}else
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
if( pcfg80211_wdinfo->restore_channel != pmlmeext->cur_channel )
|
||||
if ( pcfg80211_wdinfo->restore_channel != pmlmeext->cur_channel )
|
||||
{
|
||||
if ( !check_fwstate(&padapter->mlmepriv, _FW_LINKED ) )
|
||||
pmlmeext->cur_channel = pcfg80211_wdinfo->restore_channel;
|
||||
|
@ -3604,7 +3604,7 @@ static void rtw_cfg80211_adjust_p2pie_channel(_adapter *padapter, const u8 *fram
|
|||
u8 *pattr = NULL;
|
||||
|
||||
//Check P2P_ATTR_CH_LIST
|
||||
if((pattr=rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, NULL, (uint*)&attr_contentlen))!=NULL)
|
||||
if ((pattr=rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, NULL, (uint*)&attr_contentlen))!=NULL)
|
||||
{
|
||||
int i;
|
||||
u32 num_of_ch;
|
||||
|
@ -3612,11 +3612,11 @@ static void rtw_cfg80211_adjust_p2pie_channel(_adapter *padapter, const u8 *fram
|
|||
|
||||
attr_contentlen -= 3;
|
||||
|
||||
while(attr_contentlen>0)
|
||||
while (attr_contentlen>0)
|
||||
{
|
||||
num_of_ch = *(pattr_temp+1);
|
||||
|
||||
for(i=0; i<num_of_ch; i++)
|
||||
for (i=0; i<num_of_ch; i++)
|
||||
*(pattr_temp+2+i) = pbuddy_mlmeext->cur_channel;//forcing to the same channel
|
||||
|
||||
pattr_temp += (2+num_of_ch);
|
||||
|
@ -3627,7 +3627,7 @@ static void rtw_cfg80211_adjust_p2pie_channel(_adapter *padapter, const u8 *fram
|
|||
//Check P2P_ATTR_OPERATING_CH
|
||||
attr_contentlen = 0;
|
||||
pattr = NULL;
|
||||
if((pattr = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, NULL, (uint*)&attr_contentlen))!=NULL)
|
||||
if ((pattr = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_OPERATING_CH, NULL, (uint*)&attr_contentlen))!=NULL)
|
||||
{
|
||||
*(pattr+4) = pbuddy_mlmeext->cur_channel;//forcing to the same channel
|
||||
}
|
||||
|
@ -3651,7 +3651,7 @@ void rtw_append_wfd_ie(_adapter *padapter, u8 *buf, u32* len)
|
|||
frame_body = (unsigned char *)(buf + sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
category = frame_body[0];
|
||||
|
||||
if(category == RTW_WLAN_CATEGORY_PUBLIC)
|
||||
if (category == RTW_WLAN_CATEGORY_PUBLIC)
|
||||
{
|
||||
action = frame_body[1];
|
||||
if (action == ACT_PUBLIC_VENDOR
|
||||
|
@ -3660,7 +3660,7 @@ void rtw_append_wfd_ie(_adapter *padapter, u8 *buf, u32* len)
|
|||
{
|
||||
OUI_Subtype = frame_body[6];
|
||||
dialogToken = frame_body[7];
|
||||
switch( OUI_Subtype )//OUI Subtype
|
||||
switch ( OUI_Subtype )//OUI Subtype
|
||||
{
|
||||
case P2P_GO_NEGO_REQ:
|
||||
{
|
||||
|
@ -3717,7 +3717,7 @@ void rtw_append_wfd_ie(_adapter *padapter, u8 *buf, u32* len)
|
|||
}
|
||||
|
||||
}
|
||||
else if(category == RTW_WLAN_CATEGORY_P2P)
|
||||
else if (category == RTW_WLAN_CATEGORY_P2P)
|
||||
{
|
||||
OUI_Subtype = frame_body[5];
|
||||
dialogToken = frame_body[6];
|
||||
|
@ -3727,7 +3727,7 @@ void rtw_append_wfd_ie(_adapter *padapter, u8 *buf, u32* len)
|
|||
cpu_to_be32( *( ( u32* ) ( frame_body + 1 ) ) ), OUI_Subtype, dialogToken);
|
||||
#endif
|
||||
|
||||
switch(OUI_Subtype)
|
||||
switch (OUI_Subtype)
|
||||
{
|
||||
case P2P_NOTICE_OF_ABSENCE:
|
||||
|
||||
|
@ -3769,7 +3769,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
|
|||
frame_body = (unsigned char *)(buf + sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
category = frame_body[0];
|
||||
//just for check
|
||||
if(category == RTW_WLAN_CATEGORY_PUBLIC)
|
||||
if (category == RTW_WLAN_CATEGORY_PUBLIC)
|
||||
{
|
||||
action = frame_body[1];
|
||||
if (action == ACT_PUBLIC_VENDOR
|
||||
|
@ -3789,24 +3789,24 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
|
|||
len-sizeof(struct rtw_ieee80211_hdr_3addr)-_PUBLIC_ACTION_IE_OFFSET_,
|
||||
NULL, &p2p_ielen);
|
||||
|
||||
switch( OUI_Subtype )//OUI Subtype
|
||||
switch ( OUI_Subtype )//OUI Subtype
|
||||
{
|
||||
u8 *cont;
|
||||
uint cont_len;
|
||||
case P2P_GO_NEGO_REQ:
|
||||
DBG_871X("RTW_%s:P2P_GO_NEGO_REQ, dialogToken=%d\n", (tx==_TRUE)?"Tx":"Rx", dialogToken);
|
||||
|
||||
if(tx)
|
||||
if (tx)
|
||||
{
|
||||
#ifdef CONFIG_DRV_ISSUE_PROV_REQ // IOT FOR S2
|
||||
if(pwdev_priv->provdisc_req_issued == _FALSE)
|
||||
if (pwdev_priv->provdisc_req_issued == _FALSE)
|
||||
rtw_cfg80211_issue_p2p_provision_request(padapter, buf, len);
|
||||
#endif //CONFIG_DRV_ISSUE_PROV_REQ
|
||||
|
||||
//pwdev_priv->provdisc_req_issued = _FALSE;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(check_buddy_fwstate(padapter, _FW_LINKED))
|
||||
if (check_buddy_fwstate(padapter, _FW_LINKED))
|
||||
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
#endif
|
||||
}
|
||||
|
@ -3816,14 +3816,14 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
|
|||
cont = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, NULL, &cont_len);
|
||||
DBG_871X("RTW_%s:P2P_GO_NEGO_RESP, dialogToken=%d, status:%d\n", (tx==_TRUE)?"Tx":"Rx", dialogToken, cont?*cont:-1);
|
||||
|
||||
if(!tx)
|
||||
if (!tx)
|
||||
{
|
||||
pwdev_priv->provdisc_req_issued = _FALSE;
|
||||
}
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
else
|
||||
{
|
||||
if(check_buddy_fwstate(padapter, _FW_LINKED))
|
||||
if (check_buddy_fwstate(padapter, _FW_LINKED))
|
||||
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
}
|
||||
#endif
|
||||
|
@ -3833,9 +3833,9 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
|
|||
DBG_871X("RTW_%s:P2P_GO_NEGO_CONF, dialogToken=%d, status:%d\n", (tx==_TRUE)?"Tx":"Rx", dialogToken, cont?*cont:-1);
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(tx)
|
||||
if (tx)
|
||||
{
|
||||
if(check_buddy_fwstate(padapter, _FW_LINKED))
|
||||
if (check_buddy_fwstate(padapter, _FW_LINKED))
|
||||
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
}
|
||||
#endif
|
||||
|
@ -3846,10 +3846,10 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
|
|||
int flags = -1;
|
||||
int op_ch = 0;
|
||||
|
||||
if(tx)
|
||||
if (tx)
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(check_buddy_fwstate(padapter, _FW_LINKED))
|
||||
if (check_buddy_fwstate(padapter, _FW_LINKED))
|
||||
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
#endif
|
||||
}
|
||||
|
@ -3875,10 +3875,10 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
|
|||
int status = -1;
|
||||
int op_ch = 0;
|
||||
|
||||
if(tx)
|
||||
if (tx)
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(check_buddy_fwstate(padapter, _FW_LINKED))
|
||||
if (check_buddy_fwstate(padapter, _FW_LINKED))
|
||||
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
#endif
|
||||
}
|
||||
|
@ -3915,14 +3915,14 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
|
|||
|
||||
DBG_871X("RTW_%s:P2P_PROVISION_DISC_REQ, dialogToken=%d\n", (tx==_TRUE)?"Tx":"Rx", dialogToken);
|
||||
|
||||
//if(tx)
|
||||
//if (tx)
|
||||
{
|
||||
pwdev_priv->provdisc_req_issued = _FALSE;
|
||||
|
||||
if( (p2p_ie=rtw_get_p2p_ie( frame_body + _PUBLIC_ACTION_IE_OFFSET_, frame_body_len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &p2p_ielen)))
|
||||
if ( (p2p_ie=rtw_get_p2p_ie( frame_body + _PUBLIC_ACTION_IE_OFFSET_, frame_body_len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &p2p_ielen)))
|
||||
{
|
||||
|
||||
if(rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, NULL, &contentlen))
|
||||
if (rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, NULL, &contentlen))
|
||||
{
|
||||
pwdev_priv->provdisc_req_issued = _FALSE;//case: p2p_client join p2p GO
|
||||
}
|
||||
|
@ -3949,7 +3949,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
|
|||
}
|
||||
|
||||
}
|
||||
else if(category == RTW_WLAN_CATEGORY_P2P)
|
||||
else if (category == RTW_WLAN_CATEGORY_P2P)
|
||||
{
|
||||
OUI_Subtype = frame_body[5];
|
||||
dialogToken = frame_body[6];
|
||||
|
@ -3961,7 +3961,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
|
|||
|
||||
is_p2p_frame = OUI_Subtype;
|
||||
|
||||
switch(OUI_Subtype)
|
||||
switch (OUI_Subtype)
|
||||
{
|
||||
case P2P_NOTICE_OF_ABSENCE:
|
||||
DBG_871X("RTW_%s:P2P_NOTICE_OF_ABSENCE, dialogToken=%d\n", (tx==_TRUE)?"TX":"RX", dialogToken);
|
||||
|
@ -4006,7 +4006,7 @@ void p2p_protocol_wk_hdl(_adapter *padapter, int intCmdType)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
switch(intCmdType)
|
||||
switch (intCmdType)
|
||||
{
|
||||
case P2P_FIND_PHASE_WK:
|
||||
{
|
||||
|
@ -4104,15 +4104,15 @@ void process_p2p_ps_ie(PADAPTER padapter, u8 *IEs, u32 IELength)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
{
|
||||
return;
|
||||
}
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(padapter->iface_type != IFACE_PORT0)
|
||||
if (padapter->iface_type != IFACE_PORT0)
|
||||
return;
|
||||
#endif
|
||||
if(IELength <= _BEACON_IE_OFFSET_)
|
||||
if (IELength <= _BEACON_IE_OFFSET_)
|
||||
return;
|
||||
|
||||
ies = IEs + _BEACON_IE_OFFSET_;
|
||||
|
@ -4120,16 +4120,16 @@ _func_enter_;
|
|||
|
||||
p2p_ie = rtw_get_p2p_ie( ies, ies_len, NULL, &p2p_ielen);
|
||||
|
||||
while(p2p_ie)
|
||||
while (p2p_ie)
|
||||
{
|
||||
find_p2p = _TRUE;
|
||||
// Get Notice of Absence IE.
|
||||
if(rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_NOA, noa_attr, &attr_contentlen))
|
||||
if (rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_NOA, noa_attr, &attr_contentlen))
|
||||
{
|
||||
find_p2p_ps = _TRUE;
|
||||
noa_index = noa_attr[0];
|
||||
|
||||
if( (pwdinfo->p2p_ps_mode == P2P_PS_NONE) ||
|
||||
if ( (pwdinfo->p2p_ps_mode == P2P_PS_NONE) ||
|
||||
(noa_index != pwdinfo->noa_index) )// if index change, driver should reconfigure related setting.
|
||||
{
|
||||
pwdinfo->noa_index = noa_index;
|
||||
|
@ -4139,9 +4139,9 @@ _func_enter_;
|
|||
noa_offset = 2;
|
||||
noa_num = 0;
|
||||
// NoA length should be n*(13) + 2
|
||||
if(attr_contentlen > 2)
|
||||
if (attr_contentlen > 2)
|
||||
{
|
||||
while(noa_offset < attr_contentlen)
|
||||
while (noa_offset < attr_contentlen)
|
||||
{
|
||||
//_rtw_memcpy(&wifidirect_info->noa_count[noa_num], &noa_attr[noa_offset], 1);
|
||||
pwdinfo->noa_count[noa_num] = noa_attr[noa_offset];
|
||||
|
@ -4161,21 +4161,21 @@ _func_enter_;
|
|||
}
|
||||
pwdinfo->noa_num = noa_num;
|
||||
|
||||
if( pwdinfo->opp_ps == 1 )
|
||||
if ( pwdinfo->opp_ps == 1 )
|
||||
{
|
||||
pwdinfo->p2p_ps_mode = P2P_PS_CTWINDOW;
|
||||
// driver should wait LPS for entering CTWindow
|
||||
if(padapter->pwrctrlpriv.bFwCurrentInPSMode == _TRUE)
|
||||
if (padapter->pwrctrlpriv.bFwCurrentInPSMode == _TRUE)
|
||||
{
|
||||
p2p_ps_wk_cmd(padapter, P2P_PS_ENABLE, 1);
|
||||
}
|
||||
}
|
||||
else if( pwdinfo->noa_num > 0 )
|
||||
else if ( pwdinfo->noa_num > 0 )
|
||||
{
|
||||
pwdinfo->p2p_ps_mode = P2P_PS_NOA;
|
||||
p2p_ps_wk_cmd(padapter, P2P_PS_ENABLE, 1);
|
||||
}
|
||||
else if( pwdinfo->p2p_ps_mode > P2P_PS_NONE)
|
||||
else if ( pwdinfo->p2p_ps_mode > P2P_PS_NONE)
|
||||
{
|
||||
p2p_ps_wk_cmd(padapter, P2P_PS_DISABLE, 1);
|
||||
}
|
||||
|
@ -4189,9 +4189,9 @@ _func_enter_;
|
|||
|
||||
}
|
||||
|
||||
if(find_p2p == _TRUE)
|
||||
if (find_p2p == _TRUE)
|
||||
{
|
||||
if( (pwdinfo->p2p_ps_mode > P2P_PS_NONE) && (find_p2p_ps == _FALSE) )
|
||||
if ( (pwdinfo->p2p_ps_mode > P2P_PS_NONE) && (find_p2p_ps == _FALSE) )
|
||||
{
|
||||
p2p_ps_wk_cmd(padapter, P2P_PS_DISABLE, 1);
|
||||
}
|
||||
|
@ -4208,7 +4208,7 @@ void p2p_ps_wk_hdl(_adapter *padapter, u8 p2p_ps_state)
|
|||
_func_enter_;
|
||||
|
||||
// Pre action for p2p state
|
||||
switch(p2p_ps_state)
|
||||
switch (p2p_ps_state)
|
||||
{
|
||||
case P2P_PS_DISABLE:
|
||||
pwdinfo->p2p_ps_state = p2p_ps_state;
|
||||
|
@ -4220,9 +4220,9 @@ _func_enter_;
|
|||
pwdinfo->opp_ps = 0;
|
||||
pwdinfo->noa_num = 0;
|
||||
pwdinfo->p2p_ps_mode = P2P_PS_NONE;
|
||||
if(padapter->pwrctrlpriv.bFwCurrentInPSMode == _TRUE)
|
||||
if (padapter->pwrctrlpriv.bFwCurrentInPSMode == _TRUE)
|
||||
{
|
||||
if(pwrpriv->smart_ps == 0)
|
||||
if (pwrpriv->smart_ps == 0)
|
||||
{
|
||||
pwrpriv->smart_ps = 2;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_PWRMODE, (u8 *)(&(padapter->pwrctrlpriv.pwr_mode)));
|
||||
|
@ -4233,9 +4233,9 @@ _func_enter_;
|
|||
if (pwdinfo->p2p_ps_mode > P2P_PS_NONE) {
|
||||
pwdinfo->p2p_ps_state = p2p_ps_state;
|
||||
|
||||
if( pwdinfo->ctwindow > 0 )
|
||||
if ( pwdinfo->ctwindow > 0 )
|
||||
{
|
||||
if(pwrpriv->smart_ps != 0)
|
||||
if (pwrpriv->smart_ps != 0)
|
||||
{
|
||||
pwrpriv->smart_ps = 0;
|
||||
DBG_871X("%s(): Enter CTW, change SmartPS\n", __FUNCTION__);
|
||||
|
@ -4279,16 +4279,16 @@ _func_enter_;
|
|||
return res;
|
||||
}
|
||||
|
||||
if(enqueue)
|
||||
if (enqueue)
|
||||
{
|
||||
ph2c = (struct cmd_obj*)rtw_zmalloc(sizeof(struct cmd_obj));
|
||||
if(ph2c==NULL){
|
||||
if (ph2c==NULL){
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
pdrvextra_cmd_parm = (struct drvextra_cmd_parm*)rtw_zmalloc(sizeof(struct drvextra_cmd_parm));
|
||||
if(pdrvextra_cmd_parm==NULL){
|
||||
if (pdrvextra_cmd_parm==NULL){
|
||||
rtw_mfree((unsigned char *)ph2c, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
|
@ -4321,7 +4321,7 @@ static void reset_ch_sitesurvey_timer_process (void *FunctionContext)
|
|||
_adapter *adapter = (_adapter *)FunctionContext;
|
||||
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
|
||||
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
return;
|
||||
|
||||
DBG_871X( "[%s] In\n", __FUNCTION__ );
|
||||
|
@ -4335,7 +4335,7 @@ static void reset_ch_sitesurvey_timer_process2 (void *FunctionContext)
|
|||
_adapter *adapter = (_adapter *)FunctionContext;
|
||||
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
|
||||
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
return;
|
||||
|
||||
DBG_871X( "[%s] In\n", __FUNCTION__ );
|
||||
|
@ -4349,7 +4349,7 @@ static void restore_p2p_state_timer_process (void *FunctionContext)
|
|||
_adapter *adapter = (_adapter *)FunctionContext;
|
||||
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
|
||||
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
return;
|
||||
|
||||
p2p_protocol_wk_cmd( adapter, P2P_RESTORE_STATE_WK );
|
||||
|
@ -4363,13 +4363,13 @@ static void pre_tx_scan_timer_process (void *FunctionContext)
|
|||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
u8 _status = 0;
|
||||
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
return;
|
||||
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
|
||||
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ))
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ))
|
||||
{
|
||||
if ( _TRUE == pwdinfo->tx_prov_disc_info.benable ) // the provision discovery request frame is trigger to send or not
|
||||
{
|
||||
|
@ -4405,7 +4405,7 @@ static void find_phase_timer_process (void *FunctionContext)
|
|||
_adapter *adapter = (_adapter *)FunctionContext;
|
||||
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
|
||||
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
return;
|
||||
|
||||
adapter->wdinfo.find_phase_state_exchange_cnt++;
|
||||
|
@ -4422,7 +4422,7 @@ void ap_p2p_switch_timer_process (void *FunctionContext)
|
|||
struct rtw_wdev_priv *pwdev_priv = wdev_to_priv(adapter->rtw_wdev);
|
||||
#endif
|
||||
|
||||
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
return;
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
|
@ -4680,7 +4680,7 @@ char * p2p_state_str[] = {
|
|||
|
||||
void dbg_rtw_p2p_set_state(struct wifidirect_info *wdinfo, enum P2P_STATE state, const char *caller, int line)
|
||||
{
|
||||
if(!_rtw_p2p_chk_state(wdinfo, state)) {
|
||||
if (!_rtw_p2p_chk_state(wdinfo, state)) {
|
||||
enum P2P_STATE old_state = _rtw_p2p_state(wdinfo);
|
||||
_rtw_p2p_set_state(wdinfo, state);
|
||||
DBG_871X("[CONFIG_DBG_P2P]%s:%d set_state from %s to %s\n", caller, line
|
||||
|
@ -4694,7 +4694,7 @@ void dbg_rtw_p2p_set_state(struct wifidirect_info *wdinfo, enum P2P_STATE state,
|
|||
}
|
||||
void dbg_rtw_p2p_set_pre_state(struct wifidirect_info *wdinfo, enum P2P_STATE state, const char *caller, int line)
|
||||
{
|
||||
if(_rtw_p2p_pre_state(wdinfo) != state) {
|
||||
if (_rtw_p2p_pre_state(wdinfo) != state) {
|
||||
enum P2P_STATE old_state = _rtw_p2p_pre_state(wdinfo);
|
||||
_rtw_p2p_set_pre_state(wdinfo, state);
|
||||
DBG_871X("[CONFIG_DBG_P2P]%s:%d set_pre_state from %s to %s\n", caller, line
|
||||
|
@ -4709,7 +4709,7 @@ void dbg_rtw_p2p_set_pre_state(struct wifidirect_info *wdinfo, enum P2P_STATE st
|
|||
#if 0
|
||||
void dbg_rtw_p2p_restore_state(struct wifidirect_info *wdinfo, const char *caller, int line)
|
||||
{
|
||||
if(wdinfo->pre_p2p_state != -1) {
|
||||
if (wdinfo->pre_p2p_state != -1) {
|
||||
DBG_871X("[CONFIG_DBG_P2P]%s:%d restore from %s to %s\n", caller, line
|
||||
, p2p_state_str[wdinfo->p2p_state], p2p_state_str[wdinfo->pre_p2p_state]
|
||||
);
|
||||
|
@ -4723,7 +4723,7 @@ void dbg_rtw_p2p_restore_state(struct wifidirect_info *wdinfo, const char *calle
|
|||
#endif
|
||||
void dbg_rtw_p2p_set_role(struct wifidirect_info *wdinfo, enum P2P_ROLE role, const char *caller, int line)
|
||||
{
|
||||
if(wdinfo->role != role) {
|
||||
if (wdinfo->role != role) {
|
||||
enum P2P_ROLE old_role = wdinfo->role;
|
||||
_rtw_p2p_set_role(wdinfo, role);
|
||||
DBG_871X("[CONFIG_DBG_P2P]%s:%d set_role from %s to %s\n", caller, line
|
||||
|
@ -4755,7 +4755,7 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role)
|
|||
// Commented by Albert 2011/12/30
|
||||
// The driver just supports 1 P2P group operation.
|
||||
// So, this function will do nothing if the buddy adapter had enabled the P2P function.
|
||||
if(!rtw_p2p_chk_state(pbuddy_wdinfo, P2P_STATE_NONE))
|
||||
if (!rtw_p2p_chk_state(pbuddy_wdinfo, P2P_STATE_NONE))
|
||||
{
|
||||
// The buddy adapter had enabled the P2P function.
|
||||
return ret;
|
||||
|
@ -4790,7 +4790,7 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role)
|
|||
}
|
||||
|
||||
//Disable P2P function
|
||||
if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
{
|
||||
_cancel_timer_ex( &pwdinfo->find_phase_timer );
|
||||
_cancel_timer_ex( &pwdinfo->restore_p2p_state_timer );
|
||||
|
|
|
@ -60,12 +60,12 @@ void ips_enter(_adapter * padapter)
|
|||
#ifdef CONFIG_BT_COEXIST
|
||||
BTDM_TurnOffBtCoexistBeforeEnterIPS(padapter);
|
||||
#endif
|
||||
if(rf_off == pwrpriv->change_rfpwrstate )
|
||||
if (rf_off == pwrpriv->change_rfpwrstate )
|
||||
{
|
||||
pwrpriv->bpower_saving = _TRUE;
|
||||
DBG_871X_LEVEL(_drv_always_, "nolinked power save enter\n");
|
||||
|
||||
if(pwrpriv->ips_mode == IPS_LEVEL_2)
|
||||
if (pwrpriv->ips_mode == IPS_LEVEL_2)
|
||||
pwrpriv->bkeepfwalive = _TRUE;
|
||||
|
||||
rtw_ips_pwr_down(padapter);
|
||||
|
@ -88,7 +88,7 @@ int ips_leave(_adapter * padapter)
|
|||
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
||||
if((pwrpriv->rf_pwrstate == rf_off) &&(!pwrpriv->bips_processing))
|
||||
if ((pwrpriv->rf_pwrstate == rf_off) &&(!pwrpriv->bips_processing))
|
||||
{
|
||||
pwrpriv->bips_processing = _TRUE;
|
||||
pwrpriv->change_rfpwrstate = rf_on;
|
||||
|
@ -100,13 +100,13 @@ int ips_leave(_adapter * padapter)
|
|||
}
|
||||
DBG_871X_LEVEL(_drv_always_, "nolinked power save leave\n");
|
||||
|
||||
if((_WEP40_ == psecuritypriv->dot11PrivacyAlgrthm) ||(_WEP104_ == psecuritypriv->dot11PrivacyAlgrthm))
|
||||
if ((_WEP40_ == psecuritypriv->dot11PrivacyAlgrthm) ||(_WEP104_ == psecuritypriv->dot11PrivacyAlgrthm))
|
||||
{
|
||||
DBG_871X("==>%s,channel(%d),processing(%x)\n",__FUNCTION__,padapter->mlmeextpriv.cur_channel,pwrpriv->bips_processing);
|
||||
set_channel_bwmode(padapter, padapter->mlmeextpriv.cur_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
for(keyid=0;keyid<4;keyid++){
|
||||
if(pmlmepriv->key_mask & BIT(keyid)){
|
||||
if(keyid == psecuritypriv->dot11PrivacyKeyIndex)
|
||||
for (keyid=0;keyid<4;keyid++){
|
||||
if (pmlmepriv->key_mask & BIT(keyid)){
|
||||
if (keyid == psecuritypriv->dot11PrivacyKeyIndex)
|
||||
result=rtw_set_key(padapter,psecuritypriv, keyid, 1);
|
||||
else
|
||||
result=rtw_set_key(padapter,psecuritypriv, keyid, 0);
|
||||
|
@ -214,25 +214,25 @@ void rtw_ps_processor(_adapter*padapter)
|
|||
pwrpriv->ps_processing = _TRUE;
|
||||
|
||||
#ifdef SUPPORT_HW_RFOFF_DETECTED
|
||||
if(pwrpriv->bips_processing == _TRUE)
|
||||
if (pwrpriv->bips_processing == _TRUE)
|
||||
goto exit;
|
||||
|
||||
//DBG_871X("==> fw report state(0x%x)\n",rtw_read8(padapter,0x1ca));
|
||||
if(padapter->pwrctrlpriv.bHWPwrPindetect)
|
||||
if (padapter->pwrctrlpriv.bHWPwrPindetect)
|
||||
{
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
if(padapter->registrypriv.usbss_enable)
|
||||
if (padapter->registrypriv.usbss_enable)
|
||||
{
|
||||
if(pwrpriv->rf_pwrstate == rf_on)
|
||||
if (pwrpriv->rf_pwrstate == rf_on)
|
||||
{
|
||||
if(padapter->net_closed == _TRUE)
|
||||
if (padapter->net_closed == _TRUE)
|
||||
pwrpriv->ps_flag = _TRUE;
|
||||
|
||||
rfpwrstate = RfOnOffDetect(padapter);
|
||||
DBG_871X("@@@@- #1 %s==> rfstate:%s \n",__FUNCTION__,(rfpwrstate==rf_on)?"rf_on":"rf_off");
|
||||
if(rfpwrstate!= pwrpriv->rf_pwrstate)
|
||||
if (rfpwrstate!= pwrpriv->rf_pwrstate)
|
||||
{
|
||||
if(rfpwrstate == rf_off)
|
||||
if (rfpwrstate == rf_off)
|
||||
{
|
||||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
|
||||
|
@ -250,9 +250,9 @@ void rtw_ps_processor(_adapter*padapter)
|
|||
rfpwrstate = RfOnOffDetect(padapter);
|
||||
DBG_871X("@@@@- #2 %s==> rfstate:%s \n",__FUNCTION__,(rfpwrstate==rf_on)?"rf_on":"rf_off");
|
||||
|
||||
if(rfpwrstate!= pwrpriv->rf_pwrstate)
|
||||
if (rfpwrstate!= pwrpriv->rf_pwrstate)
|
||||
{
|
||||
if(rfpwrstate == rf_off)
|
||||
if (rfpwrstate == rf_off)
|
||||
{
|
||||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
pwrpriv->brfoffbyhw = _TRUE;
|
||||
|
@ -281,7 +281,7 @@ void rtw_ps_processor(_adapter*padapter)
|
|||
if (rtw_pwr_unassociated_idle(padapter) == _FALSE)
|
||||
goto exit;
|
||||
|
||||
if((pwrpriv->rf_pwrstate == rf_on) && ((pwrpriv->pwr_state_check_cnts%4)==0))
|
||||
if ((pwrpriv->rf_pwrstate == rf_on) && ((pwrpriv->pwr_state_check_cnts%4)==0))
|
||||
{
|
||||
DBG_871X("==>%s .fw_state(%x)\n",__FUNCTION__,get_fwstate(pmlmepriv));
|
||||
#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
|
@ -289,12 +289,12 @@ void rtw_ps_processor(_adapter*padapter)
|
|||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
#endif
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
if(padapter->registrypriv.usbss_enable)
|
||||
if (padapter->registrypriv.usbss_enable)
|
||||
{
|
||||
if(pwrpriv->bHWPwrPindetect)
|
||||
if (pwrpriv->bHWPwrPindetect)
|
||||
pwrpriv->bkeepfwalive = _TRUE;
|
||||
|
||||
if(padapter->net_closed == _TRUE)
|
||||
if (padapter->net_closed == _TRUE)
|
||||
pwrpriv->ps_flag = _TRUE;
|
||||
|
||||
#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
|
@ -311,7 +311,7 @@ void rtw_ps_processor(_adapter*padapter)
|
|||
autosuspend_enter(padapter);
|
||||
#endif //if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
}
|
||||
else if(pwrpriv->bHWPwrPindetect)
|
||||
else if (pwrpriv->bHWPwrPindetect)
|
||||
{
|
||||
}
|
||||
else
|
||||
|
@ -451,7 +451,7 @@ u8 PS_RDY_CHECK(_adapter * padapter)
|
|||
curr_time = rtw_get_current_time();
|
||||
delta_time = curr_time -pwrpriv->DelayLPSLastTimeStamp;
|
||||
|
||||
if(delta_time < LPS_DELAY_TIME)
|
||||
if (delta_time < LPS_DELAY_TIME)
|
||||
{
|
||||
return _FALSE;
|
||||
}
|
||||
|
@ -463,15 +463,15 @@ u8 PS_RDY_CHECK(_adapter * padapter)
|
|||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE) )
|
||||
return _FALSE;
|
||||
#ifdef CONFIG_WOWLAN
|
||||
if(_TRUE == pwrpriv->bInSuspend && pwrpriv->wowlan_mode)
|
||||
if (_TRUE == pwrpriv->bInSuspend && pwrpriv->wowlan_mode)
|
||||
return _TRUE;
|
||||
else
|
||||
return _FALSE;
|
||||
#else
|
||||
if(_TRUE == pwrpriv->bInSuspend )
|
||||
if (_TRUE == pwrpriv->bInSuspend )
|
||||
return _FALSE;
|
||||
#endif
|
||||
if( (padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) && (padapter->securitypriv.binstallGrpkey == _FALSE) )
|
||||
if ( (padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) && (padapter->securitypriv.binstallGrpkey == _FALSE) )
|
||||
{
|
||||
DBG_871X("Group handshake still in progress !!!\n");
|
||||
return _FALSE;
|
||||
|
@ -504,7 +504,7 @@ _func_enter_;
|
|||
("%s: PowerMode=%d Smart_PS=%d\n",
|
||||
__FUNCTION__, ps_mode, smart_ps));
|
||||
|
||||
if(ps_mode > PM_Card_Disable) {
|
||||
if (ps_mode > PM_Card_Disable) {
|
||||
RT_TRACE(_module_rtl871x_pwrctrl_c_,_drv_err_,("ps_mode:%d error\n", ps_mode));
|
||||
return;
|
||||
}
|
||||
|
@ -524,11 +524,11 @@ _func_enter_;
|
|||
_enter_pwrlock(&pwrpriv->lock);
|
||||
#endif
|
||||
|
||||
//if(pwrpriv->pwr_mode == PS_MODE_ACTIVE)
|
||||
if(ps_mode == PS_MODE_ACTIVE)
|
||||
//if (pwrpriv->pwr_mode == PS_MODE_ACTIVE)
|
||||
if (ps_mode == PS_MODE_ACTIVE)
|
||||
{
|
||||
#ifdef CONFIG_P2P_PS
|
||||
if(pwdinfo->opp_ps == 0)
|
||||
if (pwdinfo->opp_ps == 0)
|
||||
#endif //CONFIG_P2P_PS
|
||||
{
|
||||
DBG_871X("rtw_set_ps_mode: Leave 802.11 power save\n");
|
||||
|
@ -536,7 +536,7 @@ _func_enter_;
|
|||
#ifdef CONFIG_TDLS
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
for(i=0; i< NUM_STA; i++)
|
||||
for (i=0; i< NUM_STA; i++)
|
||||
{
|
||||
phead = &(pstapriv->sta_hash[i]);
|
||||
plist = get_next(phead);
|
||||
|
@ -545,7 +545,7 @@ _func_enter_;
|
|||
{
|
||||
ptdls_sta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
|
||||
|
||||
if( ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE )
|
||||
if ( ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE )
|
||||
issue_nulldata_to_TDLS_peer_STA(padapter, ptdls_sta, 0);
|
||||
plist = get_next(plist);
|
||||
}
|
||||
|
@ -573,7 +573,7 @@ _func_enter_;
|
|||
#ifdef CONFIG_TDLS
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
for(i=0; i< NUM_STA; i++)
|
||||
for (i=0; i< NUM_STA; i++)
|
||||
{
|
||||
phead = &(pstapriv->sta_hash[i]);
|
||||
plist = get_next(phead);
|
||||
|
@ -582,7 +582,7 @@ _func_enter_;
|
|||
{
|
||||
ptdls_sta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
|
||||
|
||||
if( ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE )
|
||||
if ( ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE )
|
||||
issue_nulldata_to_TDLS_peer_STA(padapter, ptdls_sta, 1);
|
||||
plist = get_next(plist);
|
||||
}
|
||||
|
@ -599,7 +599,7 @@ _func_enter_;
|
|||
|
||||
#ifdef CONFIG_P2P_PS
|
||||
// Set CTWindow after LPS
|
||||
if(pwdinfo->opp_ps == 1)
|
||||
if (pwdinfo->opp_ps == 1)
|
||||
p2p_ps_wk_cmd(padapter, P2P_PS_ENABLE, 0);
|
||||
#endif //CONFIG_P2P_PS
|
||||
|
||||
|
@ -708,9 +708,9 @@ _func_enter_;
|
|||
if (_TRUE == pwrpriv->bLeisurePs)
|
||||
{
|
||||
// Idle for a while if we connect to AP a while ago.
|
||||
if(pwrpriv->LpsIdleCount >= 2) // 4 Sec
|
||||
if (pwrpriv->LpsIdleCount >= 2) // 4 Sec
|
||||
{
|
||||
if(pwrpriv->pwr_mode == PS_MODE_ACTIVE)
|
||||
if (pwrpriv->pwr_mode == PS_MODE_ACTIVE)
|
||||
{
|
||||
pwrpriv->bpower_saving = _TRUE;
|
||||
DBG_871X("%s smart_ps:%d\n", __func__, pwrpriv->smart_ps);
|
||||
|
@ -750,11 +750,11 @@ _func_enter_;
|
|||
|
||||
if (pwrpriv->bLeisurePs)
|
||||
{
|
||||
if(pwrpriv->pwr_mode != PS_MODE_ACTIVE)
|
||||
if (pwrpriv->pwr_mode != PS_MODE_ACTIVE)
|
||||
{
|
||||
rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0);
|
||||
|
||||
if(pwrpriv->pwr_mode == PS_MODE_ACTIVE)
|
||||
if (pwrpriv->pwr_mode == PS_MODE_ACTIVE)
|
||||
LPS_RF_ON_check(padapter, LPS_LEAVE_TIMEOUT_MS);
|
||||
}
|
||||
}
|
||||
|
@ -799,10 +799,10 @@ _func_enter_;
|
|||
}
|
||||
else
|
||||
{
|
||||
if(Adapter->pwrctrlpriv.rf_pwrstate== rf_off)
|
||||
if (Adapter->pwrctrlpriv.rf_pwrstate== rf_off)
|
||||
{
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
if(Adapter->registrypriv.usbss_enable)
|
||||
if (Adapter->registrypriv.usbss_enable)
|
||||
{
|
||||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35))
|
||||
usb_disable_autosuspend(adapter_to_dvobj(Adapter)->pusbdev);
|
||||
|
@ -815,7 +815,7 @@ _func_enter_;
|
|||
{
|
||||
#if defined(CONFIG_PLATFORM_SPRD) && defined(CONFIG_RTL8188E)
|
||||
#ifdef CONFIG_IPS
|
||||
if(_FALSE == ips_leave(Adapter))
|
||||
if (_FALSE == ips_leave(Adapter))
|
||||
{
|
||||
DBG_871X("======> ips_leave fail.............\n");
|
||||
}
|
||||
|
@ -845,7 +845,7 @@ _func_enter_;
|
|||
|
||||
rtw_yield_os();
|
||||
|
||||
while(1)
|
||||
while (1)
|
||||
{
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
||||
|
@ -862,10 +862,10 @@ _func_enter_;
|
|||
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
|
||||
if(_TRUE == bReady)
|
||||
if (_TRUE == bReady)
|
||||
break;
|
||||
|
||||
if(rtw_get_passing_time_ms(start_time)>100)
|
||||
if (rtw_get_passing_time_ms(start_time)>100)
|
||||
{
|
||||
DBG_871X("Wait for cpwm event than 100 ms!!!\n");
|
||||
break;
|
||||
|
@ -1488,7 +1488,7 @@ static void rtw_late_resume(struct early_suspend *h)
|
|||
_adapter *adapter = container_of(pwrpriv, _adapter, pwrctrlpriv);
|
||||
|
||||
DBG_871X("%s\n",__FUNCTION__);
|
||||
if(pwrpriv->do_late_resume) {
|
||||
if (pwrpriv->do_late_resume) {
|
||||
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
|
||||
rtw_resume_process(adapter);
|
||||
pwrpriv->do_late_resume = _FALSE;
|
||||
|
@ -1542,7 +1542,7 @@ static void rtw_late_resume(android_early_suspend_t *h)
|
|||
_adapter *adapter = container_of(pwrpriv, _adapter, pwrctrlpriv);
|
||||
|
||||
DBG_871X("%s\n",__FUNCTION__);
|
||||
if(pwrpriv->do_late_resume) {
|
||||
if (pwrpriv->do_late_resume) {
|
||||
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
|
||||
rtw_resume_process(adapter);
|
||||
pwrpriv->do_late_resume = _FALSE;
|
||||
|
@ -1631,13 +1631,13 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
|
|||
}
|
||||
|
||||
//System suspend is not allowed to wakeup
|
||||
if((pwrpriv->bInternalAutoSuspend == _FALSE) && (_TRUE == pwrpriv->bInSuspend )){
|
||||
if ((pwrpriv->bInternalAutoSuspend == _FALSE) && (_TRUE == pwrpriv->bInSuspend )){
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
//block???
|
||||
if((pwrpriv->bInternalAutoSuspend == _TRUE) && (padapter->net_closed == _TRUE)) {
|
||||
if ((pwrpriv->bInternalAutoSuspend == _TRUE) && (padapter->net_closed == _TRUE)) {
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
@ -1646,8 +1646,8 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
|
|||
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
|
||||
{
|
||||
#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
if(_TRUE==pwrpriv->bInternalAutoSuspend){
|
||||
if(0==pwrpriv->autopm_cnt){
|
||||
if (_TRUE==pwrpriv->bInternalAutoSuspend){
|
||||
if (0==pwrpriv->autopm_cnt){
|
||||
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,33))
|
||||
if (usb_autopm_get_interface(adapter_to_dvobj(padapter)->pusbintf) < 0)
|
||||
{
|
||||
|
@ -1667,20 +1667,20 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
|
|||
}
|
||||
#endif //#if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
}
|
||||
if(rf_off == pwrpriv->rf_pwrstate )
|
||||
if (rf_off == pwrpriv->rf_pwrstate )
|
||||
{
|
||||
#ifdef CONFIG_USB_HCI
|
||||
#ifdef CONFIG_AUTOSUSPEND
|
||||
if(pwrpriv->brfoffbyhw==_TRUE)
|
||||
if (pwrpriv->brfoffbyhw==_TRUE)
|
||||
{
|
||||
DBG_8192C("hw still in rf_off state ...........\n");
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
else if(padapter->registrypriv.usbss_enable)
|
||||
else if (padapter->registrypriv.usbss_enable)
|
||||
{
|
||||
DBG_8192C("%s call autoresume_enter....\n",__FUNCTION__);
|
||||
if(_FAIL == autoresume_enter(padapter))
|
||||
if (_FAIL == autoresume_enter(padapter))
|
||||
{
|
||||
DBG_8192C("======> autoresume fail.............\n");
|
||||
ret = _FAIL;
|
||||
|
@ -1693,7 +1693,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
|
|||
{
|
||||
#ifdef CONFIG_IPS
|
||||
DBG_8192C("%s call ips_leave....\n",__FUNCTION__);
|
||||
if(_FAIL == ips_leave(padapter))
|
||||
if (_FAIL == ips_leave(padapter))
|
||||
{
|
||||
DBG_8192C("======> ips_leave fail.............\n");
|
||||
ret = _FAIL;
|
||||
|
@ -1704,7 +1704,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
|
|||
}
|
||||
|
||||
//TODO: the following checking need to be merged...
|
||||
if(padapter->bDriverStopped
|
||||
if (padapter->bDriverStopped
|
||||
|| !padapter->bup
|
||||
|| !padapter->hw_init_completed
|
||||
){
|
||||
|
@ -1731,9 +1731,9 @@ int rtw_pm_set_lps(_adapter *padapter, u8 mode)
|
|||
|
||||
if ( mode < PS_MODE_NUM )
|
||||
{
|
||||
if(pwrctrlpriv->power_mgnt !=mode)
|
||||
if (pwrctrlpriv->power_mgnt !=mode)
|
||||
{
|
||||
if(PS_MODE_ACTIVE == mode)
|
||||
if (PS_MODE_ACTIVE == mode)
|
||||
{
|
||||
LeaveAllPowerSaveMode(padapter);
|
||||
}
|
||||
|
@ -1757,15 +1757,15 @@ int rtw_pm_set_ips(_adapter *padapter, u8 mode)
|
|||
{
|
||||
struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv;
|
||||
|
||||
if( mode == IPS_NORMAL || mode == IPS_LEVEL_2 ) {
|
||||
if ( mode == IPS_NORMAL || mode == IPS_LEVEL_2 ) {
|
||||
rtw_ips_mode_req(pwrctrlpriv, mode);
|
||||
DBG_871X("%s %s\n", __FUNCTION__, mode == IPS_NORMAL?"IPS_NORMAL":"IPS_LEVEL_2");
|
||||
return 0;
|
||||
}
|
||||
else if(mode ==IPS_NONE){
|
||||
else if (mode ==IPS_NONE){
|
||||
rtw_ips_mode_req(pwrctrlpriv, mode);
|
||||
DBG_871X("%s %s\n", __FUNCTION__, "IPS_NONE");
|
||||
if((padapter->bSurpriseRemoved ==0)&&(_FAIL == rtw_pwr_wakeup(padapter)) )
|
||||
if ((padapter->bSurpriseRemoved ==0)&&(_FAIL == rtw_pwr_wakeup(padapter)) )
|
||||
return -EFAULT;
|
||||
}
|
||||
else {
|
||||
|
|
432
core/rtw_recv.c
432
core/rtw_recv.c
File diff suppressed because it is too large
Load diff
|
@ -179,7 +179,7 @@ void rtw_wep_encrypt(_adapter *padapter, u8 *pxmitframe)
|
|||
_func_enter_;
|
||||
|
||||
|
||||
if(((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
|
||||
if (((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
|
||||
return;
|
||||
|
||||
#ifdef CONFIG_USB_TX_AGGREGATION
|
||||
|
@ -196,18 +196,18 @@ _func_enter_;
|
|||
pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + hw_hdr_offset;
|
||||
|
||||
//start to encrypt each fragment
|
||||
if((pattrib->encrypt==_WEP40_)||(pattrib->encrypt==_WEP104_))
|
||||
if ((pattrib->encrypt==_WEP40_)||(pattrib->encrypt==_WEP104_))
|
||||
{
|
||||
keylength=psecuritypriv->dot11DefKeylen[psecuritypriv->dot11PrivacyKeyIndex];
|
||||
|
||||
for(curfragnum=0;curfragnum<pattrib->nr_frags;curfragnum++)
|
||||
for (curfragnum=0;curfragnum<pattrib->nr_frags;curfragnum++)
|
||||
{
|
||||
iv=pframe+pattrib->hdrlen;
|
||||
_rtw_memcpy(&wepkey[0], iv, 3);
|
||||
_rtw_memcpy(&wepkey[3], &psecuritypriv->dot11DefKey[psecuritypriv->dot11PrivacyKeyIndex].skey[0],keylength);
|
||||
payload=pframe+pattrib->iv_len+pattrib->hdrlen;
|
||||
|
||||
if((curfragnum+1)==pattrib->nr_frags)
|
||||
if ((curfragnum+1)==pattrib->nr_frags)
|
||||
{ //the last fragment
|
||||
|
||||
length=pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len;
|
||||
|
@ -257,7 +257,7 @@ _func_enter_;
|
|||
pframe=(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data;
|
||||
|
||||
//start to decrypt recvframe
|
||||
if((prxattrib->encrypt==_WEP40_)||(prxattrib->encrypt==_WEP104_))
|
||||
if ((prxattrib->encrypt==_WEP40_)||(prxattrib->encrypt==_WEP104_))
|
||||
{
|
||||
iv=pframe+prxattrib->hdrlen;
|
||||
//keyindex=(iv[3]&0x3);
|
||||
|
@ -277,7 +277,7 @@ _func_enter_;
|
|||
//calculate icv and compare the icv
|
||||
*((unsigned long *)crc)=le32_to_cpu(getcrc32(payload,length-4));
|
||||
|
||||
if(crc[3]!=payload[length-1] || crc[2]!=payload[length-2] || crc[1]!=payload[length-3] || crc[0]!=payload[length-4])
|
||||
if (crc[3]!=payload[length-1] || crc[2]!=payload[length-2] || crc[1]!=payload[length-3] || crc[0]!=payload[length-4])
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_wep_decrypt:icv error crc[3](%x)!=payload[length-1](%x) || crc[2](%x)!=payload[length-2](%x) || crc[1](%x)!=payload[length-3](%x) || crc[0](%x)!=payload[length-4](%x)\n",
|
||||
crc[3],payload[length-1],crc[2],payload[length-2],crc[1],payload[length-3],crc[0],payload[length-4]));
|
||||
|
@ -299,7 +299,7 @@ static u32 secmicgetuint32( u8 * p )
|
|||
s32 i;
|
||||
u32 res = 0;
|
||||
_func_enter_;
|
||||
for( i=0; i<4; i++ )
|
||||
for ( i=0; i<4; i++ )
|
||||
{
|
||||
res |= ((u32)(*p++)) << (8*i);
|
||||
}
|
||||
|
@ -312,7 +312,7 @@ static void secmicputuint32( u8 * p, u32 val )
|
|||
{
|
||||
long i;
|
||||
_func_enter_;
|
||||
for( i=0; i<4; i++ )
|
||||
for ( i=0; i<4; i++ )
|
||||
{
|
||||
*p++ = (u8) (val & 0xff);
|
||||
val >>= 8;
|
||||
|
@ -349,7 +349,7 @@ _func_enter_;
|
|||
pmicdata->M |= ((unsigned long)b) << (8*pmicdata->nBytesInM);
|
||||
pmicdata->nBytesInM++;
|
||||
// Process the word if it is full.
|
||||
if( pmicdata->nBytesInM >= 4 )
|
||||
if ( pmicdata->nBytesInM >= 4 )
|
||||
{
|
||||
pmicdata->L ^= pmicdata->M;
|
||||
pmicdata->R ^= ROL32( pmicdata->L, 17 );
|
||||
|
@ -371,7 +371,7 @@ void rtw_secmicappend(struct mic_data *pmicdata, u8 * src, u32 nbytes )
|
|||
{
|
||||
_func_enter_;
|
||||
// This is simple
|
||||
while( nbytes > 0 )
|
||||
while ( nbytes > 0 )
|
||||
{
|
||||
rtw_secmicappendbyte(pmicdata, *src++ );
|
||||
nbytes--;
|
||||
|
@ -389,7 +389,7 @@ _func_enter_;
|
|||
rtw_secmicappendbyte(pmicdata, 0 );
|
||||
rtw_secmicappendbyte(pmicdata, 0 );
|
||||
// and then zeroes until the length is a multiple of 4
|
||||
while( pmicdata->nBytesInM != 0 )
|
||||
while ( pmicdata->nBytesInM != 0 )
|
||||
{
|
||||
rtw_secmicappendbyte(pmicdata, 0 );
|
||||
}
|
||||
|
@ -412,16 +412,16 @@ _func_enter_;
|
|||
priority[0]=pri;
|
||||
|
||||
/* Michael MIC pseudo header: DA, SA, 3 x 0, Priority */
|
||||
if(header[1]&1){ //ToDS==1
|
||||
if (header[1]&1){ //ToDS==1
|
||||
rtw_secmicappend(&micdata, &header[16], 6); //DA
|
||||
if(header[1]&2) //From Ds==1
|
||||
if (header[1]&2) //From Ds==1
|
||||
rtw_secmicappend(&micdata, &header[24], 6);
|
||||
else
|
||||
rtw_secmicappend(&micdata, &header[10], 6);
|
||||
}
|
||||
else{ //ToDS==0
|
||||
rtw_secmicappend(&micdata, &header[4], 6); //DA
|
||||
if(header[1]&2) //From Ds==1
|
||||
if (header[1]&2) //From Ds==1
|
||||
rtw_secmicappend(&micdata, &header[16], 6);
|
||||
else
|
||||
rtw_secmicappend(&micdata, &header[10], 6);
|
||||
|
@ -669,7 +669,7 @@ u32 rtw_tkip_encrypt(_adapter *padapter, u8 *pxmitframe)
|
|||
u32 res=_SUCCESS;
|
||||
_func_enter_;
|
||||
|
||||
if(((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
|
||||
if (((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
|
||||
return _FAIL;
|
||||
|
||||
#ifdef CONFIG_USB_TX_AGGREGATION
|
||||
|
@ -685,9 +685,9 @@ _func_enter_;
|
|||
|
||||
pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + hw_hdr_offset;
|
||||
//4 start to encrypt each fragment
|
||||
if(pattrib->encrypt==_TKIP_){
|
||||
if (pattrib->encrypt==_TKIP_){
|
||||
|
||||
if(pattrib->psta)
|
||||
if (pattrib->psta)
|
||||
{
|
||||
stainfo = pattrib->psta;
|
||||
}
|
||||
|
@ -699,7 +699,7 @@ _func_enter_;
|
|||
if (stainfo!=NULL){
|
||||
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_tkip_encrypt: stainfo!=NULL!!!\n"));
|
||||
|
||||
if(IS_MCAST(pattrib->ra))
|
||||
if (IS_MCAST(pattrib->ra))
|
||||
{
|
||||
prwskey=psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey;
|
||||
}
|
||||
|
@ -710,7 +710,7 @@ _func_enter_;
|
|||
|
||||
prwskeylen=16;
|
||||
|
||||
for(curfragnum=0;curfragnum<pattrib->nr_frags;curfragnum++){
|
||||
for (curfragnum=0;curfragnum<pattrib->nr_frags;curfragnum++){
|
||||
iv=pframe+pattrib->hdrlen;
|
||||
payload=pframe+pattrib->iv_len+pattrib->hdrlen;
|
||||
|
||||
|
@ -723,7 +723,7 @@ _func_enter_;
|
|||
|
||||
phase2(&rc4key[0],prwskey,(u16 *)&ttkey[0],pnl);
|
||||
|
||||
if((curfragnum+1)==pattrib->nr_frags){ //4 the last fragment
|
||||
if ((curfragnum+1)==pattrib->nr_frags){ //4 the last fragment
|
||||
length=pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len;
|
||||
RT_TRACE(_module_rtl871x_security_c_,_drv_info_,("pattrib->iv_len =%x, pattrib->icv_len =%x\n", pattrib->iv_len,pattrib->icv_len));
|
||||
*((u32 *)crc)=cpu_to_le32(getcrc32(payload,length));/* modified by Amy*/
|
||||
|
@ -785,14 +785,14 @@ _func_enter_;
|
|||
pframe=(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data;
|
||||
|
||||
//4 start to decrypt recvframe
|
||||
if(prxattrib->encrypt==_TKIP_){
|
||||
if (prxattrib->encrypt==_TKIP_){
|
||||
|
||||
stainfo=rtw_get_stainfo(&padapter->stapriv ,&prxattrib->ta[0] );
|
||||
if (stainfo!=NULL){
|
||||
|
||||
if(IS_MCAST(prxattrib->ra))
|
||||
if (IS_MCAST(prxattrib->ra))
|
||||
{
|
||||
if(psecuritypriv->binstallGrpkey==_FALSE)
|
||||
if (psecuritypriv->binstallGrpkey==_FALSE)
|
||||
{
|
||||
res=_FAIL;
|
||||
DBG_8192C("%s:rx bc/mc packets,but didn't install group key!!!!!!!!!!\n",__FUNCTION__);
|
||||
|
@ -829,7 +829,7 @@ _func_enter_;
|
|||
|
||||
*((u32 *)crc)=le32_to_cpu(getcrc32(payload,length-4));
|
||||
|
||||
if(crc[3]!=payload[length-1] || crc[2]!=payload[length-2] || crc[1]!=payload[length-3] || crc[0]!=payload[length-4])
|
||||
if (crc[3]!=payload[length-1] || crc[2]!=payload[length-2] || crc[1]!=payload[length-3] || crc[0]!=payload[length-4])
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_wep_decrypt:icv error crc[3](%x)!=payload[length-1](%x) || crc[2](%x)!=payload[length-2](%x) || crc[1](%x)!=payload[length-3](%x) || crc[0](%x)!=payload[length-4](%x)\n",
|
||||
crc[3],payload[length-1],crc[2],payload[length-2],crc[1],payload[length-3],crc[0],payload[length-4]));
|
||||
|
@ -1109,7 +1109,7 @@ static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext)
|
|||
u8 intermediateb[16];
|
||||
u8 round_key[16];
|
||||
_func_enter_;
|
||||
for(i=0; i<16; i++) round_key[i] = key[i];
|
||||
for (i=0; i<16; i++) round_key[i] = key[i];
|
||||
|
||||
for (round = 0; round < 11; round++)
|
||||
{
|
||||
|
@ -1359,7 +1359,7 @@ _func_enter_;
|
|||
(frtype == WIFI_DATA_CFACKPOLL))
|
||||
{
|
||||
qc_exists = 1;
|
||||
if(hdrlen != WLAN_HDR_A3_QOS_LEN){
|
||||
if (hdrlen != WLAN_HDR_A3_QOS_LEN){
|
||||
|
||||
hdrlen += 2;
|
||||
}
|
||||
|
@ -1370,7 +1370,7 @@ _func_enter_;
|
|||
(frsubtype == 0x0a)||
|
||||
(frsubtype == 0x0b))
|
||||
{
|
||||
if(hdrlen != WLAN_HDR_A3_QOS_LEN){
|
||||
if (hdrlen != WLAN_HDR_A3_QOS_LEN){
|
||||
|
||||
hdrlen += 2;
|
||||
}
|
||||
|
@ -1530,7 +1530,7 @@ u32 rtw_aes_encrypt(_adapter *padapter, u8 *pxmitframe)
|
|||
u32 res=_SUCCESS;
|
||||
_func_enter_;
|
||||
|
||||
if(((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
|
||||
if (((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
|
||||
return _FAIL;
|
||||
|
||||
#ifdef CONFIG_USB_TX_AGGREGATION
|
||||
|
@ -1547,9 +1547,9 @@ _func_enter_;
|
|||
pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + hw_hdr_offset;
|
||||
|
||||
//4 start to encrypt each fragment
|
||||
if((pattrib->encrypt==_AES_)){
|
||||
if ((pattrib->encrypt==_AES_)){
|
||||
|
||||
if(pattrib->psta)
|
||||
if (pattrib->psta)
|
||||
{
|
||||
stainfo = pattrib->psta;
|
||||
}
|
||||
|
@ -1561,7 +1561,7 @@ _func_enter_;
|
|||
if (stainfo!=NULL){
|
||||
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_aes_encrypt: stainfo!=NULL!!!\n"));
|
||||
|
||||
if(IS_MCAST(pattrib->ra))
|
||||
if (IS_MCAST(pattrib->ra))
|
||||
{
|
||||
prwskey=psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey;
|
||||
}
|
||||
|
@ -1574,7 +1574,7 @@ _func_enter_;
|
|||
{
|
||||
struct sta_info *ptdls_sta;
|
||||
ptdls_sta=rtw_get_stainfo(&padapter->stapriv ,&pattrib->dst[0] );
|
||||
if((ptdls_sta != NULL) && (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) )
|
||||
if ((ptdls_sta != NULL) && (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) )
|
||||
{
|
||||
DBG_871X("[%s] for tdls link\n", __FUNCTION__);
|
||||
prwskey=&ptdls_sta->tpk.tk[0];
|
||||
|
@ -1584,9 +1584,9 @@ _func_enter_;
|
|||
|
||||
prwskeylen=16;
|
||||
|
||||
for(curfragnum=0;curfragnum<pattrib->nr_frags;curfragnum++){
|
||||
for (curfragnum=0;curfragnum<pattrib->nr_frags;curfragnum++){
|
||||
|
||||
if((curfragnum+1)==pattrib->nr_frags){ //4 the last fragment
|
||||
if ((curfragnum+1)==pattrib->nr_frags){ //4 the last fragment
|
||||
length=pattrib->last_txcmdsz-pattrib->hdrlen-pattrib->iv_len- pattrib->icv_len;
|
||||
|
||||
aes_cipher(prwskey,pattrib->hdrlen,pframe, length);
|
||||
|
@ -1675,7 +1675,7 @@ _func_enter_;
|
|||
(frtype == WIFI_DATA_CFACKPOLL))
|
||||
{
|
||||
qc_exists = 1;
|
||||
if(hdrlen != WLAN_HDR_A3_QOS_LEN){
|
||||
if (hdrlen != WLAN_HDR_A3_QOS_LEN){
|
||||
|
||||
hdrlen += 2;
|
||||
}
|
||||
|
@ -1686,7 +1686,7 @@ _func_enter_;
|
|||
(frsubtype == 0x0a)||
|
||||
(frsubtype == 0x0b))
|
||||
{
|
||||
if(hdrlen != WLAN_HDR_A3_QOS_LEN){
|
||||
if (hdrlen != WLAN_HDR_A3_QOS_LEN){
|
||||
|
||||
hdrlen += 2;
|
||||
}
|
||||
|
@ -1739,7 +1739,7 @@ _func_enter_;
|
|||
}
|
||||
|
||||
//start to calculate the mic
|
||||
if((hdrlen +plen+8) <= MAX_MSG_SIZE)
|
||||
if ((hdrlen +plen+8) <= MAX_MSG_SIZE)
|
||||
_rtw_memcpy((void *)message, pframe, (hdrlen +plen+8)); //8 is for ext iv len
|
||||
|
||||
|
||||
|
@ -1869,8 +1869,8 @@ _func_enter_;
|
|||
for (j=0; j<8;j++) message[payload_index++] = chain_buffer[j];
|
||||
|
||||
//compare the mic
|
||||
for(i=0;i<8;i++){
|
||||
if(pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i])
|
||||
for (i=0;i<8;i++){
|
||||
if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i])
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("aes_decipher:mic check error mic[%d]: pframe(%x) != message(%x) \n",
|
||||
i,pframe[hdrlen+8+plen-8+i],message[hdrlen+8+plen-8+i]));
|
||||
|
@ -1904,25 +1904,25 @@ u32 rtw_aes_decrypt(_adapter *padapter, u8 *precvframe)
|
|||
_func_enter_;
|
||||
pframe=(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data;
|
||||
//4 start to encrypt each fragment
|
||||
if((prxattrib->encrypt==_AES_)){
|
||||
if ((prxattrib->encrypt==_AES_)){
|
||||
|
||||
stainfo=rtw_get_stainfo(&padapter->stapriv ,&prxattrib->ta[0] );
|
||||
if (stainfo!=NULL){
|
||||
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("rtw_aes_decrypt: stainfo!=NULL!!!\n"));
|
||||
|
||||
if(IS_MCAST(prxattrib->ra))
|
||||
if (IS_MCAST(prxattrib->ra))
|
||||
{
|
||||
//in concurrent we should use sw descrypt in group key, so we remove this message
|
||||
//DBG_871X("rx bc/mc packets, to perform sw rtw_aes_decrypt\n");
|
||||
//prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey;
|
||||
if(psecuritypriv->binstallGrpkey==_FALSE)
|
||||
if (psecuritypriv->binstallGrpkey==_FALSE)
|
||||
{
|
||||
res=_FAIL;
|
||||
DBG_8192C("%s:rx bc/mc packets,but didn't install group key!!!!!!!!!!\n",__FUNCTION__);
|
||||
goto exit;
|
||||
}
|
||||
prwskey = psecuritypriv->dot118021XGrpKey[prxattrib->key_index].skey;
|
||||
if(psecuritypriv->dot118021XGrpKeyid != prxattrib->key_index)
|
||||
if (psecuritypriv->dot118021XGrpKeyid != prxattrib->key_index)
|
||||
{
|
||||
DBG_871X("not match packet_index=%d, install_index=%d \n"
|
||||
, prxattrib->key_index, psecuritypriv->dot118021XGrpKeyid);
|
||||
|
@ -2858,7 +2858,7 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("^^^rtw_use_tkipkey_handler ^^^\n"));
|
||||
|
||||
/*
|
||||
if(padapter->bDriverStopped ||padapter->bSurpriseRemoved){
|
||||
if (padapter->bDriverStopped ||padapter->bSurpriseRemoved){
|
||||
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("^^^rtw_use_tkipkey_handler (padapter->bDriverStopped %d)(padapter->bSurpriseRemoved %d)^^^\n",padapter->bDriverStopped,padapter->bSurpriseRemoved));
|
||||
|
||||
return;
|
||||
|
|
|
@ -51,20 +51,20 @@ u8 sreset_get_wifi_status(_adapter *padapter)
|
|||
u8 status = WIFI_STATUS_SUCCESS;
|
||||
u32 val32 = 0;
|
||||
_irqL irqL;
|
||||
if(psrtpriv->silent_reset_inprogress == _TRUE)
|
||||
if (psrtpriv->silent_reset_inprogress == _TRUE)
|
||||
{
|
||||
return status;
|
||||
}
|
||||
val32 =rtw_read32(padapter,REG_TXDMA_STATUS);
|
||||
if(val32==0xeaeaeaea){
|
||||
if (val32==0xeaeaeaea){
|
||||
psrtpriv->Wifi_Error_Status = WIFI_IF_NOT_EXIST;
|
||||
}
|
||||
else if(val32!=0){
|
||||
else if (val32!=0){
|
||||
DBG_8192C("txdmastatu(%x)\n",val32);
|
||||
psrtpriv->Wifi_Error_Status = WIFI_MAC_TXDMA_ERROR;
|
||||
}
|
||||
|
||||
if(WIFI_STATUS_SUCCESS !=psrtpriv->Wifi_Error_Status)
|
||||
if (WIFI_STATUS_SUCCESS !=psrtpriv->Wifi_Error_Status)
|
||||
{
|
||||
DBG_8192C("==>%s error_status(0x%x) \n",__FUNCTION__,psrtpriv->Wifi_Error_Status);
|
||||
status = (psrtpriv->Wifi_Error_Status &( ~(USB_READ_PORT_FAIL|USB_WRITE_PORT_FAIL)));
|
||||
|
|
|
@ -101,7 +101,7 @@ _func_enter_;
|
|||
|
||||
pstapriv->pallocated_stainfo_buf = rtw_zvmalloc (sizeof(struct sta_info) * NUM_STA+ 4);
|
||||
|
||||
if(!pstapriv->pallocated_stainfo_buf)
|
||||
if (!pstapriv->pallocated_stainfo_buf)
|
||||
return _FAIL;
|
||||
|
||||
pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 4 -
|
||||
|
@ -119,7 +119,7 @@ _func_enter_;
|
|||
psta = (struct sta_info *)(pstapriv->pstainfo_buf);
|
||||
|
||||
|
||||
for(i = 0; i < NUM_STA; i++)
|
||||
for (i = 0; i < NUM_STA; i++)
|
||||
{
|
||||
_rtw_init_stainfo(psta);
|
||||
|
||||
|
@ -212,7 +212,7 @@ void rtw_mfree_stainfo(struct sta_info *psta)
|
|||
{
|
||||
_func_enter_;
|
||||
|
||||
if(&psta->lock != NULL)
|
||||
if (&psta->lock != NULL)
|
||||
_rtw_spinlock_free(&psta->lock);
|
||||
|
||||
_rtw_free_sta_xmit_priv_lock(&psta->sta_xmitpriv);
|
||||
|
@ -283,11 +283,11 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
|
|||
int index;
|
||||
|
||||
_func_enter_;
|
||||
if(pstapriv){
|
||||
if (pstapriv){
|
||||
|
||||
/* delete all reordering_ctrl_timer */
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
for(index = 0; index < NUM_STA; index++)
|
||||
for (index = 0; index < NUM_STA; index++)
|
||||
{
|
||||
phead = &(pstapriv->sta_hash[index]);
|
||||
plist = get_next(phead);
|
||||
|
@ -298,7 +298,7 @@ _func_enter_;
|
|||
psta = LIST_CONTAINOR(plist, struct sta_info ,hash_list);
|
||||
plist = get_next(plist);
|
||||
|
||||
for(i=0; i < 16 ; i++)
|
||||
for (i=0; i < 16 ; i++)
|
||||
{
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
|
||||
|
@ -310,7 +310,7 @@ _func_enter_;
|
|||
|
||||
rtw_mfree_sta_priv_lock(pstapriv);
|
||||
|
||||
if(pstapriv->pallocated_stainfo_buf) {
|
||||
if (pstapriv->pallocated_stainfo_buf) {
|
||||
rtw_vmfree(pstapriv->pallocated_stainfo_buf, sizeof(struct sta_info)*NUM_STA+4);
|
||||
}
|
||||
}
|
||||
|
@ -362,7 +362,7 @@ _func_enter_;
|
|||
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_info_,("rtw_alloc_stainfo: index = %x", index));
|
||||
|
||||
if(index >= NUM_STA){
|
||||
if (index >= NUM_STA){
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("ERROR=> rtw_alloc_stainfo: index >= NUM_STA"));
|
||||
psta= NULL;
|
||||
goto exit;
|
||||
|
@ -382,7 +382,7 @@ _func_enter_;
|
|||
// In this case, this packet will be dropped by recv_decache function if we use the 0x00 as the default value for tid_rxseq variable.
|
||||
// So, we initialize the tid_rxseq variable as the 0xffff.
|
||||
|
||||
for( i = 0; i < 16; i++ )
|
||||
for ( i = 0; i < 16; i++ )
|
||||
{
|
||||
_rtw_memcpy( &psta->sta_recvpriv.rxcache.tid_rxseq[ i ], &wRxSeqInitialValue, 2 );
|
||||
}
|
||||
|
@ -403,7 +403,7 @@ _func_enter_;
|
|||
#endif //CONFIG_TDLS
|
||||
|
||||
//for A-MPDU Rx reordering buffer control
|
||||
for(i=0; i < 16 ; i++)
|
||||
for (i=0; i < 16 ; i++)
|
||||
{
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
|
||||
|
@ -532,7 +532,7 @@ _func_enter_;
|
|||
#endif //CONFIG_TDLS
|
||||
|
||||
//for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer
|
||||
for(i=0; i < 16 ; i++)
|
||||
for (i=0; i < 16 ; i++)
|
||||
{
|
||||
_irqL irqL;
|
||||
_list *phead, *plist;
|
||||
|
@ -552,7 +552,7 @@ _func_enter_;
|
|||
phead = get_list_head(ppending_recvframe_queue);
|
||||
plist = get_next(phead);
|
||||
|
||||
while(!rtw_is_list_empty(phead))
|
||||
while (!rtw_is_list_empty(phead))
|
||||
{
|
||||
prframe = LIST_CONTAINOR(plist, union recv_frame, u);
|
||||
|
||||
|
@ -642,12 +642,12 @@ void rtw_free_all_stainfo(_adapter *padapter)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if(pstapriv->asoc_sta_count==1)
|
||||
if (pstapriv->asoc_sta_count==1)
|
||||
goto exit;
|
||||
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
for(index=0; index< NUM_STA; index++)
|
||||
for (index=0; index< NUM_STA; index++)
|
||||
{
|
||||
phead = &(pstapriv->sta_hash[index]);
|
||||
plist = get_next(phead);
|
||||
|
@ -658,7 +658,7 @@ _func_enter_;
|
|||
|
||||
plist = get_next(plist);
|
||||
|
||||
if(pbcmc_stainfo!=psta)
|
||||
if (pbcmc_stainfo!=psta)
|
||||
rtw_free_stainfo(padapter , psta);
|
||||
|
||||
}
|
||||
|
@ -690,10 +690,10 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if(hwaddr==NULL)
|
||||
if (hwaddr==NULL)
|
||||
return NULL;
|
||||
|
||||
if(IS_MCAST(hwaddr))
|
||||
if (IS_MCAST(hwaddr))
|
||||
{
|
||||
addr = bc_addr;
|
||||
}
|
||||
|
@ -744,7 +744,7 @@ _func_enter_;
|
|||
|
||||
psta = rtw_alloc_stainfo(pstapriv, bcast_addr);
|
||||
|
||||
if(psta==NULL){
|
||||
if (psta==NULL){
|
||||
res=_FAIL;
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("rtw_alloc_stainfo fail"));
|
||||
goto exit;
|
||||
|
@ -803,9 +803,9 @@ u8 rtw_access_ctrl(_adapter *padapter, u8 *mac_addr)
|
|||
paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
|
||||
plist = get_next(plist);
|
||||
|
||||
if(_rtw_memcmp(paclnode->addr, mac_addr, ETH_ALEN))
|
||||
if (_rtw_memcmp(paclnode->addr, mac_addr, ETH_ALEN))
|
||||
{
|
||||
if(paclnode->valid == _TRUE)
|
||||
if (paclnode->valid == _TRUE)
|
||||
{
|
||||
match = _TRUE;
|
||||
break;
|
||||
|
@ -815,11 +815,11 @@ u8 rtw_access_ctrl(_adapter *padapter, u8 *mac_addr)
|
|||
_exit_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
|
||||
|
||||
if(pacl_list->mode == 1)//accept unless in deny list
|
||||
if (pacl_list->mode == 1)//accept unless in deny list
|
||||
{
|
||||
res = (match == _TRUE) ? _FALSE:_TRUE;
|
||||
}
|
||||
else if(pacl_list->mode == 2)//deny unless in accept list
|
||||
else if (pacl_list->mode == 2)//deny unless in accept list
|
||||
{
|
||||
res = (match == _TRUE) ? _TRUE:_FALSE;
|
||||
}
|
||||
|
|
320
core/rtw_tdls.c
320
core/rtw_tdls.c
File diff suppressed because it is too large
Load diff
156
core/rtw_wapi.c
156
core/rtw_wapi.c
|
@ -26,14 +26,14 @@ void WapiFreeAllStaInfo(_adapter *padapter)
|
|||
rtw_wapi_return_all_sta_info(padapter);
|
||||
|
||||
//Sta Info List
|
||||
while(!list_empty(&(pWapiInfo->wapiSTAIdleList)))
|
||||
while (!list_empty(&(pWapiInfo->wapiSTAIdleList)))
|
||||
{
|
||||
pWapiStaInfo = (PRT_WAPI_STA_INFO)list_entry(pWapiInfo->wapiSTAIdleList.next, RT_WAPI_STA_INFO, list);
|
||||
list_del_init(&pWapiStaInfo->list);
|
||||
}
|
||||
|
||||
//BKID List
|
||||
while(!list_empty(&(pWapiInfo->wapiBKIDIdleList)))
|
||||
while (!list_empty(&(pWapiInfo->wapiBKIDIdleList)))
|
||||
{
|
||||
pWapiBkid = (PRT_WAPI_BKID)list_entry(pWapiInfo->wapiBKIDIdleList.next, RT_WAPI_BKID, list);
|
||||
list_del_init(&pWapiBkid->list);
|
||||
|
@ -64,7 +64,7 @@ void WapiSetIE(_adapter *padapter)
|
|||
memcpy(pWapiInfo->wapiIE+pWapiInfo->wapiIELength, &akmCnt, 2);
|
||||
pWapiInfo->wapiIELength +=2;
|
||||
|
||||
if(pWapiInfo->bWapiPSK){
|
||||
if (pWapiInfo->bWapiPSK){
|
||||
memcpy(pWapiInfo->wapiIE+pWapiInfo->wapiIELength,OUI, 3);
|
||||
pWapiInfo->wapiIELength +=3;
|
||||
pWapiInfo->wapiIE[pWapiInfo->wapiIELength] = 0x2;
|
||||
|
@ -112,9 +112,9 @@ u32 WapiComparePN(u8 *PN1, u8 *PN2)
|
|||
|
||||
for (i=16; i>0; i--)
|
||||
{
|
||||
if(PN1[i-1] == PN2[i-1])
|
||||
if (PN1[i-1] == PN2[i-1])
|
||||
continue;
|
||||
else if(PN1[i-1] > PN2[i-1])
|
||||
else if (PN1[i-1] > PN2[i-1])
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
|
@ -136,9 +136,9 @@ WapiGetEntryForCamWrite(_adapter *padapter,u8 *pMacAddr,u8 KID,BOOLEAN IsMsk)
|
|||
pWapiInfo = &padapter->wapiInfo;
|
||||
|
||||
//exist?
|
||||
for(i=0;i<WAPI_CAM_ENTRY_NUM;i++)
|
||||
for (i=0;i<WAPI_CAM_ENTRY_NUM;i++)
|
||||
{
|
||||
if(pWapiInfo->wapiCamEntry[i].IsUsed
|
||||
if (pWapiInfo->wapiCamEntry[i].IsUsed
|
||||
&& (_rtw_memcmp(pMacAddr, pWapiInfo->wapiCamEntry[i].PeerMacAddr, ETH_ALEN) == _TRUE)
|
||||
&& pWapiInfo->wapiCamEntry[i].keyidx == KID
|
||||
&& pWapiInfo->wapiCamEntry[i].type == IsMsk)
|
||||
|
@ -148,11 +148,11 @@ WapiGetEntryForCamWrite(_adapter *padapter,u8 *pMacAddr,u8 KID,BOOLEAN IsMsk)
|
|||
}
|
||||
}
|
||||
|
||||
if(i == WAPI_CAM_ENTRY_NUM) //not found
|
||||
if (i == WAPI_CAM_ENTRY_NUM) //not found
|
||||
{
|
||||
for(i=0;i<WAPI_CAM_ENTRY_NUM;i++)
|
||||
for (i=0;i<WAPI_CAM_ENTRY_NUM;i++)
|
||||
{
|
||||
if(pWapiInfo->wapiCamEntry[i].IsUsed == 0)
|
||||
if (pWapiInfo->wapiCamEntry[i].IsUsed == 0)
|
||||
{
|
||||
pWapiInfo->wapiCamEntry[i].IsUsed = 1;
|
||||
pWapiInfo->wapiCamEntry[i].type = IsMsk;
|
||||
|
@ -168,7 +168,7 @@ WapiGetEntryForCamWrite(_adapter *padapter,u8 *pMacAddr,u8 KID,BOOLEAN IsMsk)
|
|||
return ret;
|
||||
|
||||
/*
|
||||
if(RTIsListEmpty(&pWapiInfo->wapiCamIdleList)){
|
||||
if (RTIsListEmpty(&pWapiInfo->wapiCamIdleList)){
|
||||
RT_TRACE(COMP_SEC,DBG_LOUD,("No Entry for wapi!!!\n"));
|
||||
return 0;
|
||||
}
|
||||
|
@ -190,9 +190,9 @@ u8 WapiGetEntryForCamClear(_adapter *padapter,u8 *pPeerMac,u8 keyid,u8 IsMsk)
|
|||
|
||||
pWapiInfo = &padapter->wapiInfo;
|
||||
|
||||
for(i=0;i<WAPI_CAM_ENTRY_NUM;i++)
|
||||
for (i=0;i<WAPI_CAM_ENTRY_NUM;i++)
|
||||
{
|
||||
if(pWapiInfo->wapiCamEntry[i].IsUsed
|
||||
if (pWapiInfo->wapiCamEntry[i].IsUsed
|
||||
&& (_rtw_memcmp(pPeerMac, pWapiInfo->wapiCamEntry[i].PeerMacAddr, ETH_ALEN) == _TRUE)
|
||||
&& pWapiInfo->wapiCamEntry[i].keyidx == keyid
|
||||
&& pWapiInfo->wapiCamEntry[i].type == IsMsk)
|
||||
|
@ -209,16 +209,16 @@ u8 WapiGetEntryForCamClear(_adapter *padapter,u8 *pPeerMac,u8 keyid,u8 IsMsk)
|
|||
WAPI_TRACE(WAPI_API,"<====WapiGetReturnCamEntry(), No this cam entry.\n");
|
||||
return 0xff;
|
||||
/*
|
||||
if(RTIsListEmpty(&pWapiInfo->wapiCamUsedList)){
|
||||
if (RTIsListEmpty(&pWapiInfo->wapiCamUsedList)){
|
||||
RT_TRACE(COMP_SEC,DBG_LOUD,("No Entry for wapi!!!\n"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pList = &pWapiInfo->wapiCamUsedList;
|
||||
while(pList->Flink != &pWapiInfo->wapiCamUsedList)
|
||||
while (pList->Flink != &pWapiInfo->wapiCamUsedList)
|
||||
{
|
||||
pEntry = (PRT_WAPI_CAM_ENTRY)pList->Flink;
|
||||
if(PlatformCompareMemory(pPeerMac,pEntry->PeerMacAddr, ETHER_ADDRLEN)== 0
|
||||
if (PlatformCompareMemory(pPeerMac,pEntry->PeerMacAddr, ETHER_ADDRLEN)== 0
|
||||
&& keyid == pEntry->keyidx)
|
||||
{
|
||||
RTRemoveEntryList(pList);
|
||||
|
@ -270,7 +270,7 @@ u8 WapiWriteOneCamEntry(
|
|||
|
||||
WAPI_TRACE(WAPI_API, "===========> %s\n", __FUNCTION__);
|
||||
|
||||
if(EntryId >= 32)
|
||||
if (EntryId >= 32)
|
||||
{
|
||||
WAPI_TRACE(WAPI_ERR, "<=== CamAddOneEntry(): ulKeyId exceed!\n");
|
||||
return retVal;
|
||||
|
@ -278,11 +278,11 @@ u8 WapiWriteOneCamEntry(
|
|||
|
||||
usConfig=usConfig|(0x01<<15)|((u16)(EncAlg)<<2)|(KeyId);
|
||||
|
||||
if(EncAlg == _SMS4_ )
|
||||
if (EncAlg == _SMS4_ )
|
||||
{
|
||||
if(bGroupKey == 1)
|
||||
if (bGroupKey == 1)
|
||||
usConfig |= (0x01<<6);
|
||||
if((EntryId % 2)==1) // ==0 sec key; == 1mic key
|
||||
if ((EntryId % 2)==1) // ==0 sec key; == 1mic key
|
||||
usConfig |= (0x01<<5);
|
||||
}
|
||||
|
||||
|
@ -312,7 +312,7 @@ void rtw_wapi_init(_adapter *padapter)
|
|||
//Init BKID List
|
||||
INIT_LIST_HEAD(&pWapiInfo->wapiBKIDIdleList);
|
||||
INIT_LIST_HEAD(&pWapiInfo->wapiBKIDStoreList);
|
||||
for(i=0;i<WAPI_MAX_BKID_NUM;i++)
|
||||
for (i=0;i<WAPI_MAX_BKID_NUM;i++)
|
||||
{
|
||||
list_add_tail(&pWapiInfo->wapiBKID[i].list, &pWapiInfo->wapiBKIDIdleList);
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ void rtw_wapi_init(_adapter *padapter)
|
|||
//Init STA List
|
||||
INIT_LIST_HEAD(&pWapiInfo->wapiSTAIdleList);
|
||||
INIT_LIST_HEAD(&pWapiInfo->wapiSTAUsedList);
|
||||
for(i=0;i<WAPI_MAX_STAINFO_NUM;i++)
|
||||
for (i=0;i<WAPI_MAX_STAINFO_NUM;i++)
|
||||
{
|
||||
list_add_tail(&pWapiInfo->wapiSta[i].list, &pWapiInfo->wapiSTAIdleList);
|
||||
}
|
||||
|
@ -395,7 +395,7 @@ u8 rtw_wapi_is_wai_packet(_adapter* padapter,u8 *pkt_data)
|
|||
}
|
||||
|
||||
pTaddr = GetAddr2Ptr(pkt_data);
|
||||
if(list_empty(&pWapiInfo->wapiSTAUsedList)){
|
||||
if (list_empty(&pWapiInfo->wapiSTAUsedList)){
|
||||
bFind = false;
|
||||
}else{
|
||||
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list){
|
||||
|
@ -414,7 +414,7 @@ u8 rtw_wapi_is_wai_packet(_adapter* padapter,u8 *pkt_data)
|
|||
}
|
||||
|
||||
// 88b4?
|
||||
if( (pkt_data[Offset_TypeWAI]==0x88) && (pkt_data[Offset_TypeWAI+1]==0xb4) ){
|
||||
if ( (pkt_data[Offset_TypeWAI]==0x88) && (pkt_data[Offset_TypeWAI+1]==0xb4) ){
|
||||
WaiPkt = pkt_data[Offset_TypeWAI+5];
|
||||
|
||||
psecuritypriv->hw_decrypted = _TRUE;
|
||||
|
@ -494,27 +494,27 @@ u8 rtw_wapi_check_for_drop(
|
|||
return false;
|
||||
}
|
||||
|
||||
if(precv_hdr->bIsWaiPacket !=0)
|
||||
if (precv_hdr->bIsWaiPacket !=0)
|
||||
{
|
||||
if(precv_hdr->bIsWaiPacket== 0x8)
|
||||
if (precv_hdr->bIsWaiPacket== 0x8)
|
||||
{
|
||||
|
||||
DBG_871X("rtw_wapi_check_for_drop: dump packet \n");
|
||||
for(i=0;i<50;i++)
|
||||
for (i=0;i<50;i++)
|
||||
{
|
||||
DBG_871X("%02X ",ptr[i]);
|
||||
if((i+1) %8 ==0)
|
||||
if ((i+1) %8 ==0)
|
||||
DBG_871X("\n");
|
||||
}
|
||||
DBG_871X("\n rtw_wapi_check_for_drop: dump packet \n");
|
||||
|
||||
for(i=0;i<16;i++)
|
||||
for (i=0;i<16;i++)
|
||||
{
|
||||
if(ptr[i+27] !=0)
|
||||
if (ptr[i+27] !=0)
|
||||
break;
|
||||
}
|
||||
|
||||
if(i== 16)
|
||||
if (i== 16)
|
||||
{
|
||||
WAPI_TRACE(WAPI_RX,"rtw_wapi_check_for_drop: drop with zero BKID \n");
|
||||
return true;
|
||||
|
@ -528,7 +528,7 @@ u8 rtw_wapi_check_for_drop(
|
|||
return false;
|
||||
}
|
||||
|
||||
if(list_empty(&pWapiInfo->wapiSTAUsedList)){
|
||||
if (list_empty(&pWapiInfo->wapiSTAUsedList)){
|
||||
bFind = false;
|
||||
}else{
|
||||
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
|
||||
|
@ -540,9 +540,9 @@ u8 rtw_wapi_check_for_drop(
|
|||
}
|
||||
WAPI_TRACE(WAPI_RX, "%s: bFind=%d prxb->WapiSrcAddr="MAC_FMT"\n", __FUNCTION__, bFind, MAC_ARG(precv_hdr->WapiSrcAddr));
|
||||
|
||||
if(bFind)
|
||||
if (bFind)
|
||||
{
|
||||
if(IS_MCAST(precv_hdr->attrib.ra))
|
||||
if (IS_MCAST(precv_hdr->attrib.ra))
|
||||
{
|
||||
WAPI_TRACE(WAPI_RX,"rtw_wapi_check_for_drop: multicast case \n");
|
||||
pLastRecvPN = pWapiSta->lastRxMulticastPN;
|
||||
|
@ -550,7 +550,7 @@ u8 rtw_wapi_check_for_drop(
|
|||
else
|
||||
{
|
||||
WAPI_TRACE(WAPI_RX,"rtw_wapi_check_for_drop: unicast case \n");
|
||||
switch(precv_hdr->UserPriority)
|
||||
switch (precv_hdr->UserPriority)
|
||||
{
|
||||
case 0:
|
||||
case 3:
|
||||
|
@ -574,10 +574,10 @@ u8 rtw_wapi_check_for_drop(
|
|||
}
|
||||
}
|
||||
|
||||
if(!WapiComparePN(precv_hdr->WapiTempPN,pLastRecvPN))
|
||||
if (!WapiComparePN(precv_hdr->WapiTempPN,pLastRecvPN))
|
||||
{
|
||||
WAPI_TRACE(WAPI_RX,"%s: Equal PN!!\n",__FUNCTION__);
|
||||
if(IS_MCAST(precv_hdr->attrib.ra))
|
||||
if (IS_MCAST(precv_hdr->attrib.ra))
|
||||
_rtw_memcpy(pLastRecvPN,WapiAEMultiCastPNInitialValueSrc,16);
|
||||
else
|
||||
_rtw_memcpy(pLastRecvPN,WapiAEPNInitialValueSrc,16);
|
||||
|
@ -658,7 +658,7 @@ void rtw_build_assoc_req_wapi_ie(_adapter *padapter, unsigned char *pframe, stru
|
|||
WapiSetIE(padapter);
|
||||
WapiIELength = pWapiInfo->wapiIELength;
|
||||
bkidNum = 0;
|
||||
if(!list_empty(&(pWapiInfo->wapiBKIDStoreList))){
|
||||
if (!list_empty(&(pWapiInfo->wapiBKIDStoreList))){
|
||||
list_for_each_entry(pWapiBKID, &pWapiInfo->wapiBKIDStoreList, list) {
|
||||
bkidNum ++;
|
||||
_rtw_memcpy(pWapiInfo->wapiIE+WapiIELength+2, pWapiBKID->bkid,16);
|
||||
|
@ -726,9 +726,9 @@ void rtw_wapi_return_one_sta_info(_adapter *padapter, u8 *MacAddr)
|
|||
return;
|
||||
}
|
||||
|
||||
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE))
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
|
||||
{
|
||||
while(!list_empty(&(pWapiInfo->wapiBKIDStoreList)))
|
||||
while (!list_empty(&(pWapiInfo->wapiBKIDStoreList)))
|
||||
{
|
||||
pWapiBkid = (PRT_WAPI_BKID)list_entry(pWapiInfo->wapiBKIDStoreList.next, RT_WAPI_BKID, list);
|
||||
list_del_init(&pWapiBkid->list);
|
||||
|
@ -742,7 +742,7 @@ void rtw_wapi_return_one_sta_info(_adapter *padapter, u8 *MacAddr)
|
|||
|
||||
|
||||
//Remove STA info
|
||||
if(list_empty(&(pWapiInfo->wapiSTAUsedList))){
|
||||
if (list_empty(&(pWapiInfo->wapiSTAUsedList))){
|
||||
WAPI_TRACE(WAPI_API, " %s: wapiSTAUsedList is null \n", __FUNCTION__);
|
||||
return;
|
||||
}else{
|
||||
|
@ -758,19 +758,19 @@ void rtw_wapi_return_one_sta_info(_adapter *padapter, u8 *MacAddr)
|
|||
|
||||
DBG_871X("peer Addr %02x-%02x-%02x-%02x-%02x-%02x \n",pWapiStaInfo->PeerMacAddr[0],pWapiStaInfo->PeerMacAddr[1],pWapiStaInfo->PeerMacAddr[2],pWapiStaInfo->PeerMacAddr[3],pWapiStaInfo->PeerMacAddr[4],pWapiStaInfo->PeerMacAddr[5]);
|
||||
|
||||
if(pWapiStaInfo == NULL)
|
||||
if (pWapiStaInfo == NULL)
|
||||
{
|
||||
WAPI_TRACE(WAPI_API, " %s: pWapiStaInfo == NULL Case \n", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
if(pWapiStaInfo->PeerMacAddr == NULL)
|
||||
if (pWapiStaInfo->PeerMacAddr == NULL)
|
||||
{
|
||||
WAPI_TRACE(WAPI_API, " %s: pWapiStaInfo->PeerMacAddr == NULL Case \n", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
if(MacAddr == NULL)
|
||||
if (MacAddr == NULL)
|
||||
{
|
||||
WAPI_TRACE(WAPI_API, " %s: MacAddr == NULL Case \n", __FUNCTION__);
|
||||
return;
|
||||
|
@ -788,7 +788,7 @@ void rtw_wapi_return_one_sta_info(_adapter *padapter, u8 *MacAddr)
|
|||
}
|
||||
#endif
|
||||
|
||||
while(!list_empty(&(pWapiInfo->wapiSTAUsedList)))
|
||||
while (!list_empty(&(pWapiInfo->wapiSTAUsedList)))
|
||||
{
|
||||
pWapiStaInfo = (PRT_WAPI_STA_INFO)list_entry(pWapiInfo->wapiSTAUsedList.next, RT_WAPI_STA_INFO, list);
|
||||
|
||||
|
@ -822,7 +822,7 @@ void rtw_wapi_return_all_sta_info(_adapter *padapter)
|
|||
}
|
||||
|
||||
//Sta Info List
|
||||
while(!list_empty(&(pWapiInfo->wapiSTAUsedList)))
|
||||
while (!list_empty(&(pWapiInfo->wapiSTAUsedList)))
|
||||
{
|
||||
pWapiStaInfo = (PRT_WAPI_STA_INFO)list_entry(pWapiInfo->wapiSTAUsedList.next, RT_WAPI_STA_INFO, list);
|
||||
list_del_init(&pWapiStaInfo->list);
|
||||
|
@ -832,7 +832,7 @@ void rtw_wapi_return_all_sta_info(_adapter *padapter)
|
|||
}
|
||||
|
||||
//BKID List
|
||||
while(!list_empty(&(pWapiInfo->wapiBKIDStoreList)))
|
||||
while (!list_empty(&(pWapiInfo->wapiBKIDStoreList)))
|
||||
{
|
||||
pWapiBkid = (PRT_WAPI_BKID)list_entry(pWapiInfo->wapiBKIDStoreList.next, RT_WAPI_BKID, list);
|
||||
list_del_init(&pWapiBkid->list);
|
||||
|
@ -855,25 +855,25 @@ void rtw_wapi_clear_cam_entry(_adapter *padapter, u8 *pMacAddr)
|
|||
}
|
||||
|
||||
UcIndex = WapiGetEntryForCamClear(padapter, pMacAddr, 0, 0);
|
||||
if(UcIndex != 0xff){
|
||||
if (UcIndex != 0xff){
|
||||
//CAM_mark_invalid(Adapter, UcIndex);
|
||||
CAM_empty_entry(padapter, UcIndex);
|
||||
}
|
||||
|
||||
UcIndex = WapiGetEntryForCamClear(padapter, pMacAddr, 1, 0);
|
||||
if(UcIndex != 0xff){
|
||||
if (UcIndex != 0xff){
|
||||
//CAM_mark_invalid(Adapter, UcIndex);
|
||||
CAM_empty_entry(padapter, UcIndex);
|
||||
}
|
||||
|
||||
UcIndex = WapiGetEntryForCamClear(padapter, pMacAddr, 0, 1);
|
||||
if(UcIndex != 0xff){
|
||||
if (UcIndex != 0xff){
|
||||
//CAM_mark_invalid(Adapter, UcIndex);
|
||||
CAM_empty_entry(padapter, UcIndex);
|
||||
}
|
||||
|
||||
UcIndex = WapiGetEntryForCamClear(padapter, pMacAddr, 1, 1);
|
||||
if(UcIndex != 0xff){
|
||||
if (UcIndex != 0xff){
|
||||
//CAM_mark_invalid(padapter, UcIndex);
|
||||
CAM_empty_entry(padapter, UcIndex);
|
||||
}
|
||||
|
@ -916,7 +916,7 @@ void rtw_wapi_set_key(_adapter *padapter, RT_WAPI_KEY *pWapiKey, RT_WAPI_STA_INF
|
|||
EncAlgo = _SMS4_;
|
||||
|
||||
//For Tx bc/mc pkt,use defualt key entry
|
||||
if(bUseDefaultKey)
|
||||
if (bUseDefaultKey)
|
||||
{
|
||||
// when WAPI update key, keyid will be 0 or 1 by turns.
|
||||
if (pWapiKey->keyId == 0)
|
||||
|
@ -930,7 +930,7 @@ void rtw_wapi_set_key(_adapter *padapter, RT_WAPI_KEY *pWapiKey, RT_WAPI_STA_INF
|
|||
EntryId = WapiGetEntryForCamWrite(padapter,pMacAddr,pWapiKey->keyId,bGroupKey);
|
||||
}
|
||||
|
||||
if(EntryId == 0xff){
|
||||
if (EntryId == 0xff){
|
||||
WAPI_TRACE(WAPI_API, "===>No entry for WAPI setkey! !!\n");
|
||||
return;
|
||||
}
|
||||
|
@ -986,8 +986,8 @@ void wapi_test_set_key(struct _adapter *padapter, u8* buf)
|
|||
bUpdate = data[3];
|
||||
memcpy(PeerAddr,data+4,6);
|
||||
|
||||
if(data[0] == 0x3){
|
||||
if(!list_empty(&(pWapiInfo->wapiBKIDIdleList))){
|
||||
if (data[0] == 0x3){
|
||||
if (!list_empty(&(pWapiInfo->wapiBKIDIdleList))){
|
||||
pWapiBkid = (PRT_WAPI_BKID)list_entry(pWapiInfo->wapiBKIDIdleList.next, RT_WAPI_BKID, list);
|
||||
list_del_init(&pWapiBkid->list);
|
||||
memcpy(pWapiBkid->bkid, data+10, 16);
|
||||
|
@ -996,13 +996,13 @@ void wapi_test_set_key(struct _adapter *padapter, u8* buf)
|
|||
}
|
||||
}else{
|
||||
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
|
||||
if(!memcmp(pWapiSta->PeerMacAddr,PeerAddr,6)){
|
||||
if (!memcmp(pWapiSta->PeerMacAddr,PeerAddr,6)){
|
||||
pWapiSta->bAuthenticatorInUpdata = false;
|
||||
switch(data[0]){
|
||||
switch (data[0]){
|
||||
case 1: //usk
|
||||
if(bAuthenticator){ //authenticator
|
||||
if (bAuthenticator){ //authenticator
|
||||
memcpy(pWapiSta->lastTxUnicastPN,WapiAEPNInitialValueSrc,16);
|
||||
if(!bUpdate) { //first
|
||||
if (!bUpdate) { //first
|
||||
WAPI_TRACE(WAPI_INIT,"AE fisrt set usk \n");
|
||||
pWapiSta->wapiUsk.bSet = true;
|
||||
memcpy(pWapiSta->wapiUsk.dataKey,data+10,16);
|
||||
|
@ -1029,9 +1029,9 @@ void wapi_test_set_key(struct _adapter *padapter, u8* buf)
|
|||
}
|
||||
}
|
||||
else{
|
||||
if(!bUpdate){
|
||||
if (!bUpdate){
|
||||
WAPI_TRACE(WAPI_INIT,"ASUE fisrt set usk \n");
|
||||
if(bTxEnable){
|
||||
if (bTxEnable){
|
||||
pWapiSta->wapiUsk.bTxEnable = true;
|
||||
memcpy(pWapiSta->lastTxUnicastPN,WapiASUEPNInitialValueSrc,16);
|
||||
}else{
|
||||
|
@ -1043,9 +1043,9 @@ void wapi_test_set_key(struct _adapter *padapter, u8* buf)
|
|||
}
|
||||
}else{
|
||||
WAPI_TRACE(WAPI_INIT,"ASUE update usk \n");
|
||||
if(bTxEnable){
|
||||
if (bTxEnable){
|
||||
pWapiSta->wapiUskUpdate.bTxEnable = true;
|
||||
if(pWapiSta->wapiUskUpdate.bSet){
|
||||
if (pWapiSta->wapiUskUpdate.bSet){
|
||||
memcpy(pWapiSta->wapiUsk.dataKey,pWapiSta->wapiUskUpdate.dataKey,16);
|
||||
memcpy(pWapiSta->wapiUsk.micKey,pWapiSta->wapiUskUpdate.micKey,16);
|
||||
pWapiSta->wapiUsk.keyId=pWapiSta->wapiUskUpdate.keyId;
|
||||
|
@ -1069,7 +1069,7 @@ void wapi_test_set_key(struct _adapter *padapter, u8* buf)
|
|||
}
|
||||
break;
|
||||
case 2: //msk
|
||||
if(bAuthenticator){ //authenticator
|
||||
if (bAuthenticator){ //authenticator
|
||||
pWapiInfo->wapiTxMsk.bSet = true;
|
||||
memcpy(pWapiInfo->wapiTxMsk.dataKey,data+10,16);
|
||||
memcpy(pWapiInfo->wapiTxMsk.micKey,data+26,16);
|
||||
|
@ -1077,9 +1077,9 @@ void wapi_test_set_key(struct _adapter *padapter, u8* buf)
|
|||
pWapiInfo->wapiTxMsk.bTxEnable = true;
|
||||
memcpy(pWapiInfo->lastTxMulticastPN,WapiAEMultiCastPNInitialValueSrc,16);
|
||||
|
||||
if(!bUpdate){ //first
|
||||
if (!bUpdate){ //first
|
||||
WAPI_TRACE(WAPI_INIT, "AE fisrt set msk \n");
|
||||
if(!pWapiSta->bSetkeyOk)
|
||||
if (!pWapiSta->bSetkeyOk)
|
||||
pWapiSta->bSetkeyOk = true;
|
||||
pWapiInfo->bFirstAuthentiateInProgress= false;
|
||||
}else{ //update
|
||||
|
@ -1090,14 +1090,14 @@ void wapi_test_set_key(struct _adapter *padapter, u8* buf)
|
|||
WAPI_DATA(WAPI_INIT, "SetKey - AE MSK Mic Key", pWapiInfo->wapiTxMsk.micKey, 16);
|
||||
}
|
||||
else{
|
||||
if(!bUpdate){
|
||||
if (!bUpdate){
|
||||
WAPI_TRACE(WAPI_INIT,"ASUE fisrt set msk \n");
|
||||
pWapiSta->wapiMsk.bSet = true;
|
||||
memcpy(pWapiSta->wapiMsk.dataKey,data+10,16);
|
||||
memcpy(pWapiSta->wapiMsk.micKey,data+26,16);
|
||||
pWapiSta->wapiMsk.keyId = *(data+42);
|
||||
pWapiSta->wapiMsk.bTxEnable = false;
|
||||
if(!pWapiSta->bSetkeyOk)
|
||||
if (!pWapiSta->bSetkeyOk)
|
||||
pWapiSta->bSetkeyOk = true;
|
||||
pWapiInfo->bFirstAuthentiateInProgress= false;
|
||||
WAPI_DATA(WAPI_INIT, "SetKey - ASUE MSK Data Key", pWapiSta->wapiMsk.dataKey, 16);
|
||||
|
@ -1209,13 +1209,13 @@ void rtw_wapi_get_iv(_adapter *padapter,u8 *pRA, u8*IV)
|
|||
|
||||
WAPI_DATA(WAPI_RX,"wapi_get_iv: pra",pRA,6);
|
||||
|
||||
if(IS_MCAST(pRA)){
|
||||
if(!pWapiInfo->wapiTxMsk.bTxEnable){
|
||||
if (IS_MCAST(pRA)){
|
||||
if (!pWapiInfo->wapiTxMsk.bTxEnable){
|
||||
WAPI_TRACE(WAPI_ERR,"%s: bTxEnable = 0!!\n",__FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
if(pWapiInfo->wapiTxMsk.keyId <= 1){
|
||||
if (pWapiInfo->wapiTxMsk.keyId <= 1){
|
||||
pWapiExt->KeyIdx = pWapiInfo->wapiTxMsk.keyId;
|
||||
pWapiExt->Reserved = 0;
|
||||
bPNOverflow = WapiIncreasePN(pWapiInfo->lastTxMulticastPN, 1);
|
||||
|
@ -1224,7 +1224,7 @@ void rtw_wapi_get_iv(_adapter *padapter,u8 *pRA, u8*IV)
|
|||
}
|
||||
else
|
||||
{
|
||||
if(list_empty(&pWapiInfo->wapiSTAUsedList)){
|
||||
if (list_empty(&pWapiInfo->wapiSTAUsedList)){
|
||||
WAPI_TRACE(WAPI_RX,"rtw_wapi_get_iv: list is empty \n");
|
||||
_rtw_memset(IV,10,18);
|
||||
return;
|
||||
|
@ -1242,11 +1242,11 @@ void rtw_wapi_get_iv(_adapter *padapter,u8 *pRA, u8*IV)
|
|||
WAPI_DATA(WAPI_RX,"Addr",pRA,6);
|
||||
|
||||
if (bFindMatchPeer){
|
||||
if((!pWapiSta->wapiUskUpdate.bTxEnable) && (!pWapiSta->wapiUsk.bTxEnable))
|
||||
if ((!pWapiSta->wapiUskUpdate.bTxEnable) && (!pWapiSta->wapiUsk.bTxEnable))
|
||||
return;
|
||||
|
||||
if (pWapiSta->wapiUsk.keyId <= 1){
|
||||
if(pWapiSta->wapiUskUpdate.bTxEnable)
|
||||
if (pWapiSta->wapiUskUpdate.bTxEnable)
|
||||
pWapiExt->KeyIdx = pWapiSta->wapiUskUpdate.keyId;
|
||||
else
|
||||
pWapiExt->KeyIdx = pWapiSta->wapiUsk.keyId;
|
||||
|
@ -1273,20 +1273,20 @@ bool rtw_wapi_drop_for_key_absent(_adapter *padapter,u8 *pRA)
|
|||
|
||||
WAPI_DATA(WAPI_RX,"rtw_wapi_drop_for_key_absent: ra ",pRA,6);
|
||||
|
||||
if(psecuritypriv->dot11PrivacyAlgrthm == _SMS4_)
|
||||
if (psecuritypriv->dot11PrivacyAlgrthm == _SMS4_)
|
||||
{
|
||||
if ((!padapter->WapiSupport) || (!pWapiInfo->bWapiEnable))
|
||||
return true;
|
||||
|
||||
if(IS_MCAST(pRA)){
|
||||
if(!pWapiInfo->wapiTxMsk.bTxEnable){
|
||||
if (IS_MCAST(pRA)){
|
||||
if (!pWapiInfo->wapiTxMsk.bTxEnable){
|
||||
bDrop = true;
|
||||
WAPI_TRACE(WAPI_RX,"rtw_wapi_drop_for_key_absent: multicast key is absent \n");
|
||||
return bDrop;
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(!list_empty(&pWapiInfo->wapiSTAUsedList)){
|
||||
if (!list_empty(&pWapiInfo->wapiSTAUsedList)){
|
||||
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list){
|
||||
WAPI_DATA(WAPI_RX,"rtw_wapi_drop_for_key_absent: pWapiSta->PeerMacAddr ",pWapiSta->PeerMacAddr,6);
|
||||
if (_rtw_memcmp(pRA, pWapiSta->PeerMacAddr, 6) == _TRUE){
|
||||
|
|
|
@ -163,19 +163,19 @@ void WapiSMS4Cryption(u8 *Key, u8 *IV, u8 *Input, u16 InputLength,
|
|||
*OutputLength = 0;
|
||||
remainder = InputLength & 0x0F;
|
||||
blockNum = InputLength >> 4;
|
||||
if(remainder !=0)
|
||||
if (remainder !=0)
|
||||
blockNum++;
|
||||
else
|
||||
remainder = 16;
|
||||
|
||||
for(k=0;k<16;k++)
|
||||
for (k=0;k<16;k++)
|
||||
tempIV[k] = IV[15-k];
|
||||
|
||||
memcpy(blockIn, tempIV, 16);
|
||||
|
||||
SMS4KeyExt((u8 *)Key, rk,CryptFlag);
|
||||
|
||||
for(i=0; i<blockNum-1; i++)
|
||||
for (i=0; i<blockNum-1; i++)
|
||||
{
|
||||
SMS4Crypt((u8 *)blockIn, blockOut, rk);
|
||||
xor_block(&Output[i*16], &Input[i*16], blockOut);
|
||||
|
@ -186,7 +186,7 @@ void WapiSMS4Cryption(u8 *Key, u8 *IV, u8 *Input, u16 InputLength,
|
|||
|
||||
SMS4Crypt((u8 *)blockIn, blockOut, rk);
|
||||
|
||||
for(j=0; j<remainder; j++)
|
||||
for (j=0; j<remainder; j++)
|
||||
{
|
||||
Output[i*16+j] = Input[i*16+j] ^ blockOut[j];
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ void WapiSMS4CalculateMic(u8 *Key, u8 *IV, u8 *Input1, u8 Input1Length,
|
|||
remainder = Input1Length & 0x0F;
|
||||
blockNum = Input1Length >> 4;
|
||||
|
||||
for(k=0;k<16;k++)
|
||||
for (k=0;k<16;k++)
|
||||
tempIV[k] = IV[15-k];
|
||||
|
||||
memcpy(BlockIn, tempIV, 16);
|
||||
|
@ -227,12 +227,12 @@ void WapiSMS4CalculateMic(u8 *Key, u8 *IV, u8 *Input1, u8 Input1Length,
|
|||
|
||||
SMS4Crypt((u8 *)BlockIn, BlockOut, rk);
|
||||
|
||||
for(i=0; i<blockNum; i++){
|
||||
for (i=0; i<blockNum; i++){
|
||||
xor_block(BlockIn, (Input1+i*16), BlockOut);
|
||||
SMS4Crypt((u8 *)BlockIn, BlockOut, rk);
|
||||
}
|
||||
|
||||
if(remainder !=0){
|
||||
if (remainder !=0){
|
||||
memset(TempBlock, 0, 16);
|
||||
memcpy(TempBlock, (Input1+blockNum*16), remainder);
|
||||
|
||||
|
@ -243,12 +243,12 @@ void WapiSMS4CalculateMic(u8 *Key, u8 *IV, u8 *Input1, u8 Input1Length,
|
|||
remainder = Input2Length & 0x0F;
|
||||
blockNum = Input2Length >> 4;
|
||||
|
||||
for(i=0; i<blockNum; i++){
|
||||
for (i=0; i<blockNum; i++){
|
||||
xor_block(BlockIn, (Input2+i*16), BlockOut);
|
||||
SMS4Crypt((u8 *)BlockIn, BlockOut, rk);
|
||||
}
|
||||
|
||||
if(remainder !=0){
|
||||
if (remainder !=0){
|
||||
memset(TempBlock, 0, 16);
|
||||
memcpy(TempBlock, (Input2+blockNum*16), remainder);
|
||||
|
||||
|
@ -302,7 +302,7 @@ void SecCalculateMicSMS4(
|
|||
QosOffset = 24;
|
||||
}
|
||||
|
||||
if((fc & 0x0088) == 0x0088){
|
||||
if ((fc & 0x0088) == 0x0088){
|
||||
memcpy((TempBuf+28), (pHeader+QosOffset), 2);
|
||||
TempLen += 2;
|
||||
//IV = pHeader + QosOffset + 2 + SNAP_SIZE + sizeof(u16) + 2;
|
||||
|
@ -343,9 +343,9 @@ u8 WapiIncreasePN(u8 *PN, u8 AddCount)
|
|||
return 1;
|
||||
//YJ,test,091102
|
||||
/*
|
||||
if(AddCount == 2){
|
||||
if (AddCount == 2){
|
||||
DBG_8192C("############################%s(): PN[0]=0x%x\n", __FUNCTION__, PN[0]);
|
||||
if(PN[0] == 0x48){
|
||||
if (PN[0] == 0x48){
|
||||
PN[0] += AddCount;
|
||||
return 1;
|
||||
}else{
|
||||
|
@ -380,7 +380,7 @@ void WapiGetLastRxUnicastPNForQoSData(
|
|||
)
|
||||
{
|
||||
WAPI_TRACE(WAPI_RX, "===========> %s\n", __FUNCTION__);
|
||||
switch(UserPriority)
|
||||
switch (UserPriority)
|
||||
{
|
||||
case 0:
|
||||
case 3:
|
||||
|
@ -413,7 +413,7 @@ void WapiSetLastRxUnicastPNForQoSData(
|
|||
)
|
||||
{
|
||||
WAPI_TRACE(WAPI_RX, "===========> %s\n", __FUNCTION__);
|
||||
switch(UserPriority)
|
||||
switch (UserPriority)
|
||||
{
|
||||
case 0:
|
||||
case 3:
|
||||
|
@ -461,7 +461,7 @@ u8 WapiCheckPnInSwDecrypt(
|
|||
pRaddr = header->addr1;
|
||||
fc = le16_to_cpu(header->frame_ctl);
|
||||
|
||||
if(GetToDs(&fc))
|
||||
if (GetToDs(&fc))
|
||||
pDaddr = header->addr3;
|
||||
else
|
||||
pDaddr = header->addr1;
|
||||
|
@ -511,12 +511,12 @@ int SecSMS4HeaderFillIV(_adapter *padapter, u8 *pxmitframe)
|
|||
WAPI_DATA(WAPI_TX, "FillIV - Before Fill IV", pskb->data, pskb->len);
|
||||
|
||||
//Address 1 is always receiver's address
|
||||
if( IS_MCAST(pRA) ){
|
||||
if(!pWapiInfo->wapiTxMsk.bTxEnable){
|
||||
if ( IS_MCAST(pRA) ){
|
||||
if (!pWapiInfo->wapiTxMsk.bTxEnable){
|
||||
WAPI_TRACE(WAPI_ERR,"%s: bTxEnable = 0!!\n",__FUNCTION__);
|
||||
return -2;
|
||||
}
|
||||
if(pWapiInfo->wapiTxMsk.keyId <= 1){
|
||||
if (pWapiInfo->wapiTxMsk.keyId <= 1){
|
||||
pWapiExt->KeyIdx = pWapiInfo->wapiTxMsk.keyId;
|
||||
pWapiExt->Reserved = 0;
|
||||
bPNOverflow = WapiIncreasePN(pWapiInfo->lastTxMulticastPN, 1);
|
||||
|
@ -533,18 +533,18 @@ int SecSMS4HeaderFillIV(_adapter *padapter, u8 *pxmitframe)
|
|||
}
|
||||
else{
|
||||
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
|
||||
if(!memcmp(pWapiSta->PeerMacAddr,pRA,6)){
|
||||
if (!memcmp(pWapiSta->PeerMacAddr,pRA,6)){
|
||||
bFindMatchPeer = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (bFindMatchPeer){
|
||||
if((!pWapiSta->wapiUskUpdate.bTxEnable) && (!pWapiSta->wapiUsk.bTxEnable)){
|
||||
if ((!pWapiSta->wapiUskUpdate.bTxEnable) && (!pWapiSta->wapiUsk.bTxEnable)){
|
||||
WAPI_TRACE(WAPI_ERR,"%s: bTxEnable = 0!!\n",__FUNCTION__);
|
||||
return -4;
|
||||
}
|
||||
if (pWapiSta->wapiUsk.keyId <= 1){
|
||||
if(pWapiSta->wapiUskUpdate.bTxEnable)
|
||||
if (pWapiSta->wapiUskUpdate.bTxEnable)
|
||||
pWapiExt->KeyIdx = pWapiSta->wapiUskUpdate.keyId;
|
||||
else
|
||||
pWapiExt->KeyIdx = pWapiSta->wapiUsk.keyId;
|
||||
|
@ -600,7 +600,7 @@ void SecSWSMS4Encryption(
|
|||
pRA = pframe + 4;
|
||||
|
||||
|
||||
if( IS_MCAST(pRA) ){
|
||||
if ( IS_MCAST(pRA) ){
|
||||
KeyIdx = pWapiInfo->wapiTxMsk.keyId;
|
||||
pIV = pWapiInfo->lastTxMulticastPN;
|
||||
pMicKey = pWapiInfo->wapiTxMsk.micKey;
|
||||
|
@ -689,7 +689,7 @@ u8 SecSWSMS4Decryption(
|
|||
IVOffset += 2;
|
||||
}
|
||||
|
||||
//if(GetHTC())
|
||||
//if (GetHTC())
|
||||
// IVOffset += 4;
|
||||
|
||||
//IVOffset += SNAP_SIZE + sizeof(u16);
|
||||
|
@ -719,7 +719,7 @@ u8 SecSWSMS4Decryption(
|
|||
return false;
|
||||
}
|
||||
|
||||
if( IS_MCAST(pRA) ){
|
||||
if ( IS_MCAST(pRA) ){
|
||||
WAPI_TRACE(WAPI_RX, "%s: Multicast decryption !!!\n", __FUNCTION__);
|
||||
if (pWapiSta->wapiMsk.keyId == KeyIdx && pWapiSta->wapiMsk.bSet){
|
||||
pLastRxPN = pWapiSta->lastRxMulticastPN;
|
||||
|
@ -748,8 +748,8 @@ u8 SecSWSMS4Decryption(
|
|||
WAPI_TRACE(WAPI_RX, "%s: Unicast decryption !!!\n", __FUNCTION__);
|
||||
if (pWapiSta->wapiUsk.keyId == KeyIdx && pWapiSta->wapiUsk.bSet){
|
||||
WAPI_TRACE(WAPI_RX, "%s: Use USK for Decryption!!!\n", __FUNCTION__);
|
||||
if(precv_hdr->bWapiCheckPNInDecrypt){
|
||||
if(GetFrameType(pskb->data) == WIFI_QOS_DATA_TYPE){
|
||||
if (precv_hdr->bWapiCheckPNInDecrypt){
|
||||
if (GetFrameType(pskb->data) == WIFI_QOS_DATA_TYPE){
|
||||
WapiGetLastRxUnicastPNForQoSData(TID, pWapiSta, lastRxPNforQoS);
|
||||
pLastRxPN = lastRxPNforQoS;
|
||||
}else{
|
||||
|
@ -758,7 +758,7 @@ u8 SecSWSMS4Decryption(
|
|||
if (!WapiComparePN(pRecvPN, pLastRxPN)){
|
||||
return false;
|
||||
}
|
||||
if(bQosData){
|
||||
if (bQosData){
|
||||
WapiSetLastRxUnicastPNForQoSData(TID, pRecvPN, pWapiSta);
|
||||
}else{
|
||||
memcpy(pWapiSta->lastRxUnicastPN, pRecvPN, 16);
|
||||
|
@ -780,12 +780,12 @@ u8 SecSWSMS4Decryption(
|
|||
}
|
||||
else if (pWapiSta->wapiUskUpdate.keyId == KeyIdx && pWapiSta->wapiUskUpdate.bSet ){
|
||||
WAPI_TRACE(WAPI_RX, "%s: Use Updated USK for Decryption!!!\n", __FUNCTION__);
|
||||
if(pWapiSta->bAuthenticatorInUpdata)
|
||||
if (pWapiSta->bAuthenticatorInUpdata)
|
||||
bUseUpdatedKey = true;
|
||||
else
|
||||
bUseUpdatedKey = false;
|
||||
|
||||
if(bQosData){
|
||||
if (bQosData){
|
||||
WapiSetLastRxUnicastPNForQoSData(TID, pRecvPN, pWapiSta);
|
||||
}else{
|
||||
memcpy(pWapiSta->lastRxUnicastPN, pRecvPN, 16);
|
||||
|
@ -861,7 +861,7 @@ u32 rtw_sms4_encrypt(_adapter *padapter, u8 *pxmitframe)
|
|||
return _FAIL;
|
||||
}
|
||||
|
||||
if(((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
|
||||
if (((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
|
||||
return _FAIL;
|
||||
|
||||
pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + TXDESC_OFFSET;
|
||||
|
|
|
@ -78,7 +78,7 @@ int cckrates_included(unsigned char *rate, int ratelen)
|
|||
{
|
||||
int i;
|
||||
|
||||
for(i = 0; i < ratelen; i++)
|
||||
for (i = 0; i < ratelen; i++)
|
||||
{
|
||||
if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
|
||||
(((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) )
|
||||
|
@ -93,7 +93,7 @@ int cckratesonly_included(unsigned char *rate, int ratelen)
|
|||
{
|
||||
int i;
|
||||
|
||||
for(i = 0; i < ratelen; i++)
|
||||
for (i = 0; i < ratelen; i++)
|
||||
{
|
||||
if ( (((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) &&
|
||||
(((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22) )
|
||||
|
@ -107,7 +107,7 @@ unsigned char networktype_to_raid(unsigned char network_type)
|
|||
{
|
||||
unsigned char raid;
|
||||
|
||||
switch(network_type)
|
||||
switch (network_type)
|
||||
{
|
||||
case WIRELESS_11B:
|
||||
raid = RATR_INX_WIRELESS_B;
|
||||
|
@ -147,7 +147,7 @@ u8 judge_network_type(_adapter *padapter, unsigned char *rate, int ratelen)
|
|||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
|
||||
if(pmlmeext->cur_channel > 14)
|
||||
if (pmlmeext->cur_channel > 14)
|
||||
{
|
||||
if (pmlmeinfo->HT_enable)
|
||||
{
|
||||
|
@ -167,7 +167,7 @@ u8 judge_network_type(_adapter *padapter, unsigned char *rate, int ratelen)
|
|||
{
|
||||
network_type |= WIRELESS_11B;
|
||||
}
|
||||
else if((cckrates_included(rate, ratelen)) == _TRUE)
|
||||
else if ((cckrates_included(rate, ratelen)) == _TRUE)
|
||||
{
|
||||
network_type |= WIRELESS_11BG;
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ int is_basicrate(_adapter *padapter, unsigned char rate)
|
|||
unsigned char val;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
|
||||
for(i = 0; i < NumRates; i++)
|
||||
for (i = 0; i < NumRates; i++)
|
||||
{
|
||||
val = pmlmeext->basicrate[i];
|
||||
|
||||
|
@ -318,10 +318,10 @@ void UpdateBrateTbl(
|
|||
u8 rate;
|
||||
|
||||
// 1M, 2M, 5.5M, 11M, 6M, 12M, 24M are mandatory.
|
||||
for(i=0;i<NDIS_802_11_LENGTH_RATES_EX;i++)
|
||||
for (i=0;i<NDIS_802_11_LENGTH_RATES_EX;i++)
|
||||
{
|
||||
rate = mBratesOS[i] & 0x7f;
|
||||
switch(rate)
|
||||
switch (rate)
|
||||
{
|
||||
case IEEE80211_CCK_RATE_1MB:
|
||||
case IEEE80211_CCK_RATE_2MB:
|
||||
|
@ -342,10 +342,10 @@ void UpdateBrateTblForSoftAP(u8 *bssrateset, u32 bssratelen)
|
|||
u8 i;
|
||||
u8 rate;
|
||||
|
||||
for(i=0;i<bssratelen;i++)
|
||||
for (i=0;i<bssratelen;i++)
|
||||
{
|
||||
rate = bssrateset[i] & 0x7f;
|
||||
switch(rate)
|
||||
switch (rate)
|
||||
{
|
||||
case IEEE80211_CCK_RATE_1MB:
|
||||
case IEEE80211_CCK_RATE_2MB:
|
||||
|
@ -364,7 +364,7 @@ void Save_DM_Func_Flag(_adapter *padapter)
|
|||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
_adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
if(pbuddy_adapter)
|
||||
if (pbuddy_adapter)
|
||||
rtw_hal_set_hwreg(pbuddy_adapter, HW_VAR_DM_FUNC_OP, (u8 *)(&bSaveFlag));
|
||||
#endif
|
||||
|
||||
|
@ -377,7 +377,7 @@ void Restore_DM_Func_Flag(_adapter *padapter)
|
|||
u8 bSaveFlag = _FALSE;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
_adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
if(pbuddy_adapter)
|
||||
if (pbuddy_adapter)
|
||||
rtw_hal_set_hwreg(pbuddy_adapter, HW_VAR_DM_FUNC_OP, (u8 *)(&bSaveFlag));
|
||||
#endif
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_OP, (u8 *)(&bSaveFlag));
|
||||
|
@ -389,10 +389,10 @@ void Switch_DM_Func(_adapter *padapter, u32 mode, u8 enable)
|
|||
_adapter *pbuddy_adapter = padapter->pbuddy_adapter;
|
||||
#endif
|
||||
|
||||
if(enable == _TRUE)
|
||||
if (enable == _TRUE)
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(pbuddy_adapter)
|
||||
if (pbuddy_adapter)
|
||||
rtw_hal_set_hwreg(pbuddy_adapter, HW_VAR_DM_FUNC_SET, (u8 *)(&mode));
|
||||
#endif
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_SET, (u8 *)(&mode));
|
||||
|
@ -400,7 +400,7 @@ void Switch_DM_Func(_adapter *padapter, u32 mode, u8 enable)
|
|||
else
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(pbuddy_adapter)
|
||||
if (pbuddy_adapter)
|
||||
rtw_hal_set_hwreg(pbuddy_adapter, HW_VAR_DM_FUNC_CLR, (u8 *)(&mode));
|
||||
#endif
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_CLR, (u8 *)(&mode));
|
||||
|
@ -411,7 +411,7 @@ void Switch_DM_Func(_adapter *padapter, u32 mode, u8 enable)
|
|||
|
||||
val8 = rtw_read8(padapter, FW_DYNAMIC_FUN_SWITCH);
|
||||
|
||||
if(enable == _TRUE)
|
||||
if (enable == _TRUE)
|
||||
{
|
||||
rtw_write8(padapter, FW_DYNAMIC_FUN_SWITCH, (val8 | mode));
|
||||
}
|
||||
|
@ -436,7 +436,7 @@ static void Set_NETYPE0_MSR(_adapter *padapter, u8 type)
|
|||
void Set_MSR(_adapter *padapter, u8 type)
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(padapter->iface_type == IFACE_PORT1)
|
||||
if (padapter->iface_type == IFACE_PORT1)
|
||||
{
|
||||
Set_NETYPE1_MSR(padapter, type);
|
||||
}
|
||||
|
@ -570,7 +570,7 @@ void set_channel_bwmode(_adapter *padapter, unsigned char channel, unsigned char
|
|||
DBG_871X( "[%s] ch = %d, offset = %d, bwmode = %d\n", __FUNCTION__, channel, channel_offset, bwmode );
|
||||
}
|
||||
|
||||
if((bwmode == HT_CHANNEL_WIDTH_20)||(channel_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE))
|
||||
if ((bwmode == HT_CHANNEL_WIDTH_20)||(channel_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE))
|
||||
{
|
||||
//SelectChannel(padapter, channel);
|
||||
center_ch = channel;
|
||||
|
@ -657,7 +657,7 @@ int is_client_associated_to_ap(_adapter *padapter)
|
|||
struct mlme_ext_priv *pmlmeext;
|
||||
struct mlme_ext_info *pmlmeinfo;
|
||||
|
||||
if(!padapter)
|
||||
if (!padapter)
|
||||
return _FAIL;
|
||||
|
||||
pmlmeext = &padapter->mlmeextpriv;
|
||||
|
@ -742,10 +742,10 @@ static u32 _ReadCAM(_adapter *padapter ,u32 addr)
|
|||
rtw_write32(padapter, RWCAM, cmd);
|
||||
|
||||
do{
|
||||
if(0 == (rtw_read32(padapter,REG_CAMCMD) & CAM_POLLINIG)){
|
||||
if (0 == (rtw_read32(padapter,REG_CAMCMD) & CAM_POLLINIG)){
|
||||
break;
|
||||
}
|
||||
}while(count++ < 100);
|
||||
}while (count++ < 100);
|
||||
|
||||
return rtw_read32(padapter,REG_CAMREAD);
|
||||
}
|
||||
|
@ -867,25 +867,25 @@ void flush_all_cam_entry(_adapter *padapter)
|
|||
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
//if(check_buddy_mlmeinfo_state(padapter, _HW_STATE_NOLINK_))
|
||||
if(check_buddy_fwstate(padapter, _FW_LINKED) == _FALSE)
|
||||
//if (check_buddy_mlmeinfo_state(padapter, _HW_STATE_NOLINK_))
|
||||
if (check_buddy_fwstate(padapter, _FW_LINKED) == _FALSE)
|
||||
{
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_CAM_INVALID_ALL, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE))
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
|
||||
{
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta;
|
||||
u8 cam_id;//cam_entry
|
||||
|
||||
psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress);
|
||||
if(psta) {
|
||||
if(psta->state & WIFI_AP_STATE)
|
||||
if (psta) {
|
||||
if (psta->state & WIFI_AP_STATE)
|
||||
{} //clear cam when ap free per sta_info
|
||||
else {
|
||||
if(psta->mac_id==2)
|
||||
if (psta->mac_id==2)
|
||||
cam_id = 5;
|
||||
else
|
||||
cam_id = 4;
|
||||
|
@ -894,7 +894,7 @@ void flush_all_cam_entry(_adapter *padapter)
|
|||
rtw_clearstakey_cmd(padapter, (u8*)psta, cam_id, _FALSE);
|
||||
}
|
||||
}
|
||||
else if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
|
||||
else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
|
||||
{
|
||||
//clear cam when ap free per sta_info
|
||||
}
|
||||
|
@ -952,7 +952,7 @@ int WMM_param_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
|||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
if(pmlmepriv->qospriv.qos_option==0)
|
||||
if (pmlmepriv->qospriv.qos_option==0)
|
||||
{
|
||||
pmlmeinfo->WMM_enable = 0;
|
||||
return _FAIL;
|
||||
|
@ -1004,7 +1004,7 @@ void WMMOnAssocRsp(_adapter *padapter)
|
|||
|
||||
acm_mask = 0;
|
||||
|
||||
if( pmlmeext->cur_wireless_mode == WIRELESS_11B)
|
||||
if ( pmlmeext->cur_wireless_mode == WIRELESS_11B)
|
||||
aSifsTime = 10;
|
||||
else
|
||||
aSifsTime = 16;
|
||||
|
@ -1053,35 +1053,35 @@ void WMMOnAssocRsp(_adapter *padapter)
|
|||
DBG_871X("WMM(%x): %x, %x\n", ACI, ACM, acParm);
|
||||
}
|
||||
|
||||
if(padapter->registrypriv.acm_method == 1)
|
||||
if (padapter->registrypriv.acm_method == 1)
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_ACM_CTRL, (u8 *)(&acm_mask));
|
||||
else
|
||||
padapter->mlmepriv.acm_mask = acm_mask;
|
||||
|
||||
inx[0] = 0; inx[1] = 1; inx[2] = 2; inx[3] = 3;
|
||||
|
||||
if(pregpriv->wifi_spec==1)
|
||||
if (pregpriv->wifi_spec==1)
|
||||
{
|
||||
u32 j, tmp, change_inx;
|
||||
|
||||
//entry indx: 0->vo, 1->vi, 2->be, 3->bk.
|
||||
for(i=0; i<4; i++)
|
||||
for (i=0; i<4; i++)
|
||||
{
|
||||
for(j=i+1; j<4; j++)
|
||||
for (j=i+1; j<4; j++)
|
||||
{
|
||||
//compare CW and AIFS
|
||||
if((edca[j] & 0xFFFF) < (edca[i] & 0xFFFF))
|
||||
if ((edca[j] & 0xFFFF) < (edca[i] & 0xFFFF))
|
||||
{
|
||||
change_inx = _TRUE;
|
||||
}
|
||||
else if((edca[j] & 0xFFFF) == (edca[i] & 0xFFFF))
|
||||
else if ((edca[j] & 0xFFFF) == (edca[i] & 0xFFFF))
|
||||
{
|
||||
//compare TXOP
|
||||
if((edca[j] >> 16) > (edca[i] >> 16))
|
||||
if ((edca[j] >> 16) > (edca[i] >> 16))
|
||||
change_inx = _TRUE;
|
||||
}
|
||||
|
||||
if(change_inx)
|
||||
if (change_inx)
|
||||
{
|
||||
tmp = edca[i];
|
||||
edca[i] = edca[j];
|
||||
|
@ -1097,7 +1097,7 @@ void WMMOnAssocRsp(_adapter *padapter)
|
|||
}
|
||||
}
|
||||
|
||||
for(i=0; i<4; i++) {
|
||||
for (i=0; i<4; i++) {
|
||||
pxmitpriv->wmm_para_seq[i] = inx[i];
|
||||
DBG_871X("wmm_para_seq(%d): %d\n", i, pxmitpriv->wmm_para_seq[i]);
|
||||
}
|
||||
|
@ -1117,17 +1117,17 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI
|
|||
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
||||
struct ht_priv *phtpriv = &pmlmepriv->htpriv;
|
||||
|
||||
if(!pIE)
|
||||
if (!pIE)
|
||||
return;
|
||||
|
||||
if(phtpriv->ht_option == _FALSE) return;
|
||||
if (phtpriv->ht_option == _FALSE) return;
|
||||
|
||||
if(pIE->Length > sizeof(struct HT_info_element))
|
||||
if (pIE->Length > sizeof(struct HT_info_element))
|
||||
return;
|
||||
|
||||
pHT_info = (struct HT_info_element *)pIE->data;
|
||||
|
||||
if((pHT_info->infos[0] & BIT(2)) && pregistrypriv->cbw40_enable )
|
||||
if ((pHT_info->infos[0] & BIT(2)) && pregistrypriv->cbw40_enable )
|
||||
{
|
||||
new_bwmode = HT_CHANNEL_WIDTH_40;
|
||||
|
||||
|
@ -1153,7 +1153,7 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI
|
|||
}
|
||||
|
||||
|
||||
if((new_bwmode!= pmlmeext->cur_bwmode) || (new_ch_offset!=pmlmeext->cur_ch_offset))
|
||||
if ((new_bwmode!= pmlmeext->cur_bwmode) || (new_ch_offset!=pmlmeext->cur_ch_offset))
|
||||
{
|
||||
pmlmeinfo->bwmode_updated = _TRUE;
|
||||
|
||||
|
@ -1169,7 +1169,7 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI
|
|||
}
|
||||
|
||||
|
||||
if(_TRUE == pmlmeinfo->bwmode_updated)
|
||||
if (_TRUE == pmlmeinfo->bwmode_updated)
|
||||
{
|
||||
struct sta_info *psta;
|
||||
WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network);
|
||||
|
@ -1180,11 +1180,11 @@ static void bwmode_update_check(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pI
|
|||
|
||||
//update ap's stainfo
|
||||
psta = rtw_get_stainfo(pstapriv, cur_network->MacAddress);
|
||||
if(psta)
|
||||
if (psta)
|
||||
{
|
||||
struct ht_priv *phtpriv_sta = &psta->htpriv;
|
||||
|
||||
if(phtpriv_sta->ht_option)
|
||||
if (phtpriv_sta->ht_option)
|
||||
{
|
||||
// bwmode
|
||||
phtpriv_sta->bwmode = pmlmeext->cur_bwmode;
|
||||
|
@ -1216,9 +1216,9 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
|||
struct ht_priv *phtpriv = &pmlmepriv->htpriv;
|
||||
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
||||
|
||||
if(pIE==NULL) return;
|
||||
if (pIE==NULL) return;
|
||||
|
||||
if(phtpriv->ht_option == _FALSE) return;
|
||||
if (phtpriv->ht_option == _FALSE) return;
|
||||
|
||||
pmlmeinfo->HT_caps_enable = 1;
|
||||
|
||||
|
@ -1266,14 +1266,14 @@ void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
|||
//update the MCS rates
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
if((rf_type == RF_1T1R) || (rf_type == RF_1T2R))
|
||||
if ((rf_type == RF_1T1R) || (rf_type == RF_1T2R))
|
||||
{
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef CONFIG_DISABLE_MCS13TO15
|
||||
if(pmlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40 && (pregistrypriv->wifi_spec!=1))
|
||||
if (pmlmeext->cur_bwmode == HT_CHANNEL_WIDTH_40 && (pregistrypriv->wifi_spec!=1))
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R_MCS13TO15_OFF[i];
|
||||
else
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R[i];
|
||||
|
@ -1299,12 +1299,12 @@ void HT_info_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
|||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct ht_priv *phtpriv = &pmlmepriv->htpriv;
|
||||
|
||||
if(pIE==NULL) return;
|
||||
if (pIE==NULL) return;
|
||||
|
||||
if(phtpriv->ht_option == _FALSE) return;
|
||||
if (phtpriv->ht_option == _FALSE) return;
|
||||
|
||||
|
||||
if(pIE->Length > sizeof(struct HT_info_element))
|
||||
if (pIE->Length > sizeof(struct HT_info_element))
|
||||
return;
|
||||
|
||||
pmlmeinfo->HT_info_enable = 1;
|
||||
|
@ -1380,7 +1380,7 @@ void HTOnAssocRsp(_adapter *padapter)
|
|||
// Config SM Power Save setting
|
||||
//
|
||||
pmlmeinfo->SM_PS = (pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info & 0x0C) >> 2;
|
||||
if(pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC)
|
||||
if (pmlmeinfo->SM_PS == WLAN_HT_CAP_SM_PS_STATIC)
|
||||
{
|
||||
/*u8 i;
|
||||
//update the MCS rates
|
||||
|
@ -1404,7 +1404,7 @@ void ERP_IE_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
|||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
if(pIE->Length>1)
|
||||
if (pIE->Length>1)
|
||||
return;
|
||||
|
||||
pmlmeinfo->ERP_enable = 1;
|
||||
|
@ -1466,13 +1466,13 @@ int check_ap_tdls_prohibited(u8 *pframe, u8 pkt_len)
|
|||
{
|
||||
u8 tdls_prohibited_bit = 0x40; //bit(38); TDLS_prohibited
|
||||
|
||||
if(pkt_len < 5)
|
||||
if (pkt_len < 5)
|
||||
{
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
pframe += 4;
|
||||
if( (*pframe) & tdls_prohibited_bit )
|
||||
if ( (*pframe) & tdls_prohibited_bit )
|
||||
return _TRUE;
|
||||
|
||||
return _FALSE;
|
||||
|
@ -1521,7 +1521,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
|
|||
|
||||
subtype = GetFrameSubType(pframe) >> 4;
|
||||
|
||||
if(subtype==WIFI_BEACON)
|
||||
if (subtype==WIFI_BEACON)
|
||||
bssid->Reserved[0] = 1;
|
||||
|
||||
bssid->Length = sizeof(WLAN_BSSID_EX) - MAX_IE_SZ + len;
|
||||
|
@ -1533,7 +1533,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
|
|||
/* check bw and channel offset */
|
||||
/* parsing HT_CAP_IE */
|
||||
p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
|
||||
if(p && len>0) {
|
||||
if (p && len>0) {
|
||||
pht_cap = (struct rtw_ieee80211_ht_cap *)(p + 2);
|
||||
ht_cap_info = pht_cap->cap_info;
|
||||
} else {
|
||||
|
@ -1541,7 +1541,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
|
|||
}
|
||||
/* parsing HT_INFO_IE */
|
||||
p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_ADD_INFO_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
|
||||
if(p && len>0) {
|
||||
if (p && len>0) {
|
||||
pht_info = (struct HT_info_element *)(p + 2);
|
||||
ht_info_infos_0 = pht_info->infos[0];
|
||||
} else {
|
||||
|
@ -1569,7 +1569,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
|
|||
bcn_channel = *(p + 2);
|
||||
} else {/* In 5G, some ap do not have DSSET IE checking HT info for channel */
|
||||
p = rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, _HT_ADD_INFO_IE_, &len, bssid->IELength - _FIXED_IE_LENGTH_);
|
||||
if(pht_info) {
|
||||
if (pht_info) {
|
||||
bcn_channel = pht_info->primary_channel;
|
||||
} else { /* we don't find channel IE, so don't check it */
|
||||
DBG_871X("Oops: %s we don't find channel IE, so don't check it \n", __func__);
|
||||
|
@ -1590,7 +1590,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
|
|||
hidden_ssid = _FALSE;
|
||||
}
|
||||
|
||||
if((NULL != p) && (_FALSE == hidden_ssid && (*(p + 1)))) {
|
||||
if ((NULL != p) && (_FALSE == hidden_ssid && (*(p + 1)))) {
|
||||
_rtw_memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1));
|
||||
bssid->Ssid.SsidLength = *(p + 1);
|
||||
} else {
|
||||
|
@ -1645,7 +1645,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
|
|||
|
||||
if (encryp_protocol == ENCRYP_PROTOCOL_WPA || encryp_protocol == ENCRYP_PROTOCOL_WPA2) {
|
||||
pbuf = rtw_get_wpa_ie(&bssid->IEs[12], &wpa_ielen, bssid->IELength-12);
|
||||
if(pbuf && (wpa_ielen>0)) {
|
||||
if (pbuf && (wpa_ielen>0)) {
|
||||
if (_SUCCESS == rtw_parse_wpa_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is_8021x)) {
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,
|
||||
("%s pnetwork->pairwise_cipher: %d, group_cipher is %d, is_8021x is %d\n", __func__,
|
||||
|
@ -1654,7 +1654,7 @@ int rtw_check_bcn_info(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
|
|||
} else {
|
||||
pbuf = rtw_get_wpa2_ie(&bssid->IEs[12], &wpa_ielen, bssid->IELength-12);
|
||||
|
||||
if(pbuf && (wpa_ielen>0)) {
|
||||
if (pbuf && (wpa_ielen>0)) {
|
||||
if (_SUCCESS == rtw_parse_wpa2_ie(pbuf, wpa_ielen+2, &group_cipher, &pairwise_cipher, &is_8021x)) {
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,
|
||||
("%s pnetwork->pairwise_cipher: %d, pnetwork->group_cipher is %d, is_802x is %d\n",
|
||||
|
@ -1729,7 +1729,7 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta
|
|||
|
||||
#ifdef CONFIG_TDLS
|
||||
case _EXT_CAP_IE_:
|
||||
if( check_ap_tdls_prohibited(pIE->data, pIE->Length) == _TRUE )
|
||||
if ( check_ap_tdls_prohibited(pIE->data, pIE->Length) == _TRUE )
|
||||
ptdlsinfo->ap_prohibited = _TRUE;
|
||||
break;
|
||||
#endif //CONFIG_TDLS
|
||||
|
@ -2029,9 +2029,9 @@ unsigned char get_highest_rate_idx(u32 mask)
|
|||
int i;
|
||||
unsigned char rate_idx=0;
|
||||
|
||||
for(i=27; i>=0; i--)
|
||||
for (i=27; i>=0; i--)
|
||||
{
|
||||
if(mask & BIT(i))
|
||||
if (mask & BIT(i))
|
||||
{
|
||||
rate_idx = i;
|
||||
break;
|
||||
|
@ -2086,7 +2086,7 @@ void update_tx_basic_rate(_adapter *padapter, u8 wirelessmode)
|
|||
// Added by Albert 2011/03/22
|
||||
// In the P2P mode, the driver should not support the b mode.
|
||||
// So, the Tx packet shouldn't use the CCK rate
|
||||
if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
|
||||
return;
|
||||
#endif //CONFIG_P2P
|
||||
#ifdef CONFIG_INTEL_WIDI
|
||||
|
@ -2172,7 +2172,7 @@ unsigned char check_assoc_AP(u8 *pframe, uint len)
|
|||
else if (_rtw_memcmp(pIE->data, EPIGRAM_OUI, 3))
|
||||
{
|
||||
epigram_vendor_flag = 1;
|
||||
if(ralink_vendor_flag) {
|
||||
if (ralink_vendor_flag) {
|
||||
DBG_871X("link to Tenda W311R AP\n");
|
||||
return HT_IOT_PEER_TENDA;
|
||||
} else {
|
||||
|
@ -2243,12 +2243,12 @@ void update_capinfo(PADAPTER Adapter, u16 updateCap)
|
|||
|
||||
// Check preamble mode, 2005.01.06, by rcnjko.
|
||||
// Mark to update preamble value forever, 2008.03.18 by lanhsin
|
||||
//if( pMgntInfo->RegPreambleMode == PREAMBLE_AUTO )
|
||||
//if ( pMgntInfo->RegPreambleMode == PREAMBLE_AUTO )
|
||||
{
|
||||
|
||||
if(updateCap & cShortPreamble)
|
||||
if (updateCap & cShortPreamble)
|
||||
{ // Short Preamble
|
||||
if(pmlmeinfo->preamble_mode != PREAMBLE_SHORT) // PREAMBLE_LONG or PREAMBLE_AUTO
|
||||
if (pmlmeinfo->preamble_mode != PREAMBLE_SHORT) // PREAMBLE_LONG or PREAMBLE_AUTO
|
||||
{
|
||||
ShortPreamble = _TRUE;
|
||||
pmlmeinfo->preamble_mode = PREAMBLE_SHORT;
|
||||
|
@ -2257,7 +2257,7 @@ void update_capinfo(PADAPTER Adapter, u16 updateCap)
|
|||
}
|
||||
else
|
||||
{ // Long Preamble
|
||||
if(pmlmeinfo->preamble_mode != PREAMBLE_LONG) // PREAMBLE_SHORT or PREAMBLE_AUTO
|
||||
if (pmlmeinfo->preamble_mode != PREAMBLE_LONG) // PREAMBLE_SHORT or PREAMBLE_AUTO
|
||||
{
|
||||
ShortPreamble = _FALSE;
|
||||
pmlmeinfo->preamble_mode = PREAMBLE_LONG;
|
||||
|
@ -2273,24 +2273,24 @@ void update_capinfo(PADAPTER Adapter, u16 updateCap)
|
|||
else
|
||||
{
|
||||
//Filen: See 802.11-2007 p.90
|
||||
if( pmlmeext->cur_wireless_mode & (WIRELESS_11G | WIRELESS_11_24N))
|
||||
if ( pmlmeext->cur_wireless_mode & (WIRELESS_11G | WIRELESS_11_24N))
|
||||
{
|
||||
if( (updateCap & cShortSlotTime) /* && (!(pMgntInfo->pHTInfo->RT2RT_HT_Mode & RT_HT_CAP_USE_LONG_PREAMBLE)) */)
|
||||
if ( (updateCap & cShortSlotTime) /* && (!(pMgntInfo->pHTInfo->RT2RT_HT_Mode & RT_HT_CAP_USE_LONG_PREAMBLE)) */)
|
||||
{ // Short Slot Time
|
||||
if(pmlmeinfo->slotTime != SHORT_SLOT_TIME)
|
||||
if (pmlmeinfo->slotTime != SHORT_SLOT_TIME)
|
||||
{
|
||||
pmlmeinfo->slotTime = SHORT_SLOT_TIME;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // Long Slot Time
|
||||
if(pmlmeinfo->slotTime != NON_SHORT_SLOT_TIME)
|
||||
if (pmlmeinfo->slotTime != NON_SHORT_SLOT_TIME)
|
||||
{
|
||||
pmlmeinfo->slotTime = NON_SHORT_SLOT_TIME;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( pmlmeext->cur_wireless_mode & (WIRELESS_11A | WIRELESS_11_5N))
|
||||
else if ( pmlmeext->cur_wireless_mode & (WIRELESS_11A | WIRELESS_11_5N))
|
||||
{
|
||||
pmlmeinfo->slotTime = SHORT_SLOT_TIME;
|
||||
}
|
||||
|
@ -2321,7 +2321,7 @@ void update_wireless_mode(_adapter *padapter)
|
|||
pmlmeinfo->HT_enable = 1;
|
||||
}
|
||||
|
||||
if(pmlmeext->cur_channel > 14)
|
||||
if (pmlmeext->cur_channel > 14)
|
||||
{
|
||||
if (pmlmeinfo->HT_enable)
|
||||
{
|
||||
|
@ -2341,7 +2341,7 @@ void update_wireless_mode(_adapter *padapter)
|
|||
{
|
||||
network_type |= WIRELESS_11B;
|
||||
}
|
||||
else if((cckrates_included(rate, ratelen)) == _TRUE)
|
||||
else if ((cckrates_included(rate, ratelen)) == _TRUE)
|
||||
{
|
||||
network_type |= WIRELESS_11BG;
|
||||
}
|
||||
|
@ -2353,7 +2353,7 @@ void update_wireless_mode(_adapter *padapter)
|
|||
|
||||
pmlmeext->cur_wireless_mode = network_type & padapter->registrypriv.wireless_mode;
|
||||
/*
|
||||
if((pmlmeext->cur_wireless_mode==WIRELESS_11G) ||
|
||||
if ((pmlmeext->cur_wireless_mode==WIRELESS_11G) ||
|
||||
(pmlmeext->cur_wireless_mode==WIRELESS_11BG))//WIRELESS_MODE_G)
|
||||
SIFS_Timer = 0x0a0a;//CCK
|
||||
else
|
||||
|
@ -2404,7 +2404,7 @@ void update_bmc_sta_support_rate(_adapter *padapter, u32 mac_id)
|
|||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
if(pmlmeext->cur_wireless_mode & WIRELESS_11B)
|
||||
if (pmlmeext->cur_wireless_mode & WIRELESS_11B)
|
||||
{
|
||||
// Only B, B/G, and B/G/N AP could use CCK rate
|
||||
_rtw_memcpy((pmlmeinfo->FW_sta_info[mac_id].SupportedRates), rtw_basic_rate_cck, 4);
|
||||
|
@ -2454,7 +2454,7 @@ void process_addba_req(_adapter *padapter, u8 *paddba_req, u8 *addr)
|
|||
|
||||
psta = rtw_get_stainfo(pstapriv, addr);
|
||||
|
||||
if(psta)
|
||||
if (psta)
|
||||
{
|
||||
start_seq = le16_to_cpu(preq->BA_starting_seqctrl) >> 4;
|
||||
|
||||
|
@ -2615,7 +2615,7 @@ int rtw_handle_dualmac(_adapter *adapter, bool init)
|
|||
if (init) {
|
||||
#if 0
|
||||
/* For SMSP on 92DU-VC, driver do not probe another Interface. */
|
||||
if(dvobj->NumInterfaces == 2 && dvobj->InterfaceNumber != 0 &&
|
||||
if (dvobj->NumInterfaces == 2 && dvobj->InterfaceNumber != 0 &&
|
||||
adapter->registrypriv.mac_phy_mode == 1) {
|
||||
DBG_871X("%s(): Do not init another USB Interface because SMSP\n",__FUNCTION__);
|
||||
status = _FAIL;
|
||||
|
|
344
core/rtw_xmit.c
344
core/rtw_xmit.c
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue