wifi: renew patch drivers/net/wireless
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / mt5931 / os / linux / include / gl_p2p_os.h
1 /*
2 ** $Id:
3 //Department/DaVinci/TRUNK/MT6620_5931_WiFi_Driver/os/linux/include/gl_p2p_os.h#28 $
4 */
5
6 /*! \file   gl_p2p_os.h
7     \brief  List the external reference to OS for p2p GLUE Layer.
8
9     In this file we define the data structure - GLUE_INFO_T to store those objects
10     we acquired from OS - e.g. TIMER, SPINLOCK, NET DEVICE ... . And all the
11     external reference (header file, extern func() ..) to OS for GLUE Layer should
12     also list down here.
13 */
14
15
16
17
18
19 #ifndef _GL_P2P_OS_H
20 #define _GL_P2P_OS_H
21
22 /*******************************************************************************
23 *                         C O M P I L E R   F L A G S
24 ********************************************************************************
25 */
26
27 /*******************************************************************************
28 *                    E X T E R N A L   R E F E R E N C E S
29 ********************************************************************************
30 */
31
32 /*******************************************************************************
33 *                              C O N S T A N T S
34 ********************************************************************************
35 */
36
37 /*******************************************************************************
38 *                                 M A C R O S
39 ********************************************************************************
40 */
41
42 /*******************************************************************************
43 *                             D A T A   T Y P E S
44 ********************************************************************************
45 */
46
47 /*******************************************************************************
48 *                            P U B L I C   D A T A
49 ********************************************************************************
50 */
51
52 /*******************************************************************************
53 *                           P R I V A T E   D A T A
54 ********************************************************************************
55 */
56
57 /*******************************************************************************
58 *                  F U N C T I O N   D E C L A R A T I O N S
59 ********************************************************************************
60 */
61
62
63 struct _GL_P2P_INFO_T {
64
65     /* Device handle */
66     struct net_device           *prDevHandler;
67
68     #if CFG_ENABLE_WIFI_DIRECT_CFG_80211
69     /* cfg80211 */
70     struct wireless_dev         wdev;
71
72     struct cfg80211_scan_request    *prScanRequest;
73
74     UINT_64 u8Cookie;
75
76     /* Generation for station list update. */
77     INT_32 i4Generation;
78
79     UINT_32 u4OsMgmtFrameFilter;
80
81     #endif
82
83     /* Device statistics */
84     struct net_device_stats     rNetDevStats;
85
86     /* glue layer variables */
87     /*move to glueinfo->adapter*/
88    // BOOLEAN                     fgIsRegistered;
89     UINT_32                     u4FreqInKHz;    /* frequency */
90     UINT_8                      ucRole;         /* 0: P2P Device, 1: Group Client, 2: Group Owner */
91     UINT_8                      ucIntent;       /* range: 0-15 */
92     UINT_8                      ucScanMode;     /* 0: Search & Listen, 1: Scan without probe response */
93
94     ENUM_PARAM_MEDIA_STATE_T    eState;
95     UINT_32                     u4PacketFilter;
96     PARAM_MAC_ADDRESS           aucMCAddrList[MAX_NUM_GROUP_ADDR];
97
98     /* connection-requested peer information */
99     UINT_8                      aucConnReqDevName[32];
100     INT_32                      u4ConnReqNameLength;
101     PARAM_MAC_ADDRESS           rConnReqPeerAddr;
102     PARAM_MAC_ADDRESS           rConnReqGroupAddr;   /* For invitation group. */
103     UINT_8                      ucConnReqDevType;
104     INT_32                      i4ConnReqConfigMethod;
105     INT_32                      i4ConnReqActiveConfigMethod;
106
107     UINT_32                     u4CipherPairwise;
108     UINT_8                      ucWSCRunning;
109
110     UINT_8                      aucWSCIE[3][400]; /* 0 for beacon, 1 for probe req, 2 for probe response */
111     UINT_16                     u2WSCIELen[3];
112
113         UINT_8                      ucOperatingChnl;
114         UINT_8                      ucInvitationType;
115
116         UINT_32                     u4InvStatus;
117
118     /* For SET_STRUCT/GET_STRUCT */
119     UINT_8                      aucOidBuf[4096];
120
121 #if 1 /* CFG_SUPPORT_ANTI_PIRACY */
122     UINT_8                      aucSecCheck[256];
123     UINT_8                      aucSecCheckRsp[256];
124 #endif
125
126     /* Hotspot Client Management */
127     PARAM_MAC_ADDRESS           aucblackMACList[8];
128     UINT_8                      ucMaxClients;
129
130 };
131
132
133 BOOLEAN
134 p2pRegisterToWlan(
135     P_GLUE_INFO_T prGlueInfo
136     );
137
138 BOOLEAN
139 p2pUnregisterToWlan(
140     P_GLUE_INFO_T prGlueInfo
141     );
142
143 BOOLEAN
144 p2pLaunch(
145     P_GLUE_INFO_T prGlueInfo
146     );
147
148 BOOLEAN
149 p2pRemove(
150     P_GLUE_INFO_T prGlueInfo
151     );
152
153 VOID
154 p2pSetMode(
155     IN BOOLEAN fgIsAPMOde
156     );
157
158
159 BOOLEAN
160 glRegisterP2P(
161     P_GLUE_INFO_T prGlueInfo,
162     const char *prDevName,
163     BOOLEAN fgIsApMode
164     );
165
166 BOOLEAN
167 glUnregisterP2P(
168     P_GLUE_INFO_T prGlueInfo
169     );
170
171 BOOLEAN
172 p2pNetRegister(
173     P_GLUE_INFO_T prGlueInfo,
174     BOOLEAN fgIsRtnlLockAcquired
175     );
176
177 BOOLEAN
178 p2pNetUnregister(
179     P_GLUE_INFO_T prGlueInfo,
180     BOOLEAN fgIsRtnlLockAcquired
181     );
182
183 BOOLEAN
184 p2pStopImmediate(
185     P_GLUE_INFO_T prGlueInfo
186     );
187
188 BOOLEAN
189 p2PFreeInfo(
190     P_GLUE_INFO_T prGlueInfo
191     );
192
193
194 #endif