support different wifi bt chip auto compatible
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / combo_mt66xx / mt6620 / wlan / mgmt / p2p_assoc.c
1 /*
2 ** $Id: @(#) p2p_assoc.c@@
3 */
4
5 /*! \file   "p2p_assoc.c"
6     \brief  This file includes the Wi-Fi Direct association-related functions.
7
8     This file includes the association-related functions.
9 */
10
11
12
13
14 /*******************************************************************************
15 *                         C O M P I L E R   F L A G S
16 ********************************************************************************
17 */
18
19 /*******************************************************************************
20 *                    E X T E R N A L   R E F E R E N C E S
21 ********************************************************************************
22 */
23
24 #include "precomp.h"
25
26 /*******************************************************************************
27 *                              C O N S T A N T S
28 ********************************************************************************
29 */
30
31 /*******************************************************************************
32 *                             D A T A   T Y P E S
33 ********************************************************************************
34 */
35
36 /*******************************************************************************
37 *                            P U B L I C   D A T A
38 ********************************************************************************
39 */
40
41 /*******************************************************************************
42 *                           P R I V A T E   D A T A
43 ********************************************************************************
44 */
45
46 /*******************************************************************************
47 *                                 M A C R O S
48 ********************************************************************************
49 */
50
51 /*******************************************************************************
52 *                   F U N C T I O N   D E C L A R A T I O N S
53 ********************************************************************************
54 */
55
56 /*******************************************************************************
57 *                              F U N C T I O N S
58 ********************************************************************************
59 */
60
61 /*----------------------------------------------------------------------------*/
62 /*!
63 * @brief This function is used to compose Common Information Elements for P2P Association
64 *        Request Frame.
65 *
66 * @param[in] prMsduInfo     Pointer to the composed MSDU_INFO_T.
67 *
68 * @return (none)
69 */
70 /*----------------------------------------------------------------------------*/
71 PUINT_8
72 p2pBuildReAssocReqFrameCommonIEs(
73     IN P_ADAPTER_T prAdapter,
74     IN P_MSDU_INFO_T prMsduInfo,
75     IN PUINT_8 pucBuffer
76     )
77 {
78     P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL;
79
80     prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings;
81
82     /* Fill the SSID element. */
83     SSID_IE(pucBuffer)->ucId = ELEM_ID_SSID;
84
85     /* NOTE(Kevin): We copy the SSID from CONNECTION_SETTINGS for the case of
86      * Passive Scan and the target BSS didn't broadcast SSID on its Beacon Frame.
87      */
88
89     COPY_SSID(SSID_IE(pucBuffer)->aucSSID,
90               SSID_IE(pucBuffer)->ucLength,
91               prP2pConnSettings->aucSSID,
92               prP2pConnSettings->ucSSIDLen);
93
94     prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer);
95     pucBuffer += IE_SIZE(pucBuffer);
96     return pucBuffer;
97 }
98
99