mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-08 14:33:05 +00:00
rtl8188eu: CONFIG_TDLS
This variable is not defined. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
c372b989e3
commit
1bb0401638
22 changed files with 12 additions and 4974 deletions
|
@ -1371,22 +1371,12 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key, bool en
|
|||
memcpy(psetstakey_para->addr, sta->hwaddr,ETH_ALEN);
|
||||
|
||||
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE)){
|
||||
#ifdef CONFIG_TDLS
|
||||
if(sta->tdls_sta_state&TDLS_LINKED_STATE)
|
||||
psetstakey_para->algorithm=(u8)sta->dot118021XPrivacy;
|
||||
else
|
||||
#endif /* CONFIG_TDLS */
|
||||
psetstakey_para->algorithm =(unsigned char) psecuritypriv->dot11PrivacyAlgrthm;
|
||||
}else{
|
||||
GET_ENCRY_ALGO(psecuritypriv, sta, psetstakey_para->algorithm, false);
|
||||
}
|
||||
|
||||
if (unicast_key == true) {
|
||||
#ifdef CONFIG_TDLS
|
||||
if((sta->tdls_sta_state&TDLS_LINKED_STATE)==TDLS_LINKED_STATE)
|
||||
memcpy(&psetstakey_para->key, sta->tpk.tk, 16);
|
||||
else
|
||||
#endif /* CONFIG_TDLS */
|
||||
memcpy(&psetstakey_para->key, &sta->dot118021x_UncstKey, 16);
|
||||
}
|
||||
else {
|
||||
|
@ -1963,39 +1953,7 @@ u8 rtw_tdls_cmd(struct adapter *padapter, u8 *addr, u8 option)
|
|||
|
||||
u8 res=_SUCCESS;
|
||||
|
||||
;
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
|
||||
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){
|
||||
res=_FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
TDLSoption= (struct TDLSoption_param *)rtw_zmalloc(sizeof(struct TDLSoption_param));
|
||||
if(TDLSoption == NULL) {
|
||||
rtw_mfree((u8 *)pcmdobj, sizeof(struct cmd_obj));
|
||||
res= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
_rtw_spinlock(&(padapter->tdlsinfo.cmd_lock));
|
||||
memcpy(TDLSoption->addr, addr, 6);
|
||||
TDLSoption->option = option;
|
||||
_rtw_spinunlock(&(padapter->tdlsinfo.cmd_lock));
|
||||
init_h2fwcmd_w_parm_no_rsp(pcmdobj, TDLSoption, GEN_CMD_CODE(_TDLS));
|
||||
res = rtw_enqueue_cmd(pcmdpriv, pcmdobj);
|
||||
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
exit:
|
||||
|
||||
|
||||
;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -2045,18 +2003,11 @@ static void traffic_status_watchdog(struct adapter *padapter)
|
|||
u8 bBusyTraffic = false, bTxBusyTraffic = false, bRxBusyTraffic = false;
|
||||
u8 bHigherBusyTraffic = false, bHigherBusyRxTraffic = false, bHigherBusyTxTraffic = false;
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &(padapter->tdlsinfo);
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
RT_LINK_DETECT_T * link_detect = &pmlmepriv->LinkDetectInfo;
|
||||
|
||||
/* */
|
||||
/* Determine if our traffic is busy now */
|
||||
/* */
|
||||
if((check_fwstate(pmlmepriv, _FW_LINKED)== true)
|
||||
/*&& !MgntInitAdapterInProgress(pMgntInfo)*/)
|
||||
{
|
||||
if(check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
/* if we raise bBusyTraffic in last watchdog, using lower threshold. */
|
||||
if (pmlmepriv->LinkDetectInfo.bBusyTraffic)
|
||||
BusyThreshold =180; /* 75; */
|
||||
|
@ -2101,14 +2052,6 @@ static void traffic_status_watchdog(struct adapter *padapter)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
#ifdef CONFIG_TDLS_AUTOSETUP
|
||||
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 */
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
if (BT_1Ant(padapter) == false)
|
||||
#endif
|
||||
|
|
|
@ -1242,11 +1242,6 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue)
|
|||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct wlan_network *tgt_network = &pmlmepriv->cur_network;
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &adapter->tdlsinfo;
|
||||
#endif /* CONFIG_TDLS */
|
||||
;
|
||||
|
||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+rtw_free_assoc_resources\n"));
|
||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("tgt_network->network.MacAddress="MAC_FMT" ssid=%s\n",
|
||||
MAC_ARG(tgt_network->network.MacAddress), tgt_network->network.Ssid.Ssid));
|
||||
|
@ -1256,18 +1251,8 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue)
|
|||
|
||||
psta = rtw_get_stainfo(&adapter->stapriv, tgt_network->network.MacAddress);
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if(ptdlsinfo->setup_state != TDLS_STATE_NONE) {
|
||||
rtw_tdls_cmd(adapter, myid(&(adapter->eeprompriv)), TDLS_RS_RCR);
|
||||
rtw_reset_tdls_info(adapter);
|
||||
rtw_free_all_stainfo(adapter);
|
||||
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
} else
|
||||
#endif /* CONFIG_TDLS */
|
||||
{
|
||||
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
rtw_free_stainfo(adapter, psta);
|
||||
}
|
||||
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
rtw_free_stainfo(adapter, psta);
|
||||
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
|
||||
|
|
|
@ -250,12 +250,6 @@ static void init_mlme_ext_priv_value(struct adapter* padapter)
|
|||
{
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
u8 i;
|
||||
#endif
|
||||
|
||||
/* unsigned char default_channel_set[MAX_CHANNEL_NUM] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0, 0}; */
|
||||
unsigned char mixed_datarate[NumRates] = {_1M_RATE_, _2M_RATE_, _5M_RATE_, _11M_RATE_, _6M_RATE_,_9M_RATE_, _12M_RATE_, _18M_RATE_, _24M_RATE_, _36M_RATE_, _48M_RATE_, _54M_RATE_, 0xff};
|
||||
unsigned char mixed_basicrate[NumRates] ={_1M_RATE_, _2M_RATE_, _5M_RATE_, _11M_RATE_, _6M_RATE_, _12M_RATE_, _24M_RATE_, 0xff,};
|
||||
|
||||
|
@ -608,16 +602,6 @@ void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame)
|
|||
|
||||
index = GetFrameSubType(pframe) >> 4;
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if((index << 4)==WIFI_ACTION){
|
||||
/* category==public (4), action==TDLS_DISCOVERY_RESPONSE */
|
||||
if(*(pframe+24)==0x04 && *(pframe+25)==TDLS_DISCOVERY_RESPONSE){
|
||||
DBG_871X("recv tdls discovery response frame\n");
|
||||
On_TDLS_Dis_Rsp(padapter, precv_frame);
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
if (index > 13)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Currently we do not support reserved sub-fr-type=%d\n", index));
|
||||
|
@ -2356,15 +2340,6 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra
|
|||
category = frame_body[0];
|
||||
if (category == RTW_WLAN_CATEGORY_BACK)/* representing Block Ack */
|
||||
{
|
||||
#ifdef CONFIG_TDLS
|
||||
if((psta->tdls_sta_state & TDLS_LINKED_STATE) &&
|
||||
(psta->htpriv.ht_option==true) &&
|
||||
(psta->htpriv.ampdu_enable==true) )
|
||||
{
|
||||
/* do nothing; just don't want to return _SUCCESS; */
|
||||
}
|
||||
else
|
||||
#endif /* CONFIG_TDLS */
|
||||
if (!pmlmeinfo->HT_enable)
|
||||
{
|
||||
return _SUCCESS;
|
||||
|
@ -10448,11 +10423,6 @@ u8 set_stakey_hdl(struct adapter *padapter, u8 *pbuf)
|
|||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct set_stakey_parm *pparm = (struct set_stakey_parm *)pbuf;
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta;
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
/* cam_entry: */
|
||||
/* 0~3 for default key */
|
||||
|
@ -10525,20 +10495,6 @@ u8 set_stakey_hdl(struct adapter *padapter, u8 *pbuf)
|
|||
|
||||
ctrl = BIT(15) | ((pparm->algorithm) << 2);
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if(ptdlsinfo->clear_cam!=0){
|
||||
clear_cam_entry(padapter, ptdlsinfo->clear_cam);
|
||||
ptdlsinfo->clear_cam=0;
|
||||
|
||||
return H2C_SUCCESS;
|
||||
}
|
||||
|
||||
psta = rtw_get_stainfo(pstapriv, pparm->addr);/* Get TDLS Peer STA */
|
||||
if( psta->tdls_sta_state&TDLS_LINKED_STATE ){
|
||||
write_cam(padapter, psta->mac_id, ctrl, pparm->addr, pparm->key);
|
||||
}
|
||||
else
|
||||
#endif /* CONFIG_TDLS */
|
||||
write_cam(padapter, cam_id, ctrl, pparm->addr, pparm->key);
|
||||
|
||||
pmlmeinfo->enc_algo = pparm->algorithm;
|
||||
|
@ -10567,20 +10523,7 @@ u8 add_ba_hdl(struct adapter *padapter, unsigned char *pbuf)
|
|||
pparm->tid);
|
||||
/* _set_timer(&pmlmeext->ADDBA_timer, ADDBA_TO); */
|
||||
_set_timer(&psta->addba_retry_timer, ADDBA_TO);
|
||||
}
|
||||
#ifdef CONFIG_TDLS
|
||||
else if((psta->tdls_sta_state & TDLS_LINKED_STATE)&&
|
||||
(psta->htpriv.ht_option==true) &&
|
||||
(psta->htpriv.ampdu_enable==true) )
|
||||
{
|
||||
issue_action_BA(padapter, pparm->addr, RTW_WLAN_ACTION_ADDBA_REQ,
|
||||
pparm->tid);
|
||||
/* _set_timer(&pmlmeext->ADDBA_timer, ADDBA_TO); */
|
||||
_set_timer(&psta->addba_retry_timer, ADDBA_TO);
|
||||
}
|
||||
#endif /* CONFIG */
|
||||
else
|
||||
{
|
||||
} else {
|
||||
psta->htpriv.candidate_tid_bitmap &= ~BIT(pparm->tid);
|
||||
}
|
||||
return H2C_SUCCESS;
|
||||
|
@ -10953,163 +10896,5 @@ u8 set_csa_hdl(struct adapter *padapter, unsigned char *pbuf)
|
|||
/* TDLS_FREE_STA : free tdls sta */
|
||||
u8 tdls_hdl(struct adapter *padapter, unsigned char *pbuf)
|
||||
{
|
||||
#ifdef CONFIG_TDLS
|
||||
_irqL irqL;
|
||||
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
|
||||
struct TDLSoption_param *TDLSoption;
|
||||
struct sta_info *ptdls_sta;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
u8 survey_channel, i, min, option;
|
||||
|
||||
if(!pbuf)
|
||||
return H2C_PARAMETERS_ERROR;
|
||||
|
||||
TDLSoption = (struct TDLSoption_param *)pbuf;
|
||||
|
||||
ptdls_sta = rtw_get_stainfo( &(padapter->stapriv), TDLSoption->addr );
|
||||
option = TDLSoption->option;
|
||||
|
||||
if( ptdls_sta == NULL )
|
||||
{
|
||||
if( option != TDLS_RS_RCR )
|
||||
return H2C_REJECTED;
|
||||
}
|
||||
|
||||
/* _enter_critical_bh(&(ptdlsinfo->hdl_lock), &irqL); */
|
||||
DBG_871X("[%s] option:%d\n", __FUNCTION__, option);
|
||||
|
||||
switch(option){
|
||||
case TDLS_WRCR:
|
||||
/* As long as TDLS handshake success, we should set RCR_CBSSID_DATA bit to 0 */
|
||||
/* such we can receive all kinds of data frames. */
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_TDLS_WRCR, 0);
|
||||
DBG_871X("TDLS with "MAC_FMT"\n", MAC_ARG(ptdls_sta->hwaddr));
|
||||
|
||||
pmlmeinfo->FW_sta_info[ptdls_sta->mac_id].psta = ptdls_sta;
|
||||
/* set TDLS sta rate. */
|
||||
set_sta_rate(padapter, ptdls_sta);
|
||||
break;
|
||||
case TDLS_SD_PTI:
|
||||
issue_tdls_peer_traffic_indication(padapter, ptdls_sta);
|
||||
break;
|
||||
case TDLS_CS_OFF:
|
||||
_cancel_timer_ex(&ptdls_sta->base_ch_timer);
|
||||
_cancel_timer_ex(&ptdls_sta->off_ch_timer);
|
||||
SelectChannel(padapter, pmlmeext->cur_channel);
|
||||
ptdls_sta->tdls_sta_state &= ~(TDLS_CH_SWITCH_ON_STATE |
|
||||
TDLS_PEER_AT_OFF_STATE |
|
||||
TDLS_AT_OFF_CH_STATE);
|
||||
DBG_871X("go back to base channel\n ");
|
||||
issue_nulldata(padapter, NULL, 0, 0, 0);
|
||||
break;
|
||||
case TDLS_INIT_CH_SEN:
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_TDLS_INIT_CH_SEN, 0);
|
||||
pmlmeext->sitesurvey_res.channel_idx = 0;
|
||||
ptdls_sta->option = TDLS_DONE_CH_SEN;
|
||||
rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_DONE_CH_SEN);
|
||||
break;
|
||||
case TDLS_DONE_CH_SEN:
|
||||
survey_channel = pmlmeext->channel_set[pmlmeext->sitesurvey_res.channel_idx].ChannelNum;
|
||||
if(survey_channel){
|
||||
SelectChannel(padapter, survey_channel);
|
||||
ptdlsinfo->cur_channel = survey_channel;
|
||||
pmlmeext->sitesurvey_res.channel_idx++;
|
||||
_set_timer(&ptdls_sta->option_timer, SURVEY_TO);
|
||||
}else{
|
||||
SelectChannel(padapter, pmlmeext->cur_channel);
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_TDLS_DONE_CH_SEN, 0);
|
||||
|
||||
if(ptdlsinfo->ch_sensing==1){
|
||||
ptdlsinfo->ch_sensing=0;
|
||||
ptdlsinfo->cur_channel=1;
|
||||
min=ptdlsinfo->collect_pkt_num[0];
|
||||
for(i=1; i<MAX_CHANNEL_NUM-1; i++){
|
||||
if(min > ptdlsinfo->collect_pkt_num[i]){
|
||||
ptdlsinfo->cur_channel=i+1;
|
||||
min=ptdlsinfo->collect_pkt_num[i];
|
||||
}
|
||||
ptdlsinfo->collect_pkt_num[i]=0;
|
||||
}
|
||||
ptdlsinfo->collect_pkt_num[0]=0;
|
||||
ptdlsinfo->candidate_ch=ptdlsinfo->cur_channel;
|
||||
DBG_871X("TDLS channel sensing done, candidate channel: %02x\n", ptdlsinfo->candidate_ch);
|
||||
ptdlsinfo->cur_channel=0;
|
||||
|
||||
}
|
||||
|
||||
if(ptdls_sta->tdls_sta_state & TDLS_PEER_SLEEP_STATE){
|
||||
ptdls_sta->tdls_sta_state |= TDLS_APSD_CHSW_STATE;
|
||||
}else{
|
||||
/* send null data with pwrbit==1 before send ch_switching_req to peer STA. */
|
||||
issue_nulldata(padapter, NULL, 1, 0, 0);
|
||||
|
||||
ptdls_sta->tdls_sta_state |= TDLS_CH_SW_INITIATOR_STATE;
|
||||
|
||||
issue_tdls_ch_switch_req(padapter, ptdls_sta->hwaddr);
|
||||
DBG_871X("issue tdls ch switch req\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TDLS_OFF_CH:
|
||||
issue_nulldata(padapter, NULL, 1, 0, 0);
|
||||
SelectChannel(padapter, ptdls_sta->off_ch);
|
||||
|
||||
DBG_871X("change channel to tar ch:%02x\n", ptdls_sta->off_ch);
|
||||
ptdls_sta->tdls_sta_state |= TDLS_AT_OFF_CH_STATE;
|
||||
ptdls_sta->tdls_sta_state &= ~(TDLS_PEER_AT_OFF_STATE);
|
||||
_set_timer(&ptdls_sta->option_timer, (u32)ptdls_sta->ch_switch_time);
|
||||
break;
|
||||
case TDLS_BASE_CH:
|
||||
_cancel_timer_ex(&ptdls_sta->base_ch_timer);
|
||||
_cancel_timer_ex(&ptdls_sta->off_ch_timer);
|
||||
SelectChannel(padapter, pmlmeext->cur_channel);
|
||||
ptdls_sta->tdls_sta_state &= ~(TDLS_CH_SWITCH_ON_STATE |
|
||||
TDLS_PEER_AT_OFF_STATE |
|
||||
TDLS_AT_OFF_CH_STATE);
|
||||
DBG_871X("go back to base channel\n ");
|
||||
issue_nulldata(padapter, NULL, 0, 0, 0);
|
||||
_set_timer(&ptdls_sta->option_timer, (u32)ptdls_sta->ch_switch_time);
|
||||
break;
|
||||
case TDLS_P_OFF_CH:
|
||||
SelectChannel(padapter, pmlmeext->cur_channel);
|
||||
issue_nulldata(padapter, NULL, 0, 0, 0);
|
||||
DBG_871X("change channel to base ch:%02x\n", pmlmeext->cur_channel);
|
||||
ptdls_sta->tdls_sta_state &= ~(TDLS_PEER_AT_OFF_STATE| TDLS_AT_OFF_CH_STATE);
|
||||
_set_timer(&ptdls_sta->off_ch_timer, TDLS_STAY_TIME);
|
||||
break;
|
||||
case TDLS_P_BASE_CH:
|
||||
issue_nulldata(ptdls_sta->padapter, NULL, 1, 0, 0);
|
||||
SelectChannel(padapter, ptdls_sta->off_ch);
|
||||
DBG_871X("change channel to off ch:%02x\n", ptdls_sta->off_ch);
|
||||
ptdls_sta->tdls_sta_state |= TDLS_AT_OFF_CH_STATE;
|
||||
if((ptdls_sta->tdls_sta_state & TDLS_PEER_AT_OFF_STATE) != TDLS_PEER_AT_OFF_STATE){
|
||||
issue_nulldata_to_TDLS_peer_STA(padapter, ptdls_sta, 0);
|
||||
}
|
||||
_set_timer(&ptdls_sta->base_ch_timer, TDLS_STAY_TIME);
|
||||
break;
|
||||
case TDLS_RS_RCR:
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_TDLS_RS_RCR, 0);
|
||||
DBG_871X("wirte REG_RCR, set bit6 on\n");
|
||||
break;
|
||||
case TDLS_CKALV_PH1:
|
||||
_set_timer(&ptdls_sta->alive_timer2, TDLS_ALIVE_TIMER_PH2);
|
||||
break;
|
||||
case TDLS_CKALV_PH2:
|
||||
_set_timer(&ptdls_sta->alive_timer1, TDLS_ALIVE_TIMER_PH1);
|
||||
break;
|
||||
case TDLS_FREE_STA:
|
||||
free_tdls_sta(padapter, ptdls_sta);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
/* _exit_critical_bh(&(ptdlsinfo->hdl_lock), &irqL); */
|
||||
|
||||
return H2C_SUCCESS;
|
||||
#else
|
||||
return H2C_REJECTED;
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
}
|
||||
|
|
|
@ -2587,9 +2587,6 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
|
|||
#ifdef CONFIG_P2P
|
||||
u8 wfd_ie[ 128 ] = { 0x00 };
|
||||
u32 wfd_ielen = 0;
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
|
||||
#endif /* CONFIG_TDLS */
|
||||
#endif /* CONFIG_P2P */
|
||||
__be16 be_tmp;
|
||||
|
||||
|
@ -2661,15 +2658,8 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
|
|||
|
||||
/* Check P2P Capability ATTR */
|
||||
if(rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&le_tmp, (uint*)&attr_contentlen) )
|
||||
{
|
||||
cap_attr = le16_to_cpu(le_tmp);
|
||||
|
||||
#if defined(CONFIG_P2P) && defined(CONFIG_TDLS)
|
||||
if(!(cap_attr & P2P_GRPCAP_INTRABSS) )
|
||||
ptdlsinfo->ap_prohibited = true;
|
||||
#endif /* defined(CONFIG_P2P) && defined(CONFIG_TDLS) */
|
||||
}
|
||||
|
||||
if ( rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GO_INTENT , &attr_content, &attr_contentlen) )
|
||||
{
|
||||
DBG_871X( "[%s] GO Intent = %d, tie = %d\n", __FUNCTION__, attr_content >> 1, attr_content & 0x01 );
|
||||
|
@ -2806,9 +2796,6 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram
|
|||
#ifdef CONFIG_P2P
|
||||
u8 wfd_ie[ 128 ] = { 0x00 };
|
||||
u32 wfd_ielen = 0;
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
|
||||
#endif /* CONFIG_TDLS */
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
ies = pframe + _PUBLIC_ACTION_IE_OFFSET_;
|
||||
|
@ -2854,17 +2841,10 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram
|
|||
|
||||
/* Check P2P Capability ATTR */
|
||||
if(rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&le_tmp, (uint*)&attr_contentlen) )
|
||||
{
|
||||
cap_attr = le16_to_cpu(le_tmp);
|
||||
#ifdef CONFIG_TDLS
|
||||
if(!(cap_attr & P2P_GRPCAP_INTRABSS) )
|
||||
ptdlsinfo->ap_prohibited = true;
|
||||
#endif /* CONFIG_TDLS */
|
||||
}
|
||||
|
||||
rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_STATUS, &attr_content, &attr_contentlen);
|
||||
if ( attr_contentlen == 1 )
|
||||
{
|
||||
if ( attr_contentlen == 1 ) {
|
||||
DBG_871X( "[%s] Status = %d\n", __FUNCTION__, attr_content );
|
||||
if ( attr_content == P2P_STATUS_SUCCESS )
|
||||
{
|
||||
|
|
|
@ -469,15 +469,6 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a
|
|||
#ifdef CONFIG_P2P
|
||||
struct wifidirect_info *pwdinfo = &( padapter->wdinfo );
|
||||
#endif /* CONFIG_P2P */
|
||||
#ifdef CONFIG_TDLS
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
_irqL irqL;
|
||||
int i, j;
|
||||
_list *plist, *phead;
|
||||
struct sta_info *ptdls_sta;
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
;
|
||||
|
||||
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
|
||||
("%s: PowerMode=%d Smart_PS=%d\n",
|
||||
|
@ -507,28 +498,6 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a
|
|||
#endif /* CONFIG_P2P */
|
||||
{
|
||||
DBG_871X("rtw_set_ps_mode: Leave 802.11 power save\n");
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
for(i=0; i< NUM_STA; i++)
|
||||
{
|
||||
phead = &(pstapriv->sta_hash[i]);
|
||||
plist = get_next(phead);
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == false)
|
||||
{
|
||||
ptdls_sta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
|
||||
|
||||
if( ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE )
|
||||
issue_nulldata_to_TDLS_peer_STA(padapter, ptdls_sta, 0);
|
||||
plist = get_next(plist);
|
||||
}
|
||||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
pwrpriv->pwr_mode = ps_mode;
|
||||
rtw_set_rpwm(padapter, PS_STATE_S4);
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_PWRMODE, (u8 *)(&ps_mode));
|
||||
|
@ -544,28 +513,6 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a
|
|||
)
|
||||
{
|
||||
DBG_871X("%s: Enter 802.11 power save\n", __FUNCTION__);
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
for(i=0; i< NUM_STA; i++)
|
||||
{
|
||||
phead = &(pstapriv->sta_hash[i]);
|
||||
plist = get_next(phead);
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == false)
|
||||
{
|
||||
ptdls_sta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
|
||||
|
||||
if( ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE )
|
||||
issue_nulldata_to_TDLS_peer_STA(padapter, ptdls_sta, 1);
|
||||
plist = get_next(plist);
|
||||
}
|
||||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
pwrpriv->bFwCurrentInPSMode = true;
|
||||
pwrpriv->pwr_mode = ps_mode;
|
||||
pwrpriv->smart_ps = smart_ps;
|
||||
|
|
280
core/rtw_recv.c
280
core/rtw_recv.c
|
@ -830,21 +830,12 @@ void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame)
|
|||
|
||||
if(!psta) return;
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if( !(psta->tdls_sta_state & TDLS_LINKED_STATE ) )
|
||||
{
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
if(!psta->qos_option)
|
||||
return;
|
||||
|
||||
if(!(psta->qos_info&0xf))
|
||||
return;
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
if(psta->state&WIFI_SLEEP_STATE)
|
||||
{
|
||||
u8 wmmps_ac=0;
|
||||
|
@ -891,100 +882,6 @@ void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame)
|
|||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
sint OnTDLS(struct adapter *adapter, union recv_frame *precv_frame)
|
||||
{
|
||||
struct rx_pkt_attrib *pattrib = & precv_frame->u.hdr.attrib;
|
||||
sint ret = _SUCCESS;
|
||||
u8 *paction = get_recvframe_data(precv_frame);
|
||||
u8 category_field = 1;
|
||||
#ifdef CONFIG_P2P
|
||||
u8 WFA_OUI[3] = { 0x50, 0x6f, 0x9a };
|
||||
#endif /* CONFIG_P2P */
|
||||
struct tdls_info *ptdlsinfo = &(adapter->tdlsinfo);
|
||||
|
||||
/* point to action field */
|
||||
paction+=pattrib->hdrlen
|
||||
+ pattrib->iv_len
|
||||
+ SNAP_SIZE
|
||||
+ ETH_TYPE_LEN
|
||||
+ PAYLOAD_TYPE_LEN
|
||||
+ category_field;
|
||||
|
||||
if(ptdlsinfo->enable == 0)
|
||||
{
|
||||
DBG_871X("recv tdls frame, "
|
||||
"but tdls haven't enabled\n");
|
||||
ret = _FAIL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
switch(*paction){
|
||||
case TDLS_SETUP_REQUEST:
|
||||
DBG_871X("recv tdls setup request frame\n");
|
||||
ret=On_TDLS_Setup_Req(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_SETUP_RESPONSE:
|
||||
DBG_871X("recv tdls setup response frame\n");
|
||||
ret=On_TDLS_Setup_Rsp(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_SETUP_CONFIRM:
|
||||
DBG_871X("recv tdls setup confirm frame\n");
|
||||
ret=On_TDLS_Setup_Cfm(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_TEARDOWN:
|
||||
DBG_871X("recv tdls teardown, free sta_info\n");
|
||||
ret=On_TDLS_Teardown(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_DISCOVERY_REQUEST:
|
||||
DBG_871X("recv tdls discovery request frame\n");
|
||||
ret=On_TDLS_Dis_Req(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_PEER_TRAFFIC_RESPONSE:
|
||||
DBG_871X("recv tdls peer traffic response frame\n");
|
||||
ret=On_TDLS_Peer_Traffic_Rsp(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_CHANNEL_SWITCH_REQUEST:
|
||||
DBG_871X("recv tdls channel switch request frame\n");
|
||||
ret=On_TDLS_Ch_Switch_Req(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_CHANNEL_SWITCH_RESPONSE:
|
||||
DBG_871X("recv tdls channel switch response frame\n");
|
||||
ret=On_TDLS_Ch_Switch_Rsp(adapter, precv_frame);
|
||||
break;
|
||||
#ifdef CONFIG_P2P
|
||||
case 0x50: /* First byte of WFA OUI */
|
||||
if( _rtw_memcmp(WFA_OUI, (paction), 3) )
|
||||
{
|
||||
if( *(paction + 3) == 0x04) /* Probe request frame */
|
||||
{
|
||||
/* WFDTDLS: for sigma test, do not setup direct link automatically */
|
||||
ptdlsinfo->dev_discovered = 1;
|
||||
DBG_871X("recv tunneled probe request frame\n");
|
||||
issue_tunneled_probe_rsp(adapter, precv_frame);
|
||||
}
|
||||
if( *(paction + 3) == 0x05) /* Probe response frame */
|
||||
{
|
||||
/* WFDTDLS: for sigma test, do not setup direct link automatically */
|
||||
ptdlsinfo->dev_discovered = 1;
|
||||
DBG_871X("recv tunneled probe response frame\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif /* CONFIG_P2P */
|
||||
default:
|
||||
DBG_871X("receive TDLS frame but not supported\n");
|
||||
ret=_FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
exit:
|
||||
return ret;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
void count_rx_stats(struct adapter *padapter, union recv_frame *prframe, struct sta_info*sta);
|
||||
void count_rx_stats(struct adapter *padapter, union recv_frame *prframe, struct sta_info*sta)
|
||||
{
|
||||
int sz;
|
||||
|
@ -1038,16 +935,6 @@ sint sta2sta_data_frame(
|
|||
u8 * sta_addr = NULL;
|
||||
sint bmcast = IS_MCAST(pattrib->dst);
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &adapter->tdlsinfo;
|
||||
struct sta_info *ptdls_sta=NULL;
|
||||
u8 *psnap_type=ptr+pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE;
|
||||
/* frame body located after [+2]: ether-type, [+1]: payload type */
|
||||
u8 *pframe_body = psnap_type+2+1;
|
||||
#endif
|
||||
|
||||
;
|
||||
|
||||
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) ||
|
||||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true))
|
||||
{
|
||||
|
@ -1076,89 +963,6 @@ sint sta2sta_data_frame(
|
|||
}
|
||||
else if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true)
|
||||
{
|
||||
#ifdef CONFIG_TDLS
|
||||
|
||||
/* direct link data transfer */
|
||||
if(ptdlsinfo->setup_state == TDLS_LINKED_STATE){
|
||||
ptdls_sta = rtw_get_stainfo(pstapriv, pattrib->src);
|
||||
if(ptdls_sta==NULL)
|
||||
{
|
||||
ret=_FAIL;
|
||||
goto exit;
|
||||
}
|
||||
else if(ptdls_sta->tdls_sta_state&TDLS_LINKED_STATE)
|
||||
{
|
||||
|
||||
/* drop QoS-SubType Data, including QoS NULL, excluding QoS-Data */
|
||||
if( (GetFrameSubType(ptr) & WIFI_QOS_DATA_TYPE )== WIFI_QOS_DATA_TYPE)
|
||||
{
|
||||
if(GetFrameSubType(ptr)&(BIT(4)|BIT(5)|BIT(6)))
|
||||
{
|
||||
DBG_871X("drop QoS-Sybtype Data\n");
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
/* filter packets that SA is myself or multicast or broadcast */
|
||||
if (_rtw_memcmp(myhwaddr, pattrib->src, ETH_ALEN)){
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
/* da should be for me */
|
||||
if((!_rtw_memcmp(myhwaddr, pattrib->dst, ETH_ALEN))&& (!bmcast))
|
||||
{
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
/* check BSSID */
|
||||
if( _rtw_memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
|
||||
_rtw_memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
|
||||
(!_rtw_memcmp(pattrib->bssid, mybssid, ETH_ALEN)) )
|
||||
{
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* process UAPSD tdls sta */
|
||||
process_pwrbit_data(adapter, precv_frame);
|
||||
|
||||
/* if NULL-frame, check pwrbit */
|
||||
if ((GetFrameSubType(ptr)) == WIFI_DATA_NULL)
|
||||
{
|
||||
/* NULL-frame with pwrbit=1, buffer_STA should buffer frames for sleep_STA */
|
||||
if(GetPwrMgt(ptr))
|
||||
{
|
||||
DBG_871X("TDLS: recv peer null frame with pwr bit 1\n");
|
||||
ptdls_sta->tdls_sta_state|=TDLS_PEER_SLEEP_STATE;
|
||||
/* it would be triggered when we are off channel and receiving NULL DATA */
|
||||
/* we can confirm that peer STA is at off channel */
|
||||
}
|
||||
else if(ptdls_sta->tdls_sta_state&TDLS_CH_SWITCH_ON_STATE)
|
||||
{
|
||||
if((ptdls_sta->tdls_sta_state & TDLS_PEER_AT_OFF_STATE) != TDLS_PEER_AT_OFF_STATE)
|
||||
{
|
||||
issue_nulldata_to_TDLS_peer_STA(adapter, ptdls_sta, 0);
|
||||
ptdls_sta->tdls_sta_state |= TDLS_PEER_AT_OFF_STATE;
|
||||
On_TDLS_Peer_Traffic_Rsp(adapter, precv_frame);
|
||||
}
|
||||
}
|
||||
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
/* receive some of all TDLS management frames, process it at ON_TDLS */
|
||||
if((_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_TDLS, 2))){
|
||||
ret= OnTDLS(adapter, precv_frame);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sta_addr = pattrib->src;
|
||||
|
||||
}
|
||||
else
|
||||
#endif /* CONFIG_TDLS */
|
||||
{
|
||||
/* For Station mode, sa and bssid should always be BSSID, and DA is my mac-address */
|
||||
if(!_rtw_memcmp(pattrib->bssid, pattrib->src, ETH_ALEN) )
|
||||
|
@ -1216,11 +1020,6 @@ sint sta2sta_data_frame(
|
|||
else
|
||||
*psta = rtw_get_stainfo(pstapriv, sta_addr); /* get ap_info */
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if(ptdls_sta != NULL)
|
||||
*psta = ptdls_sta;
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
if (*psta == NULL) {
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("can't get psta under sta2sta_data_frame ; drop pkt\n"));
|
||||
ret= _FAIL;
|
||||
|
@ -1722,11 +1521,6 @@ sint validate_recv_data_frame(struct adapter *adapter, union recv_frame *precv_f
|
|||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct security_priv *psecuritypriv = &adapter->securitypriv;
|
||||
sint ret = _SUCCESS;
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &adapter->tdlsinfo;
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
;
|
||||
|
||||
bretry = GetRetry(ptr);
|
||||
pda = get_da(ptr);
|
||||
|
@ -1847,14 +1641,6 @@ sint validate_recv_data_frame(struct adapter *adapter, union recv_frame *precv_f
|
|||
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("validate_recv_data_frame:pattrib->privacy=%x\n", pattrib->privacy));
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n ^^^^^^^^^^^IS_MCAST(pattrib->ra(0x%02x))=%d^^^^^^^^^^^^^^^6\n", pattrib->ra[0],IS_MCAST(pattrib->ra)));
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if((psta->tdls_sta_state & TDLS_LINKED_STATE) && (psta->dot118021XPrivacy==_AES_))
|
||||
{
|
||||
pattrib->encrypt=psta->dot118021XPrivacy;
|
||||
}
|
||||
else
|
||||
#endif /* CONFIG_TDLS */
|
||||
GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt, IS_MCAST(pattrib->ra));
|
||||
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n pattrib->encrypt=%d\n",pattrib->encrypt));
|
||||
|
@ -2013,10 +1799,6 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame)
|
|||
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &adapter->tdlsinfo;
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) {
|
||||
int ch_set_idx = rtw_ch_set_search_ch(pmlmeext->channel_set, rtw_get_oper_ch(adapter));
|
||||
|
@ -2025,27 +1807,6 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if(ptdlsinfo->ch_sensing==1 && ptdlsinfo->cur_channel !=0){
|
||||
ptdlsinfo->collect_pkt_num[ptdlsinfo->cur_channel-1]++;
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
#ifdef RTK_DMP_PLATFORM
|
||||
if ( 0 )
|
||||
{
|
||||
DBG_871X("++\n");
|
||||
{
|
||||
int i;
|
||||
for(i=0; i<64;i=i+8)
|
||||
DBG_871X("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:", *(ptr+i),
|
||||
*(ptr+i+1), *(ptr+i+2) ,*(ptr+i+3) ,*(ptr+i+4),*(ptr+i+5), *(ptr+i+6), *(ptr+i+7));
|
||||
|
||||
}
|
||||
DBG_871X("--\n");
|
||||
}
|
||||
#endif /* RTK_DMP_PLATFORM */
|
||||
|
||||
/* add version chk */
|
||||
if(ver!=0){
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_data_frame fail! (ver!=0)\n"));
|
||||
|
@ -3158,25 +2919,11 @@ int process_recv_indicatepkts(struct adapter *padapter, union recv_frame *prfram
|
|||
int process_recv_indicatepkts(struct adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
int retval = _SUCCESS;
|
||||
/* struct recv_priv *precvpriv = &padapter->recvpriv; */
|
||||
/* struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib; */
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
#ifdef CONFIG_TDLS
|
||||
struct sta_info *psta = prframe->u.hdr.psta;
|
||||
#endif /* CONFIG_TDLS */
|
||||
struct ht_priv *phtpriv = &pmlmepriv->htpriv;
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if( (phtpriv->ht_option==true) ||
|
||||
((psta->tdls_sta_state & TDLS_LINKED_STATE) &&
|
||||
(psta->htpriv.ht_option==true) &&
|
||||
(psta->htpriv.ampdu_enable==true))) /* B/G/N Mode */
|
||||
#else
|
||||
if(phtpriv->ht_option==true) /* B/G/N Mode */
|
||||
#endif /* CONFIG_TDLS */
|
||||
{
|
||||
/* prframe->u.hdr.preorder_ctrl = &precvpriv->recvreorder_ctrl[pattrib->priority]; */
|
||||
|
||||
if(recv_indicatepkt_reorder(padapter, prframe)!=_SUCCESS)/* including perform A-MPDU Rx Ordering Buffer Control */
|
||||
{
|
||||
#ifdef DBG_RX_DROP_FRAME
|
||||
|
@ -3255,13 +3002,6 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr
|
|||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
_queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
|
||||
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
u8 *psnap_type, *pcategory;
|
||||
struct sta_info *ptdls_sta = NULL;
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
|
||||
/* DATA FRAME */
|
||||
rtw_led_control(padapter, LED_CTL_RX);
|
||||
|
||||
|
@ -3275,19 +3015,6 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr
|
|||
goto _recv_data_drop;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
/* check TDLS frame */
|
||||
psnap_type = get_recvframe_data(orig_prframe);
|
||||
psnap_type+=pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE;
|
||||
pcategory = psnap_type + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN;
|
||||
|
||||
if((_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_TDLS, ETH_TYPE_LEN)) &&
|
||||
((*pcategory==RTW_WLAN_CATEGORY_TDLS) || (*pcategory==RTW_WLAN_CATEGORY_P2P))){
|
||||
ret = OnTDLS(padapter, prframe); /* all of functions will return _FAIL */
|
||||
goto _exit_recv_func;
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
prframe = recvframe_chk_defrag(padapter, prframe);
|
||||
if(prframe==NULL) {
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("recvframe_chk_defrag: drop pkt\n"));
|
||||
|
@ -3306,14 +3033,7 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr
|
|||
ret = _FAIL;
|
||||
goto _recv_data_drop;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if(padapter->tdlsinfo.setup_state == TDLS_LINKED_STATE)
|
||||
ptdls_sta = rtw_get_stainfo(&padapter->stapriv, pattrib->src);
|
||||
count_rx_stats(padapter, prframe, ptdls_sta);
|
||||
#else
|
||||
count_rx_stats(padapter, prframe, NULL);
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
ret = process_recv_indicatepkts(padapter, prframe);
|
||||
if (ret != _SUCCESS)
|
||||
|
|
|
@ -1620,19 +1620,6 @@ u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe)
|
|||
{
|
||||
prwskey=&stainfo->dot118021x_UncstKey.skey[0];
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS /* swencryption */
|
||||
{
|
||||
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) )
|
||||
{
|
||||
DBG_871X("[%s] for tdls link\n", __FUNCTION__);
|
||||
prwskey=&ptdls_sta->tpk.tk[0];
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
prwskeylen=16;
|
||||
|
||||
for(curfragnum=0;curfragnum<pattrib->nr_frags;curfragnum++){
|
||||
|
@ -2830,176 +2817,6 @@ static int omac1_aes_128(u8 *key, u8 *data, size_t data_len, u8 *mac)
|
|||
return omac1_aes_128_vector(key, 1, &data, &data_len, mac);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
void wpa_tdls_generate_tpk(struct adapter *padapter, struct sta_info *psta)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
u8 *SNonce = psta->SNonce;
|
||||
u8 *ANonce = psta->ANonce;
|
||||
|
||||
u8 key_input[SHA256_MAC_LEN];
|
||||
u8 *nonce[2];
|
||||
size_t len[2];
|
||||
u8 data[3 * ETH_ALEN];
|
||||
|
||||
/* IEEE Std 802.11z-2010 8.5.9.1:
|
||||
* TPK-Key-Input = SHA-256(min(SNonce, ANonce) || max(SNonce, ANonce))
|
||||
*/
|
||||
len[0] = 32;
|
||||
len[1] = 32;
|
||||
if (os_memcmp(SNonce, ANonce, 32) < 0) {
|
||||
nonce[0] = SNonce;
|
||||
nonce[1] = ANonce;
|
||||
} else {
|
||||
nonce[0] = ANonce;
|
||||
nonce[1] = SNonce;
|
||||
}
|
||||
|
||||
sha256_vector(2, nonce, len, key_input);
|
||||
|
||||
/*
|
||||
* TPK-Key-Data = KDF-N_KEY(TPK-Key-Input, "TDLS PMK",
|
||||
* min(MAC_I, MAC_R) || max(MAC_I, MAC_R) || BSSID || N_KEY)
|
||||
* TODO: is N_KEY really included in KDF Context and if so, in which
|
||||
* presentation format (little endian 16-bit?) is it used? It gets
|
||||
* added by the KDF anyway..
|
||||
*/
|
||||
|
||||
if (os_memcmp(myid(&(padapter->eeprompriv)), psta->hwaddr, ETH_ALEN) < 0) {
|
||||
memcpy(data, myid(&(padapter->eeprompriv)), ETH_ALEN);
|
||||
memcpy(data + ETH_ALEN, psta->hwaddr, ETH_ALEN);
|
||||
} else {
|
||||
memcpy(data, psta->hwaddr, ETH_ALEN);
|
||||
memcpy(data + ETH_ALEN, myid(&(padapter->eeprompriv)), ETH_ALEN);
|
||||
}
|
||||
memcpy(data + 2 * ETH_ALEN, get_bssid(pmlmepriv), ETH_ALEN);
|
||||
|
||||
sha256_prf(key_input, SHA256_MAC_LEN, "TDLS PMK", data, sizeof(data), (u8 *) &psta->tpk, sizeof(psta->tpk));
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* wpa_tdls_ftie_mic - Calculate TDLS FTIE MIC
|
||||
* @kck: TPK-KCK
|
||||
* @lnkid: Pointer to the beginning of Link Identifier IE
|
||||
* @rsnie: Pointer to the beginning of RSN IE used for handshake
|
||||
* @timeoutie: Pointer to the beginning of Timeout IE used for handshake
|
||||
* @ftie: Pointer to the beginning of FT IE
|
||||
* @mic: Pointer for writing MIC
|
||||
*
|
||||
* Calculate MIC for TDLS frame.
|
||||
*/
|
||||
int wpa_tdls_ftie_mic(u8 *kck, u8 trans_seq,
|
||||
u8 *lnkid, u8 *rsnie, u8 *timeoutie, u8 *ftie,
|
||||
u8 *mic)
|
||||
{
|
||||
u8 *buf, *pos;
|
||||
struct wpa_tdls_ftie *_ftie;
|
||||
struct wpa_tdls_lnkid *_lnkid;
|
||||
int ret;
|
||||
int len = 2 * ETH_ALEN + 1 + 2 + lnkid[1] + 2 + rsnie[1] +
|
||||
2 + timeoutie[1] + 2 + ftie[1];
|
||||
buf = rtw_zmalloc(len);
|
||||
if (!buf) {
|
||||
DBG_871X("TDLS: No memory for MIC calculation\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
pos = buf;
|
||||
_lnkid = (struct wpa_tdls_lnkid *) lnkid;
|
||||
/* 1) TDLS initiator STA MAC address */
|
||||
memcpy(pos, _lnkid->init_sta, ETH_ALEN);
|
||||
pos += ETH_ALEN;
|
||||
/* 2) TDLS responder STA MAC address */
|
||||
memcpy(pos, _lnkid->resp_sta, ETH_ALEN);
|
||||
pos += ETH_ALEN;
|
||||
/* 3) Transaction Sequence number */
|
||||
*pos++ = trans_seq;
|
||||
/* 4) Link Identifier IE */
|
||||
memcpy(pos, lnkid, 2 + lnkid[1]);
|
||||
pos += 2 + lnkid[1];
|
||||
/* 5) RSN IE */
|
||||
memcpy(pos, rsnie, 2 + rsnie[1]);
|
||||
pos += 2 + rsnie[1];
|
||||
/* 6) Timeout Interval IE */
|
||||
memcpy(pos, timeoutie, 2 + timeoutie[1]);
|
||||
pos += 2 + timeoutie[1];
|
||||
/* 7) FTIE, with the MIC field of the FTIE set to 0 */
|
||||
memcpy(pos, ftie, 2 + ftie[1]);
|
||||
_ftie = (struct wpa_tdls_ftie *) pos;
|
||||
memset(_ftie->mic, 0, TDLS_MIC_LEN);
|
||||
pos += 2 + ftie[1];
|
||||
|
||||
ret = omac1_aes_128(kck, buf, pos - buf, mic);
|
||||
rtw_mfree(buf, len);
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
int tdls_verify_mic(u8 *kck, u8 trans_seq,
|
||||
u8 *lnkid, u8 *rsnie, u8 *timeoutie, u8 *ftie)
|
||||
{
|
||||
u8 *buf, *pos;
|
||||
int len;
|
||||
u8 mic[16];
|
||||
int ret;
|
||||
u8 *rx_ftie, *tmp_ftie;
|
||||
|
||||
if (lnkid == NULL || rsnie == NULL ||
|
||||
timeoutie == NULL || ftie == NULL){
|
||||
return 0;
|
||||
}
|
||||
|
||||
len = 2 * ETH_ALEN + 1 + 2 + 18 + 2 + *(rsnie+1) + 2 + *(timeoutie+1) + 2 + *(ftie+1);
|
||||
|
||||
buf = rtw_zmalloc(len);
|
||||
if (buf == NULL)
|
||||
return 0;
|
||||
|
||||
pos = buf;
|
||||
/* 1) TDLS initiator STA MAC address */
|
||||
memcpy(pos, lnkid + ETH_ALEN + 2, ETH_ALEN);
|
||||
pos += ETH_ALEN;
|
||||
/* 2) TDLS responder STA MAC address */
|
||||
memcpy(pos, lnkid + 2 * ETH_ALEN + 2, ETH_ALEN);
|
||||
pos += ETH_ALEN;
|
||||
/* 3) Transaction Sequence number */
|
||||
*pos++ = trans_seq;
|
||||
/* 4) Link Identifier IE */
|
||||
memcpy(pos, lnkid, 2 + 18);
|
||||
pos += 2 + 18;
|
||||
/* 5) RSN IE */
|
||||
memcpy(pos, rsnie, 2 + *(rsnie+1));
|
||||
pos += 2 + *(rsnie+1);
|
||||
/* 6) Timeout Interval IE */
|
||||
memcpy(pos, timeoutie, 2 + *(timeoutie+1));
|
||||
pos += 2 + *(timeoutie+1);
|
||||
/* 7) FTIE, with the MIC field of the FTIE set to 0 */
|
||||
memcpy(pos, ftie, 2 + *(ftie+1));
|
||||
pos += 2;
|
||||
tmp_ftie = (u8 *) (pos+2);
|
||||
memset(tmp_ftie, 0, 16);
|
||||
pos += *(ftie+1);
|
||||
|
||||
ret = omac1_aes_128(kck, buf, pos - buf, mic);
|
||||
rtw_mfree(buf, len);
|
||||
if (ret)
|
||||
return 0;
|
||||
rx_ftie = ftie+4;
|
||||
|
||||
if (os_memcmp(mic, rx_ftie, 16) == 0) {
|
||||
/* Valid MIC */
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Invalid MIC */
|
||||
DBG_871X( "[%s] Invalid MIC\n", __FUNCTION__);
|
||||
return 0;
|
||||
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
void rtw_use_tkipkey_handler(void *FunctionContext)
|
||||
{
|
||||
struct adapter *padapter = (struct adapter *)FunctionContext;
|
||||
|
|
|
@ -372,16 +372,6 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
|||
|
||||
init_addba_retry_timer(pstapriv->padapter, psta);
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
psta->padapter = pstapriv->padapter;
|
||||
init_TPK_timer(pstapriv->padapter, psta);
|
||||
init_ch_switch_timer(pstapriv->padapter, psta);
|
||||
init_base_ch_timer(pstapriv->padapter, psta);
|
||||
init_off_ch_timer(pstapriv->padapter, psta);
|
||||
init_handshake_timer(pstapriv->padapter, psta);
|
||||
init_tdls_alive_timer(pstapriv->padapter, psta);
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
/* for A-MPDU Rx reordering buffer control */
|
||||
for(i=0; i < 16 ; i++) {
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
|
@ -497,15 +487,6 @@ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta)
|
|||
pstapriv->asoc_sta_count --;
|
||||
_cancel_timer_ex(&psta->addba_retry_timer);
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
_cancel_timer_ex(&psta->TPK_timer);
|
||||
_cancel_timer_ex(&psta->option_timer);
|
||||
_cancel_timer_ex(&psta->base_ch_timer);
|
||||
_cancel_timer_ex(&psta->off_ch_timer);
|
||||
_cancel_timer_ex(&psta->alive_timer1);
|
||||
_cancel_timer_ex(&psta->alive_timer2);
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
/* for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer */
|
||||
for(i=0; i < 16 ; i++)
|
||||
{
|
||||
|
|
2936
core/rtw_tdls.c
2936
core/rtw_tdls.c
File diff suppressed because it is too large
Load diff
|
@ -1166,24 +1166,6 @@ void VCS_update(struct adapter *padapter, struct sta_info *psta)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
int check_ap_tdls_prohibited(u8 *pframe, u8 pkt_len)
|
||||
{
|
||||
u8 tdls_prohibited_bit = 0x40; /* bit(38); TDLS_prohibited */
|
||||
|
||||
if(pkt_len < 5)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
pframe += 4;
|
||||
if( (*pframe) & tdls_prohibited_bit )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
|
||||
{
|
||||
unsigned int len;
|
||||
|
@ -1401,11 +1383,6 @@ void update_beacon_info(struct adapter *padapter, u8 *pframe, uint pkt_len, stru
|
|||
unsigned int len;
|
||||
PNDIS_802_11_VARIABLE_IEs pIE;
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
|
||||
u8 tdls_prohibited[] = { 0x00, 0x00, 0x00, 0x00, 0x10 }; /* bit(38): TDLS_prohibited */
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
len = pkt_len - (_BEACON_IE_OFFSET_ + WLAN_HDR_A3_LEN);
|
||||
|
||||
for (i = 0; i < len;)
|
||||
|
@ -1422,12 +1399,6 @@ void update_beacon_info(struct adapter *padapter, u8 *pframe, uint pkt_len, stru
|
|||
ERP_IE_handler(padapter, pIE);
|
||||
VCS_update(padapter, psta);
|
||||
break;
|
||||
#ifdef CONFIG_TDLS
|
||||
case _EXT_CAP_IE_:
|
||||
if( check_ap_tdls_prohibited(pIE->data, pIE->Length) == true )
|
||||
ptdlsinfo->ap_prohibited = true;
|
||||
break;
|
||||
#endif /* CONFIG_TDLS */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
454
core/rtw_xmit.c
454
core/rtw_xmit.c
|
@ -1033,12 +1033,6 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat
|
|||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct qos_priv *pqospriv = &pmlmepriv->qospriv;
|
||||
u8 qos_option = false;
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info *ptdls_sta=NULL, *psta_backup=NULL;
|
||||
u8 direct_link=0;
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
sint res = _SUCCESS;
|
||||
__le16 *fctrl = &pwlanhdr->frame_ctl;
|
||||
|
@ -1080,32 +1074,11 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat
|
|||
{
|
||||
if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true)) {
|
||||
/* to_ds = 1, fr_ds = 0; */
|
||||
#ifdef CONFIG_TDLS
|
||||
if((ptdlsinfo->setup_state == TDLS_LINKED_STATE)){
|
||||
ptdls_sta = rtw_get_stainfo(pstapriv, pattrib->dst);
|
||||
if((ptdls_sta!=NULL)&&(ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE)&&(pattrib->ether_type!=0x0806)){
|
||||
/* TDLS data transfer, ToDS=0, FrDs=0 */
|
||||
memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN);
|
||||
direct_link=1;
|
||||
}else{
|
||||
/* 1.Data transfer to AP */
|
||||
/* 2.Arp pkt will relayed by AP */
|
||||
SetToDs(fctrl);
|
||||
memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN);
|
||||
}
|
||||
}else
|
||||
#endif /* CONFIG_TDLS */
|
||||
{
|
||||
/* Data transfer to AP */
|
||||
SetToDs(fctrl);
|
||||
memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN);
|
||||
}
|
||||
/* Data transfer to AP */
|
||||
SetToDs(fctrl);
|
||||
memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN);
|
||||
|
||||
if (pqospriv->qos_option)
|
||||
qos_option = true;
|
||||
|
@ -1159,13 +1132,6 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat
|
|||
/* Update Seq Num will be handled by f/w */
|
||||
{
|
||||
if(psta){
|
||||
#ifdef CONFIG_TDLS
|
||||
if(direct_link==1)
|
||||
{
|
||||
psta_backup = psta;
|
||||
psta = ptdls_sta;
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
psta->sta_xmitpriv.txseq_tid[pattrib->priority]++;
|
||||
psta->sta_xmitpriv.txseq_tid[pattrib->priority] &= 0xFFF;
|
||||
|
@ -1208,29 +1174,6 @@ s32 rtw_make_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pat
|
|||
}
|
||||
|
||||
}
|
||||
#ifdef CONFIG_TDLS
|
||||
if(direct_link==1)
|
||||
{
|
||||
if (pattrib->encrypt){
|
||||
pattrib->encrypt= _AES_;
|
||||
pattrib->iv_len=8;
|
||||
pattrib->icv_len=8;
|
||||
}
|
||||
|
||||
/* qos_en, ht_en, init rate, ,bw, ch_offset, sgi */
|
||||
/* pattrib->qos_en = ptdls_sta->qos_option; */
|
||||
|
||||
pattrib->raid = ptdls_sta->raid;
|
||||
pattrib->bwmode = ptdls_sta->htpriv.bwmode;
|
||||
pattrib->ht_en = ptdls_sta->htpriv.ht_option;
|
||||
pattrib->ch_offset = ptdls_sta->htpriv.ch_offset;
|
||||
pattrib->sgi= ptdls_sta->htpriv.sgi;
|
||||
pattrib->mac_id = ptdls_sta->mac_id;
|
||||
|
||||
psta = psta_backup;
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1310,269 +1253,6 @@ s32 rtw_txframes_sta_ac_pending(struct adapter *padapter, struct pkt_attrib *pat
|
|||
return ptxservq->qcnt;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
|
||||
int rtw_build_tdls_ies(struct adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, u8 action)
|
||||
{
|
||||
int res=_SUCCESS;
|
||||
|
||||
switch(action){
|
||||
case TDLS_SETUP_REQUEST:
|
||||
rtw_build_tdls_setup_req_ies(padapter, pxmitframe, pframe);
|
||||
break;
|
||||
case TDLS_SETUP_RESPONSE:
|
||||
rtw_build_tdls_setup_rsp_ies(padapter, pxmitframe, pframe);
|
||||
break;
|
||||
case TDLS_SETUP_CONFIRM:
|
||||
rtw_build_tdls_setup_cfm_ies(padapter, pxmitframe, pframe);
|
||||
break;
|
||||
case TDLS_TEARDOWN:
|
||||
rtw_build_tdls_teardown_ies(padapter, pxmitframe, pframe);
|
||||
break;
|
||||
case TDLS_DISCOVERY_REQUEST:
|
||||
rtw_build_tdls_dis_req_ies(padapter, pxmitframe, pframe);
|
||||
break;
|
||||
case TDLS_PEER_TRAFFIC_INDICATION:
|
||||
rtw_build_tdls_peer_traffic_indication_ies(padapter, pxmitframe, pframe);
|
||||
break;
|
||||
case TDLS_CHANNEL_SWITCH_REQUEST:
|
||||
rtw_build_tdls_ch_switch_req_ies(padapter, pxmitframe, pframe);
|
||||
break;
|
||||
case TDLS_CHANNEL_SWITCH_RESPONSE:
|
||||
rtw_build_tdls_ch_switch_rsp_ies(padapter, pxmitframe, pframe);
|
||||
break;
|
||||
#ifdef CONFIG_P2P
|
||||
case TUNNELED_PROBE_REQ:
|
||||
rtw_build_tunneled_probe_req_ies(padapter, pxmitframe, pframe);
|
||||
break;
|
||||
case TUNNELED_PROBE_RSP:
|
||||
rtw_build_tunneled_probe_rsp_ies(padapter, pxmitframe, pframe);
|
||||
break;
|
||||
#endif /* CONFIG_P2P */
|
||||
default:
|
||||
res=_FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
s32 rtw_make_tdls_wlanhdr (struct adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib, u8 action)
|
||||
{
|
||||
u16 *qc;
|
||||
struct rtw_ieee80211_hdr *pwlanhdr = (struct rtw_ieee80211_hdr *)hdr;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct qos_priv *pqospriv = &pmlmepriv->qospriv;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta=NULL, *ptdls_sta=NULL;
|
||||
u8 tdls_seq=0, baddr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||
|
||||
sint res = _SUCCESS;
|
||||
u16 *fctrl = &pwlanhdr->frame_ctl;
|
||||
|
||||
;
|
||||
|
||||
memset(hdr, 0, WLANHDR_OFFSET);
|
||||
|
||||
SetFrameSubType(fctrl, pattrib->subtype);
|
||||
|
||||
switch(action){
|
||||
case TDLS_SETUP_REQUEST:
|
||||
case TDLS_SETUP_RESPONSE:
|
||||
case TDLS_SETUP_CONFIRM:
|
||||
case TDLS_TEARDOWN: /* directly to peer STA or via AP */
|
||||
case TDLS_PEER_TRAFFIC_INDICATION:
|
||||
case TDLS_PEER_PSM_REQUEST: /* directly to peer STA or via AP */
|
||||
case TUNNELED_PROBE_REQ:
|
||||
case TUNNELED_PROBE_RSP:
|
||||
SetToDs(fctrl);
|
||||
memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN);
|
||||
break;
|
||||
case TDLS_CHANNEL_SWITCH_REQUEST:
|
||||
case TDLS_CHANNEL_SWITCH_RESPONSE:
|
||||
case TDLS_PEER_PSM_RESPONSE:
|
||||
case TDLS_PEER_TRAFFIC_RESPONSE:
|
||||
memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN);
|
||||
tdls_seq=1;
|
||||
break;
|
||||
case TDLS_DISCOVERY_REQUEST: /* unicast: directly to peer sta, Bcast: via AP */
|
||||
if(_rtw_memcmp(pattrib->dst, baddr, ETH_ALEN) )
|
||||
{
|
||||
SetToDs(fctrl);
|
||||
memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
|
||||
memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN);
|
||||
tdls_seq=1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (pattrib->encrypt)
|
||||
SetPrivacy(fctrl);
|
||||
|
||||
if (pqospriv->qos_option)
|
||||
{
|
||||
qc = (unsigned short *)(hdr + pattrib->hdrlen - 2);
|
||||
if (pattrib->priority)
|
||||
SetPriority(qc, pattrib->priority);
|
||||
SetAckpolicy(qc, pattrib->ack_policy);
|
||||
}
|
||||
|
||||
psta = pattrib->psta;
|
||||
|
||||
/* 1. update seq_num per link by sta_info */
|
||||
/* 2. rewrite encrypt to _AES_, also rewrite iv_len, icv_len */
|
||||
if(tdls_seq==1){
|
||||
ptdls_sta=rtw_get_stainfo(pstapriv, pattrib->dst);
|
||||
if(ptdls_sta){
|
||||
ptdls_sta->sta_xmitpriv.txseq_tid[pattrib->priority]++;
|
||||
ptdls_sta->sta_xmitpriv.txseq_tid[pattrib->priority] &= 0xFFF;
|
||||
pattrib->seqnum = ptdls_sta->sta_xmitpriv.txseq_tid[pattrib->priority];
|
||||
SetSeqNum(hdr, pattrib->seqnum);
|
||||
|
||||
if (pattrib->encrypt){
|
||||
pattrib->encrypt= _AES_;
|
||||
pattrib->iv_len=8;
|
||||
pattrib->icv_len=8;
|
||||
}
|
||||
}else{
|
||||
res=_FAIL;
|
||||
goto exit;
|
||||
}
|
||||
}else if(psta){
|
||||
psta->sta_xmitpriv.txseq_tid[pattrib->priority]++;
|
||||
psta->sta_xmitpriv.txseq_tid[pattrib->priority] &= 0xFFF;
|
||||
pattrib->seqnum = psta->sta_xmitpriv.txseq_tid[pattrib->priority];
|
||||
SetSeqNum(hdr, pattrib->seqnum);
|
||||
}
|
||||
|
||||
|
||||
exit:
|
||||
|
||||
;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
s32 rtw_xmit_tdls_coalesce(struct adapter * padapter, struct xmit_frame * pxmitframe, u8 action)
|
||||
{
|
||||
s32 llc_sz;
|
||||
|
||||
u8 *pframe, *mem_start;
|
||||
|
||||
struct sta_info *psta;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
||||
u8 *pbuf_start;
|
||||
s32 bmcst = IS_MCAST(pattrib->ra);
|
||||
s32 res = _SUCCESS;
|
||||
|
||||
;
|
||||
|
||||
if (pattrib->psta) {
|
||||
psta = pattrib->psta;
|
||||
} else {
|
||||
if(bmcst) {
|
||||
psta = rtw_get_bcmc_stainfo(padapter);
|
||||
} else {
|
||||
psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra);
|
||||
}
|
||||
}
|
||||
|
||||
if(psta==NULL)
|
||||
return _FAIL;
|
||||
|
||||
if (pxmitframe->buf_addr == NULL)
|
||||
return _FAIL;
|
||||
|
||||
pbuf_start = pxmitframe->buf_addr;
|
||||
mem_start = pbuf_start + TXDESC_OFFSET;
|
||||
|
||||
if (rtw_make_tdls_wlanhdr(padapter, mem_start, pattrib, action) == _FAIL) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
pframe = mem_start;
|
||||
pframe += pattrib->hdrlen;
|
||||
|
||||
/* adding icv, if necessary... */
|
||||
if (pattrib->iv_len)
|
||||
{
|
||||
if (psta != NULL)
|
||||
{
|
||||
switch(pattrib->encrypt)
|
||||
{
|
||||
case _WEP40_:
|
||||
case _WEP104_:
|
||||
WEP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx);
|
||||
break;
|
||||
case _TKIP_:
|
||||
if(bmcst)
|
||||
TKIP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx);
|
||||
else
|
||||
TKIP_IV(pattrib->iv, psta->dot11txpn, 0);
|
||||
break;
|
||||
case _AES_:
|
||||
if(bmcst)
|
||||
AES_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx);
|
||||
else
|
||||
AES_IV(pattrib->iv, psta->dot11txpn, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(pframe, pattrib->iv, pattrib->iv_len);
|
||||
pframe += pattrib->iv_len;
|
||||
|
||||
}
|
||||
|
||||
llc_sz = rtw_put_snap(pframe, pattrib->ether_type);
|
||||
pframe += llc_sz;
|
||||
|
||||
/* pattrib->pktlen will be counted in rtw_build_tdls_ies */
|
||||
pattrib->pktlen = 0;
|
||||
|
||||
rtw_build_tdls_ies(padapter, pxmitframe, pframe, action);
|
||||
|
||||
if ((pattrib->icv_len >0 )&& (pattrib->bswenc)) {
|
||||
pframe += pattrib->pktlen;
|
||||
memcpy(pframe, pattrib->icv, pattrib->icv_len);
|
||||
pframe += pattrib->icv_len;
|
||||
}
|
||||
|
||||
pattrib->nr_frags = 1;
|
||||
pattrib->last_txcmdsz = pattrib->hdrlen + pattrib->iv_len + llc_sz +
|
||||
((pattrib->bswenc) ? pattrib->icv_len : 0) + pattrib->pktlen;
|
||||
|
||||
if (xmitframe_addmic(padapter, pxmitframe) == _FAIL)
|
||||
{
|
||||
goto exit;
|
||||
}
|
||||
|
||||
xmitframe_swencrypt(padapter, pxmitframe);
|
||||
|
||||
update_attrib_vcs_info(padapter, pxmitframe);
|
||||
|
||||
exit:
|
||||
|
||||
;
|
||||
|
||||
return res;
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
/*
|
||||
* Calculate wlan 802.11 packet MAX size from pkt_attrib
|
||||
* This function doesn't consider fragment case
|
||||
|
@ -3148,82 +2828,7 @@ s32 rtw_xmit(struct adapter *padapter, _pkt **ppkt)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
sint xmitframe_enqueue_for_tdls_sleeping_sta(struct adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
{
|
||||
sint ret=false;
|
||||
|
||||
_irqL irqL;
|
||||
struct sta_info *ptdls_sta=NULL;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
int i;
|
||||
|
||||
ptdls_sta=rtw_get_stainfo(pstapriv, pattrib->dst);
|
||||
if(ptdls_sta==NULL){
|
||||
return ret;
|
||||
}else if(ptdls_sta->tdls_sta_state&TDLS_LINKED_STATE){
|
||||
|
||||
if(pattrib->triggered==1)
|
||||
{
|
||||
ret = true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
_enter_critical_bh(&ptdls_sta->sleep_q.lock, &irqL);
|
||||
|
||||
if(ptdls_sta->state&WIFI_SLEEP_STATE)
|
||||
{
|
||||
rtw_list_delete(&pxmitframe->list);
|
||||
|
||||
/* _enter_critical_bh(&psta->sleep_q.lock, &irqL); */
|
||||
|
||||
rtw_list_insert_tail(&pxmitframe->list, get_list_head(&ptdls_sta->sleep_q));
|
||||
|
||||
ptdls_sta->sleepq_len++;
|
||||
ptdls_sta->sleepq_ac_len++;
|
||||
|
||||
/* indicate 4-AC queue bit in TDLS peer traffic indication */
|
||||
switch(pattrib->priority)
|
||||
{
|
||||
case 1:
|
||||
case 2:
|
||||
ptdls_sta->uapsd_bk = ptdls_sta->uapsd_bk | BIT(1);
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
ptdls_sta->uapsd_vi = ptdls_sta->uapsd_vi | BIT(1);
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
ptdls_sta->uapsd_vo = ptdls_sta->uapsd_vo | BIT(1);
|
||||
break;
|
||||
case 0:
|
||||
case 3:
|
||||
default:
|
||||
ptdls_sta->uapsd_be = ptdls_sta->uapsd_be | BIT(1);
|
||||
break;
|
||||
}
|
||||
|
||||
if(ptdls_sta->sleepq_len==1)
|
||||
{
|
||||
/* transmit TDLS PTI via AP */
|
||||
rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_SD_PTI);
|
||||
}
|
||||
ret = true;
|
||||
|
||||
}
|
||||
|
||||
_exit_critical_bh(&ptdls_sta->sleep_q.lock, &irqL);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
#if defined(CONFIG_AP_MODE) || defined(CONFIG_TDLS)
|
||||
#if defined(CONFIG_AP_MODE)
|
||||
|
||||
sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
{
|
||||
|
@ -3234,15 +2839,6 @@ sint xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_fr
|
|||
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
sint bmcst = IS_MCAST(pattrib->ra);
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
|
||||
|
||||
if( ptdlsinfo->setup_state == TDLS_LINKED_STATE )
|
||||
{
|
||||
ret = xmitframe_enqueue_for_tdls_sleeping_sta(padapter, pxmitframe);
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == false)
|
||||
return ret;
|
||||
|
@ -3439,13 +3035,8 @@ void stop_sta_xmit(struct adapter *padapter, struct sta_info *psta)
|
|||
|
||||
psta->state |= WIFI_SLEEP_STATE;
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if( !(psta->tdls_sta_state & TDLS_LINKED_STATE) )
|
||||
#endif /* CONFIG_TDLS */
|
||||
pstapriv->sta_dz_bitmap |= BIT(psta->aid);
|
||||
|
||||
|
||||
|
||||
dequeue_xmitframes_to_sleeping_queue(padapter, psta, &pstaxmitpriv->vo_q.sta_pending);
|
||||
rtw_list_delete(&(pstaxmitpriv->vo_q.tx_pending));
|
||||
|
||||
|
@ -3461,27 +3052,13 @@ void stop_sta_xmit(struct adapter *padapter, struct sta_info *psta)
|
|||
dequeue_xmitframes_to_sleeping_queue(padapter, psta, &pstaxmitpriv->bk_q.sta_pending);
|
||||
rtw_list_delete(&(pstaxmitpriv->bk_q.tx_pending));
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if( !(psta->tdls_sta_state & TDLS_LINKED_STATE) )
|
||||
{
|
||||
if( psta_bmc != NULL )
|
||||
{
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
|
||||
/* for BC/MC Frames */
|
||||
pstaxmitpriv = &psta_bmc->sta_xmitpriv;
|
||||
dequeue_xmitframes_to_sleeping_queue(padapter, psta_bmc, &pstaxmitpriv->be_q.sta_pending);
|
||||
rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending));
|
||||
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
|
||||
|
@ -3496,8 +3073,6 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
|
|||
|
||||
psta_bmc = rtw_get_bcmc_stainfo(padapter);
|
||||
|
||||
|
||||
/* _enter_critical_bh(&psta->sleep_q.lock, &irqL); */
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
|
||||
xmitframe_phead = get_list_head(&psta->sleep_q);
|
||||
|
@ -3621,15 +3196,6 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
|
|||
|
||||
if(psta->sleepq_len==0)
|
||||
{
|
||||
#ifdef CONFIG_TDLS
|
||||
if( psta->tdls_sta_state & TDLS_LINKED_STATE )
|
||||
{
|
||||
if(psta->state&WIFI_SLEEP_STATE)
|
||||
psta->state ^= WIFI_SLEEP_STATE;
|
||||
|
||||
goto _exit;
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
pstapriv->tim_bitmap &= ~BIT(psta->aid);
|
||||
|
||||
/* DBG_871X("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); */
|
||||
|
@ -3737,14 +3303,6 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst
|
|||
|
||||
if((psta->sleepq_ac_len==0) && (!psta->has_legacy_ac) && (wmmps_ac))
|
||||
{
|
||||
#ifdef CONFIG_TDLS
|
||||
if(psta->tdls_sta_state & TDLS_LINKED_STATE )
|
||||
{
|
||||
/* _exit_critical_bh(&psta->sleep_q.lock, &irqL); */
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL);
|
||||
return;
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
pstapriv->tim_bitmap &= ~BIT(psta->aid);
|
||||
|
||||
/* DBG_871X("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue