diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 7da7cdb..7e6610c 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -1558,116 +1558,6 @@ void rtw_WLAN_BSSID_EX_remove_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id) #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 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 */ int ieee80211_is_empty_essid(const char *essid, int essid_len) { diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index ef604a1..8de16fb 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -1276,10 +1276,6 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) u8 p2p_status_code = P2P_STATUS_SUCCESS; u8 *p2pie; u32 p2pielen = 0; -#ifdef CONFIG_WFD - u8 wfd_ie[ 128 ] = { 0x00 }; - u32 wfd_ielen = 0; -#endif /* CONFIG_WFD */ #endif /* CONFIG_P2P */ if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE) @@ -1683,21 +1679,6 @@ unsigned int OnAssocReq(_adapter *padapter, union recv_frame *precv_frame) 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; #endif /* CONFIG_P2P */ @@ -1864,12 +1845,6 @@ unsigned int OnAssocRsp(_adapter *padapter, union recv_frame *precv_frame) case _VENDOR_SPECIFIC_IE_: if (_rtw_memcmp(pIE->data, WMM_PARA_OUI, 6)) /* WMM */ 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; case _HT_CAPABILITY_IE_: /* HT caps */ 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 channel_cnt_24g = 0, channel_cnt_5gl = 0, channel_cnt_5gh = 0; u16 len_channellist_attr = 0; -#ifdef CONFIG_WFD - u32 wfdielen = 0; -#endif /* CONFIG_WFD */ - struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; 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 ); -#ifdef CONFIG_WFD - wfdielen = build_nego_req_wfd_ie(pwdinfo, pframe); - pframe += wfdielen; - pattrib->pktlen += wfdielen; -#endif /* CONFIG_WFD */ - pattrib->last_txcmdsz = pattrib->pktlen; dump_mgntframe(padapter, pmgntframe); return; - } - 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 wifidirect_info *pwdinfo = &( padapter->wdinfo); -#ifdef CONFIG_WFD - u32 wfdielen = 0; -#endif /* CONFIG_WFD */ - if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { 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 ); -#ifdef CONFIG_WFD - wfdielen = build_nego_resp_wfd_ie(pwdinfo, pframe); - pframe += wfdielen; - pattrib->pktlen += wfdielen; -#endif /* CONFIG_WFD */ - pattrib->last_txcmdsz = pattrib->pktlen; 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_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct wifidirect_info *pwdinfo = &( padapter->wdinfo); -#ifdef CONFIG_WFD - u32 wfdielen = 0; -#endif /* CONFIG_WFD */ 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 ); -#ifdef CONFIG_WFD - wfdielen = build_nego_confirm_wfd_ie(pwdinfo, pframe); - pframe += wfdielen; - pattrib->pktlen += wfdielen; -#endif /* CONFIG_WFD */ - pattrib->last_txcmdsz = pattrib->pktlen; dump_mgntframe(padapter, pmgntframe); @@ -3356,10 +3300,6 @@ void issue_p2p_invitation_request(_adapter *padapter, u8* raddr ) u8 dialogToken = 3; u8 channel_cnt_24g = 0, channel_cnt_5gl = 0, channel_cnt_5gh = 0; u16 len_channellist_attr = 0; -#ifdef CONFIG_WFD - u32 wfdielen = 0; -#endif /* CONFIG_WFD */ - struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; 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 ); -#ifdef CONFIG_WFD - wfdielen = build_invitation_req_wfd_ie(pwdinfo, pframe); - pframe += wfdielen; - pattrib->pktlen += wfdielen; -#endif /* CONFIG_WFD */ - pattrib->last_txcmdsz = pattrib->pktlen; dump_mgntframe(padapter, pmgntframe); @@ -3630,10 +3564,6 @@ void issue_p2p_invitation_response(_adapter *padapter, u8* raddr, u8 dialogToken u8 p2pielen = 0, i; u8 channel_cnt_24g = 0, channel_cnt_5gl = 0, channel_cnt_5gh = 0; u16 len_channellist_attr = 0; -#ifdef CONFIG_WFD - u32 wfdielen = 0; -#endif /* CONFIG_WFD */ - struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; 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 ); -#ifdef CONFIG_WFD - wfdielen = build_invitation_resp_wfd_ie(pwdinfo, pframe); - pframe += wfdielen; - pattrib->pktlen += wfdielen; -#endif /* CONFIG_WFD */ - pattrib->last_txcmdsz = pattrib->pktlen; dump_mgntframe(padapter, pmgntframe); return; - } 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 wpsielen = 0; u32 p2pielen = 0; -#ifdef CONFIG_WFD - u32 wfdielen = 0; -#endif /* CONFIG_WFD */ - struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; 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 ); - -#ifdef CONFIG_WFD - wfdielen = build_provdisc_req_wfd_ie(pwdinfo, pframe); - pframe += wfdielen; - pattrib->pktlen += wfdielen; -#endif /* CONFIG_WFD */ - pattrib->last_txcmdsz = pattrib->pktlen; dump_mgntframe(padapter, pmgntframe); return; - } - static u8 is_matched_in_profilelist( u8* peermacaddr, struct profile_info* profileinfo ) { u8 i, match_result = 0; @@ -3984,9 +3894,6 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) struct wifidirect_info *pwdinfo = &(padapter->wdinfo); u8 wpsie[255] = { 0x00 }; u32 wpsielen = 0, p2pielen = 0; -#ifdef CONFIG_WFD - u32 wfdielen = 0; -#endif /* CONFIG_WFD */ if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) return; @@ -4217,12 +4124,6 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) pframe += 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; 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); u8 wpsie[255] = { 0x00 }, p2pie[ 255 ] = { 0x00 }; u16 wpsielen = 0, p2pielen = 0; -#ifdef CONFIG_WFD - u32 wfdielen = 0; -#endif /* CONFIG_WFD */ - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) { 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; } -#ifdef CONFIG_WFD - wfdielen = build_probe_req_wfd_ie(pwdinfo, pframe); - pframe += wfdielen; - pattrib->pktlen += wfdielen; -#endif /* CONFIG_WFD */ - pattrib->last_txcmdsz = pattrib->pktlen; 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; pattrib->pktlen += len; -#ifdef CONFIG_WFD - len = build_beacon_wfd_ie( pwdinfo, pframe ); - pframe += len; - pattrib->pktlen += len; -#endif /* CONFIG_WFD */ } #endif /* CONFIG_P2P */ @@ -5595,9 +5480,6 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe unsigned int rate_len; #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo = &(padapter->wdinfo); -#ifdef CONFIG_WFD - u32 wfdielen = 0; -#endif /* CONFIG_WFD */ #endif /* CONFIG_P2P */ /* DBG_88E("%s\n", __func__); */ @@ -5751,23 +5633,14 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe pframe += 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 */ - pattrib->last_txcmdsz = pattrib->pktlen; - dump_mgntframe(padapter, pmgntframe); return; - } 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; #ifdef CONFIG_P2P struct wifidirect_info *pwdinfo = &(padapter->wdinfo); -#ifdef CONFIG_WFD - u32 wfdielen = 0; -#endif /* CONFIG_WFD */ - #endif /* CONFIG_P2P */ DBG_88E("%s\n", __func__); @@ -6202,13 +6071,6 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p pframe += 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 */ pattrib->last_txcmdsz = pattrib->pktlen; dump_mgntframe(padapter, pmgntframe); @@ -6238,9 +6100,6 @@ void issue_assocreq(_adapter *padapter) struct wifidirect_info *pwdinfo = &(padapter->wdinfo); u8 p2pie[ 255 ] = { 0x00 }; u16 p2pielen = 0; -#ifdef CONFIG_WFD - u32 wfdielen = 0; -#endif /* CONFIG_WFD */ #endif /* CONFIG_P2P */ #ifdef CONFIG_DFS @@ -6573,12 +6432,6 @@ void issue_assocreq(_adapter *padapter) #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; dump_mgntframe(padapter, pmgntframe); diff --git a/core/rtw_p2p.c b/core/rtw_p2p.c index 8274359..b300c08 100644 --- a/core/rtw_p2p.c +++ b/core/rtw_p2p.c @@ -317,10 +317,6 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8* raddr, u8 oui_subtype = P2P_PROVISION_DISC_RESP; u8 wpsie[ 100 ] = { 0x00 }; u8 wpsielen = 0; -#ifdef CONFIG_WFD - u32 wfdielen = 0; -#endif /* CONFIG_WFD */ - struct xmit_frame *pmgntframe; struct pkt_attrib *pattrib; unsigned char *pframe; @@ -330,11 +326,8 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8* raddr, struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) - { return; - } /* update attribute */ pattrib = &pmgntframe->attrib; @@ -385,18 +378,11 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8* raddr, pframe = rtw_set_ie(pframe, _VENDOR_SPECIFIC_IE_, wpsielen, (unsigned char *) wpsie, &pattrib->pktlen ); -#ifdef CONFIG_WFD - wfdielen = build_provdisc_resp_wfd_ie(pwdinfo, pframe); - pframe += wfdielen; - pattrib->pktlen += wfdielen; -#endif /* CONFIG_WFD */ - pattrib->last_txcmdsz = pattrib->pktlen; dump_mgntframe(padapter, pmgntframe); return; - } static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 status, u8 dialogToken) @@ -531,1337 +517,6 @@ u32 build_beacon_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) return len; } -#ifdef CONFIG_WFD -u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) -{ - u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; - _adapter *padapter = pwdinfo->padapter; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - - /* WFD OUI */ - wfdielen = 0; - wfdie[ wfdielen++ ] = 0x50; - wfdie[ wfdielen++ ] = 0x6F; - wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - - /* Commented by Albert 20110812 */ - /* According to the WFD Specification, the beacon frame should contain 4 WFD attributes */ - /* 1. WFD Device Information */ - /* 2. Associated BSSID */ - /* 3. Coupled Sink Information */ - - - /* WFD Device Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value1: */ - /* WFD device information */ - - if ( P2P_ROLE_GO == pwdinfo->role ) - { - if ( is_any_client_associated( pwdinfo->padapter ) ) - { - /* WFD primary sink + WiFi Direct mode + WSD (WFD Service Discovery) */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_WSD ); - } - else - { - /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD (WFD Service Discovery) */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); - } - - } - else - { - /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); - } - - wfdielen += 2; - - /* Value2: */ - /* Session Management Control Port */ - /* Default TCP port for RTSP messages is 554 */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); - wfdielen += 2; - - /* Value3: */ - /* WFD Device Maximum Throughput */ - /* 300Mbps is the maximum throughput */ - RTW_PUT_BE16(wfdie + wfdielen, 300); - wfdielen += 2; - - /* Associated BSSID ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value: */ - /* Associated BSSID */ - if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) - { - _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); - } - else - { - _rtw_memset( wfdie + wfdielen, 0x00, ETH_ALEN ); - } - - wfdielen += ETH_ALEN; - - /* Coupled Sink Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0007); - wfdielen += 2; - - /* Value: */ - /* Coupled Sink Status bitmap */ - /* Not coupled/available for Coupling */ - wfdie[ wfdielen++ ] = 0; - /* MAC Addr. */ - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); - - return len; - -} - -u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) -{ - u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; - _adapter *padapter = pwdinfo->padapter; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - - /* WFD OUI */ - wfdielen = 0; - wfdie[ wfdielen++ ] = 0x50; - wfdie[ wfdielen++ ] = 0x6F; - wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - - /* Commented by Albert 20110812 */ - /* According to the WFD Specification, the probe request frame should contain 4 WFD attributes */ - /* 1. WFD Device Information */ - /* 2. Associated BSSID */ - /* 3. Coupled Sink Information */ - - - /* WFD Device Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value1: */ - /* WFD device information */ - - if ( 1 == pwdinfo->wfd_tdls_enable ) - { - /* WFD primary sink + available for WFD session + WiFi TDLS mode + WSC ( WFD Service Discovery ) */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | - WFD_DEVINFO_SESSION_AVAIL | - WFD_DEVINFO_WSD | - WFD_DEVINFO_PC_TDLS ); - } - else - { - /* WFD primary sink + available for WFD session + WiFi Direct mode + WSC ( WFD Service Discovery ) */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | - WFD_DEVINFO_SESSION_AVAIL | - WFD_DEVINFO_WSD ); - } - - wfdielen += 2; - - /* Value2: */ - /* Session Management Control Port */ - /* Default TCP port for RTSP messages is 554 */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); - wfdielen += 2; - - /* Value3: */ - /* WFD Device Maximum Throughput */ - /* 300Mbps is the maximum throughput */ - RTW_PUT_BE16(wfdie + wfdielen, 300); - wfdielen += 2; - - /* Associated BSSID ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value: */ - /* Associated BSSID */ - if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) - { - _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); - } - else - { - _rtw_memset( wfdie + wfdielen, 0x00, ETH_ALEN ); - } - - wfdielen += ETH_ALEN; - - /* Coupled Sink Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0007); - wfdielen += 2; - - /* Value: */ - /* Coupled Sink Status bitmap */ - /* Not coupled/available for Coupling */ - wfdie[ wfdielen++ ] = 0; - /* MAC Addr. */ - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); - - return len; - -} - -u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunneled) -{ - u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; - _adapter *padapter = pwdinfo->padapter; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - - /* WFD OUI */ - wfdielen = 0; - wfdie[ wfdielen++ ] = 0x50; - wfdie[ wfdielen++ ] = 0x6F; - wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - - /* Commented by Albert 20110812 */ - /* According to the WFD Specification, the probe response frame should contain 4 WFD attributes */ - /* 1. WFD Device Information */ - /* 2. Associated BSSID */ - /* 3. Coupled Sink Information */ - /* 4. WFD Session Information */ - - - /* WFD Device Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value1: */ - /* WFD device information */ - /* WFD primary sink + available for WFD session + WiFi Direct mode */ - - if ( true == pwdinfo->session_available ) - { - if ( P2P_ROLE_GO == pwdinfo->role ) - { - if ( is_any_client_associated( pwdinfo->padapter ) ) - { - if ( pwdinfo->wfd_tdls_enable ) - { - /* WFD primary sink + TDLS mode + WSD ( WFD Service Discovery ) */ - RTW_PUT_BE16(wfdie + wfdielen, WFD_DEVINFO_PSINK | WFD_DEVINFO_WSD | WFD_DEVINFO_PC_TDLS | WFD_DEVINFO_HDCP_SUPPORT); - } - else - { - /* WFD primary sink + WiFi Direct mode + WSD ( WFD Service Discovery ) */ - RTW_PUT_BE16(wfdie + wfdielen, WFD_DEVINFO_PSINK | WFD_DEVINFO_WSD | WFD_DEVINFO_HDCP_SUPPORT); - } - } - else - { - if ( pwdinfo->wfd_tdls_enable ) - { - /* WFD primary sink + available for WFD session + TDLS mode + WSD ( WFD Service Discovery ) */ - RTW_PUT_BE16(wfdie + wfdielen, WFD_DEVINFO_PSINK | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD | WFD_DEVINFO_PC_TDLS | WFD_DEVINFO_HDCP_SUPPORT); - } - else - { - /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ - RTW_PUT_BE16(wfdie + wfdielen, WFD_DEVINFO_PSINK | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD | WFD_DEVINFO_HDCP_SUPPORT); - } - } - } - else - { - if ( pwdinfo->wfd_tdls_enable ) - { - /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ - RTW_PUT_BE16(wfdie + wfdielen, WFD_DEVINFO_PSINK | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD | WFD_DEVINFO_PC_TDLS | WFD_DEVINFO_HDCP_SUPPORT); - } - else - { - - /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ - RTW_PUT_BE16(wfdie + wfdielen, WFD_DEVINFO_PSINK | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD | WFD_DEVINFO_HDCP_SUPPORT); - } - } - } - else - { - if ( pwdinfo->wfd_tdls_enable ) - { - RTW_PUT_BE16(wfdie + wfdielen, WFD_DEVINFO_PSINK | WFD_DEVINFO_WSD |WFD_DEVINFO_PC_TDLS | WFD_DEVINFO_HDCP_SUPPORT); - } - else - { - RTW_PUT_BE16(wfdie + wfdielen, WFD_DEVINFO_PSINK | WFD_DEVINFO_WSD | WFD_DEVINFO_HDCP_SUPPORT); - } - - } - - wfdielen += 2; - - /* Value2: */ - /* Session Management Control Port */ - /* Default TCP port for RTSP messages is 554 */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); - wfdielen += 2; - - /* Value3: */ - /* WFD Device Maximum Throughput */ - /* 300Mbps is the maximum throughput */ - RTW_PUT_BE16(wfdie + wfdielen, 300); - wfdielen += 2; - - /* Associated BSSID ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value: */ - /* Associated BSSID */ - if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) - { - _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); - } - else - { - _rtw_memset( wfdie + wfdielen, 0x00, ETH_ALEN ); - } - - wfdielen += ETH_ALEN; - - /* Coupled Sink Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0007); - wfdielen += 2; - - /* Value: */ - /* Coupled Sink Status bitmap */ - /* Not coupled/available for Coupling */ - wfdie[ wfdielen++ ] = 0; - /* MAC Addr. */ - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - - if (rtw_p2p_chk_role(pwdinfo, P2P_ROLE_GO)) - { - /* WFD Session Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_SESSION_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0000); - wfdielen += 2; - - /* Todo: to add the list of WFD device info descriptor in WFD group. */ - - } - - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); - - return len; - -} - -u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) -{ - u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; - _adapter *padapter = NULL; - struct mlme_priv *pmlmepriv = NULL; - struct wifi_display_info *pwfd_info = NULL; - - /* WFD OUI */ - if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE)) - { - return 0; - } - - padapter = pwdinfo->padapter; - pmlmepriv = &padapter->mlmepriv; - pwfd_info = padapter->wdinfo.wfd_info; - - wfdielen = 0; - wfdie[ wfdielen++ ] = 0x50; - wfdie[ wfdielen++ ] = 0x6F; - wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - - /* Commented by Albert 20110812 */ - /* According to the WFD Specification, the probe request frame should contain 4 WFD attributes */ - /* 1. WFD Device Information */ - /* 2. Associated BSSID */ - /* 3. Coupled Sink Information */ - - - /* WFD Device Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value1: */ - /* WFD device information */ - /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); - wfdielen += 2; - - /* Value2: */ - /* Session Management Control Port */ - /* Default TCP port for RTSP messages is 554 */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); - wfdielen += 2; - - /* Value3: */ - /* WFD Device Maximum Throughput */ - /* 300Mbps is the maximum throughput */ - RTW_PUT_BE16(wfdie + wfdielen, 300); - wfdielen += 2; - - /* Associated BSSID ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value: */ - /* Associated BSSID */ - if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) - { - _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); - } - else - { - _rtw_memset( wfdie + wfdielen, 0x00, ETH_ALEN ); - } - - wfdielen += ETH_ALEN; - - /* Coupled Sink Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0007); - wfdielen += 2; - - /* Value: */ - /* Coupled Sink Status bitmap */ - /* Not coupled/available for Coupling */ - wfdie[ wfdielen++ ] = 0; - /* MAC Addr. */ - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); - - return len; - -} - -u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) -{ - u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; - _adapter *padapter = pwdinfo->padapter; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - - /* WFD OUI */ - wfdielen = 0; - wfdie[ wfdielen++ ] = 0x50; - wfdie[ wfdielen++ ] = 0x6F; - wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - - /* Commented by Albert 20110812 */ - /* According to the WFD Specification, the probe request frame should contain 4 WFD attributes */ - /* 1. WFD Device Information */ - /* 2. Associated BSSID */ - /* 3. Coupled Sink Information */ - - - /* WFD Device Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value1: */ - /* WFD device information */ - /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); - wfdielen += 2; - - /* Value2: */ - /* Session Management Control Port */ - /* Default TCP port for RTSP messages is 554 */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); - wfdielen += 2; - - /* Value3: */ - /* WFD Device Maximum Throughput */ - /* 300Mbps is the maximum throughput */ - RTW_PUT_BE16(wfdie + wfdielen, 300); - wfdielen += 2; - - /* Associated BSSID ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value: */ - /* Associated BSSID */ - if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) - { - _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); - } - else - { - _rtw_memset( wfdie + wfdielen, 0x00, ETH_ALEN ); - } - - wfdielen += ETH_ALEN; - - /* Coupled Sink Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0007); - wfdielen += 2; - - /* Value: */ - /* Coupled Sink Status bitmap */ - /* Not coupled/available for Coupling */ - wfdie[ wfdielen++ ] = 0; - /* MAC Addr. */ - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); - - return len; - -} - -u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) -{ - u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; - _adapter *padapter = pwdinfo->padapter; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - - /* WFD OUI */ - wfdielen = 0; - wfdie[ wfdielen++ ] = 0x50; - wfdie[ wfdielen++ ] = 0x6F; - wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - - /* Commented by Albert 20110825 */ - /* According to the WFD Specification, the negotiation request frame should contain 3 WFD attributes */ - /* 1. WFD Device Information */ - /* 2. Associated BSSID ( Optional ) */ - /* 3. Local IP Adress ( Optional ) */ - - - /* WFD Device Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value1: */ - /* WFD device information */ - /* WFD primary sink + WiFi Direct mode + WSD ( WFD Service Discovery ) + WFD Session Available */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_WSD | WFD_DEVINFO_SESSION_AVAIL); - wfdielen += 2; - - /* Value2: */ - /* Session Management Control Port */ - /* Default TCP port for RTSP messages is 554 */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); - wfdielen += 2; - - /* Value3: */ - /* WFD Device Maximum Throughput */ - /* 300Mbps is the maximum throughput */ - RTW_PUT_BE16(wfdie + wfdielen, 300); - wfdielen += 2; - - /* Associated BSSID ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value: */ - /* Associated BSSID */ - if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) - { - _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); - } - else - { - _rtw_memset( wfdie + wfdielen, 0x00, ETH_ALEN ); - } - - wfdielen += ETH_ALEN; - - /* Coupled Sink Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0007); - wfdielen += 2; - - /* Value: */ - /* Coupled Sink Status bitmap */ - /* Not coupled/available for Coupling */ - wfdie[ wfdielen++ ] = 0; - /* MAC Addr. */ - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); - - return len; - -} - -u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) -{ - u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; - _adapter *padapter = pwdinfo->padapter; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - - /* WFD OUI */ - wfdielen = 0; - wfdie[ wfdielen++ ] = 0x50; - wfdie[ wfdielen++ ] = 0x6F; - wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - - /* Commented by Albert 20110825 */ - /* According to the WFD Specification, the negotiation request frame should contain 3 WFD attributes */ - /* 1. WFD Device Information */ - /* 2. Associated BSSID ( Optional ) */ - /* 3. Local IP Adress ( Optional ) */ - - - /* WFD Device Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value1: */ - /* WFD device information */ - /* WFD primary sink + WiFi Direct mode + WSD ( WFD Service Discovery ) + WFD Session Available */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_WSD | WFD_DEVINFO_SESSION_AVAIL); - wfdielen += 2; - - /* Value2: */ - /* Session Management Control Port */ - /* Default TCP port for RTSP messages is 554 */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); - wfdielen += 2; - - /* Value3: */ - /* WFD Device Maximum Throughput */ - /* 300Mbps is the maximum throughput */ - RTW_PUT_BE16(wfdie + wfdielen, 300); - wfdielen += 2; - - /* Associated BSSID ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value: */ - /* Associated BSSID */ - if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) - { - _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); - } - else - { - _rtw_memset( wfdie + wfdielen, 0x00, ETH_ALEN ); - } - - wfdielen += ETH_ALEN; - - /* Coupled Sink Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0007); - wfdielen += 2; - - /* Value: */ - /* Coupled Sink Status bitmap */ - /* Not coupled/available for Coupling */ - wfdie[ wfdielen++ ] = 0; - /* MAC Addr. */ - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - - - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); - - return len; - -} - -u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) -{ - u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; - _adapter *padapter = pwdinfo->padapter; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - - /* WFD OUI */ - wfdielen = 0; - wfdie[ wfdielen++ ] = 0x50; - wfdie[ wfdielen++ ] = 0x6F; - wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - - /* Commented by Albert 20110825 */ - /* According to the WFD Specification, the negotiation request frame should contain 3 WFD attributes */ - /* 1. WFD Device Information */ - /* 2. Associated BSSID ( Optional ) */ - /* 3. Local IP Adress ( Optional ) */ - - - /* WFD Device Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value1: */ - /* WFD device information */ - /* WFD primary sink + WiFi Direct mode + WSD ( WFD Service Discovery ) + WFD Session Available */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_WSD | WFD_DEVINFO_SESSION_AVAIL); - wfdielen += 2; - - /* Value2: */ - /* Session Management Control Port */ - /* Default TCP port for RTSP messages is 554 */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); - wfdielen += 2; - - /* Value3: */ - /* WFD Device Maximum Throughput */ - /* 300Mbps is the maximum throughput */ - RTW_PUT_BE16(wfdie + wfdielen, 300); - wfdielen += 2; - - /* Associated BSSID ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value: */ - /* Associated BSSID */ - if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) - { - _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); - } - else - { - _rtw_memset( wfdie + wfdielen, 0x00, ETH_ALEN ); - } - - wfdielen += ETH_ALEN; - - /* Coupled Sink Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0007); - wfdielen += 2; - - /* Value: */ - /* Coupled Sink Status bitmap */ - /* Not coupled/available for Coupling */ - wfdie[ wfdielen++ ] = 0; - /* MAC Addr. */ - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - - - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); - - return len; - -} - -u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) -{ - u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; - _adapter *padapter = pwdinfo->padapter; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - - /* WFD OUI */ - wfdielen = 0; - wfdie[ wfdielen++ ] = 0x50; - wfdie[ wfdielen++ ] = 0x6F; - wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - - /* Commented by Albert 20110825 */ - /* According to the WFD Specification, the provision discovery request frame should contain 3 WFD attributes */ - /* 1. WFD Device Information */ - /* 2. Associated BSSID ( Optional ) */ - /* 3. Local IP Adress ( Optional ) */ - - - /* WFD Device Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value1: */ - /* WFD device information */ - /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); - wfdielen += 2; - - /* Value2: */ - /* Session Management Control Port */ - /* Default TCP port for RTSP messages is 554 */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); - wfdielen += 2; - - /* Value3: */ - /* WFD Device Maximum Throughput */ - /* 300Mbps is the maximum throughput */ - RTW_PUT_BE16(wfdie + wfdielen, 300); - wfdielen += 2; - - /* Associated BSSID ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value: */ - /* Associated BSSID */ - if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) - { - _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); - } - else - { - _rtw_memset( wfdie + wfdielen, 0x00, ETH_ALEN ); - } - - wfdielen += ETH_ALEN; - - /* Coupled Sink Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0007); - wfdielen += 2; - - /* Value: */ - /* Coupled Sink Status bitmap */ - /* Not coupled/available for Coupling */ - wfdie[ wfdielen++ ] = 0; - /* MAC Addr. */ - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - - if ( P2P_ROLE_GO == pwdinfo->role ) - { - /* WFD Session Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_SESSION_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0000); - wfdielen += 2; - - /* Todo: to add the list of WFD device info descriptor in WFD group. */ - - } - - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); - - return len; - -} - -u32 build_invitation_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) -{ - u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; - _adapter *padapter = pwdinfo->padapter; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - - /* WFD OUI */ - wfdielen = 0; - wfdie[ wfdielen++ ] = 0x50; - wfdie[ wfdielen++ ] = 0x6F; - wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - - /* Commented by Albert 20110825 */ - /* According to the WFD Specification, the provision discovery request frame should contain 3 WFD attributes */ - /* 1. WFD Device Information */ - /* 2. Associated BSSID ( Optional ) */ - /* 3. Local IP Adress ( Optional ) */ - - - /* WFD Device Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value1: */ - /* WFD device information */ - /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); - wfdielen += 2; - - /* Value2: */ - /* Session Management Control Port */ - /* Default TCP port for RTSP messages is 554 */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); - wfdielen += 2; - - /* Value3: */ - /* WFD Device Maximum Throughput */ - /* 300Mbps is the maximum throughput */ - RTW_PUT_BE16(wfdie + wfdielen, 300); - wfdielen += 2; - - /* Associated BSSID ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value: */ - /* Associated BSSID */ - if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) - { - _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); - } - else - { - _rtw_memset( wfdie + wfdielen, 0x00, ETH_ALEN ); - } - - wfdielen += ETH_ALEN; - - /* Coupled Sink Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0007); - wfdielen += 2; - - /* Value: */ - /* Coupled Sink Status bitmap */ - /* Not coupled/available for Coupling */ - wfdie[ wfdielen++ ] = 0; - /* MAC Addr. */ - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - - if ( P2P_ROLE_GO == pwdinfo->role ) - { - /* WFD Session Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_SESSION_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0000); - wfdielen += 2; - - /* Todo: to add the list of WFD device info descriptor in WFD group. */ - - } - - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); - - return len; - -} - -u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) -{ - u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; - _adapter *padapter = pwdinfo->padapter; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - - /* WFD OUI */ - wfdielen = 0; - wfdie[ wfdielen++ ] = 0x50; - wfdie[ wfdielen++ ] = 0x6F; - wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - - /* Commented by Albert 20110825 */ - /* According to the WFD Specification, the provision discovery request frame should contain 3 WFD attributes */ - /* 1. WFD Device Information */ - /* 2. Associated BSSID ( Optional ) */ - /* 3. Local IP Adress ( Optional ) */ - - - /* WFD Device Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value1: */ - /* WFD device information */ - /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); - wfdielen += 2; - - /* Value2: */ - /* Session Management Control Port */ - /* Default TCP port for RTSP messages is 554 */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); - wfdielen += 2; - - /* Value3: */ - /* WFD Device Maximum Throughput */ - /* 300Mbps is the maximum throughput */ - RTW_PUT_BE16(wfdie + wfdielen, 300); - wfdielen += 2; - - /* Associated BSSID ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value: */ - /* Associated BSSID */ - if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) - { - _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); - } - else - { - _rtw_memset( wfdie + wfdielen, 0x00, ETH_ALEN ); - } - - wfdielen += ETH_ALEN; - - /* Coupled Sink Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0007); - wfdielen += 2; - - /* Value: */ - /* Coupled Sink Status bitmap */ - /* Not coupled/available for Coupling */ - wfdie[ wfdielen++ ] = 0; - /* MAC Addr. */ - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - - - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); - - return len; - -} - -u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) -{ - u8 wfdie[ MAX_WFD_IE_LEN] = { 0x00 }; - u32 len=0, wfdielen = 0; - _adapter *padapter = pwdinfo->padapter; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info; - - /* WFD OUI */ - wfdielen = 0; - wfdie[ wfdielen++ ] = 0x50; - wfdie[ wfdielen++ ] = 0x6F; - wfdie[ wfdielen++ ] = 0x9A; - wfdie[ wfdielen++ ] = 0x0A; /* WFA WFD v1.0 */ - - /* Commented by Albert 20110825 */ - /* According to the WFD Specification, the provision discovery response frame should contain 3 WFD attributes */ - /* 1. WFD Device Information */ - /* 2. Associated BSSID ( Optional ) */ - /* 3. Local IP Adress ( Optional ) */ - - - /* WFD Device Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_DEVICE_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value1: */ - /* WFD device information */ - /* WFD primary sink + available for WFD session + WiFi Direct mode + WSD ( WFD Service Discovery ) */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->wfd_device_type | WFD_DEVINFO_SESSION_AVAIL | WFD_DEVINFO_WSD ); - wfdielen += 2; - - /* Value2: */ - /* Session Management Control Port */ - /* Default TCP port for RTSP messages is 554 */ - RTW_PUT_BE16(wfdie + wfdielen, pwfd_info->rtsp_ctrlport ); - wfdielen += 2; - - /* Value3: */ - /* WFD Device Maximum Throughput */ - /* 300Mbps is the maximum throughput */ - RTW_PUT_BE16(wfdie + wfdielen, 300); - wfdielen += 2; - - /* Associated BSSID ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_ASSOC_BSSID; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0006); - wfdielen += 2; - - /* Value: */ - /* Associated BSSID */ - if ( check_fwstate(pmlmepriv, _FW_LINKED) == true ) - { - _rtw_memcpy( wfdie + wfdielen, &pmlmepriv->assoc_bssid[ 0 ], ETH_ALEN ); - } - else - { - _rtw_memset( wfdie + wfdielen, 0x00, ETH_ALEN ); - } - - wfdielen += ETH_ALEN; - - /* Coupled Sink Information ATTR */ - /* Type: */ - wfdie[ wfdielen++ ] = WFD_ATTR_COUPLED_SINK_INFO; - - /* Length: */ - /* Note: In the WFD specification, the size of length field is 2. */ - RTW_PUT_BE16(wfdie + wfdielen, 0x0007); - wfdielen += 2; - - /* Value: */ - /* Coupled Sink Status bitmap */ - /* Not coupled/available for Coupling */ - wfdie[ wfdielen++ ] = 0; - /* MAC Addr. */ - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - wfdie[ wfdielen++ ] = 0; - - pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len); - - return len; - -} - - -#endif /* CONFIG_WFD */ - u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) { u8 p2pie[ MAX_P2P_IE_LEN] = { 0x00 }; @@ -2581,10 +1236,6 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe u16 wps_devicepassword_id = 0x0000; uint wps_devicepassword_id_len = 0; __be16 be_tmp; -#ifdef CONFIG_WFD - u8 wfd_ie[ 128 ] = { 0x00 }; - u32 wfd_ielen = 0; -#endif /* CONFIG_WFD */ if ( (wpsie=rtw_get_wps_ie( pframe + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &wps_ielen)) ) { @@ -2736,25 +1387,6 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe /* Get the next P2P IE */ p2p_ie = rtw_get_p2p_ie(p2p_ie+p2p_ielen, ies_len -(p2p_ie -ies + p2p_ielen), NULL, &p2p_ielen); } - -#ifdef CONFIG_WFD - /* Added by Albert 20110823 */ - /* Try to get the TCP port information when receiving the negotiation request. */ - if ( rtw_get_wfd_ie( pframe + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_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 /* CONFIG_WFD */ - return( result ); } @@ -2766,10 +1398,6 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram u8 * ies; u32 ies_len; u8 * p2p_ie; -#ifdef CONFIG_WFD - u8 wfd_ie[ 128 ] = { 0x00 }; - u32 wfd_ielen = 0; -#endif /* CONFIG_WFD */ ies = pframe + _PUBLIC_ACTION_IE_OFFSET_; ies_len = len - _PUBLIC_ACTION_IE_OFFSET_; @@ -2967,27 +1595,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram } } - -#ifdef CONFIG_WFD - /* Added by Albert 20111122 */ - /* Try to get the TCP port information when receiving the negotiation response. */ - if ( rtw_get_wfd_ie( pframe + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_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 /* CONFIG_WFD */ - return( result ); - } u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pframe, uint len ) @@ -3533,31 +2141,6 @@ void reset_global_wifidirect_info( _adapter* padapter ) pwdinfo->wfd_tdls_weaksec = 0; } -#ifdef CONFIG_WFD -int rtw_init_wifi_display_info(_adapter* padapter) -{ - int res = _SUCCESS; - struct wifi_display_info *pwfd_info = &padapter->wfd_info; - - /* Used in P2P and TDLS */ - pwfd_info->rtsp_ctrlport = 554; - pwfd_info->peer_rtsp_ctrlport = 0; /* Reset to 0 */ - pwfd_info->wfd_enable = false; - pwfd_info->wfd_device_type = WFD_DEVINFO_PSINK; - pwfd_info->scan_result_type = SCAN_RESULT_P2P_ONLY; - - /* Used in P2P */ - pwfd_info->peer_session_avail = true; - pwfd_info->wfd_pc = false; - - /* Used in TDLS */ - _rtw_memset( pwfd_info->ip_address, 0x00, 4 ); - _rtw_memset( pwfd_info->peer_ip_address, 0x00, 4 ); - return res; - -} -#endif /* CONFIG_WFD */ - void rtw_init_wifidirect_timers(_adapter* padapter) { struct wifidirect_info *pwdinfo = &padapter->wdinfo; @@ -3587,9 +2170,7 @@ void rtw_init_wifidirect_addrs(_adapter* padapter, u8 *dev_addr, u8 *iface_addr) void init_wifidirect_info( _adapter* padapter, enum P2P_ROLE role) { struct wifidirect_info *pwdinfo; -#ifdef CONFIG_WFD - struct wifi_display_info *pwfd_info = &padapter->wfd_info; -#endif + pwdinfo = &padapter->wdinfo; pwdinfo->padapter = padapter; @@ -3651,7 +2232,6 @@ void init_wifidirect_info( _adapter* padapter, enum P2P_ROLE role) rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_NONE); pwdinfo->listen_dwell = ( u8 ) (( rtw_get_current_time() % 3 ) + 1); - /* DBG_88E( "[%s] listen_dwell time is %d00ms\n", __func__, pwdinfo->listen_dwell ); */ _rtw_memset( &pwdinfo->tx_prov_disc_info, 0x00, sizeof( struct tx_provdisc_req_info ) ); pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_NONE; @@ -3665,12 +2245,7 @@ void init_wifidirect_info( _adapter* padapter, enum P2P_ROLE role) pwdinfo->nego_ssidlen = 0; pwdinfo->ui_got_wps_info = P2P_NO_WPSINFO; -#ifdef CONFIG_WFD - pwdinfo->supported_wps_cm = WPS_CONFIG_METHOD_DISPLAY | WPS_CONFIG_METHOD_PBC; - pwdinfo->wfd_info = pwfd_info; -#else pwdinfo->supported_wps_cm = WPS_CONFIG_METHOD_DISPLAY | WPS_CONFIG_METHOD_PBC | WPS_CONFIG_METHOD_KEYPAD; -#endif /* CONFIG_WFD */ pwdinfo->channel_list_attr_len = 0; _rtw_memset( pwdinfo->channel_list_attr, 0x00, 100 ); @@ -3788,10 +2363,6 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role) init_wifidirect_info(padapter, role); rtw_hal_set_odm_var(padapter,HAL_ODM_P2P_STATE,NULL,true); - #ifdef CONFIG_WFD - rtw_hal_set_odm_var(padapter,HAL_ODM_WIFI_DISPLAY_STATE,NULL,true); - #endif - } else if (role == P2P_ROLE_DISABLE) { @@ -3816,9 +2387,6 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role) } rtw_hal_set_odm_var(padapter,HAL_ODM_P2P_STATE,NULL,false); - #ifdef CONFIG_WFD - rtw_hal_set_odm_var(padapter,HAL_ODM_WIFI_DISPLAY_STATE,NULL,false); - #endif /* Restore to initial setting. */ update_tx_basic_rate(padapter, padapter->registrypriv.wireless_mode); diff --git a/core/rtw_wlan_util.c b/core/rtw_wlan_util.c index efc1cfe..d361414 100644 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -670,42 +670,6 @@ void flush_all_cam_entry(_adapter *padapter) _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) { /* struct registry_priv *pregpriv = &padapter->registrypriv; */ diff --git a/include/drv_types.h b/include/drv_types.h index 1b9c372..11e6302 100644 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -336,11 +336,7 @@ struct _ADAPTER{ struct wifidirect_info wdinfo; #endif //CONFIG_P2P -#ifdef CONFIG_WFD - struct wifi_display_info wfd_info; -#endif //CONFIG_WFD - - void * HalData; + void *HalData; u32 hal_data_sz; struct hal_ops HalFunc; diff --git a/include/ieee80211.h b/include/ieee80211.h index 55a4b3b..6f91368 100644 --- a/include/ieee80211.h +++ b/include/ieee80211.h @@ -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); #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); struct registry_priv; diff --git a/include/rtw_mlme.h b/include/rtw_mlme.h index 3d8438d..d27b9b7 100644 --- a/include/rtw_mlme.h +++ b/include/rtw_mlme.h @@ -179,30 +179,6 @@ struct tx_invite_resp_info{ 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{ u16 wps_config_method_request; // Used when sending the provisioning request frame 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 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 -#ifdef CONFIG_WFD - struct wifi_display_info *wfd_info; -#endif enum P2P_ROLE role; enum P2P_STATE pre_p2p_state; enum P2P_STATE p2p_state; @@ -341,9 +314,6 @@ struct tdls_info{ u8 watchdog_count; u8 dev_discovered; //WFD_TDLS: for sigma test u8 enable; -#ifdef CONFIG_WFD - struct wifi_display_info *wfd_info; -#endif }; struct mlme_priv { diff --git a/include/rtw_mlme_ext.h b/include/rtw_mlme_ext.h index eee9642..0355ea1 100644 --- a/include/rtw_mlme_ext.h +++ b/include/rtw_mlme_ext.h @@ -553,9 +553,6 @@ int is_IBSS_empty(_adapter *padapter); unsigned char check_assoc_AP(u8 *pframe, uint len); 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 HT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE); diff --git a/include/rtw_p2p.h b/include/rtw_p2p.h index 5c42100..83117c2 100644 --- a/include/rtw_p2p.h +++ b/include/rtw_p2p.h @@ -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_assoc_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 status_code); 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_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); diff --git a/os_dep/ioctl_linux.c b/os_dep/ioctl_linux.c index 7fd4dfc..d70689a 100644 --- a/os_dep/ioctl_linux.c +++ b/os_dep/ioctl_linux.c @@ -280,94 +280,39 @@ static char *translate_scan(_adapter *padapter, #endif //CONFIG_P2P #ifdef CONFIG_P2P -#ifdef CONFIG_WFD - if (SCAN_RESULT_ALL == pwdinfo->wfd_info->scan_result_type) + if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) { + u32 blnGotP2PIE = false; - } - else if ((SCAN_RESULT_P2P_ONLY == pwdinfo->wfd_info->scan_result_type) || - (SCAN_RESULT_WFD_TYPE == pwdinfo->wfd_info->scan_result_type)) -#endif // CONFIG_WFD - { - if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) + // User is doing the P2P device discovery + // The prefix of SSID should be "DIRECT-" and the IE should contains the P2P IE. + // If not, the driver should ignore this AP and go to the next AP. + + // Verifying the SSID + 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 - // The prefix of SSID should be "DIRECT-" and the IE should contains the P2P IE. - // If not, the driver should ignore this AP and go to the next AP. - - // 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) + 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)) { - // the first two bits will indicate the WFD device type - 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; - } + blnGotP2PIE = 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 - 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; - } + blnGotP2PIE = true; } } } - if (blnGotWFD == false) + if (blnGotP2PIE == false) { return start; } } -#endif // CONFIG_WFD - #endif //CONFIG_P2P /* AP MAC address */ @@ -4041,67 +3986,6 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev, 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, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -4609,11 +4493,6 @@ static int rtw_p2p_invite_req(struct net_device *dev, _irqL irqL; 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. // 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. @@ -4698,45 +4577,6 @@ static int rtw_p2p_invite_req(struct net_device *dev, _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) { // Store the GO's bssid @@ -4792,11 +4632,6 @@ static int rtw_p2p_set_persistent(struct net_device *dev, _irqL irqL; 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 // 0: disable persistent group functionality // 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, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -5103,11 +4685,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev, u8 *p2pie; uint p2pielen = 0, attr_contentlen = 0; _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. // 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 @@ -5218,44 +4796,6 @@ static int rtw_p2p_prov_disc(struct net_device *dev, _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) { @@ -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 // to application. @@ -5425,36 +4964,9 @@ static int rtw_p2p_set(struct net_device *dev, wrqu->data.length -= 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 return ret; - } 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)) { 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 return ret; @@ -10019,29 +9521,6 @@ static int rtw_tdls_get(struct net_device *dev, struct iw_request_info *info, 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; } diff --git a/os_dep/os_intfs.c b/os_dep/os_intfs.c index e9371b9..82993a6 100644 --- a/os_dep/os_intfs.c +++ b/os_dep/os_intfs.c @@ -1114,10 +1114,6 @@ _func_enter_; rtw_init_wifidirect_timers(padapter); init_wifidirect_info(padapter, P2P_ROLE_DISABLE); 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 */ if (init_mlme_ext_priv(padapter) == _FAIL) { diff --git a/os_dep/rtw_android.c b/os_dep/rtw_android.c index 917a019..085a56c 100644 --- a/os_dep/rtw_android.c +++ b/os_dep/rtw_android.c @@ -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; //bytes_written = wl_cfg80211_set_p2p_ps(net, command + skip, priv_cmd.total_len - skip); 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: DBG_88E("Unknown PRIVATE command %s - ignored\n", command); snprintf(command, 3, "OK");