2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/wlan_lib.h#3 $
6 \brief The declaration of the functions of the wlanAdpater objects
16 ** 01 15 2014 eason.tsai
17 ** [ALPS01070904] [Need Patch] [Volunteer Patch][MT6630][Driver]MT6630 Wi-Fi Patch
20 ** //ALPS_SW/DEV/ALPS.JB2.MT6630.DEV/alps/mediatek/kernel/drivers/combo/drv_wlan/mt6630/wlan/...
22 ** to //ALPS_SW/TRUNK/KK/alps/mediatek/kernel/drivers/combo/drv_wlan/mt6630/wlan/...
24 ** 12 27 2013 eason.tsai
25 ** [ALPS01070904] [Need Patch] [Volunteer Patch][MT6630][Driver]MT6630 Wi-Fi Patch
26 ** update code for ICAP & nvram
29 ** [BORA00002253] [MT6630 Wi-Fi][Driver][Firmware] Add NLO and timeout mechanism to SCN module
30 ** 1. integrate scheduled scan functionality
31 ** 2. condition compilation for linux-3.4 & linux-3.8 compatibility
32 ** 3. correct CMD queue access to reduce lock scope
34 ** 08 09 2013 terry.wu
35 ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
36 ** 1. Add new input parameter, Tx done status, for wlanReleaseCommand()
39 ** [BORA00002227] [MT6630 Wi-Fi][Driver] Update for Makefile and HIFSYS modifications
40 ** for windows build success
42 ** 07 31 2013 terry.wu
43 ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
44 ** 1. Fix NetDev binding issue
46 ** 07 30 2013 yuche.tsai
47 ** [BORA00002398] [MT6630][Volunteer Patch] P2P Driver Re-Design for Multiple BSS support
48 ** Temp fix Hot-spot data path issue.
50 ** 07 26 2013 terry.wu
51 ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
52 ** 1. Reduce extra Tx frame header parsing
53 ** 2. Add TX port control
54 ** 3. Add net interface to BSS binding
57 ** [BORA00002227] [MT6630 Wi-Fi][Driver] Update for Makefile and HIFSYS modifications
58 ** update MAC address handling logic
61 ** [BORA00002227] [MT6630 Wi-Fi][Driver] Update for Makefile and HIFSYS modifications
62 ** add reset option for firmware download configuration
65 ** [BORA00002227] [MT6630 Wi-Fi][Driver] Update for Makefile and HIFSYS modifications
66 ** 1. eliminate MT5931/MT6620/MT6628 logic
67 ** 2. add firmware download control sequence
69 ** 01 21 2013 terry.wu
70 ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
71 ** Update TX path based on new ucBssIndex modifications.
73 ** 01 17 2013 cm.chang
74 ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
75 ** Use ucBssIndex to replace eNetworkTypeIndex
77 ** 01 15 2013 terry.wu
78 ** [BORA00002207] [MT6630 Wi-Fi] TXM & MQM Implementation
79 ** Update Tx done resource release mechanism.
81 ** 09 17 2012 cm.chang
82 ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
83 ** Duplicate source from MT6620 v2.3 driver branch
84 ** (Davinci label: MT6620_WIFI_Driver_V2_3_120913_1942_As_MT6630_Base)
87 ** [WCXRP00001269] [MT6620 Wi-Fi][Driver] cfg80211 porting merge back to DaVinci
88 ** sync for NVRAM warning scan result generation for CFG80211.
91 ** [WCXRP00001269] [MT6620 Wi-Fi][Driver] cfg80211 porting merge back to DaVinci
95 ** [WCXRP00001269] [MT6620 Wi-Fi][Driver] cfg80211 porting merge back to DaVinci
96 ** cfg80211 support merge back from ALPS.JB to DaVinci - MT6620 Driver v2.3 branch.
98 * 06 08 2012 eason.tsai
100 * Nvram context covert from 6620 to 6628 for old 6620 meta tool
103 * [MT6620 Wi-Fi][Driver] API and behavior modification for preferred band configuration with corresponding network configuration
104 * add wlanSetPreferBandByNetwork() for glue layer to invoke for setting preferred band configuration corresponding to network type.
107 * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function
108 * Adding the related ioctl / wlan oid function to set the Tx power cfg.
111 * [WCXRP00001022] [MT6628 Driver][Firmware Download] Add multi section independent download functionality
112 * eliminate win32 native data types.
115 * [WCXRP00001022] [MT6628 Driver][Firmware Download] Add multi section independent download functionality
116 * add firmware download path in divided scatters.
119 * [MT6628 Driver][Firmware Download] Add multi section independent download functionality
120 * add firmware downloading aggregated path.
122 * 09 20 2011 tsaiyuan.hsu
123 * [WCXRP00000931] [MT5931 Wi-Fi][DRV/FW] add swcr to disable roaming from driver
124 * change window registry of driver for roaming.
126 * 09 08 2011 cm.chang
127 * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code
128 * Use new fields ucChannelListMap and ucChannelListIndex in NVRAM
130 * 08 31 2011 cm.chang
131 * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code
134 * 08 25 2011 chinghwa.yu
135 * [WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm
138 * 08 24 2011 chinghwa.yu
139 * [WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm
140 * Update RDD test mode cases.
143 * [WCXRP00000913] [MT6620 Wi-Fi] create repository of source code dedicated for MT6620 E6 ASIC
144 * support to load different firmware image for E3/E4/E5 and E6 ASIC on win32 platforms.
146 * 08 02 2011 yuche.tsai
147 * [WCXRP00000896] [Volunteer Patch][WiFi Direct][Driver] GO with multiple client, TX deauth to a disconnecting device issue.
148 * Fix GO send deauth frame issue.
150 * 07 22 2011 jeffrey.chang
151 * [WCXRP00000864] [MT5931] Add command to adjust OSC stable time
152 * modify driver to set OSC stable time after f/w download
154 * 07 18 2011 chinghwa.yu
155 * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm
156 * Add CMD/Event for RDD and BWCS.
159 * [WCXRP00000749] [MT6620 Wi-Fi][Driver] Add band edge tx power control to Wi-Fi NVRAM
160 * invoke CMD_ID_SET_EDGE_TXPWR_LIMIT when there is valid data exist in NVRAM content.
163 * [WCXRP00000718] [MT6620 Wi-Fi] modify the behavior of setting tx power
164 * ACPI APIs migrate to wlan_lib.c for glue layer to invoke.
167 * [WCXRP00000636] [WHQL][MT5931 Driver] 2c_PMHibernate (hang on 2h)
168 * 1) add API for glue layer to query ACPI state
169 * 2) Windows glue should not access to hardware after switched into D3 state
172 * [WCXRP00000532] [MT6620 Wi-Fi][Driver] Migrate NVRAM configuration procedures from MT6620 E2 to MT6620 E3
173 * deprecate configuration used by MT6620 E2
175 * 01 27 2011 tsaiyuan.hsu
176 * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support
178 * 1. not support 11r, only use strength of signal to determine roaming.
179 * 2. not enable CFG_SUPPORT_ROAMING until completion of full test.
180 * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw
181 * 4. assume that change of link quality in smooth way.
183 * 01 27 2011 george.huang
184 * [WCXRP00000355] [MT6620 Wi-Fi] Set WMM-PS related setting with qualifying AP capability
185 * Support current measure mode, assigned by registry (XP only).
188 * [WCXRP00000382] [MT6620 Wi-Fi][Driver] Track forwarding packet number with notifying tx thread for serving
189 * 1. add an extra counter for tracking pending forward frames.
190 * 2. notify TX service thread as well when there is pending forward frame
191 * 3. correct build errors leaded by introduction of Wi-Fi direct separation module
194 * [WCXRP00000351] [MT6620 Wi-Fi][Driver] remove from scanning result in OID handling layer when the corresponding BSS is disconnected due to beacon timeout
195 * remove from scanning result when the BSS is disconnected due to beacon timeout.
197 * 10 27 2010 george.huang
198 * [WCXRP00000127] [MT6620 Wi-Fi][Driver] Add a registry to disable Beacon Timeout function for SQA test by using E1 EVB
199 * Support registry option for disable beacon lost detection.
202 * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000137] [MT6620 Wi-Fi] [FW] Support NIC capability query command
203 * 1) update NVRAM content template to ver 1.02
204 * 2) add compile option for querying NIC capability (default: off)
205 * 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting
206 * 4) correct auto-rate compiler error under linux (treat warning as error)
207 * 5) simplify usage of NVRAM and REG_INFO_T
208 * 6) add version checking between driver and firmware
210 * 10 26 2010 eddie.chen
211 * [WCXRP00000134] [MT6620 Wi-Fi][Driver] Add a registry to enable auto rate for SQA test by using E1 EVB
212 * Add auto rate parameter in registry.
215 * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000086] [MT6620 Wi-Fi][Driver] The mac address is all zero at android
216 * complete implementation of Android NVRAM access
219 * [WCXRP00000084] [MT6620 Wi-Fi][Driver][FW] Add fixed rate support for distance test
220 * adding fixed rate support for distance test. (from registry setting)
223 * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning
224 * divide a single function into 2 part to surpress a weird compiler warning from gcc-4.4.0
227 * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning
228 * code reorganization to improve isolation between GLUE and CORE layers.
231 * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
232 * load manufacture data when CFG_SUPPORT_NVRAM is set to 1
235 * [WCXRP00000057] [MT6620 Wi-Fi][Driver] Modify online scan to a run-time switchable feature
236 * Modify online scan as a run-time adjustable option (for Windows, in registry)
239 * [WCXRP00000051] [MT6620 Wi-Fi][Driver] WHQL test fail in MAC address changed item
240 * use firmware reported mac address right after wlanAdapterStart() as permanent address
243 * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
244 * add skeleton for NVRAM integration
246 * 08 26 2010 yuche.tsai
248 * Add AT GO test configure mode under WinXP.
249 * Please enable 1. CFG_ENABLE_WIFI_DIRECT, 2. CFG_TEST_WIFI_DIRECT_GO, 3. CFG_SUPPORT_AAA
251 * 08 25 2010 george.huang
257 * 1) change BG_SCAN to ONLINE_SCAN for consistent term
258 * 2) only clear scanning result when scan is permitted to do
262 * 1) MMPDUs are now sent to MT6620 by CMD queue for keeping strict order of 1X/MMPDU/CMD packets
263 * 2) integrate with qmGetFrameAction() for deciding which MMPDU/1X could pass checking for sending
264 * 2) enhance CMD_INFO_T descriptor number from 10 to 32 to avoid descriptor underflow under concurrent network operation
268 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
271 * [WPD00003833][MT6620 and MT5931] Driver migration
272 * 802.1x and bluetooth-over-Wi-Fi security frames are now delievered to firmware via command path instead of data path.
275 * [WPD00003833][MT6620 and MT5931] Driver migration
276 * change MAC address updating logic.
279 * [WPD00003833][MT6620 and MT5931] Driver migration
280 * simplify timer usage.
283 * [WPD00003833][MT6620 and MT5931] Driver migration
284 * 1) migrate assoc.c.
285 * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
286 * 3) add configuration options for CNM_MEM and RSN modules
287 * 4) add data path for management frames
288 * 5) eliminate rPacketInfo of MSDU_INFO_T
291 * [WPD00003833][MT6620 and MT5931] Driver migration
292 * cnm_timer has been migrated.
294 * 06 06 2010 kevin.huang
295 * [WPD00003832][MT6620 5931] Create driver base
296 * [MT6620 5931] Create driver base
299 * [WPD00001943]Create WiFi test driver framework on WinXP
300 * 1) integrate OID_GEN_NETWORK_LAYER_ADDRESSES with CMD_ID_SET_IP_ADDRESS
301 * 2) buffer statistics data for 2 seconds
302 * 3) use default value for adhoc parameters instead of 0
305 * [WPD00001943]Create WiFi test driver framework on WinXP
306 * add extra 64 adjustable parameters for CoEX scenario.
309 * [WPD00001943]Create WiFi test driver framework on WinXP
310 * code refine: fgTestMode should be at adapter rather than glue due to the device/fw is also involved
313 * [WPD00001943]Create WiFi test driver framework on WinXP
314 * 1) for some OID, never do timeout expiration
315 * * 2) add 2 kal API for later integration
318 * [WPD00001943]Create WiFi test driver framework on WinXP
319 * change to use WIFI_TCM_ALWAYS_ON as firmware image
322 * [WPD00003816][MT6620 Wi-Fi] Adding the security support
323 * modify the wapi related code for new driver's design.
326 * [WPD00001943]Create WiFi test driver framework on WinXP
327 * always send CMD_NIC_POWER_CTRL packet when nic is being halted
330 * [WPD00001943]Create WiFi test driver framework on WinXP
331 * add two option for ACK and ENCRYPTION for firmware download
334 * [WPD00001943]Create WiFi test driver framework on WinXP
335 * separate wlanProcesQueuePacket() into 2 APIs upon request
338 * [WPD00001943]Create WiFi test driver framework on WinXP
339 * add new API: wlanProcessQueuedPackets()
342 * [WPD00001943]Create WiFi test driver framework on WinXP
343 * 1. add logic for firmware download
344 * * * 2. firmware image filename and start/load address are now retrieved from registry
347 * [WPD00001943]Create WiFi test driver framework on WinXP
348 * 1) remove unused function in nic_rx.c [which has been handled in que_mgt.c]
349 * * * * 2) firmware image length is now retrieved via NdisFileOpen
350 * * * * 3) firmware image is not structured by (P_IMG_SEC_HDR_T) anymore
351 * * * * 4) nicRxWaitResponse() revised
352 * * * * 5) another set of TQ counter default value is added for fw-download state
353 * * * * 6) Wi-Fi load address is now retrieved from registry too
356 * [WPD00001943]Create WiFi test driver framework on WinXP
357 * prepare for implementing fw download logic
360 * [WPD00001943]Create WiFi test driver framework on WinXP
361 * 1. eliminate improper variable in rHifInfo
362 * * * * * * * 2. block TX/ordinary OID when RF test mode is engaged
363 * * * * * * * 3. wait until firmware finish operation when entering into and leaving from RF test mode
364 * * * * * * * 4. correct some HAL implementation
365 ** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-12-10 16:39:55 GMT mtk02752
366 ** eliminate unused API
367 ** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-10-13 21:58:41 GMT mtk01084
368 ** update for new macro define
369 ** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-05-19 10:43:06 GMT mtk01461
370 ** Add wlanReleasePendingOid()
371 ** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-04-13 16:38:44 GMT mtk01084
372 ** add WIFI start function
373 ** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-08 16:51:14 GMT mtk01084
374 ** Update for the image download part
375 ** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-04-01 10:57:38 GMT mtk01461
376 ** Add wlanSendLeftClusteredFrames() for SDIO_TX_ENHANCE
377 ** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-23 00:31:02 GMT mtk01461
378 ** Add declaration of FW Image download reference code
379 ** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-16 09:08:31 GMT mtk01461
380 ** Update TX PATH API
381 ** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:12:04 GMT mtk01426
389 /*******************************************************************************
390 * C O M P I L E R F L A G S
391 ********************************************************************************
394 /*******************************************************************************
395 * E X T E R N A L R E F E R E N C E S
396 ********************************************************************************
398 #include "CFG_Wifi_File.h"
399 #include "rlm_domain.h"
401 /*******************************************************************************
403 ********************************************************************************
406 #define MAX_NUM_GROUP_ADDR 32 /* max number of group addresses */
410 #define TX_CS_TCP_UDP_GEN BIT(1)
411 #define TX_CS_IP_GEN BIT(0)
414 #define CSUM_OFFLOAD_EN_TX_TCP BIT(0)
415 #define CSUM_OFFLOAD_EN_TX_UDP BIT(1)
416 #define CSUM_OFFLOAD_EN_TX_IP BIT(2)
417 #define CSUM_OFFLOAD_EN_RX_TCP BIT(3)
418 #define CSUM_OFFLOAD_EN_RX_UDP BIT(4)
419 #define CSUM_OFFLOAD_EN_RX_IPv4 BIT(5)
420 #define CSUM_OFFLOAD_EN_RX_IPv6 BIT(6)
421 #define CSUM_OFFLOAD_EN_TX_MASK BITS(0, 2)
422 #define CSUM_OFFLOAD_EN_ALL BITS(0, 6)
424 /* TCP, UDP, IP Checksum */
425 #define RX_CS_TYPE_UDP BIT(7)
426 #define RX_CS_TYPE_TCP BIT(6)
427 #define RX_CS_TYPE_IPv6 BIT(5)
428 #define RX_CS_TYPE_IPv4 BIT(4)
430 #define RX_CS_STATUS_UDP BIT(3)
431 #define RX_CS_STATUS_TCP BIT(2)
432 #define RX_CS_STATUS_IP BIT(0)
434 #define CSUM_NOT_SUPPORTED 0x0
436 #define TXPWR_USE_PDSLOPE 0
438 /* NVRAM error code definitions */
439 #define NVRAM_ERROR_VERSION_MISMATCH BIT(1)
440 #define NVRAM_ERROR_INVALID_TXPWR BIT(2)
441 #define NVRAM_ERROR_INVALID_DPD BIT(3)
442 #define NVRAM_ERROR_INVALID_MAC_ADDR BIT(4)
444 #define NUM_TC_RESOURCE_TO_STATISTICS 4
446 #define WLAN_CFG_ARGV_MAX 8
447 #define WLAN_CFG_ENTRY_NUM_MAX 128
448 #define WLAN_CFG_KEY_LEN_MAX 32 /* include \x00 EOL */
449 #define WLAN_CFG_VALUE_LEN_MAX 32 /* include \x00 EOL */
450 #define WLAN_CFG_FLAG_SKIP_CB BIT(0)
451 #define WLAN_CFG_FILE_BUF_SIZE 2048
453 #define WLAN_CFG_SET_CHIP_LEN_MAX 10
454 #define WLAN_CFG_SET_DEBUG_LEVEL_LEN_MAX 10
455 #define WLAN_CFG_SET_SW_CTRL_LEN_MAX 10
458 #define WLAN_OID_TIMEOUT_THRESHOLD 2000 /* OID timeout (in ms) */
459 #define WLAN_OID_TIMEOUT_THRESHOLD_IN_RESETING 300 /* OID timeout during chip-reseting (in ms) */
461 #define WLAN_OID_NO_ACK_THRESHOLD 3
463 #define WLAN_TX_THREAD_TASK_PRIORITY 0 /* If not setting the priority, 0 is the default */
464 #define WLAN_TX_THREAD_TASK_NICE (-10) /* If not setting the nice, -10 is the default */
465 /*******************************************************************************
467 ********************************************************************************
469 typedef WLAN_STATUS(*PFN_OID_HANDLER_FUNC
) (IN P_ADAPTER_T prAdapter
,
471 IN UINT_32 u4BufLen
, OUT PUINT_32 pu4OutInfoLen
);
473 typedef enum _ENUM_CSUM_TYPE_T
{
479 } ENUM_CSUM_TYPE_T
, *P_ENUM_CSUM_TYPE_T
;
481 typedef enum _ENUM_CSUM_RESULT_T
{
486 } ENUM_CSUM_RESULT_T
, *P_ENUM_CSUM_RESULT_T
;
488 typedef enum _ENUM_PHY_MODE_T
{
490 ENUM_PHY_2G4_OFDM_BPSK
,
491 ENUM_PHY_2G4_OFDM_QPSK
,
492 ENUM_PHY_2G4_OFDM_16QAM
,
493 ENUM_PHY_2G4_OFDM_48M
,
494 ENUM_PHY_2G4_OFDM_54M
,
495 ENUM_PHY_2G4_HT20_BPSK
,
496 ENUM_PHY_2G4_HT20_QPSK
,
497 ENUM_PHY_2G4_HT20_16QAM
,
498 ENUM_PHY_2G4_HT20_MCS5
,
499 ENUM_PHY_2G4_HT20_MCS6
,
500 ENUM_PHY_2G4_HT20_MCS7
,
501 ENUM_PHY_2G4_HT40_BPSK
,
502 ENUM_PHY_2G4_HT40_QPSK
,
503 ENUM_PHY_2G4_HT40_16QAM
,
504 ENUM_PHY_2G4_HT40_MCS5
,
505 ENUM_PHY_2G4_HT40_MCS6
,
506 ENUM_PHY_2G4_HT40_MCS7
,
507 ENUM_PHY_5G_OFDM_BPSK
,
508 ENUM_PHY_5G_OFDM_QPSK
,
509 ENUM_PHY_5G_OFDM_16QAM
,
510 ENUM_PHY_5G_OFDM_48M
,
511 ENUM_PHY_5G_OFDM_54M
,
512 ENUM_PHY_5G_HT20_BPSK
,
513 ENUM_PHY_5G_HT20_QPSK
,
514 ENUM_PHY_5G_HT20_16QAM
,
515 ENUM_PHY_5G_HT20_MCS5
,
516 ENUM_PHY_5G_HT20_MCS6
,
517 ENUM_PHY_5G_HT20_MCS7
,
518 ENUM_PHY_5G_HT40_BPSK
,
519 ENUM_PHY_5G_HT40_QPSK
,
520 ENUM_PHY_5G_HT40_16QAM
,
521 ENUM_PHY_5G_HT40_MCS5
,
522 ENUM_PHY_5G_HT40_MCS6
,
523 ENUM_PHY_5G_HT40_MCS7
,
525 } ENUM_PHY_MODE_T
, *P_ENUM_PHY_MODE_T
;
527 typedef enum _ENUM_POWER_SAVE_POLL_MODE_T
{
528 ENUM_POWER_SAVE_POLL_DISABLE
,
529 ENUM_POWER_SAVE_POLL_LEGACY_NULL
,
530 ENUM_POWER_SAVE_POLL_QOS_NULL
,
531 ENUM_POWER_SAVE_POLL_NUM
532 } ENUM_POWER_SAVE_POLL_MODE_T
, *P_ENUM_POWER_SAVE_POLL_MODE_T
;
534 typedef enum _ENUM_AC_TYPE_T
{
544 } ENUM_AC_TYPE_T
, *P_ENUM_AC_TYPE_T
;
546 typedef enum _ENUM_ADV_AC_TYPE_T
{
547 ENUM_ADV_AC_TYPE_RX_NSW
,
548 ENUM_ADV_AC_TYPE_RX_PTA
,
549 ENUM_ADV_AC_TYPE_RX_SP
,
550 ENUM_ADV_AC_TYPE_TX_PTA
,
551 ENUM_ADV_AC_TYPE_TX_RSP
,
553 } ENUM_ADV_AC_TYPE_T
, *P_ENUM_ADV_AC_TYPE_T
;
555 typedef enum _ENUM_REG_CH_MAP_T
{
556 REG_CH_MAP_COUNTRY_CODE
,
558 REG_CH_MAP_CUSTOMIZED
,
560 } ENUM_REG_CH_MAP_T
, *P_ENUM_REG_CH_MAP_T
;
562 typedef enum _ENUM_FEATURE_OPTION_T
{
565 FEATURE_FORCE_ENABLED
566 } ENUM_FEATURE_OPTION_T
, *P_ENUM_FEATURE_OPTION_T
;
568 /* This enum is for later added feature options which use command reserved field as option switch */
569 typedef enum _ENUM_FEATURE_OPTION_IN_CMD_T
{
570 FEATURE_OPT_CMD_AUTO
,
571 FEATURE_OPT_CMD_DISABLED
,
572 FEATURE_OPT_CMD_ENABLED
,
573 FEATURE_OPT_CMD_FORCE_ENABLED
574 } ENUM_FEATURE_OPTION_IN_CMD_T
, *P_ENUM_FEATURE_OPTION_IN_CMD_T
;
576 #define DEBUG_MSG_SIZE_MAX 1200
578 DEBUG_MSG_ID_UNKNOWN
= 0x00,
579 DEBUG_MSG_ID_PRINT
= 0x01,
580 DEBUG_MSG_ID_FWLOG
= 0x02,
585 DEBUG_MSG_TYPE_UNKNOWN
= 0x00,
586 DEBUG_MSG_TYPE_MEM8
= 0x01,
587 DEBUG_MSG_TYPE_MEM32
= 0x02,
588 DEBUG_MSG_TYPE_ASCII
= 0x03,
589 DEBUG_MSG_TYPE_BINARY
= 0x04,
593 #define CHIP_CONFIG_RESP_SIZE 320
595 CHIP_CONFIG_TYPE_WO_RESPONSE
= 0x00,
596 CHIP_CONFIG_TYPE_MEM8
= 0x01,
597 CHIP_CONFIG_TYPE_MEM32
= 0x02,
598 CHIP_CONFIG_TYPE_ASCII
= 0x03,
599 CHIP_CONFIG_TYPE_BINARY
= 0x04,
600 CHIP_CONFIG_TYPE_DRV_PASSTHROUGH
= 0x05,
604 typedef struct _SET_TXPWR_CTRL_T
{
605 INT_8 c2GLegacyStaPwrOffset
; /* Unit: 0.5dBm, default: 0 */
606 INT_8 c2GHotspotPwrOffset
;
607 INT_8 c2GP2pPwrOffset
;
608 INT_8 c2GBowPwrOffset
;
609 INT_8 c5GLegacyStaPwrOffset
; /* Unit: 0.5dBm, default: 0 */
610 INT_8 c5GHotspotPwrOffset
;
611 INT_8 c5GP2pPwrOffset
;
612 INT_8 c5GBowPwrOffset
;
613 UINT_8 ucConcurrencePolicy
; /* TX power policy when concurrence
615 0: Highest power has priority
616 1: Lowest power has priority */
617 INT_8 acReserved1
[3]; /* Must be zero */
619 /* Power limit by channel for all data rates */
620 INT_8 acTxPwrLimit2G
[14]; /* Channel 1~14, Unit: 0.5dBm */
621 INT_8 acTxPwrLimit5G
[4]; /* UNII 1~4 */
622 INT_8 acReserved2
[2]; /* Must be zero */
623 } SET_TXPWR_CTRL_T
, *P_SET_TXPWR_CTRL_T
;
625 typedef enum _ENUM_NVRAM_MTK_FEATURE_T
{
626 MTK_FEATURE_2G_256QAM_DISABLED
= 0,
628 } ENUM_NVRAM_MTK_FEATURES_T
, *P_ENUM_NVRAM_MTK_FEATURES_T
;
630 /* For storing driver initialization value from glue layer */
631 typedef struct _REG_INFO_T
{
632 UINT_32 u4SdBlockSize
; /* SDIO block size */
633 UINT_32 u4SdBusWidth
; /* SDIO bus width. 1 or 4 */
634 UINT_32 u4SdClockRate
; /* SDIO clock rate. (in unit of HZ) */
635 UINT_32 u4StartAddress
; /* Starting address of Wi-Fi Firmware */
636 UINT_32 u4LoadAddress
; /* Load address of Wi-Fi Firmware */
637 UINT_16 aucFwImgFilename
[65]; /* Firmware filename */
638 UINT_16 aucFwImgFilenameE6
[65]; /* Firmware filename for E6 */
639 UINT_32 u4StartFreq
; /* Start Frequency for Ad-Hoc network : in unit of KHz */
640 UINT_32 u4AdhocMode
; /* Default mode for Ad-Hoc network : ENUM_PARAM_AD_HOC_MODE_T */
641 UINT_32 u4RddStartFreq
;
642 UINT_32 u4RddStopFreq
;
643 UINT_32 u4RddTestMode
;
644 UINT_32 u4RddShutFreq
;
646 INT_32 i4HighRssiThreshold
;
647 INT_32 i4MediumRssiThreshold
;
648 INT_32 i4LowRssiThreshold
;
649 INT_32 au4TxPriorityTag
[ENUM_AC_TYPE_NUM
];
650 INT_32 au4RxPriorityTag
[ENUM_AC_TYPE_NUM
];
651 INT_32 au4AdvPriorityTag
[ENUM_ADV_AC_TYPE_NUM
];
652 UINT_32 u4FastPSPoll
;
653 UINT_32 u4PTA
; /* 0: disable, 1: enable */
654 UINT_32 u4TXLimit
; /* 0: disable, 1: enable */
655 UINT_32 u4SilenceWindow
; /* range: 100 - 625, unit: us */
656 UINT_32 u4TXLimitThreshold
; /* range: 250 - 1250, unit: us */
658 UINT_32 fgEnArpFilter
;
659 UINT_32 u4PsCurrentMeasureEn
;
660 UINT_32 u4UapsdAcBmp
;
662 UINT_32 fgDisOnlineScan
; /* 0: enable online scan, non-zero: disable online scan */
663 UINT_32 fgDisBcnLostDetection
; /* 0: enable online scan, non-zero: disable online scan */
664 UINT_32 u4FixedRate
; /* 0: automatic, non-zero: fixed rate */
665 UINT_32 u4ArSysParam0
;
666 UINT_32 u4ArSysParam1
;
667 UINT_32 u4ArSysParam2
;
668 UINT_32 u4ArSysParam3
;
669 UINT_32 fgDisRoaming
; /* 0:enable roaming 1:disable */
671 /* NVRAM - MP Data -START- */
673 UINT_16 u2Part1OwnVersion
;
674 UINT_16 u2Part1PeerVersion
;
676 UINT_8 aucMacAddr
[6];
677 UINT_16 au2CountryCode
[4]; /* Country code (in ISO 3166-1 expression, ex: "US", "TW") */
678 TX_PWR_PARAM_T rTxPwr
;
679 UINT_8 aucEFUSE
[144];
681 UINT_8 ucSupport5GBand
;
682 UINT_8 fg2G4BandEdgePwrUsed
;
683 INT_8 cBandEdgeMaxPwrCCK
;
684 INT_8 cBandEdgeMaxPwrOFDM20
;
685 INT_8 cBandEdgeMaxPwrOFDM40
;
686 ENUM_REG_CH_MAP_T eRegChannelListMap
;
687 UINT_8 ucRegChannelListIndex
;
688 DOMAIN_INFO_ENTRY rDomainInfo
;
689 RSSI_PATH_COMPASATION_T rRssiPathCompasation
;
690 UINT_8 ucRssiPathCompasationUsed
;
691 /* NVRAM - MP Data -END- */
693 /* NVRAM - Functional Data -START- */
694 UINT_8 uc2G4BwFixed20M
;
695 UINT_8 uc5GBwFixed20M
;
696 UINT_8 ucEnable5GBand
;
698 UINT_8 ucRxDiversity
;
699 /* NVRAM - Functional Data -END- */
701 P_NEW_EFUSE_MAPPING2NVRAM_T prOldEfuseMapping
;
703 UINT_8 aucNvram
[512];
704 P_WIFI_CFG_PARAM_STRUCT prNvramSettings
;
706 } REG_INFO_T
, *P_REG_INFO_T
;
708 /* for divided firmware loading */
709 typedef struct _FWDL_SECTION_INFO_T
{
714 } FWDL_SECTION_INFO_T
, *P_FWDL_SECTION_INFO_T
;
716 typedef struct _FIRMWARE_DIVIDED_DOWNLOAD_T
{
718 UINT_32 u4CRC
; /* CRC calculated without first 8 bytes included */
719 UINT_32 u4NumOfEntries
;
721 FWDL_SECTION_INFO_T arSection
[];
722 } FIRMWARE_DIVIDED_DOWNLOAD_T
, *P_FIRMWARE_DIVIDED_DOWNLOAD_T
;
724 typedef struct _PARAM_MCR_RW_STRUC_T
{
727 } PARAM_MCR_RW_STRUC_T
, *P_PARAM_MCR_RW_STRUC_T
;
729 typedef struct _PARAM_GET_STA_STATISTICS
{
730 /* Per-STA statistic */
731 UINT_8 aucMacAddr
[MAC_ADDR_LEN
];
738 UINT_32 u4TxTotalCount
;
739 UINT_32 u4TxExceedThresholdCount
;
742 UINT_32 u4TxAverageProcessTime
;
744 UINT_32 u4RxTotalCount
;
746 UINT_32 au4TcResourceEmptyCount
[NUM_TC_RESOURCE_TO_STATISTICS
];
747 UINT_32 au4TcQueLen
[NUM_TC_RESOURCE_TO_STATISTICS
];
750 UINT_8 ucPer
; /* base: 128 */
753 UINT_16 u2LinkSpeed
; /* unit is 0.5 Mbits */
755 UINT_32 u4TxFailCount
;
756 UINT_32 u4TxLifeTimeoutCount
;
758 UINT_32 u4TxAverageAirTime
;
759 UINT_32 u4TransmitCount
; /* Transmit in the air (wtbl) */
760 UINT_32 u4TransmitFailCount
; /* Transmit without ack/ba in the air (wtbl) */
762 /* Global queue management statistic */
763 UINT_32 au4TcAverageQueLen
[NUM_TC_RESOURCE_TO_STATISTICS
];
764 UINT_32 au4TcCurrentQueLen
[NUM_TC_RESOURCE_TO_STATISTICS
];
766 /* Reserved fields */
767 UINT_8 au4Reserved
[32];
768 } PARAM_GET_STA_STA_STATISTICS
, *P_PARAM_GET_STA_STATISTICS
;
771 typedef struct _NET_INTERFACE_INFO_T
{
773 PVOID pvNetInterface
;
774 } NET_INTERFACE_INFO_T
, *P_NET_INTERFACE_INFO_T
;
776 typedef struct _SEC_FRAME_INFO_T
{
777 BOOLEAN fgIsProtected
;
778 #if CFG_SUPPORT_MULTITHREAD
779 /* Compose TxDesc in tx_thread and place here */
780 UINT_8 ucTxDescBuffer
[DWORD_TO_BYTE(7)];
782 } SEC_FRAME_INFO_T
, *P_SEC_FRAME_INFO_T
;
784 typedef enum _ENUM_TX_RESULT_CODE_T
{
785 TX_RESULT_SUCCESS
= 0,
786 TX_RESULT_LIFE_TIMEOUT
,
788 TX_RESULT_MPDU_ERROR
,
789 TX_RESULT_AGING_TIMEOUT
,
792 TX_RESULT_UNSPECIFIED_ERROR
,
793 TX_RESULT_DROPPED_IN_DRIVER
= 32,
794 TX_RESULT_DROPPED_IN_FW
,
795 TX_RESULT_QUEUE_CLEARANCE
,
797 } ENUM_TX_RESULT_CODE_T
, *P_ENUM_TX_RESULT_CODE_T
;
799 struct _WLAN_CFG_ENTRY_T
{
800 UINT_8 aucKey
[WLAN_CFG_KEY_LEN_MAX
];
801 UINT_8 aucValue
[WLAN_CFG_VALUE_LEN_MAX
];
802 WLAN_CFG_SET_CB pfSetCb
;
808 UINT_32 u4WlanCfgEntryNumMax
;
809 UINT_32 u4WlanCfgKeyLenMax
;
810 UINT_32 u4WlanCfgValueLenMax
;
811 WLAN_CFG_ENTRY_T arWlanCfgBuf
[WLAN_CFG_ENTRY_NUM_MAX
];
814 typedef enum _ENUM_MAX_BANDWIDTH_SETTING_T
{
820 } ENUM_MAX_BANDWIDTH_SETTING
, *P_ENUM_MAX_BANDWIDTH_SETTING_T
;
821 #if CFG_AUTO_CHANNEL_SEL_SUPPORT
823 typedef struct _LTE_SAFE_CH_INFO_T
{
824 UINT_32 u4SafeChannelBitmask
[4];
825 } LTE_SAFE_CH_INFO_T
, *P_CMD_LTE_SAFE_CH_INFO_T
;
827 /* Record Each CH Load */
828 typedef struct _PARAM_CHN_LOAD_INFO
{
832 UINT_16 u2ChannelLoad
;
833 UINT_8 au4Reserved0
[1];
835 UINT_16 u2APNumTmpCountingBuf
;
836 /* Reserved fields */
837 UINT_8 au4Reserved1
[8];
838 } PARAM_CHN_LOAD_INFO
, *P_PARAM_CHN_LOAD_INFO
;
840 typedef struct _PARAM_GET_CHN_LOAD
{
841 LTE_SAFE_CH_INFO_T rLteSafeChnList
;
842 PARAM_CHN_LOAD_INFO rEachChnLoad
[MAX_AUTO_CHAL_NUM
];
843 BOOLEAN fgDataReadyBit
;
844 UINT_8 au4Reserved
[3];
845 } PARAM_GET_CHN_LOAD
, *P_PARAM_GET_CHN_LOAD
;
847 typedef struct _PARAM_PREFER_CHN_INFO
{
850 UINT_8 au4Reserved
[1];
851 } PARAM_PREFER_CHN_INFO
, *P_PARAM_PREFER_CHN_INFO
;
854 typedef struct _PARAM_GET_LTE_MODE
{
857 UINT_8 aucReserved0
[3];
858 UINT_32 u4Flags
; /* Bit0: valid */
859 LTE_SAFE_CH_INFO_T LTE_MODE
;
860 UINT_8 aucReserved1
[4];
861 UINT_8 aucReserved2
[4];
862 } PARAM_GET_LTE_MODE
, *P_PARAM_GET_LTE_MODE
;
866 typedef struct _TX_PACKET_INFO
{
867 UINT_8 ucPriorityParam
;
869 UINT_8 aucEthDestAddr
[MAC_ADDR_LEN
];
873 BOOLEAN fgIsVlanExists
;
874 } TX_PACKET_INFO
, *P_TX_PACKET_INFO
;
876 typedef enum _ENUM_TX_PROFILING_TAG_T
{
877 TX_PROF_TAG_OS_TO_DRV
= 0,
878 TX_PROF_TAG_DRV_ENQUE
,
879 TX_PROF_TAG_DRV_DEQUE
,
880 TX_PROF_TAG_DRV_TX_DONE
,
881 TX_PROF_TAG_MAC_TX_DONE
882 } ENUM_TX_PROFILING_TAG_T
, *P_ENUM_TX_PROFILING_TAG_T
;
884 /*******************************************************************************
885 * P U B L I C D A T A
886 ********************************************************************************
889 /*******************************************************************************
890 * P R I V A T E D A T A
891 ********************************************************************************
894 /*******************************************************************************
896 ********************************************************************************
898 #define BUILD_SIGN(ch0, ch1, ch2, ch3) \
899 ((UINT_32)(UINT_8)(ch0) | ((UINT_32)(UINT_8)(ch1) << 8) | \
900 ((UINT_32)(UINT_8)(ch2) << 16) | ((UINT_32)(UINT_8)(ch3) << 24))
902 #define MTK_WIFI_SIGNATURE BUILD_SIGN('M', 'T', 'K', 'W')
904 #define IS_FEATURE_ENABLED(_ucFeature) \
905 (((_ucFeature) == FEATURE_ENABLED) || ((_ucFeature) == FEATURE_FORCE_ENABLED))
906 #define IS_FEATURE_FORCE_ENABLED(_ucFeature) ((_ucFeature) == FEATURE_FORCE_ENABLED)
907 #define IS_FEATURE_DISABLED(_ucFeature) ((_ucFeature) == FEATURE_DISABLED)
909 /* This macro is for later added feature options which use command reserved field as option switch */
915 #define FEATURE_OPT_IN_COMMAND(_ucFeature) ((_ucFeature) + 1)
918 /*******************************************************************************
919 * F U N C T I O N D E C L A R A T I O N S
920 ********************************************************************************
923 P_ADAPTER_T
wlanAdapterCreate(IN P_GLUE_INFO_T prGlueInfo
);
925 VOID
wlanAdapterDestroy(IN P_ADAPTER_T prAdapter
);
927 VOID
wlanCardEjected(IN P_ADAPTER_T prAdapter
);
929 VOID
wlanIST(IN P_ADAPTER_T prAdapter
);
931 BOOL
wlanISR(IN P_ADAPTER_T prAdapter
, IN BOOLEAN fgGlobalIntrCtrl
);
933 WLAN_STATUS
wlanProcessCommandQueue(IN P_ADAPTER_T prAdapter
, IN P_QUE_T prCmdQue
);
935 WLAN_STATUS
wlanSendCommand(IN P_ADAPTER_T prAdapter
, IN P_CMD_INFO_T prCmdInfo
);
937 #if CFG_SUPPORT_MULTITHREAD
938 WLAN_STATUS
wlanSendCommandMthread(IN P_ADAPTER_T prAdapter
, IN P_CMD_INFO_T prCmdInfo
);
940 WLAN_STATUS
wlanTxCmdMthread(IN P_ADAPTER_T prAdapter
);
942 WLAN_STATUS
wlanTxCmdDoneMthread(IN P_ADAPTER_T prAdapter
);
944 VOID
wlanClearTxCommandQueue(IN P_ADAPTER_T prAdapter
);
946 VOID
wlanClearTxCommandDoneQueue(IN P_ADAPTER_T prAdapter
);
948 VOID
wlanClearDataQueue(IN P_ADAPTER_T prAdapter
);
950 VOID
wlanClearRxToOsQueue(IN P_ADAPTER_T prAdapter
);
954 wlanReleaseCommand(IN P_ADAPTER_T prAdapter
,
955 IN P_CMD_INFO_T prCmdInfo
, IN ENUM_TX_RESULT_CODE_T rTxDoneStatus
);
957 VOID
wlanReleasePendingOid(IN P_ADAPTER_T prAdapter
, IN ULONG ulParamPtr
);
959 VOID
wlanReleasePendingCMDbyBssIdx(IN P_ADAPTER_T prAdapter
, IN UINT_8 ucBssIndex
);
961 VOID
wlanReturnPacketDelaySetupTimeout(IN P_ADAPTER_T prAdapter
, IN ULONG ulParamPtr
);
963 VOID
wlanReturnPacket(IN P_ADAPTER_T prAdapter
, IN PVOID pvPacket
);
966 wlanQueryInformation(IN P_ADAPTER_T prAdapter
,
967 IN PFN_OID_HANDLER_FUNC pfOidQryHandler
,
968 IN PVOID pvInfoBuf
, IN UINT_32 u4InfoBufLen
, OUT PUINT_32 pu4QryInfoLen
);
971 wlanSetInformation(IN P_ADAPTER_T prAdapter
,
972 IN PFN_OID_HANDLER_FUNC pfOidSetHandler
,
973 IN PVOID pvInfoBuf
, IN UINT_32 u4InfoBufLen
, OUT PUINT_32 pu4SetInfoLen
);
977 wlanAdapterStart(IN P_ADAPTER_T prAdapter
,
978 IN P_REG_INFO_T prRegInfo
,
979 IN PVOID pvFwImageMapFile
, IN UINT_32 u4FwImageFileLength
);
981 WLAN_STATUS
wlanAdapterStop(IN P_ADAPTER_T prAdapter
);
984 BOOLEAN
wlanQueryWapiMode(IN P_ADAPTER_T prAdapter
);
987 VOID
wlanReturnRxPacket(IN PVOID pvAdapter
, IN PVOID pvPacket
);
989 VOID
wlanRxSetBroadcast(IN P_ADAPTER_T prAdapter
, IN BOOLEAN fgEnableBroadcast
);
991 BOOLEAN
wlanIsHandlerNeedHwAccess(IN PFN_OID_HANDLER_FUNC pfnOidHandler
, IN BOOLEAN fgSetInfo
);
993 VOID
wlanSetPromiscuousMode(IN P_ADAPTER_T prAdapter
, IN BOOLEAN fgEnablePromiscuousMode
);
995 #if CFG_ENABLE_FW_DOWNLOAD
997 wlanImageSectionConfig(IN P_ADAPTER_T prAdapter
,
998 IN UINT_32 u4DestAddr
, IN UINT_32 u4ImgSecSize
, IN BOOLEAN fgReset
);
1001 wlanImageSectionDownload(IN P_ADAPTER_T prAdapter
,
1002 IN UINT_32 u4ImgSecSize
, IN PUINT_8 pucImgSecBuf
);
1005 wlanFwDvdDwnloadHandler(IN P_ADAPTER_T prAdapter
,
1006 IN P_FIRMWARE_DIVIDED_DOWNLOAD_T prFwHead
, IN PVOID pvFwImageMapFile
, OUT WLAN_STATUS
*u4Status
);
1009 wlanFwDwnloadHandler(IN P_ADAPTER_T prAdapter
,
1010 IN UINT_32 u4FwImgLength
, IN PVOID pvFwImageMapFile
, OUT WLAN_STATUS
*u4Status
);
1014 #if !CFG_ENABLE_FW_DOWNLOAD_ACK
1015 WLAN_STATUS
wlanImageQueryStatus(IN P_ADAPTER_T prAdapter
);
1017 WLAN_STATUS
wlanImageSectionDownloadStatus(IN P_ADAPTER_T prAdapter
, IN UINT_8 ucCmdSeqNum
);
1021 wlanConfigWifiFunc(IN P_ADAPTER_T prAdapter
, IN BOOLEAN fgEnable
, IN UINT_32 u4StartAddress
);
1023 UINT_32
wlanCRC32(PUINT_8 buf
, UINT_32 len
);
1027 WLAN_STATUS
wlanSendNicPowerCtrlCmd(IN P_ADAPTER_T prAdapter
, IN UINT_8 ucPowerMode
);
1029 BOOLEAN
wlanIsHandlerAllowedInRFTest(IN PFN_OID_HANDLER_FUNC pfnOidHandler
, IN BOOLEAN fgSetInfo
);
1031 WLAN_STATUS
wlanProcessQueuedSwRfb(IN P_ADAPTER_T prAdapter
, IN P_SW_RFB_T prSwRfbListHead
);
1034 wlanProcessQueuedMsduInfo(IN P_ADAPTER_T prAdapter
, IN P_MSDU_INFO_T prMsduInfoListHead
);
1036 BOOLEAN
wlanoidTimeoutCheck(IN P_ADAPTER_T prAdapter
, IN PFN_OID_HANDLER_FUNC pfnOidHandler
);
1038 VOID
wlanoidClearTimeoutCheck(IN P_ADAPTER_T prAdapter
);
1040 WLAN_STATUS
wlanUpdateNetworkAddress(IN P_ADAPTER_T prAdapter
);
1042 WLAN_STATUS
wlanUpdateBasicConfig(IN P_ADAPTER_T prAdapter
);
1044 BOOLEAN
wlanQueryTestMode(IN P_ADAPTER_T prAdapter
);
1046 BOOLEAN
wlanProcessTxFrame(IN P_ADAPTER_T prAdapter
, IN P_NATIVE_PACKET prPacket
);
1048 /* Security Frame Handling */
1049 BOOLEAN
wlanProcessSecurityFrame(IN P_ADAPTER_T prAdapter
, IN P_NATIVE_PACKET prPacket
);
1052 wlanSecurityFrameTxDone(IN P_ADAPTER_T prAdapter
,
1053 IN P_CMD_INFO_T prCmdInfo
, IN PUINT_8 pucEventBuf
);
1055 VOID
wlanSecurityFrameTxTimeout(IN P_ADAPTER_T prAdapter
, IN P_CMD_INFO_T prCmdInfo
);
1057 /*----------------------------------------------------------------------------*/
1058 /* OID/IOCTL Handling */
1059 /*----------------------------------------------------------------------------*/
1060 VOID
wlanClearScanningResult(IN P_ADAPTER_T prAdapter
);
1062 VOID
wlanClearBssInScanningResult(IN P_ADAPTER_T prAdapter
, IN PUINT_8 arBSSID
);
1064 #if CFG_TEST_WIFI_DIRECT_GO
1065 VOID
wlanEnableP2pFunction(IN P_ADAPTER_T prAdapter
);
1067 VOID
wlanEnableATGO(IN P_ADAPTER_T prAdapter
);
1070 /*----------------------------------------------------------------------------*/
1071 /* NIC Capability Retrieve by Polling */
1072 /*----------------------------------------------------------------------------*/
1073 WLAN_STATUS
wlanQueryNicCapability(IN P_ADAPTER_T prAdapter
);
1075 /*----------------------------------------------------------------------------*/
1076 /* PD MCR Retrieve by Polling */
1077 /*----------------------------------------------------------------------------*/
1078 WLAN_STATUS
wlanQueryPdMcr(IN P_ADAPTER_T prAdapter
, IN P_PARAM_MCR_RW_STRUC_T prMcrRdInfo
);
1080 /*----------------------------------------------------------------------------*/
1081 /* Loading Manufacture Data */
1082 /*----------------------------------------------------------------------------*/
1083 WLAN_STATUS
wlanLoadManufactureData(IN P_ADAPTER_T prAdapter
, IN P_REG_INFO_T prRegInfo
);
1086 /*----------------------------------------------------------------------------*/
1087 /* Media Stream Mode */
1088 /*----------------------------------------------------------------------------*/
1089 BOOLEAN
wlanResetMediaStreamMode(IN P_ADAPTER_T prAdapter
);
1092 /*----------------------------------------------------------------------------*/
1093 /* Timer Timeout Check (for Glue Layer) */
1094 /*----------------------------------------------------------------------------*/
1095 WLAN_STATUS
wlanTimerTimeoutCheck(IN P_ADAPTER_T prAdapter
);
1098 /*----------------------------------------------------------------------------*/
1099 /* Mailbox Message Check (for Glue Layer) */
1100 /*----------------------------------------------------------------------------*/
1101 WLAN_STATUS
wlanProcessMboxMessage(IN P_ADAPTER_T prAdapter
);
1104 /*----------------------------------------------------------------------------*/
1105 /* TX Pending Packets Handling (for Glue Layer) */
1106 /*----------------------------------------------------------------------------*/
1107 WLAN_STATUS
wlanEnqueueTxPacket(IN P_ADAPTER_T prAdapter
, IN P_NATIVE_PACKET prNativePacket
);
1109 WLAN_STATUS
wlanFlushTxPendingPackets(IN P_ADAPTER_T prAdapter
);
1111 WLAN_STATUS
wlanTxPendingPackets(IN P_ADAPTER_T prAdapter
, IN OUT PBOOLEAN pfgHwAccess
);
1114 /*----------------------------------------------------------------------------*/
1115 /* Low Power Acquire/Release (for Glue Layer) */
1116 /*----------------------------------------------------------------------------*/
1117 WLAN_STATUS
wlanAcquirePowerControl(IN P_ADAPTER_T prAdapter
);
1119 WLAN_STATUS
wlanReleasePowerControl(IN P_ADAPTER_T prAdapter
);
1122 /*----------------------------------------------------------------------------*/
1123 /* Pending Packets Number Reporting (for Glue Layer) */
1124 /*----------------------------------------------------------------------------*/
1125 UINT_32
wlanGetTxPendingFrameCount(IN P_ADAPTER_T prAdapter
);
1128 /*----------------------------------------------------------------------------*/
1129 /* ACPI state inquiry (for Glue Layer) */
1130 /*----------------------------------------------------------------------------*/
1131 ENUM_ACPI_STATE_T
wlanGetAcpiState(IN P_ADAPTER_T prAdapter
);
1133 VOID
wlanSetAcpiState(IN P_ADAPTER_T prAdapter
, IN ENUM_ACPI_STATE_T ePowerState
);
1135 VOID
wlanDefTxPowerCfg(IN P_ADAPTER_T prAdapter
);
1137 /*----------------------------------------------------------------------------*/
1138 /* get ECO version from Revision ID register (for Win32) */
1139 /*----------------------------------------------------------------------------*/
1140 UINT_8
wlanGetEcoVersion(IN P_ADAPTER_T prAdapter
);
1142 /*----------------------------------------------------------------------------*/
1143 /* set preferred band configuration corresponding to network type */
1144 /*----------------------------------------------------------------------------*/
1146 wlanSetPreferBandByNetwork(IN P_ADAPTER_T prAdapter
, IN ENUM_BAND_T eBand
, IN UINT_8 ucBssIndex
);
1148 /*----------------------------------------------------------------------------*/
1149 /* get currently operating channel information */
1150 /*----------------------------------------------------------------------------*/
1151 UINT_8
wlanGetChannelNumberByNetwork(IN P_ADAPTER_T prAdapter
, IN UINT_8 ucBssIndex
);
1153 /*----------------------------------------------------------------------------*/
1154 /* check for system configuration to generate message on scan list */
1155 /*----------------------------------------------------------------------------*/
1156 WLAN_STATUS
wlanCheckSystemConfiguration(IN P_ADAPTER_T prAdapter
);
1158 /*----------------------------------------------------------------------------*/
1159 /* query sta statistics information from driver and firmware */
1160 /*----------------------------------------------------------------------------*/
1162 wlanoidQueryStaStatistics(IN P_ADAPTER_T prAdapter
,
1163 IN PVOID pvQueryBuffer
,
1164 IN UINT_32 u4QueryBufferLen
, OUT PUINT_32 pu4QueryInfoLen
);
1166 /*----------------------------------------------------------------------------*/
1167 /* query NIC resource information from chip and reset Tx resource for normal operation */
1168 /*----------------------------------------------------------------------------*/
1169 VOID
wlanQueryNicResourceInformation(IN P_ADAPTER_T prAdapter
);
1171 /*----------------------------------------------------------------------------*/
1172 /* GET/SET BSS index mapping for network interfaces */
1173 /*----------------------------------------------------------------------------*/
1175 wlanBindNetInterface(IN P_GLUE_INFO_T prGlueInfo
,
1176 IN UINT_8 ucNetInterfaceIndex
, IN PVOID pvNetInterface
);
1179 wlanBindBssIdxToNetInterface(IN P_GLUE_INFO_T prGlueInfo
,
1180 IN UINT_8 ucBssIndex
, IN PVOID pvNetInterface
);
1182 UINT_8
wlanGetBssIdxByNetInterface(IN P_GLUE_INFO_T prGlueInfo
, IN PVOID pvNetInterface
);
1184 PVOID
wlanGetNetInterfaceByBssIdx(IN P_GLUE_INFO_T prGlueInfo
, IN UINT_8 ucBssIndex
);
1186 /* for windows as windows glue cannot see through P_ADAPTER_T */
1187 UINT_8
wlanGetAisBssIndex(IN P_ADAPTER_T prAdapter
);
1189 VOID
wlanInitFeatureOption(IN P_ADAPTER_T prAdapter
);
1191 VOID
wlanCfgSetSwCtrl(IN P_ADAPTER_T prAdapter
);
1193 VOID
wlanCfgSetChip(IN P_ADAPTER_T prAdapter
);
1195 VOID
wlanCfgSetDebugLevel(IN P_ADAPTER_T prAdapter
);
1197 VOID
wlanCfgSetCountryCode(IN P_ADAPTER_T prAdapter
);
1199 P_WLAN_CFG_ENTRY_T
wlanCfgGetEntry(IN P_ADAPTER_T prAdapter
, const PCHAR pucKey
);
1202 wlanCfgGet(IN P_ADAPTER_T prAdapter
,
1203 const PCHAR pucKey
, PCHAR pucValue
, PCHAR pucValueDef
, UINT_32 u4Flags
);
1205 UINT_32
wlanCfgGetUint32(IN P_ADAPTER_T prAdapter
, const PCHAR pucKey
, UINT_32 u4ValueDef
);
1207 INT_32
wlanCfgGetInt32(IN P_ADAPTER_T prAdapter
, const PCHAR pucKey
, INT_32 i4ValueDef
);
1209 WLAN_STATUS
wlanCfgSetUint32(IN P_ADAPTER_T prAdapter
, const PCHAR pucKey
, UINT_32 u4Value
);
1212 wlanCfgSet(IN P_ADAPTER_T prAdapter
, const PCHAR pucKey
, PCHAR pucValue
, UINT_32 u4Flags
);
1215 wlanCfgSetCb(IN P_ADAPTER_T prAdapter
,
1216 const PCHAR pucKey
, WLAN_CFG_SET_CB pfSetCb
, void *pPrivate
, UINT_32 u4Flags
);
1219 wlanCfgInit(IN P_ADAPTER_T prAdapter
,
1220 PUINT_8 pucConfigBuf
, UINT_32 u4ConfigBufLen
, UINT_32 u4Flags
);
1222 WLAN_STATUS
wlanCfgParseArgument(CHAR
*cmdLine
, INT_32
*argc
, CHAR
*argv
[]
1226 INT_32
wlanHexToNum(CHAR c
);
1227 INT_32
wlanHexToByte(PCHAR hex
);
1229 INT_32
wlanHwAddrToBin(PCHAR txt
, UINT_8
*addr
);
1231 BOOLEAN
wlanIsChipNoAck(IN P_ADAPTER_T prAdapter
);
1233 VOID
wlanTxProfilingTagPacket(IN P_ADAPTER_T prAdapter
,
1234 IN P_NATIVE_PACKET prPacket
, IN ENUM_TX_PROFILING_TAG_T eTag
);
1236 VOID
wlanTxProfilingTagMsdu(IN P_ADAPTER_T prAdapter
,
1237 IN P_MSDU_INFO_T prMsduInfo
, IN ENUM_TX_PROFILING_TAG_T eTag
);
1239 #endif /* _WLAN_LIB_H */