mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-08 14:33:05 +00:00
rtl8188eu: Remove dead code for CONFIG_TDLS
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
0e4009c999
commit
e79535e153
23 changed files with 50 additions and 5135 deletions
|
@ -1397,22 +1397,12 @@ _func_enter_;
|
|||
_rtw_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)
|
||||
_rtw_memcpy(&psetstakey_para->key, sta->tpk.tk, 16);
|
||||
else
|
||||
#endif /* CONFIG_TDLS */
|
||||
_rtw_memcpy(&psetstakey_para->key, &sta->dot118021x_UncstKey, 16);
|
||||
} else {
|
||||
_rtw_memcpy(&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey, 16);
|
||||
|
@ -1884,47 +1874,7 @@ _func_exit_;
|
|||
|
||||
u8 rtw_tdls_cmd(_adapter *padapter, u8 *addr, u8 option)
|
||||
{
|
||||
struct cmd_obj* pcmdobj;
|
||||
struct TDLSoption_param *TDLSoption;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
||||
|
||||
u8 res=_SUCCESS;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
spin_lock(&(padapter->tdlsinfo.cmd_lock));
|
||||
_rtw_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:
|
||||
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return res;
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
static void traffic_status_watchdog(_adapter *padapter)
|
||||
|
@ -1938,9 +1888,6 @@ static void traffic_status_watchdog(_adapter *padapter)
|
|||
u16 bPktCount = 0;
|
||||
#endif
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &(padapter->tdlsinfo);
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
/* */
|
||||
/* Determine if our traffic is busy now */
|
||||
|
@ -1993,14 +1940,6 @@ static void traffic_status_watchdog(_adapter *padapter)
|
|||
}
|
||||
#endif /* CONFIG_KEEP_FTP_TRANSMIT */
|
||||
|
||||
#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_LPS
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
if (BT_1Ant(padapter) == false)
|
||||
|
|
|
@ -1213,9 +1213,6 @@ void rtw_free_assoc_resources(_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 */
|
||||
_func_enter_;
|
||||
|
||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_notice_, ("+rtw_free_assoc_resources\n"));
|
||||
|
@ -1227,18 +1224,9 @@ _func_enter_;
|
|||
|
||||
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);
|
||||
} else
|
||||
#endif /* CONFIG_TDLS */
|
||||
{
|
||||
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
rtw_free_stainfo(adapter, psta);
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
}
|
||||
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
rtw_free_stainfo(adapter, psta);
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
}
|
||||
|
||||
if (check_fwstate( pmlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE|WIFI_AP_STATE)) {
|
||||
|
|
|
@ -264,14 +264,15 @@ static void init_mlme_ext_priv_value(_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,};
|
||||
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,
|
||||
};
|
||||
|
||||
ATOMIC_SET(&pmlmeext->event_seq, 0);
|
||||
pmlmeext->mgnt_seq = 0;/* reset to zero when disconnect at client mode */
|
||||
|
@ -620,16 +621,6 @@ void mgt_dispatcher(_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_88E("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));
|
||||
|
@ -637,13 +628,9 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
|
|||
}
|
||||
ptable += index;
|
||||
|
||||
#if 1
|
||||
if (psta != NULL)
|
||||
{
|
||||
if (GetRetry(pframe))
|
||||
{
|
||||
if (precv_frame->u.hdr.attrib.seq_num == psta->RxMgmtFrameSeqNum)
|
||||
{
|
||||
if (psta != NULL) {
|
||||
if (GetRetry(pframe)) {
|
||||
if (precv_frame->u.hdr.attrib.seq_num == psta->RxMgmtFrameSeqNum) {
|
||||
/* drop the duplicate management frame */
|
||||
DBG_88E("Drop duplicate management frame with seq_num = %d.\n", precv_frame->u.hdr.attrib.seq_num);
|
||||
return;
|
||||
|
@ -651,14 +638,6 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
|
|||
}
|
||||
psta->RxMgmtFrameSeqNum = precv_frame->u.hdr.attrib.seq_num;
|
||||
}
|
||||
#else
|
||||
|
||||
if (GetRetry(pframe))
|
||||
{
|
||||
/* RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("drop due to decache!\n")); */
|
||||
/* return; */
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
switch (GetFrameSubType(pframe))
|
||||
|
@ -2386,19 +2365,8 @@ unsigned int OnAction_back(_adapter *padapter, union recv_frame *precv_frame)
|
|||
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;
|
||||
}
|
||||
|
||||
action = frame_body[1];
|
||||
DBG_88E("%s, action=%d\n", __func__, action);
|
||||
|
@ -10635,13 +10603,6 @@ u8 sitesurvey_cmd_hdl(_adapter *padapter, u8 *pbuf)
|
|||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
else if (is_client_associated_to_ap(padapter->pbuddy_adapter) == true)
|
||||
{
|
||||
#ifdef CONFIG_TDLS
|
||||
if (padapter->pbuddy_adapter->wdinfo.wfd_tdls_enable == 1)
|
||||
{
|
||||
issue_tunneled_probe_req(padapter->pbuddy_adapter);
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
pmlmeext->sitesurvey_res.state = SCAN_TXNULL;
|
||||
|
||||
issue_nulldata(padapter->pbuddy_adapter, NULL, 1, 3, 500);
|
||||
|
@ -10745,11 +10706,6 @@ u8 set_stakey_hdl(_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 */
|
||||
|
@ -10851,20 +10807,6 @@ u8 set_stakey_hdl(_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;
|
||||
|
@ -10893,19 +10835,7 @@ u8 add_ba_hdl(_adapter *padapter, unsigned char *pbuf)
|
|||
issue_action_BA(padapter, pparm->addr, RTW_WLAN_ACTION_ADDBA_REQ, (u16)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, (u16)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);
|
||||
}
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
|
@ -12126,163 +12056,5 @@ u8 set_csa_hdl(_adapter *padapter, unsigned char *pbuf)
|
|||
/* TDLS_FREE_STA : free tdls sta */
|
||||
u8 tdls_hdl(_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_88E("[%s] option:%d\n", __func__, 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_88E("TDLS with %pM\n", 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_88E("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_88E("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_88E("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_88E("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_88E("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_88E("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_88E("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_88E("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 */
|
||||
|
||||
}
|
||||
|
|
|
@ -929,26 +929,6 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel
|
|||
|
||||
}
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
#ifdef CONFIG_TDLS
|
||||
if ( ( tunneled == 0 ) && ( padapter->pbuddy_adapter->wdinfo.wfd_tdls_enable == 1 ) )
|
||||
{
|
||||
/* Alternative MAC Address ATTR */
|
||||
/* Type: */
|
||||
wfdie[ wfdielen++ ] = WFD_ATTR_ALTER_MAC;
|
||||
|
||||
/* Length: */
|
||||
/* Note: In the WFD specification, the size of length field is 2. */
|
||||
RTW_PUT_BE16(wfdie + wfdielen, ETH_ALEN );
|
||||
wfdielen += 2;
|
||||
|
||||
/* Value: */
|
||||
/* Alternative MAC Address */
|
||||
_rtw_memcpy( wfdie + wfdielen, &padapter->pbuddy_adapter->eeprompriv.mac_addr[ 0 ], ETH_ALEN );
|
||||
/* This mac address is used to make the WFD session when TDLS is enable. */
|
||||
|
||||
wfdielen += ETH_ALEN;
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
#endif /* CONFIG_CONCURRENT_MODE */
|
||||
|
||||
pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len);
|
||||
|
@ -2632,9 +2612,6 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
|
|||
#ifdef CONFIG_WFD
|
||||
u8 wfd_ie[ 128 ] = { 0x00 };
|
||||
u32 wfd_ielen = 0;
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
|
||||
#endif /* CONFIG_TDLS */
|
||||
#endif /* CONFIG_WFD */
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
_adapter *pbuddy_adapter = pwdinfo->padapter->pbuddy_adapter;
|
||||
|
@ -2695,23 +2672,10 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
|
|||
u8 peer_ch_num = 0;
|
||||
u8 ch_list_inclusioned[50] = { 0x00 };
|
||||
u8 ch_num_inclusioned = 0;
|
||||
#if defined(CONFIG_WFD) && defined(CONFIG_TDLS)
|
||||
u16 cap_attr;
|
||||
#endif /* defined(CONFIG_WFD) && defined(CONFIG_TDLS) */
|
||||
__le16 le_tmp;
|
||||
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_ING);
|
||||
|
||||
/* Check P2P Capability ATTR */
|
||||
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&le_tmp, (uint*)&attr_contentlen) )
|
||||
{
|
||||
#if defined(CONFIG_WFD) && defined(CONFIG_TDLS)
|
||||
cap_attr = le16_to_cpu(le_tmp);
|
||||
if (!(cap_attr & P2P_GRPCAP_INTRABSS) )
|
||||
ptdlsinfo->ap_prohibited = true;
|
||||
#endif /* defined(CONFIG_WFD) && defined(CONFIG_TDLS) */
|
||||
}
|
||||
|
||||
if ( rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GO_INTENT , &attr_content, &attr_contentlen) )
|
||||
{
|
||||
DBG_88E( "[%s] GO Intent = %d, tie = %d\n", __func__, attr_content >> 1, attr_content & 0x01 );
|
||||
|
@ -2858,9 +2822,6 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram
|
|||
#ifdef CONFIG_WFD
|
||||
u8 wfd_ie[ 128 ] = { 0x00 };
|
||||
u32 wfd_ielen = 0;
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
|
||||
#endif /* CONFIG_TDLS */
|
||||
#endif /* CONFIG_WFD */
|
||||
|
||||
ies = pframe + _PUBLIC_ACTION_IE_OFFSET_;
|
||||
|
@ -2895,9 +2856,6 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram
|
|||
uint ch_cnt = 0;
|
||||
u8 ch_content[50] = { 0x00 };
|
||||
u8 groupid[ 38 ];
|
||||
#ifdef CONFIG_TDLS
|
||||
u16 cap_attr;
|
||||
#endif /* CONFIG_TDLS */
|
||||
u8 peer_ch_list[50] = { 0x00 };
|
||||
u8 peer_ch_num = 0;
|
||||
u8 ch_list_inclusioned[50] = { 0x00 };
|
||||
|
@ -2905,15 +2863,6 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram
|
|||
__le16 le_tmp;
|
||||
|
||||
while (p2p_ie) { /* Found the P2P IE. */
|
||||
/* Check P2P Capability ATTR */
|
||||
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CAPABILITY, (u8*)&le_tmp, (uint*)&attr_contentlen) ) {
|
||||
#ifdef CONFIG_TDLS
|
||||
cap_attr = le16_to_cpu(le_tmp);
|
||||
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 ) {
|
||||
DBG_88E( "[%s] Status = %d\n", __func__, attr_content );
|
||||
|
|
|
@ -484,13 +484,6 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode
|
|||
#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 */
|
||||
|
||||
_func_enter_;
|
||||
|
||||
|
@ -526,28 +519,6 @@ _func_enter_;
|
|||
#endif /* CONFIG_P2P_PS */
|
||||
{
|
||||
DBG_88E("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));
|
||||
|
@ -563,28 +534,6 @@ _func_enter_;
|
|||
)
|
||||
{
|
||||
DBG_88E("%s: Enter 802.11 power save\n", __func__);
|
||||
|
||||
#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;
|
||||
|
|
270
core/rtw_recv.c
270
core/rtw_recv.c
|
@ -843,23 +843,13 @@ void process_wmmps_data(_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)
|
||||
{
|
||||
if (psta->state&WIFI_SLEEP_STATE) {
|
||||
u8 wmmps_ac=0;
|
||||
|
||||
switch (pattrib->priority)
|
||||
|
@ -904,100 +894,6 @@ void process_wmmps_data(_adapter *padapter, union recv_frame *precv_frame)
|
|||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
sint OnTDLS(_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_WFD
|
||||
u8 WFA_OUI[3] = { 0x50, 0x6f, 0x9a };
|
||||
#endif /* CONFIG_WFD */
|
||||
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_88E("recv tdls frame, "
|
||||
"but tdls haven't enabled\n");
|
||||
ret = _FAIL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
switch (*paction){
|
||||
case TDLS_SETUP_REQUEST:
|
||||
DBG_88E("recv tdls setup request frame\n");
|
||||
ret=On_TDLS_Setup_Req(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_SETUP_RESPONSE:
|
||||
DBG_88E("recv tdls setup response frame\n");
|
||||
ret=On_TDLS_Setup_Rsp(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_SETUP_CONFIRM:
|
||||
DBG_88E("recv tdls setup confirm frame\n");
|
||||
ret=On_TDLS_Setup_Cfm(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_TEARDOWN:
|
||||
DBG_88E("recv tdls teardown, free sta_info\n");
|
||||
ret=On_TDLS_Teardown(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_DISCOVERY_REQUEST:
|
||||
DBG_88E("recv tdls discovery request frame\n");
|
||||
ret=On_TDLS_Dis_Req(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_PEER_TRAFFIC_RESPONSE:
|
||||
DBG_88E("recv tdls peer traffic response frame\n");
|
||||
ret=On_TDLS_Peer_Traffic_Rsp(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_CHANNEL_SWITCH_REQUEST:
|
||||
DBG_88E("recv tdls channel switch request frame\n");
|
||||
ret=On_TDLS_Ch_Switch_Req(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_CHANNEL_SWITCH_RESPONSE:
|
||||
DBG_88E("recv tdls channel switch response frame\n");
|
||||
ret=On_TDLS_Ch_Switch_Rsp(adapter, precv_frame);
|
||||
break;
|
||||
#ifdef CONFIG_WFD
|
||||
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_88E("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_88E("recv tunneled probe response frame\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif /* CONFIG_WFD */
|
||||
default:
|
||||
DBG_88E("receive TDLS frame but not supported\n");
|
||||
ret=_FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
exit:
|
||||
return ret;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
void count_rx_stats(_adapter *padapter, union recv_frame *prframe, struct sta_info*sta);
|
||||
void count_rx_stats(_adapter *padapter, union recv_frame *prframe, struct sta_info*sta)
|
||||
{
|
||||
int sz;
|
||||
|
@ -1051,14 +947,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
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) ||
|
||||
|
@ -1089,100 +977,14 @@ _func_enter_;
|
|||
}
|
||||
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_88E("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_88E("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) )
|
||||
{
|
||||
/* 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) )
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("bssid != TA under STATION_MODE; drop pkt\n"));
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("bssid != TA under STATION_MODE; drop pkt\n"));
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
sta_addr = pattrib->bssid;
|
||||
}
|
||||
|
||||
}
|
||||
else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
|
||||
|
@ -1229,11 +1031,6 @@ _func_enter_;
|
|||
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"));
|
||||
#ifdef CONFIG_MP_INCLUDED
|
||||
|
@ -1743,9 +1540,6 @@ sint validate_recv_data_frame(_adapter *adapter, union recv_frame *precv_frame)
|
|||
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 */
|
||||
|
||||
_func_enter_;
|
||||
|
||||
|
@ -1869,13 +1663,6 @@ _func_enter_;
|
|||
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));
|
||||
|
@ -1914,9 +1701,6 @@ sint validate_recv_frame(_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_WAPI_SUPPORT
|
||||
PRT_WAPI_T pWapiInfo = &adapter->wapiInfo;
|
||||
struct recv_frame_hdr *phdr = &precv_frame->u.hdr;
|
||||
|
@ -1936,12 +1720,6 @@ _func_enter_;
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if (ptdlsinfo->ch_sensing==1 && ptdlsinfo->cur_channel !=0){
|
||||
ptdlsinfo->collect_pkt_num[ptdlsinfo->cur_channel-1]++;
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
/* add version chk */
|
||||
if (ver!=0){
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_data_frame fail! (ver!=0)\n"));
|
||||
|
@ -3021,22 +2799,12 @@ int process_recv_indicatepkts(_adapter *padapter, union recv_frame *prframe)
|
|||
/* 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 */
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
|
||||
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]; */
|
||||
|
||||
|
@ -3142,13 +2910,6 @@ static int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe)
|
|||
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);
|
||||
|
||||
|
@ -3162,19 +2923,6 @@ static int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe)
|
|||
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"));
|
||||
|
@ -3194,13 +2942,7 @@ static int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe)
|
|||
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 */
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
rtw_wapi_update_info(padapter, prframe);
|
||||
|
|
|
@ -1552,18 +1552,6 @@ _func_enter_;
|
|||
{
|
||||
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_88E("[%s] for tdls link\n", __func__);
|
||||
prwskey=&ptdls_sta->tpk.tk[0];
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
for (curfragnum=0;curfragnum<pattrib->nr_frags;curfragnum++){
|
||||
|
||||
if ((curfragnum+1)==pattrib->nr_frags){ /* 4 the last fragment */
|
||||
|
@ -2640,176 +2628,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(_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) {
|
||||
_rtw_memcpy(data, myid(&(padapter->eeprompriv)), ETH_ALEN);
|
||||
_rtw_memcpy(data + ETH_ALEN, psta->hwaddr, ETH_ALEN);
|
||||
} else {
|
||||
_rtw_memcpy(data, psta->hwaddr, ETH_ALEN);
|
||||
_rtw_memcpy(data + ETH_ALEN, myid(&(padapter->eeprompriv)), ETH_ALEN);
|
||||
}
|
||||
_rtw_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_88E("TDLS: No memory for MIC calculation\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
pos = buf;
|
||||
_lnkid = (struct wpa_tdls_lnkid *) lnkid;
|
||||
/* 1) TDLS initiator STA MAC address */
|
||||
_rtw_memcpy(pos, _lnkid->init_sta, ETH_ALEN);
|
||||
pos += ETH_ALEN;
|
||||
/* 2) TDLS responder STA MAC address */
|
||||
_rtw_memcpy(pos, _lnkid->resp_sta, ETH_ALEN);
|
||||
pos += ETH_ALEN;
|
||||
/* 3) Transaction Sequence number */
|
||||
*pos++ = trans_seq;
|
||||
/* 4) Link Identifier IE */
|
||||
_rtw_memcpy(pos, lnkid, 2 + lnkid[1]);
|
||||
pos += 2 + lnkid[1];
|
||||
/* 5) RSN IE */
|
||||
_rtw_memcpy(pos, rsnie, 2 + rsnie[1]);
|
||||
pos += 2 + rsnie[1];
|
||||
/* 6) Timeout Interval IE */
|
||||
_rtw_memcpy(pos, timeoutie, 2 + timeoutie[1]);
|
||||
pos += 2 + timeoutie[1];
|
||||
/* 7) FTIE, with the MIC field of the FTIE set to 0 */
|
||||
_rtw_memcpy(pos, ftie, 2 + ftie[1]);
|
||||
_ftie = (struct wpa_tdls_ftie *) pos;
|
||||
_rtw_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 */
|
||||
_rtw_memcpy(pos, lnkid + ETH_ALEN + 2, ETH_ALEN);
|
||||
pos += ETH_ALEN;
|
||||
/* 2) TDLS responder STA MAC address */
|
||||
_rtw_memcpy(pos, lnkid + 2 * ETH_ALEN + 2, ETH_ALEN);
|
||||
pos += ETH_ALEN;
|
||||
/* 3) Transaction Sequence number */
|
||||
*pos++ = trans_seq;
|
||||
/* 4) Link Identifier IE */
|
||||
_rtw_memcpy(pos, lnkid, 2 + 18);
|
||||
pos += 2 + 18;
|
||||
/* 5) RSN IE */
|
||||
_rtw_memcpy(pos, rsnie, 2 + *(rsnie+1));
|
||||
pos += 2 + *(rsnie+1);
|
||||
/* 6) Timeout Interval IE */
|
||||
_rtw_memcpy(pos, timeoutie, 2 + *(timeoutie+1));
|
||||
pos += 2 + *(timeoutie+1);
|
||||
/* 7) FTIE, with the MIC field of the FTIE set to 0 */
|
||||
_rtw_memcpy(pos, ftie, 2 + *(ftie+1));
|
||||
pos += 2;
|
||||
tmp_ftie = (u8 *) (pos+2);
|
||||
_rtw_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_88E( "[%s] Invalid MIC\n", __func__);
|
||||
return 0;
|
||||
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
void rtw_use_tkipkey_handler(void *FunctionContext)
|
||||
{
|
||||
_adapter *padapter = (_adapter *)FunctionContext;
|
||||
|
|
|
@ -362,16 +362,6 @@ _func_enter_;
|
|||
|
||||
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++)
|
||||
{
|
||||
|
@ -492,15 +482,6 @@ _func_enter_;
|
|||
|
||||
_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++)
|
||||
{
|
||||
|
|
2939
core/rtw_tdls.c
2939
core/rtw_tdls.c
File diff suppressed because it is too large
Load diff
|
@ -1295,24 +1295,6 @@ void VCS_update(_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(ADAPTER *Adapter, u8 *pframe, u32 packet_len)
|
||||
{
|
||||
unsigned int len;
|
||||
|
@ -1528,11 +1510,6 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta
|
|||
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;)
|
||||
|
@ -1550,13 +1527,6 @@ void update_beacon_info(_adapter *padapter, u8 *pframe, uint pkt_len, struct sta
|
|||
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;
|
||||
}
|
||||
|
|
478
core/rtw_xmit.c
478
core/rtw_xmit.c
|
@ -1020,12 +1020,6 @@ s32 rtw_make_wlanhdr (_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib)
|
|||
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;
|
||||
u16 *fctrl = &pwlanhdr->frame_ctl;
|
||||
|
@ -1053,32 +1047,11 @@ _func_enter_;
|
|||
if (pattrib->subtype & WIFI_DATA_TYPE) {
|
||||
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 */
|
||||
_rtw_memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
|
||||
_rtw_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);
|
||||
_rtw_memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN);
|
||||
}
|
||||
}else
|
||||
#endif /* CONFIG_TDLS */
|
||||
{
|
||||
/* Data transfer to AP */
|
||||
SetToDs(fctrl);
|
||||
_rtw_memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN);
|
||||
}
|
||||
/* Data transfer to AP */
|
||||
SetToDs(fctrl);
|
||||
_rtw_memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN);
|
||||
|
||||
if (pqospriv->qos_option)
|
||||
qos_option = true;
|
||||
|
@ -1132,14 +1105,6 @@ _func_enter_;
|
|||
/* 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;
|
||||
|
||||
|
@ -1183,40 +1148,9 @@ _func_enter_;
|
|||
|
||||
}
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
#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;
|
||||
#ifdef CONFIG_80211N_HT
|
||||
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;
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
pattrib->mac_id = ptdls_sta->mac_id;
|
||||
|
||||
psta = psta_backup;
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
_func_exit_;
|
||||
|
@ -1267,269 +1201,6 @@ s32 rtw_txframes_sta_ac_pending(_adapter *padapter, struct pkt_attrib *pattrib)
|
|||
return ptxservq->qcnt;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
|
||||
int rtw_build_tdls_ies(_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_WFD
|
||||
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_WFD */
|
||||
default:
|
||||
res=_FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
s32 rtw_make_tdls_wlanhdr (_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;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_rtw_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);
|
||||
_rtw_memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
|
||||
_rtw_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:
|
||||
_rtw_memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
|
||||
_rtw_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);
|
||||
_rtw_memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
_rtw_memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
|
||||
_rtw_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:
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
s32 rtw_xmit_tdls_coalesce(_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;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
_rtw_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;
|
||||
_rtw_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:
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return res;
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
/*
|
||||
* Calculate wlan 802.11 packet MAX size from pkt_attrib
|
||||
* This function doesn't consider fragment case
|
||||
|
@ -2832,82 +2503,7 @@ s32 rtw_xmit(_adapter *padapter, _pkt **ppkt)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
sint xmitframe_enqueue_for_tdls_sleeping_sta(_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(_adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
{
|
||||
|
@ -2918,27 +2514,14 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p
|
|||
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;
|
||||
|
||||
if (pattrib->psta)
|
||||
{
|
||||
psta = pattrib->psta;
|
||||
}
|
||||
else
|
||||
{
|
||||
psta=rtw_get_stainfo(pstapriv, pattrib->ra);
|
||||
}
|
||||
|
||||
if (psta==NULL)
|
||||
return ret;
|
||||
|
@ -3103,13 +2686,8 @@ void stop_sta_xmit(_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));
|
||||
|
||||
|
@ -3125,27 +2703,12 @@ void stop_sta_xmit(_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(_adapter *padapter, struct sta_info *psta)
|
||||
|
@ -3225,21 +2788,8 @@ void wakeup_sta_to_xmit(_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;
|
||||
|
||||
_exit_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
return;
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
pstapriv->tim_bitmap &= ~BIT(psta->aid);
|
||||
|
||||
/* DBG_88E("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); */
|
||||
/* upate BCN for TIM IE */
|
||||
/* update_BCNTIM(padapter); */
|
||||
update_mask = BIT(0);
|
||||
|
||||
if (psta->state&WIFI_SLEEP_STATE)
|
||||
|
@ -3382,32 +2932,18 @@ void xmit_delivery_enabled_frames(_adapter *padapter, struct sta_info *psta)
|
|||
pxmitframe->attrib.triggered = 1;
|
||||
|
||||
if (rtw_hal_xmit(padapter, pxmitframe) == true)
|
||||
{
|
||||
rtw_os_xmit_complete(padapter, pxmitframe);
|
||||
}
|
||||
|
||||
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);
|
||||
return;
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
if ((psta->sleepq_ac_len==0) && (!psta->has_legacy_ac) && (wmmps_ac)) {
|
||||
pstapriv->tim_bitmap &= ~BIT(psta->aid);
|
||||
|
||||
/* DBG_88E("wakeup to xmit, qlen==0, update_BCNTIM, tim=%x\n", pstapriv->tim_bitmap); */
|
||||
/* upate BCN for TIM IE */
|
||||
/* update_BCNTIM(padapter); */
|
||||
update_beacon(padapter, _TIM_IE_, NULL, false);
|
||||
/* update_mask = BIT(0); */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
_exit_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue