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