MT6620: add the new driver JB2 V1.0
[firefly-linux-kernel-4.4.55.git] / drivers / mtk_wcn_combo / drv_wlan / mt6620 / wlan / os / linux / include / gl_kal.h
1 /*
2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/os/linux/include/gl_kal.h#1 $
3 */
4
5 /*! \file   gl_kal.h
6     \brief  Declaration of KAL functions - kal*() which is provided by GLUE Layer.
7
8     Any definitions in this file will be shared among GLUE Layer and internal Driver Stack.
9 */
10
11
12
13 /*
14 ** $Log: gl_kal.h $
15  *
16  * 06 13 2012 yuche.tsai
17  * NULL
18  * Update maintrunk driver.
19  * Add support for driver compose assoc request frame.
20  *
21  * 04 12 2012 terry.wu
22  * NULL
23  * Add AEE message support
24  * 1) Show AEE warning(red screen) if SDIO access error occurs
25
26  *
27  * 03 02 2012 terry.wu
28  * NULL
29  * Snc CFG80211 modification for ICS migration from branch 2.2.
30  *
31  * 02 06 2012 wh.su
32  * [WCXRP00001177] [MT6620 Wi-Fi][Driver][2.2] Adding the query channel filter for AP mode
33  * adding the channel query filter for AP mode.
34  *
35  * 01 02 2012 wh.su
36  * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function
37  * Adding the proto type function for set_int set_tx_power and get int get_ch_list.
38  *
39  * 12 13 2011 cm.chang
40  * [WCXRP00001136] [All Wi-Fi][Driver] Add wake lock for pending timer
41  * Add wake lock if timer timeout value is smaller than 5 seconds
42  *
43  * 11 24 2011 wh.su
44  * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
45  * adjust the code for Non-DBG and no XLOG.
46  *
47  * 11 22 2011 cp.wu
48  * [WCXRP00001120] [MT6620 Wi-Fi][Driver] Modify roaming to AIS state transition from synchronous to asynchronous approach to avoid incomplete state termination
49  * 1. change RDD related compile option brace position.
50  * 2. when roaming is triggered, ask AIS to transit immediately only when AIS is in Normal TR state without join timeout timer ticking
51  * 3. otherwise, insert AIS_REQUEST into pending request queue
52  *
53  * 11 11 2011 wh.su
54  * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
55  * modify the xlog related code.
56  *
57  * 11 10 2011 cp.wu
58  * [WCXRP00001098] [MT6620 Wi-Fi][Driver] Replace printk by DBG LOG macros in linux porting layer
59  * 1. eliminaite direct calls to printk in porting layer.
60  * 2. replaced by DBGLOG, which would be XLOG on ALPS platforms.
61  *
62  * 11 10 2011 eddie.chen
63  * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog)
64  * Modify the QM xlog level and remove LOG_FUNC.
65  *
66  * 11 10 2011 wh.su
67  * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
68  * Using the new XLOG define for dum Memory.
69  *
70  * 11 08 2011 eddie.chen
71  * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog)
72  * Add xlog function.
73  *
74  * 11 08 2011 tsaiyuan.hsu
75  * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered
76  * add debug counters, eCurPsProf, for PS.
77  *
78  * 11 08 2011 cm.chang
79  * NULL
80  * Add RLM and CNM debug message for XLOG
81  *
82  * 11 07 2011 tsaiyuan.hsu
83  * [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered
84  * add debug counters and periodically dump counters for debugging.
85  *
86  * 11 03 2011 wh.su
87  * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
88  * Add dumpMemory8 at XLOG support.
89  *
90  * 11 02 2011 wh.su
91  * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
92  * adding the code for XLOG.
93  *
94  * 10 12 2011 wh.su
95  * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP
96  * adding the 802.11w related function and define .
97  *
98  * 04 18 2011 terry.wu
99  * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED
100  * Remove flag CFG_WIFI_DIRECT_MOVED.
101  *
102  * 04 12 2011 cp.wu
103  * [WCXRP00000635] [MT6620 Wi-Fi][Driver] Clear pending security frames when QM clear pending data frames for dedicated network type
104  * include link.h for linux's port.
105  *
106  * 04 12 2011 cp.wu
107  * [WCXRP00000635] [MT6620 Wi-Fi][Driver] Clear pending security frames when QM clear pending data frames for dedicated network type
108  * clear pending security frames for dedicated network type when BSS is being deactivated/disconnected
109  *
110  * 04 01 2011 cp.wu
111  * [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer
112  * 1. simplify config.h due to aggregation options could be also applied for eHPI/SPI interface
113  * 2. use spin-lock instead of semaphore for protecting eHPI access because of possible access from ISR
114  * 3. request_irq() API has some changes between linux kernel 2.6.12 and 2.6.26
115  *
116  * 03 16 2011 cp.wu
117  * [WCXRP00000562] [MT6620 Wi-Fi][Driver] I/O buffer pre-allocation to avoid physically continuous memory shortage after system running for a long period
118  * 1. pre-allocate physical continuous buffer while module is being loaded
119  * 2. use pre-allocated physical continuous buffer for TX/RX DMA transfer
120  *
121  * The windows part remained the same as before, but added similiar APIs to hide the difference.
122  *
123  * 03 10 2011 chinghwa.yu
124  * [WCXRP00000065] Update BoW design and settings
125  * Add BOW table.
126  *
127  * 03 07 2011 terry.wu
128  * [WCXRP00000521] [MT6620 Wi-Fi][Driver] Remove non-standard debug message
129  * Toggle non-standard debug messages to comments.
130  *
131  * 03 06 2011 chinghwa.yu
132  * [WCXRP00000065] Update BoW design and settings
133  * Sync BOW Driver to latest person development branch version..
134  *
135  * 03 02 2011 cp.wu
136  * [WCXRP00000503] [MT6620 Wi-Fi][Driver] Take RCPI brought by association response as initial RSSI right after connection is built.
137  * use RCPI brought by ASSOC-RESP after connection is built as initial RCPI to avoid using a uninitialized MAC-RX RCPI.
138  *
139  * 02 24 2011 cp.wu
140  * [WCXRP00000490] [MT6620 Wi-Fi][Driver][Win32] modify kalMsleep() implementation because NdisMSleep() won't sleep long enough for specified interval such as 500ms
141  * modify cnm_timer and hem_mbox APIs to be thread safe to ease invoking restrictions
142  *
143  * 01 12 2011 cp.wu
144  * [WCXRP00000357] [MT6620 Wi-Fi][Driver][Bluetooth over Wi-Fi] add another net device interface for BT AMP
145  * implementation of separate BT_OVER_WIFI data path.
146  *
147  * 01 04 2011 cp.wu
148  * [WCXRP00000338] [MT6620 Wi-Fi][Driver] Separate kalMemAlloc into kmalloc and vmalloc implementations to ease physically continous memory demands
149  * separate kalMemAlloc() into virtually-continous and physically-continous type to ease slab system pressure
150  *
151  * 12 31 2010 cp.wu
152  * [WCXRP00000335] [MT6620 Wi-Fi][Driver] change to use milliseconds sleep instead of delay to avoid blocking to system scheduling
153  * change to use msleep() and shorten waiting interval to reduce blocking to other task while Wi-Fi driver is being loaded
154  *
155  * 12 31 2010 jeffrey.chang
156  * [WCXRP00000332] [MT6620 Wi-Fi][Driver] add kal sleep function for delay which use blocking call
157  * modify the implementation of kalDelay to msleep
158  *
159  * 12 22 2010 cp.wu
160  * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery
161  * 1. header file restructure for more clear module isolation
162  * 2. add function interface definition for implementing Service Discovery callbacks
163  *
164  * 11 30 2010 yuche.tsai
165  * NULL
166  * Invitation & Provision Discovery Indication.
167  *
168  * 11 26 2010 cp.wu
169  * [WCXRP00000209] [MT6620 Wi-Fi][Driver] Modify NVRAM checking mechanism to warning only with necessary data field checking
170  * 1. NVRAM error is now treated as warning only, thus normal operation is still available but extra scan result used to indicate user is attached
171  * 2. DPD and TX-PWR are needed fields from now on, if these 2 fields are not availble then warning message is shown
172  *
173  * 11 08 2010 cp.wu
174  * [WCXRP00000166] [MT6620 Wi-Fi][Driver] use SDIO CMD52 for enabling/disabling interrupt to reduce transaction period
175  * change to use CMD52 for enabling/disabling interrupt to reduce SDIO transaction time
176  *
177  * 11 01 2010 cp.wu
178  * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000150] [MT6620 Wi-Fi][Driver] Add implementation for querying current TX rate from firmware auto rate module
179  * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead
180  * 2) Remove CNM CH-RECOVER event handling
181  * 3) cfg read/write API renamed with kal prefix for unified naming rules.
182  *
183  * 10 05 2010 cp.wu
184  * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
185  * 1) add NVRAM access API
186  * 2) fake scanning result when NVRAM doesn't exist and/or version mismatch. (off by compiler option)
187  * 3) add OID implementation for NVRAM read/write service
188  *
189  * 10 04 2010 wh.su
190  * [WCXRP00000081] [MT6620][Driver] Fix the compiling error at WinXP while enable P2P
191  * add a kal function for set cipher.
192  *
193  * 10 04 2010 wh.su
194  * [WCXRP00000081] [MT6620][Driver] Fix the compiling error at WinXP while enable P2P
195  * fixed compiling error while enable p2p.
196  *
197  * 09 28 2010 wh.su
198  * NULL
199  * [WCXRP00000069][MT6620 Wi-Fi][Driver] Fix some code for phase 1 P2P Demo.
200  *
201  * 09 21 2010 cp.wu
202  * [WCXRP00000053] [MT6620 Wi-Fi][Driver] Reset incomplete and might leads to BSOD when entering RF test with AIS associated
203  * Do a complete reset with STA-REC null checking for RF test re-entry
204  *
205  * 09 21 2010 kevin.huang
206  * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning
207  * Eliminate Linux Compile Warning
208  *
209  * 09 10 2010 wh.su
210  * NULL
211  * fixed the compiling error at win XP.
212  *
213  * 09 07 2010 wh.su
214  * NULL
215  * adding the code for beacon/probe req/ probe rsp wsc ie at p2p.
216  *
217  * 09 06 2010 wh.su
218  * NULL
219  * let the p2p can set the privacy bit at beacon and rsn ie at assoc req at key handshake state.
220  *
221  * 09 03 2010 kevin.huang
222  * NULL
223  * Refine #include sequence and solve recursive/nested #include issue
224  *
225  * 08 06 2010 cp.wu
226  * NULL
227  * driver hook modifications corresponding to ioctl interface change.
228  *
229  * 08 03 2010 cp.wu
230  * NULL
231  * [Wi-Fi Direct Driver Hook] change event indication API to be consistent with supplicant
232  *
233  * 08 03 2010 cp.wu
234  * NULL
235  * [Wi-Fi Direct] add framework for driver hooks
236  *
237  * 08 02 2010 jeffrey.chang
238  * NULL
239  * modify kalSetEvent declaration
240  *
241  * 07 29 2010 cp.wu
242  * NULL
243  * simplify post-handling after TX_DONE interrupt is handled.
244  *
245  * 07 23 2010 cp.wu
246  *
247  * 1) re-enable AIS-FSM beacon timeout handling.
248  * 2) scan done API revised
249  *
250  * 07 23 2010 jeffrey.chang
251  *
252  * fix kal header file
253  *
254  * 07 22 2010 jeffrey.chang
255  *
256  * use different spin lock for security frame
257  *
258  * 07 22 2010 jeffrey.chang
259  *
260  * add new spinlock
261  *
262  * 07 19 2010 jeffrey.chang
263  *
264  * add kal api for scanning done
265  *
266  * 07 19 2010 jeffrey.chang
267  *
268  * modify cmd/data path for new design
269  *
270  * 07 19 2010 jeffrey.chang
271  *
272  * add new kal api
273  *
274  * 07 19 2010 jeffrey.chang
275  *
276  * Linux port modification
277  *
278  * 07 08 2010 cp.wu
279  *
280  * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
281  *
282  * 06 21 2010 cp.wu
283  * [WPD00003833][MT6620 and MT5931] Driver migration
284  * change MAC address updating logic.
285  *
286  * 06 18 2010 cm.chang
287  * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
288  * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf
289  *
290  * 06 11 2010 cp.wu
291  * [WPD00003833][MT6620 and MT5931] Driver migration
292  * 1) migrate assoc.c.
293  * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
294  * 3) add configuration options for CNM_MEM and RSN modules
295  * 4) add data path for management frames
296  * 5) eliminate rPacketInfo of MSDU_INFO_T
297  *
298  * 06 07 2010 cp.wu
299  * [WPD00003833][MT6620 and MT5931] Driver migration
300  * gl_kal merged
301  *
302  * 06 06 2010 kevin.huang
303  * [WPD00003832][MT6620 5931] Create driver base
304  * [MT6620 5931] Create driver base
305  *
306  * 05 17 2010 cp.wu
307  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
308  * add basic handling framework for wireless extension ioctls.
309  *
310  * 05 11 2010 cp.wu
311  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
312  * add ioctl for controlling p2p scan phase parameters
313  *
314  * 05 10 2010 cp.wu
315  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
316  * fill network type field while doing frame identification.
317  *
318  * 05 10 2010 cp.wu
319  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
320  * implement basic wi-fi direct framework
321  *
322  * 05 07 2010 cp.wu
323  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
324  * add basic framework for implementating P2P driver hook.
325  *
326  * 05 07 2010 jeffrey.chang
327  * [WPD00003826]Initial import for Linux port
328  * modify kalMemAlloc method
329  *
330  * 04 28 2010 cp.wu
331  * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
332  * change prefix for data structure used to communicate with 802.11 PAL
333  * to avoid ambiguous naming with firmware interface
334  *
335  * 04 27 2010 cp.wu
336  * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
337  * add multiple physical link support
338  *
339  * 04 27 2010 jeffrey.chang
340  * [WPD00003826]Initial import for Linux port
341  * follow Linux's firmware framework, and remove unused kal API
342  *
343  * 04 22 2010 cp.wu
344  * [WPD00001943]Create WiFi test driver framework on WinXP
345  * when acquiring driver-own, wait for up to 8 seconds.
346  *
347  * 04 22 2010 jeffrey.chang
348  * [WPD00003826]Initial import for Linux port
349  *
350  * 1) modify rx path code for supporting Wi-Fi direct
351  * 2) modify config.h since Linux dont need to consider retaining packet
352  *
353  * 04 21 2010 jeffrey.chang
354  * [WPD00003826]Initial import for Linux port
355  * add for private ioctl support
356  *
357  * 04 20 2010 cp.wu
358  * [WPD00001943]Create WiFi test driver framework on WinXP
359  * don't need SPIN_LOCK_PWR_CTRL anymore, it will raise IRQL
360  *  * and cause SdBusSubmitRequest running at DISPATCH_LEVEL as well.
361  *
362  * 04 14 2010 cp.wu
363  * [WPD00001943]Create WiFi test driver framework on WinXP
364  * information buffer for query oid/ioctl is now buffered in prCmdInfo
365  *  *  *  *  *  *  *  * instead of glue-layer variable to improve multiple oid/ioctl capability
366  *
367  * 04 13 2010 cp.wu
368  * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
369  * add framework for BT-over-Wi-Fi support.
370  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * 1) prPendingCmdInfo is replaced by queue for multiple handler capability
371  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * 2) command sequence number is now increased atomically
372  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * 3) private data could be hold and taken use for other purpose
373  *
374  * 04 09 2010 jeffrey.chang
375  * [WPD00003826]Initial import for Linux port
376  * 1) add spinlock
377  *  *  * 2) add KAPI for handling association info
378  *
379  * 04 09 2010 jeffrey.chang
380  * [WPD00003826]Initial import for Linux port
381  * adding firmware download KAPI
382  *
383  * 04 07 2010 cp.wu
384  * [WPD00001943]Create WiFi test driver framework on WinXP
385  * finish non-glue layer access to glue variables
386  *
387  * 04 07 2010 cp.wu
388  * [WPD00001943]Create WiFi test driver framework on WinXP
389  * accessing to firmware load/start address, and access to OID handling information
390  *  *  *  * are now handled in glue layer
391  *
392  * 04 07 2010 cp.wu
393  * [WPD00001943]Create WiFi test driver framework on WinXP
394  * rWlanInfo should be placed at adapter rather than glue due to most operations
395  *  *  *  *  *  *  *  *  * are done in adapter layer.
396  *
397  * 04 07 2010 cp.wu
398  * [WPD00001943]Create WiFi test driver framework on WinXP
399  * eliminate direct access to prGlueInfo->eParamMediaStateIndicated from non-glue layer
400  *
401  * 04 06 2010 cp.wu
402  * [WPD00001943]Create WiFi test driver framework on WinXP
403  * add KAL API: kalFlushPendingTxPackets(), and take use of the API
404  *
405  * 04 06 2010 cp.wu
406  * [WPD00001943]Create WiFi test driver framework on WinXP
407  * eliminate direct access to prGlueInfo->rWlanInfo.eLinkAttr.ucMediaStreamMode from non-glue layer.
408  *
409  * 04 06 2010 jeffrey.chang
410  * [WPD00003826]Initial import for Linux port
411  * improve none-glue code portability
412  *
413  * 04 06 2010 cp.wu
414  * [WPD00001943]Create WiFi test driver framework on WinXP
415  * code refine: fgTestMode should be at adapter rather than glue due to the device/fw is also involved
416  *
417  * 04 06 2010 cp.wu
418  * [WPD00001943]Create WiFi test driver framework on WinXP
419  * 1) for some OID, never do timeout expiration
420  *  *  *  * 2) add 2 kal API for later integration
421  *
422  * 03 30 2010 jeffrey.chang
423  * [WPD00003826]Initial import for Linux port
424  * emulate NDIS Pending OID facility
425  *
426  * 03 26 2010 jeffrey.chang
427  * [WPD00003826]Initial import for Linux port
428  * [WPD00003826] Initial import for Linux port
429  * adding firmware download KAPI
430  *
431  * 03 24 2010 jeffrey.chang
432  * [WPD00003826]Initial import for Linux port
433  * initial import for Linux port
434 **  \main\maintrunk.MT5921\41 2009-09-28 20:19:23 GMT mtk01090
435 **  Add private ioctl to carry OID structures. Restructure public/private ioctl interfaces to Linux kernel.
436 **  \main\maintrunk.MT5921\40 2009-08-18 22:57:09 GMT mtk01090
437 **  Add Linux SDIO (with mmc core) support.
438 **  Add Linux 2.6.21, 2.6.25, 2.6.26.
439 **  Fix compile warning in Linux.
440 **  \main\maintrunk.MT5921\39 2009-06-23 23:19:15 GMT mtk01090
441 **  Add build option BUILD_USE_EEPROM and compile option CFG_SUPPORT_EXT_CONFIG for NVRAM support
442 **  \main\maintrunk.MT5921\38 2009-02-09 14:03:17 GMT mtk01090
443 **  Add KAL function kalDevSetPowerState(). It is not implemented yet. Only add an empty macro.
444 **
445 **  \main\maintrunk.MT5921\37 2009-01-22 13:05:59 GMT mtk01088
446 **  new defeine to got 1x value at packet reserved field
447 **  \main\maintrunk.MT5921\36 2008-12-08 16:15:02 GMT mtk01461
448 **  Add kalQueryValidBufferLength() macro
449 **  \main\maintrunk.MT5921\35 2008-11-13 20:33:15 GMT mtk01104
450 **  Remove lint warning
451 **  \main\maintrunk.MT5921\34 2008-10-22 11:05:52 GMT mtk01461
452 **  Remove unused macro
453 **  \main\maintrunk.MT5921\33 2008-10-16 15:48:17 GMT mtk01461
454 **  Update driver to fix lint warning
455 **  \main\maintrunk.MT5921\32 2008-09-02 11:50:51 GMT mtk01461
456 **  SPIN_LOCK_SDIO_DDK_TX_QUE
457 **  \main\maintrunk.MT5921\31 2008-08-29 15:58:30 GMT mtk01088
458 **  remove non-used function for code refine
459 **  \main\maintrunk.MT5921\30 2008-08-21 00:33:29 GMT mtk01461
460 **  Update for Driver Review
461 **  \main\maintrunk.MT5921\29 2008-06-19 13:29:14 GMT mtk01425
462 **  1. Add declaration of SPIN_LOCK_SDIO_DDK_TX_QUE and SPIN_LOCK_SDIO_DDK_RX_QUE
463 **  \main\maintrunk.MT5921\28 2008-05-30 20:27:34 GMT mtk01461
464 **  Rename KAL function
465 **  \main\maintrunk.MT5921\27 2008-05-30 14:42:05 GMT mtk01461
466 **  Remove WMM Assoc Flag in KAL
467 **  \main\maintrunk.MT5921\26 2008-05-29 14:15:18 GMT mtk01084
468 **  remove un-used function
469 **  \main\maintrunk.MT5921\25 2008-04-23 14:02:20 GMT mtk01084
470 **  modify KAL port access function prototype
471 **  \main\maintrunk.MT5921\24 2008-04-17 23:06:41 GMT mtk01461
472 **  Add iwpriv support for AdHocMode setting
473 **  \main\maintrunk.MT5921\23 2008-04-08 15:38:50 GMT mtk01084
474 **  add KAL function to setting pattern search function enable/ disable
475 **  \main\maintrunk.MT5921\22 2008-03-26 15:34:48 GMT mtk01461
476 **  Add update MAC address func
477 **  \main\maintrunk.MT5921\21 2008-03-18 15:56:15 GMT mtk01084
478 **  update ENUM_NIC_INITIAL_PARAM_E
479 **  \main\maintrunk.MT5921\20 2008-03-18 11:49:28 GMT mtk01084
480 **  update function for initial value access
481 **  \main\maintrunk.MT5921\19 2008-03-18 10:21:31 GMT mtk01088
482 **  use kal update associate request at linux
483 **  \main\maintrunk.MT5921\18 2008-03-14 18:03:41 GMT mtk01084
484 **  refine register and port access function
485 **  \main\maintrunk.MT5921\17 2008-03-11 14:51:02 GMT mtk01461
486 **  Add copy_to(from)_user macro
487 **  \main\maintrunk.MT5921\16 2008-03-06 23:42:21 GMT mtk01385
488 **  1. add Query Registry Mac address function.
489 **  \main\maintrunk.MT5921\15 2008-02-26 09:48:04 GMT mtk01084
490 **  modify KAL set network address/ checksum offload part
491 **  \main\maintrunk.MT5921\14 2008-01-09 17:54:58 GMT mtk01084
492 **  Modify the argument of kalQueryPacketInfo
493 **  \main\maintrunk.MT5921\13 2007-11-29 02:05:20 GMT mtk01461
494 **  Fix Windows RX multiple packet retain problem
495 **  \main\maintrunk.MT5921\12 2007-11-26 19:43:45 GMT mtk01461
496 **  Add OS_TIMESTAMP macro
497 **
498 **  \main\maintrunk.MT5921\11 2007-11-09 16:36:15 GMT mtk01425
499 **  1. Modify for CSUM offloading with Tx Fragment
500 **  \main\maintrunk.MT5921\10 2007-11-07 18:38:37 GMT mtk01461
501 **  Add Tx Fragmentation Support
502 **  \main\maintrunk.MT5921\9 2007-11-06 19:36:50 GMT mtk01088
503 **  add the WPS related code
504 **  \main\maintrunk.MT5921\8 2007-11-02 01:03:57 GMT mtk01461
505 **  Unify TX Path for Normal and IBSS Power Save + IBSS neighbor learning
506 ** Revision 1.4  2007/07/05 07:25:33  MTK01461
507 ** Add Linux initial code, modify doc, add 11BB, RF init code
508 **
509 ** Revision 1.3  2007/06/27 02:18:50  MTK01461
510 ** Update SCAN_FSM, Initial(Can Load Module), Proc(Can do Reg R/W), TX API
511 **
512 ** Revision 1.2  2007/06/25 06:16:23  MTK01461
513 ** Update illustrations, gl_init.c, gl_kal.c, gl_kal.h, gl_os.h and RX API
514 **
515 */
516
517
518 #ifndef _GL_KAL_H
519 #define _GL_KAL_H
520
521
522 /*******************************************************************************
523 *                         C O M P I L E R   F L A G S
524 ********************************************************************************
525 */
526
527 /*******************************************************************************
528 *                    E X T E R N A L   R E F E R E N C E S
529 ********************************************************************************
530 */
531 #include "config.h"
532 #include "gl_typedef.h"
533 #include "gl_os.h"
534 #include "link.h"
535 #include "nic/mac.h"
536 #include "nic/wlan_def.h"
537 #include "wlan_lib.h"
538 #include "wlan_oid.h"
539 #include "gl_wext_priv.h"
540
541
542 #if CFG_ENABLE_BT_OVER_WIFI
543     #include "nic/bow.h"
544 #endif
545
546 #if DBG
547 extern int allocatedMemSize;
548 #endif
549
550 /*******************************************************************************
551 *                              C O N S T A N T S
552 ********************************************************************************
553 */
554 //#define USEC_PER_MSEC   (1000)
555
556 /*******************************************************************************
557 *                             D A T A   T Y P E S
558 ********************************************************************************
559 */
560 typedef enum _ENUM_SPIN_LOCK_CATEGORY_E {
561     SPIN_LOCK_FSM = 0,
562
563   /* FIX ME */
564     SPIN_LOCK_RX_QUE,
565     SPIN_LOCK_TX_QUE,
566     SPIN_LOCK_CMD_QUE,
567     SPIN_LOCK_TX_RESOURCE,
568     SPIN_LOCK_CMD_RESOURCE,
569     SPIN_LOCK_QM_TX_QUEUE,
570     SPIN_LOCK_CMD_PENDING,
571     SPIN_LOCK_CMD_SEQ_NUM,
572     SPIN_LOCK_TX_MSDU_INFO_LIST,
573     SPIN_LOCK_TXING_MGMT_LIST,
574     SPIN_LOCK_TX_SEQ_NUM,
575     SPIN_LOCK_TX_COUNT,
576     SPIN_LOCK_TXS_COUNT,
577   /* end    */
578     SPIN_LOCK_TX,
579     SPIN_LOCK_IO_REQ,
580     SPIN_LOCK_INT,
581
582     SPIN_LOCK_MGT_BUF,
583     SPIN_LOCK_MSG_BUF,
584     SPIN_LOCK_STA_REC,
585
586     SPIN_LOCK_MAILBOX,
587     SPIN_LOCK_TIMER,
588
589     SPIN_LOCK_BOW_TABLE,
590
591     SPIN_LOCK_EHPI_BUS, /* only for EHPI */
592     SPIN_LOCK_NET_DEV,
593     SPIN_LOCK_NUM
594 } ENUM_SPIN_LOCK_CATEGORY_E;
595
596 /* event for assoc infomation update */
597 typedef struct _EVENT_ASSOC_INFO {
598     UINT_8      ucAssocReq; /* 1 for assoc req, 0 for assoc rsp */
599     UINT_8      ucReassoc;  /* 0 for assoc, 1 for reassoc */
600     UINT_16     u2Length;
601     PUINT_8     pucIe;
602 } EVENT_ASSOC_INFO, *P_EVENT_ASSOC_INFO;
603
604 typedef enum _ENUM_KAL_NETWORK_TYPE_INDEX_T {
605     KAL_NETWORK_TYPE_AIS_INDEX = 0,
606 #if CFG_ENABLE_WIFI_DIRECT
607     KAL_NETWORK_TYPE_P2P_INDEX,
608 #endif
609 #if CFG_ENABLE_BT_OVER_WIFI
610     KAL_NETWORK_TYPE_BOW_INDEX,
611 #endif
612     KAL_NETWORK_TYPE_INDEX_NUM
613 } ENUM_KAL_NETWORK_TYPE_INDEX_T;
614
615 typedef enum _ENUM_KAL_MEM_ALLOCATION_TYPE_E {
616     PHY_MEM_TYPE,   /* physically continuous */
617     VIR_MEM_TYPE,   /* virtually continous */
618     MEM_TYPE_NUM
619 } ENUM_KAL_MEM_ALLOCATION_TYPE;
620
621 #if CONFIG_ANDROID /* Defined in Android kernel source */
622 typedef struct wake_lock    KAL_WAKE_LOCK_T, *P_KAL_WAKE_LOCK_T;
623 #else
624 typedef UINT_32             KAL_WAKE_LOCK_T, *P_KAL_WAKE_LOCK_T;
625 #endif
626
627 /*******************************************************************************
628 *                            P U B L I C   D A T A
629 ********************************************************************************
630 */
631
632 /*******************************************************************************
633 *                           P R I V A T E   D A T A
634 ********************************************************************************
635 */
636
637 /*******************************************************************************
638 *                                 M A C R O S
639 ********************************************************************************
640 */
641 /*----------------------------------------------------------------------------*/
642 /* Macros of SPIN LOCK operations for using in Driver Layer                   */
643 /*----------------------------------------------------------------------------*/
644 #define KAL_SPIN_LOCK_DECLARATION()             UINT_32 __u4Flags
645
646 #define KAL_ACQUIRE_SPIN_LOCK(_prAdapter, _rLockCategory)   \
647             kalAcquireSpinLock(((P_ADAPTER_T)_prAdapter)->prGlueInfo, _rLockCategory, &__u4Flags)
648
649 #define KAL_RELEASE_SPIN_LOCK(_prAdapter, _rLockCategory)   \
650             kalReleaseSpinLock(((P_ADAPTER_T)_prAdapter)->prGlueInfo, _rLockCategory, __u4Flags)
651
652 /*----------------------------------------------------------------------------*/
653 /* Macros for accessing Reserved Fields of native packet                      */
654 /*----------------------------------------------------------------------------*/
655 #define KAL_GET_PKT_QUEUE_ENTRY(_p)             GLUE_GET_PKT_QUEUE_ENTRY(_p)
656 #define KAL_GET_PKT_DESCRIPTOR(_prQueueEntry)   GLUE_GET_PKT_DESCRIPTOR(_prQueueEntry)
657 #define KAL_GET_PKT_TID(_p)                     GLUE_GET_PKT_TID(_p)
658 #define KAL_GET_PKT_IS1X(_p)                    GLUE_GET_PKT_IS1X(_p)
659 #define KAL_GET_PKT_HEADER_LEN(_p)              GLUE_GET_PKT_HEADER_LEN(_p)
660 #define KAL_GET_PKT_PAYLOAD_LEN(_p)             GLUE_GET_PKT_PAYLOAD_LEN(_p)
661 #define KAL_GET_PKT_ARRIVAL_TIME(_p)            GLUE_GET_PKT_ARRIVAL_TIME(_p)
662
663 /*----------------------------------------------------------------------------*/
664 /* Macros of wake_lock operations for using in Driver Layer                   */
665 /*----------------------------------------------------------------------------*/
666 #if CONFIG_ANDROID /* Defined in Android kernel source */
667 #define KAL_WAKE_LOCK_INIT(_prAdapter, _prWakeLock, _pcName) \
668         wake_lock_init(_prWakeLock, WAKE_LOCK_SUSPEND, _pcName)
669
670 #define KAL_WAKE_LOCK_DESTROY(_prAdapter, _prWakeLock) \
671         wake_lock_destroy(_prWakeLock)
672
673 #define KAL_WAKE_LOCK(_prAdapter, _prWakeLock) \
674         wake_lock(_prWakeLock)
675
676 #define KAL_WAKE_LOCK_TIMEOUT(_prAdapter, _prWakeLock, _u4Timeout) \
677         wake_lock_timeout(_prWakeLock, _u4Timeout)
678
679 #define KAL_WAKE_UNLOCK(_prAdapter, _prWakeLock) \
680         wake_unlock(_prWakeLock)
681
682 #else
683 #define KAL_WAKE_LOCK_INIT(_prAdapter, _prWakeLock, _pcName)
684 #define KAL_WAKE_LOCK_DESTROY(_prAdapter, _prWakeLock)
685 #define KAL_WAKE_LOCK(_prAdapter, _prWakeLock)
686 #define KAL_WAKE_LOCK_TIMEOUT(_prAdapter, _prWakeLock, _u4Timeout)
687 #define KAL_WAKE_UNLOCK(_prAdapter, _prWakeLock)
688 #endif
689
690 /*----------------------------------------------------------------------------*/
691 /*!
692 * \brief Cache memory allocation
693 *
694 * \param[in] u4Size Required memory size.
695 * \param[in] eMemType  Memory allocation type
696 *
697 * \return Pointer to allocated memory
698 *         or NULL
699 */
700 /*----------------------------------------------------------------------------*/
701 #if DBG
702 #define kalMemAlloc(u4Size, eMemType) ({    \
703     void *pvAddr; \
704     if(eMemType == PHY_MEM_TYPE) { \
705         pvAddr = kmalloc(u4Size, GFP_KERNEL);   \
706     } \
707     else { \
708         pvAddr = vmalloc(u4Size);   \
709     } \
710     if (pvAddr) {   \
711         allocatedMemSize += u4Size;   \
712         printk(KERN_INFO DRV_NAME "0x%p(%ld) allocated (%s:%s)\n", \
713             pvAddr, (UINT_32)u4Size, __FILE__, __FUNCTION__);  \
714     }   \
715     pvAddr; \
716     })
717 #else
718 #define kalMemAlloc(u4Size, eMemType) ({    \
719     void *pvAddr; \
720     if(eMemType == PHY_MEM_TYPE) { \
721         pvAddr = kmalloc(u4Size, GFP_KERNEL);   \
722     } \
723     else { \
724         pvAddr = vmalloc(u4Size);   \
725     } \
726     pvAddr; \
727     })
728 #endif
729
730 /*----------------------------------------------------------------------------*/
731 /*!
732 * \brief Free allocated cache memory
733 *
734 * \param[in] pvAddr Required memory size.
735 * \param[in] eMemType  Memory allocation type
736 * \param[in] u4Size Allocated memory size.
737 *
738 * \return -
739 */
740 /*----------------------------------------------------------------------------*/
741 #if DBG
742 #define kalMemFree(pvAddr, eMemType, u4Size)  \
743     {   \
744         if (pvAddr) {   \
745             allocatedMemSize -= u4Size; \
746             printk(KERN_INFO DRV_NAME "0x%p(%ld) freed (%s:%s)\n", \
747                 pvAddr, (UINT_32)u4Size, __FILE__, __FUNCTION__);  \
748         }   \
749         if(eMemType == PHY_MEM_TYPE) { \
750             kfree(pvAddr); \
751         } \
752         else { \
753             vfree(pvAddr); \
754         } \
755     }
756 #else
757 #define kalMemFree(pvAddr, eMemType, u4Size)  \
758     {   \
759         if(eMemType == PHY_MEM_TYPE) { \
760             kfree(pvAddr); \
761         } \
762         else { \
763             vfree(pvAddr); \
764         } \
765     }
766 #endif
767
768 #define kalUdelay(u4USec)                           udelay(u4USec)
769
770 #define kalMdelay(u4MSec)                           mdelay(u4MSec)
771 #define kalMsleep(u4MSec)                           msleep(u4MSec)
772
773 /* Copy memory from user space to kernel space */
774 #define kalMemCopyFromUser(_pvTo, _pvFrom, _u4N)    copy_from_user(_pvTo, _pvFrom, _u4N)
775
776 /* Copy memory from kernel space to user space */
777 #define kalMemCopyToUser(_pvTo, _pvFrom, _u4N)      copy_to_user(_pvTo, _pvFrom, _u4N)
778
779 /* Copy memory block with specific size */
780 #define kalMemCopy(pvDst, pvSrc, u4Size)            memcpy(pvDst, pvSrc, u4Size)
781
782 /* Set memory block with specific pattern */
783 #define kalMemSet(pvAddr, ucPattern, u4Size)        memset(pvAddr, ucPattern, u4Size)
784
785 /* Compare two memory block with specific length.
786  * Return zero if they are the same.
787  */
788 #define kalMemCmp(pvAddr1, pvAddr2, u4Size)         memcmp(pvAddr1, pvAddr2, u4Size)
789
790 /* Zero specific memory block */
791 #define kalMemZero(pvAddr, u4Size)                  memset(pvAddr, 0, u4Size)
792
793 /* defined for wince sdio driver only */
794 #if defined(_HIF_SDIO)
795 #define kalDevSetPowerState(prGlueInfo, ePowerMode) glSetPowerState(prGlueInfo, ePowerMode)
796 #else
797 #define kalDevSetPowerState(prGlueInfo, ePowerMode)
798 #endif
799
800 /*----------------------------------------------------------------------------*/
801 /*!
802 * \brief Notify OS with SendComplete event of the specific packet. Linux should
803 *        free packets here.
804 *
805 * \param[in] prGlueInfo     Pointer of GLUE Data Structure
806 * \param[in] pvPacket       Pointer of Packet Handle
807 * \param[in] status         Status Code for OS upper layer
808 *
809 * \return -
810 */
811 /*----------------------------------------------------------------------------*/
812 #define kalSendComplete(prGlueInfo, pvPacket, status)   \
813             kalSendCompleteAndAwakeQueue(prGlueInfo, pvPacket)
814
815
816 /*----------------------------------------------------------------------------*/
817 /*!
818 * \brief This function is used to locate the starting address of incoming ethernet
819 *        frame for skb.
820 *
821 * \param[in] prGlueInfo     Pointer of GLUE Data Structure
822 * \param[in] pvPacket       Pointer of Packet Handle
823 *
824 * \return starting address of ethernet frame buffer.
825 */
826 /*----------------------------------------------------------------------------*/
827 #define kalQueryBufferPointer(prGlueInfo, pvPacket)     \
828             ((PUINT_8)((struct sk_buff *)pvPacket)->data)
829
830
831 /*----------------------------------------------------------------------------*/
832 /*!
833 * \brief This function is used to query the length of valid buffer which is accessible during
834 *         port read/write.
835 *
836 * \param[in] prGlueInfo     Pointer of GLUE Data Structure
837 * \param[in] pvPacket       Pointer of Packet Handle
838 *
839 * \return starting address of ethernet frame buffer.
840 */
841 /*----------------------------------------------------------------------------*/
842 #define kalQueryValidBufferLength(prGlueInfo, pvPacket)     \
843             ((UINT_32)((struct sk_buff *)pvPacket)->end -  \
844              (UINT_32)((struct sk_buff *)pvPacket)->data)
845
846 /*----------------------------------------------------------------------------*/
847 /*!
848 * \brief This function is used to copy the entire frame from skb to the destination
849 *        address in the input parameter.
850 *
851 * \param[in] prGlueInfo     Pointer of GLUE Data Structure
852 * \param[in] pvPacket       Pointer of Packet Handle
853 * \param[in] pucDestBuffer  Destination Address
854 *
855 * \return -
856 */
857 /*----------------------------------------------------------------------------*/
858 #define kalCopyFrame(prGlueInfo, pvPacket, pucDestBuffer)   \
859             {struct sk_buff *skb = (struct sk_buff *)pvPacket; \
860              memcpy(pucDestBuffer, skb->data, skb->len);}
861
862 #define kalGetTimeTick()                            jiffies_to_msecs(jiffies)
863
864 #define kalPrint                                    printk
865
866 #if !DBG
867 #if CFG_SUPPORT_XLOG
868 #define XLOG_TAG   "wlan"
869
870 #define XLOG_FUNC(__LEVEL, __FMT...)\
871     if (__LEVEL == ANDROID_LOG_ERROR) {\
872         xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, ##__FMT);\
873     } \
874     else if (__LEVEL == ANDROID_LOG_WARN) {\
875         xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, ##__FMT);\
876     } \
877     else if (__LEVEL == ANDROID_LOG_INFO) {\
878         xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, ##__FMT);\
879     } \
880     else if (__LEVEL == ANDROID_LOG_DEBUG) {\
881         xlog_printk(ANDROID_LOG_DEBUG, XLOG_TAG, ##__FMT);\
882     } \
883     else if (__LEVEL == ANDROID_LOG_VERBOSE) {\
884         xlog_printk(ANDROID_LOG_VERBOSE, XLOG_TAG, ##__FMT);\
885     }
886
887 #define AIS_ERROR_LOGFUNC(_Fmt...)
888 #define AIS_WARN_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, _Fmt)
889 #define AIS_INFO_LOGFUNC(_Fmt...)
890 #define AIS_STATE_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt)
891 #define AIS_EVENT_LOGFUNC(_Fmt...)
892 #define AIS_TRACE_LOGFUNC(_Fmt...)
893 #define AIS_LOUD_LOGFUNC(_Fmt...)
894 #define AIS_TEMP_LOGFUNC(_Fmt...)
895
896 #define AIS_ERROR_LOGDUMP8(x, y)
897 #define AIS_WARN_LOGDUMP8(x, y)
898 #define AIS_INFO_LOGDUMP8(x, y)
899 #define AIS_STATE_LOGDUMP8(x, y)
900 #define AIS_EVENT_LOGDUMP8(x, y)
901 #define AIS_TRACE_LOGDUMP8(x, y)
902 #define AIS_LOUD_LOGDUMP8(x, y)
903 #define AIS_TEMP_LOGDUMP8(x, y)
904
905 #define INTR_ERROR_LOGFUNC(_Fmt...)
906 #define INTR_WARN_LOGFUNC(_Fmt...)
907 #define INTR_INFO_LOGFUNC(_Fmt...)
908 #define INTR_STATE_LOGFUNC(_Fmt...)
909 #define INTR_EVENT_LOGFUNC(_Fmt...)
910 #define INTR_TRACE_LOGFUNC(_Fmt...)
911 #define INTR_LOUD_LOGFUNC(_Fmt...)
912 #define INTR_TEMP_LOGFUNC(_Fmt...)
913
914 #define INTR_ERROR_LOGDUMP8(x, y)
915 #define INTR_WARN_LOGDUMP8(x, y)
916 #define INTR_INFO_LOGDUMP8(x, y)
917 #define INTR_STATE_LOGDUMP8(x, y)
918 #define INTR_EVENT_LOGDUMP8(x, y)
919 #define INTR_TRACE_LOGDUMP8(x, y)
920 #define INTR_LOUD_LOGDUMP8(x, y)
921 #define INTR_TEMP_LOGDUMP8(x, y)
922
923 #define INIT_ERROR_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, _Fmt)
924 #define INIT_WARN_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, _Fmt)
925 #define INIT_INFO_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt)
926 #define INIT_STATE_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt)
927 #define INIT_EVENT_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt)
928 #define INIT_TRACE_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_DEBUG, XLOG_TAG, _Fmt)
929 #define INIT_LOUD_LOGFUNC(_Fmt...)
930 #define INIT_TEMP_LOGFUNC(_Fmt...)
931
932 #define INIT_ERROR_LOGDUMP8(x, y)
933 #define INIT_WARN_LOGDUMP8(x, y)
934 #define INIT_INFO_LOGDUMP8(x, y)
935 #define INIT_STATE_LOGDUMP8(x, y)
936 #define INIT_EVENT_LOGDUMP8(x, y)
937 #define INIT_TRACE_LOGDUMP8(x, y)
938 #define INIT_LOUD_LOGDUMP8(x, y)
939 #define INIT_TEMP_LOGDUMP8(x, y)
940
941 #define AAA_ERROR_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, _Fmt)
942 #define AAA_WARN_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, _Fmt)
943 #define AAA_INFO_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt)
944 #define AAA_STATE_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt)
945 #define AAA_EVENT_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt)
946 #define AAA_TRACE_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_DEBUG, XLOG_TAG, _Fmt)
947 #define AAA_LOUD_LOGFUNC(_Fmt...)
948 #define AAA_TEMP_LOGFUNC(_Fmt...)
949
950 #define AAA_ERROR_LOGDUMP8(x, y)
951 #define AAA_WARN_LOGDUMP8(x, y)
952 #define AAA_INFO_LOGDUMP8(x, y)
953 #define AAA_STATE_LOGDUMP8(x, y)
954 #define AAA_EVENT_LOGDUMP8(x, y)
955 #define AAA_TRACE_LOGDUMP8(x, y)
956 #define AAA_LOUD_LOGDUMP8(x, y)
957 #define AAA_TEMP_LOGDUMP8(x, y)
958
959 #define ROAMING_ERROR_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, _Fmt)
960 #define ROAMING_WARN_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, _Fmt)
961 #define ROAMING_INFO_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt)
962 #define ROAMING_STATE_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt)
963 #define ROAMING_EVENT_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt)
964 #define ROAMING_TRACE_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_DEBUG, XLOG_TAG, _Fmt)
965 #define ROAMING_LOUD_LOGFUNC(_Fmt...)
966 #define ROAMING_TEMP_LOGFUNC(_Fmt...)
967
968 #define ROAMING_ERROR_LOGDUMP8(x, y)
969 #define ROAMING_WARN_LOGDUMP8(x, y)
970 #define ROAMING_INFO_LOGDUMP8(x, y)
971 #define ROAMING_STATE_LOGDUMP8(x, y)
972 #define ROAMING_EVENT_LOGDUMP8(x, y)
973 #define ROAMING_TRACE_LOGDUMP8(x, y)
974 #define ROAMING_LOUD_LOGDUMP8(x, y)
975 #define ROAMING_TEMP_LOGDUMP8(x, y)
976
977 #define REQ_ERROR_LOGFUNC(_Fmt...)
978 #define REQ_WARN_LOGFUNC(_Fmt...)
979 #define REQ_INFO_LOGFUNC(_Fmt...)
980 #define REQ_STATE_LOGFUNC(_Fmt...)
981 #define REQ_EVENT_LOGFUNC(_Fmt...)
982 #define REQ_TRACE_LOGFUNC(_Fmt...)
983 #define REQ_LOUD_LOGFUNC(_Fmt...)
984 #define REQ_TEMP_LOGFUNC(_Fmt...)
985
986 #define REQ_ERROR_LOGDUMP8(x, y)
987 #define REQ_WARN_LOGDUMP8(x, y)
988 #define REQ_INFO_LOGDUMP8(x, y)
989 #define REQ_STATE_LOGDUMP8(x, y)
990 #define REQ_EVENT_LOGDUMP8(x, y)
991 #define REQ_TRACE_LOGDUMP8(x, y)
992 #define REQ_LOUD_LOGDUMP8(x, y)
993 #define REQ_TEMP_LOGDUMP8(x, y)
994
995 #define TX_ERROR_LOGFUNC(_Fmt...)
996 #define TX_WARN_LOGFUNC(_Fmt...)
997 #define TX_INFO_LOGFUNC(_Fmt...)
998 #define TX_STATE_LOGFUNC(_Fmt...)
999 #define TX_EVENT_LOGFUNC(_Fmt...)
1000 #define TX_TRACE_LOGFUNC(_Fmt...)
1001 #define TX_LOUD_LOGFUNC(_Fmt...)
1002 #define TX_TEMP_LOGFUNC(_Fmt...)
1003
1004 #define TX_ERROR_LOGDUMP8(x, y)
1005 #define TX_WARN_LOGDUMP8(x, y)
1006 #define TX_INFO_LOGDUMP8(x, y)
1007 #define TX_STATE_LOGDUMP8(x, y)
1008 #define TX_EVENT_LOGDUMP8(x, y)
1009 #define TX_TRACE_LOGDUMP8(x, y)
1010 #define TX_LOUD_LOGDUMP8(x, y)
1011 #define TX_TEMP_LOGDUMP8(x, y)
1012
1013 #define RX_ERROR_LOGFUNC(_Fmt...)
1014 #define RX_WARN_LOGFUNC(_Fmt...)
1015 #define RX_INFO_LOGFUNC(_Fmt...)
1016 #define RX_STATE_LOGFUNC(_Fmt...)
1017 #define RX_EVENT_LOGFUNC(_Fmt...)
1018 #define RX_TRACE_LOGFUNC(_Fmt...)
1019 #define RX_LOUD_LOGFUNC(_Fmt...)
1020 #define RX_TEMP_LOGFUNC(_Fmt...)
1021
1022 #define RX_ERROR_LOGDUMP8(x, y)
1023 #define RX_WARN_LOGDUMP8(x, y)
1024 #define RX_INFO_LOGDUMP8(x, y)
1025 #define RX_STATE_LOGDUMP8(x, y)
1026 #define RX_EVENT_LOGDUMP8(x, y)
1027 #define RX_TRACE_LOGDUMP8(x, y)
1028 #define RX_LOUD_LOGDUMP8(x, y)
1029 #define RX_TEMP_LOGDUMP8(x, y)
1030
1031 #define RFTEST_ERROR_LOGFUNC(_Fmt...)
1032 #define RFTEST_WARN_LOGFUNC(_Fmt...)
1033 #define RFTEST_INFO_LOGFUNC(_Fmt...)
1034 #define RFTEST_STATE_LOGFUNC(_Fmt...)
1035 #define RFTEST_EVENT_LOGFUNC(_Fmt...)
1036 #define RFTEST_TRACE_LOGFUNC(_Fmt...)
1037 #define RFTEST_LOUD_LOGFUNC(_Fmt...)
1038 #define RFTEST_TEMP_LOGFUNC(_Fmt...)
1039
1040 #define RFTEST_ERROR_LOGDUMP8(x, y)
1041 #define RFTEST_WARN_LOGDUMP8(x, y)
1042 #define RFTEST_INFO_LOGDUMP8(x, y)
1043 #define RFTEST_STATE_LOGDUMP8(x, y)
1044 #define RFTEST_EVENT_LOGDUMP8(x, y)
1045 #define RFTEST_TRACE_LOGDUMP8(x, y)
1046 #define RFTEST_LOUD_LOGDUMP8(x, y)
1047 #define RFTEST_TEMP_LOGDUMP8(x, y)
1048
1049 #define EMU_ERROR_LOGFUNC(_Fmt...)
1050 #define EMU_WARN_LOGFUNC(_Fmt...)
1051 #define EMU_INFO_LOGFUNC(_Fmt...)
1052 #define EMU_STATE_LOGFUNC(_Fmt...)
1053 #define EMU_EVENT_LOGFUNC(_Fmt...)
1054 #define EMU_TRACE_LOGFUNC(_Fmt...)
1055 #define EMU_LOUD_LOGFUNC(_Fmt...)
1056 #define EMU_TEMP_LOGFUNC(_Fmt...)
1057
1058 #define EMU_ERROR_LOGDUMP8(x, y)
1059 #define EMU_WARN_LOGDUMP8(x, y)
1060 #define EMU_INFO_LOGDUMP8(x, y)
1061 #define EMU_STATE_LOGDUMP8(x, y)
1062 #define EMU_EVENT_LOGDUMP8(x, y)
1063 #define EMU_TRACE_LOGDUMP8(x, y)
1064 #define EMU_LOUD_LOGDUMP8(x, y)
1065 #define EMU_TEMP_LOGDUMP8(x, y)
1066
1067 #define HEM_ERROR_LOGFUNC(_Fmt...)
1068 #define HEM_WARN_LOGFUNC(_Fmt...)
1069 #define HEM_INFO_LOGFUNC(_Fmt...)
1070 #define HEM_STATE_LOGFUNC(_Fmt...)
1071 #define HEM_EVENT_LOGFUNC(_Fmt...)
1072 #define HEM_TRACE_LOGFUNC(_Fmt...)
1073 #define HEM_LOUD_LOGFUNC(_Fmt...)
1074 #define HEM_TEMP_LOGFUNC(_Fmt...)
1075
1076 #define HEM_ERROR_LOGDUMP8(x, y)
1077 #define HEM_WARN_LOGDUMP8(x, y)
1078 #define HEM_INFO_LOGDUMP8(x, y)
1079 #define HEM_STATE_LOGDUMP8(x, y)
1080 #define HEM_EVENT_LOGDUMP8(x, y)
1081 #define HEM_TRACE_LOGDUMP8(x, y)
1082 #define HEM_LOUD_LOGDUMP8(x, y)
1083 #define HEM_TEMP_LOGDUMP8(x, y)
1084
1085 #define RLM_ERROR_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, _Fmt)
1086 #define RLM_WARN_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, _Fmt)
1087 #define RLM_INFO_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt)
1088 #define RLM_STATE_LOGFUNC(_Fmt...)
1089 #define RLM_EVENT_LOGFUNC(_Fmt...)
1090 #define RLM_TRACE_LOGFUNC(_Fmt...)
1091 #define RLM_LOUD_LOGFUNC(_Fmt...)
1092 #define RLM_TEMP_LOGFUNC(_Fmt...)
1093
1094 #define RLM_ERROR_LOGDUMP8(x, y)
1095 #define RLM_WARN_LOGDUMP8(x, y)
1096 #define RLM_INFO_LOGDUMP8(x, y)
1097 #define RLM_STATE_LOGDUMP8(x, y)
1098 #define RLM_EVENT_LOGDUMP8(x, y)
1099 #define RLM_TRACE_LOGDUMP8(x, y)
1100 #define RLM_LOUD_LOGDUMP8(x, y)
1101 #define RLM_TEMP_LOGDUMP8(x, y)
1102
1103 #define MEM_ERROR_LOGFUNC(_Fmt...)
1104 #define MEM_WARN_LOGFUNC(_Fmt...)
1105 #define MEM_INFO_LOGFUNC(_Fmt...)
1106 #define MEM_STATE_LOGFUNC(_Fmt...)
1107 #define MEM_EVENT_LOGFUNC(_Fmt...)
1108 #define MEM_TRACE_LOGFUNC(_Fmt...)
1109 #define MEM_LOUD_LOGFUNC(_Fmt...)
1110 #define MEM_TEMP_LOGFUNC(_Fmt...)
1111
1112 #define MEM_ERROR_LOGDUMP8(x, y)
1113 #define MEM_WARN_LOGDUMP8(x, y)
1114 #define MEM_INFO_LOGDUMP8(x, y)
1115 #define MEM_STATE_LOGDUMP8(x, y)
1116 #define MEM_EVENT_LOGDUMP8(x, y)
1117 #define MEM_TRACE_LOGDUMP8(x, y)
1118 #define MEM_LOUD_LOGDUMP8(x, y)
1119 #define MEM_TEMP_LOGDUMP8(x, y)
1120
1121 #define CNM_ERROR_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, _Fmt)
1122 #define CNM_WARN_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, _Fmt)
1123 #define CNM_INFO_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt)
1124 #define CNM_STATE_LOGFUNC(_Fmt...)
1125 #define CNM_EVENT_LOGFUNC(_Fmt...)
1126 #define CNM_TRACE_LOGFUNC(_Fmt...)
1127 #define CNM_LOUD_LOGFUNC(_Fmt...)
1128 #define CNM_TEMP_LOGFUNC(_Fmt...)
1129
1130 #define CNM_ERROR_LOGDUMP8(x, y)
1131 #define CNM_WARN_LOGDUMP8(x, y)
1132 #define CNM_INFO_LOGDUMP8(x, y)
1133 #define CNM_STATE_LOGDUMP8(x, y)
1134 #define CNM_EVENT_LOGDUMP8(x, y)
1135 #define CNM_TRACE_LOGDUMP8(x, y)
1136 #define CNM_LOUD_LOGDUMP8(x, y)
1137 #define CNM_TEMP_LOGDUMP8(x, y)
1138
1139 #define RSN_ERROR_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, _Fmt)
1140 #define RSN_WARN_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, _Fmt)
1141 #define RSN_INFO_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt)
1142 #define RSN_STATE_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt)
1143 #define RSN_EVENT_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt)
1144 #define RSN_TRACE_LOGFUNC(_Fmt...)
1145 #define RSN_LOUD_LOGFUNC(_Fmt...)
1146 #define RSN_TEMP_LOGFUNC(_Fmt...)
1147
1148 #define RSN_ERROR_LOGDUMP8(x, y)
1149 #define RSN_WARN_LOGDUMP8(x, y)
1150 #define RSN_INFO_LOGDUMP8(x, y)
1151 #define RSN_STATE_LOGDUMP8(x, y)
1152 #define RSN_EVENT_LOGDUMP8(x, y)
1153 #define RSN_TRACE_LOGDUMP8(x, y)
1154 #define RSN_LOUD_LOGDUMP8(x, y)
1155 #define RSN_TEMP_LOGDUMP8(x, y)
1156
1157 #define BSS_ERROR_LOGFUNC(_Fmt...)
1158 #define BSS_WARN_LOGFUNC(_Fmt...)
1159 #define BSS_INFO_LOGFUNC(_Fmt...)
1160 #define BSS_STATE_LOGFUNC(_Fmt...)
1161 #define BSS_EVENT_LOGFUNC(_Fmt...)
1162 #define BSS_TRACE_LOGFUNC(_Fmt...)
1163 #define BSS_LOUD_LOGFUNC(_Fmt...)
1164 #define BSS_TEMP_LOGFUNC(_Fmt...)
1165
1166 #define BSS_ERROR_LOGDUMP8(x, y)
1167 #define BSS_WARN_LOGDUMP8(x, y)
1168 #define BSS_INFO_LOGDUMP8(x, y)
1169 #define BSS_STATE_LOGDUMP8(x, y)
1170 #define BSS_EVENT_LOGDUMP8(x, y)
1171 #define BSS_TRACE_LOGDUMP8(x, y)
1172 #define BSS_LOUD_LOGDUMP8(x, y)
1173 #define BSS_TEMP_LOGDUMP8(x, y)
1174
1175 #define SCN_ERROR_LOGFUNC(_Fmt...)
1176 #define SCN_WARN_LOGFUNC(_Fmt...)
1177 #define SCN_INFO_LOGFUNC(_Fmt...)
1178 #define SCN_STATE_LOGFUNC(_Fmt...)
1179 #define SCN_EVENT_LOGFUNC(_Fmt...)
1180 #define SCN_TRACE_LOGFUNC(_Fmt...)
1181 #define SCN_LOUD_LOGFUNC(_Fmt...)
1182 #define SCN_TEMP_LOGFUNC(_Fmt...)
1183
1184 #define SCN_ERROR_LOGDUMP8(x, y)
1185 #define SCN_WARN_LOGDUMP8(x, y)
1186 #define SCN_INFO_LOGDUMP8(x, y)
1187 #define SCN_STATE_LOGDUMP8(x, y)
1188 #define SCN_EVENT_LOGDUMP8(x, y)
1189 #define SCN_TRACE_LOGDUMP8(x, y)
1190 #define SCN_LOUD_LOGDUMP8(x, y)
1191 #define SCN_TEMP_LOGDUMP8(x, y)
1192
1193 #define SAA_ERROR_LOGFUNC(_Fmt...)
1194 #define SAA_WARN_LOGFUNC(_Fmt...)
1195 #define SAA_INFO_LOGFUNC(_Fmt...)
1196 #define SAA_STATE_LOGFUNC(_Fmt...)
1197 #define SAA_EVENT_LOGFUNC(_Fmt...)
1198 #define SAA_TRACE_LOGFUNC(_Fmt...)
1199 #define SAA_LOUD_LOGFUNC(_Fmt...)
1200 #define SAA_TEMP_LOGFUNC(_Fmt...)
1201
1202 #define SAA_ERROR_LOGDUMP8(x, y)
1203 #define SAA_WARN_LOGDUMP8(x, y)
1204 #define SAA_INFO_LOGDUMP8(x, y)
1205 #define SAA_STATE_LOGDUMP8(x, y)
1206 #define SAA_EVENT_LOGDUMP8(x, y)
1207 #define SAA_TRACE_LOGDUMP8(x, y)
1208 #define SAA_LOUD_LOGDUMP8(x, y)
1209 #define SAA_TEMP_LOGDUMP8(x, y)
1210
1211 #define P2P_ERROR_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, _Fmt) 
1212 #define P2P_WARN_LOGFUNC(_Fmt...)  xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, _Fmt) 
1213 #define P2P_INFO_LOGFUNC(_Fmt...)  xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt) 
1214 #define P2P_STATE_LOGFUNC(_Fmt...)
1215 #define P2P_EVENT_LOGFUNC(_Fmt...)
1216 #define P2P_TRACE_LOGFUNC(_Fmt...)
1217 #define P2P_LOUD_LOGFUNC(_Fmt...)
1218 #define P2P_TEMP_LOGFUNC(_Fmt...)
1219
1220 #define P2P_ERROR_LOGDUMP8(x, y)
1221 #define P2P_WARN_LOGDUMP8(x, y)
1222 #define P2P_INFO_LOGDUMP8(x, y)
1223 #define P2P_STATE_LOGDUMP8(x, y)
1224 #define P2P_EVENT_LOGDUMP8(x, y)
1225 #define P2P_TRACE_LOGDUMP8(x, y)
1226 #define P2P_LOUD_LOGDUMP8(x, y)
1227 #define P2P_TEMP_LOGDUMP8(x, y)
1228
1229 #define QM_ERROR_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, _Fmt)
1230 #define QM_WARN_LOGFUNC(_Fmt...)  xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, _Fmt)
1231 #define QM_INFO_LOGFUNC(_Fmt...)  xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt)
1232 #define QM_STATE_LOGFUNC(_Fmt...)
1233 #define QM_EVENT_LOGFUNC(_Fmt...)
1234 #define QM_TRACE_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_DEBUG, XLOG_TAG, _Fmt)
1235 #define QM_LOUD_LOGFUNC(_Fmt...)
1236 #define QM_TEMP_LOGFUNC(_Fmt...)
1237
1238 #define QM_ERROR_LOGDUMP8(x, y)
1239 #define QM_WARN_LOGDUMP8(x, y)
1240 #define QM_INFO_LOGDUMP8(x, y)
1241 #define QM_STATE_LOGDUMP8(x, y)
1242 #define QM_EVENT_LOGDUMP8(x, y)
1243 #define QM_TRACE_LOGDUMP8(x, y)
1244 #define QM_LOUD_LOGDUMP8(x, y)
1245 #define QM_TEMP_LOGDUMP8(x, y)
1246
1247 #define SEC_ERROR_LOGFUNC(_Fmt...)
1248 #define SEC_WARN_LOGFUNC(_Fmt...)
1249 #define SEC_INFO_LOGFUNC(_Fmt...)
1250 #define SEC_STATE_LOGFUNC(_Fmt...)
1251 #define SEC_EVENT_LOGFUNC(_Fmt...)
1252 #define SEC_TRACE_LOGFUNC(_Fmt...)
1253 #define SEC_LOUD_LOGFUNC(_Fmt...)
1254 #define SEC_TEMP_LOGFUNC(_Fmt...)
1255
1256 #define SEC_ERROR_LOGDUMP8(x, y)
1257 #define SEC_WARN_LOGDUMP8(x, y)
1258 #define SEC_INFO_LOGDUMP8(x, y)
1259 #define SEC_STATE_LOGDUMP8(x, y)
1260 #define SEC_EVENT_LOGDUMP8(x, y)
1261 #define SEC_TRACE_LOGDUMP8(x, y)
1262 #define SEC_LOUD_LOGDUMP8(x, y)
1263 #define SEC_TEMP_LOGDUMP8(x, y)
1264
1265 #define BOW_ERROR_LOGFUNC(_Fmt...)
1266 #define BOW_WARN_LOGFUNC(_Fmt...)
1267 #define BOW_INFO_LOGFUNC(_Fmt...)
1268 #define BOW_STATE_LOGFUNC(_Fmt...)
1269 #define BOW_EVENT_LOGFUNC(_Fmt...)
1270 #define BOW_TRACE_LOGFUNC(_Fmt...)
1271 #define BOW_LOUD_LOGFUNC(_Fmt...)
1272 #define BOW_TEMP_LOGFUNC(_Fmt...)
1273
1274 #define BOW_ERROR_LOGDUMP8(x, y)
1275 #define BOW_WARN_LOGDUMP8(x, y)
1276 #define BOW_INFO_LOGDUMP8(x, y)
1277 #define BOW_STATE_LOGDUMP8(x, y)
1278 #define BOW_EVENT_LOGDUMP8(x, y)
1279 #define BOW_TRACE_LOGDUMP8(x, y)
1280 #define BOW_LOUD_LOGDUMP8(x, y)
1281 #define BOW_TEMP_LOGDUMP8(x, y)
1282
1283 #define HAL_ERROR_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, _Fmt)
1284 #define HAL_WARN_LOGFUNC(_Fmt...)
1285 #define HAL_INFO_LOGFUNC(_Fmt...)
1286 #define HAL_STATE_LOGFUNC(_Fmt...)
1287 #define HAL_EVENT_LOGFUNC(_Fmt...)
1288 #define HAL_TRACE_LOGFUNC(_Fmt...)
1289 #define HAL_LOUD_LOGFUNC(_Fmt...)
1290 #define HAL_TEMP_LOGFUNC(_Fmt...)
1291
1292 #define HAL_ERROR_LOGDUMP8(x, y)
1293 #define HAL_WARN_LOGDUMP8(x, y)
1294 #define HAL_INFO_LOGDUMP8(x, y)
1295 #define HAL_STATE_LOGDUMP8(x, y)
1296 #define HAL_EVENT_LOGDUMP8(x, y)
1297 #define HAL_TRACE_LOGDUMP8(x, y)
1298 #define HAL_LOUD_LOGDUMP8(x, y)
1299 #define HAL_TEMP_LOGDUMP8(x, y)
1300
1301 #define WAPI_ERROR_LOGFUNC(_Fmt...)
1302 #define WAPI_WARN_LOGFUNC(_Fmt...)
1303 #define WAPI_INFO_LOGFUNC(_Fmt...)
1304 #define WAPI_STATE_LOGFUNC(_Fmt...)
1305 #define WAPI_EVENT_LOGFUNC(_Fmt...)
1306 #define WAPI_TRACE_LOGFUNC(_Fmt...)
1307 #define WAPI_LOUD_LOGFUNC(_Fmt...)
1308 #define WAPI_TEMP_LOGFUNC(_Fmt...)
1309
1310 #define WAPI_ERROR_LOGDUMP8(x, y)
1311 #define WAPI_WARN_LOGDUMP8(x, y)
1312 #define WAPI_INFO_LOGDUMP8(x, y)
1313 #define WAPI_STATE_LOGDUMP8(x, y)
1314 #define WAPI_EVENT_LOGDUMP8(x, y)
1315 #define WAPI_TRACE_LOGDUMP8(x, y)
1316 #define WAPI_LOUD_LOGDUMP8(x, y)
1317 #define WAPI_TEMP_LOGDUMP8(x, y)
1318
1319 #define SW1_ERROR_LOGFUNC(_Fmt...)
1320 #define SW1_WARN_LOGFUNC(_Fmt...)
1321 #define SW1_INFO_LOGFUNC(_Fmt...)
1322 #define SW1_STATE_LOGFUNC(_Fmt...)
1323 #define SW1_EVENT_LOGFUNC(_Fmt...)
1324 #define SW1_TRACE_LOGFUNC(_Fmt...)
1325 #define SW1_LOUD_LOGFUNC(_Fmt...)
1326 #define SW1_TEMP_LOGFUNC(_Fmt...)
1327
1328 #define SW1_ERROR_LOGDUMP8(x, y)
1329 #define SW1_WARN_LOGDUMP8(x, y)
1330 #define SW1_INFO_LOGDUMP8(x, y)
1331 #define SW1_STATE_LOGDUMP8(x, y)
1332 #define SW1_EVENT_LOGDUMP8(x, y)
1333 #define SW1_TRACE_LOGDUMP8(x, y)
1334 #define SW1_LOUD_LOGDUMP8(x, y)
1335 #define SW1_TEMP_LOGDUMP8(x, y)
1336
1337 #define SW2_ERROR_LOGFUNC(_Fmt...)
1338 #define SW2_WARN_LOGFUNC(_Fmt...)
1339 #define SW2_INFO_LOGFUNC(_Fmt...)
1340 #define SW2_STATE_LOGFUNC(_Fmt...)
1341 #define SW2_EVENT_LOGFUNC(_Fmt...)
1342 #define SW2_TRACE_LOGFUNC(_Fmt...)
1343 #define SW2_LOUD_LOGFUNC(_Fmt...)
1344 #define SW2_TEMP_LOGFUNC(_Fmt...)
1345
1346 #define SW2_ERROR_LOGDUMP8(x, y)
1347 #define SW2_WARN_LOGDUMP8(x, y)
1348 #define SW2_INFO_LOGDUMP8(x, y)
1349 #define SW2_STATE_LOGDUMP8(x, y)
1350 #define SW2_EVENT_LOGDUMP8(x, y)
1351 #define SW2_TRACE_LOGDUMP8(x, y)
1352 #define SW2_LOUD_LOGDUMP8(x, y)
1353 #define SW2_TEMP_LOGDUMP8(x, y)
1354
1355 #define SW3_ERROR_LOGFUNC(_Fmt...)
1356 #define SW3_WARN_LOGFUNC(_Fmt...)
1357 #define SW3_INFO_LOGFUNC(_Fmt...)
1358 #define SW3_STATE_LOGFUNC(_Fmt...)
1359 #define SW3_EVENT_LOGFUNC(_Fmt...)
1360 #define SW3_TRACE_LOGFUNC(_Fmt...)
1361 #define SW3_LOUD_LOGFUNC(_Fmt...)
1362 #define SW3_TEMP_LOGFUNC(_Fmt...)
1363
1364 #define SW3_ERROR_LOGDUMP8(x, y)
1365 #define SW3_WARN_LOGDUMP8(x, y)
1366 #define SW3_INFO_LOGDUMP8(x, y)
1367 #define SW3_STATE_LOGDUMP8(x, y)
1368 #define SW3_EVENT_LOGDUMP8(x, y)
1369 #define SW3_TRACE_LOGDUMP8(x, y)
1370 #define SW3_LOUD_LOGDUMP8(x, y)
1371 #define SW3_TEMP_LOGDUMP8(x, y)
1372
1373 #define SW4_ERROR_LOGFUNC(_Fmt...)
1374 #define SW4_WARN_LOGFUNC(_Fmt...)
1375 #define SW4_INFO_LOGFUNC(_Fmt...) xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, _Fmt)
1376 #define SW4_STATE_LOGFUNC(_Fmt...)
1377 #define SW4_EVENT_LOGFUNC(_Fmt...)
1378 #define SW4_TRACE_LOGFUNC(_Fmt...)
1379 #define SW4_LOUD_LOGFUNC(_Fmt...)
1380 #define SW4_TEMP_LOGFUNC(_Fmt...)
1381
1382 #define SW4_ERROR_LOGDUMP8(x, y)
1383 #define SW4_WARN_LOGDUMP8(x, y)
1384 #define SW4_INFO_LOGDUMP8(x, y)
1385 #define SW4_STATE_LOGDUMP8(x, y)
1386 #define SW4_EVENT_LOGDUMP8(x, y)
1387 #define SW4_TRACE_LOGDUMP8(x, y) dumpMemory8(ANDROID_LOG_DEBUG, x, y)
1388 #define SW4_LOUD_LOGDUMP8(x, y)
1389 #define SW4_TEMP_LOGDUMP8(x, y)
1390 #else
1391 #define AIS_ERROR_LOGFUNC(_Fmt...)
1392 #define AIS_WARN_LOGFUNC(_Fmt...)
1393 #define AIS_INFO_LOGFUNC(_Fmt...)
1394 #define AIS_STATE_LOGFUNC(_Fmt...)
1395 #define AIS_EVENT_LOGFUNC(_Fmt...)
1396 #define AIS_TRACE_LOGFUNC(_Fmt...)
1397 #define AIS_LOUD_LOGFUNC(_Fmt...)
1398 #define AIS_TEMP_LOGFUNC(_Fmt...)
1399
1400 #define INTR_ERROR_LOGFUNC(_Fmt...)
1401 #define INTR_WARN_LOGFUNC(_Fmt...)
1402 #define INTR_INFO_LOGFUNC(_Fmt...)
1403 #define INTR_STATE_LOGFUNC(_Fmt...)
1404 #define INTR_EVENT_LOGFUNC(_Fmt...)
1405 #define INTR_TRACE_LOGFUNC(_Fmt...)
1406 #define INTR_LOUD_LOGFUNC(_Fmt...)
1407 #define INTR_TEMP_LOGFUNC(_Fmt...)
1408
1409 #define INIT_ERROR_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1410 #define INIT_WARN_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1411 #define INIT_INFO_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1412 #define INIT_STATE_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1413 #define INIT_EVENT_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1414 #define INIT_TRACE_LOGFUNC(_Fmt...)
1415 #define INIT_LOUD_LOGFUNC(_Fmt...)
1416 #define INIT_TEMP_LOGFUNC(_Fmt...)
1417
1418 #define AAA_ERROR_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1419 #define AAA_WARN_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1420 #define AAA_INFO_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1421 #define AAA_STATE_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1422 #define AAA_EVENT_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1423 #define AAA_TRACE_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1424 #define AAA_LOUD_LOGFUNC(_Fmt...)
1425 #define AAA_TEMP_LOGFUNC(_Fmt...)
1426
1427 #define ROAMING_ERROR_LOGFUNC(_Fmt...)
1428 #define ROAMING_WARN_LOGFUNC(_Fmt...)
1429 #define ROAMING_INFO_LOGFUNC(_Fmt...)
1430 #define ROAMING_STATE_LOGFUNC(_Fmt...)
1431 #define ROAMING_EVENT_LOGFUNC(_Fmt...)
1432 #define ROAMING_TRACE_LOGFUNC(_Fmt...)
1433 #define ROAMING_LOUD_LOGFUNC(_Fmt...)
1434 #define ROAMING_TEMP_LOGFUNC(_Fmt...)
1435
1436 #define REQ_ERROR_LOGFUNC(_Fmt...)
1437 #define REQ_WARN_LOGFUNC(_Fmt...)
1438 #define REQ_INFO_LOGFUNC(_Fmt...)
1439 #define REQ_STATE_LOGFUNC(_Fmt...)
1440 #define REQ_EVENT_LOGFUNC(_Fmt...)
1441 #define REQ_TRACE_LOGFUNC(_Fmt...)
1442 #define REQ_LOUD_LOGFUNC(_Fmt...)
1443 #define REQ_TEMP_LOGFUNC(_Fmt...)
1444
1445 #define TX_ERROR_LOGFUNC(_Fmt...)
1446 #define TX_WARN_LOGFUNC(_Fmt...)
1447 #define TX_INFO_LOGFUNC(_Fmt...)
1448 #define TX_STATE_LOGFUNC(_Fmt...)
1449 #define TX_EVENT_LOGFUNC(_Fmt...)
1450 #define TX_TRACE_LOGFUNC(_Fmt...)
1451 #define TX_LOUD_LOGFUNC(_Fmt...)
1452 #define TX_TEMP_LOGFUNC(_Fmt...)
1453
1454 #define RX_ERROR_LOGFUNC(_Fmt...)
1455 #define RX_WARN_LOGFUNC(_Fmt...)
1456 #define RX_INFO_LOGFUNC(_Fmt...)
1457 #define RX_STATE_LOGFUNC(_Fmt...)
1458 #define RX_EVENT_LOGFUNC(_Fmt...)
1459 #define RX_TRACE_LOGFUNC(_Fmt...)
1460 #define RX_LOUD_LOGFUNC(_Fmt...)
1461 #define RX_TEMP_LOGFUNC(_Fmt...)
1462
1463 #define RFTEST_ERROR_LOGFUNC(_Fmt...)
1464 #define RFTEST_WARN_LOGFUNC(_Fmt...)
1465 #define RFTEST_INFO_LOGFUNC(_Fmt...)
1466 #define RFTEST_STATE_LOGFUNC(_Fmt...)
1467 #define RFTEST_EVENT_LOGFUNC(_Fmt...)
1468 #define RFTEST_TRACE_LOGFUNC(_Fmt...)
1469 #define RFTEST_LOUD_LOGFUNC(_Fmt...)
1470 #define RFTEST_TEMP_LOGFUNC(_Fmt...)
1471
1472 #define EMU_ERROR_LOGFUNC(_Fmt...)
1473 #define EMU_WARN_LOGFUNC(_Fmt...)
1474 #define EMU_INFO_LOGFUNC(_Fmt...)
1475 #define EMU_STATE_LOGFUNC(_Fmt...)
1476 #define EMU_EVENT_LOGFUNC(_Fmt...)
1477 #define EMU_TRACE_LOGFUNC(_Fmt...)
1478 #define EMU_LOUD_LOGFUNC(_Fmt...)
1479 #define EMU_TEMP_LOGFUNC(_Fmt...)
1480
1481 #define HEM_ERROR_LOGFUNC(_Fmt...)
1482 #define HEM_WARN_LOGFUNC(_Fmt...)
1483 #define HEM_INFO_LOGFUNC(_Fmt...)
1484 #define HEM_STATE_LOGFUNC(_Fmt...)
1485 #define HEM_EVENT_LOGFUNC(_Fmt...)
1486 #define HEM_TRACE_LOGFUNC(_Fmt...)
1487 #define HEM_LOUD_LOGFUNC(_Fmt...)
1488 #define HEM_TEMP_LOGFUNC(_Fmt...)
1489
1490 #define RLM_ERROR_LOGFUNC(_Fmt...)
1491 #define RLM_WARN_LOGFUNC(_Fmt...)
1492 #define RLM_INFO_LOGFUNC(_Fmt...)
1493 #define RLM_STATE_LOGFUNC(_Fmt...)
1494 #define RLM_EVENT_LOGFUNC(_Fmt...)
1495 #define RLM_TRACE_LOGFUNC(_Fmt...)
1496 #define RLM_LOUD_LOGFUNC(_Fmt...)
1497 #define RLM_TEMP_LOGFUNC(_Fmt...)
1498
1499 #define MEM_ERROR_LOGFUNC(_Fmt...)
1500 #define MEM_WARN_LOGFUNC(_Fmt...)
1501 #define MEM_INFO_LOGFUNC(_Fmt...)
1502 #define MEM_STATE_LOGFUNC(_Fmt...)
1503 #define MEM_EVENT_LOGFUNC(_Fmt...)
1504 #define MEM_TRACE_LOGFUNC(_Fmt...)
1505 #define MEM_LOUD_LOGFUNC(_Fmt...)
1506 #define MEM_TEMP_LOGFUNC(_Fmt...)
1507
1508 #define CNM_ERROR_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1509 #define CNM_WARN_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1510 #define CNM_INFO_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1511 #define CNM_STATE_LOGFUNC(_Fmt...)
1512 #define CNM_EVENT_LOGFUNC(_Fmt...)
1513 #define CNM_TRACE_LOGFUNC(_Fmt...)
1514 #define CNM_LOUD_LOGFUNC(_Fmt...)
1515 #define CNM_TEMP_LOGFUNC(_Fmt...)
1516
1517 #define RSN_ERROR_LOGFUNC(_Fmt...)
1518 #define RSN_WARN_LOGFUNC(_Fmt...)
1519 #define RSN_INFO_LOGFUNC(_Fmt...)
1520 #define RSN_STATE_LOGFUNC(_Fmt...)
1521 #define RSN_EVENT_LOGFUNC(_Fmt...)
1522 #define RSN_TRACE_LOGFUNC(_Fmt...)
1523 #define RSN_LOUD_LOGFUNC(_Fmt...)
1524 #define RSN_TEMP_LOGFUNC(_Fmt...)
1525
1526 #define BSS_ERROR_LOGFUNC(_Fmt...)
1527 #define BSS_WARN_LOGFUNC(_Fmt...)
1528 #define BSS_INFO_LOGFUNC(_Fmt...)
1529 #define BSS_STATE_LOGFUNC(_Fmt...)
1530 #define BSS_EVENT_LOGFUNC(_Fmt...)
1531 #define BSS_TRACE_LOGFUNC(_Fmt...)
1532 #define BSS_LOUD_LOGFUNC(_Fmt...)
1533 #define BSS_TEMP_LOGFUNC(_Fmt...)
1534
1535 #define SCN_ERROR_LOGFUNC(_Fmt...)
1536 #define SCN_WARN_LOGFUNC(_Fmt...)
1537 #define SCN_INFO_LOGFUNC(_Fmt...)
1538 #define SCN_STATE_LOGFUNC(_Fmt...)
1539 #define SCN_EVENT_LOGFUNC(_Fmt...)
1540 #define SCN_TRACE_LOGFUNC(_Fmt...)
1541 #define SCN_LOUD_LOGFUNC(_Fmt...)
1542 #define SCN_TEMP_LOGFUNC(_Fmt...)
1543
1544 #define SAA_ERROR_LOGFUNC(_Fmt...)
1545 #define SAA_WARN_LOGFUNC(_Fmt...)
1546 #define SAA_INFO_LOGFUNC(_Fmt...)
1547 #define SAA_STATE_LOGFUNC(_Fmt...)
1548 #define SAA_EVENT_LOGFUNC(_Fmt...)
1549 #define SAA_TRACE_LOGFUNC(_Fmt...)
1550 #define SAA_LOUD_LOGFUNC(_Fmt...)
1551 #define SAA_TEMP_LOGFUNC(_Fmt...)
1552
1553 #define P2P_ERROR_LOGFUNC(_Fmt...)
1554 #define P2P_WARN_LOGFUNC(_Fmt...)
1555 #define P2P_INFO_LOGFUNC(_Fmt...)
1556 #define P2P_STATE_LOGFUNC(_Fmt...)
1557 #define P2P_EVENT_LOGFUNC(_Fmt...)
1558 #define P2P_TRACE_LOGFUNC(_Fmt...)
1559 #define P2P_LOUD_LOGFUNC(_Fmt...)
1560 #define P2P_TEMP_LOGFUNC(_Fmt...)
1561
1562 #define QM_ERROR_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1563 #define QM_WARN_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1564 #define QM_INFO_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1565 #define QM_STATE_LOGFUNC(_Fmt...)
1566 #define QM_EVENT_LOGFUNC(_Fmt...)
1567 #define QM_TRACE_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1568 #define QM_LOUD_LOGFUNC(_Fmt...)
1569 #define QM_TEMP_LOGFUNC(_Fmt...)
1570
1571 #define SEC_ERROR_LOGFUNC(_Fmt...)
1572 #define SEC_WARN_LOGFUNC(_Fmt...)
1573 #define SEC_INFO_LOGFUNC(_Fmt...)
1574 #define SEC_STATE_LOGFUNC(_Fmt...)
1575 #define SEC_EVENT_LOGFUNC(_Fmt...)
1576 #define SEC_TRACE_LOGFUNC(_Fmt...)
1577 #define SEC_LOUD_LOGFUNC(_Fmt...)
1578 #define SEC_TEMP_LOGFUNC(_Fmt...)
1579
1580 #define BOW_ERROR_LOGFUNC(_Fmt...)
1581 #define BOW_WARN_LOGFUNC(_Fmt...)
1582 #define BOW_INFO_LOGFUNC(_Fmt...)
1583 #define BOW_STATE_LOGFUNC(_Fmt...)
1584 #define BOW_EVENT_LOGFUNC(_Fmt...)
1585 #define BOW_TRACE_LOGFUNC(_Fmt...)
1586 #define BOW_LOUD_LOGFUNC(_Fmt...)
1587 #define BOW_TEMP_LOGFUNC(_Fmt...)
1588
1589 #define HAL_ERROR_LOGFUNC(_Fmt...) kalPrint(_Fmt)
1590 #define HAL_WARN_LOGFUNC(_Fmt...)
1591 #define HAL_INFO_LOGFUNC(_Fmt...)
1592 #define HAL_STATE_LOGFUNC(_Fmt...)
1593 #define HAL_EVENT_LOGFUNC(_Fmt...)
1594 #define HAL_TRACE_LOGFUNC(_Fmt...)
1595 #define HAL_LOUD_LOGFUNC(_Fmt...)
1596 #define HAL_TEMP_LOGFUNC(_Fmt...)
1597
1598 #define WAPI_ERROR_LOGFUNC(_Fmt...)
1599 #define WAPI_WARN_LOGFUNC(_Fmt...)
1600 #define WAPI_INFO_LOGFUNC(_Fmt...)
1601 #define WAPI_STATE_LOGFUNC(_Fmt...)
1602 #define WAPI_EVENT_LOGFUNC(_Fmt...)
1603 #define WAPI_TRACE_LOGFUNC(_Fmt...)
1604 #define WAPI_LOUD_LOGFUNC(_Fmt...)
1605 #define WAPI_TEMP_LOGFUNC(_Fmt...)
1606
1607 #define SW1_ERROR_LOGFUNC(_Fmt...)
1608 #define SW1_WARN_LOGFUNC(_Fmt...)
1609 #define SW1_INFO_LOGFUNC(_Fmt...)
1610 #define SW1_STATE_LOGFUNC(_Fmt...)
1611 #define SW1_EVENT_LOGFUNC(_Fmt...)
1612 #define SW1_TRACE_LOGFUNC(_Fmt...)
1613 #define SW1_LOUD_LOGFUNC(_Fmt...)
1614 #define SW1_TEMP_LOGFUNC(_Fmt...)
1615
1616 #define SW2_ERROR_LOGFUNC(_Fmt...)
1617 #define SW2_WARN_LOGFUNC(_Fmt...)
1618 #define SW2_INFO_LOGFUNC(_Fmt...)
1619 #define SW2_STATE_LOGFUNC(_Fmt...)
1620 #define SW2_EVENT_LOGFUNC(_Fmt...)
1621 #define SW2_TRACE_LOGFUNC(_Fmt...)
1622 #define SW2_LOUD_LOGFUNC(_Fmt...)
1623 #define SW2_TEMP_LOGFUNC(_Fmt...)
1624
1625 #define SW3_ERROR_LOGFUNC(_Fmt...)
1626 #define SW3_WARN_LOGFUNC(_Fmt...)
1627 #define SW3_INFO_LOGFUNC(_Fmt...)
1628 #define SW3_STATE_LOGFUNC(_Fmt...)
1629 #define SW3_EVENT_LOGFUNC(_Fmt...)
1630 #define SW3_TRACE_LOGFUNC(_Fmt...)
1631 #define SW3_LOUD_LOGFUNC(_Fmt...)
1632 #define SW3_TEMP_LOGFUNC(_Fmt...)
1633
1634 #define SW4_ERROR_LOGFUNC(_Fmt...)
1635 #define SW4_WARN_LOGFUNC(_Fmt...)
1636 #define SW4_INFO_LOGFUNC(_Fmt...)
1637 #define SW4_STATE_LOGFUNC(_Fmt...)
1638 #define SW4_EVENT_LOGFUNC(_Fmt...)
1639 #define SW4_TRACE_LOGFUNC(_Fmt...)
1640 #define SW4_LOUD_LOGFUNC(_Fmt...)
1641 #define SW4_TEMP_LOGFUNC(_Fmt...)
1642 #endif
1643 #endif
1644
1645 #define kalBreakPoint() \
1646     do { \
1647         BUG(); \
1648         panic("Oops"); \
1649     } while(0)
1650
1651 #if CFG_ENABLE_AEE_MSG
1652 #define kalSendAeeException                         aee_kernel_exception
1653 #define kalSendAeeWarning                           aee_kernel_warning
1654 #define kalSendAeeReminding                         aee_kernel_reminding
1655 #else
1656 #define kalSendAeeException(_module, _desc, ...)
1657 #define kalSendAeeWarning(_module, _desc, ...)
1658 #define kalSendAeeReminding(_module, _desc, ...)
1659 #endif
1660
1661 #define PRINTF_ARG(...)                             __VA_ARGS__
1662 #define SPRINTF(buf, arg)                           {buf += sprintf((char *)(buf), PRINTF_ARG arg);}
1663
1664 #define USEC_TO_SYSTIME(_usec)      ((_usec) / USEC_PER_MSEC)
1665 #define MSEC_TO_SYSTIME(_msec)      (_msec)
1666
1667 /*******************************************************************************
1668 *                  F U N C T I O N   D E C L A R A T I O N S
1669 ********************************************************************************
1670 */
1671 /*----------------------------------------------------------------------------*/
1672 /* Routines in gl_kal.c                                                       */
1673 /*----------------------------------------------------------------------------*/
1674 VOID
1675 kalAcquireSpinLock(
1676     IN P_GLUE_INFO_T                prGlueInfo,
1677     IN ENUM_SPIN_LOCK_CATEGORY_E    rLockCategory,
1678     OUT PUINT_32                    pu4Flags
1679     );
1680
1681 VOID
1682 kalReleaseSpinLock(
1683     IN P_GLUE_INFO_T                prGlueInfo,
1684     IN ENUM_SPIN_LOCK_CATEGORY_E    rLockCategory,
1685     IN UINT_32                      u4Flags
1686     );
1687
1688 VOID
1689 kalUpdateMACAddress(
1690     IN P_GLUE_INFO_T    prGlueInfo,
1691     IN PUINT_8          pucMacAddr
1692     );
1693
1694 VOID
1695 kalPacketFree(
1696     IN  P_GLUE_INFO_T    prGlueInfo,
1697     IN PVOID             pvPacket
1698     );
1699
1700 PVOID
1701 kalPacketAlloc(
1702     IN P_GLUE_INFO_T     prGlueInfo,
1703     IN UINT_32           u4Size,
1704     OUT PUINT_8          *ppucData
1705     );
1706
1707 VOID
1708 kalOsTimerInitialize(
1709     IN P_GLUE_INFO_T     prGlueInfo,
1710     IN PVOID             prTimerHandler
1711     );
1712
1713 BOOL
1714 kalSetTimer(
1715     IN P_GLUE_INFO_T      prGlueInfo,
1716     IN OS_SYSTIME         rInterval
1717     );
1718
1719 WLAN_STATUS
1720 kalProcessRxPacket(
1721     IN P_GLUE_INFO_T      prGlueInfo,
1722     IN PVOID              pvPacket,
1723     IN PUINT_8            pucPacketStart,
1724     IN UINT_32            u4PacketLen,
1725     //IN PBOOLEAN           pfgIsRetain,
1726     IN BOOLEAN            fgIsRetain,
1727     IN ENUM_CSUM_RESULT_T aeCSUM[]
1728     );
1729
1730 WLAN_STATUS
1731 kalRxIndicatePkts(
1732     IN P_GLUE_INFO_T prGlueInfo,
1733     IN PVOID         apvPkts[],
1734     IN UINT_8        ucPktNum
1735     );
1736
1737 VOID
1738 kalIndicateStatusAndComplete(
1739     IN P_GLUE_INFO_T prGlueInfo,
1740     IN WLAN_STATUS   eStatus,
1741     IN PVOID         pvBuf,
1742     IN UINT_32       u4BufLen
1743     );
1744
1745 VOID
1746 kalUpdateReAssocReqInfo(
1747     IN P_GLUE_INFO_T prGlueInfo,
1748     IN PUINT_8       pucFrameBody,
1749     IN UINT_32       u4FrameBodyLen,
1750     IN BOOLEAN       fgReassocRequest
1751     );
1752
1753 VOID
1754 kalUpdateReAssocRspInfo (
1755     IN P_GLUE_INFO_T    prGlueInfo,
1756     IN PUINT_8          pucFrameBody,
1757     IN UINT_32          u4FrameBodyLen
1758     );
1759
1760 #if CFG_TX_FRAGMENT
1761 BOOLEAN
1762 kalQueryTxPacketHeader(
1763     IN P_GLUE_INFO_T prGlueInfo,
1764     IN PVOID         pvPacket,
1765     OUT PUINT_16     pu2EtherTypeLen,
1766     OUT PUINT_8      pucEthDestAddr
1767     );
1768 #endif /* CFG_TX_FRAGMENT */
1769
1770 VOID
1771 kalSendCompleteAndAwakeQueue(
1772     IN P_GLUE_INFO_T  prGlueInfo,
1773     IN PVOID          pvPacket
1774     );
1775
1776 #if CFG_TCP_IP_CHKSUM_OFFLOAD
1777 VOID
1778 kalQueryTxChksumOffloadParam(
1779     IN  PVOID     pvPacket,
1780     OUT PUINT_8   pucFlag);
1781
1782 VOID
1783 kalUpdateRxCSUMOffloadParam(
1784     IN PVOID               pvPacket,
1785     IN ENUM_CSUM_RESULT_T  eCSUM[]
1786     );
1787 #endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */
1788
1789
1790 BOOLEAN
1791 kalRetrieveNetworkAddress(
1792     IN P_GLUE_INFO_T prGlueInfo,
1793     IN OUT PARAM_MAC_ADDRESS * prMacAddr
1794     );
1795
1796
1797 /*----------------------------------------------------------------------------*/
1798 /* Routines in interface - ehpi/sdio.c                                                       */
1799 /*----------------------------------------------------------------------------*/
1800 BOOL
1801 kalDevRegRead(
1802     IN  P_GLUE_INFO_T  prGlueInfo,
1803     IN  UINT_32        u4Register,
1804     OUT PUINT_32       pu4Value
1805     );
1806
1807 BOOL
1808 kalDevRegWrite(
1809     P_GLUE_INFO_T  prGlueInfo,
1810     IN UINT_32     u4Register,
1811     IN UINT_32     u4Value
1812     );
1813
1814 BOOL
1815 kalDevPortRead(
1816     IN  P_GLUE_INFO_T   prGlueInfo,
1817     IN  UINT_16         u2Port,
1818     IN  UINT_16         u2Len,
1819     OUT PUINT_8         pucBuf,
1820     IN  UINT_16         u2ValidOutBufSize
1821     );
1822
1823 BOOL
1824 kalDevPortWrite(
1825     P_GLUE_INFO_T  prGlueInfo,
1826     IN UINT_16     u2Port,
1827     IN UINT_16     u2Len,
1828     IN PUINT_8     pucBuf,
1829     IN UINT_16     u2ValidInBufSize
1830     );
1831
1832 BOOL
1833 kalDevWriteWithSdioCmd52 (
1834     IN P_GLUE_INFO_T    prGlueInfo,
1835     IN UINT_32          u4Addr,
1836     IN UINT_8           ucData
1837     );
1838
1839
1840     #if CFG_SUPPORT_EXT_CONFIG
1841 UINT_32
1842 kalReadExtCfg (
1843     IN P_GLUE_INFO_T prGlueInfo
1844     );
1845     #endif
1846
1847 BOOL
1848 kalQoSFrameClassifierAndPacketInfo (
1849     IN P_GLUE_INFO_T prGlueInfo,
1850     IN P_NATIVE_PACKET prPacket,
1851     OUT PUINT_8 pucPriorityParam,
1852     OUT PUINT_32 pu4PacketLen,
1853     OUT PUINT_8 pucEthDestAddr,
1854     OUT PBOOLEAN pfgIs1X,
1855     OUT PBOOLEAN pfgIsPAL,
1856     OUT PUINT_8 pucNetworkType
1857 );
1858
1859 inline VOID
1860 kalOidComplete (
1861     IN P_GLUE_INFO_T prGlueInfo,
1862     IN BOOLEAN fgSetQuery,
1863     IN UINT_32 u4SetQueryInfoLen,
1864     IN WLAN_STATUS rOidStatus
1865     );
1866
1867
1868 WLAN_STATUS
1869 kalIoctl (IN P_GLUE_INFO_T    prGlueInfo,
1870     IN PFN_OID_HANDLER_FUNC     pfnOidHandler,
1871     IN PVOID                    pvInfoBuf,
1872     IN UINT_32                  u4InfoBufLen,
1873     IN BOOL                     fgRead,
1874     IN BOOL                     fgWaitResp,
1875     IN BOOL                     fgCmd,
1876     IN BOOL                     fgIsP2pOid,
1877     OUT PUINT_32                pu4QryInfoLen
1878     );
1879
1880 VOID
1881 kalHandleAssocInfo(
1882     IN P_GLUE_INFO_T prGlueInfo,
1883     IN P_EVENT_ASSOC_INFO prAssocInfo
1884     );
1885
1886 #if CFG_ENABLE_FW_DOWNLOAD
1887
1888 PVOID
1889 kalFirmwareImageMapping (
1890     IN P_GLUE_INFO_T    prGlueInfo,
1891     OUT PPVOID          ppvMapFileBuf,
1892     OUT PUINT_32        pu4FileLength
1893     );
1894
1895 VOID
1896 kalFirmwareImageUnmapping (
1897     IN P_GLUE_INFO_T    prGlueInfo,
1898     IN PVOID            prFwHandle,
1899     IN PVOID            pvMapFileBuf
1900     );
1901 #endif
1902
1903
1904 /*----------------------------------------------------------------------------*/
1905 /* Card Removal Check                                                         */
1906 /*----------------------------------------------------------------------------*/
1907 BOOLEAN
1908 kalIsCardRemoved(
1909     IN P_GLUE_INFO_T    prGlueInfo
1910     );
1911
1912
1913 /*----------------------------------------------------------------------------*/
1914 /* TX                                                                         */
1915 /*----------------------------------------------------------------------------*/
1916 VOID
1917 kalFlushPendingTxPackets(
1918     IN P_GLUE_INFO_T    prGlueInfo
1919     );
1920
1921
1922 /*----------------------------------------------------------------------------*/
1923 /* Media State Indication                                                     */
1924 /*----------------------------------------------------------------------------*/
1925 ENUM_PARAM_MEDIA_STATE_T
1926 kalGetMediaStateIndicated(
1927     IN P_GLUE_INFO_T    prGlueInfo
1928     );
1929
1930
1931 VOID
1932 kalSetMediaStateIndicated(
1933     IN P_GLUE_INFO_T            prGlueInfo,
1934     IN ENUM_PARAM_MEDIA_STATE_T eParamMediaStateIndicate
1935     );
1936
1937
1938 /*----------------------------------------------------------------------------*/
1939 /* OID handling                                                               */
1940 /*----------------------------------------------------------------------------*/
1941 VOID
1942 kalOidCmdClearance(
1943     IN P_GLUE_INFO_T prGlueInfo
1944     );
1945
1946 VOID
1947 kalOidClearance(
1948     IN P_GLUE_INFO_T prGlueInfo
1949     );
1950
1951 VOID
1952 kalEnqueueCommand(
1953     IN P_GLUE_INFO_T prGlueInfo,
1954     IN P_QUE_ENTRY_T prQueueEntry
1955     );
1956
1957 #if CFG_ENABLE_BT_OVER_WIFI
1958 /*----------------------------------------------------------------------------*/
1959 /* Bluetooth over Wi-Fi handling                                              */
1960 /*----------------------------------------------------------------------------*/
1961 VOID
1962 kalIndicateBOWEvent(
1963     IN P_GLUE_INFO_T        prGlueInfo,
1964     IN P_AMPC_EVENT prEvent
1965     );
1966
1967 ENUM_BOW_DEVICE_STATE
1968 kalGetBowState (
1969     IN P_GLUE_INFO_T        prGlueInfo,
1970     IN PARAM_MAC_ADDRESS    rPeerAddr
1971     );
1972
1973 BOOLEAN
1974 kalSetBowState (
1975     IN P_GLUE_INFO_T            prGlueInfo,
1976     IN ENUM_BOW_DEVICE_STATE    eBowState,
1977     PARAM_MAC_ADDRESS           rPeerAddr
1978     );
1979
1980 ENUM_BOW_DEVICE_STATE
1981 kalGetBowGlobalState (
1982     IN P_GLUE_INFO_T    prGlueInfo
1983     );
1984
1985 UINT_32
1986 kalGetBowFreqInKHz(
1987     IN P_GLUE_INFO_T prGlueInfo
1988     );
1989
1990 UINT_8
1991 kalGetBowRole(
1992     IN P_GLUE_INFO_T        prGlueInfo,
1993     IN PARAM_MAC_ADDRESS    rPeerAddr
1994     );
1995
1996 VOID
1997 kalSetBowRole(
1998     IN P_GLUE_INFO_T        prGlueInfo,
1999     IN UINT_8               ucRole,
2000     IN PARAM_MAC_ADDRESS    rPeerAddr
2001     );
2002
2003 UINT_8
2004 kalGetBowAvailablePhysicalLinkCount(
2005     IN P_GLUE_INFO_T        prGlueInfo
2006     );
2007
2008 #if CFG_BOW_SEPARATE_DATA_PATH
2009 /*----------------------------------------------------------------------------*/
2010 /* Bluetooth over Wi-Fi Net Device Init/Uninit                                */
2011 /*----------------------------------------------------------------------------*/
2012 BOOLEAN
2013 kalInitBowDevice(
2014     IN P_GLUE_INFO_T        prGlueInfo,
2015     IN const char           *prDevName
2016     );
2017
2018 BOOLEAN
2019 kalUninitBowDevice(
2020     IN P_GLUE_INFO_T        prGlueInfo
2021     );
2022 #endif // CFG_BOW_SEPARATE_DATA_PATH
2023 #endif // CFG_ENABLE_BT_OVER_WIFI
2024
2025
2026 /*----------------------------------------------------------------------------*/
2027 /* Firmware Download Handling                                                 */
2028 /*----------------------------------------------------------------------------*/
2029 UINT_32
2030 kalGetFwStartAddress(
2031     IN P_GLUE_INFO_T    prGlueInfo
2032     );
2033
2034 UINT_32
2035 kalGetFwLoadAddress(
2036     IN P_GLUE_INFO_T    prGlueInfo
2037     );
2038
2039 /*----------------------------------------------------------------------------*/
2040 /* Security Frame Clearance                                                   */
2041 /*----------------------------------------------------------------------------*/
2042 VOID
2043 kalClearSecurityFrames(
2044     IN P_GLUE_INFO_T prGlueInfo
2045     );
2046
2047 VOID
2048 kalClearSecurityFramesByNetType(
2049     IN P_GLUE_INFO_T prGlueInfo,
2050     IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx
2051     );
2052
2053 VOID
2054 kalSecurityFrameSendComplete (
2055     IN P_GLUE_INFO_T prGlueInfo,
2056     IN PVOID pvPacket,
2057     IN WLAN_STATUS rStatus
2058     );
2059
2060
2061 /*----------------------------------------------------------------------------*/
2062 /* Management Frame Clearance                                                 */
2063 /*----------------------------------------------------------------------------*/
2064 VOID
2065 kalClearMgmtFrames(
2066     IN P_GLUE_INFO_T prGlueInfo
2067     );
2068
2069 VOID
2070 kalClearMgmtFramesByNetType(
2071     IN P_GLUE_INFO_T prGlueInfo,
2072     IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx
2073     );
2074
2075 UINT_32
2076 kalGetTxPendingFrameCount(
2077     IN P_GLUE_INFO_T    prGlueInfo
2078     );
2079
2080 UINT_32
2081 kalGetTxPendingCmdCount(
2082     IN P_GLUE_INFO_T    prGlueInfo
2083     );
2084
2085 BOOLEAN
2086 kalSetTimer(
2087     IN P_GLUE_INFO_T    prGlueInfo,
2088     IN UINT_32          u4Interval
2089     );
2090
2091 BOOLEAN
2092 kalCancelTimer(
2093     IN P_GLUE_INFO_T    prGlueInfo
2094     );
2095
2096 VOID
2097 kalScanDone(
2098     IN P_GLUE_INFO_T            prGlueInfo,
2099     IN ENUM_KAL_NETWORK_TYPE_INDEX_T   eNetTypeIdx,
2100     IN WLAN_STATUS                 status
2101     );
2102
2103 UINT_32
2104 kalRandomNumber(
2105     VOID
2106     );
2107
2108 VOID
2109 kalTimeoutHandler (unsigned long arg);
2110
2111 VOID
2112 kalSetEvent (P_GLUE_INFO_T pr);
2113
2114
2115 /*----------------------------------------------------------------------------*/
2116 /* NVRAM/Registry Service                                                     */
2117 /*----------------------------------------------------------------------------*/
2118 BOOLEAN
2119 kalIsConfigurationExist(
2120     IN P_GLUE_INFO_T    prGlueInfo
2121     );
2122
2123 P_REG_INFO_T
2124 kalGetConfiguration(
2125     IN P_GLUE_INFO_T    prGlueInfo
2126     );
2127
2128 VOID
2129 kalGetConfigurationVersion(
2130     IN P_GLUE_INFO_T    prGlueInfo,
2131     OUT PUINT_16        pu2Part1CfgOwnVersion,
2132     OUT PUINT_16        pu2Part1CfgPeerVersion,
2133     OUT PUINT_16        pu2Part2CfgOwnVersion,
2134     OUT PUINT_16        pu2Part2CfgPeerVersion
2135     );
2136
2137 BOOLEAN
2138 kalCfgDataRead16(
2139     IN P_GLUE_INFO_T    prGlueInfo,
2140     IN UINT_32          u4Offset,
2141     OUT PUINT_16        pu2Data
2142     );
2143
2144 BOOLEAN
2145 kalCfgDataWrite16(
2146     IN P_GLUE_INFO_T    prGlueInfo,
2147     IN UINT_32          u4Offset,
2148     IN UINT_16          u2Data
2149     );
2150
2151 /*----------------------------------------------------------------------------*/
2152 /* WSC Connection                                                     */
2153 /*----------------------------------------------------------------------------*/
2154 BOOLEAN
2155 kalWSCGetActiveState(
2156     IN P_GLUE_INFO_T    prGlueInfo
2157     );
2158
2159 /*----------------------------------------------------------------------------*/
2160 /* RSSI Updating                                                              */
2161 /*----------------------------------------------------------------------------*/
2162 VOID
2163 kalUpdateRSSI(
2164     IN P_GLUE_INFO_T                    prGlueInfo,
2165     IN ENUM_KAL_NETWORK_TYPE_INDEX_T    eNetTypeIdx,
2166     IN INT_8                            cRssi,
2167     IN INT_8                            cLinkQuality
2168     );
2169
2170
2171 /*----------------------------------------------------------------------------*/
2172 /* I/O Buffer Pre-allocation                                                  */
2173 /*----------------------------------------------------------------------------*/
2174 BOOLEAN
2175 kalInitIOBuffer(
2176     VOID
2177     );
2178
2179 VOID
2180 kalUninitIOBuffer(
2181     VOID
2182     );
2183
2184 PVOID
2185 kalAllocateIOBuffer(
2186     IN UINT_32 u4AllocSize
2187     );
2188
2189 VOID
2190 kalReleaseIOBuffer(
2191     IN PVOID pvAddr,
2192     IN UINT_32 u4Size
2193     );
2194
2195 VOID
2196 kalGetChannelList(
2197     IN P_GLUE_INFO_T           prGlueInfo,
2198     IN ENUM_BAND_T             eSpecificBand,
2199     IN UINT_8                  ucMaxChannelNum,
2200     IN PUINT_8                 pucNumOfChannel,
2201     IN P_RF_CHANNEL_INFO_T     paucChannelList
2202     );
2203
2204 BOOL
2205 kalIsAPmode(
2206     IN P_GLUE_INFO_T           prGlueInfo
2207     );
2208
2209 #if CFG_SUPPORT_802_11W
2210 /*----------------------------------------------------------------------------*/
2211 /* 802.11W                                                                    */
2212 /*----------------------------------------------------------------------------*/
2213 UINT_32
2214 kalGetMfpSetting(
2215     IN P_GLUE_INFO_T    prGlueInfo
2216     );
2217 #endif
2218
2219 UINT_32
2220 kalWriteToFile(
2221     const PUINT_8 pucPath,
2222     BOOLEAN fgDoAppend,
2223     PUINT_8 pucData,
2224     UINT_32 u4Size
2225     );
2226
2227
2228 /*----------------------------------------------------------------------------*/
2229 /* NL80211                                                                    */
2230 /*----------------------------------------------------------------------------*/
2231 VOID
2232 kalIndicateBssInfo (
2233     IN P_GLUE_INFO_T prGlueInfo,
2234     IN PUINT_8  pucFrameBuf,
2235     IN UINT_32  u4BufLen,
2236     IN UINT_8   ucChannelNum,
2237     IN INT_32   i4SignalStrength
2238     );
2239
2240
2241
2242 /*******************************************************************************
2243 *                              F U N C T I O N S
2244 ********************************************************************************
2245 */
2246
2247 int tx_thread(void *data);
2248
2249 #endif /* _GL_KAL_H */
2250