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