mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-07 14:03:05 +00:00
rtl8188eu: CONFIG_TDLS
This variable is not defined. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
c372b989e3
commit
1bb0401638
22 changed files with 12 additions and 4974 deletions
280
core/rtw_recv.c
280
core/rtw_recv.c
|
@ -830,21 +830,12 @@ void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame)
|
|||
|
||||
if(!psta) return;
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if( !(psta->tdls_sta_state & TDLS_LINKED_STATE ) )
|
||||
{
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
if(!psta->qos_option)
|
||||
return;
|
||||
|
||||
if(!(psta->qos_info&0xf))
|
||||
return;
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
if(psta->state&WIFI_SLEEP_STATE)
|
||||
{
|
||||
u8 wmmps_ac=0;
|
||||
|
@ -891,100 +882,6 @@ void process_wmmps_data(struct adapter *padapter, union recv_frame *precv_frame)
|
|||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
sint OnTDLS(struct adapter *adapter, union recv_frame *precv_frame)
|
||||
{
|
||||
struct rx_pkt_attrib *pattrib = & precv_frame->u.hdr.attrib;
|
||||
sint ret = _SUCCESS;
|
||||
u8 *paction = get_recvframe_data(precv_frame);
|
||||
u8 category_field = 1;
|
||||
#ifdef CONFIG_P2P
|
||||
u8 WFA_OUI[3] = { 0x50, 0x6f, 0x9a };
|
||||
#endif /* CONFIG_P2P */
|
||||
struct tdls_info *ptdlsinfo = &(adapter->tdlsinfo);
|
||||
|
||||
/* point to action field */
|
||||
paction+=pattrib->hdrlen
|
||||
+ pattrib->iv_len
|
||||
+ SNAP_SIZE
|
||||
+ ETH_TYPE_LEN
|
||||
+ PAYLOAD_TYPE_LEN
|
||||
+ category_field;
|
||||
|
||||
if(ptdlsinfo->enable == 0)
|
||||
{
|
||||
DBG_871X("recv tdls frame, "
|
||||
"but tdls haven't enabled\n");
|
||||
ret = _FAIL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
switch(*paction){
|
||||
case TDLS_SETUP_REQUEST:
|
||||
DBG_871X("recv tdls setup request frame\n");
|
||||
ret=On_TDLS_Setup_Req(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_SETUP_RESPONSE:
|
||||
DBG_871X("recv tdls setup response frame\n");
|
||||
ret=On_TDLS_Setup_Rsp(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_SETUP_CONFIRM:
|
||||
DBG_871X("recv tdls setup confirm frame\n");
|
||||
ret=On_TDLS_Setup_Cfm(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_TEARDOWN:
|
||||
DBG_871X("recv tdls teardown, free sta_info\n");
|
||||
ret=On_TDLS_Teardown(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_DISCOVERY_REQUEST:
|
||||
DBG_871X("recv tdls discovery request frame\n");
|
||||
ret=On_TDLS_Dis_Req(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_PEER_TRAFFIC_RESPONSE:
|
||||
DBG_871X("recv tdls peer traffic response frame\n");
|
||||
ret=On_TDLS_Peer_Traffic_Rsp(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_CHANNEL_SWITCH_REQUEST:
|
||||
DBG_871X("recv tdls channel switch request frame\n");
|
||||
ret=On_TDLS_Ch_Switch_Req(adapter, precv_frame);
|
||||
break;
|
||||
case TDLS_CHANNEL_SWITCH_RESPONSE:
|
||||
DBG_871X("recv tdls channel switch response frame\n");
|
||||
ret=On_TDLS_Ch_Switch_Rsp(adapter, precv_frame);
|
||||
break;
|
||||
#ifdef CONFIG_P2P
|
||||
case 0x50: /* First byte of WFA OUI */
|
||||
if( _rtw_memcmp(WFA_OUI, (paction), 3) )
|
||||
{
|
||||
if( *(paction + 3) == 0x04) /* Probe request frame */
|
||||
{
|
||||
/* WFDTDLS: for sigma test, do not setup direct link automatically */
|
||||
ptdlsinfo->dev_discovered = 1;
|
||||
DBG_871X("recv tunneled probe request frame\n");
|
||||
issue_tunneled_probe_rsp(adapter, precv_frame);
|
||||
}
|
||||
if( *(paction + 3) == 0x05) /* Probe response frame */
|
||||
{
|
||||
/* WFDTDLS: for sigma test, do not setup direct link automatically */
|
||||
ptdlsinfo->dev_discovered = 1;
|
||||
DBG_871X("recv tunneled probe response frame\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif /* CONFIG_P2P */
|
||||
default:
|
||||
DBG_871X("receive TDLS frame but not supported\n");
|
||||
ret=_FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
exit:
|
||||
return ret;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
void count_rx_stats(struct adapter *padapter, union recv_frame *prframe, struct sta_info*sta);
|
||||
void count_rx_stats(struct adapter *padapter, union recv_frame *prframe, struct sta_info*sta)
|
||||
{
|
||||
int sz;
|
||||
|
@ -1038,16 +935,6 @@ sint sta2sta_data_frame(
|
|||
u8 * sta_addr = NULL;
|
||||
sint bmcast = IS_MCAST(pattrib->dst);
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &adapter->tdlsinfo;
|
||||
struct sta_info *ptdls_sta=NULL;
|
||||
u8 *psnap_type=ptr+pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE;
|
||||
/* frame body located after [+2]: ether-type, [+1]: payload type */
|
||||
u8 *pframe_body = psnap_type+2+1;
|
||||
#endif
|
||||
|
||||
;
|
||||
|
||||
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) ||
|
||||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true))
|
||||
{
|
||||
|
@ -1076,89 +963,6 @@ sint sta2sta_data_frame(
|
|||
}
|
||||
else if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true)
|
||||
{
|
||||
#ifdef CONFIG_TDLS
|
||||
|
||||
/* direct link data transfer */
|
||||
if(ptdlsinfo->setup_state == TDLS_LINKED_STATE){
|
||||
ptdls_sta = rtw_get_stainfo(pstapriv, pattrib->src);
|
||||
if(ptdls_sta==NULL)
|
||||
{
|
||||
ret=_FAIL;
|
||||
goto exit;
|
||||
}
|
||||
else if(ptdls_sta->tdls_sta_state&TDLS_LINKED_STATE)
|
||||
{
|
||||
|
||||
/* drop QoS-SubType Data, including QoS NULL, excluding QoS-Data */
|
||||
if( (GetFrameSubType(ptr) & WIFI_QOS_DATA_TYPE )== WIFI_QOS_DATA_TYPE)
|
||||
{
|
||||
if(GetFrameSubType(ptr)&(BIT(4)|BIT(5)|BIT(6)))
|
||||
{
|
||||
DBG_871X("drop QoS-Sybtype Data\n");
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
/* filter packets that SA is myself or multicast or broadcast */
|
||||
if (_rtw_memcmp(myhwaddr, pattrib->src, ETH_ALEN)){
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
/* da should be for me */
|
||||
if((!_rtw_memcmp(myhwaddr, pattrib->dst, ETH_ALEN))&& (!bmcast))
|
||||
{
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
/* check BSSID */
|
||||
if( _rtw_memcmp(pattrib->bssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
|
||||
_rtw_memcmp(mybssid, "\x0\x0\x0\x0\x0\x0", ETH_ALEN) ||
|
||||
(!_rtw_memcmp(pattrib->bssid, mybssid, ETH_ALEN)) )
|
||||
{
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* process UAPSD tdls sta */
|
||||
process_pwrbit_data(adapter, precv_frame);
|
||||
|
||||
/* if NULL-frame, check pwrbit */
|
||||
if ((GetFrameSubType(ptr)) == WIFI_DATA_NULL)
|
||||
{
|
||||
/* NULL-frame with pwrbit=1, buffer_STA should buffer frames for sleep_STA */
|
||||
if(GetPwrMgt(ptr))
|
||||
{
|
||||
DBG_871X("TDLS: recv peer null frame with pwr bit 1\n");
|
||||
ptdls_sta->tdls_sta_state|=TDLS_PEER_SLEEP_STATE;
|
||||
/* it would be triggered when we are off channel and receiving NULL DATA */
|
||||
/* we can confirm that peer STA is at off channel */
|
||||
}
|
||||
else if(ptdls_sta->tdls_sta_state&TDLS_CH_SWITCH_ON_STATE)
|
||||
{
|
||||
if((ptdls_sta->tdls_sta_state & TDLS_PEER_AT_OFF_STATE) != TDLS_PEER_AT_OFF_STATE)
|
||||
{
|
||||
issue_nulldata_to_TDLS_peer_STA(adapter, ptdls_sta, 0);
|
||||
ptdls_sta->tdls_sta_state |= TDLS_PEER_AT_OFF_STATE;
|
||||
On_TDLS_Peer_Traffic_Rsp(adapter, precv_frame);
|
||||
}
|
||||
}
|
||||
|
||||
ret= _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
/* receive some of all TDLS management frames, process it at ON_TDLS */
|
||||
if((_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_TDLS, 2))){
|
||||
ret= OnTDLS(adapter, precv_frame);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sta_addr = pattrib->src;
|
||||
|
||||
}
|
||||
else
|
||||
#endif /* CONFIG_TDLS */
|
||||
{
|
||||
/* For Station mode, sa and bssid should always be BSSID, and DA is my mac-address */
|
||||
if(!_rtw_memcmp(pattrib->bssid, pattrib->src, ETH_ALEN) )
|
||||
|
@ -1216,11 +1020,6 @@ sint sta2sta_data_frame(
|
|||
else
|
||||
*psta = rtw_get_stainfo(pstapriv, sta_addr); /* get ap_info */
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if(ptdls_sta != NULL)
|
||||
*psta = ptdls_sta;
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
if (*psta == NULL) {
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("can't get psta under sta2sta_data_frame ; drop pkt\n"));
|
||||
ret= _FAIL;
|
||||
|
@ -1722,11 +1521,6 @@ sint validate_recv_data_frame(struct adapter *adapter, union recv_frame *precv_f
|
|||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct security_priv *psecuritypriv = &adapter->securitypriv;
|
||||
sint ret = _SUCCESS;
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &adapter->tdlsinfo;
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
;
|
||||
|
||||
bretry = GetRetry(ptr);
|
||||
pda = get_da(ptr);
|
||||
|
@ -1847,14 +1641,6 @@ sint validate_recv_data_frame(struct adapter *adapter, union recv_frame *precv_f
|
|||
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("validate_recv_data_frame:pattrib->privacy=%x\n", pattrib->privacy));
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n ^^^^^^^^^^^IS_MCAST(pattrib->ra(0x%02x))=%d^^^^^^^^^^^^^^^6\n", pattrib->ra[0],IS_MCAST(pattrib->ra)));
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if((psta->tdls_sta_state & TDLS_LINKED_STATE) && (psta->dot118021XPrivacy==_AES_))
|
||||
{
|
||||
pattrib->encrypt=psta->dot118021XPrivacy;
|
||||
}
|
||||
else
|
||||
#endif /* CONFIG_TDLS */
|
||||
GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt, IS_MCAST(pattrib->ra));
|
||||
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("\n pattrib->encrypt=%d\n",pattrib->encrypt));
|
||||
|
@ -2013,10 +1799,6 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame)
|
|||
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &adapter->tdlsinfo;
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) {
|
||||
int ch_set_idx = rtw_ch_set_search_ch(pmlmeext->channel_set, rtw_get_oper_ch(adapter));
|
||||
|
@ -2025,27 +1807,6 @@ sint validate_recv_frame(struct adapter *adapter, union recv_frame *precv_frame)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if(ptdlsinfo->ch_sensing==1 && ptdlsinfo->cur_channel !=0){
|
||||
ptdlsinfo->collect_pkt_num[ptdlsinfo->cur_channel-1]++;
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
#ifdef RTK_DMP_PLATFORM
|
||||
if ( 0 )
|
||||
{
|
||||
DBG_871X("++\n");
|
||||
{
|
||||
int i;
|
||||
for(i=0; i<64;i=i+8)
|
||||
DBG_871X("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:", *(ptr+i),
|
||||
*(ptr+i+1), *(ptr+i+2) ,*(ptr+i+3) ,*(ptr+i+4),*(ptr+i+5), *(ptr+i+6), *(ptr+i+7));
|
||||
|
||||
}
|
||||
DBG_871X("--\n");
|
||||
}
|
||||
#endif /* RTK_DMP_PLATFORM */
|
||||
|
||||
/* add version chk */
|
||||
if(ver!=0){
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("validate_recv_data_frame fail! (ver!=0)\n"));
|
||||
|
@ -3158,25 +2919,11 @@ int process_recv_indicatepkts(struct adapter *padapter, union recv_frame *prfram
|
|||
int process_recv_indicatepkts(struct adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
int retval = _SUCCESS;
|
||||
/* struct recv_priv *precvpriv = &padapter->recvpriv; */
|
||||
/* struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib; */
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
#ifdef CONFIG_TDLS
|
||||
struct sta_info *psta = prframe->u.hdr.psta;
|
||||
#endif /* CONFIG_TDLS */
|
||||
struct ht_priv *phtpriv = &pmlmepriv->htpriv;
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if( (phtpriv->ht_option==true) ||
|
||||
((psta->tdls_sta_state & TDLS_LINKED_STATE) &&
|
||||
(psta->htpriv.ht_option==true) &&
|
||||
(psta->htpriv.ampdu_enable==true))) /* B/G/N Mode */
|
||||
#else
|
||||
if(phtpriv->ht_option==true) /* B/G/N Mode */
|
||||
#endif /* CONFIG_TDLS */
|
||||
{
|
||||
/* prframe->u.hdr.preorder_ctrl = &precvpriv->recvreorder_ctrl[pattrib->priority]; */
|
||||
|
||||
if(recv_indicatepkt_reorder(padapter, prframe)!=_SUCCESS)/* including perform A-MPDU Rx Ordering Buffer Control */
|
||||
{
|
||||
#ifdef DBG_RX_DROP_FRAME
|
||||
|
@ -3255,13 +3002,6 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr
|
|||
struct recv_priv *precvpriv = &padapter->recvpriv;
|
||||
_queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
|
||||
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
u8 *psnap_type, *pcategory;
|
||||
struct sta_info *ptdls_sta = NULL;
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
|
||||
/* DATA FRAME */
|
||||
rtw_led_control(padapter, LED_CTL_RX);
|
||||
|
||||
|
@ -3275,19 +3015,6 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr
|
|||
goto _recv_data_drop;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
/* check TDLS frame */
|
||||
psnap_type = get_recvframe_data(orig_prframe);
|
||||
psnap_type+=pattrib->hdrlen + pattrib->iv_len+SNAP_SIZE;
|
||||
pcategory = psnap_type + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN;
|
||||
|
||||
if((_rtw_memcmp(psnap_type, SNAP_ETH_TYPE_TDLS, ETH_TYPE_LEN)) &&
|
||||
((*pcategory==RTW_WLAN_CATEGORY_TDLS) || (*pcategory==RTW_WLAN_CATEGORY_P2P))){
|
||||
ret = OnTDLS(padapter, prframe); /* all of functions will return _FAIL */
|
||||
goto _exit_recv_func;
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
prframe = recvframe_chk_defrag(padapter, prframe);
|
||||
if(prframe==NULL) {
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,("recvframe_chk_defrag: drop pkt\n"));
|
||||
|
@ -3306,14 +3033,7 @@ static int recv_func_posthandle(struct adapter *padapter, union recv_frame *prfr
|
|||
ret = _FAIL;
|
||||
goto _recv_data_drop;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if(padapter->tdlsinfo.setup_state == TDLS_LINKED_STATE)
|
||||
ptdls_sta = rtw_get_stainfo(&padapter->stapriv, pattrib->src);
|
||||
count_rx_stats(padapter, prframe, ptdls_sta);
|
||||
#else
|
||||
count_rx_stats(padapter, prframe, NULL);
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
ret = process_recv_indicatepkts(padapter, prframe);
|
||||
if (ret != _SUCCESS)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue