2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_2/os/linux/include/gl_kal.h#1 $
6 \brief Declaration of KAL functions - kal*() which is provided by GLUE Layer.
8 Any definitions in this file will be shared among GLUE Layer and internal Driver Stack.
11 /*******************************************************************************
12 * Copyright (c) 2007 MediaTek Inc.
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
18 ********************************************************************************
21 /*******************************************************************************
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.
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.
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
50 ********************************************************************************
57 * [ALPS00109161] [Need Patch] [Volunteer Patch] [Wi-Fi] Support the set tx power driver cmd
58 * Adding the AP mode channel query filter.
61 * [ALPS00096191] [MT6620 Wi-Fi][Driver][Firmware] Porting to ALPS4.0_DEV branch
62 * sync to up-to-date changes including:
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.
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
75 * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
76 * adjust the code for Non-DBG and no XLOG.
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
85 * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
86 * modify the xlog related code.
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.
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.
98 * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
99 * Using the new XLOG define for dum Memory.
101 * 11 08 2011 eddie.chen
102 * [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog)
105 * 11 08 2011 cm.chang
107 * Add RLM and CNM debug message for XLOG
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.
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.
118 * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
119 * Add dumpMemory8 at XLOG support.
122 * [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
123 * Add XLOG related code and define.
125 * 10 19 2011 yuche.tsai
126 * [WCXRP00001045] [WiFi Direct][Driver] Check 2.1 branch.
128 * Davinci Maintrunk Label: MT6620_WIFI_DRIVER_FW_TRUNK_MT6620E5_111019_0926.
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.
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.
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
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
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
151 * The windows part remained the same as before, but added similiar APIs to hide the difference.
153 * 03 10 2011 chinghwa.yu
154 * [WCXRP00000065] Update BoW design and settings
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.
161 * 03 06 2011 chinghwa.yu
162 * [WCXRP00000065] Update BoW design and settings
163 * Sync BOW Driver to latest person development branch version..
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.
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
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.
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
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
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
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
194 * 11 30 2010 yuche.tsai
196 * Invitation & Provision Discovery Indication.
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
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
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.
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
220 * [WCXRP00000081] [MT6620][Driver] Fix the compiling error at WinXP while enable P2P
221 * add a kal function for set cipher.
224 * [WCXRP00000081] [MT6620][Driver] Fix the compiling error at WinXP while enable P2P
225 * fixed compiling error while enable p2p.
229 * [WCXRP00000069][MT6620 Wi-Fi][Driver] Fix some code for phase 1 P2P Demo.
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
235 * 09 21 2010 kevin.huang
236 * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning
237 * Eliminate Linux Compile Warning
241 * fixed the compiling error at win XP.
245 * adding the code for beacon/probe req/ probe rsp wsc ie at p2p.
249 * let the p2p can set the privacy bit at beacon and rsn ie at assoc req at key handshake state.
251 * 09 03 2010 kevin.huang
253 * Refine #include sequence and solve recursive/nested #include issue
257 * driver hook modifications corresponding to ioctl interface change.
261 * [Wi-Fi Direct Driver Hook] change event indication API to be consistent with supplicant
265 * [Wi-Fi Direct] add framework for driver hooks
267 * 08 02 2010 jeffrey.chang
269 * modify kalSetEvent declaration
273 * simplify post-handling after TX_DONE interrupt is handled.
277 * 1) re-enable AIS-FSM beacon timeout handling.
278 * 2) scan done API revised
280 * 07 23 2010 jeffrey.chang
282 * fix kal header file
284 * 07 22 2010 jeffrey.chang
286 * use different spin lock for security frame
288 * 07 22 2010 jeffrey.chang
292 * 07 19 2010 jeffrey.chang
294 * add kal api for scanning done
296 * 07 19 2010 jeffrey.chang
298 * modify cmd/data path for new design
300 * 07 19 2010 jeffrey.chang
304 * 07 19 2010 jeffrey.chang
306 * Linux port modification
310 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
313 * [WPD00003833][MT6620 and MT5931] Driver migration
314 * change MAC address updating logic.
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
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
329 * [WPD00003833][MT6620 and MT5931] Driver migration
332 * 06 06 2010 kevin.huang
333 * [WPD00003832][MT6620 5931] Create driver base
334 * [MT6620 5931] Create driver base
337 * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
338 * add basic handling framework for wireless extension ioctls.
341 * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
342 * add ioctl for controlling p2p scan phase parameters
345 * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
346 * fill network type field while doing frame identification.
349 * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
350 * implement basic wi-fi direct framework
353 * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
354 * add basic framework for implementating P2P driver hook.
356 * 05 07 2010 jeffrey.chang
357 * [WPD00003826]Initial import for Linux port
358 * modify kalMemAlloc method
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
366 * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
367 * add multiple physical link support
369 * 04 27 2010 jeffrey.chang
370 * [WPD00003826]Initial import for Linux port
371 * follow Linux's firmware framework, and remove unused kal API
374 * [WPD00001943]Create WiFi test driver framework on WinXP
375 * when acquiring driver-own, wait for up to 8 seconds.
377 * 04 22 2010 jeffrey.chang
378 * [WPD00003826]Initial import for Linux port
380 * 1) modify rx path code for supporting Wi-Fi direct
381 * 2) modify config.h since Linux dont need to consider retaining packet
383 * 04 21 2010 jeffrey.chang
384 * [WPD00003826]Initial import for Linux port
385 * add for private ioctl support
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.
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
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
404 * 04 09 2010 jeffrey.chang
405 * [WPD00003826]Initial import for Linux port
407 * * * 2) add KAPI for handling association info
409 * 04 09 2010 jeffrey.chang
410 * [WPD00003826]Initial import for Linux port
411 * adding firmware download KAPI
414 * [WPD00001943]Create WiFi test driver framework on WinXP
415 * finish non-glue layer access to glue variables
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
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.
428 * [WPD00001943]Create WiFi test driver framework on WinXP
429 * eliminate direct access to prGlueInfo->eParamMediaStateIndicated from non-glue layer
432 * [WPD00001943]Create WiFi test driver framework on WinXP
433 * add KAL API: kalFlushPendingTxPackets(), and take use of the API
436 * [WPD00001943]Create WiFi test driver framework on WinXP
437 * eliminate direct access to prGlueInfo->rWlanInfo.eLinkAttr.ucMediaStreamMode from non-glue layer.
439 * 04 06 2010 jeffrey.chang
440 * [WPD00003826]Initial import for Linux port
441 * improve none-glue code portability
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
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
452 * 03 30 2010 jeffrey.chang
453 * [WPD00003826]Initial import for Linux port
454 * emulate NDIS Pending OID facility
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
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.
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
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
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
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
552 /*******************************************************************************
553 * C O M P I L E R F L A G S
554 ********************************************************************************
557 /*******************************************************************************
558 * E X T E R N A L R E F E R E N C E S
559 ********************************************************************************
562 #include "gl_typedef.h"
566 #include "nic/wlan_def.h"
567 #include "wlan_lib.h"
568 #include "wlan_oid.h"
569 #include "gl_wext_priv.h"
572 #if CFG_ENABLE_BT_OVER_WIFI
577 extern int allocatedMemSize;
580 /*******************************************************************************
582 ********************************************************************************
584 //#define USEC_PER_MSEC (1000)
586 /*******************************************************************************
588 ********************************************************************************
590 typedef enum _ENUM_SPIN_LOCK_CATEGORY_E {
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,
621 SPIN_LOCK_EHPI_BUS, /* only for EHPI */
623 } ENUM_SPIN_LOCK_CATEGORY_E;
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 */
631 } EVENT_ASSOC_INFO, *P_EVENT_ASSOC_INFO;
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,
638 #if CFG_ENABLE_BT_OVER_WIFI
639 KAL_NETWORK_TYPE_BOW_INDEX,
641 KAL_NETWORK_TYPE_INDEX_NUM
642 } ENUM_KAL_NETWORK_TYPE_INDEX_T;
644 typedef enum _ENUM_KAL_MEM_ALLOCATION_TYPE_E {
645 PHY_MEM_TYPE, /* physically continuous */
646 VIR_MEM_TYPE, /* virtually continous */
648 } ENUM_KAL_MEM_ALLOCATION_TYPE;
650 #if CONFIG_ANDROID /* Defined in Android kernel source */
651 typedef struct wake_lock KAL_WAKE_LOCK_T, *P_KAL_WAKE_LOCK_T;
653 typedef UINT_32 KAL_WAKE_LOCK_T, *P_KAL_WAKE_LOCK_T;
656 /*******************************************************************************
657 * P U B L I C D A T A
658 ********************************************************************************
661 /*******************************************************************************
662 * P R I V A T E D A T A
663 ********************************************************************************
666 /*******************************************************************************
668 ********************************************************************************
670 /*----------------------------------------------------------------------------*/
671 /* Macros of SPIN LOCK operations for using in Driver Layer */
672 /*----------------------------------------------------------------------------*/
673 #define KAL_SPIN_LOCK_DECLARATION() UINT_32 __u4Flags
675 #define KAL_ACQUIRE_SPIN_LOCK(_prAdapter, _rLockCategory) \
676 kalAcquireSpinLock(((P_ADAPTER_T)_prAdapter)->prGlueInfo, _rLockCategory, &__u4Flags)
678 #define KAL_RELEASE_SPIN_LOCK(_prAdapter, _rLockCategory) \
679 kalReleaseSpinLock(((P_ADAPTER_T)_prAdapter)->prGlueInfo, _rLockCategory, __u4Flags)
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)
692 #define kalUpdateReAssocRspInfo(prGlueInfo, pucFrameBody, u4FrameBodyLen)
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)
701 #define KAL_WAKE_LOCK_DESTROY(_prAdapter, _prWakeLock) \
702 wake_lock_destroy(_prWakeLock)
704 #define KAL_WAKE_LOCK(_prAdapter, _prWakeLock) \
705 wake_lock(_prWakeLock)
707 #define KAL_WAKE_LOCK_TIMEOUT(_prAdapter, _prWakeLock, _u4Timeout) \
708 wake_lock_timeout(_prWakeLock, _u4Timeout)
710 #define KAL_WAKE_UNLOCK(_prAdapter, _prWakeLock) \
711 wake_unlock(_prWakeLock)
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)
721 /*----------------------------------------------------------------------------*/
723 * \brief Cache memory allocation
725 * \param[in] u4Size Required memory size.
726 * \param[in] eMemType Memory allocation type
728 * \return Pointer to allocated memory
731 /*----------------------------------------------------------------------------*/
733 #define kalMemAlloc(u4Size, eMemType) ({ \
735 if(eMemType == PHY_MEM_TYPE) { \
736 pvAddr = kmalloc(u4Size, GFP_KERNEL); \
739 pvAddr = vmalloc(u4Size); \
742 allocatedMemSize += u4Size; \
743 printk(KERN_INFO DRV_NAME "0x%p(%ld) allocated (%s:%s)\n", \
744 pvAddr, (UINT_32)u4Size, __FILE__, __FUNCTION__); \
749 #define kalMemAlloc(u4Size, eMemType) ({ \
751 if(eMemType == PHY_MEM_TYPE) { \
752 pvAddr = kmalloc(u4Size, GFP_KERNEL); \
755 pvAddr = vmalloc(u4Size); \
761 /*----------------------------------------------------------------------------*/
763 * \brief Free allocated cache memory
765 * \param[in] pvAddr Required memory size.
766 * \param[in] eMemType Memory allocation type
767 * \param[in] u4Size Allocated memory size.
771 /*----------------------------------------------------------------------------*/
773 #define kalMemFree(pvAddr, eMemType, u4Size) \
776 allocatedMemSize -= u4Size; \
777 printk(KERN_INFO DRV_NAME "0x%p(%ld) freed (%s:%s)\n", \
778 pvAddr, (UINT_32)u4Size, __FILE__, __FUNCTION__); \
780 if(eMemType == PHY_MEM_TYPE) { \
788 #define kalMemFree(pvAddr, eMemType, u4Size) \
790 if(eMemType == PHY_MEM_TYPE) { \
799 #define kalUdelay(u4USec) udelay(u4USec)
801 #define kalMdelay(u4MSec) mdelay(u4MSec)
802 #define kalMsleep(u4MSec) msleep(u4MSec)
804 /* Copy memory from user space to kernel space */
805 #define kalMemCopyFromUser(_pvTo, _pvFrom, _u4N) copy_from_user(_pvTo, _pvFrom, _u4N)
807 /* Copy memory from kernel space to user space */
808 #define kalMemCopyToUser(_pvTo, _pvFrom, _u4N) copy_to_user(_pvTo, _pvFrom, _u4N)
810 /* Copy memory block with specific size */
811 #define kalMemCopy(pvDst, pvSrc, u4Size) memcpy(pvDst, pvSrc, u4Size)
813 /* Set memory block with specific pattern */
814 #define kalMemSet(pvAddr, ucPattern, u4Size) memset(pvAddr, ucPattern, u4Size)
816 /* Compare two memory block with specific length.
817 * Return zero if they are the same.
819 #define kalMemCmp(pvAddr1, pvAddr2, u4Size) memcmp(pvAddr1, pvAddr2, u4Size)
821 /* Zero specific memory block */
822 #define kalMemZero(pvAddr, u4Size) memset(pvAddr, 0, u4Size)
824 /* defined for wince sdio driver only */
825 #if defined(_HIF_SDIO)
826 #define kalDevSetPowerState(prGlueInfo, ePowerMode) glSetPowerState(prGlueInfo, ePowerMode)
828 #define kalDevSetPowerState(prGlueInfo, ePowerMode)
831 /*----------------------------------------------------------------------------*/
833 * \brief Notify OS with SendComplete event of the specific packet. Linux should
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
842 /*----------------------------------------------------------------------------*/
843 #define kalSendComplete(prGlueInfo, pvPacket, status) \
844 kalSendCompleteAndAwakeQueue(prGlueInfo, pvPacket)
847 /*----------------------------------------------------------------------------*/
849 * \brief This function is used to locate the starting address of incoming ethernet
852 * \param[in] prGlueInfo Pointer of GLUE Data Structure
853 * \param[in] pvPacket Pointer of Packet Handle
855 * \return starting address of ethernet frame buffer.
857 /*----------------------------------------------------------------------------*/
858 #define kalQueryBufferPointer(prGlueInfo, pvPacket) \
859 ((PUINT_8)((struct sk_buff *)pvPacket)->data)
862 /*----------------------------------------------------------------------------*/
864 * \brief This function is used to query the length of valid buffer which is accessible during
867 * \param[in] prGlueInfo Pointer of GLUE Data Structure
868 * \param[in] pvPacket Pointer of Packet Handle
870 * \return starting address of ethernet frame buffer.
872 /*----------------------------------------------------------------------------*/
873 #define kalQueryValidBufferLength(prGlueInfo, pvPacket) \
874 ((UINT_32)((struct sk_buff *)pvPacket)->end - \
875 (UINT_32)((struct sk_buff *)pvPacket)->data)
877 /*----------------------------------------------------------------------------*/
879 * \brief This function is used to copy the entire frame from skb to the destination
880 * address in the input parameter.
882 * \param[in] prGlueInfo Pointer of GLUE Data Structure
883 * \param[in] pvPacket Pointer of Packet Handle
884 * \param[in] pucDestBuffer Destination Address
888 /*----------------------------------------------------------------------------*/
889 #define kalCopyFrame(prGlueInfo, pvPacket, pucDestBuffer) \
890 {struct sk_buff *skb = (struct sk_buff *)pvPacket; \
891 memcpy(pucDestBuffer, skb->data, skb->len);}
893 #define kalGetTimeTick() jiffies_to_msecs(jiffies)
895 #define kalPrint printk
898 #define XLOG_TAG "wlan"
900 #define XLOG_FUNC(__LEVEL, __FMT...)\
901 if (__LEVEL == ANDROID_LOG_ERROR) {\
902 xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, ##__FMT);\
904 else if (__LEVEL == ANDROID_LOG_WARN) {\
905 xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, ##__FMT);\
907 else if (__LEVEL == ANDROID_LOG_INFO) {\
908 xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, ##__FMT);\
910 else if (__LEVEL == ANDROID_LOG_DEBUG) {\
911 xlog_printk(ANDROID_LOG_DEBUG, XLOG_TAG, ##__FMT);\
913 else if (__LEVEL == ANDROID_LOG_VERBOSE) {\
914 xlog_printk(ANDROID_LOG_VERBOSE, XLOG_TAG, ##__FMT);\
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
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...)
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)
1423 #define kalBreakPoint() \
1429 #define PRINTF_ARG(...) __VA_ARGS__
1430 #define SPRINTF(buf, arg) {buf += sprintf((char *)(buf), PRINTF_ARG arg);}
1432 #define USEC_TO_SYSTIME(_usec) ((_usec) / USEC_PER_MSEC)
1433 #define MSEC_TO_SYSTIME(_msec) (_msec)
1435 /*******************************************************************************
1436 * F U N C T I O N D E C L A R A T I O N S
1437 ********************************************************************************
1439 /*----------------------------------------------------------------------------*/
1440 /* Routines in gl_kal.c */
1441 /*----------------------------------------------------------------------------*/
1444 IN P_GLUE_INFO_T prGlueInfo,
1445 IN ENUM_SPIN_LOCK_CATEGORY_E rLockCategory,
1446 OUT PUINT_32 pu4Flags
1451 IN P_GLUE_INFO_T prGlueInfo,
1452 IN ENUM_SPIN_LOCK_CATEGORY_E rLockCategory,
1457 kalUpdateMACAddress(
1458 IN P_GLUE_INFO_T prGlueInfo,
1459 IN PUINT_8 pucMacAddr
1464 IN P_GLUE_INFO_T prGlueInfo,
1470 IN P_GLUE_INFO_T prGlueInfo,
1472 OUT PUINT_8 *ppucData
1476 kalOsTimerInitialize(
1477 IN P_GLUE_INFO_T prGlueInfo,
1478 IN PVOID prTimerHandler
1483 IN P_GLUE_INFO_T prGlueInfo,
1484 IN OS_SYSTIME rInterval
1489 IN P_GLUE_INFO_T prGlueInfo,
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[]
1500 IN P_GLUE_INFO_T prGlueInfo,
1506 kalIndicateStatusAndComplete(
1507 IN P_GLUE_INFO_T prGlueInfo,
1508 IN WLAN_STATUS eStatus,
1514 kalUpdateReAssocReqInfo(
1515 IN P_GLUE_INFO_T prGlueInfo,
1516 IN PUINT_8 pucFrameBody,
1517 IN UINT_32 u4FrameBodyLen,
1518 IN BOOLEAN fgReassocRequest
1523 kalQueryTxPacketHeader(
1524 IN P_GLUE_INFO_T prGlueInfo,
1526 OUT PUINT_16 pu2EtherTypeLen,
1527 OUT PUINT_8 pucEthDestAddr
1529 #endif /* CFG_TX_FRAGMENT */
1532 kalSendCompleteAndAwakeQueue(
1533 IN P_GLUE_INFO_T prGlueInfo,
1537 #if CFG_TCP_IP_CHKSUM_OFFLOAD
1539 kalQueryTxChksumOffloadParam(
1541 OUT PUINT_8 pucFlag);
1544 kalUpdateRxCSUMOffloadParam(
1546 IN ENUM_CSUM_RESULT_T eCSUM[]
1548 #endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */
1552 kalRetrieveNetworkAddress(
1553 IN P_GLUE_INFO_T prGlueInfo,
1554 IN OUT PARAM_MAC_ADDRESS * prMacAddr
1558 /*----------------------------------------------------------------------------*/
1559 /* Routines in interface - ehpi/sdio.c */
1560 /*----------------------------------------------------------------------------*/
1563 IN P_GLUE_INFO_T prGlueInfo,
1564 IN UINT_32 u4Register,
1565 OUT PUINT_32 pu4Value
1570 P_GLUE_INFO_T prGlueInfo,
1571 IN UINT_32 u4Register,
1577 IN P_GLUE_INFO_T prGlueInfo,
1581 IN UINT_16 u2ValidOutBufSize
1586 P_GLUE_INFO_T prGlueInfo,
1590 IN UINT_16 u2ValidInBufSize
1594 kalDevWriteWithSdioCmd52 (
1595 IN P_GLUE_INFO_T prGlueInfo,
1601 #if CFG_SUPPORT_EXT_CONFIG
1604 IN P_GLUE_INFO_T prGlueInfo
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
1622 IN P_GLUE_INFO_T prGlueInfo,
1623 IN BOOLEAN fgSetQuery,
1624 IN UINT_32 u4SetQueryInfoLen,
1625 IN WLAN_STATUS rOidStatus
1630 kalIoctl (IN P_GLUE_INFO_T prGlueInfo,
1631 IN PFN_OID_HANDLER_FUNC pfnOidHandler,
1633 IN UINT_32 u4InfoBufLen,
1638 OUT PUINT_32 pu4QryInfoLen
1643 IN P_GLUE_INFO_T prGlueInfo,
1644 IN P_EVENT_ASSOC_INFO prAssocInfo
1647 #if CFG_ENABLE_FW_DOWNLOAD
1650 kalFirmwareImageMapping (
1651 IN P_GLUE_INFO_T prGlueInfo,
1652 OUT PPVOID ppvMapFileBuf,
1653 OUT PUINT_32 pu4FileLength
1657 kalFirmwareImageUnmapping (
1658 IN P_GLUE_INFO_T prGlueInfo,
1659 IN PVOID prFwHandle,
1660 IN PVOID pvMapFileBuf
1665 /*----------------------------------------------------------------------------*/
1666 /* Card Removal Check */
1667 /*----------------------------------------------------------------------------*/
1670 IN P_GLUE_INFO_T prGlueInfo
1674 /*----------------------------------------------------------------------------*/
1676 /*----------------------------------------------------------------------------*/
1678 kalFlushPendingTxPackets(
1679 IN P_GLUE_INFO_T prGlueInfo
1683 /*----------------------------------------------------------------------------*/
1684 /* Media State Indication */
1685 /*----------------------------------------------------------------------------*/
1686 ENUM_PARAM_MEDIA_STATE_T
1687 kalGetMediaStateIndicated(
1688 IN P_GLUE_INFO_T prGlueInfo
1693 kalSetMediaStateIndicated(
1694 IN P_GLUE_INFO_T prGlueInfo,
1695 IN ENUM_PARAM_MEDIA_STATE_T eParamMediaStateIndicate
1699 /*----------------------------------------------------------------------------*/
1701 /*----------------------------------------------------------------------------*/
1704 IN P_GLUE_INFO_T prGlueInfo
1709 IN P_GLUE_INFO_T prGlueInfo
1714 IN P_GLUE_INFO_T prGlueInfo,
1715 IN P_QUE_ENTRY_T prQueueEntry
1718 #if CFG_ENABLE_BT_OVER_WIFI
1719 /*----------------------------------------------------------------------------*/
1720 /* Bluetooth over Wi-Fi handling */
1721 /*----------------------------------------------------------------------------*/
1723 kalIndicateBOWEvent(
1724 IN P_GLUE_INFO_T prGlueInfo,
1725 IN P_AMPC_EVENT prEvent
1728 ENUM_BOW_DEVICE_STATE
1730 IN P_GLUE_INFO_T prGlueInfo,
1731 IN PARAM_MAC_ADDRESS rPeerAddr
1736 IN P_GLUE_INFO_T prGlueInfo,
1737 IN ENUM_BOW_DEVICE_STATE eBowState,
1738 PARAM_MAC_ADDRESS rPeerAddr
1741 ENUM_BOW_DEVICE_STATE
1742 kalGetBowGlobalState (
1743 IN P_GLUE_INFO_T prGlueInfo
1748 IN P_GLUE_INFO_T prGlueInfo
1753 IN P_GLUE_INFO_T prGlueInfo,
1754 IN PARAM_MAC_ADDRESS rPeerAddr
1759 IN P_GLUE_INFO_T prGlueInfo,
1761 IN PARAM_MAC_ADDRESS rPeerAddr
1765 kalGetBowAvailablePhysicalLinkCount(
1766 IN P_GLUE_INFO_T prGlueInfo
1769 #if CFG_BOW_SEPARATE_DATA_PATH
1770 /*----------------------------------------------------------------------------*/
1771 /* Bluetooth over Wi-Fi Net Device Init/Uninit */
1772 /*----------------------------------------------------------------------------*/
1775 IN P_GLUE_INFO_T prGlueInfo,
1776 IN const char *prDevName
1781 IN P_GLUE_INFO_T prGlueInfo
1783 #endif // CFG_BOW_SEPARATE_DATA_PATH
1784 #endif // CFG_ENABLE_BT_OVER_WIFI
1787 /*----------------------------------------------------------------------------*/
1788 /* Firmware Download Handling */
1789 /*----------------------------------------------------------------------------*/
1791 kalGetFwStartAddress(
1792 IN P_GLUE_INFO_T prGlueInfo
1796 kalGetFwLoadAddress(
1797 IN P_GLUE_INFO_T prGlueInfo
1800 /*----------------------------------------------------------------------------*/
1801 /* Security Frame Clearance */
1802 /*----------------------------------------------------------------------------*/
1804 kalClearSecurityFrames(
1805 IN P_GLUE_INFO_T prGlueInfo
1809 kalClearSecurityFramesByNetType(
1810 IN P_GLUE_INFO_T prGlueInfo,
1811 IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx
1815 kalSecurityFrameSendComplete (
1816 IN P_GLUE_INFO_T prGlueInfo,
1818 IN WLAN_STATUS rStatus
1822 /*----------------------------------------------------------------------------*/
1823 /* Management Frame Clearance */
1824 /*----------------------------------------------------------------------------*/
1827 IN P_GLUE_INFO_T prGlueInfo
1831 kalClearMgmtFramesByNetType(
1832 IN P_GLUE_INFO_T prGlueInfo,
1833 IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx
1837 kalGetTxPendingFrameCount(
1838 IN P_GLUE_INFO_T prGlueInfo
1842 kalGetTxPendingCmdCount(
1843 IN P_GLUE_INFO_T prGlueInfo
1848 IN P_GLUE_INFO_T prGlueInfo,
1849 IN UINT_32 u4Interval
1854 IN P_GLUE_INFO_T prGlueInfo
1859 IN P_GLUE_INFO_T prGlueInfo,
1860 IN ENUM_KAL_NETWORK_TYPE_INDEX_T eNetTypeIdx,
1861 IN WLAN_STATUS status
1870 kalTimeoutHandler (unsigned long arg);
1873 kalSetEvent (P_GLUE_INFO_T pr);
1876 /*----------------------------------------------------------------------------*/
1877 /* NVRAM/Registry Service */
1878 /*----------------------------------------------------------------------------*/
1880 kalIsConfigurationExist(
1881 IN P_GLUE_INFO_T prGlueInfo
1885 kalGetConfiguration(
1886 IN P_GLUE_INFO_T prGlueInfo
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
1900 IN P_GLUE_INFO_T prGlueInfo,
1901 IN UINT_32 u4Offset,
1902 OUT PUINT_16 pu2Data
1907 IN P_GLUE_INFO_T prGlueInfo,
1908 IN UINT_32 u4Offset,
1912 /*----------------------------------------------------------------------------*/
1913 /* WSC Connection */
1914 /*----------------------------------------------------------------------------*/
1916 kalWSCGetActiveState(
1917 IN P_GLUE_INFO_T prGlueInfo
1920 /*----------------------------------------------------------------------------*/
1922 /*----------------------------------------------------------------------------*/
1925 IN P_GLUE_INFO_T prGlueInfo,
1926 IN ENUM_KAL_NETWORK_TYPE_INDEX_T eNetTypeIdx,
1928 IN INT_8 cLinkQuality
1932 /*----------------------------------------------------------------------------*/
1933 /* I/O Buffer Pre-allocation */
1934 /*----------------------------------------------------------------------------*/
1946 kalAllocateIOBuffer(
1947 IN UINT_32 u4AllocSize
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
1967 IN P_GLUE_INFO_T prGlueInfo
1970 #if CFG_SUPPORT_802_11W
1971 /*----------------------------------------------------------------------------*/
1973 /*----------------------------------------------------------------------------*/
1976 IN P_GLUE_INFO_T prGlueInfo
1980 /*******************************************************************************
1982 ********************************************************************************
1985 int tx_thread(void *data);
1987 #endif /* _GL_KAL_H */