import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / misc / mediatek / connectivity / conn_soc / drv_wlan / mt_wifi / wlan / include / mgmt / cnm_mem.h
CommitLineData
6fa3eb70
S
1/*
2** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/cnm_mem.h#1 $
3*/
4
5/*! \file "cnm_mem.h"
6 \brief In this file we define the structure of the control unit of
7 packet buffer and MGT/MSG Memory Buffer.
8*/
9
10
11
12/*
13** $Log: cnm_mem.h $
14 *
15 * 03 02 2012 terry.wu
16 * NULL
17 * Snc CFG80211 modification for ICS migration from branch 2.2.
18 *
19 * 01 05 2012 tsaiyuan.hsu
20 * [WCXRP00001157] [MT6620 Wi-Fi][FW][DRV] add timing measurement support for 802.11v
21 * add timing measurement support for 802.11v.
22 *
23 * 03 17 2011 yuche.tsai
24 * NULL
25 * Resize the Secondary Device Type array when WiFi Direct is enabled.
26 *
27 * 03 16 2011 wh.su
28 * [WCXRP00000530] [MT6620 Wi-Fi] [Driver] skip doing p2pRunEventAAAComplete after send assoc response Tx Done
29 * enable the protected while at P2P start GO, and skip some security check .
30 *
31 * 01 26 2011 cm.chang
32 * [WCXRP00000395] [MT6620 Wi-Fi][Driver][FW] Search STA_REC with additional net type index argument
33 * .
34 *
35 * 01 11 2011 eddie.chen
36 * [WCXRP00000322] Add WMM IE in beacon,
37
38Add per station flow control when STA is in PS
39
40
41 * Add per STA flow control when STA is in PS mode
42 *
43 * 12 29 2010 eddie.chen
44 * [WCXRP00000322] Add WMM IE in beacon,
45Add per station flow control when STA is in PS
46
47 * 1) PS flow control event
48 *
49 * 2) WMM IE in beacon, assoc resp, probe resp
50 *
51 * 12 23 2010 george.huang
52 * [WCXRP00000152] [MT6620 Wi-Fi] AP mode power saving function
53 * 1. update WMM IE parsing, with ASSOC REQ handling
54 * 2. extend U-APSD parameter passing from driver to FW
55 *
56 * 12 07 2010 cm.chang
57 * [WCXRP00000239] MT6620 Wi-Fi][Driver][FW] Merge concurrent branch back to maintrunk
58 * 1. BSSINFO include RLM parameter
59 * 2. free all sta records when network is disconnected
60 *
61 * 11 29 2010 cm.chang
62 * [WCXRP00000210] [MT6620 Wi-Fi][Driver][FW] Set RCPI value in STA_REC for initial TX rate selection of auto-rate algorithm
63 * Sync RCPI of STA_REC to FW as reference of initial TX rate
64 *
65 * 10 18 2010 cp.wu
66 * [WCXRP00000053] [MT6620 Wi-Fi][Driver] Reset incomplete and might leads to BSOD when entering RF test with AIS associated
67 * 1. remove redundant variables in STA_REC structure
68 * 2. add STA-REC uninitialization routine for clearing pending events
69 *
70 * 09 21 2010 kevin.huang
71 * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning
72 * Eliminate Linux Compile Warning
73 *
74 * 09 03 2010 kevin.huang
75 * NULL
76 * Refine #include sequence and solve recursive/nested #include issue
77 *
78 * 07 12 2010 cp.wu
79 *
80 * SAA will take a record for tracking request sequence number.
81 *
82 * 07 08 2010 cp.wu
83 *
84 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
85 *
86 * 07 07 2010 cm.chang
87 * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
88 * Support state of STA record change from 1 to 1
89 *
90 * 07 01 2010 cm.chang
91 * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
92 * Support sync command of STA_REC
93 *
94 * 06 21 2010 wh.su
95 * [WPD00003840][MT6620 5931] Security migration
96 * modify some code for concurrent network.
97 *
98 * 06 21 2010 yuche.tsai
99 * [WPD00003839][MT6620 5931][P2P] Feature migration
100 * Fix compile error for P2P related defination.
101 *
102 * 06 18 2010 cm.chang
103 * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
104 * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf
105 *
106 * 06 17 2010 yuche.tsai
107 * [WPD00003839][MT6620 5931][P2P] Feature migration
108 * Add P2P related fields.
109 *
110 * 06 14 2010 cp.wu
111 * [WPD00003833][MT6620 and MT5931] Driver migration
112 * saa_fsm.c is migrated.
113 *
114 * 06 14 2010 cp.wu
115 * [WPD00003833][MT6620 and MT5931] Driver migration
116 * restore utility function invoking via hem_mbox to direct calls
117 *
118 * 06 10 2010 cp.wu
119 * [WPD00003833][MT6620 and MT5931] Driver migration
120 * add buildable & linkable ais_fsm.c
121 *
122 * related reference are still waiting to be resolved
123 *
124 * 06 08 2010 cp.wu
125 * [WPD00003833][MT6620 and MT5931] Driver migration
126 * hem_mbox is migrated.
127 *
128 * 06 08 2010 cp.wu
129 * [WPD00003833][MT6620 and MT5931] Driver migration
130 * add hem_mbox.c and cnm_mem.h (but disabled some feature) for further migration
131 *
132 * 06 04 2010 george.huang
133 * [BORA00000678][MT6620]WiFi LP integration
134 * [BORA00000678] [MT6620]WiFi LP integration
135 * 1. add u8TimeStamp in MSDU_INFO
136 * 2. move fgIsRxTSFUpdated/fgIsTxTSFUpdated from static to BSS_INFO
137 * 3. add new member for supporting PM in STA_RECORD, which is for AP PS mode
138 *
139 * 05 31 2010 yarco.yang
140 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
141 * Add RX TSF Log Feature and ADDBA Rsp with DECLINE handling
142 *
143 * 05 28 2010 cm.chang
144 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
145 * Support checking of duplicated buffer free
146 *
147 * 05 28 2010 kevin.huang
148 * [BORA00000794][WIFISYS][New Feature]Power Management Support
149 * Move define of STA_REC_NUM to config.h and rename to CFG_STA_REC_NUM
150 *
151 * 05 21 2010 kevin.huang
152 * [BORA00000794][WIFISYS][New Feature]Power Management Support
153 * Refine txmInitWtblTxRateTable() - set TX initial rate according to AP's operation rate set
154 *
155 * 05 19 2010 yarco.yang
156 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
157 * Fixed MAC RX Desc be overwritten issue
158 *
159 * 05 12 2010 kevin.huang
160 * [BORA00000794][WIFISYS][New Feature]Power Management Support
161 * Add Power Management - Legacy PS-POLL support.
162 *
163 * 05 10 2010 yarco.yang
164 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
165 * Support Rx header translation for A-MSDU subframe
166 *
167 * 05 07 2010 george.huang
168 * [BORA00000678][MT6620]WiFi LP integration
169 * add more sanity check about setting timer
170 *
171 * 04 29 2010 george.huang
172 * [BORA00000678][MT6620]WiFi LP integration
173 * modify the compiling flag for RAM usage
174 *
175 * 04 28 2010 tehuang.liu
176 * [BORA00000605][WIFISYS] Phase3 Integration
177 * Modified some MQM-related data structures (SN counter, TX/RX BA table)
178 *
179 * 04 27 2010 tehuang.liu
180 * [BORA00000605][WIFISYS] Phase3 Integration
181 * Added new TX/RX BA tables in STA_REC
182 *
183 * 04 19 2010 kevin.huang
184 * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support
185 * Add Beacon Timeout Support and will send Null frame to diagnose connection
186 *
187 * 04 09 2010 tehuang.liu
188 * [BORA00000605][WIFISYS] Phase3 Integration
189 * [BORA00000644] WiFi phase 4 integration
190 * Added per-TID SN cache in STA_REC
191 *
192 * 03 24 2010 cm.chang
193 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
194 * Support power control
195 *
196 * 03 16 2010 kevin.huang
197 * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
198 * Add AdHoc Mode
199 *
200 * 03 11 2010 yuche.tsai
201 * [BORA00000343][MT6620] Emulation For TX
202 * .
203 *
204 * 03 05 2010 yarco.yang
205 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
206 * Remove Emulation definition
207 *
208 * 03 04 2010 cp.wu
209 * [BORA00000368]Integrate HIF part into BORA
210 * eliminate HIF_EMULATION in cnm_mem.h
211 *
212 * 03 04 2010 kevin.huang
213 * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
214 * Add cnmStaRecChangeState() declaration.
215 *
216 * 03 03 2010 cm.chang
217 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
218 * Remove compiling warning for some emulation flags
219 *
220 * 03 03 2010 wh.su
221 * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize
222 * move the AIS specific variable for security to AIS specific structure.
223 *
224 * 03 03 2010 wh.su
225 * [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize
226 * Fixed the pre-authentication timer not correctly init issue, and modify the security related callback function prototype.
227 *
228 * 03 01 2010 tehuang.liu
229 * [BORA00000569][WIFISYS] Phase 2 Integration Test
230 * To store field AMPDU Parameters in STA_REC
231 *
232 * 02 26 2010 tehuang.liu
233 * [BORA00000569][WIFISYS] Phase 2 Integration Test
234 * Added fgIsWmmSupported in STA_RECORD_T.
235 *
236 * 02 26 2010 tehuang.liu
237 * [BORA00000569][WIFISYS] Phase 2 Integration Test
238 * Added fgIsUapsdSupported in STA_RECORD_T
239 *
240 * 02 13 2010 tehuang.liu
241 * [BORA00000569][WIFISYS] Phase 2 Integration Test
242 * Added arTspecTable in STA_REC for TSPEC management
243 *
244 * 02 12 2010 cm.chang
245 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
246 * Enable mgmt buffer debug by default
247 *
248 * 02 12 2010 tehuang.liu
249 * [BORA00000569][WIFISYS] Phase 2 Integration Test
250 * Added BUFFER_SOURCE_BCN
251 *
252 * 02 10 2010 tehuang.liu
253 * [BORA00000569][WIFISYS] Phase 2 Integration Test
254 * Renamed MSDU_INFO.ucFixedRateIndex as MSDU_INFO.ucFixedRateCode
255 *
256 * 02 04 2010 kevin.huang
257 * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
258 * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup
259 *
260 * 02 02 2010 tehuang.liu
261 * [BORA00000569][WIFISYS] Phase 2 Integration Test
262 * Added SN info in MSDU_INFO_T
263 *
264 * 01 27 2010 wh.su
265 * [BORA00000476][Wi-Fi][firmware] Add the security module initialize code
266 * add and fixed some security function.
267 *
268 * 01 11 2010 kevin.huang
269 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
270 * Add Deauth and Disassoc Handler
271 *
272 * 01 08 2010 cp.wu
273 * [BORA00000368]Integrate HIF part into BORA
274 * 1) separate wifi_var_emu.c/.h from wifi_var.c/.h
275 * 2) eliminate HIF_EMULATION code sections appeared in wifi_var/cnm_mem
276 * 3) use cnmMemAlloc() instead to allocate SRAM buffer
277 *
278 * 12 31 2009 cp.wu
279 * [BORA00000368]Integrate HIF part into BORA
280 * 1) surpress debug message emitted from hal_hif.c
281 * 2) add two set of field for recording buffer process time
282 *
283 * 12 31 2009 cp.wu
284 * [BORA00000368]Integrate HIF part into BORA
285 * 1. move wifi task initialization from wifi_task.c(rom) to wifi_init.c (TCM) for integrating F/W download later
286 * * * * * 2. WIFI_Event_Dispatcher() prototype changed to return to suspend mode from normal operation mode
287 * * * * * 2. HIF emulation logic revised
288 *
289 * 12 29 2009 yuche.tsai
290 * [BORA00000343][MT6620] Emulation For TX
291 * .Using global buffer declaring by SD1 instead of using another one.
292 *
293 * 12 25 2009 tehuang.liu
294 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
295 * Integrated modifications for 1st connection (mainly on FW modules MQM, TXM, and RXM)
296 * * MQM: BA handling
297 * * TXM: Macros updates
298 * * RXM: Macros/Duplicate Removal updates
299 *
300 * 12 24 2009 yarco.yang
301 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
302 * .
303 *
304 * 12 23 2009 cp.wu
305 * [BORA00000368]Integrate HIF part into BORA
306 * allocating SRAM for emulation purpose by ruducing MEM_BANK3_BUF_SZ
307 *
308 * 12 21 2009 cm.chang
309 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
310 * Remove individual DATA_BUF_BLOCK_NUM definition for emulation compiling flagsu1rwduu`wvpghlqg|fh+fmdkb
311 *
312 * 12 21 2009 cm.chang
313 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
314 * Support several data buffer banks.
315 *
316 * 12 18 2009 cm.chang
317 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
318 * .For new FPGA memory size
319 *
320 * 12 18 2009 cm.chang
321 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
322 * .
323 *
324 * 12 17 2009 george.huang
325 * [BORA00000018]Integrate WIFI part into BORA for the 1st time
326 * .
327 *
328 * Dec 17 2009 MTK02468
329 * [BORA00000337] To check in codes for FPGA emulation
330 * Modified the DATA_BLOCK_SIZE from 1620 to 2048
331 *
332 * Dec 16 2009 mtk01426
333 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
334 * Add CFG_TEST_SEC_EMULATION flag
335 *
336 * Dec 9 2009 mtk01104
337 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
338 * Add HT cap to sta record
339 *
340 * Dec 9 2009 mtk02752
341 * [BORA00000368] Integrate HIF part into BORA
342 * add cnmDataPktFree() for emulation loopback purpose
343 *
344 * Dec 8 2009 mtk01088
345 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
346 * add the buffer for key handshake 1x and cmd key order issue
347 *
348 * Dec 7 2009 mtk01088
349 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
350 * move the tx call back function proto type to typedef.h
351 *
352 * Dec 3 2009 mtk01461
353 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
354 * Add cnmGetStaRecByAddress() and modify variable in STA_RECORD_T
355 *
356 * Dec 1 2009 mtk01088
357 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
358 * rename the port block flag
359 *
360 * Nov 23 2009 mtk01461
361 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
362 * Add variables to STA_RECORD_T for assoc/auth
363 *
364 * Nov 23 2009 mtk02468
365 * [BORA00000337] To check in codes for FPGA emulation
366 * Fixed the value of STA_WAIT_QUEUE_NUM (from 7 to 5)
367 *
368 * Nov 20 2009 mtk02468
369 * [BORA00000337] To check in codes for FPGA emulation
370 * Removed u2FrameLength from SW_RFB
371 *
372 * Nov 20 2009 mtk02468
373 * [BORA00000337] To check in codes for FPGA emulation
374 * Fixed indenting
375 *
376 * Nov 20 2009 mtk02468
377 * [BORA00000337] To check in codes for FPGA emulation
378 * Updated MSDU_INFO and SW_RFB
379 *
380 * Nov 19 2009 mtk01088
381 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
382 * update the variable for security
383 *
384 * Nov 18 2009 mtk01088
385 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
386 * remove the variable to make the compiler ok
387 *
388 * Nov 18 2009 mtk01088
389 * [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
390 * add the variable for security module
391 *
392 * Nov 16 2009 mtk01461
393 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
394 * Fix typo in define of MSG_BUF_BLOCK_SIZE
395 *
396 * Nov 13 2009 mtk02468
397 * [BORA00000337] To check in codes for FPGA emulation
398 * Let typedef STA_REC_T precede typedef MSDU_INFO_T and SW_RFB_T
399 *
400 * Nov 13 2009 mtk02468
401 * [BORA00000337] To check in codes for FPGA emulation
402 * Modified MSDU_INFO and STA_REC for TXM and MQM
403 *
404 * Nov 12 2009 mtk01104
405 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
406 * Rename STA_REC_T to STA_RECORD_T and add ucIndex member
407 *
408 * Nov 9 2009 mtk01104
409 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
410 * Make sure ucBufferSource the same offset in MSDU_INFO and SW_RFB
411 *
412 * Nov 6 2009 mtk01426
413 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
414 *
415 *
416 * Nov 5 2009 mtk01426
417 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
418 *
419 *
420 * Nov 5 2009 mtk01461
421 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
422 * Update comment
423 *
424 * Oct 30 2009 mtk01461
425 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
426 * Add draft content of MSDU_INFO_T and SW_RFB_T
427 *
428 * Oct 30 2009 mtk01084
429 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
430 *
431 *
432 * Oct 28 2009 mtk01104
433 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
434 *
435 *
436 * Oct 23 2009 mtk01461
437 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
438 * Fix lint warning
439 *
440 * Oct 21 2009 mtk01426
441 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
442 * Add CFG_TEST_RX_EMULATION flag
443 *
444 * Oct 20 2009 mtk01426
445 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
446 *
447 *
448 * Oct 9 2009 mtk02468
449 * [BORA00000337] To check in codes for FPGA emulation
450 * Added field ucTC to MSDU_INFO_T and field pucHifRxPacket to SW_RFB_T
451 *
452 * Oct 8 2009 mtk01104
453 * [BORA00000018] Integrate WIFI part into BORA for the 1st time
454 *
455**
456*/
457
458#ifndef _CNM_MEM_H
459#define _CNM_MEM_H
460
461/*******************************************************************************
462* C O M P I L E R F L A G S
463********************************************************************************
464*/
465
466/*******************************************************************************
467* E X T E R N A L R E F E R E N C E S
468********************************************************************************
469*/
470
471/*******************************************************************************
472* C O N S T A N T S
473********************************************************************************
474*/
475
476#ifndef POWER_OF_2
477#define POWER_OF_2(n) BIT(n)
478#endif
479
480/* Size of a basic management buffer block in power of 2 */
481#define MGT_BUF_BLOCK_SIZE_IN_POWER_OF_2 7 /* 7 to the power of 2 = 128 */
482#define MSG_BUF_BLOCK_SIZE_IN_POWER_OF_2 5 /* 5 to the power of 2 = 32 */
483
484/* Size of a basic management buffer block */
485#define MGT_BUF_BLOCK_SIZE POWER_OF_2(MGT_BUF_BLOCK_SIZE_IN_POWER_OF_2)
486#define MSG_BUF_BLOCK_SIZE POWER_OF_2(MSG_BUF_BLOCK_SIZE_IN_POWER_OF_2)
487
488/* Total size of (n) basic management buffer blocks */
489#define MGT_BUF_BLOCKS_SIZE(n) ((UINT_32)(n) << MGT_BUF_BLOCK_SIZE_IN_POWER_OF_2)
490#define MSG_BUF_BLOCKS_SIZE(n) ((UINT_32)(n) << MSG_BUF_BLOCK_SIZE_IN_POWER_OF_2)
491
492/* Number of management buffer block */
493#define MAX_NUM_OF_BUF_BLOCKS 32 /* Range: 1~32 */
494
495/* Size of overall management frame buffer */
496#define MGT_BUFFER_SIZE (MAX_NUM_OF_BUF_BLOCKS * MGT_BUF_BLOCK_SIZE)
497#define MSG_BUFFER_SIZE (MAX_NUM_OF_BUF_BLOCKS * MSG_BUF_BLOCK_SIZE)
498
499
500/* STA_REC related definitions */
501#define STA_REC_INDEX_BMCAST 0xFF
502#define STA_REC_INDEX_NOT_FOUND 0xFE
503#define STA_WAIT_QUEUE_NUM 5 /* Number of SW queues in each STA_REC: AC0~AC4 */
504#define SC_CACHE_INDEX_NUM 5 /* Number of SC caches in each STA_REC: AC0~AC4 */
505
506
507/* P2P related definitions */
508#ifdef CFG_ENABLE_WIFI_DIRECT
509/* Moved from p2p_fsm.h */
510#define WPS_ATTRI_MAX_LEN_DEVICE_NAME 32 /* 0x1011 */
511#define P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT 8 /* NOTE(Kevin): Shall <= 16 */
512#endif
513
514
515/*******************************************************************************
516* D A T A T Y P E S
517********************************************************************************
518*/
519#if ((MAX_NUM_OF_BUF_BLOCKS > 32) || (MAX_NUM_OF_BUF_BLOCKS <= 0))
520 #error > #define MAX_NUM_OF_MGT_BUF_BLOCKS : Out of boundary !
521#elif MAX_NUM_OF_BUF_BLOCKS > 16
522 typedef UINT_32 BUF_BITMAP;
523#elif MAX_NUM_OF_BUF_BLOCKS > 8
524 typedef UINT_16 BUF_BITMAP;
525#else
526 typedef UINT_8 BUF_BITMAP;
527#endif /* MAX_NUM_OF_MGT_BUF_BLOCKS */
528
529
530/* Control variable of TX management memory pool */
531typedef struct _BUF_INFO_T {
532 PUINT_8 pucBuf;
533
534#if CFG_DBG_MGT_BUF
535 UINT_32 u4AllocCount;
536 UINT_32 u4FreeCount;
537 UINT_32 u4AllocNullCount;
538#endif /* CFG_DBG_MGT_BUF */
539
540 BUF_BITMAP rFreeBlocksBitmap;
541 UINT_8 aucAllocatedBlockNum[MAX_NUM_OF_BUF_BLOCKS];
542} BUF_INFO_T, *P_BUF_INFO_T;
543
544
545/* Wi-Fi divides RAM into three types
546 * MSG: Mailbox message (Small size)
547 * BUF: HW DMA buffers (HIF/MAC)
548 */
549typedef enum _ENUM_RAM_TYPE_T {
550 RAM_TYPE_MSG = 0,
551 RAM_TYPE_BUF
552} ENUM_RAM_TYPE_T, P_ENUM_RAM_TYPE_T;
553
554typedef enum _ENUM_BUFFER_SOURCE_T {
555 BUFFER_SOURCE_HIF_TX0 =0,
556 BUFFER_SOURCE_HIF_TX1,
557 BUFFER_SOURCE_MAC_RX,
558 BUFFER_SOURCE_MNG,
559 BUFFER_SOURCE_BCN,
560 BUFFER_SOURCE_NUM
561} ENUM_BUFFER_SOURCE_T, *P_ENUM_BUFFER_SOURCE_T;
562
563
564typedef enum _ENUM_SEC_STATE_T {
565 SEC_STATE_INIT,
566 SEC_STATE_INITIATOR_PORT_BLOCKED,
567 SEC_STATE_RESPONDER_PORT_BLOCKED,
568 SEC_STATE_CHECK_OK,
569 SEC_STATE_SEND_EAPOL,
570 SEC_STATE_SEND_DEAUTH,
571 SEC_STATE_COUNTERMEASURE,
572 SEC_STATE_NUM
573} ENUM_SEC_STATE_T;
574
575typedef struct _TSPEC_ENTRY_T {
576 UINT_8 ucStatus;
577 UINT_8 ucToken; /* Dialog Token in ADDTS_REQ or ADDTS_RSP */
578 UINT_16 u2MediumTime;
579 UINT_32 u4TsInfo;
580 //PARAM_QOS_TS_INFO rParamTsInfo;
581 /* Add other retained QoS parameters below */
582} TSPEC_ENTRY_T, *P_TSPEC_ENTRY_T, TSPEC_TABLE_ENTRY_T, *P_TSPEC_TABLE_ENTRY_T;
583
584typedef struct _SEC_INFO_T {
585
586 ENUM_SEC_STATE_T ePreviousState;
587 ENUM_SEC_STATE_T eCurrentState;
588
589 BOOLEAN fg2nd1xSend;
590 BOOLEAN fgKeyStored;
591
592 UINT_8 aucStoredKey[64];
593
594 BOOLEAN fgAllowOnly1x;
595} SEC_INFO_T, *P_SEC_INFO_T;
596
597#define MAX_NUM_CONCURRENT_FRAGMENTED_MSDUS 3
598
599#define UPDATE_BSS_RSSI_INTERVAL_SEC 3 // Seconds
600
601/* Fragment information structure */
602typedef struct _FRAG_INFO_T {
603 UINT_16 u2NextFragSeqCtrl;
604 PUINT_8 pucNextFragStart;
605 P_SW_RFB_T pr1stFrag;
606 OS_SYSTIME rReceiveLifetimeLimit; /* The receive time of 1st fragment */
607} FRAG_INFO_T, *P_FRAG_INFO_T;
608
609
610typedef struct _STAT_CNT_INFO_FW_T {
611 UINT32 u4NumOfTx; /* number of packets sent from host */
612 UINT32 u4NumOfTxOK; /* number of packets sent to air OK */
613 UINT32 u4NumOfTxRetry; /* number of packets sent to air RETRY */
614 UINT32 u4TxDoneAirTimeMax; /* maximum tx done air time */
615
616 UINT32 u4NumOfPtiRspTxOk; /* number of PTI RSP sent to air OK */
617 UINT32 u4NumOfPtiRspTxErr; /* number of PTI RSP sent to air ERROR */
618
619 UINT32 u4NumOfTxErr; /* number of packets sent to air ERROR */
620
621 UINT32 u4NumOfRx; /* number of received packets */
622 UINT32 u4NumOfPtiRspRx; /* number of PTI RSP rcv */
623
624#define STAT_CNT_INFO_TX_ERR_FLUSHED 0x00000001
625#define STAT_CNT_INFO_TX_ERR_AGE_TIMEOUT 0x00000002
626#define STAT_CNT_INFO_TX_ERR_MPDU 0x00000004
627#define STAT_CNT_INFO_TX_ERR_RTS 0x00000010
628#define STAT_CNT_INFO_TX_ERR_LIFETIME 0x00000020
629#define STAT_CNT_INFO_TX_ERR_UNKNOWN 0x80000000
630 UINT32 u4TxErrBitmap; /* TX error type */
631
632#define STAT_CNT_INFO_MAX_TX_RATE_OK_HIS_NUM 10 /* TX OK history */
633 UINT8 aucTxRateOkHis[STAT_CNT_INFO_MAX_TX_RATE_OK_HIS_NUM][2];
634 UINT32 u4TxRateOkHisId;
635
636#define STAT_CNT_INFO_MAX_RATE_ID (32) /* MCS0 ~ MCS31 */
637 UINT32 aucTxRateMap[STAT_CNT_INFO_MAX_RATE_ID];
638 UINT32 aucRxRateMap[STAT_CNT_INFO_MAX_RATE_ID];
639
640 UINT8 aucStateHis[100][3]; /* State history */
641 UINT32 u4StateHisId; /* history ID */
642} STAT_CNT_INFO_FW_T;
643
644typedef struct _STAT_CNT_INFO_DRV_T {
645
646 UINT32 u4NumOfTxFromOs; /* number of packets sent from OS */
647 UINT32 u4NumOfTxQueFull; /* number of packets dropped due to queue full */
648 UINT32 u4NumOfTxToFw; /* number of packets sent to firmware */
649
650 STAT_CNT_INFO_FW_T rFw;
651} STAT_CNT_INFO_DRV_T;
652
653/* Define STA record structure */
654struct _STA_RECORD_T {
655 LINK_ENTRY_T rLinkEntry;
656 UINT_8 ucIndex; /* Not modify it except initializing */
657
658 BOOLEAN fgIsInUse; /* Indicate if this entry is in use or not */
659 UINT_8 aucMacAddr[MAC_ADDR_LEN]; /* MAC address */
660
661 /* SAA/AAA */
662 ENUM_AA_STATE_T eAuthAssocState; /* Store STATE Value used in SAA/AAA */
663 UINT_8 ucAuthAssocReqSeqNum;
664
665 ENUM_STA_TYPE_T eStaType; /* Indicate the role of this STA in
666 * the network (for example, P2P GO)
667 */
668
669 UINT_8 ucNetTypeIndex; /* ENUM_NETWORK_TYPE_INDEX_T */
670
671 UINT_8 ucStaState; /* STATE_1,2,3 */
672
673 UINT_8 ucPhyTypeSet; /* Available PHY Type Set of this peer
674 * (may deduced from received BSS_DESC_T)
675 */
676 UINT_8 ucDesiredPhyTypeSet; /* The match result by AND operation of peer's
677 * PhyTypeSet and ours.
678 */
679 BOOLEAN fgHasBasicPhyType; /* A flag to indicate a Basic Phy Type which
680 * is used to generate some Phy Attribute IE
681 * (e.g. capability, MIB) during association.
682 */
683 UINT_8 ucNonHTBasicPhyType; /* The Basic Phy Type choosen among the
684 * ucDesiredPhyTypeSet.
685 */
686
687 UINT_16 u2CapInfo; /* For Infra Mode, to store Capability Info. from Association Resp(SAA).
688 * For AP Mode, to store Capability Info. from Association Req(AAA).
689 */
690 UINT_16 u2AssocId; /* For Infra Mode, to store AID from Association Resp(SAA).
691 * For AP Mode, to store the Assigned AID(AAA).
692 */
693
694 UINT_16 u2ListenInterval; /* Listen Interval from STA(AAA) */
695
696 UINT_16 u2DesiredNonHTRateSet; /* Our Current Desired Rate Set after
697 * match with STA's Operational Rate Set
698 */
699
700 UINT_16 u2OperationalRateSet; /* Operational Rate Set of peer BSS */
701 UINT_16 u2BSSBasicRateSet; /* Basic Rate Set of peer BSS */
702
703 BOOLEAN fgIsMerging; /* For IBSS Mode, to indicate that Merge is ongoing */
704
705 BOOLEAN fgDiagnoseConnection; /* For Infra/AP Mode, to diagnose the Connection with
706 * this peer by sending ProbeReq/Null frame */
707
708 /*------------------------------------------------------------------------------------------*/
709 /* 802.11n HT capabilities when (prStaRec->ucPhyTypeSet & PHY_TYPE_BIT_HT) is true */
710 /* They have the same definition with fields of information element */
711 /*------------------------------------------------------------------------------------------*/
712 UINT_8 ucMcsSet; /* MCS0~7 rate set of peer BSS */
713 BOOLEAN fgSupMcs32; /* MCS32 is supported by peer BSS */
714 UINT_16 u2HtCapInfo; /* HT cap info field by HT cap IE */
715 UINT_8 ucAmpduParam; /* Field A-MPDU Parameters in HT cap IE */
716 UINT_16 u2HtExtendedCap; /* HT extended cap field by HT cap IE */
717 UINT_32 u4TxBeamformingCap; /* TX beamforming cap field by HT cap IE */
718 UINT_8 ucAselCap; /* ASEL cap field by HT cap IE */
719
720 UINT_8 ucRCPI; /* RCPI of peer */
721
722 UINT_8 ucDTIMPeriod; /* Target BSS's DTIM Period, we use this
723 * value for setup Listen Interval
724 * TODO(Kevin): TBD
725 */
726 UINT_8 ucAuthAlgNum; /* For Infra/AP Mode, the Auth Alogrithm Num used in Authentication(SAA/AAA) */
727 BOOLEAN fgIsReAssoc; /* For Infra/AP Mode, to indicate ReAssoc Frame was in used(SAA/AAA) */
728
729 UINT_8 ucTxAuthAssocRetryCount;/* For Infra Mode, the Retry Count of TX Auth/Assod Frame(SAA) */
730 UINT_8 ucTxAuthAssocRetryLimit;/* For Infra Mode, the Retry Limit of TX Auth/Assod Frame(SAA) */
731
732 UINT_16 u2StatusCode; /* Status of Auth/Assoc Req */
733 UINT_16 u2ReasonCode; /* Reason that been Deauth/Disassoc */
734
735
736 P_IE_CHALLENGE_TEXT_T prChallengeText; /* Point to an allocated buffer for storing Challenge Text for Shared Key Authentication */
737
738 TIMER_T rTxReqDoneOrRxRespTimer;/* For Infra Mode, a timer used to send a timeout event
739 * while waiting for TX request done or RX response.
740 */
741
742 /*------------------------------------------------------------------------------------------*/
743 /* Power Management related fields (for STA/ AP/ P2P/ BOW power saving mode) */
744 /*------------------------------------------------------------------------------------------*/
745 BOOLEAN fgSetPwrMgtBit; /* For Infra Mode, to indicate that outgoing frame need toggle
746 * the Pwr Mgt Bit in its Frame Control Field.
747 */
748
749 BOOLEAN fgIsInPS; /* For AP Mode, to indicate the client PS state(PM).
750 * TRUE: In PS Mode; FALSE: In Active Mode. */
751
752 BOOLEAN fgIsInPsPollSP; /* For Infra Mode, to indicate we've sent a PS POLL to AP and start
753 * the PS_POLL Service Period(LP)
754 */
755
756 BOOLEAN fgIsInTriggerSP; /* For Infra Mode, to indicate we've sent a Trigger Frame to AP and start
757 * the Delivery Service Period(LP)
758 */
759
760 UINT_8 ucBmpDeliveryAC; /* 0: AC0, 1: AC1, 2: AC2, 3: AC3 */
761
762 UINT_8 ucBmpTriggerAC; /* 0: AC0, 1: AC1, 2: AC2, 3: AC3 */
763
764 UINT_8 ucUapsdSp; /* Max SP length */
765
766 /*------------------------------------------------------------------------------------------*/
767
768 BOOLEAN fgIsRtsEnabled;
769
770 OS_SYSTIME rUpdateTime; /* (4) System Timestamp of Successful TX and RX */
771
772 OS_SYSTIME rLastJoinTime; /* (4) System Timestamp of latest JOIN process */
773
774 UINT_8 ucJoinFailureCount; /* Retry Count of JOIN process */
775
776 LINK_T arStaWaitQueue[STA_WAIT_QUEUE_NUM]; /* For TXM to defer pkt forwarding to MAC TX DMA */
777
778 UINT_16 au2CachedSeqCtrl[TID_NUM + 1]; /* Duplicate removal for HT STA on a per-TID basis ("+1" is for MMPDU and non-QoS) */
779
780#if 0
781 /* RXM */
782 P_RX_BA_ENTRY_T aprRxBaTable[TID_NUM];
783
784 /* TXM */
785 P_TX_BA_ENTRY_T aprTxBaTable[TID_NUM];
786#endif
787
788 FRAG_INFO_T rFragInfo[MAX_NUM_CONCURRENT_FRAGMENTED_MSDUS];
789
790 SEC_INFO_T rSecInfo; /* The security state machine */
791
792 BOOLEAN fgPortBlock; /* The 802.1x Port Control flag */
793
794 BOOLEAN fgTransmitKeyExist; /* Unicast key exist for this STA */
795
796 UINT_8 ucWTEntry;
797
798 BOOLEAN fgTxAmpduEn; /* Enable TX AMPDU for this Peer */
799 BOOLEAN fgRxAmpduEn; /* Enable RX AMPDU for this Peer */
800
801 PUINT_8 pucAssocReqIe;
802 UINT_16 u2AssocReqIeLen;
803 /*------------------------------------------------------------------------------------------*/
804 /* WMM/QoS related fields */
805 /*------------------------------------------------------------------------------------------*/
806 BOOLEAN fgIsQoS; /* If the STA is associated as a QSTA or QAP (for TX/RX) */
807 BOOLEAN fgIsWmmSupported; /* If the peer supports WMM, set to TRUE (for association)*/
808 BOOLEAN fgIsUapsdSupported; /* Set according to the scan result (for association) */
809
810 /*------------------------------------------------------------------------------------------*/
811 /* P2P related fields */
812 /*------------------------------------------------------------------------------------------*/
813#if CFG_ENABLE_WIFI_DIRECT
814 UINT_8 u2DevNameLen;
815 UINT_8 aucDevName[WPS_ATTRI_MAX_LEN_DEVICE_NAME];
816
817 UINT_8 aucDevAddr[MAC_ADDR_LEN]; /* P2P Device Address */
818
819 UINT_16 u2ConfigMethods;
820
821 UINT_8 ucDeviceCap;
822
823 UINT_8 ucSecondaryDevTypeCount;
824
825 DEVICE_TYPE_T rPrimaryDevTypeBE;
826
827 DEVICE_TYPE_T arSecondaryDevTypeBE[P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT];
828#endif /* CFG_SUPPORT_P2P */
829
830
831 /*------------------------------------------------------------------------------------------*/
832 /* QM related fields */
833 /*------------------------------------------------------------------------------------------*/
834
835 UINT_8 ucFreeQuota; /* Per Sta flow controal. Valid when fgIsInPS is TRUE. Chnage it for per Queue flow control */
836 //UINT_8 aucFreeQuotaPerQueue[NUM_OF_PER_STA_TX_QUEUES]; /* used in future */
837 UINT_8 ucFreeQuotaForDelivery;
838 UINT_8 ucFreeQuotaForNonDelivery;
839#if CFG_ENABLE_PKT_LIFETIME_PROFILE && CFG_ENABLE_PER_STA_STATISTICS
840 UINT_32 u4TotalTxPktsNumber;
841 UINT_32 u4TotalTxPktsTime;
842 UINT_32 u4MaxTxPktsTime;
843 UINT_32 u4ThresholdCounter;
844#endif
845
846#if 1
847 /*------------------------------------------------------------------------------------------*/
848 /* To be removed, this is to make que_mgt compilation success only */
849 /*------------------------------------------------------------------------------------------*/
850 /* When this STA_REC is in use, set to TRUE. */
851 BOOLEAN fgIsValid;
852
853 /* Per-STA Queues: [0] AC0, [1] AC1, [2] AC2, [3] AC3, [4] 802.1x */
854 QUE_T arTxQueue[NUM_OF_PER_STA_TX_QUEUES];
855
856 /* When this STA is in PS Mode, set to TRUE. */
857 //BOOLEAN fgIsPS;
858
859 /* When this STA enters Power-Saving, FW will notify the driver with a Session ID */
860 UINT_8 ucPsSessionID;
861
862 BOOLEAN fgIsAp;
863
864 /* Reorder Parameter reference table */
865 P_RX_BA_ENTRY_T aprRxReorderParamRefTbl[CFG_RX_MAX_BA_TID_NUM];
866#endif
867
868#if CFG_SUPPORT_802_11V_TIMING_MEASUREMENT
869 TIMINGMSMT_PARAM_T rWNMTimingMsmt;
870#endif
871
872#if (CFG_SUPPORT_TDLS == 1)
873 BOOLEAN fgTdlsIsProhibited; /* TRUE: AP prohibits TDLS links */
874 BOOLEAN fgTdlsIsChSwProhibited; /* TRUE: AP prohibits TDLS chan switch */
875
876 BOOLEAN flgTdlsIsInitiator; /* TRUE: the peer is the initiator */
877 IE_HT_CAP_T rTdlsHtCap; /* temp to queue HT capability element */
878 BOOLEAN fgTdlsInSecurityMode; /* TRUE: security mode */
879 PARAM_KEY_T rTdlsKeyTemp; /* temp to queue the key information */
880
881#define TDLS_SETUP_TIMEOUT_SEC 5 /* unit: second */
882 OS_SYSTIME rTdlsSetupStartTime; /* time when link setup is started */
883
884 OS_SYSTIME rTdlsTxQuotaEmptyTime; /* time when TX quota is 0 */
885
886 STAT_CNT_INFO_DRV_T rTdlsStatistics;
887#endif /* CFG_SUPPORT_TDLS */
888
889#if (CFG_SUPPORT_STATISTICS == 1)
890#define STATS_ENV_TIMEOUT_SEC 10 /* unit: second */
891 OS_SYSTIME rStatsEnvTxPeriodLastTime;
892
893#define STATS_ENV_TX_CNT_REPORT_TRIGGER 2500 /* 6Mbps */
894#define STATS_ENV_TX_CNT_REPORT_TRIGGER_SEC 5 /* unit: second */
895 OS_SYSTIME rStatsEnvTxLastTime;
896 UINT32 u4StatsEnvTxCnt;
897
898 UINT32 u4NumOfNoTxQuota;
899
900 UINT32 u4RxReorderFallAheadCnt;
901 UINT32 u4RxReorderFallBehindCnt;
902 UINT32 u4RxReorderHoleCnt;
903
904 UINT32 u4StatsRxPassToOsCnt;
905
906 /* delay from HIF to pass to OS: us */
907#define STATS_STAY_INT_BYTE_THRESHOLD 500
908 UINT32 u4StayIntMaxRx[3], u4StayIntMinRx[3], u4StayIntAvgRx[3];
909#endif /* CFG_SUPPORT_STATISTICS */
910};
911
912#if 0
913/* use nic_tx.h instead */
914/* MSDU_INFO and SW_RFB structure */
915typedef struct _MSDU_INFO_T {
916
917 //4 /* ----------------MSDU_INFO and SW_RFB Common Fields------------------ */
918
919 LINK_ENTRY_T rLinkEntry;
920 PUINT_8 pucBuffer; /* Pointer to the associated buffer */
921
922 UINT_8 ucBufferSource; /* HIF TX0, HIF TX1, MAC RX, or MNG Pool */
923 UINT_8 ucNetworkTypeIndex; /* Network type index that this TX packet is assocaited with */
924 UINT_8 ucTC; /* 0 to 5 (used by HIF TX to increment the corresponding TC counter) */
925 UINT_8 ucTID; /* Traffic Identification */
926
927 BOOLEAN fgIs802_11Frame; /* Set to TRUE for 802.11 frame */
928 UINT_8 ucMacHeaderLength;
929 UINT_16 u2PayloadLength;
930 PUINT_8 pucMacHeader; /* 802.11 header */
931 PUINT_8 pucPayload; /* 802.11 payload */
932
933 OS_SYSTIME rArrivalTime; /* System Timestamp (4) */
934 P_STA_RECORD_T prStaRec;
935
936#if CFG_PROFILE_BUFFER_TRACING
937 ENUM_BUFFER_ACTIVITY_TYPE_T eActivity[2];
938 UINT_32 rActivityTime[2];
939#endif
940#if DBG && CFG_BUFFER_FREE_CHK
941 BOOLEAN fgBufferInSource;
942#endif
943
944 UINT_8 ucControlFlag; /* For specify some Control Flags, e.g. Basic Rate */
945
946 //4 /* -----------------------Non-Common ------------------------- */
947 /* TODO: move flags to ucControlFlag */
948
949 BOOLEAN fgIs1xFrame; /* Set to TRUE for 802.1x frame */
950
951 /* TXM: For TX Done handling, callback function & parameter (5) */
952 BOOLEAN fgIsTxFailed; /* Set to TRUE if transmission failure */
953
954 PFN_TX_DONE_HANDLER pfTxDoneHandler;
955
956 UINT_64 u8TimeStamp; /* record the TX timestamp */
957
958 /* TXM: For PS forwarding control (per-STA flow control) */
959 UINT_8 ucPsForwardingType; /* Delivery-enabled, non-delivery-enabled, non-PS */
960 UINT_8 ucPsSessionID; /* The Power Save session id for PS forwarding control*/
961
962 /* TXM: For MAC TX DMA operations */
963 UINT_8 ucMacTxQueIdx; /* MAC TX queue: AC0-AC6, BCM, or BCN */
964 BOOLEAN fgNoAck; /* Set to true if Ack is not requred for this packet */
965 BOOLEAN fgBIP; /* Set to true if BIP is used for this packet */
966 UINT_8 ucFragTotalCount;
967 UINT_8 ucFragFinishedCount;
968 UINT_16 u2FragThreshold; /* Fragmentation threshold without WLAN Header & FCS */
969 BOOLEAN fgFixedRate; /* If a fixed rate is used, set to TRUE. */
970 UINT_8 ucFixedRateCode; /* The rate code copied to MAC TX Desc */
971 UINT_8 ucFixedRateRetryLimit; /* The retry limit when a fixed rate is used */
972 BOOLEAN fgIsBmcQueueEnd; /* Set to true if this packet is the end of BMC */
973
974 /* TXM: For flushing ACL frames */
975 UINT_16 u2PalLLH; /* 802.11 PAL LLH */
976 //UINT_16 u2LLH;
977 UINT_16 u2ACLSeq; /* u2LLH+u2ACLSeq for AM HCI flush ACL frame */
978
979 /* TXM for retransmitting a flushed packet */
980 BOOLEAN fgIsSnAssigned;
981 UINT_16 u2SequenceNumber; /* To remember the Sequence Control field of this MPDU */
982
983} MSDU_INFO_T, *P_MSDU_INFO_T;
984#endif
985
986#if 0
987/* nic_rx.h */
988typedef struct _SW_RFB_T {
989
990 //4 /* ----------------MSDU_INFO and SW_RFB Common Fields------------------ */
991
992 LINK_ENTRY_T rLinkEntry;
993 PUINT_8 pucBuffer; /* Pointer to the associated buffer */
994
995 UINT_8 ucBufferSource; /* HIF TX0, HIF TX1, MAC RX, or MNG Pool */
996 UINT_8 ucNetworkTypeIndex; /* Network type index that this TX packet is assocaited with */
997 UINT_8 ucTC; /* 0 to 5 (used by HIF TX to increment the corresponding TC counter) */
998 UINT_8 ucTID; /* Traffic Identification */
999
1000 BOOLEAN fgIs802_11Frame; /* Set to TRUE for 802.11 frame */
1001 UINT_8 ucMacHeaderLength;
1002 UINT_16 u2PayloadLength;
1003 PUINT_8 pucMacHeader; /* 802.11 header */
1004 PUINT_8 pucPayload; /* 802.11 payload */
1005
1006 OS_SYSTIME rArrivalTime; /* System Timestamp (4) */
1007 P_STA_RECORD_T prStaRec;
1008
1009#if CFG_PROFILE_BUFFER_TRACING
1010 ENUM_BUFFER_ACTIVITY_TYPE_T eActivity[2];
1011 UINT_32 rActivityTime[2];
1012#endif
1013#if DBG && CFG_BUFFER_FREE_CHK
1014 BOOLEAN fgBufferInSource;
1015#endif
1016
1017 UINT_8 ucControlFlag; /* For specify some Control Flags, e.g. Basic Rate */
1018
1019 //4 /* -----------------------Non-Common ------------------------- */
1020
1021 /* For composing the HIF RX Header (TODO: move flags to ucControlFlag) */
1022 PUINT_8 pucHifRxPacket; /* Pointer to the Response packet to HIF RX0 or RX1 */
1023 UINT_16 u2HifRxPacketLength;
1024 UINT_8 ucHeaderOffset;
1025 UINT_8 ucHifRxPortIndex;
1026
1027 UINT_16 u2SequenceControl;
1028 BOOLEAN fgIsA4Frame; /* (For MAC RX packet parsing) set to TRUE if 4 addresses are present */
1029 BOOLEAN fgIsBAR;
1030 BOOLEAN fgIsQoSData;
1031 BOOLEAN fgIsAmsduSubframe; /* Set to TRUE for A-MSDU Subframe */
1032
1033 /* For HIF RX DMA Desc */
1034 BOOLEAN fgTUChecksumCheckRequired;
1035 BOOLEAN fgIPChecksumCheckRequired;
1036 UINT_8 ucEtherTypeOffset;
1037
1038} SW_RFB_T, *P_SW_RFB_T;
1039#endif
1040
1041
1042/*******************************************************************************
1043* P U B L I C D A T A
1044********************************************************************************
1045*/
1046
1047/*******************************************************************************
1048* P R I V A T E D A T A
1049********************************************************************************
1050*/
1051
1052/*******************************************************************************
1053* M A C R O S
1054********************************************************************************
1055*/
1056
1057/*******************************************************************************
1058* F U N C T I O N D E C L A R A T I O N S
1059********************************************************************************
1060*/
1061
1062P_MSDU_INFO_T
1063cnmMgtPktAlloc (
1064 IN P_ADAPTER_T prAdapter,
1065 IN UINT_32 u4Length
1066 );
1067
1068VOID
1069cnmMgtPktFree (
1070 IN P_ADAPTER_T prAdapter,
1071 IN P_MSDU_INFO_T prMsduInfo
1072 );
1073
1074VOID
1075cnmMemInit (
1076 IN P_ADAPTER_T prAdapter
1077 );
1078
1079PVOID
1080cnmMemAlloc (
1081 IN P_ADAPTER_T prAdapter,
1082 IN ENUM_RAM_TYPE_T eRamType,
1083 IN UINT_32 u4Length
1084 );
1085
1086VOID
1087cnmMemFree (
1088 IN P_ADAPTER_T prAdapter,
1089 IN PVOID pvMemory
1090 );
1091
1092VOID
1093cnmStaRecInit (
1094 IN P_ADAPTER_T prAdapter
1095 );
1096
1097VOID
1098cnmStaRecUninit (
1099 IN P_ADAPTER_T prAdapter
1100 );
1101
1102P_STA_RECORD_T
1103cnmStaRecAlloc (
1104 IN P_ADAPTER_T prAdapter,
1105 IN UINT_8 ucNetTypeIndex
1106 );
1107
1108VOID
1109cnmStaRecFree (
1110 IN P_ADAPTER_T prAdapter,
1111 IN P_STA_RECORD_T prStaRec,
1112 IN BOOLEAN fgSyncToChip
1113 );
1114
1115VOID
1116cnmStaFreeAllStaByNetType (
1117 P_ADAPTER_T prAdapter,
1118 ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
1119 BOOLEAN fgSyncToChip
1120 );
1121
1122P_STA_RECORD_T
1123cnmGetStaRecByIndex (
1124 IN P_ADAPTER_T prAdapter,
1125 IN UINT_8 ucIndex
1126 );
1127
1128P_STA_RECORD_T
1129cnmGetStaRecByAddress (
1130 IN P_ADAPTER_T prAdapter,
1131 IN UINT_8 ucNetTypeIndex,
1132 IN UINT_8 aucPeerMACAddress[]
1133 );
1134
1135VOID
1136cnmStaRecResetStatus (
1137 IN P_ADAPTER_T prAdapter,
1138 IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex
1139 );
1140
1141VOID
1142cnmStaRecChangeState (
1143 IN P_ADAPTER_T prAdapter,
1144 IN OUT P_STA_RECORD_T prStaRec,
1145 IN UINT_8 ucNewState
1146 );
1147
1148P_STA_RECORD_T
1149cnmStaTheTypeGet (
1150 P_ADAPTER_T prAdapter,
1151 ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
1152 ENUM_STA_TYPE_T eStaType,
1153 UINT32 *pu4StartIdx
1154 );
1155
1156/*******************************************************************************
1157* F U N C T I O N S
1158********************************************************************************
1159*/
1160#ifndef _lint
1161/* Kevin: we don't have to call following function to inspect the data structure.
1162 * It will check automatically while at compile time.
1163 * We'll need this for porting driver to different RTOS.
1164 */
1165__KAL_INLINE__ VOID
1166cnmMemDataTypeCheck (
1167 VOID
1168 )
1169{
1170#if 0
1171 DATA_STRUC_INSPECTING_ASSERT(
1172 OFFSET_OF(MSDU_INFO_T,rLinkEntry) == 0);
1173
1174 DATA_STRUC_INSPECTING_ASSERT(
1175 OFFSET_OF(MSDU_INFO_T,rLinkEntry) == OFFSET_OF(SW_RFB_T,rLinkEntry));
1176
1177 DATA_STRUC_INSPECTING_ASSERT(
1178 OFFSET_OF(MSDU_INFO_T,pucBuffer) == OFFSET_OF(SW_RFB_T,pucBuffer));
1179
1180 DATA_STRUC_INSPECTING_ASSERT(
1181 OFFSET_OF(MSDU_INFO_T,ucBufferSource) ==
1182 OFFSET_OF(SW_RFB_T,ucBufferSource));
1183
1184 DATA_STRUC_INSPECTING_ASSERT(
1185 OFFSET_OF(MSDU_INFO_T,pucMacHeader) ==
1186 OFFSET_OF(SW_RFB_T,pucMacHeader));
1187
1188 DATA_STRUC_INSPECTING_ASSERT(
1189 OFFSET_OF(MSDU_INFO_T,ucMacHeaderLength) ==
1190 OFFSET_OF(SW_RFB_T,ucMacHeaderLength));
1191
1192 DATA_STRUC_INSPECTING_ASSERT(
1193 OFFSET_OF(MSDU_INFO_T,pucPayload) ==
1194 OFFSET_OF(SW_RFB_T,pucPayload));
1195
1196 DATA_STRUC_INSPECTING_ASSERT(
1197 OFFSET_OF(MSDU_INFO_T,u2PayloadLength) ==
1198 OFFSET_OF(SW_RFB_T,u2PayloadLength));
1199
1200 DATA_STRUC_INSPECTING_ASSERT(
1201 OFFSET_OF(MSDU_INFO_T,prStaRec) ==
1202 OFFSET_OF(SW_RFB_T,prStaRec));
1203
1204 DATA_STRUC_INSPECTING_ASSERT(
1205 OFFSET_OF(MSDU_INFO_T,ucNetworkTypeIndex) ==
1206 OFFSET_OF(SW_RFB_T,ucNetworkTypeIndex));
1207
1208 DATA_STRUC_INSPECTING_ASSERT(
1209 OFFSET_OF(MSDU_INFO_T,ucTID) ==
1210 OFFSET_OF(SW_RFB_T,ucTID));
1211
1212 DATA_STRUC_INSPECTING_ASSERT(
1213 OFFSET_OF(MSDU_INFO_T,fgIs802_11Frame) ==
1214 OFFSET_OF(SW_RFB_T,fgIs802_11Frame));
1215
1216 DATA_STRUC_INSPECTING_ASSERT(
1217 OFFSET_OF(MSDU_INFO_T,ucControlFlag) ==
1218 OFFSET_OF(SW_RFB_T,ucControlFlag));
1219
1220 DATA_STRUC_INSPECTING_ASSERT(
1221 OFFSET_OF(MSDU_INFO_T,rArrivalTime) ==
1222 OFFSET_OF(SW_RFB_T,rArrivalTime));
1223
1224 DATA_STRUC_INSPECTING_ASSERT(
1225 OFFSET_OF(MSDU_INFO_T,ucTC) ==
1226 OFFSET_OF(SW_RFB_T,ucTC));
1227
1228#if CFG_PROFILE_BUFFER_TRACING
1229 DATA_STRUC_INSPECTING_ASSERT(
1230 OFFSET_OF(MSDU_INFO_T,eActivity[0]) ==
1231 OFFSET_OF(SW_RFB_T,eActivity[0]));
1232
1233 DATA_STRUC_INSPECTING_ASSERT(
1234 OFFSET_OF(MSDU_INFO_T,rActivityTime[0]) ==
1235 OFFSET_OF(SW_RFB_T,rActivityTime[0]));
1236#endif
1237
1238#if DBG && CFG_BUFFER_FREE_CHK
1239 DATA_STRUC_INSPECTING_ASSERT(
1240 OFFSET_OF(MSDU_INFO_T,fgBufferInSource) ==
1241 OFFSET_OF(SW_RFB_T,fgBufferInSource));
1242#endif
1243
1244
1245 DATA_STRUC_INSPECTING_ASSERT(
1246 OFFSET_OF(STA_RECORD_T,rLinkEntry) == 0);
1247
1248 return;
1249#endif
1250}
1251#endif /* _lint */
1252
1253#endif /* _CNM_MEM_H */
1254
1255