add rk3288 pinctrl dts code
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / combo_mt66xx / mt6620 / wlan / include / mgmt / bss.h
1 /*
2 ** $Id: @(#) bss.h
3 */
4
5 /*! \file   "bss.h"
6     \brief  In this file we define the function prototype used in BSS/IBSS.
7
8     The file contains the function declarations and defines for used in BSS/IBSS.
9 */
10
11
12
13 /*
14 ** $Log: bss.h $
15  *
16  * 07 17 2012 yuche.tsai
17  * NULL
18  * Let netdev bring up.
19  *
20  * 07 17 2012 yuche.tsai
21  * NULL
22  * Compile no error before trial run.
23  *
24  * 03 02 2012 terry.wu
25  * NULL
26  * Sync CFG80211 modification from branch 2,2.
27  *
28  * 09 14 2011 yuche.tsai
29  * NULL
30  * Add P2P IE in assoc response.
31  *
32  * 03 19 2011 yuche.tsai
33  * [WCXRP00000581] [Volunteer Patch][MT6620][Driver] P2P IE in Assoc Req Issue
34  * Make assoc req to append P2P IE if wifi direct is enabled.
35  *
36  * 03 02 2011 wh.su
37  * [WCXRP00000448] [MT6620 Wi-Fi][Driver] Fixed WSC IE not send out at probe request
38  * Add code to send beacon and probe response WSC IE at Auto GO.
39  *
40  * 02 23 2011 eddie.chen
41  * [WCXRP00000463] [MT6620 Wi-Fi][FW/Driver][Hotspot] Cannot update WMM PS STA's partital bitmap
42  * Fix parsing WMM INFO and bmp delivery bitmap definition.
43  *
44  * 01 31 2011 george.huang
45  * [WCXRP00000333] [MT5931][FW] support SRAM power control drivers
46  * Extend TIM PVB, from 2 to 3 octets.
47  *
48  * 11 29 2010 cp.wu
49  * [WCXRP00000210] [MT6620 Wi-Fi][Driver][FW] Set RCPI value in STA_REC for initial TX rate selection of auto-rate algorithm
50  * update ucRcpi of STA_RECORD_T for AIS when
51  * 1) Beacons for IBSS merge is received
52  * 2) Associate Response for a connecting peer is received
53  *
54  * 09 03 2010 kevin.huang
55  * NULL
56  * Refine #include sequence and solve recursive/nested #include issue
57  *
58  * 08 12 2010 kevin.huang
59  * NULL
60  * Update bssProcessProbeRequest() and bssSendBeaconProbeResponse() declarations
61  *
62  * 07 19 2010 cp.wu
63  *
64  * [WPD00003833] [MT6620 and MT5931] Driver migration.
65  * when IBSS is being merged-in, send command packet to PM for connected indication
66  *
67  * 07 08 2010 cp.wu
68  *
69  * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
70  *
71  * 06 25 2010 george.huang
72  * [WPD00001556]Basic power managemenet function
73  * Create beacon update path, with expose bssUpdateBeaconContent()
74  *
75  * 06 17 2010 yuche.tsai
76  * [WPD00003839][MT6620 5931][P2P] Feature migration
77  * Add CTRL FLAGS for Probe Response.
78  *
79  * 06 09 2010 cp.wu
80  * [WPD00003833][MT6620 and MT5931] Driver migration
81  * add necessary changes to driver data paths.
82  *
83  * 06 07 2010 cp.wu
84  * [WPD00003833][MT6620 and MT5931] Driver migration
85  * add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h.
86  *
87  * 06 04 2010 george.huang
88  * [BORA00000678][MT6620]WiFi LP integration
89  * [PM] Support U-APSD for STA mode
90  *
91  * 05 28 2010 kevin.huang
92  * [BORA00000794][WIFISYS][New Feature]Power Management Support
93  * Add ClientList handling API - bssClearClientList, bssAddStaRecToClientList
94  *
95  * 05 14 2010 kevin.huang
96  * [BORA00000794][WIFISYS][New Feature]Power Management Support
97  * Remove unused typedef.
98  *
99  * 05 12 2010 kevin.huang
100  * [BORA00000794][WIFISYS][New Feature]Power Management Support
101  * Fix file merge error
102  *
103  * 05 12 2010 kevin.huang
104  * [BORA00000794][WIFISYS][New Feature]Power Management Support
105  * Add Power Management - Legacy PS-POLL support.
106  *
107  * 04 19 2010 kevin.huang
108  * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support
109  * Add Beacon Timeout Support
110  *  *  *  and will send Null frame to diagnose connection
111  *
112  * 03 16 2010 kevin.huang
113  * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
114  * Add AdHoc Mode
115  *
116  * 02 23 2010 kevin.huang
117  * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
118  * Add DTIM count update while TX Beacon
119  *
120  * 02 04 2010 kevin.huang
121  * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
122  * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup
123 */
124
125 #ifndef _BSS_H
126 #define _BSS_H
127
128 /*******************************************************************************
129 *                         C O M P I L E R   F L A G S
130 ********************************************************************************
131 */
132
133 /*******************************************************************************
134 *                    E X T E R N A L   R E F E R E N C E S
135 ********************************************************************************
136 */
137
138 /*******************************************************************************
139 *                              C O N S T A N T S
140 ********************************************************************************
141 */
142 //NOTE(Kevin): change define for george
143 //#define MAX_LEN_TIM_PARTIAL_BMP     (((MAX_ASSOC_ID + 1) + 7) / 8)   /* Required bits = (MAX_ASSOC_ID + 1) */
144 #define MAX_LEN_TIM_PARTIAL_BMP                     ((CFG_STA_REC_NUM + 7) / 8)  /* reserve length greater than maximum size of STA_REC */ //obsoleted: Assume we only use AID:1~15
145
146 /* CTRL FLAGS for Probe Response */
147 #define BSS_PROBE_RESP_USE_P2P_DEV_ADDR             BIT(0)
148 #define BSS_PROBE_RESP_INCLUDE_P2P_IE               BIT(1)
149
150 /*******************************************************************************
151 *                             D A T A   T Y P E S
152 ********************************************************************************
153 */
154
155 /*******************************************************************************
156 *                            P U B L I C   D A T A
157 ********************************************************************************
158 */
159
160 /*******************************************************************************
161 *                           P R I V A T E   D A T A
162 ********************************************************************************
163 */
164
165 /*******************************************************************************
166 *                                 M A C R O S
167 ********************************************************************************
168 */
169 #define bssAssignAssocID(_prStaRec)      ((_prStaRec)->ucIndex + 1)
170
171 /*******************************************************************************
172 *                   F U N C T I O N   D E C L A R A T I O N S
173 ********************************************************************************
174 */
175 /*----------------------------------------------------------------------------*/
176 /* Routines for all Operation Modes                                           */
177 /*----------------------------------------------------------------------------*/
178 P_STA_RECORD_T
179 bssCreateStaRecFromBssDesc (
180     IN P_ADAPTER_T                  prAdapter,
181     IN ENUM_STA_TYPE_T              eStaType,
182     IN ENUM_NETWORK_TYPE_INDEX_T    eNetTypeIndex,
183     IN P_BSS_DESC_T                 prBssDesc
184     );
185
186 VOID
187 bssComposeNullFrame (
188     IN P_ADAPTER_T      prAdapter,
189     IN PUINT_8          pucBuffer,
190     IN P_STA_RECORD_T   prStaRec
191     );
192
193 VOID
194 bssComposeQoSNullFrame (
195     IN P_ADAPTER_T      prAdapter,
196     IN PUINT_8          pucBuffer,
197     IN P_STA_RECORD_T   prStaRec,
198     IN UINT_8           ucUP,
199     IN BOOLEAN          fgSetEOSP
200     );
201
202 WLAN_STATUS
203 bssSendNullFrame (
204     IN P_ADAPTER_T          prAdapter,
205     IN P_STA_RECORD_T       prStaRec,
206     IN PFN_TX_DONE_HANDLER  pfTxDoneHandler
207     );
208
209 WLAN_STATUS
210 bssSendQoSNullFrame (
211     IN P_ADAPTER_T          prAdapter,
212     IN P_STA_RECORD_T       prStaRec,
213     IN UINT_8               ucUP,
214     IN PFN_TX_DONE_HANDLER  pfTxDoneHandler
215     );
216
217
218 /*----------------------------------------------------------------------------*/
219 /* Routines for both IBSS(AdHoc) and BSS(AP)                                  */
220 /*----------------------------------------------------------------------------*/
221 VOID
222 bssGenerateExtSuppRate_IE (
223     IN P_ADAPTER_T      prAdapter,
224     IN P_MSDU_INFO_T    prMsduInfo
225     );
226
227 VOID
228 bssBuildBeaconProbeRespFrameCommonIEs (
229     IN P_MSDU_INFO_T    prMsduInfo,
230     IN P_BSS_INFO_T     prBssInfo,
231     IN PUINT_8          pucDestAddr
232     );
233
234 VOID
235 bssComposeBeaconProbeRespFrameHeaderAndFF (
236     IN PUINT_8      pucBuffer,
237     IN PUINT_8      pucDestAddr,
238     IN PUINT_8      pucOwnMACAddress,
239     IN PUINT_8      pucBSSID,
240     IN UINT_16      u2BeaconInterval,
241     IN UINT_16      u2CapInfo
242     );
243
244 WLAN_STATUS
245 bssSendBeaconProbeResponse (
246     IN P_ADAPTER_T prAdapter,
247     IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
248     IN PUINT_8 pucDestAddr,
249     IN UINT_32 u4ControlFlags
250     );
251
252 WLAN_STATUS
253 bssProcessProbeRequest (
254     IN P_ADAPTER_T  prAdapter,
255     IN P_SW_RFB_T   prSwRfb
256     );
257
258 VOID
259 bssClearClientList (
260     IN P_ADAPTER_T  prAdapter,
261     IN P_BSS_INFO_T prBssInfo
262     );
263
264 VOID
265 bssAddStaRecToClientList (
266     IN P_ADAPTER_T  prAdapter,
267     IN P_BSS_INFO_T prBssInfo,
268     IN P_STA_RECORD_T prStaRec
269     );
270
271 VOID
272 bssRemoveStaRecFromClientList (
273     IN P_ADAPTER_T  prAdapter,
274     IN P_BSS_INFO_T prBssInfo,
275     IN P_STA_RECORD_T prStaRec
276     );
277
278
279 /*----------------------------------------------------------------------------*/
280 /* Routines for IBSS(AdHoc) only                                              */
281 /*----------------------------------------------------------------------------*/
282 VOID
283 ibssProcessMatchedBeacon (
284     IN P_ADAPTER_T  prAdapter,
285     IN P_BSS_INFO_T prBssInfo,
286     IN P_BSS_DESC_T prBssDesc,
287     IN UINT_8       ucRCPI
288     );
289
290 WLAN_STATUS
291 ibssCheckCapabilityForAdHocMode (
292     IN P_ADAPTER_T  prAdapter,
293     IN P_BSS_DESC_T prBssDesc
294     );
295
296 VOID
297 ibssInitForAdHoc (
298     IN P_ADAPTER_T  prAdapter,
299     IN P_BSS_INFO_T prBssInfo
300     );
301
302 WLAN_STATUS
303 bssUpdateBeaconContent (
304     IN P_ADAPTER_T prAdapter,
305     IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex
306     );
307
308
309 /*----------------------------------------------------------------------------*/
310 /* Routines for BSS(AP) only                                                  */
311 /*----------------------------------------------------------------------------*/
312 VOID
313 bssInitForAP (
314     IN P_ADAPTER_T  prAdapter,
315     IN P_BSS_INFO_T prBssInfo,
316     IN BOOLEAN fgIsRateUpdate
317     );
318
319 VOID
320 bssUpdateDTIMCount (
321     IN P_ADAPTER_T  prAdapter,
322     IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex
323     );
324
325 VOID
326 bssSetTIMBitmap (
327     IN P_ADAPTER_T  prAdapter,
328     IN P_BSS_INFO_T prBssInfo,
329     IN UINT_16 u2AssocId
330     );
331
332
333 /*link function to p2p module for txBcnIETable*/
334
335 /* WMM-2.2.2 WMM ACI to AC coding */
336 typedef enum _ENUM_ACI_T {
337     ACI_BE = 0,
338     ACI_BK = 1,
339     ACI_VI = 2,
340     ACI_VO = 3,
341     ACI_NUM
342 } ENUM_ACI_T, *P_ENUM_ACI_T;
343
344 typedef enum _ENUM_AC_PRIORITY_T {
345     AC_BK_PRIORITY = 0,
346     AC_BE_PRIORITY,
347     AC_VI_PRIORITY,
348     AC_VO_PRIORITY
349 } ENUM_AC_PRIORITY_T, *P_ENUM_AC_PRIORITY_T;
350
351
352 #endif /* _BSS_H */
353