2 ** $Id: //Department/DaVinci/BRANCHES/MT662X_593X_WIFI_DRIVER_V2_3/include/nic/adapter.h#1 $
6 \brief Definition of internal data structure for driver manipulation.
8 In this file we define the internal data structure - ADAPTER_T which stands
9 for MiniPort ADAPTER(From Windows point of view) or stands for Network ADAPTER.
12 /*******************************************************************************
13 * Copyright (c) 2007 MediaTek Inc.
15 * All rights reserved. Copying, compilation, modification, distribution
16 * or any other use whatsoever of this material is strictly prohibited
17 * except in accordance with a Software License Agreement with
19 ********************************************************************************
22 /*******************************************************************************
25 * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND
26 * AGREES THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK
27 * SOFTWARE") RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE
28 * PROVIDED TO BUYER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY
29 * DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
30 * LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
31 * PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE
32 * ANY WARRANTY WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY
33 * WHICH MAY BE USED BY, INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK
34 * SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY
35 * WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE
36 * FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION OR TO
37 * CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
39 * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
40 * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL
41 * BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT
42 * ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY
43 * BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
45 * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
46 * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT
47 * OF LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING
48 * THEREOF AND RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN
49 * FRANCISCO, CA, UNDER THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE
51 ********************************************************************************
58 ** [WCXRP00001269] [MT6620 Wi-Fi][Driver] cfg80211 porting merge back to DaVinci
59 ** to sync with CFG80211 behavior for CFG80211 will block disconnect request while not staying in connected state
62 ** [WCXRP00001269] [MT6620 Wi-Fi][Driver] cfg80211 porting merge back to DaVinci
66 ** [WCXRP00001269] [MT6620 Wi-Fi][Driver] cfg80211 porting merge back to DaVinci
67 ** cfg80211 support merge back from ALPS.JB to DaVinci - MT6620 Driver v2.3 branch.
69 ** 07 24 2012 yuche.tsai
73 * 07 17 2012 yuche.tsai
75 * Let netdev bring up.
77 * 07 17 2012 yuche.tsai
79 * Compile no error before trial run.
81 * 06 13 2012 yuche.tsai
83 * Update maintrunk driver.
84 * Add support for driver compose assoc request frame.
88 * Snc CFG80211 modification for ICS migration from branch 2.2.
92 * Sync CFG80211 modification from branch 2,2.
95 * [MT6620 Wi-Fi][Driver] API and behavior modification for preferred band configuration with corresponding network configuration
96 * add wlanSetPreferBandByNetwork() for glue layer to invoke for setting preferred band configuration corresponding to network type.
99 * [WCXRP00001136] [All Wi-Fi][Driver] Add wake lock for pending timer
100 * Add wake lock if timer timeout value is smaller than 5 seconds
102 * 12 02 2011 yuche.tsai
104 * Resolve inorder issue under AP mode.
106 * data frame may TX before assoc response frame.
108 * 11 19 2011 yuche.tsai
110 * Update RSSI for P2P.
112 * 11 18 2011 yuche.tsai
114 * CONFIG P2P support RSSI query, default turned off.
116 * 11 11 2011 yuche.tsai
118 * Fix work thread cancel issue.
120 * 10 21 2011 eddie.chen
121 * [WCXRP00001051] [MT6620 Wi-Fi][Driver/Fw] Adjust the STA aging timeout
122 * Add switch to ignore the STA aging timeout.
125 * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP
126 * adding the 802.11w related function and define .
128 * 09 20 2011 cm.chang
129 * [WCXRP00000997] [MT6620 Wi-Fi][Driver][FW] Handle change of BSS preamble type and slot time
130 * Remove ERP member in adapter structure
132 * 09 14 2011 yuche.tsai
134 * Add P2P IE in assoc response.
136 * 08 31 2011 cm.chang
137 * [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code
140 * 07 18 2011 chinghwa.yu
141 * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm
142 * Add CMD/Event for RDD and BWCS.
145 * [WCXRP00000812] [MT6620 Wi-Fi][Driver] not show NVRAM when there is no valid MAC address in NVRAM content
146 * check with firmware for valid MAC address.
148 * 04 18 2011 terry.wu
149 * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED
150 * Remove flag CFG_WIFI_DIRECT_MOVED.
152 * 04 12 2011 cm.chang
153 * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency
156 * 04 08 2011 yuche.tsai
157 * [WCXRP00000624] [Volunteer Patch][MT6620][Driver] Add device discoverability support for GO.
158 * Add device discoverability support.
159 * Action frame callback for GO Device Discoverability Req.
161 * 04 08 2011 george.huang
162 * [WCXRP00000621] [MT6620 Wi-Fi][Driver] Support P2P supplicant to set power mode
163 * separate settings of P2P and AIS
165 * 04 08 2011 eddie.chen
166 * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma
169 * 03 19 2011 yuche.tsai
170 * [WCXRP00000584] [Volunteer Patch][MT6620][Driver] Add beacon timeout support for WiFi Direct.
171 * Add beacon timeout support for WiFi Direct Network.
173 * 03 19 2011 yuche.tsai
174 * [WCXRP00000581] [Volunteer Patch][MT6620][Driver] P2P IE in Assoc Req Issue
175 * Make assoc req to append P2P IE if wifi direct is enabled.
178 * [WCXRP00000562] [MT6620 Wi-Fi][Driver] I/O buffer pre-allocation to avoid physically continuous memory shortage after system running for a long period
179 * use pre-allocated buffer for storing enhanced interrupt response as well
182 * [WCXRP00000559] [MT6620 Wi-Fi][Driver] Combine TX/RX DMA buffers into a single one to reduce physically continuous memory consumption
183 * 1. deprecate CFG_HANDLE_IST_IN_SDIO_CALLBACK
184 * 2. Use common coalescing buffer for both TX/RX directions
187 * 03 10 2011 yuche.tsai
188 * [WCXRP00000533] [Volunteer Patch][MT6620][Driver] Provide a P2P function API for Legacy WiFi to query AP mode.
189 * Provide an API for Legacy WiFi to query the operation mode..
192 * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code
193 * add the code to get the check rsponse and indicate to app.
196 * [WCXRP00000448] [MT6620 Wi-Fi][Driver] Fixed WSC IE not send out at probe request
197 * Add code to send beacon and probe response WSC IE at Auto GO.
200 * [WCXRP00000503] [MT6620 Wi-Fi][Driver] Take RCPI brought by association response as initial RSSI right after connection is built.
201 * use RCPI brought by ASSOC-RESP after connection is built as initial RCPI to avoid using a uninitialized MAC-RX RCPI.
203 * 02 21 2011 terry.wu
204 * [WCXRP00000476] [MT6620 Wi-Fi][Driver] Clean P2P scan list while removing P2P
205 * Clean P2P scan list while removing P2P.
207 * 02 17 2011 eddie.chen
208 * [WCXRP00000458] [MT6620 Wi-Fi][Driver] BOW Concurrent - ProbeResp was exist in other channel
209 * 1) Chnage GetFrameAction decision when BSS is absent.
210 * 2) Check channel and resource in processing ProbeRequest
212 * 02 16 2011 cm.chang
213 * [WCXRP00000447] [MT6620 Wi-Fi][FW] Support new NVRAM update mechanism
216 * 02 10 2011 yuche.tsai
217 * [WCXRP00000431] [Volunteer Patch][MT6620][Driver] Add MLME support for deauthentication under AP(Hot-Spot) mode.
218 * Add RX deauthentication & disassociation process under Hot-Spot mode.
221 * [WCXRP00000433] [MT6620 Wi-Fi][Driver] Remove WAPI structure define for avoid P2P module with structure miss-align pointer issue
222 * always pre-allio WAPI related structure for align p2p module.
224 * 02 08 2011 yuche.tsai
225 * [WCXRP00000419] [Volunteer Patch][MT6620/MT5931][Driver] Provide function of disconnect to target station for AAA module.
226 * Provide disconnect function for AAA module.
228 * 02 01 2011 cm.chang
229 * [WCXRP00000415] [MT6620 Wi-Fi][Driver] Check if any memory leakage happens when uninitializing in DGB mode
232 * 01 27 2011 tsaiyuan.hsu
233 * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support
235 * 1. not support 11r, only use strength of signal to determine roaming.
236 * 2. not enable CFG_SUPPORT_ROAMING until completion of full test.
237 * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw
238 * 4. assume that change of link quality in smooth way.
240 * 01 27 2011 george.huang
241 * [WCXRP00000400] [MT6620 Wi-Fi] support CTIA power mode setting
242 * Support CTIA power mode setting.
244 * 01 27 2011 george.huang
245 * [WCXRP00000355] [MT6620 Wi-Fi] Set WMM-PS related setting with qualifying AP capability
246 * Support current measure mode, assigned by registry (XP only).
249 * [WCXRP00000382] [MT6620 Wi-Fi][Driver] Track forwarding packet number with notifying tx thread for serving
250 * 1. add an extra counter for tracking pending forward frames.
251 * 2. notify TX service thread as well when there is pending forward frame
252 * 3. correct build errors leaded by introduction of Wi-Fi direct separation module
254 * 01 12 2011 cm.chang
255 * [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting
256 * User-defined bandwidth is for 2.4G and 5G individually
258 * 12 29 2010 eddie.chen
259 * [WCXRP00000322] Add WMM IE in beacon,
261 Add per station flow control when STA is in PS
264 * Add WMM parameter for broadcast.
266 * 12 29 2010 eddie.chen
267 * [WCXRP00000322] Add WMM IE in beacon,
269 Add per station flow control when STA is in PS
272 * Add CWMin CWMax for AP to generate IE.
274 * 12 29 2010 eddie.chen
275 * [WCXRP00000322] Add WMM IE in beacon,
276 Add per station flow control when STA is in PS
278 * 1) PS flow control event
280 * 2) WMM IE in beacon, assoc resp, probe resp
283 * [WCXRP00000269] [MT6620 Wi-Fi][Driver][Firmware] Prepare for v1.1 branch release
284 * report EEPROM used flag via NIC_CAPABILITY
287 * [WCXRP00000269] [MT6620 Wi-Fi][Driver][Firmware] Prepare for v1.1 branch release
288 * integrate with 'EEPROM used' flag for reporting correct capability to Engineer Mode/META and other tools
290 * 12 07 2010 cm.chang
291 * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant
292 * 1. Country code is from NVRAM or supplicant
293 * 2. Change band definition in CMD/EVENT.
296 * [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
297 * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead
298 * 2) Remove CNM CH-RECOVER event handling
299 * 3) cfg read/write API renamed with kal prefix for unified naming rules.
301 * 10 27 2010 george.huang
302 * [WCXRP00000127] [MT6620 Wi-Fi][Driver] Add a registry to disable Beacon Timeout function for SQA test by using E1 EVB
303 * Support registry option for disable beacon lost detection.
306 * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000137] [MT6620 Wi-Fi] [FW] Support NIC capability query command
307 * 1) update NVRAM content template to ver 1.02
308 * 2) add compile option for querying NIC capability (default: off)
309 * 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting
310 * 4) correct auto-rate compiler error under linux (treat warning as error)
311 * 5) simplify usage of NVRAM and REG_INFO_T
312 * 6) add version checking between driver and firmware
315 * [WCXRP00000084] [MT6620 Wi-Fi][Driver][FW] Add fixed rate support for distance test
316 * adding fixed rate support for distance test. (from registry setting)
319 * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning
320 * code reorganization to improve isolation between GLUE and CORE layers.
323 * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
324 * 1) add NVRAM access API
325 * 2) fake scanning result when NVRAM doesn't exist and/or version mismatch. (off by compiler option)
326 * 3) add OID implementation for NVRAM read/write service
328 * 09 27 2010 chinghwa.yu
329 * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000065] Update BoW design and settings
330 * Update BCM/BoW design and settings.
333 * [WCXRP00000057] [MT6620 Wi-Fi][Driver] Modify online scan to a run-time switchable feature
334 * Modify online scan as a run-time adjustable option (for Windows, in registry)
337 * [WCXRP00000051] [MT6620 Wi-Fi][Driver] WHQL test fail in MAC address changed item
338 * use firmware reported mac address right after wlanAdapterStart() as permanent address
342 * use static memory pool for storing IEs of scanning result.
344 * 09 07 2010 yuche.tsai
346 * Add a common IE buffer in P2P INFO structure.
348 * 09 03 2010 kevin.huang
350 * Refine #include sequence and solve recursive/nested #include issue
354 * restore configuration as before.
358 * adding the wapi support for integration test.
360 * 08 31 2010 kevin.huang
362 * Use LINK LIST operation to process SCAN result
364 * 08 29 2010 yuche.tsai
366 * Finish SLT TX/RX & Rate Changing Support.
368 * 08 25 2010 george.huang
370 * update OID/ registry control path for PM related settings
372 * 08 24 2010 cm.chang
374 * Support RLM initail channel of Ad-hoc, P2P and BOW
376 * 08 23 2010 chinghwa.yu
380 * 08 20 2010 cm.chang
382 * Migrate RLM code to host from FW
384 * 08 16 2010 yuche.tsai
386 * Add an intend mode for BSS info.
387 * It is used to let P2P BSS Info to know which OP Mode it is going to become.
389 * 08 04 2010 george.huang
391 * handle change PS mode OID/ CMD
395 * comment out deprecated members in BSS_INFO, which are only used by firmware rather than driver.
399 * eliminate u4FreqInKHz usage, combined into rConnections.ucAdHoc*
403 * 1) eliminate redundant variable eOPMode in prAdapter->rWlanInfo
404 * 2) change nicMediaStateChange() API prototype
408 * .support the Wi-Fi RSN
410 * 07 21 2010 yuche.tsai
412 * Add for P2P Scan Result Parsing & Saving.
416 * update for security supporting.
418 * 07 19 2010 cm.chang
420 * Set RLM parameters and enable CNM channel manager
422 * 07 19 2010 yuche.tsai
424 * Remove BSS info which is redonedent in Wifi Var..
426 * 07 16 2010 yarco.yang
428 * 1. Support BSS Absence/Presence Event
429 * 2. Support STA change PS mode Event
430 * 3. Support BMC forwarding for AP mode.
432 * 07 14 2010 yarco.yang
434 * 1. Remove CFG_MQM_MIGRATION
435 * 2. Add CMD_UPDATE_WMM_PARMS command
437 * 07 09 2010 george.huang
439 * [WPD00001556] Migrate PM variables from FW to driver: for composing QoS Info
443 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
445 * 07 08 2010 cm.chang
446 * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
447 * Check draft RLM code for HT cap
449 * 06 29 2010 yarco.yang
450 * [WPD00003837][MT6620]Data Path Refine
451 * replace g_rQM with Adpater->rQM
453 * 06 28 2010 cm.chang
454 * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
455 * 1st draft code for RLM module
458 * [WPD00003840][MT6620 5931] Security migration
459 * remove duplicate variable for migration.
462 * [WPD00003840][MT6620 5931] Security migration
463 * modify some code for concurrent network.
465 * 06 21 2010 yuche.tsai
466 * [WPD00003839][MT6620 5931][P2P] Feature migration
467 * Add P2P FSM Info in adapter.
469 * 06 21 2010 yarco.yang
470 * [WPD00003837][MT6620]Data Path Refine
471 * Support CFG_MQM_MIGRATION flag
473 * 06 18 2010 cm.chang
474 * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
475 * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf
478 * [WPD00003840][MT6620 5931] Security migration
479 * migration the security related function from firmware.
481 * 06 17 2010 yuche.tsai
482 * [WPD00003839][MT6620 5931][P2P] Feature migration
483 * Add P2P related field, additional include p2p_fsm.h if p2p is enabled.
486 * [WPD00003833][MT6620 and MT5931] Driver migration
490 * [WPD00003833][MT6620 and MT5931] Driver migration
491 * add management dispatching function table.
494 * [WPD00003833][MT6620 and MT5931] Driver migration
495 * auth.c is migrated.
498 * [WPD00003833][MT6620 and MT5931] Driver migration
499 * 1) migrate assoc.c.
500 * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
501 * 3) add configuration options for CNM_MEM and RSN modules
502 * 4) add data path for management frames
503 * 5) eliminate rPacketInfo of MSDU_INFO_T
506 * [WPD00003833][MT6620 and MT5931] Driver migration
507 * add buildable & linkable ais_fsm.c
509 * related reference are still waiting to be resolved
512 * [WPD00003833][MT6620 and MT5931] Driver migration
513 * add definitions for module migration.
516 * [WPD00003833][MT6620 and MT5931] Driver migration
517 * cnm_timer has been migrated.
520 * [WPD00003833][MT6620 and MT5931] Driver migration
521 * hem_mbox is migrated.
524 * [WPD00003833][MT6620 and MT5931] Driver migration
525 * merge wifi_var.h, precomp.h, cnm_timer.h (data type only)
527 * 06 06 2010 kevin.huang
528 * [WPD00003832][MT6620 5931] Create driver base
529 * [MT6620 5931] Create driver base
532 * [WPD00001943]Create WiFi test driver framework on WinXP
533 * change OID behavior to meet WHQL requirement.
536 * [WPD00001943]Create WiFi test driver framework on WinXP
537 * 1) integrate OID_GEN_NETWORK_LAYER_ADDRESSES with CMD_ID_SET_IP_ADDRESS
538 * 2) buffer statistics data for 2 seconds
539 * 3) use default value for adhoc parameters instead of 0
542 * [WPD00001943]Create WiFi test driver framework on WinXP
543 * 1) do not take timeout mechanism for power mode oids
544 * 2) retrieve network type from connection status
545 * 3) after disassciation, set radio state to off
546 * 4) TCP option over IPv6 is supported
549 * [WPD00001943]Create WiFi test driver framework on WinXP
550 * implement Wakeup-on-LAN except firmware integration part
553 * [WPD00001943]Create WiFi test driver framework on WinXP
554 * reserve field of privacy filter and RTS threshold setting.
557 * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
558 * add framework for BT-over-Wi-Fi support.
559 * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability
560 * * * * * * 2) command sequence number is now increased atomically
561 * * * * * * 3) private data could be hold and taken use for other purpose
564 * [WPD00001943]Create WiFi test driver framework on WinXP
565 * rWlanInfo should be placed at adapter rather than glue due to most operations
566 * * * are done in adapter layer.
569 * [WPD00001943]Create WiFi test driver framework on WinXP
570 * code refine: fgTestMode should be at adapter rather than glue due to the device/fw is also involved
573 * [WPD00003816][MT6620 Wi-Fi] Adding the security support
574 * modify the wapi related code for new driver's design.
577 * [WPD00001943]Create WiFi test driver framework on WinXP
578 * 1) add ACPI D0/D3 state switching support
579 * * * 2) use more formal way to handle interrupt when the status is retrieved from enhanced RX response
582 * [WPD00001943]Create WiFi test driver framework on WinXP
583 * implement OID_802_3_MULTICAST_LIST oid handling
586 * [WPD00001943]Create WiFi test driver framework on WinXP
587 * 1) the use of prPendingOid revised, all accessing are now protected by spin lock
588 * * * 2) ensure wlanReleasePendingOid will clear all command queues
591 * [WPD00001943]Create WiFi test driver framework on WinXP
592 * move ucCmdSeqNum as instance variable
595 * [WPD00003816][MT6620 Wi-Fi] Adding the security support
599 * [WPD00001943]Create WiFi test driver framework on WinXP
600 * 1. eliminate improper variable in rHifInfo
601 * * * 2. block TX/ordinary OID when RF test mode is engaged
602 * * * 3. wait until firmware finish operation when entering into and leaving from RF test mode
603 * * * 4. correct some HAL implementation
606 * [WPD00001943]Create WiFi test driver framework on WinXP
607 * 1) According to CMD/EVENT documentation v0.8,
608 * * * OID_CUSTOM_TEST_RX_STATUS & OID_CUSTOM_TEST_TX_STATUS is no longer used,
609 * * * and result is retrieved by get ATInfo instead
610 * * * 2) add 4 counter for recording aggregation statistics
613 * [WPD00001943]Create WiFi test driver framework on WinXP
614 * eliminate redundant variables for connection_state
615 ** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-12-16 18:02:03 GMT mtk02752
616 ** add external reference to avoid compilation error
617 ** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-12-10 16:40:26 GMT mtk02752
618 ** eliminate unused member
619 ** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-12-08 17:36:08 GMT mtk02752
620 ** add RF test data members into P_ADAPTER_T
621 ** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-10-13 21:58:45 GMT mtk01084
622 ** update for new HW architecture design
623 ** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-04-28 10:29:57 GMT mtk01461
624 ** Add read WTSR for SDIO_STATUS_ENHANCE mode
625 ** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-04-21 09:37:35 GMT mtk01461
626 ** Add prPendingCmdInfoOfOID for temporarily saving the CMD_INFO_T before en-queue to rCmdQueue
627 ** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-04-17 19:57:51 GMT mtk01461
628 ** Add MGMT Buffer Info
629 ** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-01 10:34:12 GMT mtk01461
630 ** Add SW pre test CFG_HIF_LOOPBACK_PRETEST
631 ** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-03-23 21:41:48 GMT mtk01461
632 ** Add fgIsWmmAssoc flag for TC assignment
633 ** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-19 18:32:51 GMT mtk01084
634 ** update for basic power management functions
635 ** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-18 20:51:52 GMT mtk01426
636 ** Add #if CFG_SDIO_RX_ENHANCE related data structure
637 ** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:17 GMT mtk01426
645 /*******************************************************************************
646 * C O M P I L E R F L A G S
647 ********************************************************************************
650 /*******************************************************************************
651 * E X T E R N A L R E F E R E N C E S
652 ********************************************************************************
655 /*******************************************************************************
657 ********************************************************************************
660 /*******************************************************************************
662 ********************************************************************************
664 typedef struct _ENHANCE_MODE_DATA_STRUCT_T SDIO_CTRL_T, *P_SDIO_CTRL_T;
666 typedef struct _WLAN_INFO_T {
667 PARAM_BSSID_EX_T rCurrBssId;
670 PARAM_BSSID_EX_T arScanResult[CFG_MAX_NUM_BSS_LIST];
671 PUINT_8 apucScanResultIEs[CFG_MAX_NUM_BSS_LIST];
672 UINT_32 u4ScanResultNum;
674 // IE pool for Scanning Result
675 UINT_8 aucScanIEBuf[CFG_MAX_COMMON_IE_BUF_LEN];
676 UINT_32 u4ScanIEBufferUsage;
678 OS_SYSTIME u4SysTime;
680 // connection parameter (for Ad-Hoc)
681 UINT_16 u2BeaconPeriod;
682 UINT_16 u2AtimWindow;
684 PARAM_RATES eDesiredRates;
685 CMD_LINK_ATTRIB eLinkAttr;
686 // CMD_PS_PROFILE_T ePowerSaveMode;
687 CMD_PS_PROFILE_T arPowerSaveMode[NETWORK_TYPE_INDEX_NUM];
690 ENUM_RSSI_TRIGGER_TYPE eRssiTriggerType;
691 PARAM_RSSI rRssiTriggerValue;
694 ENUM_PARAM_PRIVACY_FILTER_T ePrivacyFilter;
697 PARAM_RTS_THRESHOLD eRtsThreshold;
700 UINT_8 ucNetworkType;
702 // Network Type In Use
703 UINT_8 ucNetworkTypeInUse;
705 } WLAN_INFO_T, *P_WLAN_INFO_T;
707 /* Session for CONNECTION SETTINGS */
708 typedef struct _CONNECTION_SETTINGS_T {
710 UINT_8 aucMacAddress[MAC_ADDR_LEN];
712 UINT_8 ucDelayTimeOfDisconnectEvent;
714 BOOLEAN fgIsConnByBssidIssued;
715 UINT_8 aucBSSID[MAC_ADDR_LEN];
717 BOOLEAN fgIsConnReqIssued;
718 BOOLEAN fgIsDisconnectedByNonRequest;
721 UINT_8 aucSSID[ELEM_MAX_LEN_SSID];
723 ENUM_PARAM_OP_MODE_T eOPMode;
725 ENUM_PARAM_CONNECTION_POLICY_T eConnectionPolicy;
727 ENUM_PARAM_AD_HOC_MODE_T eAdHocMode;
729 ENUM_PARAM_AUTH_MODE_T eAuthMode;
731 ENUM_PARAM_ENCRYPTION_STATUS_T eEncStatus;
733 BOOLEAN fgIsScanReqIssued;
737 UINT_16 u2BeaconPeriod;
739 UINT_16 u2RTSThreshold; /* User desired setting */
741 UINT_16 u2DesiredNonHTRateSet; /* User desired setting */
743 UINT_8 ucAdHocChannelNum; /* For AdHoc */
745 ENUM_BAND_T eAdHocBand; /* For AdHoc */
747 UINT_32 u4FreqInKHz; /* Center frequency */
749 /* ATIM windows using for IBSS power saving function */
750 UINT_16 u2AtimWindow;
753 BOOLEAN fgIsEnableRoaming;
755 BOOLEAN fgIsAdHocQoSEnable;
757 ENUM_PARAM_PHY_CONFIG_T eDesiredPhyConfig;
759 /* Used for AP mode for desired channel and bandwidth */
760 UINT_16 u2CountryCode;
761 UINT_8 uc2G4BandwidthMode; /* 20/40M or 20M only */
762 UINT_8 uc5GBandwidthMode; /* 20/40M or 20M only */
764 BOOLEAN fgTxShortGIDisabled;
765 BOOLEAN fgRxShortGIDisabled;
767 #if CFG_SUPPORT_802_11D
768 BOOLEAN fgMultiDomainCapabilityEnabled;
769 #endif /* CFG_SUPPORT_802_11D*/
772 #if 1 //CFG_SUPPORT_WAPI
774 UINT_32 u4WapiSelectedGroupCipher;
775 UINT_32 u4WapiSelectedPairwiseCipher;
776 UINT_32 u4WapiSelectedAKMSuite;
780 /* for WPS, disable the privacy check for AP selection policy */
781 BOOLEAN fgPrivacyCheckDisable;
783 /* b0~3: trigger-en AC0~3. b4~7: delivery-en AC0~3 */
786 } CONNECTION_SETTINGS_T, *P_CONNECTION_SETTINGS_T;
790 ENUM_PARAM_MEDIA_STATE_T eConnectionState; /* Connected Flag used in AIS_NORMAL_TR */
791 ENUM_PARAM_MEDIA_STATE_T eConnectionStateIndicated; /* The Media State that report to HOST */
793 ENUM_OP_MODE_T eCurrentOPMode; /* Current Operation Mode - Infra/IBSS */
794 #if CFG_ENABLE_WIFI_DIRECT
795 ENUM_OP_MODE_T eIntendOPMode;
798 BOOLEAN fgIsNetActive; /* TRUE if this network has been activated */
800 UINT_8 ucNetTypeIndex; /* ENUM_NETWORK_TYPE_INDEX_T */
802 UINT_8 ucReasonOfDisconnect; /* Used by media state indication */
804 UINT_8 ucSSIDLen; /* Length of SSID */
806 #if CFG_ENABLE_WIFI_DIRECT
807 ENUM_HIDDEN_SSID_TYPE_T eHiddenSsidType; /* For Hidden SSID usage. */
810 UINT_8 aucSSID[ELEM_MAX_LEN_SSID]; /* SSID used in this BSS */
812 UINT_8 aucBSSID[MAC_ADDR_LEN]; /* The BSSID of the associated BSS */
814 UINT_8 aucOwnMacAddr[MAC_ADDR_LEN];/* Owned MAC Address used in this BSS */
816 P_STA_RECORD_T prStaRecOfAP; /* For Infra Mode, and valid only if
817 * eConnectionState == MEDIA_STATE_CONNECTED
819 LINK_T rStaRecOfClientList; /* For IBSS/AP Mode, all known STAs in current BSS */
821 UINT_16 u2CapInfo; /* Change Detection */
823 UINT_16 u2BeaconInterval; /* The Beacon Interval of this BSS */
826 UINT_16 u2ATIMWindow; /* For IBSS Mode */
828 UINT_16 u2AssocId; /* For Infra Mode, it is the Assoc ID assigned by AP.
832 UINT_8 ucDTIMPeriod; /* For Infra/AP Mode */
834 UINT_8 ucDTIMCount; /* For AP Mode, it is the DTIM value we should carried in
835 * the Beacon of next TBTT.
838 UINT_8 ucPhyTypeSet; /* Available PHY Type Set of this peer
839 * (This is deduced from received BSS_DESC_T)
842 UINT_8 ucNonHTBasicPhyType; /* The Basic PHY Type Index, used to setup Phy Capability */
844 UINT_8 ucConfigAdHocAPMode; /* The configuration of AdHoc/AP Mode. e.g. 11g or 11b */
846 UINT_8 ucBeaconTimeoutCount; /* For Infra/AP Mode, it is a threshold of Beacon Lost Count to
847 confirm connection was lost */
849 BOOLEAN fgHoldSameBssidForIBSS; /* For IBSS Mode, to keep use same BSSID to extend the life cycle of an IBSS */
851 BOOLEAN fgIsBeaconActivated; /* For AP/IBSS Mode, it is used to indicate that Beacon is sending */
853 P_MSDU_INFO_T prBeacon; /* For AP/IBSS Mode - Beacon Frame */
855 BOOLEAN fgIsIBSSMaster; /* For IBSS Mode - To indicate that we can reply ProbeResp Frame.
856 In current TBTT interval */
858 BOOLEAN fgIsShortPreambleAllowed; /* From Capability Info. of AssocResp Frame AND of Beacon/ProbeResp Frame */
859 BOOLEAN fgUseShortPreamble; /* Short Preamble is enabled in current BSS. */
860 BOOLEAN fgUseShortSlotTime; /* Short Slot Time is enabled in current BSS. */
862 UINT_16 u2OperationalRateSet; /* Operational Rate Set of current BSS */
863 UINT_16 u2BSSBasicRateSet; /* Basic Rate Set of current BSS */
866 UINT_8 ucAllSupportedRatesLen; /* Used for composing Beacon Frame in AdHoc or AP Mode */
867 UINT_8 aucAllSupportedRates[RATE_NUM];
869 UINT_8 ucAssocClientCnt; /* TODO(Kevin): Number of associated clients */
871 BOOLEAN fgIsProtection;
872 BOOLEAN fgIsQBSS; /* fgIsWmmBSS; */ /* For Infra/AP/IBSS Mode, it is used to indicate if we support WMM in
874 BOOLEAN fgIsNetAbsent; /* TRUE: BSS is absent, FALSE: BSS is present */
876 UINT_32 u4RsnSelectedGroupCipher;
877 UINT_32 u4RsnSelectedPairwiseCipher;
878 UINT_32 u4RsnSelectedAKMSuite;
879 UINT_16 u2RsnSelectedCapInfo;
881 /*------------------------------------------------------------------------*/
882 /* Power Management related information */
883 /*------------------------------------------------------------------------*/
884 PM_PROFILE_SETUP_INFO_T rPmProfSetupInfo;
887 /*------------------------------------------------------------------------*/
888 /* WMM/QoS related information */
889 /*------------------------------------------------------------------------*/
890 UINT_8 ucWmmParamSetCount; /* Used to detect the change of EDCA parameters. For AP mode, the value is used in WMM IE */
892 AC_QUE_PARMS_T arACQueParms[WMM_AC_INDEX_NUM];
894 UINT_8 aucCWminLog2ForBcast[WMM_AC_INDEX_NUM]; /* For AP mode, broadcast the CWminLog2 */
895 UINT_8 aucCWmaxLog2ForBcast[WMM_AC_INDEX_NUM]; /* For AP mode, broadcast the CWmaxLog2 */
896 AC_QUE_PARMS_T arACQueParmsForBcast[WMM_AC_INDEX_NUM]; /* For AP mode, broadcast the value */
898 /*------------------------------------------------------------------------*/
899 /* 802.11n HT operation IE when (prStaRec->ucPhyTypeSet & PHY_TYPE_BIT_HT)*/
900 /* is true. They have the same definition with fields of */
901 /* information element (CM) */
902 /*------------------------------------------------------------------------*/
904 UINT_8 ucPrimaryChannel;
909 /*------------------------------------------------------------------------*/
910 /* Required protection modes (CM) */
911 /*------------------------------------------------------------------------*/
912 BOOLEAN fgErpProtectMode;
913 ENUM_HT_PROTECT_MODE_T eHtProtectMode;
914 ENUM_GF_MODE_T eGfOperationMode;
915 ENUM_RIFS_MODE_T eRifsOperationMode;
917 BOOLEAN fgObssErpProtectMode; /* GO only */
918 ENUM_HT_PROTECT_MODE_T eObssHtProtectMode; /* GO only */
919 ENUM_GF_MODE_T eObssGfOperationMode; /* GO only */
920 BOOLEAN fgObssRifsOperationMode; /* GO only */
922 /*------------------------------------------------------------------------*/
923 /* OBSS to decide if 20/40M bandwidth is permitted. */
924 /* The first member indicates the following channel list length. */
925 /*------------------------------------------------------------------------*/
926 BOOLEAN fgAssoc40mBwAllowed;
927 BOOLEAN fg40mBwAllowed;
928 ENUM_CHNL_EXT_T eBssSCO; /* Real setting for HW
929 * 20/40M AP mode will always set 40M,
930 * but its OP IE can be changed.
932 UINT_8 auc2G_20mReqChnlList[CHNL_LIST_SZ_2G + 1];
933 UINT_8 auc2G_NonHtChnlList[CHNL_LIST_SZ_2G + 1];
934 UINT_8 auc2G_PriChnlList[CHNL_LIST_SZ_2G + 1];
935 UINT_8 auc2G_SecChnlList[CHNL_LIST_SZ_2G + 1];
937 UINT_8 auc5G_20mReqChnlList[CHNL_LIST_SZ_5G + 1];
938 UINT_8 auc5G_NonHtChnlList[CHNL_LIST_SZ_5G + 1];
939 UINT_8 auc5G_PriChnlList[CHNL_LIST_SZ_5G + 1];
940 UINT_8 auc5G_SecChnlList[CHNL_LIST_SZ_5G + 1];
942 TIMER_T rObssScanTimer;
943 UINT_16 u2ObssScanInterval; /* in unit of sec */
945 BOOLEAN fgObssActionForcedTo20M; /* GO only */
946 BOOLEAN fgObssBeaconForcedTo20M; /* GO only */
948 /*------------------------------------------------------------------------*/
949 /* HW Related Fields (Kevin) */
950 /*------------------------------------------------------------------------*/
951 UINT_8 ucHwDefaultFixedRateCode; /* The default rate code copied to MAC TX Desc */
952 UINT_16 u2HwLPWakeupGuardTimeUsec;
955 UINT_8 ucBssFreeQuota; /* The value is updated from FW */
959 struct _AIS_SPECIFIC_BSS_INFO_T {
960 UINT_8 ucRoamingAuthTypes; /* This value indicate the roaming type used in AIS_JOIN */
962 BOOLEAN fgIsIBSSActive;
964 /*! \brief Global flag to let arbiter stay at standby and not connect to any network */
965 BOOLEAN fgCounterMeasure;
966 UINT_8 ucWEPDefaultKeyID;
967 BOOLEAN fgTransmitKeyExist; /* Legacy wep Transmit key exist or not */
969 /* While Do CounterMeasure procedure, check the EAPoL Error report have send out */
970 BOOLEAN fgCheckEAPoLTxDone;
972 UINT_32 u4RsnaLastMICFailTime;
974 /* Stored the current bss wpa rsn cap filed, used for roaming policy */
976 TIMER_T rPreauthenticationTimer;
978 /* By the flow chart of 802.11i,
979 wait 60 sec before associating to same AP
980 or roaming to a new AP
981 or sending data in IBSS,
982 keep a timer for handle the 60 sec counterMeasure */
983 TIMER_T rRsnaBlockTrafficTimer;
984 TIMER_T rRsnaEAPoLReportTimeoutTimer;
986 /* For Keep the Tx/Rx Mic key for TKIP SW Calculate Mic */
987 /* This is only one for AIS/AP */
988 UINT_8 aucTxMicKey[8];
989 UINT_8 aucRxMicKey[8];
991 /* Buffer for WPA2 PMKID */
992 /* The PMKID cache lifetime is expire by media_disconnect_indication */
993 UINT_32 u4PmkidCandicateCount;
994 PMKID_CANDICATE_T arPmkidCandicate[CFG_MAX_PMKID_CACHE];
995 UINT_32 u4PmkidCacheCount;
996 PMKID_ENTRY_T arPmkidCache[CFG_MAX_PMKID_CACHE];
997 BOOLEAN fgIndicatePMKID;
998 #if CFG_SUPPORT_802_11W
999 BOOLEAN fgMgmtProtection;
1000 UINT_32 u4SaQueryStart;
1001 UINT_32 u4SaQueryCount;
1002 UINT_8 ucSaQueryTimedOut;
1003 PUINT_8 pucSaQueryTransId;
1004 TIMER_T rSaQueryTimer;
1005 BOOLEAN fgBipKeyInstalled;
1009 struct _BOW_SPECIFIC_BSS_INFO_T {
1010 UINT_16 u2Reserved; /* Reserved for Data Type Check */
1014 typedef struct _SLT_INFO_T {
1016 P_BSS_DESC_T prPseudoBssDesc;
1018 UINT_8 ucChannel2G4;
1021 UINT_32 u4BeaconReceiveCnt;
1022 /////////Deprecated/////////
1023 P_STA_RECORD_T prPseudoStaRec;
1024 } SLT_INFO_T, *P_SLT_INFO_T;
1028 /* Major member variables for WiFi FW operation.
1029 Variables within this region will be ready for access after WIFI function is enabled.
1031 typedef struct _WIFI_VAR_T {
1032 BOOLEAN fgIsRadioOff;
1034 BOOLEAN fgIsEnterD3ReqIssued;
1036 BOOLEAN fgDebugCmdResp;
1038 CONNECTION_SETTINGS_T rConnSettings;
1040 SCAN_INFO_T rScanInfo;
1042 #if CFG_SUPPORT_ROAMING
1043 ROAMING_INFO_T rRoamingInfo;
1044 #endif /* CFG_SUPPORT_ROAMING */
1046 AIS_FSM_INFO_T rAisFsmInfo;
1048 ENUM_PWR_STATE_T aePwrState[NETWORK_TYPE_INDEX_NUM];
1050 BSS_INFO_T arBssInfo[NETWORK_TYPE_INDEX_NUM];
1052 AIS_SPECIFIC_BSS_INFO_T rAisSpecificBssInfo;
1054 #if CFG_ENABLE_WIFI_DIRECT
1055 P_P2P_CONNECTION_SETTINGS_T prP2PConnSettings;
1057 P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo;
1059 P_P2P_FSM_INFO_T prP2pFsmInfo;
1060 #endif /* CFG_ENABLE_WIFI_DIRECT */
1062 #if CFG_ENABLE_BT_OVER_WIFI
1063 BOW_SPECIFIC_BSS_INFO_T rBowSpecificBssInfo;
1064 BOW_FSM_INFO_T rBowFsmInfo;
1065 #endif /* CFG_ENABLE_BT_OVER_WIFI */
1067 DEAUTH_INFO_T arDeauthInfo[MAX_DEAUTH_INFO_COUNT];
1069 /* Current Wi-Fi Settings and Flags */
1070 UINT_8 aucPermanentAddress[MAC_ADDR_LEN];
1071 UINT_8 aucMacAddress[MAC_ADDR_LEN];
1072 UINT_8 aucDeviceAddress[MAC_ADDR_LEN];
1073 UINT_8 aucInterfaceAddress[MAC_ADDR_LEN];
1075 UINT_8 ucAvailablePhyTypeSet;
1077 ENUM_PHY_TYPE_INDEX_T eNonHTBasicPhyType2G4; /* Basic Phy Type used by SCN according
1078 * to the set of Available PHY Types
1081 ENUM_PARAM_PREAMBLE_TYPE_T ePreambleType;
1082 ENUM_REGISTRY_FIXED_RATE_T eRateSetting;
1084 BOOLEAN fgIsShortSlotTimeOptionEnable;
1085 /* User desired setting, but will honor the capability of AP */
1087 BOOLEAN fgEnableJoinToHiddenSSID;
1088 BOOLEAN fgSupportWZCDisassociation;
1090 BOOLEAN fgSupportQoS;
1091 BOOLEAN fgSupportAmpduTx;
1092 BOOLEAN fgSupportAmpduRx;
1093 BOOLEAN fgSupportTspec;
1094 BOOLEAN fgSupportUAPSD;
1095 BOOLEAN fgSupportULPSMP;
1098 SLT_INFO_T rSltInfo;
1101 } WIFI_VAR_T, *P_WIFI_VAR_T;/* end of _WIFI_VAR_T */
1103 /* cnm_timer module */
1106 OS_SYSTIME rNextExpiredSysTime;
1107 KAL_WAKE_LOCK_T rWakeLock;
1108 BOOLEAN fgWakeLocked;
1109 } ROOT_TIMER, *P_ROOT_TIMER;
1112 /* FW/DRV/NVRAM version information */
1115 /* NVRAM or Registry */
1116 UINT_16 u2Part1CfgOwnVersion;
1117 UINT_16 u2Part1CfgPeerVersion;
1118 UINT_16 u2Part2CfgOwnVersion;
1119 UINT_16 u2Part2CfgPeerVersion;
1122 UINT_16 u2FwProductID;
1123 UINT_16 u2FwOwnVersion;
1124 UINT_16 u2FwPeerVersion;
1126 } WIFI_VER_INFO_T, *P_WIFI_VER_INFO_T;
1129 #if CFG_ENABLE_WIFI_DIRECT
1131 * p2p function pointer structure
1134 typedef struct _P2P_FUNCTION_LINKER {
1135 P2P_REMOVE prP2pRemove;
1136 // NIC_P2P_MEDIA_STATE_CHANGE prNicP2pMediaStateChange;
1137 // SCAN_UPDATE_P2P_DEVICE_DESC prScanUpdateP2pDeviceDesc;
1138 // P2P_FSM_RUN_EVENT_RX_PROBE_RESPONSE_FRAME prP2pFsmRunEventRxProbeResponseFrame;
1139 P2P_GENERATE_P2P_IE prP2pGenerateWSC_IEForBeacon;
1140 // P2P_CALCULATE_WSC_IE_LEN_FOR_PROBE_RSP prP2pCalculateWSC_IELenForProbeRsp;
1141 // P2P_GENERATE_WSC_IE_FOR_PROBE_RSP prP2pGenerateWSC_IEForProbeRsp;
1142 // SCAN_REMOVE_P2P_BSS_DESC prScanRemoveP2pBssDesc;
1143 // P2P_HANDLE_SEC_CHECK_RSP prP2pHandleSecCheckRsp;
1144 P2P_NET_REGISTER prP2pNetRegister;
1145 P2P_NET_UNREGISTER prP2pNetUnregister;
1146 P2P_CALCULATE_P2P_IE_LEN prP2pCalculateP2p_IELenForAssocReq; /* All IEs generated from supplicant. */
1147 P2P_GENERATE_P2P_IE prP2pGenerateP2p_IEForAssocReq; /* All IEs generated from supplicant. */
1148 } P2P_FUNCTION_LINKER, *P_P2P_FUNCTION_LINKER;
1154 * Major ADAPTER structure
1155 * Major data structure for driver operation
1160 UINT_16 u2NicOpChnlNum;
1162 BOOLEAN fgIsEnableWMM;
1163 BOOLEAN fgIsWmmAssoc; /* This flag is used to indicate that WMM is enable in current BSS */
1165 UINT_32 u4OsPacketFilter; // packet filter used by OS
1168 #if CFG_TCP_IP_CHKSUM_OFFLOAD
1169 UINT_32 u4CSUMFlags;
1170 #endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */
1173 ENUM_BAND_T aePreferBand[NETWORK_TYPE_INDEX_NUM];
1179 BOOLEAN fgIsRadioOff;
1181 BOOLEAN fgIsEnterD3ReqIssued;
1183 UINT_8 aucMacAddress[MAC_ADDR_LEN];
1185 ENUM_PHY_TYPE_INDEX_T eCurrentPhyType; /* Current selection basing on the set of Available PHY Types */
1187 #if CFG_COALESCING_BUFFER_SIZE || CFG_SDIO_RX_AGG
1188 UINT_32 u4CoalescingBufCachedSize;
1189 PUINT_8 pucCoalescingBufCached;
1190 #endif /* CFG_COALESCING_BUFFER_SIZE */
1192 /* Buffer for CMD_INFO_T, Mgt packet and mailbox message */
1193 BUF_INFO_T rMgtBufInfo;
1194 BUF_INFO_T rMsgBufInfo;
1195 PUINT_8 pucMgtBufCached;
1196 UINT_32 u4MgtBufCachedSize;
1197 UINT_8 aucMsgBuf[MSG_BUFFER_SIZE];
1199 UINT_32 u4MemAllocDynamicCount; /* Debug only */
1200 UINT_32 u4MemFreeDynamicCount; /* Debug only */
1203 STA_RECORD_T arStaRec[CFG_STA_REC_NUM];
1205 /* Element for TX PATH */
1208 CMD_INFO_T arHifCmdDesc[CFG_TX_MAX_CMD_PKT_NUM];
1210 /* Element for RX PATH */
1213 P_SDIO_CTRL_T prSDIOCtrl;
1215 #if (MT6620_E1_ASIC_HIFSYS_WORKAROUND == 1)
1216 /* Element for MT6620 E1 HIFSYS workaround */
1217 BOOLEAN fgIsClockGatingEnabled;
1220 /* Buffer for Authentication Event */
1221 /* <Todo> Move to glue layer and refine the kal function */
1222 /* Reference to rsnGeneratePmkidIndication function at rsn.c */
1223 UINT_8 aucIndicationEventBuffer[(CFG_MAX_PMKID_CACHE * 20) + 8 ];
1225 UINT_32 u4IntStatus;
1227 ENUM_ACPI_STATE_T rAcpiState;
1229 BOOLEAN fgIsIntEnable;
1230 BOOLEAN fgIsIntEnableWithLPOwnSet;
1233 BOOLEAN fgWiFiInSleepyState;
1235 UINT_32 u4PwrCtrlBlockCnt;
1237 QUE_T rPendingCmdQueue;
1239 P_GLUE_INFO_T prGlueInfo;
1244 #if 1//CFG_SUPPORT_WAPI
1251 /* WLAN Info for DRIVER_CORE OID query */
1252 WLAN_INFO_T rWlanInfo;
1254 #if CFG_ENABLE_WIFI_DIRECT
1255 BOOLEAN fgIsP2PRegistered;
1256 ENUM_NET_REG_STATE_T rP2PNetRegState;
1257 BOOLEAN fgIsWlanLaunched;
1258 P_P2P_INFO_T prP2pInfo;
1259 #if CFG_SUPPORT_P2P_RSSI_QUERY
1260 OS_SYSTIME rP2pLinkQualityUpdateTime;
1261 BOOLEAN fgIsP2pLinkQualityValid;
1262 EVENT_LINK_QUALITY rP2pLinkQuality;
1266 /* Online Scan Option */
1267 BOOLEAN fgEnOnlineScan;
1269 /* Online Scan Option */
1270 BOOLEAN fgDisBcnLostDetection;
1273 PARAM_MAC_ADDRESS rMyMacAddr;
1275 /* Wake-up Event for WOL */
1276 UINT_32 u4WakeupEventEnable;
1278 /* Event Buffering */
1279 EVENT_STATISTICS rStatStruct;
1280 OS_SYSTIME rStatUpdateTime;
1281 BOOLEAN fgIsStatValid;
1283 EVENT_LINK_QUALITY rLinkQuality;
1284 OS_SYSTIME rLinkQualityUpdateTime;
1285 BOOLEAN fgIsLinkQualityValid;
1286 OS_SYSTIME rLinkRateUpdateTime;
1287 BOOLEAN fgIsLinkRateValid;
1290 WIFI_VAR_T rWifiVar;
1292 /* MTK WLAN NIC driver IEEE 802.11 MIB */
1293 IEEE_802_11_MIB_T rMib;
1295 /* Mailboxs for inter-module communication */
1296 MBOX_T arMbox[MBOX_ID_TOTAL_NUM];
1298 /* Timers for OID Pending Handling */
1299 TIMER_T rOidTimeoutTimer;
1301 /* Root Timer for cnm_timer module */
1302 ROOT_TIMER rRootTimer;
1304 /* RLM maintenance */
1305 ENUM_CHNL_EXT_T eRfSco;
1306 ENUM_SYS_PROTECT_MODE_T eSysProtectMode;
1307 ENUM_GF_MODE_T eSysHtGfMode;
1308 ENUM_RIFS_MODE_T eSysTxRifsMode;
1309 ENUM_SYS_PCO_PHASE_T eSysPcoPhase;
1311 P_DOMAIN_INFO_ENTRY prDomainInfo;
1316 CNM_INFO_T rCnmInfo;
1318 UINT_32 u4PowerMode;
1320 UINT_32 u4CtiaPowerMode;
1321 BOOLEAN fgEnCtiaPowerMode;
1323 UINT_32 fgEnArpFilter;
1325 UINT_32 u4UapsdAcBmp;
1329 UINT_32 u4PsCurrentMeasureEn;
1331 /* Version Information */
1332 WIFI_VER_INFO_T rVerInfo;
1334 /* 5GHz support (from F/W) */
1335 BOOLEAN fgIsHw5GBandDisabled;
1336 BOOLEAN fgEnable5GBand;
1337 BOOLEAN fgIsEepromUsed;
1338 BOOLEAN fgIsEfuseValid;
1339 BOOLEAN fgIsEmbbededMacAddrValid;
1341 /* Packet Forwarding Tracking */
1342 INT_32 i4PendingFwdFrameCount;
1344 #if CFG_SUPPORT_RDD_TEST_MODE
1348 BOOL fgDisStaAgingTimeoutDetection;
1350 };/* end of _ADAPTER_T */
1352 /*******************************************************************************
1353 * P U B L I C D A T A
1354 ********************************************************************************
1357 /*******************************************************************************
1358 * P R I V A T E D A T A
1359 ********************************************************************************
1362 /*******************************************************************************
1364 ********************************************************************************
1366 /*----------------------------------------------------------------------------*/
1367 /* Macros for BSS_INFO_T - Flag of Net Active */
1368 /*----------------------------------------------------------------------------*/
1369 #define IS_NET_ACTIVE(_prAdapter, _NetTypeIndex) \
1370 (_prAdapter->rWifiVar.arBssInfo[(_NetTypeIndex)].fgIsNetActive)
1371 #define IS_BSS_ACTIVE(_prBssInfo) ((_prBssInfo)->fgIsNetActive)
1373 #define IS_AIS_ACTIVE(_prAdapter) IS_NET_ACTIVE(_prAdapter, NETWORK_TYPE_AIS_INDEX)
1374 #define IS_P2P_ACTIVE(_prAdapter) IS_NET_ACTIVE(_prAdapter, NETWORK_TYPE_P2P_INDEX)
1375 #define IS_BOW_ACTIVE(_prAdapter) IS_NET_ACTIVE(_prAdapter, NETWORK_TYPE_BOW_INDEX)
1377 #define SET_NET_ACTIVE(_prAdapter, _NetTypeIndex) \
1378 {_prAdapter->rWifiVar.arBssInfo[(_NetTypeIndex)].fgIsNetActive = TRUE;}
1380 #define UNSET_NET_ACTIVE(_prAdapter, _NetTypeIndex) \
1381 {_prAdapter->rWifiVar.arBssInfo[(_NetTypeIndex)].fgIsNetActive = FALSE;}
1383 #define BSS_INFO_INIT(_prAdapter, _NetTypeIndex) \
1384 { UINT_8 _aucZeroMacAddr[] = NULL_MAC_ADDR; \
1385 P_BSS_INFO_T _prBssInfo = &(_prAdapter->rWifiVar.arBssInfo[(_NetTypeIndex)]); \
1387 _prBssInfo->eConnectionState = PARAM_MEDIA_STATE_DISCONNECTED; \
1388 _prBssInfo->eConnectionStateIndicated = PARAM_MEDIA_STATE_DISCONNECTED; \
1389 _prBssInfo->eCurrentOPMode = OP_MODE_INFRASTRUCTURE; \
1390 _prBssInfo->fgIsNetActive = FALSE; \
1391 _prBssInfo->ucNetTypeIndex = (_NetTypeIndex); \
1392 _prBssInfo->ucReasonOfDisconnect = DISCONNECT_REASON_CODE_RESERVED; \
1393 COPY_MAC_ADDR(_prBssInfo->aucBSSID, _aucZeroMacAddr); \
1394 LINK_INITIALIZE(&_prBssInfo->rStaRecOfClientList); \
1395 _prBssInfo->fgIsBeaconActivated = FALSE; \
1396 _prBssInfo->ucHwDefaultFixedRateCode = RATE_CCK_1M_LONG; \
1397 _prBssInfo->fgIsNetAbsent = FALSE; \
1400 #if CFG_ENABLE_BT_OVER_WIFI
1401 #define BOW_BSS_INFO_INIT(_prAdapter, _NetTypeIndex) \
1403 P_BSS_INFO_T _prBssInfo = &(_prAdapter->rWifiVar.arBssInfo[(_NetTypeIndex)]); \
1405 _prBssInfo->eConnectionState = PARAM_MEDIA_STATE_DISCONNECTED; \
1406 _prBssInfo->eConnectionStateIndicated = PARAM_MEDIA_STATE_DISCONNECTED; \
1407 _prBssInfo->eCurrentOPMode = OP_MODE_BOW; \
1408 _prBssInfo->ucNetTypeIndex = (_NetTypeIndex); \
1409 _prBssInfo->ucReasonOfDisconnect = DISCONNECT_REASON_CODE_RESERVED; \
1410 LINK_INITIALIZE(&_prBssInfo->rStaRecOfClientList); \
1411 _prBssInfo->fgIsBeaconActivated = TRUE; \
1412 _prBssInfo->ucHwDefaultFixedRateCode = RATE_CCK_1M_LONG; \
1413 _prBssInfo->fgIsNetAbsent = FALSE; \
1417 /*----------------------------------------------------------------------------*/
1418 /* Macros for Power State */
1419 /*----------------------------------------------------------------------------*/
1420 #define SET_NET_PWR_STATE_IDLE(_prAdapter, _NetTypeIndex) \
1421 {_prAdapter->rWifiVar.aePwrState[(_NetTypeIndex)] = PWR_STATE_IDLE;}
1423 #define SET_NET_PWR_STATE_ACTIVE(_prAdapter, _NetTypeIndex) \
1424 {_prAdapter->rWifiVar.aePwrState[(_NetTypeIndex)] = PWR_STATE_ACTIVE;}
1426 #define SET_NET_PWR_STATE_PS(_prAdapter, _NetTypeIndex) \
1427 {_prAdapter->rWifiVar.aePwrState[(_NetTypeIndex)] = PWR_STATE_PS;}
1429 #define IS_NET_PWR_STATE_ACTIVE(_prAdapter, _NetTypeIndex) \
1430 (_prAdapter->rWifiVar.aePwrState[(_NetTypeIndex)] == PWR_STATE_ACTIVE)
1432 #define IS_NET_PWR_STATE_IDLE(_prAdapter, _NetTypeIndex) \
1433 (_prAdapter->rWifiVar.aePwrState[(_NetTypeIndex)] == PWR_STATE_IDLE)
1435 #define IS_SCN_PWR_STATE_ACTIVE(_prAdapter) \
1436 (_prAdapter->rWifiVar.rScanInfo.eScanPwrState == SCAN_PWR_STATE_ACTIVE)
1438 #define IS_SCN_PWR_STATE_IDLE(_prAdapter) \
1439 (_prAdapter->rWifiVar.rScanInfo.eScanPwrState == SCAN_PWR_STATE_IDLE)
1441 /*******************************************************************************
1442 * F U N C T I O N D E C L A R A T I O N S
1443 ********************************************************************************
1447 /*******************************************************************************
1449 ********************************************************************************
1452 #endif /* _ADAPTER_H */