rtl8188eu: Remove CONFIG_WFD - not selected

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-07-20 13:53:07 -05:00
parent d538ad412a
commit 39f4cd8546
12 changed files with 20 additions and 2390 deletions

View file

@ -1558,116 +1558,6 @@ void rtw_WLAN_BSSID_EX_remove_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id)
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
#ifdef CONFIG_WFD
int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
{
int match;
uint cnt = 0;
u8 eid, wfd_oui[4]={0x50,0x6F,0x9A,0x0A};
match=false;
if ( in_len < 0 )
{
return match;
}
while (cnt<in_len)
{
eid = in_ie[cnt];
if ( ( eid == _VENDOR_SPECIFIC_IE_ ) && ( _rtw_memcmp( &in_ie[cnt+2], wfd_oui, 4) == true ) )
{
if ( wfd_ie != NULL )
{
_rtw_memcpy( wfd_ie, &in_ie[ cnt ], in_ie[ cnt + 1 ] + 2 );
}
else
{
if ( wfd_ielen != NULL )
{
*wfd_ielen = 0;
}
}
if ( wfd_ielen != NULL )
{
*wfd_ielen = in_ie[ cnt + 1 ] + 2;
}
cnt += in_ie[ cnt + 1 ] + 2;
match = true;
break;
}
else
{
cnt += in_ie[ cnt + 1 ] +2; /* goto next */
}
}
if ( match == true )
{
match = cnt;
}
return match;
}
/* attr_content: The output buffer, contains the "body field" of WFD attribute. */
/* attr_contentlen: The data length of the "body field" of WFD attribute. */
int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *attr_content, uint *attr_contentlen)
{
int match;
uint cnt = 0;
u8 attr_id, wfd_oui[4]={0x50,0x6F,0x9A,0x0A};
match=false;
if ( ( wfd_ie[ 0 ] != _VENDOR_SPECIFIC_IE_ ) ||
( _rtw_memcmp( wfd_ie + 2, wfd_oui , 4 ) != true ) )
{
return( match );
}
/* 1 ( WFD IE ) + 1 ( Length ) + 3 ( OUI ) + 1 ( OUI Type ) */
cnt = 6;
while ( cnt < wfd_ielen )
{
u16 attrlen = RTW_GET_BE16(wfd_ie + cnt + 1);
attr_id = wfd_ie[cnt];
if ( attr_id == target_attr_id )
{
/* 3 -> 1 byte for attribute ID field, 2 bytes for length field */
if (attr_content)
_rtw_memcpy( attr_content, &wfd_ie[ cnt + 3 ], attrlen );
if (attr_contentlen)
*attr_contentlen = attrlen;
cnt += attrlen + 3;
match = true;
break;
}
else
{
cnt += attrlen + 3; /* goto next */
}
}
return match;
}
#endif /* CONFIG_WFD */
/* Baron adds to avoid FreeBSD warning */ /* Baron adds to avoid FreeBSD warning */
int ieee80211_is_empty_essid(const char *essid, int essid_len) int ieee80211_is_empty_essid(const char *essid, int essid_len)
{ {

View file

@ -1276,10 +1276,6 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame)
u8 p2p_status_code = P2P_STATUS_SUCCESS; u8 p2p_status_code = P2P_STATUS_SUCCESS;
u8 *p2pie; u8 *p2pie;
u32 p2pielen = 0; u32 p2pielen = 0;
#ifdef CONFIG_WFD
u8 wfd_ie[ 128 ] = { 0x00 };
u32 wfd_ielen = 0;
#endif /* CONFIG_WFD */
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
@ -1683,21 +1679,6 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame)
goto OnAssocReqFail; goto OnAssocReqFail;
} }
} }
#ifdef CONFIG_WFD
if (rtw_get_wfd_ie(pframe + WLAN_HDR_A3_LEN + ie_offset , pkt_len - WLAN_HDR_A3_LEN - ie_offset , wfd_ie, &wfd_ielen ))
{
u8 attr_content[ 10 ] = { 0x00 };
u32 attr_contentlen = 0;
DBG_88E( "[%s] WFD IE Found!!\n", __func__ );
rtw_get_wfd_attr_content( wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, attr_content, &attr_contentlen);
if ( attr_contentlen )
{
pwdinfo->wfd_info->peer_rtsp_ctrlport = RTW_GET_BE16( attr_content + 2 );
DBG_88E( "[%s] Peer PORT NUM = %d\n", __func__, pwdinfo->wfd_info->peer_rtsp_ctrlport );
}
}
#endif
} }
pstat->p2p_status_code = p2p_status_code; pstat->p2p_status_code = p2p_status_code;
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
@ -1864,12 +1845,6 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame)
case _VENDOR_SPECIFIC_IE_: case _VENDOR_SPECIFIC_IE_:
if (_rtw_memcmp(pIE->data, WMM_PARA_OUI, 6)) /* WMM */ if (_rtw_memcmp(pIE->data, WMM_PARA_OUI, 6)) /* WMM */
WMM_param_handler(padapter, pIE); WMM_param_handler(padapter, pIE);
#if defined(CONFIG_P2P) && defined(CONFIG_WFD)
else if ( _rtw_memcmp(pIE->data, WFD_OUI, 4)) { /* WFD */
DBG_88E( "[%s] Found WFD IE\n", __func__ );
WFD_info_handler( padapter, pIE );
}
#endif
break; break;
case _HT_CAPABILITY_IE_: /* HT caps */ case _HT_CAPABILITY_IE_: /* HT caps */
HT_caps_handler(padapter, pIE); HT_caps_handler(padapter, pIE);
@ -2332,10 +2307,6 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr)
u8 wpsielen = 0, p2pielen = 0, i; u8 wpsielen = 0, p2pielen = 0, i;
u8 channel_cnt_24g = 0, channel_cnt_5gl = 0, channel_cnt_5gh = 0; u8 channel_cnt_24g = 0, channel_cnt_5gl = 0, channel_cnt_5gh = 0;
u16 len_channellist_attr = 0; u16 len_channellist_attr = 0;
#ifdef CONFIG_WFD
u32 wfdielen = 0;
#endif /* CONFIG_WFD */
struct xmit_frame *pmgntframe; struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib; struct pkt_attrib *pattrib;
unsigned char *pframe; unsigned char *pframe;
@ -2690,21 +2661,13 @@ void issue_p2p_GO_request(_adapter *padapter, u8* raddr)
pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen ); pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen );
#ifdef CONFIG_WFD
wfdielen = build_nego_req_wfd_ie(pwdinfo, pframe);
pframe += wfdielen;
pattrib->pktlen += wfdielen;
#endif /* CONFIG_WFD */
pattrib->last_txcmdsz = pattrib->pktlen; pattrib->last_txcmdsz = pattrib->pktlen;
dump_mgntframe(padapter, pmgntframe); dump_mgntframe(padapter, pmgntframe);
return; return;
} }
static void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body,uint len, u8 result) static void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body,uint len, u8 result)
{ {
@ -2731,10 +2694,6 @@ static void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body,
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct wifidirect_info *pwdinfo = &( padapter->wdinfo); struct wifidirect_info *pwdinfo = &( padapter->wdinfo);
#ifdef CONFIG_WFD
u32 wfdielen = 0;
#endif /* CONFIG_WFD */
if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL)
{ {
return; return;
@ -3112,12 +3071,6 @@ static void issue_p2p_GO_response(_adapter *padapter, u8* raddr, u8* frame_body,
pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen ); pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen );
#ifdef CONFIG_WFD
wfdielen = build_nego_resp_wfd_ie(pwdinfo, pframe);
pframe += wfdielen;
pattrib->pktlen += wfdielen;
#endif /* CONFIG_WFD */
pattrib->last_txcmdsz = pattrib->pktlen; pattrib->last_txcmdsz = pattrib->pktlen;
dump_mgntframe(padapter, pmgntframe); dump_mgntframe(padapter, pmgntframe);
@ -3143,9 +3096,6 @@ static void issue_p2p_GO_confirm(_adapter *padapter, u8* raddr, u8 result)
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct wifidirect_info *pwdinfo = &( padapter->wdinfo); struct wifidirect_info *pwdinfo = &( padapter->wdinfo);
#ifdef CONFIG_WFD
u32 wfdielen = 0;
#endif /* CONFIG_WFD */
if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL)
{ {
@ -3330,12 +3280,6 @@ static void issue_p2p_GO_confirm(_adapter *padapter, u8* raddr, u8 result)
pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen ); pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen );
#ifdef CONFIG_WFD
wfdielen = build_nego_confirm_wfd_ie(pwdinfo, pframe);
pframe += wfdielen;
pattrib->pktlen += wfdielen;
#endif /* CONFIG_WFD */
pattrib->last_txcmdsz = pattrib->pktlen; pattrib->last_txcmdsz = pattrib->pktlen;
dump_mgntframe(padapter, pmgntframe); dump_mgntframe(padapter, pmgntframe);
@ -3356,10 +3300,6 @@ void issue_p2p_invitation_request(_adapter *padapter, u8* raddr )
u8 dialogToken = 3; u8 dialogToken = 3;
u8 channel_cnt_24g = 0, channel_cnt_5gl = 0, channel_cnt_5gh = 0; u8 channel_cnt_24g = 0, channel_cnt_5gl = 0, channel_cnt_5gh = 0;
u16 len_channellist_attr = 0; u16 len_channellist_attr = 0;
#ifdef CONFIG_WFD
u32 wfdielen = 0;
#endif /* CONFIG_WFD */
struct xmit_frame *pmgntframe; struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib; struct pkt_attrib *pattrib;
unsigned char *pframe; unsigned char *pframe;
@ -3605,12 +3545,6 @@ void issue_p2p_invitation_request(_adapter *padapter, u8* raddr )
pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen ); pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen );
#ifdef CONFIG_WFD
wfdielen = build_invitation_req_wfd_ie(pwdinfo, pframe);
pframe += wfdielen;
pattrib->pktlen += wfdielen;
#endif /* CONFIG_WFD */
pattrib->last_txcmdsz = pattrib->pktlen; pattrib->last_txcmdsz = pattrib->pktlen;
dump_mgntframe(padapter, pmgntframe); dump_mgntframe(padapter, pmgntframe);
@ -3630,10 +3564,6 @@ void issue_p2p_invitation_response(_adapter *padapter, u8* raddr, u8 dialogToken
u8 p2pielen = 0, i; u8 p2pielen = 0, i;
u8 channel_cnt_24g = 0, channel_cnt_5gl = 0, channel_cnt_5gh = 0; u8 channel_cnt_24g = 0, channel_cnt_5gl = 0, channel_cnt_5gh = 0;
u16 len_channellist_attr = 0; u16 len_channellist_attr = 0;
#ifdef CONFIG_WFD
u32 wfdielen = 0;
#endif /* CONFIG_WFD */
struct xmit_frame *pmgntframe; struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib; struct pkt_attrib *pattrib;
unsigned char *pframe; unsigned char *pframe;
@ -3817,18 +3747,11 @@ void issue_p2p_invitation_response(_adapter *padapter, u8* raddr, u8 dialogToken
pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen ); pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &pattrib->pktlen );
#ifdef CONFIG_WFD
wfdielen = build_invitation_resp_wfd_ie(pwdinfo, pframe);
pframe += wfdielen;
pattrib->pktlen += wfdielen;
#endif /* CONFIG_WFD */
pattrib->last_txcmdsz = pattrib->pktlen; pattrib->last_txcmdsz = pattrib->pktlen;
dump_mgntframe(padapter, pmgntframe); dump_mgntframe(padapter, pmgntframe);
return; return;
} }
void issue_p2p_provision_request(_adapter *padapter, u8* pssid, u8 ussidlen, u8* pdev_raddr ) void issue_p2p_provision_request(_adapter *padapter, u8* pssid, u8 ussidlen, u8* pdev_raddr )
@ -3841,10 +3764,6 @@ void issue_p2p_provision_request(_adapter *padapter, u8* pssid, u8 ussidlen, u8*
u8 wpsie[ 100 ] = { 0x00 }; u8 wpsie[ 100 ] = { 0x00 };
u8 wpsielen = 0; u8 wpsielen = 0;
u32 p2pielen = 0; u32 p2pielen = 0;
#ifdef CONFIG_WFD
u32 wfdielen = 0;
#endif /* CONFIG_WFD */
struct xmit_frame *pmgntframe; struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib; struct pkt_attrib *pattrib;
unsigned char *pframe; unsigned char *pframe;
@ -3928,22 +3847,13 @@ void issue_p2p_provision_request(_adapter *padapter, u8* pssid, u8 ussidlen, u8*
pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen ); pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen );
#ifdef CONFIG_WFD
wfdielen = build_provdisc_req_wfd_ie(pwdinfo, pframe);
pframe += wfdielen;
pattrib->pktlen += wfdielen;
#endif /* CONFIG_WFD */
pattrib->last_txcmdsz = pattrib->pktlen; pattrib->last_txcmdsz = pattrib->pktlen;
dump_mgntframe(padapter, pmgntframe); dump_mgntframe(padapter, pmgntframe);
return; return;
} }
static u8 is_matched_in_profilelist( u8* peermacaddr, struct profile_info* profileinfo ) static u8 is_matched_in_profilelist( u8* peermacaddr, struct profile_info* profileinfo )
{ {
u8 i, match_result = 0; u8 i, match_result = 0;
@ -3984,9 +3894,6 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da)
struct wifidirect_info *pwdinfo = &(padapter->wdinfo); struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
u8 wpsie[255] = { 0x00 }; u8 wpsie[255] = { 0x00 };
u32 wpsielen = 0, p2pielen = 0; u32 wpsielen = 0, p2pielen = 0;
#ifdef CONFIG_WFD
u32 wfdielen = 0;
#endif /* CONFIG_WFD */
if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL)
return; return;
@ -4217,12 +4124,6 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da)
pframe += p2pielen; pframe += p2pielen;
pattrib->pktlen += p2pielen; pattrib->pktlen += p2pielen;
#ifdef CONFIG_WFD
wfdielen = build_probe_resp_wfd_ie(pwdinfo, pframe, 0);
pframe += wfdielen;
pattrib->pktlen += wfdielen;
#endif /* CONFIG_WFD */
pattrib->last_txcmdsz = pattrib->pktlen; pattrib->last_txcmdsz = pattrib->pktlen;
dump_mgntframe(padapter, pmgntframe); dump_mgntframe(padapter, pmgntframe);
@ -4248,13 +4149,8 @@ static int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack)
struct wifidirect_info *pwdinfo = &(padapter->wdinfo); struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
u8 wpsie[255] = { 0x00 }, p2pie[ 255 ] = { 0x00 }; u8 wpsie[255] = { 0x00 }, p2pie[ 255 ] = { 0x00 };
u16 wpsielen = 0, p2pielen = 0; u16 wpsielen = 0, p2pielen = 0;
#ifdef CONFIG_WFD
u32 wfdielen = 0;
#endif /* CONFIG_WFD */
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL)
{ {
goto exit; goto exit;
@ -4524,12 +4420,6 @@ static int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack)
pframe += pmlmepriv->wps_probe_req_ie_len; pframe += pmlmepriv->wps_probe_req_ie_len;
} }
#ifdef CONFIG_WFD
wfdielen = build_probe_req_wfd_ie(pwdinfo, pframe);
pframe += wfdielen;
pattrib->pktlen += wfdielen;
#endif /* CONFIG_WFD */
pattrib->last_txcmdsz = pattrib->pktlen; pattrib->last_txcmdsz = pattrib->pktlen;
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("issuing probe_req, tx_len=%d\n", pattrib->last_txcmdsz)); RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("issuing probe_req, tx_len=%d\n", pattrib->last_txcmdsz));
@ -5486,11 +5376,6 @@ void issue_beacon(_adapter *padapter, int timeout_ms)
pframe += len; pframe += len;
pattrib->pktlen += len; pattrib->pktlen += len;
#ifdef CONFIG_WFD
len = build_beacon_wfd_ie( pwdinfo, pframe );
pframe += len;
pattrib->pktlen += len;
#endif /* CONFIG_WFD */
} }
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
@ -5595,9 +5480,6 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe
unsigned int rate_len; unsigned int rate_len;
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
struct wifidirect_info *pwdinfo = &(padapter->wdinfo); struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
#ifdef CONFIG_WFD
u32 wfdielen = 0;
#endif /* CONFIG_WFD */
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
/* DBG_88E("%s\n", __func__); */ /* DBG_88E("%s\n", __func__); */
@ -5751,23 +5633,14 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe
pframe += len; pframe += len;
pattrib->pktlen += len; pattrib->pktlen += len;
#ifdef CONFIG_WFD
len = build_probe_resp_wfd_ie(pwdinfo, pframe, 0);
pframe += len;
pattrib->pktlen += len;
#endif /* CONFIG_WFD */
} }
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
pattrib->last_txcmdsz = pattrib->pktlen; pattrib->last_txcmdsz = pattrib->pktlen;
dump_mgntframe(padapter, pmgntframe); dump_mgntframe(padapter, pmgntframe);
return; return;
} }
static int _issue_probereq(_adapter *padapter, NDIS_802_11_SSID *pssid, u8 *da, int wait_ack) static int _issue_probereq(_adapter *padapter, NDIS_802_11_SSID *pssid, u8 *da, int wait_ack)
@ -6079,10 +5952,6 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p
__le16 lestatus, leval; __le16 lestatus, leval;
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
struct wifidirect_info *pwdinfo = &(padapter->wdinfo); struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
#ifdef CONFIG_WFD
u32 wfdielen = 0;
#endif /* CONFIG_WFD */
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
DBG_88E("%s\n", __func__); DBG_88E("%s\n", __func__);
@ -6202,13 +6071,6 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p
pframe += len; pframe += len;
pattrib->pktlen += len; pattrib->pktlen += len;
} }
#ifdef CONFIG_WFD
if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) {
wfdielen = build_assoc_resp_wfd_ie(pwdinfo, pframe);
pframe += wfdielen;
pattrib->pktlen += wfdielen;
}
#endif /* CONFIG_WFD */
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
pattrib->last_txcmdsz = pattrib->pktlen; pattrib->last_txcmdsz = pattrib->pktlen;
dump_mgntframe(padapter, pmgntframe); dump_mgntframe(padapter, pmgntframe);
@ -6238,9 +6100,6 @@ void issue_assocreq(_adapter *padapter)
struct wifidirect_info *pwdinfo = &(padapter->wdinfo); struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
u8 p2pie[ 255 ] = { 0x00 }; u8 p2pie[ 255 ] = { 0x00 };
u16 p2pielen = 0; u16 p2pielen = 0;
#ifdef CONFIG_WFD
u32 wfdielen = 0;
#endif /* CONFIG_WFD */
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
#ifdef CONFIG_DFS #ifdef CONFIG_DFS
@ -6573,12 +6432,6 @@ void issue_assocreq(_adapter *padapter)
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
#ifdef CONFIG_WFD
wfdielen = build_assoc_req_wfd_ie(pwdinfo, pframe);
pframe += wfdielen;
pattrib->pktlen += wfdielen;
#endif /* CONFIG_WFD */
pattrib->last_txcmdsz = pattrib->pktlen; pattrib->last_txcmdsz = pattrib->pktlen;
dump_mgntframe(padapter, pmgntframe); dump_mgntframe(padapter, pmgntframe);

File diff suppressed because it is too large Load diff

View file

@ -670,42 +670,6 @@ void flush_all_cam_entry(_adapter *padapter)
_rtw_memset((u8 *)(pmlmeinfo->FW_sta_info), 0, sizeof(pmlmeinfo->FW_sta_info)); _rtw_memset((u8 *)(pmlmeinfo->FW_sta_info), 0, sizeof(pmlmeinfo->FW_sta_info));
} }
#if defined(CONFIG_P2P) && defined(CONFIG_WFD)
int WFD_info_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
{
struct registry_priv *pregpriv = &padapter->registrypriv;
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct wifidirect_info *pwdinfo;
u8 wfd_ie[ 128 ] = { 0x00 };
u32 wfd_ielen = 0;
pwdinfo = &padapter->wdinfo;
if ( rtw_get_wfd_ie( ( u8* ) pIE, pIE->Length, wfd_ie, &wfd_ielen ) )
{
u8 attr_content[ 10 ] = { 0x00 };
u32 attr_contentlen = 0;
DBG_88E( "[%s] Found WFD IE\n", __func__ );
rtw_get_wfd_attr_content( wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, attr_content, &attr_contentlen);
if ( attr_contentlen )
{
pwdinfo->wfd_info->peer_rtsp_ctrlport = RTW_GET_BE16( attr_content + 2 );
DBG_88E( "[%s] Peer PORT NUM = %d\n", __func__, pwdinfo->wfd_info->peer_rtsp_ctrlport );
return( true );
}
}
else
{
DBG_88E( "[%s] NO WFD IE\n", __func__ );
}
return( _FAIL );
}
#endif
int WMM_param_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE) int WMM_param_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
{ {
/* struct registry_priv *pregpriv = &padapter->registrypriv; */ /* struct registry_priv *pregpriv = &padapter->registrypriv; */

View file

@ -336,11 +336,7 @@ struct _ADAPTER{
struct wifidirect_info wdinfo; struct wifidirect_info wdinfo;
#endif //CONFIG_P2P #endif //CONFIG_P2P
#ifdef CONFIG_WFD void *HalData;
struct wifi_display_info wfd_info;
#endif //CONFIG_WFD
void * HalData;
u32 hal_data_sz; u32 hal_data_sz;
struct hal_ops HalFunc; struct hal_ops HalFunc;

View file

@ -1259,11 +1259,6 @@ u32 rtw_set_p2p_attr_content(u8 *pbuf, u8 attr_id, u16 attr_len, u8 *pdata_attr)
void rtw_WLAN_BSSID_EX_remove_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id); void rtw_WLAN_BSSID_EX_remove_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id);
#endif #endif
#ifdef CONFIG_WFD
int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen);
int rtw_get_wfd_attr_content(u8 *wfd_ie, uint wfd_ielen, u8 target_attr_id ,u8 *attr_content, uint *attr_contentlen);
#endif // CONFIG_WFD
uint rtw_get_rateset_len(u8 *rateset); uint rtw_get_rateset_len(u8 *rateset);
struct registry_priv; struct registry_priv;

View file

@ -179,30 +179,6 @@ struct tx_invite_resp_info{
u8 token; // Used to record the dialog token of p2p invitation request frame. u8 token; // Used to record the dialog token of p2p invitation request frame.
}; };
#ifdef CONFIG_WFD
struct wifi_display_info{
u16 wfd_enable; // Eanble/Disable the WFD function.
u16 rtsp_ctrlport; // TCP port number at which the this WFD device listens for RTSP messages
u16 peer_rtsp_ctrlport; // TCP port number at which the peer WFD device listens for RTSP messages
// This filed should be filled when receiving the gropu negotiation request
u8 peer_session_avail; // WFD session is available or not for the peer wfd device.
// This variable will be set when sending the provisioning discovery request to peer WFD device.
// And this variable will be reset when it is read by using the iwpriv p2p_get wfd_sa command.
u8 ip_address[4];
u8 peer_ip_address[4];
u8 wfd_pc; // WFD preferred connection
// 0 -> Prefer to use the P2P for WFD connection on peer side.
// 1 -> Prefer to use the TDLS for WFD connection on peer side.
u8 wfd_device_type; // WFD Device Type
// 0 -> WFD Source Device
// 1 -> WFD Primary Sink Device
enum SCAN_RESULT_TYPE scan_result_type; // Used when P2P is enable. This parameter will impact the scan result.
};
#endif //CONFIG_WFD
struct tx_provdisc_req_info{ struct tx_provdisc_req_info{
u16 wps_config_method_request; // Used when sending the provisioning request frame u16 wps_config_method_request; // Used when sending the provisioning request frame
u16 peer_channel_num[2]; // The channel number which the receiver stands. u16 peer_channel_num[2]; // The channel number which the receiver stands.
@ -252,9 +228,6 @@ struct wifidirect_info{
struct group_id_info groupid_info; // Store the group id information when doing the group negotiation handshake. struct group_id_info groupid_info; // Store the group id information when doing the group negotiation handshake.
struct scan_limit_info rx_invitereq_info; // Used for get the limit scan channel from the Invitation procedure struct scan_limit_info rx_invitereq_info; // Used for get the limit scan channel from the Invitation procedure
struct scan_limit_info p2p_info; // Used for get the limit scan channel from the P2P negotiation handshake struct scan_limit_info p2p_info; // Used for get the limit scan channel from the P2P negotiation handshake
#ifdef CONFIG_WFD
struct wifi_display_info *wfd_info;
#endif
enum P2P_ROLE role; enum P2P_ROLE role;
enum P2P_STATE pre_p2p_state; enum P2P_STATE pre_p2p_state;
enum P2P_STATE p2p_state; enum P2P_STATE p2p_state;
@ -341,9 +314,6 @@ struct tdls_info{
u8 watchdog_count; u8 watchdog_count;
u8 dev_discovered; //WFD_TDLS: for sigma test u8 dev_discovered; //WFD_TDLS: for sigma test
u8 enable; u8 enable;
#ifdef CONFIG_WFD
struct wifi_display_info *wfd_info;
#endif
}; };
struct mlme_priv { struct mlme_priv {

View file

@ -553,9 +553,6 @@ int is_IBSS_empty(_adapter *padapter);
unsigned char check_assoc_AP(u8 *pframe, uint len); unsigned char check_assoc_AP(u8 *pframe, uint len);
int WMM_param_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE); int WMM_param_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE);
#ifdef CONFIG_WFD
int WFD_info_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE);
#endif
void WMMOnAssocRsp(_adapter *padapter); void WMMOnAssocRsp(_adapter *padapter);
void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE); void HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE);

View file

@ -27,21 +27,6 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf);
u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8* pssid, u8 ussidlen, u8* pdev_raddr ); u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8* pssid, u8 ussidlen, u8* pdev_raddr );
u32 build_assoc_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 status_code); u32 build_assoc_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 status_code);
u32 build_deauth_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf); u32 build_deauth_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf);
#ifdef CONFIG_WFD
u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf);
u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunneled);
u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf);
u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf);
u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf);
u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf);
u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf);
u32 build_invitation_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf);
u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf);
u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf);
u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf);
u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf);
#endif //CONFIG_WFD
u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint len); u32 process_probe_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint len);
u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint len, struct sta_info *psta); u32 process_assoc_req_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pframe, uint len, struct sta_info *psta);
u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint len); u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint len);

View file

@ -280,94 +280,39 @@ static char *translate_scan(_adapter *padapter,
#endif //CONFIG_P2P #endif //CONFIG_P2P
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
#ifdef CONFIG_WFD if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
if (SCAN_RESULT_ALL == pwdinfo->wfd_info->scan_result_type)
{ {
u32 blnGotP2PIE = false;
} // User is doing the P2P device discovery
else if ((SCAN_RESULT_P2P_ONLY == pwdinfo->wfd_info->scan_result_type) || // The prefix of SSID should be "DIRECT-" and the IE should contains the P2P IE.
(SCAN_RESULT_WFD_TYPE == pwdinfo->wfd_info->scan_result_type)) // If not, the driver should ignore this AP and go to the next AP.
#endif // CONFIG_WFD
{ // Verifying the SSID
if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) if (!memcmp(pnetwork->network.Ssid.Ssid, pwdinfo->p2p_wildcard_ssid, P2P_WILDCARD_SSID_LEN))
{ {
u32 blnGotP2PIE = false; u32 p2pielen = 0;
// User is doing the P2P device discovery if (pnetwork->network.Reserved[0] == 2) { // Probe Request
// The prefix of SSID should be "DIRECT-" and the IE should contains the P2P IE. // Verifying the P2P IE
// If not, the driver should ignore this AP and go to the next AP. if (rtw_get_p2p_ie(pnetwork->network.IEs, pnetwork->network.IELength, NULL, &p2pielen))
// Verifying the SSID
if (!memcmp(pnetwork->network.Ssid.Ssid, pwdinfo->p2p_wildcard_ssid, P2P_WILDCARD_SSID_LEN))
{
u32 p2pielen = 0;
if (pnetwork->network.Reserved[0] == 2) { // Probe Request
// Verifying the P2P IE
if (rtw_get_p2p_ie(pnetwork->network.IEs, pnetwork->network.IELength, NULL, &p2pielen))
{
blnGotP2PIE = true;
}
} else { // Beacon or Probe Respones
// Verifying the P2P IE
if (rtw_get_p2p_ie(&pnetwork->network.IEs[12], pnetwork->network.IELength - 12, NULL, &p2pielen))
{
blnGotP2PIE = true;
}
}
}
if (blnGotP2PIE == false)
{
return start;
}
}
}
#ifdef CONFIG_WFD
if (SCAN_RESULT_WFD_TYPE == pwdinfo->wfd_info->scan_result_type)
{
u32 blnGotWFD = false;
u8 wfd_ie[ 128 ] = { 0x00 };
uint wfd_ielen = 0;
if (rtw_get_wfd_ie(&pnetwork->network.IEs[12], pnetwork->network.IELength - 12, wfd_ie, &wfd_ielen))
{
u8 wfd_devinfo[ 6 ] = { 0x00 };
uint wfd_devlen = 6;
if (rtw_get_wfd_attr_content(wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, wfd_devinfo, &wfd_devlen))
{
if (pwdinfo->wfd_info->wfd_device_type == WFD_DEVINFO_PSINK)
{ {
// the first two bits will indicate the WFD device type blnGotP2PIE = true;
if ((wfd_devinfo[ 1 ] & 0x03) == WFD_DEVINFO_SOURCE)
{
// If this device is Miracast PSink device, the scan reuslt should just provide the Miracast source.
blnGotWFD = true;
}
} }
else if (pwdinfo->wfd_info->wfd_device_type == WFD_DEVINFO_SOURCE) } else { // Beacon or Probe Respones
// Verifying the P2P IE
if (rtw_get_p2p_ie(&pnetwork->network.IEs[12], pnetwork->network.IELength - 12, NULL, &p2pielen))
{ {
// the first two bits will indicate the WFD device type blnGotP2PIE = true;
if ((wfd_devinfo[ 1 ] & 0x03) == WFD_DEVINFO_PSINK)
{
// If this device is Miracast source device, the scan reuslt should just provide the Miracast PSink.
// Todo: How about the SSink?!
blnGotWFD = true;
}
} }
} }
} }
if (blnGotWFD == false) if (blnGotP2PIE == false)
{ {
return start; return start;
} }
} }
#endif // CONFIG_WFD
#endif //CONFIG_P2P #endif //CONFIG_P2P
/* AP MAC address */ /* AP MAC address */
@ -4041,67 +3986,6 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev,
return ret; return ret;
} }
#ifdef CONFIG_WFD
static int rtw_p2p_get_peer_wfd_port(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
int ret = 0;
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
struct iw_point *pdata = &wrqu->data;
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
DBG_88E("[%s] p2p_state = %d\n", __func__, rtw_p2p_state(pwdinfo));
sprintf(extra, "\n\nPort=%d\n", pwdinfo->wfd_info->peer_rtsp_ctrlport);
DBG_88E("[%s] remote port = %d\n", __func__, pwdinfo->wfd_info->peer_rtsp_ctrlport);
wrqu->data.length = strlen(extra);
return ret;
}
static int rtw_p2p_get_peer_wfd_preferred_connection(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
int ret = 0;
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
struct iw_point *pdata = &wrqu->data;
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
sprintf(extra, "\n\nwfd_pc=%d\n", pwdinfo->wfd_info->wfd_pc);
DBG_88E("[%s] wfd_pc = %d\n", __func__, pwdinfo->wfd_info->wfd_pc);
wrqu->data.length = strlen(extra);
pwdinfo->wfd_info->wfd_pc = false; // Reset the WFD preferred connection to P2P
return ret;
}
static int rtw_p2p_get_peer_wfd_session_available(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
int ret = 0;
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
struct iw_point *pdata = &wrqu->data;
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
sprintf(extra, "\n\nwfd_sa=%d\n", pwdinfo->wfd_info->peer_session_avail);
DBG_88E("[%s] wfd_sa = %d\n", __func__, pwdinfo->wfd_info->peer_session_avail);
wrqu->data.length = strlen(extra);
pwdinfo->wfd_info->peer_session_avail = true; // Reset the WFD session available
return ret;
}
#endif // CONFIG_WFD
static int rtw_p2p_get_go_device_address(struct net_device *dev, static int rtw_p2p_get_go_device_address(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
@ -4609,11 +4493,6 @@ static int rtw_p2p_invite_req(struct net_device *dev,
_irqL irqL; _irqL irqL;
struct tx_invite_req_info* pinvite_req_info = &pwdinfo->invitereq_info; struct tx_invite_req_info* pinvite_req_info = &pwdinfo->invitereq_info;
#ifdef CONFIG_WFD
struct wifi_display_info* pwfd_info = pwdinfo->wfd_info;
#endif // CONFIG_WFD
// Commented by Albert 20120321
// The input data contains two informations. // The input data contains two informations.
// 1. First information is the P2P device address which you want to send to. // 1. First information is the P2P device address which you want to send to.
// 2. Second information is the group id which combines with GO's mac address, space and GO's ssid. // 2. Second information is the group id which combines with GO's mac address, space and GO's ssid.
@ -4698,45 +4577,6 @@ static int rtw_p2p_invite_req(struct net_device *dev,
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
#ifdef CONFIG_WFD
if (uintPeerChannel)
{
u8 wfd_ie[ 128 ] = { 0x00 };
uint wfd_ielen = 0;
if (rtw_get_wfd_ie(&pnetwork->network.IEs[12], pnetwork->network.IELength - 12, wfd_ie, &wfd_ielen))
{
u8 wfd_devinfo[ 6 ] = { 0x00 };
uint wfd_devlen = 6;
DBG_88E("[%s] Found WFD IE!\n", __func__);
if (rtw_get_wfd_attr_content(wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, wfd_devinfo, &wfd_devlen))
{
u16 wfd_devinfo_field = 0;
// Commented by Albert 20120319
// The first two bytes are the WFD device information field of WFD device information subelement.
// In big endian format.
wfd_devinfo_field = RTW_GET_BE16(wfd_devinfo);
if (wfd_devinfo_field & WFD_DEVINFO_SESSION_AVAIL)
{
pwfd_info->peer_session_avail = true;
}
else
{
pwfd_info->peer_session_avail = false;
}
}
}
if (false == pwfd_info->peer_session_avail)
{
DBG_88E("[%s] WFD Session not avaiable!\n", __func__);
goto exit;
}
}
#endif // CONFIG_WFD
if (uintPeerChannel) if (uintPeerChannel)
{ {
// Store the GO's bssid // Store the GO's bssid
@ -4792,11 +4632,6 @@ static int rtw_p2p_set_persistent(struct net_device *dev,
_irqL irqL; _irqL irqL;
struct tx_invite_req_info* pinvite_req_info = &pwdinfo->invitereq_info; struct tx_invite_req_info* pinvite_req_info = &pwdinfo->invitereq_info;
#ifdef CONFIG_WFD
struct wifi_display_info* pwfd_info = pwdinfo->wfd_info;
#endif // CONFIG_WFD
// Commented by Albert 20120328
// The input data is 0 or 1 // The input data is 0 or 1
// 0: disable persistent group functionality // 0: disable persistent group functionality
// 1: enable persistent group founctionality // 1: enable persistent group founctionality
@ -4831,259 +4666,6 @@ exit:
} }
#ifdef CONFIG_WFD
static int rtw_p2p_set_pc(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
int ret = 0;
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
struct iw_point *pdata = &wrqu->data;
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
u8 peerMAC[ ETH_ALEN ] = { 0x00 };
int jj,kk;
u8 peerMACStr[ ETH_ALEN * 2 ] = { 0x00 };
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
_list *plist, *phead;
_queue *queue = &(pmlmepriv->scanned_queue);
struct wlan_network *pnetwork = NULL;
u8 attr_content[50] = { 0x00 }, _status = 0;
u8 *p2pie;
uint p2pielen = 0, attr_contentlen = 0;
_irqL irqL;
uint uintPeerChannel = 0;
struct wifi_display_info* pwfd_info = pwdinfo->wfd_info;
// Commented by Albert 20120512
// 1. Input information is the MAC address which wants to know the Preferred Connection bit (PC bit)
// Format: 00:E0:4C:00:00:05
DBG_88E("[%s] data = %s\n", __func__, extra);
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
{
DBG_88E("[%s] WiFi Direct is disable!\n", __func__);
return ret;
}
for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3)
{
peerMAC[ jj ] = key_2char2num(extra[kk], extra[kk+ 1]);
}
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
phead = get_list_head(queue);
plist = get_next(phead);
while (1)
{
if (rtw_end_of_queue_search(phead,plist)== true)
break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
// Commented by Albert 2011/05/18
// Match the device address located in the P2P IE
// This is for the case that the P2P device address is not the same as the P2P interface address.
if ((p2pie=rtw_get_p2p_ie(&pnetwork->network.IEs[12], pnetwork->network.IELength - 12, NULL, &p2pielen)))
{
// The P2P Device ID attribute is included in the Beacon frame.
// The P2P Device Info attribute is included in the probe response frame.
printk("[%s] Got P2P IE\n", __func__);
if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen))
{
// Handle the P2P Device ID attribute of Beacon first
printk("[%s] P2P_ATTR_DEVICE_ID\n", __func__);
if (!memcmp(attr_content, peerMAC, ETH_ALEN))
{
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
break;
}
}
else if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen))
{
// Handle the P2P Device Info attribute of probe response
printk("[%s] P2P_ATTR_DEVICE_INFO\n", __func__);
if (!memcmp(attr_content, peerMAC, ETH_ALEN))
{
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
break;
}
}
}
plist = get_next(plist);
}
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
printk("[%s] channel = %d\n", __func__, uintPeerChannel);
if (uintPeerChannel)
{
u8 wfd_ie[ 128 ] = { 0x00 };
uint wfd_ielen = 0;
if (rtw_get_wfd_ie(&pnetwork->network.IEs[12], pnetwork->network.IELength - 12, wfd_ie, &wfd_ielen))
{
u8 wfd_devinfo[ 6 ] = { 0x00 };
uint wfd_devlen = 6;
DBG_88E("[%s] Found WFD IE!\n", __func__);
if (rtw_get_wfd_attr_content(wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, wfd_devinfo, &wfd_devlen))
{
u16 wfd_devinfo_field = 0;
// Commented by Albert 20120319
// The first two bytes are the WFD device information field of WFD device information subelement.
// In big endian format.
wfd_devinfo_field = RTW_GET_BE16(wfd_devinfo);
if (wfd_devinfo_field & WFD_DEVINFO_PC_TDLS)
{
pwfd_info->wfd_pc = true;
}
else
{
pwfd_info->wfd_pc = false;
}
}
}
}
else
{
DBG_88E("[%s] NOT Found in the Scanning Queue!\n", __func__);
}
exit:
return ret;
}
static int rtw_p2p_set_wfd_device_type(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
int ret = 0;
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
struct iw_point *pdata = &wrqu->data;
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
struct wifi_display_info* pwfd_info = pwdinfo->wfd_info;
// Commented by Albert 20120328
// The input data is 0 or 1
// 0: specify to Miracast source device
// 1 or others: specify to Miracast sink device (display device)
DBG_88E("[%s] data = %s\n", __func__, extra);
if (extra[ 0 ] == '0') // Set to Miracast source device.
{
pwfd_info->wfd_device_type = WFD_DEVINFO_SOURCE;
}
else // Set to Miracast sink device.
{
pwfd_info->wfd_device_type = WFD_DEVINFO_PSINK;
}
exit:
return ret;
}
static int rtw_p2p_set_scan_result_type(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
int ret = 0;
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
struct iw_point *pdata = &wrqu->data;
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
struct wifi_display_info *pwfd_info = pwdinfo->wfd_info;
// Commented by Albert 20120328
// The input data is 0 , 1 , 2
// 0: when the P2P is enabled, the scan result will return all the found P2P device.
// 1: when the P2P is enabled, the scan result will return all the found P2P device and AP.
// 2: when the P2P is enabled, the scan result will show up the found Miracast devices base on...
// It will show up all the Miracast source device if this device is sink.
// It will show up all the Miracast sink device if this device is source.
DBG_88E("[%s] data = %s\n", __func__, extra);
if (extra[ 0 ] == '0')
{
pwfd_info->scan_result_type = SCAN_RESULT_P2P_ONLY;
}
else if (extra[ 0 ] == '1')
{
pwfd_info->scan_result_type = SCAN_RESULT_ALL;
}
else if (extra[ 0 ] == '2')
{
pwfd_info->scan_result_type = SCAN_RESULT_WFD_TYPE;
}
else
{
pwfd_info->scan_result_type = SCAN_RESULT_P2P_ONLY;
}
exit:
return ret;
}
// To set the WFD session available to enable or disable
static int rtw_p2p_set_sa(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
int ret = 0;
_adapter *padapter = (_adapter *)rtw_netdev_priv(dev);
struct iw_point *pdata = &wrqu->data;
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
struct wifi_display_info *pwfd_info = pwdinfo->wfd_info;
DBG_88E("[%s] data = %s\n", __func__, extra);
if (0)
{
DBG_88E("[%s] WiFi Direct is disable!\n", __func__);
return ret;
}
else
{
if (extra[ 0 ] == '0') // Disable the session available.
{
pwdinfo->session_available = false;
}
else if (extra[ 0 ] == '1') // Enable the session available.
{
pwdinfo->session_available = true;
}
else
{
pwdinfo->session_available = false;
}
}
printk("[%s] session available = %d\n", __func__, pwdinfo->session_available);
exit:
return ret;
}
#endif // CONFIG_WFD
static int rtw_p2p_prov_disc(struct net_device *dev, static int rtw_p2p_prov_disc(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
@ -5103,11 +4685,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
u8 *p2pie; u8 *p2pie;
uint p2pielen = 0, attr_contentlen = 0; uint p2pielen = 0, attr_contentlen = 0;
_irqL irqL; _irqL irqL;
#ifdef CONFIG_WFD
struct wifi_display_info* pwfd_info = pwdinfo->wfd_info;
#endif // CONFIG_WFD
// Commented by Albert 20110301
// The input data contains two informations. // The input data contains two informations.
// 1. First information is the MAC address which wants to issue the provisioning discovery request frame. // 1. First information is the MAC address which wants to issue the provisioning discovery request frame.
// 2. Second information is the WPS configuration method which wants to discovery // 2. Second information is the WPS configuration method which wants to discovery
@ -5218,44 +4796,6 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); _exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
#ifdef CONFIG_WFD
{
u8 wfd_ie[ 128 ] = { 0x00 };
uint wfd_ielen = 0;
if (rtw_get_wfd_ie(&pnetwork->network.IEs[12], pnetwork->network.IELength - 12, wfd_ie, &wfd_ielen))
{
u8 wfd_devinfo[ 6 ] = { 0x00 };
uint wfd_devlen = 6;
DBG_88E("[%s] Found WFD IE!\n", __func__);
if (rtw_get_wfd_attr_content(wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, wfd_devinfo, &wfd_devlen))
{
u16 wfd_devinfo_field = 0;
// Commented by Albert 20120319
// The first two bytes are the WFD device information field of WFD device information subelement.
// In big endian format.
wfd_devinfo_field = RTW_GET_BE16(wfd_devinfo);
if (wfd_devinfo_field & WFD_DEVINFO_SESSION_AVAIL)
{
pwfd_info->peer_session_avail = true;
}
else
{
pwfd_info->peer_session_avail = false;
}
}
}
if (false == pwfd_info->peer_session_avail)
{
DBG_88E("[%s] WFD Session not avaiable!\n", __func__);
goto exit;
}
}
#endif // CONFIG_WFD
if (uintPeerChannel) if (uintPeerChannel)
{ {
@ -5293,7 +4833,6 @@ exit:
} }
// Added by Albert 20110328
// This function is used to inform the driver the user had specified the pin code value or pbc // This function is used to inform the driver the user had specified the pin code value or pbc
// to application. // to application.
@ -5425,36 +4964,9 @@ static int rtw_p2p_set(struct net_device *dev,
wrqu->data.length -= 11; wrqu->data.length -= 11;
rtw_p2p_set_persistent(dev, info, wrqu, &extra[11]); rtw_p2p_set_persistent(dev, info, wrqu, &extra[11]);
} }
#ifdef CONFIG_WFD
else if (!memcmp(extra, "sa=", 3))
{
// sa: WFD Session Available information
wrqu->data.length -= 3;
rtw_p2p_set_sa(dev, info, wrqu, &extra[3]);
}
else if (!memcmp(extra, "pc=", 3))
{
// pc: WFD Preferred Connection
wrqu->data.length -= 3;
rtw_p2p_set_pc(dev, info, wrqu, &extra[3]);
}
else if (!memcmp(extra, "wfd_type=", 9))
{
// Specify this device is Mircast source or sink
wrqu->data.length -= 9;
rtw_p2p_set_wfd_device_type(dev, info, wrqu, &extra[9]);
}
else if (!memcmp(extra, "scan_type=", 10))
{
wrqu->data.length -= 10;
rtw_p2p_set_scan_result_type(dev, info, wrqu, &extra[10]);
}
#endif //CONFIG_WFD
#endif //CONFIG_P2P #endif //CONFIG_P2P
return ret; return ret;
} }
static int rtw_p2p_get(struct net_device *dev, static int rtw_p2p_get(struct net_device *dev,
@ -5494,16 +5006,6 @@ static int rtw_p2p_get(struct net_device *dev,
} else if (!memcmp(wrqu->data.pointer, "op_ch", 5)) { } else if (!memcmp(wrqu->data.pointer, "op_ch", 5)) {
rtw_p2p_get_op_ch(dev, info, wrqu, extra); rtw_p2p_get_op_ch(dev, info, wrqu, extra);
} }
#ifdef CONFIG_WFD
else if (!memcmp(wrqu->data.pointer, "peer_port", 9)) {
rtw_p2p_get_peer_wfd_port(dev, info, wrqu, extra);
} else if (!memcmp(wrqu->data.pointer, "wfd_sa", 6)) {
rtw_p2p_get_peer_wfd_session_available(dev, info, wrqu, extra);
} else if (!memcmp(wrqu->data.pointer, "wfd_pc", 6)) {
rtw_p2p_get_peer_wfd_preferred_connection(dev, info, wrqu, extra);
}
#endif // CONFIG_WFD
#endif //CONFIG_P2P #endif //CONFIG_P2P
return ret; return ret;
@ -10019,29 +9521,6 @@ static int rtw_tdls_get(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
#ifdef CONFIG_WFD
DBG_88E("[%s] extra = %s\n", __func__, (char*) wrqu->data.pointer);
if (!memcmp(wrqu->data.pointer, "ip", 2))
{
rtw_tdls_getip(dev, info, wrqu, extra);
}
if (!memcmp(wrqu->data.pointer, "port", 4))
{
rtw_tdls_getport(dev, info, wrqu, extra);
}
//WFDTDLS, for sigma test
if (!memcmp(wrqu->data.pointer, "dis", 3))
{
rtw_tdls_dis_result(dev, info, wrqu, extra);
}
if (!memcmp(wrqu->data.pointer, "status", 6))
{
rtw_wfd_tdls_status(dev, info, wrqu, extra);
}
#endif //CONFIG_WFD
return 0; return 0;
} }

View file

@ -1114,10 +1114,6 @@ _func_enter_;
rtw_init_wifidirect_timers(padapter); rtw_init_wifidirect_timers(padapter);
init_wifidirect_info(padapter, P2P_ROLE_DISABLE); init_wifidirect_info(padapter, P2P_ROLE_DISABLE);
reset_global_wifidirect_info(padapter); reset_global_wifidirect_info(padapter);
#ifdef CONFIG_WFD
if (rtw_init_wifi_display_info(padapter) == _FAIL)
RT_TRACE(_module_os_intfs_c_,_drv_err_,("\n Can't init init_wifi_display_info\n"));
#endif
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
if (init_mlme_ext_priv(padapter) == _FAIL) { if (init_mlme_ext_priv(padapter) == _FAIL) {

View file

@ -456,69 +456,6 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
//int skip = strlen(CMD_P2P_SET_PS) + 1; //int skip = strlen(CMD_P2P_SET_PS) + 1;
//bytes_written = wl_cfg80211_set_p2p_ps(net, command + skip, priv_cmd.total_len - skip); //bytes_written = wl_cfg80211_set_p2p_ps(net, command + skip, priv_cmd.total_len - skip);
break; break;
#ifdef CONFIG_WFD
case ANDROID_WIFI_CMD_WFD_ENABLE:
{
// Commented by Albert 2012/07/24
// We can enable the WFD function by using the following command:
// wpa_cli driver wfd-enable
struct wifi_display_info *pwfd_info;
_adapter* padapter = ( _adapter * ) rtw_netdev_priv(net);
pwfd_info = &padapter->wfd_info;
pwfd_info->wfd_enable = true;
break;
}
case ANDROID_WIFI_CMD_WFD_DISABLE:
{
// Commented by Albert 2012/07/24
// We can disable the WFD function by using the following command:
// wpa_cli driver wfd-disable
struct wifi_display_info *pwfd_info;
_adapter* padapter = ( _adapter * ) rtw_netdev_priv(net);
pwfd_info = &padapter->wfd_info;
pwfd_info->wfd_enable = false;
break;
}
case ANDROID_WIFI_CMD_WFD_SET_TCPPORT:
{
// Commented by Albert 2012/07/24
// We can set the tcp port number by using the following command:
// wpa_cli driver wfd-set-tcpport = 554
struct wifi_display_info *pwfd_info;
_adapter* padapter = ( _adapter * ) rtw_netdev_priv(net);
pwfd_info = &padapter->wfd_info;
pwfd_info->rtsp_ctrlport = ( u16 ) get_int_from_command( priv_cmd.buf );
break;
}
case ANDROID_WIFI_CMD_WFD_SET_MAX_TPUT:
{
break;
}
case ANDROID_WIFI_CMD_WFD_SET_DEVTYPE:
{
// Commented by Albert 2012/08/28
// Specify the WFD device type ( WFD source/primary sink )
struct wifi_display_info *pwfd_info;
_adapter* padapter = ( _adapter * ) rtw_netdev_priv(net);
pwfd_info = &padapter->wfd_info;
pwfd_info->wfd_device_type = ( u8 ) get_int_from_command( priv_cmd.buf );
pwfd_info->wfd_device_type &= WFD_DEVINFO_DUAL;
break;
}
#endif
default: default:
DBG_88E("Unknown PRIVATE command %s - ignored\n", command); DBG_88E("Unknown PRIVATE command %s - ignored\n", command);
snprintf(command, 3, "OK"); snprintf(command, 3, "OK");