rtl8188eu: CONFIG_TDLS

This variable is not defined.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2015-03-04 15:31:57 -06:00
parent c372b989e3
commit 1bb0401638
22 changed files with 12 additions and 4974 deletions

View file

@ -128,7 +128,6 @@ rtk_core := core/rtw_cmd.o \
core/rtw_ap.o \
core/rtw_xmit.o \
core/rtw_p2p.o \
core/rtw_tdls.o \
core/rtw_br_ext.o \
core/rtw_iol.o \
core/rtw_led.o \

View file

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

View file

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

View file

@ -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 */
}

View file

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

View file

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

View file

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

View file

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

View file

@ -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++)
{

File diff suppressed because it is too large Load diff

View file

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

View file

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

View file

@ -2788,30 +2788,6 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8* val)
}
break;
#endif /* CONFIG_P2P */
#ifdef CONFIG_TDLS
case HW_VAR_TDLS_WRCR:
rtw_write32(Adapter, REG_RCR, rtw_read32(Adapter, REG_RCR)&(~RCR_CBSSID_DATA ));
break;
case HW_VAR_TDLS_INIT_CH_SEN:
{
rtw_write32(Adapter, REG_RCR, rtw_read32(Adapter, REG_RCR)&(~ RCR_CBSSID_DATA )&(~RCR_CBSSID_BCN ));
rtw_write16(Adapter, REG_RXFLTMAP2,0xffff);
/* disable update TSF */
rtw_write8(Adapter, REG_BCN_CTRL, rtw_read8(Adapter, REG_BCN_CTRL)|BIT(4));
}
break;
case HW_VAR_TDLS_DONE_CH_SEN:
{
/* enable update TSF */
rtw_write8(Adapter, REG_BCN_CTRL, rtw_read8(Adapter, REG_BCN_CTRL)&(~ BIT(4)));
rtw_write32(Adapter, REG_RCR, rtw_read32(Adapter, REG_RCR)|(RCR_CBSSID_BCN ));
}
break;
case HW_VAR_TDLS_RS_RCR:
rtw_write32(Adapter, REG_RCR, rtw_read32(Adapter, REG_RCR)|(RCR_CBSSID_DATA));
break;
#endif /* CONFIG_TDLS */
case HW_VAR_INITIAL_GAIN:
{
DIG_T *pDigTable = &podmpriv->DM_DigTable;

View file

@ -374,9 +374,6 @@ struct adapter {
struct wifidirect_info wdinfo;
#endif //CONFIG_P2P
#ifdef CONFIG_TDLS
struct tdls_info tdlsinfo;
#endif //CONFIG_TDLS
#ifdef CONFIG_P2P
struct wifi_display_info wfd_info;
#endif //CONFIG_P2P

View file

@ -1045,26 +1045,6 @@ enum _PUBLIC_ACTION{
ACT_PUBLIC_MAX
};
#ifdef CONFIG_TDLS
enum TDLS_ACTION_FIELD{
TDLS_SETUP_REQUEST = 0,
TDLS_SETUP_RESPONSE = 1,
TDLS_SETUP_CONFIRM = 2,
TDLS_TEARDOWN = 3,
TDLS_PEER_TRAFFIC_INDICATION = 4,
TDLS_CHANNEL_SWITCH_REQUEST = 5,
TDLS_CHANNEL_SWITCH_RESPONSE = 6,
TDLS_PEER_PSM_REQUEST = 7,
TDLS_PEER_PSM_RESPONSE = 8,
TDLS_PEER_TRAFFIC_RESPONSE = 9,
TDLS_DISCOVERY_REQUEST = 10,
TDLS_DISCOVERY_RESPONSE = 14, //it's used in public action frame
};
#define TUNNELED_PROBE_REQ 15
#define TUNNELED_PROBE_RSP 16
#endif //CONFIG_TDLS
/* BACK action code */
enum rtw_ieee80211_back_actioncode {
RTW_WLAN_ACTION_ADDBA_REQ = 0,

View file

@ -320,40 +320,6 @@ struct ss_res
#define WIFI_FW_LINKING_STATE (WIFI_FW_AUTH_NULL | WIFI_FW_AUTH_STATE | WIFI_FW_AUTH_SUCCESS |WIFI_FW_ASSOC_STATE)
#ifdef CONFIG_TDLS
// 1: Write RCR DATA BIT
// 2: Issue peer traffic indication
// 3: Go back to the channel linked with AP, terminating channel switch procedure
// 4: Init channel sensing, receive all data and mgnt frame
// 5: Channel sensing and report candidate channel
// 6: First time set channel to off channel
// 7: Go back tp the channel linked with AP when set base channel as target channel
// 8: Set channel back to base channel
// 9: Set channel back to off channel
// 10: Restore RCR DATA BIT
// 11: Check alive
// 12: Check alive
// 13: Free TDLS sta
enum TDLS_option
{
TDLS_WRCR = 1,
TDLS_SD_PTI = 2,
TDLS_CS_OFF = 3,
TDLS_INIT_CH_SEN = 4,
TDLS_DONE_CH_SEN = 5,
TDLS_OFF_CH = 6,
TDLS_BASE_CH = 7,
TDLS_P_OFF_CH = 8,
TDLS_P_BASE_CH = 9,
TDLS_RS_RCR = 10,
TDLS_CKALV_PH1 = 11,
TDLS_CKALV_PH2 = 12,
TDLS_FREE_STA = 13,
maxTDLS,
};
#endif //CONFIG_TDLS
struct FW_Sta_Info
{
struct sta_info *psta;

View file

@ -431,15 +431,6 @@ void rtw_wep_decrypt(struct adapter *padapter, u8 *precvframe);
#ifdef CONFIG_IEEE80211W
u32 rtw_BIP_verify(struct adapter *padapter, u8 *precvframe);
#endif //CONFIG_IEEE80211W
#ifdef CONFIG_TDLS
void wpa_tdls_generate_tpk(struct adapter *padapter, struct sta_info *psta);
int wpa_tdls_ftie_mic(u8 *kck, u8 trans_seq,
u8 *lnkid, u8 *rsnie, u8 *timeoutie, u8 *ftie,
u8 *mic);
int tdls_verify_mic(u8 *kck, u8 trans_seq,
u8 *lnkid, u8 *rsnie, u8 *timeoutie, u8 *ftie);
#endif //CONFIG_TDLS
void rtw_use_tkipkey_handler(void* FunctionContext);
void rtw_sec_restore_wep_key(struct adapter *adapter);

View file

@ -22,121 +22,5 @@
#include <drv_types.h>
#ifdef CONFIG_TDLS
/* TDLS STA state */
#define TDLS_STATE_NONE 0x00000000 //default state
#define TDLS_INITIATOR_STATE 0x10000000
#define TDLS_RESPONDER_STATE 0x20000000
#define TDLS_LINKED_STATE 0x40000000
#define TDLS_CH_SWITCH_ON_STATE 0x01000000
#define TDLS_PEER_AT_OFF_STATE 0x02000000 //could send pkt on target ch
#define TDLS_AT_OFF_CH_STATE 0x04000000
#define TDLS_CH_SW_INITIATOR_STATE 0x08000000 //avoiding duplicated or unconditional ch. switch rsp.
#define TDLS_APSD_CHSW_STATE 0x00100000 //in APSD and want to setup channel switch
#define TDLS_PEER_SLEEP_STATE 0x00200000 //peer sta is sleeping
#define TDLS_SW_OFF_STATE 0x00400000 //terminate channel swithcing
#define TDLS_ALIVE_STATE 0x00010000 //Check if peer sta is alived.
#define TPK_RESEND_COUNT 301
#define CH_SWITCH_TIME 10
#define CH_SWITCH_TIMEOUT 30
#define TDLS_STAY_TIME 500
#define TDLS_SIGNAL_THRESH 0x20
#define TDLS_WATCHDOG_PERIOD 10 //Periodically sending tdls discovery request in TDLS_WATCHDOG_PERIOD * 2 sec
#define TDLS_ALIVE_TIMER_PH1 5000
#define TDLS_ALIVE_TIMER_PH2 2000
#define TDLS_STAY_TIME 500
#define TDLS_HANDSHAKE_TIME 8000
#define TDLS_ALIVE_COUNT 3
#define TDLS_INI_MACID_ENTRY 6
/* TDLS */
#define TDLS_MIC_LEN 16
#define WPA_NONCE_LEN 32
#define TDLS_TIMEOUT_LEN 4
struct wpa_tdls_ftie {
u8 ie_type; /* FTIE */
u8 ie_len;
u8 mic_ctrl[2];
u8 mic[TDLS_MIC_LEN];
u8 Anonce[WPA_NONCE_LEN]; /* Responder Nonce in TDLS */
u8 Snonce[WPA_NONCE_LEN]; /* Initiator Nonce in TDLS */
/* followed by optional elements */
} ;
struct wpa_tdls_lnkid {
u8 ie_type; /* Link Identifier IE */
u8 ie_len;
u8 bssid[ETH_ALEN];
u8 init_sta[ETH_ALEN];
u8 resp_sta[ETH_ALEN];
} ;
static u8 TDLS_RSNIE[]={ 0x01, 0x00, //version shall be set to 1
0x00, 0x0f, 0xac, 0x07, //group sipher suite
0x01, 0x00, //pairwise cipher suite count
0x00, 0x0f, 0xac, 0x04, //pairwise cipher suite list; CCMP only
0x01, 0x00, //AKM suite count
0x00, 0x0f, 0xac, 0x07, //TPK Handshake
0x00, 0x02,
//PMKID shall not be present
};
static u8 TDLS_WMMIE[]={0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00}; //Qos info all set zero
static u8 TDLS_EXT_CAPIE[] = {0x00, 0x00, 0x00, 0x50, 0x20}; //bit(28), bit(30), bit(37)
// SRC: Supported Regulatory Classes
static u8 TDLS_SRC[] = { 0x01, 0x01, 0x02, 0x03, 0x04, 0x0c, 0x16, 0x17, 0x18, 0x19, 0x1b, 0x1c, 0x1d, 0x1e, 0x20, 0x21 };
void rtw_reset_tdls_info(struct adapter* padapter);
int rtw_init_tdls_info(struct adapter* padapter);
void rtw_free_tdls_info(struct tdls_info *ptdlsinfo);
void issue_nulldata_to_TDLS_peer_STA(struct adapter *padapter, struct sta_info *ptdls_sta, unsigned int power_mode);
void init_TPK_timer(struct adapter *padapter, struct sta_info *psta);
void init_ch_switch_timer(struct adapter *padapter, struct sta_info *psta);
void init_base_ch_timer(struct adapter *padapter, struct sta_info *psta);
void init_off_ch_timer(struct adapter *padapter, struct sta_info *psta);
void init_tdls_alive_timer(struct adapter *padapter, struct sta_info *psta);
void init_handshake_timer(struct adapter *padapter, struct sta_info *psta);
void free_tdls_sta(struct adapter *padapter, struct sta_info *ptdls_sta);
#ifdef CONFIG_P2P
void issue_tunneled_probe_req(struct adapter *padapter);
void issue_tunneled_probe_rsp(struct adapter *padapter, union recv_frame *precv_frame);
#endif //CONFIG_P2P
void issue_tdls_dis_req(struct adapter *padapter, u8 *mac_addr);
void issue_tdls_setup_req(struct adapter *padapter, u8 *mac_addr);
void issue_tdls_setup_rsp(struct adapter *padapter, union recv_frame *precv_frame);
void issue_tdls_setup_cfm(struct adapter *padapter, union recv_frame *precv_frame);
void issue_tdls_dis_rsp(struct adapter * padapter, union recv_frame * precv_frame, u8 dialog);
void issue_tdls_teardown(struct adapter *padapter, u8 *mac_addr);
void issue_tdls_peer_traffic_indication(struct adapter *padapter, struct sta_info *psta);
void issue_tdls_ch_switch_req(struct adapter *padapter, u8 *mac_addr);
void issue_tdls_ch_switch_rsp(struct adapter *padapter, u8 *mac_addr);
sint On_TDLS_Dis_Rsp(struct adapter *adapter, union recv_frame *precv_frame);
sint On_TDLS_Setup_Req(struct adapter *adapter, union recv_frame *precv_frame);
sint On_TDLS_Setup_Rsp(struct adapter *adapter, union recv_frame *precv_frame);
sint On_TDLS_Setup_Cfm(struct adapter *adapter, union recv_frame *precv_frame);
sint On_TDLS_Dis_Req(struct adapter *adapter, union recv_frame *precv_frame);
sint On_TDLS_Teardown(struct adapter *adapter, union recv_frame *precv_frame);
sint On_TDLS_Peer_Traffic_Rsp(struct adapter *adapter, union recv_frame *precv_frame);
sint On_TDLS_Ch_Switch_Req(struct adapter *adapter, union recv_frame *precv_frame);
sint On_TDLS_Ch_Switch_Rsp(struct adapter *adapter, union recv_frame *precv_frame);
void rtw_build_tdls_setup_req_ies(struct adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe);
void rtw_build_tdls_setup_rsp_ies(struct adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe);
void rtw_build_tdls_setup_cfm_ies(struct adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe);
void rtw_build_tdls_teardown_ies(struct adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe);
void rtw_build_tdls_dis_req_ies(struct adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe);
void rtw_build_tdls_dis_rsp_ies(struct adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe, u8 dialog);
void rtw_build_tdls_peer_traffic_indication_ies(struct adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe);
void rtw_build_tdls_ch_switch_req_ies(struct adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe);
void rtw_build_tdls_ch_switch_rsp_ies(struct adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe);
void rtw_build_tunneled_probe_req_ies(struct adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe);
void rtw_build_tunneled_probe_rsp_ies(struct adapter * padapter, struct xmit_frame * pxmitframe, u8 *pframe);
int update_sgi_tdls(struct adapter *padapter, struct sta_info *psta);
u32 update_mask_tdls(struct adapter *padapter, struct sta_info *psta);
#endif //CONFIG_TDLS
#endif

View file

@ -439,9 +439,6 @@ extern s32 rtw_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xm
#ifdef CONFIG_IEEE80211W
extern s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit_frame *pxmitframe);
#endif //CONFIG_IEEE80211W
#ifdef CONFIG_TDLS
s32 rtw_xmit_tdls_coalesce(struct adapter *padapter, struct xmit_frame *pxmitframe, u8 action);
#endif
s32 _rtw_init_hw_txqueue(struct hw_txqueue* phw_txqueue, u8 ac_tag);
void _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv);
@ -461,7 +458,7 @@ void rtw_free_hwxmits(struct adapter *padapter);
s32 rtw_xmit(struct adapter *padapter, _pkt **pkt);
#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);
void stop_sta_xmit(struct adapter *padapter, struct sta_info *psta);
void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta);

View file

@ -85,13 +85,6 @@ struct stainfo_stats {
};
#ifdef CONFIG_TDLS
struct TDLS_PeerKey {
u8 kck[16]; /* TPK-KCK */
u8 tk[16]; /* TPK-TK; only CCMP will be used */
} ;
#endif //CONFIG_TDLS
struct sta_info {
_lock lock;
@ -140,31 +133,6 @@ struct sta_info {
u8 wireless_mode; // NETWORK_TYPE
struct stainfo_stats sta_stats;
#ifdef CONFIG_TDLS
u32 tdls_sta_state;
u8 dialog;
u8 SNonce[32];
u8 ANonce[32];
u32 TDLS_PeerKey_Lifetime;
u16 TPK_count;
_timer TPK_timer;
struct TDLS_PeerKey tpk;
u16 stat_code;
u8 off_ch;
u16 ch_switch_time;
u16 ch_switch_timeout;
u8 option;
_timer option_timer;
_timer base_ch_timer;
_timer off_ch_timer;
_timer handshake_timer;
_timer alive_timer1;
_timer alive_timer2;
u8 timer_flag;
u8 alive_count;
#endif //CONFIG_TDLS
//for A-MPDU TX, ADDBA timeout check
_timer addba_retry_timer;

View file

@ -8817,25 +8817,6 @@ static int rtw_wfd_tdls_enable(struct net_device *dev,
{
int ret = 0;
#ifdef CONFIG_TDLS
#ifdef CONFIG_P2P
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
printk( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 );
if ( extra[ 0 ] == '0' )
{
padapter->wdinfo.wfd_tdls_enable = 0;
}
else
{
padapter->wdinfo.wfd_tdls_enable = 1;
}
#endif /* CONFIG_P2P */
#endif /* CONFIG_TDLS */
return ret;
}
@ -8845,23 +8826,6 @@ static int rtw_tdls_weaksec(struct net_device *dev,
{
int ret = 0;
#ifdef CONFIG_TDLS
u8 i, j;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
DBG_871X( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 );
if ( extra[ 0 ] == '0' )
{
padapter->wdinfo.wfd_tdls_weaksec = 0;
}
else
{
padapter->wdinfo.wfd_tdls_weaksec = 1;
}
#endif
return ret;
}
@ -8872,66 +8836,6 @@ static int rtw_tdls_enable(struct net_device *dev,
{
int ret = 0;
#ifdef CONFIG_TDLS
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
_irqL irqL;
_list *plist, *phead;
s32 index;
struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv;
u8 tdls_sta[NUM_STA][ETH_ALEN];
u8 empty_hwaddr[ETH_ALEN] = { 0x00 };
printk( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 );
memset(tdls_sta, 0x00, sizeof(tdls_sta));
if ( extra[ 0 ] == '0' )
{
ptdlsinfo->enable = 0;
if(pstapriv->asoc_sta_count==1)
return ret;
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
for(index=0; index< NUM_STA; index++)
{
phead = &(pstapriv->sta_hash[index]);
plist = get_next(phead);
while ((rtw_end_of_queue_search(phead, plist)) == false)
{
psta = LIST_CONTAINOR(plist, struct sta_info ,hash_list);
plist = get_next(plist);
if(psta->tdls_sta_state != TDLS_STATE_NONE)
{
memcpy(tdls_sta[index], psta->hwaddr, ETH_ALEN);
}
}
}
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
for(index=0; index< NUM_STA; index++)
{
if( !_rtw_memcmp(tdls_sta[index], empty_hwaddr, ETH_ALEN) )
{
printk("issue tear down to "MAC_FMT"\n", MAC_ARG(tdls_sta[index]));
issue_tdls_teardown(padapter, tdls_sta[index]);
}
}
rtw_tdls_cmd(padapter, myid(&(padapter->eeprompriv)), TDLS_RS_RCR);
rtw_reset_tdls_info(padapter);
}
else if ( extra[ 0 ] == '1' )
{
ptdlsinfo->enable = 1;
}
#endif /* CONFIG_TDLS */
return ret;
}
@ -8941,43 +8845,6 @@ static int rtw_tdls_setup(struct net_device *dev,
{
int ret = 0;
#ifdef CONFIG_TDLS
u8 i, j;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
u8 mac_addr[ETH_ALEN];
#ifdef CONFIG_P2P
struct wifidirect_info *pwdinfo= &(padapter->wdinfo);
#endif /* CONFIG_P2P */
printk( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 );
for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){
mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1));
}
#ifdef CONFIG_P2P
if ( _AES_ != padapter->securitypriv.dot11PrivacyAlgrthm )
{
/* Weak Security situation with AP. */
if ( 0 == pwdinfo->wfd_tdls_weaksec )
{
/* Can't send the tdls setup request out!! */
DBG_871X( "[%s] Current link is not AES, SKIP sending the tdls setup request!!\n", __FUNCTION__ );
}
else
{
issue_tdls_setup_req(padapter, mac_addr);
}
}
else
#endif /* CONFIG_P2P */
{
issue_tdls_setup_req(padapter, mac_addr);
}
#endif
return ret;
}
@ -8987,29 +8854,6 @@ static int rtw_tdls_teardown(struct net_device *dev,
{
int ret = 0;
#ifdef CONFIG_TDLS
u8 i,j;
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct sta_info *ptdls_sta = NULL;
u8 mac_addr[ETH_ALEN];
DBG_871X( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 );
for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){
mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1));
}
ptdls_sta = rtw_get_stainfo( &(padapter->stapriv), mac_addr);
if(ptdls_sta != NULL)
{
ptdls_sta->stat_code = _RSON_TDLS_TEAR_UN_RSN_;
issue_tdls_teardown(padapter, mac_addr);
}
#endif /* CONFIG_TDLS */
return ret;
}
@ -9019,18 +8863,6 @@ static int rtw_tdls_discovery(struct net_device *dev,
{
int ret = 0;
#ifdef CONFIG_TDLS
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
DBG_871X( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 );
issue_tdls_dis_req(padapter, NULL);
#endif /* CONFIG_TDLS */
return ret;
}
@ -9040,28 +8872,6 @@ static int rtw_tdls_ch_switch(struct net_device *dev,
{
int ret = 0;
#ifdef CONFIG_TDLS
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
u8 i, j, mac_addr[ETH_ALEN];
struct sta_info *ptdls_sta = NULL;
DBG_8192C( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 );
for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){
mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1));
}
ptdls_sta = rtw_get_stainfo(&padapter->stapriv, mac_addr);
if( ptdls_sta == NULL )
return ret;
ptdlsinfo->ch_sensing=1;
rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_INIT_CH_SEN);
#endif /* CONFIG_TDLS */
return ret;
}
@ -9071,26 +8881,6 @@ static int rtw_tdls_pson(struct net_device *dev,
{
int ret = 0;
#ifdef CONFIG_TDLS
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
u8 i, j, mac_addr[ETH_ALEN];
struct sta_info *ptdls_sta = NULL;
DBG_871X( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 );
for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){
mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1));
}
ptdls_sta = rtw_get_stainfo(&padapter->stapriv, mac_addr);
issue_nulldata_to_TDLS_peer_STA(padapter, ptdls_sta, 1);
#endif /* CONFIG_TDLS */
return ret;
}
@ -9100,26 +8890,6 @@ static int rtw_tdls_psoff(struct net_device *dev,
{
int ret = 0;
#ifdef CONFIG_TDLS
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
u8 i, j, mac_addr[ETH_ALEN];
struct sta_info *ptdls_sta = NULL;
DBG_8192C( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 );
for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){
mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1));
}
ptdls_sta = rtw_get_stainfo(&padapter->stapriv, mac_addr);
issue_nulldata_to_TDLS_peer_STA(padapter, ptdls_sta, 0);
#endif /* CONFIG_TDLS */
return ret;
}
@ -9129,45 +8899,6 @@ static int rtw_tdls_setip(struct net_device *dev,
{
int ret = 0;
#ifdef CONFIG_TDLS
#ifdef CONFIG_P2P
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
struct wifi_display_info *pwfd_info = ptdlsinfo->wfd_info;
u8 i=0, j=0, k=0, tag=0, ip[3] = { 0xff }, *ptr = extra;
printk( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length - 1 );
while( i < 4 )
{
for( j=0; j < 4; j++)
{
if( *( extra + j + tag ) == '.' || *( extra + j + tag ) == '\0' )
{
if( j == 1 )
pwfd_info->ip_address[i]=convert_ip_addr( '0', '0', *(extra+(j-1)+tag));
if( j == 2 )
pwfd_info->ip_address[i]=convert_ip_addr( '0', *(extra+(j-2)+tag), *(extra+(j-1)+tag));
if( j == 3 )
pwfd_info->ip_address[i]=convert_ip_addr( *(extra+(j-3)+tag), *(extra+(j-2)+tag), *(extra+(j-1)+tag));
tag += j + 1;
break;
}
}
i++;
}
printk( "[%s] Set IP = %u.%u.%u.%u \n", __FUNCTION__,
ptdlsinfo->wfd_info->ip_address[0], ptdlsinfo->wfd_info->ip_address[1],
ptdlsinfo->wfd_info->ip_address[2], ptdlsinfo->wfd_info->ip_address[3]
);
#endif /* CONFIG_P2P */
#endif /* CONFIG_TDLS */
return ret;
}
@ -9177,30 +8908,6 @@ static int rtw_tdls_getip(struct net_device *dev,
{
int ret = 0;
#ifdef CONFIG_TDLS
#ifdef CONFIG_P2P
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
struct wifi_display_info *pwfd_info = ptdlsinfo->wfd_info;
printk( "[%s]\n", __FUNCTION__);
sprintf( extra, "\n\n%u.%u.%u.%u\n",
pwfd_info->peer_ip_address[0], pwfd_info->peer_ip_address[1],
pwfd_info->peer_ip_address[2], pwfd_info->peer_ip_address[3]
);
printk( "[%s] IP=%u.%u.%u.%u\n", __FUNCTION__,
pwfd_info->peer_ip_address[0], pwfd_info->peer_ip_address[1],
pwfd_info->peer_ip_address[2], pwfd_info->peer_ip_address[3]
);
wrqu->data.length = strlen( extra );
#endif /* CONFIG_P2P */
#endif /* CONFIG_TDLS */
return ret;
}
@ -9211,23 +8918,6 @@ static int rtw_tdls_getport(struct net_device *dev,
int ret = 0;
#ifdef CONFIG_TDLS
#ifdef CONFIG_P2P
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
struct wifi_display_info *pwfd_info = ptdlsinfo->wfd_info;
printk( "[%s]\n", __FUNCTION__);
sprintf( extra, "\n\n%d\n", pwfd_info->peer_rtsp_ctrlport );
printk( "[%s] remote port = %d\n", __FUNCTION__, pwfd_info->peer_rtsp_ctrlport );
wrqu->data.length = strlen( extra );
#endif /* CONFIG_P2P */
#endif /* CONFIG_TDLS */
return ret;
}
@ -9240,26 +8930,6 @@ static int rtw_tdls_dis_result(struct net_device *dev,
int ret = 0;
#ifdef CONFIG_TDLS
#ifdef CONFIG_P2P
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
struct wifi_display_info *pwfd_info = ptdlsinfo->wfd_info;
printk( "[%s]\n", __FUNCTION__);
if(ptdlsinfo->dev_discovered == 1 )
{
sprintf( extra, "\n\nDis=1\n" );
ptdlsinfo->dev_discovered = 0;
}
wrqu->data.length = strlen( extra );
#endif /* CONFIG_P2P */
#endif /* CONFIG_TDLS */
return ret;
}
@ -9272,31 +8942,7 @@ static int rtw_wfd_tdls_status(struct net_device *dev,
int ret = 0;
#ifdef CONFIG_TDLS
#ifdef CONFIG_P2P
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
struct wifi_display_info *pwfd_info = ptdlsinfo->wfd_info;
printk( "[%s]\n", __FUNCTION__);
if(ptdlsinfo->setup_state == TDLS_LINKED_STATE )
{
sprintf( extra, "\n\nStatus=1\n" );
}
else
{
sprintf( extra, "\n\nStatus=0\n" );
}
wrqu->data.length = strlen( extra );
#endif /* CONFIG_P2P */
#endif /* CONFIG_TDLS */
return ret;
}
static int rtw_tdls_ch_switch_off(struct net_device *dev,
@ -9305,31 +8951,6 @@ static int rtw_tdls_ch_switch_off(struct net_device *dev,
{
int ret = 0;
#ifdef CONFIG_TDLS
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
u8 i, j, mac_addr[ETH_ALEN];
struct sta_info *ptdls_sta = NULL;
DBG_871X( "[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length -1 );
for( i=0, j=0 ; i < ETH_ALEN; i++, j+=3 ){
mac_addr[i]=key_2char2num(*(extra+j), *(extra+j+1));
}
ptdls_sta = rtw_get_stainfo(&padapter->stapriv, mac_addr);
ptdls_sta->tdls_sta_state |= TDLS_SW_OFF_STATE;
/*
if((ptdls_sta->tdls_sta_state & TDLS_AT_OFF_CH_STATE) && (ptdls_sta->tdls_sta_state & TDLS_PEER_AT_OFF_STATE)){
pmlmeinfo->tdls_candidate_ch= pmlmeext->cur_channel;
issue_tdls_ch_switch_req(padapter, mac_addr);
DBG_871X("issue tdls ch switch req back to base channel\n");
}
*/
#endif /* CONFIG_TDLS */
return ret;
}
@ -9339,85 +8960,6 @@ static int rtw_tdls(struct net_device *dev,
{
int ret = 0;
#ifdef CONFIG_TDLS
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
DBG_871X( "[%s] extra = %s\n", __FUNCTION__, extra );
/* WFD Sigma will use the tdls enable command to let the driver know we want to test the tdls now! */
if ( _rtw_memcmp( extra, "wfdenable=", 10 ) )
{
wrqu->data.length -=10;
rtw_wfd_tdls_enable( dev, info, wrqu, &extra[10] );
return ret;
}
else if ( _rtw_memcmp( extra, "weaksec=", 8 ) )
{
wrqu->data.length -=8;
rtw_tdls_weaksec( dev, info, wrqu, &extra[8] );
return ret;
}
else if ( _rtw_memcmp( extra, "tdlsenable=", 11 ) )
{
wrqu->data.length -=11;
rtw_tdls_enable( dev, info, wrqu, &extra[11] );
return ret;
}
if( padapter->tdlsinfo.enable == 0 )
{
printk("tdls haven't enabled\n");
return 0;
}
if ( _rtw_memcmp( extra, "setup=", 6 ) )
{
wrqu->data.length -=6;
rtw_tdls_setup( dev, info, wrqu, &extra[6] );
}
else if (_rtw_memcmp( extra, "tear=", 5 ) )
{
wrqu->data.length -= 5;
rtw_tdls_teardown( dev, info, wrqu, &extra[5] );
}
else if (_rtw_memcmp( extra, "dis=", 4 ) )
{
wrqu->data.length -= 4;
rtw_tdls_discovery( dev, info, wrqu, &extra[4] );
}
else if (_rtw_memcmp( extra, "sw=", 3 ) )
{
wrqu->data.length -= 3;
rtw_tdls_ch_switch( dev, info, wrqu, &extra[3] );
}
else if (_rtw_memcmp( extra, "swoff=", 6 ) )
{
wrqu->data.length -= 6;
rtw_tdls_ch_switch_off( dev, info, wrqu, &extra[6] );
}
else if (_rtw_memcmp( extra, "pson=", 5 ) )
{
wrqu->data.length -= 5;
rtw_tdls_pson( dev, info, wrqu, &extra[5] );
}
else if (_rtw_memcmp( extra, "psoff=", 6 ) )
{
wrqu->data.length -= 6;
rtw_tdls_psoff( dev, info, wrqu, &extra[6] );
}
#ifdef CONFIG_P2P
else if (_rtw_memcmp( extra, "setip=", 6 ) )
{
wrqu->data.length -= 6;
rtw_tdls_setip( dev, info, wrqu, &extra[6] );
}
else if (_rtw_memcmp( extra, "tprobe=", 6 ) )
{
issue_tunneled_probe_req((struct adapter *)rtw_netdev_priv(dev));
}
#endif /* CONFIG_P2P */
#endif /* CONFIG_TDLS */
return ret;
}

View file

@ -884,15 +884,6 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
goto exit;
}
#ifdef CONFIG_TDLS
if(rtw_init_tdls_info(padapter) == _FAIL)
{
DBG_871X("Can't rtw_init_tdls_info\n");
ret8=_FAIL;
goto exit;
}
#endif /* CONFIG_TDLS */
if(_rtw_init_xmit_priv(&padapter->xmitpriv, padapter) == _FAIL)
{
DBG_871X("Can't _rtw_init_xmit_priv\n");
@ -1018,10 +1009,6 @@ u8 rtw_free_drv_sw(struct adapter *padapter)
free_mlme_ext_priv(&padapter->mlmeextpriv);
#ifdef CONFIG_TDLS
/* rtw_free_tdls_info(&padapter->tdlsinfo); */
#endif /* CONFIG_TDLS */
rtw_free_cmd_priv(&padapter->cmdpriv);
rtw_free_evt_priv(&padapter->evtpriv);