add MTK-combo-module,continue with commit 17f39ed917874e77e80411f33faba1b7ee8138c8
[firefly-linux-kernel-4.4.55.git] / drivers / mtk_wcn_combo / drv_wlan / wlan / include / nic / adapter.h
1 /*
2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_2/include/nic/adapter.h#6 $
3 */
4
5 /*! \file   adapter.h
6     \brief  Definition of internal data structure for driver manipulation.
7
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.
10 */
11
12 /*******************************************************************************
13 * Copyright (c) 2007 MediaTek Inc.
14 *
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
18 * MediaTek Inc.
19 ********************************************************************************
20 */
21
22 /*******************************************************************************
23 * LEGAL DISCLAIMER
24 *
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.
38 *
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.
44 *
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
50 * (ICC).
51 ********************************************************************************
52 */
53
54 /*
55 ** $Log: adapter.h $
56  *
57  * 02 22 2012 yuche.tsai
58  * [ALPS00240483] [Wifi P2P]Run Sigma tool of A69. Always run fail on 5.1.2. No get  correct connection from Realtek.
59  * Fix assoc response without P2P IE issue for Sigma test.
60  *
61  * 02 14 2012 yuche.tsai
62  * [ALPS00118350] [ALPS.ICS][WiFi Direct] Dirver update for wifi direct connection
63  * Replace Beacon/Probe Response IE by driver generating instead of from supplicant.
64  *
65  * 01 28 2012 yuche.tsai
66  * NULL
67  * Update for Beacon composing code but not active yet.
68  *
69  * 01 20 2012 chinglan.wang
70  * NULL
71  * Fix the WPA-PSK TKIP and WPA2-PSK AES security mode bug.
72  *
73  * 01 16 2012 yuche.tsai
74  * NULL
75  * Update Driver for wifi driect gc join IE update issue.
76  *
77  * 01 16 2012 cp.wu
78  * [MT6620 Wi-Fi][Driver] API and behavior modification for preferred band configuration with corresponding network configuration 
79  * add wlanSetPreferBandByNetwork() for glue layer to invoke for setting preferred band configuration corresponding to network type.
80  *
81  * 01 13 2012 yuche.tsai
82  * NULL
83  * WiFi Hot Spot Tethering for ICS ALPHA testing version.
84  *
85  * 12 13 2011 cm.chang
86  * [WCXRP00001136] [All Wi-Fi][Driver] Add wake lock for pending timer
87  * Add wake lock if timer timeout value is smaller than 5 seconds
88  *
89  * 12 02 2011 yuche.tsai
90  * NULL
91  * Resolve class 3 error issue under AP mode.
92  * 
93  * data frame may TX before Assoc Response TX.
94  *
95  * 11 19 2011 yuche.tsai
96  * NULL
97  * Add P2P RSSI Link Quality Query Support. (Default Off)
98  *
99  * 11 11 2011 yuche.tsai
100  * NULL
101  * Fix work thread cancel issue.
102  *
103  * 10 19 2011 yuche.tsai
104  * [WCXRP00001045] [WiFi Direct][Driver] Check 2.1 branch.
105  * Branch 2.1
106  * Davinci Maintrunk Label: MT6620_WIFI_DRIVER_FW_TRUNK_MT6620E5_111019_0926.
107  *
108  * 06 23 2011 cp.wu
109  * [WCXRP00000812] [MT6620 Wi-Fi][Driver] not show NVRAM when there is no valid MAC address in NVRAM content
110  * check with firmware for valid MAC address.
111  *
112  * 04 18 2011 terry.wu
113  * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED
114  * Remove flag CFG_WIFI_DIRECT_MOVED.
115  *
116  * 04 12 2011 cm.chang
117  * [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency
118  * .
119  *
120  * 04 10 2011 yuche.tsai
121  * [WCXRP00000624] [Volunteer Patch][MT6620][Driver] Add device discoverability support for GO.
122  * Add device discoverability support. (Phase I)
123  *
124  * 04 08 2011 george.huang
125  * [WCXRP00000621] [MT6620 Wi-Fi][Driver] Support P2P supplicant to set power mode
126  * separate settings of P2P and AIS
127  *
128  * 04 07 2011 eddie.chen
129  * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma
130  * Fix for sigma.
131  *
132  * 03 19 2011 yuche.tsai
133  * [WCXRP00000584] [Volunteer Patch][MT6620][Driver] Add beacon timeout support for WiFi Direct.
134  * Add beacon timeout support for WiFi Direct Netwrok.
135  *
136  * 03 19 2011 yuche.tsai
137  * [WCXRP00000581] [Volunteer Patch][MT6620][Driver] P2P IE in Assoc Req Issue
138  * Append P2P IE in assoc request if P2P is enabled.
139  *
140  * 03 18 2011 cp.wu
141  * [WCXRP00000577] [MT6620 Wi-Fi][Driver][FW] Create V2.0 branch for firmware and driver
142  * create V2.0 driver release based on label "MT6620_WIFI_DRIVER_V2_0_110318_1600" from main trunk
143  *
144  * 03 17 2011 cp.wu
145  * [WCXRP00000562] [MT6620 Wi-Fi][Driver] I/O buffer pre-allocation to avoid physically continuous memory shortage after system running for a long period
146  * use pre-allocated buffer for storing enhanced interrupt response as well
147  *
148  * 03 15 2011 cp.wu
149  * [WCXRP00000559] [MT6620 Wi-Fi][Driver] Combine TX/RX DMA buffers into a single one to reduce physically continuous memory consumption
150  * 1. deprecate CFG_HANDLE_IST_IN_SDIO_CALLBACK
151  * 2. Use common coalescing buffer for both TX/RX directions
152  *
153  *
154  * 03 10 2011 yuche.tsai
155  * [WCXRP00000533] [Volunteer Patch][MT6620][Driver] Provide a P2P function API for Legacy WiFi to query AP mode.
156  * Provide an API for Legacy WiFi to query the operation mode..
157  *
158  * 03 05 2011 wh.su
159  * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code
160  * add the code to get the check rsponse and indicate to app.
161  *
162  * 03 02 2011 wh.su
163  * [WCXRP00000448] [MT6620 Wi-Fi][Driver] Fixed WSC IE not send out at probe request
164  * Add code to send beacon and probe response WSC IE at Auto GO.
165  *
166  * 03 02 2011 cp.wu
167  * [WCXRP00000503] [MT6620 Wi-Fi][Driver] Take RCPI brought by association response as initial RSSI right after connection is built.
168  * use RCPI brought by ASSOC-RESP after connection is built as initial RCPI to avoid using a uninitialized MAC-RX RCPI.
169  *
170  * 02 21 2011 terry.wu
171  * [WCXRP00000476] [MT6620 Wi-Fi][Driver] Clean P2P scan list while removing P2P
172  * Clean P2P scan list while removing P2P.
173  *
174  * 02 17 2011 eddie.chen
175  * [WCXRP00000458] [MT6620 Wi-Fi][Driver] BOW Concurrent - ProbeResp was exist in other channel
176  * 1) Chnage GetFrameAction decision when BSS is absent.
177  * 2) Check channel and resource in processing ProbeRequest
178  *
179  * 02 16 2011 cm.chang
180  * [WCXRP00000447] [MT6620 Wi-Fi][FW] Support new NVRAM update mechanism
181  * .
182  *
183  * 02 10 2011 yuche.tsai
184  * [WCXRP00000431] [Volunteer Patch][MT6620][Driver] Add MLME support for deauthentication under AP(Hot-Spot) mode.
185  * Add RX deauthentication & disassociation process under Hot-Spot mode.
186  *
187  * 02 09 2011 wh.su
188  * [WCXRP00000433] [MT6620 Wi-Fi][Driver] Remove WAPI structure define for avoid P2P module with structure miss-align pointer issue
189  * always pre-allio WAPI related structure for align p2p module.
190  *
191  * 02 08 2011 yuche.tsai
192  * [WCXRP00000419] [Volunteer Patch][MT6620/MT5931][Driver] Provide function of disconnect to target station for AAA module.
193  * Provide disconnect function for AAA module.
194  *
195  * 02 01 2011 cm.chang
196  * [WCXRP00000415] [MT6620 Wi-Fi][Driver] Check if any memory leakage happens when uninitializing in DGB mode
197  * .
198  *
199  * 01 27 2011 tsaiyuan.hsu
200  * [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support
201  * add roaming fsm
202  * 1. not support 11r, only use strength of signal to determine roaming.
203  * 2. not enable CFG_SUPPORT_ROAMING until completion of full test.
204  * 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw
205  * 4. assume that change of link quality in smooth way.
206  *
207  * 01 27 2011 george.huang
208  * [WCXRP00000400] [MT6620 Wi-Fi] support CTIA power mode setting
209  * Support CTIA power mode setting.
210  *
211  * 01 27 2011 george.huang
212  * [WCXRP00000355] [MT6620 Wi-Fi] Set WMM-PS related setting with qualifying AP capability
213  * Support current measure mode, assigned by registry (XP only).
214  *
215  * 01 24 2011 cp.wu
216  * [WCXRP00000382] [MT6620 Wi-Fi][Driver] Track forwarding packet number with notifying tx thread for serving
217  * 1. add an extra counter for tracking pending forward frames.
218  * 2. notify TX service thread as well when there is pending forward frame
219  * 3. correct build errors leaded by introduction of Wi-Fi direct separation module
220  *
221  * 01 12 2011 cm.chang
222  * [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting
223  * User-defined bandwidth is for 2.4G and 5G individually
224  *
225  * 12 29 2010 eddie.chen
226  * [WCXRP00000322] Add WMM IE in beacon,
227
228 Add per station flow control when STA is in PS
229
230
231  * Add WMM parameter for broadcast.
232  *
233  * 12 29 2010 eddie.chen
234  * [WCXRP00000322] Add WMM IE in beacon,
235
236 Add per station flow control when STA is in PS
237
238
239  * Add CWMin CWMax for AP to generate IE.
240  *
241  * 12 29 2010 eddie.chen
242  * [WCXRP00000322] Add WMM IE in beacon,
243 Add per station flow control when STA is in PS
244
245  * 1) PS flow control event
246  *
247  * 2) WMM IE in beacon, assoc resp, probe resp
248  *
249  * 12 28 2010 cp.wu
250  * [WCXRP00000269] [MT6620 Wi-Fi][Driver][Firmware] Prepare for v1.1 branch release
251  * report EEPROM used flag via NIC_CAPABILITY
252  *
253  * 12 28 2010 cp.wu
254  * [WCXRP00000269] [MT6620 Wi-Fi][Driver][Firmware] Prepare for v1.1 branch release
255  * integrate with 'EEPROM used' flag for reporting correct capability to Engineer Mode/META and other tools
256  *
257  * 12 07 2010 cm.chang
258  * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant
259  * 1. Country code is from NVRAM or supplicant
260  * 2. Change band definition in CMD/EVENT.
261  *
262  * 11 01 2010 cp.wu
263  * [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
264  * 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead
265  * 2) Remove CNM CH-RECOVER event handling
266  * 3) cfg read/write API renamed with kal prefix for unified naming rules.
267  *
268  * 10 27 2010 george.huang
269  * [WCXRP00000127] [MT6620 Wi-Fi][Driver] Add a registry to disable Beacon Timeout function for SQA test by using E1 EVB
270  * Support registry option for disable beacon lost detection.
271  *
272  * 10 26 2010 cp.wu
273  * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000137] [MT6620 Wi-Fi] [FW] Support NIC capability query command
274  * 1) update NVRAM content template to ver 1.02
275  * 2) add compile option for querying NIC capability (default: off)
276  * 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting
277  * 4) correct auto-rate compiler error under linux (treat warning as error)
278  * 5) simplify usage of NVRAM and REG_INFO_T
279  * 6) add version checking between driver and firmware
280  *
281  * 10 08 2010 cp.wu
282  * [WCXRP00000084] [MT6620 Wi-Fi][Driver][FW] Add fixed rate support for distance test
283  * adding fixed rate support for distance test. (from registry setting)
284  *
285  * 10 06 2010 cp.wu
286  * [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning
287  * code reorganization to improve isolation between GLUE and CORE layers.
288  *
289  * 10 05 2010 cp.wu
290  * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
291  * 1) add NVRAM access API
292  * 2) fake scanning result when NVRAM doesn't exist and/or version mismatch. (off by compiler option)
293  * 3) add OID implementation for NVRAM read/write service
294  *
295  * 09 27 2010 chinghwa.yu
296  * [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000065] Update BoW design and settings
297  * Update BCM/BoW design and settings.
298  *
299  * 09 24 2010 cp.wu
300  * [WCXRP00000057] [MT6620 Wi-Fi][Driver] Modify online scan to a run-time switchable feature
301  * Modify online scan as a run-time adjustable option (for Windows, in registry)
302  *
303  * 09 23 2010 cp.wu
304  * [WCXRP00000051] [MT6620 Wi-Fi][Driver] WHQL test fail in MAC address changed item
305  * use firmware reported mac address right after wlanAdapterStart() as permanent address
306  *
307  * 09 08 2010 cp.wu
308  * NULL
309  * use static memory pool for storing IEs of scanning result.
310  *
311  * 09 07 2010 yuche.tsai
312  * NULL
313  * Add a common IE buffer in P2P INFO structure.
314  *
315  * 09 03 2010 kevin.huang
316  * NULL
317  * Refine #include sequence and solve recursive/nested #include issue
318  *
319  * 09 01 2010 cp.wu
320  * NULL
321  * restore configuration as before.
322  *
323  * 09 01 2010 wh.su
324  * NULL
325  * adding the wapi support for integration test.
326  *
327  * 08 31 2010 kevin.huang
328  * NULL
329  * Use LINK LIST operation to process SCAN result
330  *
331  * 08 29 2010 yuche.tsai
332  * NULL
333  * Finish SLT TX/RX & Rate Changing Support.
334  *
335  * 08 25 2010 george.huang
336  * NULL
337  * update OID/ registry control path for PM related settings
338  *
339  * 08 24 2010 cm.chang
340  * NULL
341  * Support RLM initail channel of Ad-hoc, P2P and BOW
342  *
343  * 08 23 2010 chinghwa.yu
344  * NULL
345  * Update for BOW.
346  *
347  * 08 20 2010 cm.chang
348  * NULL
349  * Migrate RLM code to host from FW
350  *
351  * 08 16 2010 yuche.tsai
352  * NULL
353  * Add an intend mode for BSS info.
354  * It is used to let P2P BSS Info to know which OP Mode it is going to become.
355  *
356  * 08 04 2010 george.huang
357  * NULL
358  * handle change PS mode OID/ CMD
359  *
360  * 08 02 2010 cp.wu
361  * NULL
362  * comment out deprecated members in BSS_INFO, which are only used by firmware rather than driver.
363  *
364  * 07 29 2010 cp.wu
365  * NULL
366  * eliminate u4FreqInKHz usage, combined into rConnections.ucAdHoc*
367  *
368  * 07 28 2010 cp.wu
369  * NULL
370  * 1) eliminate redundant variable eOPMode in prAdapter->rWlanInfo
371  * 2) change nicMediaStateChange() API prototype
372  *
373  * 07 24 2010 wh.su
374  *
375  * .support the Wi-Fi RSN
376  *
377  * 07 21 2010 yuche.tsai
378  *
379  * Add for P2P Scan Result Parsing & Saving.
380  *
381  * 07 19 2010 wh.su
382  *
383  * update for security supporting.
384  *
385  * 07 19 2010 cm.chang
386  *
387  * Set RLM parameters and enable CNM channel manager
388  *
389  * 07 19 2010 yuche.tsai
390  *
391  * Remove BSS info which is redonedent in Wifi Var..
392  *
393  * 07 16 2010 yarco.yang
394  *
395  * 1. Support BSS Absence/Presence Event
396  * 2. Support STA change PS mode Event
397  * 3. Support BMC forwarding for AP mode.
398  *
399  * 07 14 2010 yarco.yang
400  *
401  * 1. Remove CFG_MQM_MIGRATION
402  * 2. Add CMD_UPDATE_WMM_PARMS command
403  *
404  * 07 09 2010 george.huang
405  *
406  * [WPD00001556] Migrate PM variables from FW to driver: for composing QoS Info
407  *
408  * 07 08 2010 cp.wu
409  *
410  * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
411  *
412  * 07 08 2010 cm.chang
413  * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
414  * Check draft RLM code for HT cap
415  *
416  * 06 29 2010 yarco.yang
417  * [WPD00003837][MT6620]Data Path Refine
418  * replace g_rQM with Adpater->rQM
419  *
420  * 06 28 2010 cm.chang
421  * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
422  * 1st draft code for RLM module
423  *
424  * 06 21 2010 wh.su
425  * [WPD00003840][MT6620 5931] Security migration
426  * remove duplicate variable for migration.
427  *
428  * 06 21 2010 wh.su
429  * [WPD00003840][MT6620 5931] Security migration
430  * modify some code for concurrent network.
431  *
432  * 06 21 2010 yuche.tsai
433  * [WPD00003839][MT6620 5931][P2P] Feature migration
434  * Add P2P FSM Info in adapter.
435  *
436  * 06 21 2010 yarco.yang
437  * [WPD00003837][MT6620]Data Path Refine
438  * Support CFG_MQM_MIGRATION flag
439  *
440  * 06 18 2010 cm.chang
441  * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
442  * Provide cnmMgtPktAlloc() and alloc/free function of msg/buf
443  *
444  * 06 18 2010 wh.su
445  * [WPD00003840][MT6620 5931] Security migration
446  * migration the security related function from firmware.
447  *
448  * 06 17 2010 yuche.tsai
449  * [WPD00003839][MT6620 5931][P2P] Feature migration
450  * Add P2P related field, additional include p2p_fsm.h if p2p is enabled.
451  *
452  * 06 15 2010 cp.wu
453  * [WPD00003833][MT6620 and MT5931] Driver migration
454  * add scan.c.
455  *
456  * 06 14 2010 cp.wu
457  * [WPD00003833][MT6620 and MT5931] Driver migration
458  * add management dispatching function table.
459  *
460  * 06 11 2010 cp.wu
461  * [WPD00003833][MT6620 and MT5931] Driver migration
462  * auth.c is migrated.
463  *
464  * 06 11 2010 cp.wu
465  * [WPD00003833][MT6620 and MT5931] Driver migration
466  * 1) migrate assoc.c.
467  * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
468  * 3) add configuration options for CNM_MEM and RSN modules
469  * 4) add data path for management frames
470  * 5) eliminate rPacketInfo of MSDU_INFO_T
471  *
472  * 06 10 2010 cp.wu
473  * [WPD00003833][MT6620 and MT5931] Driver migration
474  * add buildable & linkable ais_fsm.c
475  *
476  * related reference are still waiting to be resolved
477  *
478  * 06 09 2010 cp.wu
479  * [WPD00003833][MT6620 and MT5931] Driver migration
480  * add definitions for module migration.
481  *
482  * 06 08 2010 cp.wu
483  * [WPD00003833][MT6620 and MT5931] Driver migration
484  * cnm_timer has been migrated.
485  *
486  * 06 08 2010 cp.wu
487  * [WPD00003833][MT6620 and MT5931] Driver migration
488  * hem_mbox is migrated.
489  *
490  * 06 07 2010 cp.wu
491  * [WPD00003833][MT6620 and MT5931] Driver migration
492  * merge wifi_var.h, precomp.h, cnm_timer.h (data type only)
493  *
494  * 06 06 2010 kevin.huang
495  * [WPD00003832][MT6620 5931] Create driver base
496  * [MT6620 5931] Create driver base
497  *
498  * 05 22 2010 cp.wu
499  * [WPD00001943]Create WiFi test driver framework on WinXP
500  * change OID behavior to meet WHQL requirement.
501  *
502  * 05 20 2010 cp.wu
503  * [WPD00001943]Create WiFi test driver framework on WinXP
504  * 1) integrate OID_GEN_NETWORK_LAYER_ADDRESSES with CMD_ID_SET_IP_ADDRESS
505  * 2) buffer statistics data for 2 seconds
506  * 3) use default value for adhoc parameters instead of 0
507  *
508  * 05 19 2010 cp.wu
509  * [WPD00001943]Create WiFi test driver framework on WinXP
510  * 1) do not take timeout mechanism for power mode oids
511  * 2) retrieve network type from connection status
512  * 3) after disassciation, set radio state to off
513  * 4) TCP option over IPv6 is supported
514  *
515  * 05 18 2010 cp.wu
516  * [WPD00001943]Create WiFi test driver framework on WinXP
517  * implement Wakeup-on-LAN except firmware integration part
518  *
519  * 04 27 2010 cp.wu
520  * [WPD00001943]Create WiFi test driver framework on WinXP
521  * reserve field of privacy filter and RTS threshold setting.
522  *
523  * 04 13 2010 cp.wu
524  * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
525  * add framework for BT-over-Wi-Fi support.
526  *  *  *  *  *  * 1) prPendingCmdInfo is replaced by queue for multiple handler capability
527  *  *  *  *  *  * 2) command sequence number is now increased atomically
528  *  *  *  *  *  * 3) private data could be hold and taken use for other purpose
529  *
530  * 04 07 2010 cp.wu
531  * [WPD00001943]Create WiFi test driver framework on WinXP
532  * rWlanInfo should be placed at adapter rather than glue due to most operations
533  *  *  * are done in adapter layer.
534  *
535  * 04 06 2010 cp.wu
536  * [WPD00001943]Create WiFi test driver framework on WinXP
537  * code refine: fgTestMode should be at adapter rather than glue due to the device/fw is also involved
538  *
539  * 03 31 2010 wh.su
540  * [WPD00003816][MT6620 Wi-Fi] Adding the security support
541  * modify the wapi related code for new driver's design.
542  *
543  * 03 19 2010 cp.wu
544  * [WPD00001943]Create WiFi test driver framework on WinXP
545  * 1) add ACPI D0/D3 state switching support
546  *  *  * 2) use more formal way to handle interrupt when the status is retrieved from enhanced RX response
547  *
548  * 03 03 2010 cp.wu
549  * [WPD00001943]Create WiFi test driver framework on WinXP
550  * implement OID_802_3_MULTICAST_LIST oid handling
551  *
552  * 03 02 2010 cp.wu
553  * [WPD00001943]Create WiFi test driver framework on WinXP
554  * 1) the use of prPendingOid revised, all accessing are now protected by spin lock
555  *  *  * 2) ensure wlanReleasePendingOid will clear all command queues
556  *
557  * 02 09 2010 cp.wu
558  * [WPD00001943]Create WiFi test driver framework on WinXP
559  * move ucCmdSeqNum as instance variable
560  *
561  * 01 27 2010 wh.su
562  * [WPD00003816][MT6620 Wi-Fi] Adding the security support
563  * .
564  *
565  * 01 27 2010 cp.wu
566  * [WPD00001943]Create WiFi test driver framework on WinXP
567  * 1. eliminate improper variable in rHifInfo
568  *  *  * 2. block TX/ordinary OID when RF test mode is engaged
569  *  *  * 3. wait until firmware finish operation when entering into and leaving from RF test mode
570  *  *  * 4. correct some HAL implementation
571  *
572  * 12 30 2009 cp.wu
573  * [WPD00001943]Create WiFi test driver framework on WinXP
574  * 1) According to CMD/EVENT documentation v0.8,
575  *  *  * OID_CUSTOM_TEST_RX_STATUS & OID_CUSTOM_TEST_TX_STATUS is no longer used,
576  *  *  * and result is retrieved by get ATInfo instead
577  *  *  * 2) add 4 counter for recording aggregation statistics
578  *
579  * 12 28 2009 cp.wu
580  * [WPD00001943]Create WiFi test driver framework on WinXP
581  * eliminate redundant variables for connection_state
582 **  \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-12-16 18:02:03 GMT mtk02752
583 **  add external reference to avoid compilation error
584 **  \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-12-10 16:40:26 GMT mtk02752
585 **  eliminate unused member
586 **  \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-12-08 17:36:08 GMT mtk02752
587 **  add RF test data members into P_ADAPTER_T
588 **  \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-10-13 21:58:45 GMT mtk01084
589 **  update for new HW architecture design
590 **  \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-04-28 10:29:57 GMT mtk01461
591 **  Add read WTSR for SDIO_STATUS_ENHANCE mode
592 **  \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-04-21 09:37:35 GMT mtk01461
593 **  Add prPendingCmdInfoOfOID for temporarily saving the CMD_INFO_T before en-queue to rCmdQueue
594 **  \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-04-17 19:57:51 GMT mtk01461
595 **  Add MGMT Buffer Info
596 **  \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-01 10:34:12 GMT mtk01461
597 **  Add SW pre test CFG_HIF_LOOPBACK_PRETEST
598 **  \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-03-23 21:41:48 GMT mtk01461
599 **  Add fgIsWmmAssoc flag for TC assignment
600 **  \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-19 18:32:51 GMT mtk01084
601 **  update for basic power management functions
602 **  \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-18 20:51:52 GMT mtk01426
603 **  Add #if CFG_SDIO_RX_ENHANCE related data structure
604 **  \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:17 GMT mtk01426
605 **  Init for develop
606 **
607 */
608
609 #ifndef _ADAPTER_H
610 #define _ADAPTER_H
611
612 /*******************************************************************************
613 *                         C O M P I L E R   F L A G S
614 ********************************************************************************
615 */
616
617 /*******************************************************************************
618 *                    E X T E R N A L   R E F E R E N C E S
619 ********************************************************************************
620 */
621
622 /*******************************************************************************
623 *                              C O N S T A N T S
624 ********************************************************************************
625 */
626
627 /*******************************************************************************
628 *                             D A T A   T Y P E S
629 ********************************************************************************
630 */
631 typedef struct _ENHANCE_MODE_DATA_STRUCT_T SDIO_CTRL_T, *P_SDIO_CTRL_T;
632
633 typedef struct _WLAN_INFO_T {
634     PARAM_BSSID_EX_T                rCurrBssId;
635
636     // Scan Result
637     PARAM_BSSID_EX_T                arScanResult[CFG_MAX_NUM_BSS_LIST];
638     PUINT_8                         apucScanResultIEs[CFG_MAX_NUM_BSS_LIST];
639     UINT_32                         u4ScanResultNum;
640
641     // IE pool for Scanning Result
642     UINT_8                          aucScanIEBuf[CFG_MAX_COMMON_IE_BUF_LEN];
643     UINT_32                         u4ScanIEBufferUsage;
644
645     OS_SYSTIME                      u4SysTime;
646
647     // connection parameter (for Ad-Hoc)
648     UINT_16                     u2BeaconPeriod;
649     UINT_16                     u2AtimWindow;
650
651     PARAM_RATES                 eDesiredRates;
652     CMD_LINK_ATTRIB             eLinkAttr;
653 //    CMD_PS_PROFILE_T         ePowerSaveMode;
654     CMD_PS_PROFILE_T         arPowerSaveMode[NETWORK_TYPE_INDEX_NUM];
655
656     // trigger parameter
657     ENUM_RSSI_TRIGGER_TYPE      eRssiTriggerType;
658     PARAM_RSSI                  rRssiTriggerValue;
659
660     // Privacy Filter
661     ENUM_PARAM_PRIVACY_FILTER_T ePrivacyFilter;
662
663     // RTS Threshold
664     PARAM_RTS_THRESHOLD         eRtsThreshold;
665
666     // Network Type
667     UINT_8                      ucNetworkType;
668
669     // Network Type In Use
670     UINT_8                      ucNetworkTypeInUse;
671
672 } WLAN_INFO_T, *P_WLAN_INFO_T;
673
674 /* Session for CONNECTION SETTINGS */
675 typedef struct _CONNECTION_SETTINGS_T {
676
677     UINT_8                          aucMacAddress[MAC_ADDR_LEN];
678
679     UINT_8                          ucDelayTimeOfDisconnectEvent;
680
681     BOOLEAN                         fgIsConnByBssidIssued;
682     UINT_8                          aucBSSID[MAC_ADDR_LEN];
683
684     BOOLEAN                         fgIsConnReqIssued;
685     UINT_8                          ucSSIDLen;
686     UINT_8                          aucSSID[ELEM_MAX_LEN_SSID];
687
688     ENUM_PARAM_OP_MODE_T            eOPMode;
689
690     ENUM_PARAM_CONNECTION_POLICY_T  eConnectionPolicy;
691
692     ENUM_PARAM_AD_HOC_MODE_T        eAdHocMode;
693
694     ENUM_PARAM_AUTH_MODE_T          eAuthMode;
695
696     ENUM_PARAM_ENCRYPTION_STATUS_T  eEncStatus;
697
698     BOOLEAN                         fgIsScanReqIssued;
699
700
701     /* MIB attributes */
702     UINT_16                         u2BeaconPeriod;
703
704     UINT_16                         u2RTSThreshold; /* User desired setting */
705
706     UINT_16                         u2DesiredNonHTRateSet; /* User desired setting */
707
708     UINT_8                          ucAdHocChannelNum; /* For AdHoc */
709
710     ENUM_BAND_T                     eAdHocBand; /* For AdHoc */
711
712     UINT_32                         u4FreqInKHz; /* Center frequency */
713
714     /* ATIM windows using for IBSS power saving function */
715     UINT_16                         u2AtimWindow;
716
717     /* Features */
718     BOOLEAN                         fgIsEnableRoaming;
719
720     BOOLEAN                         fgIsAdHocQoSEnable;
721
722     ENUM_PARAM_PHY_CONFIG_T         eDesiredPhyConfig;
723
724     /* Used for AP mode for desired channel and bandwidth */
725     UINT_16                         u2CountryCode;
726     UINT_8                          uc2G4BandwidthMode; /* 20/40M or 20M only */
727     UINT_8                          uc5GBandwidthMode;  /* 20/40M or 20M only */
728
729     BOOLEAN                         fgTxShortGIDisabled;
730     BOOLEAN                         fgRxShortGIDisabled;
731
732 #if CFG_SUPPORT_802_11D
733     BOOLEAN                         fgMultiDomainCapabilityEnabled;
734 #endif /* CFG_SUPPORT_802_11D*/
735
736
737 #if 1 //CFG_SUPPORT_WAPI
738     BOOL                            fgWapiMode;
739     UINT_32                         u4WapiSelectedGroupCipher;
740     UINT_32                         u4WapiSelectedPairwiseCipher;
741     UINT_32                         u4WapiSelectedAKMSuite;
742 #endif
743
744     /* CR1486, CR1640 */
745     /* for WPS, disable the privacy check for AP selection policy */
746     BOOLEAN                         fgPrivacyCheckDisable;
747
748     /* b0~3: trigger-en AC0~3. b4~7: delivery-en AC0~3 */
749     UINT_8                          bmfgApsdEnAc;
750
751 } CONNECTION_SETTINGS_T, *P_CONNECTION_SETTINGS_T;
752
753 struct _BSS_INFO_T {
754
755     ENUM_PARAM_MEDIA_STATE_T  eConnectionState;           /* Connected Flag used in AIS_NORMAL_TR */
756     ENUM_PARAM_MEDIA_STATE_T  eConnectionStateIndicated;  /* The Media State that report to HOST */
757
758     ENUM_OP_MODE_T          eCurrentOPMode;             /* Current Operation Mode - Infra/IBSS */
759 #if CFG_ENABLE_WIFI_DIRECT
760     ENUM_OP_MODE_T          eIntendOPMode;
761 #endif
762
763     BOOLEAN                 fgIsNetActive;              /* TRUE if this network has been activated */
764
765     UINT_8                  ucNetTypeIndex;             /* ENUM_NETWORK_TYPE_INDEX_T */
766
767     UINT_8                  ucReasonOfDisconnect;       /* Used by media state indication */
768
769     BOOLEAN                 ucSSIDLen;                  /* Length of SSID */
770     UINT_8                  aucSSID[ELEM_MAX_LEN_SSID]; /* SSID used in this BSS */
771
772     UINT_8                  aucBSSID[MAC_ADDR_LEN];     /* The BSSID of the associated BSS */
773
774     UINT_8                  aucOwnMacAddr[MAC_ADDR_LEN];/* Owned MAC Address used in this BSS */
775
776     P_STA_RECORD_T          prStaRecOfAP;               /* For Infra Mode, and valid only if
777                                                          * eConnectionState == MEDIA_STATE_CONNECTED
778                                                          */
779     LINK_T                  rStaRecOfClientList;        /* For IBSS/AP Mode, all known STAs in current BSS */
780
781     UINT_16                 u2CapInfo;                  /* Change Detection */
782
783     UINT_16                 u2BeaconInterval;           /* The Beacon Interval of this BSS */
784
785
786     UINT_16                 u2ATIMWindow;               /* For IBSS Mode */
787
788     UINT_16                 u2AssocId;                  /* For Infra Mode, it is the Assoc ID assigned by AP.
789                                                          */
790
791
792     UINT_8                  ucDTIMPeriod;               /* For Infra/AP Mode */
793
794     UINT_8                  ucDTIMCount;                /* For AP Mode, it is the DTIM value we should carried in
795                                                          * the Beacon of next TBTT.
796                                                          */
797
798     UINT_8                  ucPhyTypeSet;               /* Available PHY Type Set of this peer
799                                                          * (This is deduced from received BSS_DESC_T)
800                                                          */
801
802     UINT_8                  ucNonHTBasicPhyType;        /* The Basic PHY Type Index, used to setup Phy Capability */
803
804     UINT_8                  ucConfigAdHocAPMode;        /* The configuration of AdHoc/AP Mode. e.g. 11g or 11b */
805
806     UINT_8                  ucBeaconTimeoutCount;       /* For Infra/AP Mode, it is a threshold of Beacon Lost Count to
807                                                            confirm connection was lost */
808
809     BOOLEAN                 fgHoldSameBssidForIBSS;     /* For IBSS Mode, to keep use same BSSID to extend the life cycle of an IBSS */
810
811     BOOLEAN                 fgIsBeaconActivated;        /* For AP/IBSS Mode, it is used to indicate that Beacon is sending */
812
813     P_MSDU_INFO_T           prBeacon;                   /* For AP/IBSS Mode - Beacon Frame */
814
815     BOOLEAN                 fgIsIBSSMaster;             /* For IBSS Mode - To indicate that we can reply ProbeResp Frame.
816                                                            In current TBTT interval */
817
818     BOOLEAN                 fgIsShortPreambleAllowed;   /* From Capability Info. of AssocResp Frame AND of Beacon/ProbeResp Frame */
819     BOOLEAN                 fgUseShortPreamble;         /* Short Preamble is enabled in current BSS. */
820     BOOLEAN                 fgUseShortSlotTime;         /* Short Slot Time is enabled in current BSS. */
821
822     UINT_16                 u2OperationalRateSet;       /* Operational Rate Set of current BSS */
823     UINT_16                 u2BSSBasicRateSet;          /* Basic Rate Set of current BSS */
824
825
826     UINT_8                  ucAllSupportedRatesLen;     /* Used for composing Beacon Frame in AdHoc or AP Mode */
827     UINT_8                  aucAllSupportedRates[RATE_NUM];
828
829     UINT_8                  ucAssocClientCnt;           /* TODO(Kevin): Number of associated clients */
830
831     BOOLEAN                 fgIsProtection;
832     BOOLEAN                 fgIsQBSS; /* fgIsWmmBSS; */ /* For Infra/AP/IBSS Mode, it is used to indicate if we support WMM in
833                                                          * current BSS. */
834     BOOLEAN                 fgIsNetAbsent;              /* TRUE: BSS is absent, FALSE: BSS is present */
835
836     UINT_32                 u4RsnSelectedGroupCipher;
837     UINT_32                 u4RsnSelectedPairwiseCipher;
838     UINT_32                 u4RsnSelectedAKMSuite;
839         UINT_16                 u2RsnSelectedCapInfo;
840
841     /*------------------------------------------------------------------------*/
842     /* Power Management related information                                   */
843     /*------------------------------------------------------------------------*/
844     PM_PROFILE_SETUP_INFO_T rPmProfSetupInfo;
845
846
847     /*------------------------------------------------------------------------*/
848     /* WMM/QoS related information                                            */
849     /*------------------------------------------------------------------------*/
850     UINT_8                  ucWmmParamSetCount;         /* Used to detect the change of EDCA parameters. For AP mode, the value is used in WMM IE */
851
852     AC_QUE_PARMS_T          arACQueParms[WMM_AC_INDEX_NUM];
853
854     UINT_8                  aucCWminLog2ForBcast[WMM_AC_INDEX_NUM];        /* For AP mode, broadcast the CWminLog2 */
855     UINT_8                  aucCWmaxLog2ForBcast[WMM_AC_INDEX_NUM];        /* For AP mode, broadcast the CWmaxLog2 */
856     AC_QUE_PARMS_T          arACQueParmsForBcast[WMM_AC_INDEX_NUM];        /* For AP mode, broadcast the value */
857
858     /*------------------------------------------------------------------------*/
859     /* 802.11n HT operation IE when (prStaRec->ucPhyTypeSet & PHY_TYPE_BIT_HT)*/
860     /* is true. They have the same definition with fields of                  */
861     /* information element (CM)                                               */
862     /*------------------------------------------------------------------------*/
863     ENUM_BAND_T             eBand;
864     UINT_8                  ucPrimaryChannel;
865     UINT_8                  ucHtOpInfo1;
866     UINT_16                 u2HtOpInfo2;
867     UINT_16                 u2HtOpInfo3;
868
869     /*------------------------------------------------------------------------*/
870     /* Required protection modes (CM)                                         */
871     /*------------------------------------------------------------------------*/
872     BOOLEAN                 fgErpProtectMode;
873     ENUM_HT_PROTECT_MODE_T  eHtProtectMode;
874     ENUM_GF_MODE_T          eGfOperationMode;
875     ENUM_RIFS_MODE_T        eRifsOperationMode;
876
877     BOOLEAN                 fgObssErpProtectMode;       /* GO only */
878     ENUM_HT_PROTECT_MODE_T  eObssHtProtectMode;         /* GO only */
879     ENUM_GF_MODE_T          eObssGfOperationMode;       /* GO only */
880     BOOLEAN                 fgObssRifsOperationMode;    /* GO only */
881
882     /*------------------------------------------------------------------------*/
883     /* OBSS to decide if 20/40M bandwidth is permitted.                       */
884     /* The first member indicates the following channel list length.          */
885     /*------------------------------------------------------------------------*/
886     BOOLEAN                 fgAssoc40mBwAllowed;
887     BOOLEAN                 fg40mBwAllowed;
888     ENUM_CHNL_EXT_T         eBssSCO;    /* Real setting for HW
889                                          * 20/40M AP mode will always set 40M,
890                                          * but its OP IE can be changed.
891                                          */
892     UINT_8                  auc2G_20mReqChnlList[CHNL_LIST_SZ_2G + 1];
893     UINT_8                  auc2G_NonHtChnlList[CHNL_LIST_SZ_2G + 1];
894     UINT_8                  auc2G_PriChnlList[CHNL_LIST_SZ_2G + 1];
895     UINT_8                  auc2G_SecChnlList[CHNL_LIST_SZ_2G + 1];
896
897     UINT_8                  auc5G_20mReqChnlList[CHNL_LIST_SZ_5G + 1];
898     UINT_8                  auc5G_NonHtChnlList[CHNL_LIST_SZ_5G + 1];
899     UINT_8                  auc5G_PriChnlList[CHNL_LIST_SZ_5G + 1];
900     UINT_8                  auc5G_SecChnlList[CHNL_LIST_SZ_5G + 1];
901
902     TIMER_T                 rObssScanTimer;
903     UINT_16                 u2ObssScanInterval;     /* in unit of sec */
904
905     BOOLEAN                 fgObssActionForcedTo20M;    /* GO only */
906     BOOLEAN                 fgObssBeaconForcedTo20M;    /* GO only */
907
908     /*------------------------------------------------------------------------*/
909     /* HW Related Fields (Kevin)                                              */
910     /*------------------------------------------------------------------------*/
911     UINT_8                  ucHwDefaultFixedRateCode;   /* The default rate code copied to MAC TX Desc */
912     UINT_16                 u2HwLPWakeupGuardTimeUsec;
913
914
915     UINT_8                  ucBssFreeQuota;              /* The value is updated from FW  */
916 };
917
918
919 struct _AIS_SPECIFIC_BSS_INFO_T {
920     UINT_8                  ucRoamingAuthTypes;         /* This value indicate the roaming type used in AIS_JOIN */
921
922     BOOLEAN                 fgIsIBSSActive;
923
924     /*! \brief Global flag to let arbiter stay at standby and not connect to any network */
925     BOOLEAN                 fgCounterMeasure;
926     UINT_8                  ucWEPDefaultKeyID;
927     BOOLEAN                 fgTransmitKeyExist; /* Legacy wep Transmit key exist or not */
928
929     /* While Do CounterMeasure procedure, check the EAPoL Error report have send out */
930     BOOLEAN                 fgCheckEAPoLTxDone;
931
932     UINT_32                 u4RsnaLastMICFailTime;
933
934     /* Stored the current bss wpa rsn cap filed, used for roaming policy */
935     //UINT_16                 u2RsnCap;
936     TIMER_T                 rPreauthenticationTimer;
937
938     /* By the flow chart of 802.11i,
939                wait 60 sec before associating to same AP
940                or roaming to a new AP
941                or sending data in IBSS,
942                keep a timer for handle the 60 sec counterMeasure */
943     TIMER_T                 rRsnaBlockTrafficTimer;
944     TIMER_T                 rRsnaEAPoLReportTimeoutTimer;
945
946     /* For Keep the Tx/Rx Mic key for TKIP SW Calculate Mic */
947     /* This is only one for AIS/AP */
948     UINT_8                  aucTxMicKey[8];
949     UINT_8                  aucRxMicKey[8];
950
951     /* Buffer for WPA2 PMKID */
952     /* The PMKID cache lifetime is expire by media_disconnect_indication */
953     UINT_32                 u4PmkidCandicateCount;
954     PMKID_CANDICATE_T       arPmkidCandicate[CFG_MAX_PMKID_CACHE];
955     UINT_32                 u4PmkidCacheCount;
956     PMKID_ENTRY_T           arPmkidCache[CFG_MAX_PMKID_CACHE];
957     BOOLEAN                 fgIndicatePMKID;
958 #if CFG_SUPPORT_802_11W
959     BOOLEAN                 fgMgmtProtection;
960     UINT_32                 u4SaQueryStart;
961     UINT_32                 u4SaQueryCount;
962     UINT_8                  ucSaQueryTimedOut;
963     PUINT_8                 pucSaQueryTransId;
964     TIMER_T                 rSaQueryTimer;
965     BOOLEAN                 fgBipKeyInstalled;
966 #endif
967 };
968
969 struct _BOW_SPECIFIC_BSS_INFO_T {
970     UINT_16                 u2Reserved; /* Reserved for Data Type Check */
971 };
972
973 #if CFG_SLT_SUPPORT
974 typedef struct _SLT_INFO_T {
975
976     P_BSS_DESC_T prPseudoBssDesc;
977     UINT_16 u2SiteID;
978     UINT_8 ucChannel2G4;
979     UINT_8 ucChannel5G;
980     BOOLEAN fgIsDUT;
981     UINT_32 u4BeaconReceiveCnt;
982     /////////Deprecated/////////
983     P_STA_RECORD_T prPseudoStaRec;
984 } SLT_INFO_T, *P_SLT_INFO_T;
985 #endif
986
987
988 /* Major member variables for WiFi FW operation.
989    Variables within this region will be ready for access after WIFI function is enabled.
990 */
991 typedef struct _WIFI_VAR_T {
992     BOOLEAN                 fgIsRadioOff;
993
994     BOOLEAN                 fgIsEnterD3ReqIssued;
995
996     BOOLEAN                 fgDebugCmdResp;
997
998     CONNECTION_SETTINGS_T   rConnSettings;
999
1000     SCAN_INFO_T             rScanInfo;
1001
1002 #if CFG_SUPPORT_ROAMING
1003     ROAMING_INFO_T          rRoamingInfo;
1004 #endif /* CFG_SUPPORT_ROAMING */
1005
1006     AIS_FSM_INFO_T          rAisFsmInfo;
1007
1008     ENUM_PWR_STATE_T        aePwrState[NETWORK_TYPE_INDEX_NUM];
1009
1010     BSS_INFO_T              arBssInfo[NETWORK_TYPE_INDEX_NUM];
1011
1012     AIS_SPECIFIC_BSS_INFO_T rAisSpecificBssInfo;
1013
1014 #if CFG_ENABLE_WIFI_DIRECT
1015     P_P2P_CONNECTION_SETTINGS_T prP2PConnSettings;
1016
1017     P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo;
1018
1019     P_P2P_FSM_INFO_T prP2pFsmInfo;
1020 #endif /* CFG_ENABLE_WIFI_DIRECT */
1021
1022 #if CFG_ENABLE_BT_OVER_WIFI
1023     BOW_SPECIFIC_BSS_INFO_T rBowSpecificBssInfo;
1024     BOW_FSM_INFO_T rBowFsmInfo;
1025 #endif /* CFG_ENABLE_BT_OVER_WIFI */
1026
1027     DEAUTH_INFO_T           arDeauthInfo[MAX_DEAUTH_INFO_COUNT];
1028
1029     /* Current Wi-Fi Settings and Flags */
1030     UINT_8                  aucPermanentAddress[MAC_ADDR_LEN];
1031     UINT_8                  aucMacAddress[MAC_ADDR_LEN];
1032     UINT_8                  aucDeviceAddress[MAC_ADDR_LEN];
1033     UINT_8                  aucInterfaceAddress[MAC_ADDR_LEN];
1034
1035     UINT_8                  ucAvailablePhyTypeSet;
1036
1037     ENUM_PHY_TYPE_INDEX_T   eNonHTBasicPhyType2G4; /* Basic Phy Type used by SCN according
1038                                                     * to the set of Available PHY Types
1039                                                     */
1040
1041     ENUM_PARAM_PREAMBLE_TYPE_T  ePreambleType;
1042     ENUM_REGISTRY_FIXED_RATE_T  eRateSetting;
1043
1044     BOOLEAN                 fgIsShortSlotTimeOptionEnable;
1045                             /* User desired setting, but will honor the capability of AP */
1046
1047     BOOLEAN                 fgEnableJoinToHiddenSSID;
1048     BOOLEAN                 fgSupportWZCDisassociation;
1049
1050     BOOLEAN                 fgSupportQoS;
1051     BOOLEAN                 fgSupportAmpduTx;
1052     BOOLEAN                 fgSupportAmpduRx;
1053     BOOLEAN                 fgSupportTspec;
1054     BOOLEAN                 fgSupportUAPSD;
1055     BOOLEAN                 fgSupportULPSMP;
1056
1057 #if CFG_SLT_SUPPORT
1058     SLT_INFO_T      rSltInfo;
1059 #endif
1060
1061 } WIFI_VAR_T, *P_WIFI_VAR_T;/* end of _WIFI_VAR_T */
1062
1063 /* cnm_timer module */
1064 typedef struct {
1065     LINK_T              rLinkHead;
1066     OS_SYSTIME          rNextExpiredSysTime;
1067     KAL_WAKE_LOCK_T     rWakeLock;
1068     BOOLEAN             fgWakeLocked;
1069 } ROOT_TIMER, *P_ROOT_TIMER;
1070
1071
1072 /* FW/DRV/NVRAM version information */
1073 typedef struct {
1074
1075     /* NVRAM or Registry */
1076     UINT_16     u2Part1CfgOwnVersion;
1077     UINT_16     u2Part1CfgPeerVersion;
1078     UINT_16     u2Part2CfgOwnVersion;
1079     UINT_16     u2Part2CfgPeerVersion;
1080
1081     /* Firmware */
1082     UINT_16     u2FwProductID;
1083     UINT_16     u2FwOwnVersion;
1084     UINT_16     u2FwPeerVersion;
1085
1086 } WIFI_VER_INFO_T, *P_WIFI_VER_INFO_T;
1087
1088
1089 #if CFG_ENABLE_WIFI_DIRECT
1090 /*
1091 * p2p function pointer structure
1092 */
1093
1094 typedef struct _P2P_FUNCTION_LINKER {
1095     P2P_REMOVE                                  prP2pRemove;
1096     KAL_P2P_GET_CIPHER                          prKalP2pGetCipher;
1097     KAL_P2P_GET_TKIP_CIPHER                     prKalP2pGetTkipCipher;
1098     KAL_P2P_GET_CCMP_CIPHER                     prKalP2pGetCcmpCipher;
1099     KAL_P2P_GET_WSC_MODE                        prKalP2pGetWscMode;
1100     KAL_P2P_GET_DEV_HDLR                        prKalP2pGetDevHdlr;
1101 //    NIC_P2P_MEDIA_STATE_CHANGE                  prNicP2pMediaStateChange;
1102     KAL_P2P_UPDATE_ASSOC_INFO                   prKalP2pUpdateAssocInfo;
1103     P2P_VALIDATE_AUTH                           prP2pValidateAuth;
1104     P2P_VALIDATE_ASSOC_REQ                      prP2pValidateAssocReq;
1105     P2P_RUN_EVENT_AAA_TX_FAIL                   prP2pRunEventAAATxFail;
1106     P2P_RUN_EVENT_AAA_COMPLETE                  prP2pRunEventAAASuccess;
1107     P2P_RUN_EVENT_AAA_COMPLETE                  prP2pRunEventAAAComplete;
1108     P2P_PARSE_CHECK_FOR_P2P_INFO_ELEM           prP2pParseCheckForP2pInfoElem;
1109 //    SCAN_UPDATE_P2P_DEVICE_DESC                 prScanUpdateP2pDeviceDesc;
1110 //    P2P_FSM_RUN_EVENT_RX_PROBE_RESPONSE_FRAME   prP2pFsmRunEventRxProbeResponseFrame;
1111     P2P_PROCESS_EVENT_UPDATE_NOA_PARAM          prP2pProcessEvent_UpdateNOAParam;
1112     SCAN_P2P_PROCESS_BEACON_AND_PROBE_RESP      prScanP2pProcessBeaconAndProbeResp;
1113     P2P_RX_PUBLIC_ACTION_FRAME                  prP2pRxPublicActionFrame;
1114     RLM_RSP_GENERATE_OBSS_SCAN_IE               prRlmRspGenerateObssScanIE;
1115     RLM_PROCESS_PUBLIC_ACTION                   prRlmProcessPublicAction;
1116     RLM_PROCESS_HT_ACTION                       prRlmProcessHtAction;
1117     RLM_UPDATE_PARAMS_FOR_AP                    prRlmUpdateParamsForAp;
1118     RLM_HANDLE_OBSS_STATUS_EVENT_PKT            prRlmHandleObssStatusEventPkt;
1119     P2P_CALCULATE_P2P_IE_LEN         prP2pCalculateP2p_IELenForBeacon;
1120     P2P_GENERATE_P2P_IE              prP2pGenerateP2p_IEForBeacon;
1121     P2P_CALCULATE_P2P_IE_LEN         prP2pCalculateP2p_IELenForAssocRsp;
1122     P2P_GENERATE_P2P_IE              prP2pGenerateP2p_IEForAssocRsp;
1123     P2P_CALCULATE_P2P_IE_LEN         prP2pCalculateWSC_IELenForBeacon;
1124     P2P_GENERATE_P2P_IE              prP2pGenerateWSC_IEForBeacon;
1125 //    P2P_CALCULATE_WSC_IE_LEN_FOR_PROBE_RSP      prP2pCalculateWSC_IELenForProbeRsp;
1126 //    P2P_GENERATE_WSC_IE_FOR_PROBE_RSP           prP2pGenerateWSC_IEForProbeRsp;
1127     P2P_FUNC_VALIDATE_PROBE_REQ                 prP2pFuncValidateProbeReq;
1128     RLM_BSS_INIT_FOR_AP                         prRlmBssInitForAP;
1129     P2P_GET_PROB_RSP_IE_TABLE_SIZE              prP2pGetTxProbRspIETAbleSize;
1130     P2P_BUILD_REASSOC_REQ_FRAME_COMMON_IES      prP2pBuildReassocReqFrameCommIEs;
1131 //    SCAN_REMOVE_P2P_BSS_DESC                    prScanRemoveP2pBssDesc;
1132     P2P_FUNC_DISCONNECT                              prP2pFuncDisconnect;
1133     P2P_FSM_RUN_EVENT_RX_DEAUTH                prP2pFsmRunEventRxDeauthentication;
1134     P2P_FSM_RUN_EVENT_RX_DISASSOC            prP2pFsmRunEventRxDisassociation;
1135 //    P2P_HANDLE_SEC_CHECK_RSP                    prP2pHandleSecCheckRsp;
1136     P2P_FUN_IS_AP_MODE                                 prP2pFuncIsApMode;
1137     P2P_FSM_RUN_EVENT_BEACON_TIMEOUT      prP2pFsmRunEventBeaconTimeout;
1138     P2P_RX_PUBLIC_ACTION_FRAME                  prP2pRxActionFrame;
1139     KAL_P2P_SET_MULTICAST_WORK_ITEM        prP2pSetMulticastListWorkQueue;
1140     P2P_FUNC_STORE_ASSOC_RSP_IE_BUFFER  prP2pFuncStoreAssocRspIeBuffer;
1141     P2P_CALCULATE_P2P_IE_LEN         prP2pCalculate_IELenForAssocReq;
1142     P2P_GENERATE_P2P_IE              prP2pGenerate_IEForAssocReq;
1143 } P2P_FUNCTION_LINKER, *P_P2P_FUNCTION_LINKER;
1144
1145
1146 #endif
1147
1148 /*
1149  * Major ADAPTER structure
1150  * Major data structure for driver operation
1151  */
1152 struct _ADAPTER_T {
1153     UINT_8                  ucRevID;
1154
1155     UINT_16                 u2NicOpChnlNum;
1156
1157     BOOLEAN                 fgIsEnableWMM;
1158     BOOLEAN                 fgIsWmmAssoc; /* This flag is used to indicate that WMM is enable in current BSS */
1159
1160     UINT_32                 u4OsPacketFilter;     // packet filter used by OS
1161
1162
1163 #if CFG_TCP_IP_CHKSUM_OFFLOAD
1164     UINT_32                 u4CSUMFlags;
1165 #endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */
1166
1167
1168     ENUM_BAND_T             aePreferBand[NETWORK_TYPE_INDEX_NUM];
1169
1170     /* ADAPTER flags */
1171     UINT_32                 u4Flags;
1172     UINT_32                 u4HwFlags;
1173
1174     BOOLEAN                 fgIsRadioOff;
1175
1176     BOOLEAN                 fgIsEnterD3ReqIssued;
1177
1178     UINT_8                  aucMacAddress[MAC_ADDR_LEN];
1179
1180     ENUM_PHY_TYPE_INDEX_T   eCurrentPhyType; /* Current selection basing on the set of Available PHY Types */
1181
1182 #if CFG_COALESCING_BUFFER_SIZE || CFG_SDIO_RX_AGG
1183     UINT_32                 u4CoalescingBufCachedSize;
1184     PUINT_8                 pucCoalescingBufCached;
1185 #endif /* CFG_COALESCING_BUFFER_SIZE */
1186
1187     /* Buffer for CMD_INFO_T, Mgt packet and mailbox message */
1188     BUF_INFO_T              rMgtBufInfo;
1189     BUF_INFO_T              rMsgBufInfo;
1190     PUINT_8                 pucMgtBufCached;
1191     UINT_32                 u4MgtBufCachedSize;
1192     UINT_8                  aucMsgBuf[MSG_BUFFER_SIZE];
1193 #if CFG_DBG_MGT_BUF
1194     UINT_32                 u4MemAllocDynamicCount;     /* Debug only */
1195     UINT_32                 u4MemFreeDynamicCount;      /* Debug only */
1196 #endif
1197
1198     STA_RECORD_T            arStaRec[CFG_STA_REC_NUM];
1199
1200     /* Element for TX PATH */
1201     TX_CTRL_T               rTxCtrl;
1202     QUE_T                   rFreeCmdList;
1203     CMD_INFO_T              arHifCmdDesc[CFG_TX_MAX_CMD_PKT_NUM];
1204
1205     /* Element for RX PATH */
1206     RX_CTRL_T               rRxCtrl;
1207
1208     P_SDIO_CTRL_T           prSDIOCtrl;
1209
1210 #if (MT6620_E1_ASIC_HIFSYS_WORKAROUND == 1)
1211     /* Element for MT6620 E1 HIFSYS workaround */
1212     BOOLEAN                 fgIsClockGatingEnabled;
1213 #endif
1214
1215     /* Buffer for Authentication Event */
1216     /* <Todo> Move to glue layer and refine the kal function */
1217     /* Reference to rsnGeneratePmkidIndication function at rsn.c */
1218     UINT_8                  aucIndicationEventBuffer[(CFG_MAX_PMKID_CACHE * 20)  + 8 ];
1219
1220     UINT_32                 u4IntStatus;
1221
1222     ENUM_ACPI_STATE_T       rAcpiState;
1223
1224     BOOLEAN                 fgIsIntEnable;
1225     BOOLEAN                 fgIsIntEnableWithLPOwnSet;
1226
1227     BOOLEAN                 fgIsFwOwn;
1228     BOOLEAN                 fgWiFiInSleepyState;
1229
1230     UINT_32                 u4PwrCtrlBlockCnt;
1231
1232     QUE_T                   rPendingCmdQueue;
1233
1234     P_GLUE_INFO_T           prGlueInfo;
1235
1236     UINT_8                  ucCmdSeqNum;
1237     UINT_8                  ucTxSeqNum;
1238
1239 #if 1//CFG_SUPPORT_WAPI
1240     BOOLEAN                 fgUseWapi;
1241 #endif
1242
1243     /* RF Test flags */
1244     BOOLEAN         fgTestMode;
1245
1246     /* WLAN Info for DRIVER_CORE OID query */
1247     WLAN_INFO_T     rWlanInfo;
1248
1249 #if CFG_ENABLE_WIFI_DIRECT
1250     BOOLEAN             fgIsP2PRegistered;
1251     BOOLEAN             fgIsWlanLaunched;
1252     P_P2P_INFO_T        prP2pInfo;
1253     P2P_FUNCTION_LINKER rP2pFuncLkr;
1254 #if CFG_SUPPORT_P2P_RSSI_QUERY
1255     OS_SYSTIME          rP2pLinkQualityUpdateTime;
1256     BOOLEAN             fgIsP2pLinkQualityValid;
1257     EVENT_LINK_QUALITY  rP2pLinkQuality;
1258 #endif
1259 #endif
1260
1261     /* Online Scan Option */
1262     BOOLEAN         fgEnOnlineScan;
1263
1264     /* Online Scan Option */
1265     BOOLEAN         fgDisBcnLostDetection;
1266
1267     /* MAC address */
1268     PARAM_MAC_ADDRESS rMyMacAddr;
1269
1270     /* Wake-up Event for WOL */
1271     UINT_32         u4WakeupEventEnable;
1272
1273     /* Event Buffering */
1274     EVENT_STATISTICS    rStatStruct;
1275     OS_SYSTIME          rStatUpdateTime;
1276     BOOLEAN             fgIsStatValid;
1277
1278     EVENT_LINK_QUALITY  rLinkQuality;
1279     OS_SYSTIME          rLinkQualityUpdateTime;
1280     BOOLEAN             fgIsLinkQualityValid;
1281     OS_SYSTIME          rLinkRateUpdateTime;
1282     BOOLEAN             fgIsLinkRateValid;
1283
1284     /* WIFI_VAR_T */
1285     WIFI_VAR_T          rWifiVar;
1286
1287     /* MTK WLAN NIC driver IEEE 802.11 MIB */
1288     IEEE_802_11_MIB_T   rMib;
1289
1290     /* Mailboxs for inter-module communication */
1291     MBOX_T arMbox[MBOX_ID_TOTAL_NUM];
1292
1293     /* Timers for OID Pending Handling */
1294     TIMER_T             rOidTimeoutTimer;
1295
1296     /* Root Timer for cnm_timer module */
1297     ROOT_TIMER          rRootTimer;
1298
1299     /* RLM maintenance */
1300     ENUM_CHNL_EXT_T             eRfSco;
1301     ENUM_SYS_PROTECT_MODE_T     eSysProtectMode;
1302     ENUM_GF_MODE_T              eSysHtGfMode;
1303     ENUM_RIFS_MODE_T            eSysTxRifsMode;
1304     ENUM_SYS_PCO_PHASE_T        eSysPcoPhase;
1305
1306     P_DOMAIN_INFO_ENTRY         prDomainInfo;
1307
1308     /* QM */
1309     QUE_MGT_T                   rQM;
1310
1311     CNM_INFO_T                  rCnmInfo;
1312
1313     UINT_32 u4PowerMode;
1314
1315     UINT_32 u4CtiaPowerMode;
1316     BOOLEAN fgEnCtiaPowerMode;
1317
1318     UINT_32 fgEnArpFilter;
1319
1320     UINT_32 u4UapsdAcBmp;
1321
1322     UINT_32 u4MaxSpLen;
1323
1324     UINT_32 u4PsCurrentMeasureEn;
1325
1326     /* Version Information */
1327     WIFI_VER_INFO_T             rVerInfo;
1328
1329     /* 5GHz support (from F/W) */
1330     BOOLEAN fgIsHw5GBandDisabled;
1331     BOOLEAN fgEnable5GBand;
1332     BOOLEAN fgIsEepromUsed;
1333     BOOLEAN fgIsEfuseValid;
1334     BOOLEAN fgIsEmbbededMacAddrValid;
1335
1336     /* Packet Forwarding Tracking */
1337     INT_32  i4PendingFwdFrameCount;
1338
1339 #if CFG_SUPPORT_RDD_TEST_MODE
1340     UINT_8  ucRddStatus;
1341 #endif
1342
1343 };/* end of _ADAPTER_T */
1344
1345 /*******************************************************************************
1346 *                            P U B L I C   D A T A
1347 ********************************************************************************
1348 */
1349
1350 /*******************************************************************************
1351 *                           P R I V A T E   D A T A
1352 ********************************************************************************
1353 */
1354
1355 /*******************************************************************************
1356 *                                 M A C R O S
1357 ********************************************************************************
1358 */
1359 /*----------------------------------------------------------------------------*/
1360 /* Macros for BSS_INFO_T - Flag of Net Active                                 */
1361 /*----------------------------------------------------------------------------*/
1362 #define IS_NET_ACTIVE(_prAdapter, _NetTypeIndex) \
1363                 (_prAdapter->rWifiVar.arBssInfo[(_NetTypeIndex)].fgIsNetActive)
1364 #define IS_BSS_ACTIVE(_prBssInfo)     ((_prBssInfo)->fgIsNetActive)
1365
1366 #define IS_AIS_ACTIVE(_prAdapter)     IS_NET_ACTIVE(_prAdapter, NETWORK_TYPE_AIS_INDEX)
1367 #define IS_P2P_ACTIVE(_prAdapter)     IS_NET_ACTIVE(_prAdapter, NETWORK_TYPE_P2P_INDEX)
1368 #define IS_BOW_ACTIVE(_prAdapter)     IS_NET_ACTIVE(_prAdapter, NETWORK_TYPE_BOW_INDEX)
1369
1370 #define SET_NET_ACTIVE(_prAdapter, _NetTypeIndex) \
1371                 {_prAdapter->rWifiVar.arBssInfo[(_NetTypeIndex)].fgIsNetActive = TRUE;}
1372
1373 #define UNSET_NET_ACTIVE(_prAdapter, _NetTypeIndex) \
1374                 {_prAdapter->rWifiVar.arBssInfo[(_NetTypeIndex)].fgIsNetActive = FALSE;}
1375
1376 #define BSS_INFO_INIT(_prAdapter, _NetTypeIndex) \
1377                 {   UINT_8 _aucZeroMacAddr[] = NULL_MAC_ADDR; \
1378                     P_BSS_INFO_T _prBssInfo = &(_prAdapter->rWifiVar.arBssInfo[(_NetTypeIndex)]); \
1379                     \
1380                     _prBssInfo->eConnectionState = PARAM_MEDIA_STATE_DISCONNECTED; \
1381                     _prBssInfo->eConnectionStateIndicated = PARAM_MEDIA_STATE_DISCONNECTED; \
1382                     _prBssInfo->eCurrentOPMode = OP_MODE_INFRASTRUCTURE; \
1383                     _prBssInfo->fgIsNetActive = FALSE; \
1384                     _prBssInfo->ucNetTypeIndex = (_NetTypeIndex); \
1385                     _prBssInfo->ucReasonOfDisconnect = DISCONNECT_REASON_CODE_RESERVED; \
1386                     COPY_MAC_ADDR(_prBssInfo->aucBSSID, _aucZeroMacAddr); \
1387                     LINK_INITIALIZE(&_prBssInfo->rStaRecOfClientList); \
1388                     _prBssInfo->fgIsBeaconActivated = FALSE; \
1389                     _prBssInfo->ucHwDefaultFixedRateCode = RATE_CCK_1M_LONG; \
1390                     _prBssInfo->fgIsNetAbsent = FALSE; \
1391                 }
1392
1393 #if CFG_ENABLE_BT_OVER_WIFI
1394 #define BOW_BSS_INFO_INIT(_prAdapter, _NetTypeIndex) \
1395                 {  \
1396                     P_BSS_INFO_T _prBssInfo = &(_prAdapter->rWifiVar.arBssInfo[(_NetTypeIndex)]); \
1397                     \
1398                     _prBssInfo->eConnectionState = PARAM_MEDIA_STATE_DISCONNECTED; \
1399                     _prBssInfo->eConnectionStateIndicated = PARAM_MEDIA_STATE_DISCONNECTED; \
1400                     _prBssInfo->eCurrentOPMode = OP_MODE_BOW; \
1401                     _prBssInfo->ucNetTypeIndex = (_NetTypeIndex); \
1402                     _prBssInfo->ucReasonOfDisconnect = DISCONNECT_REASON_CODE_RESERVED; \
1403                     LINK_INITIALIZE(&_prBssInfo->rStaRecOfClientList); \
1404                     _prBssInfo->fgIsBeaconActivated = TRUE; \
1405                     _prBssInfo->ucHwDefaultFixedRateCode = RATE_CCK_1M_LONG; \
1406                     _prBssInfo->fgIsNetAbsent = FALSE; \
1407                 }
1408 #endif
1409
1410 /*----------------------------------------------------------------------------*/
1411 /* Macros for Power State                                                     */
1412 /*----------------------------------------------------------------------------*/
1413 #define SET_NET_PWR_STATE_IDLE(_prAdapter, _NetTypeIndex) \
1414                 {_prAdapter->rWifiVar.aePwrState[(_NetTypeIndex)] = PWR_STATE_IDLE;}
1415
1416 #define SET_NET_PWR_STATE_ACTIVE(_prAdapter, _NetTypeIndex) \
1417                 {_prAdapter->rWifiVar.aePwrState[(_NetTypeIndex)] = PWR_STATE_ACTIVE;}
1418
1419 #define SET_NET_PWR_STATE_PS(_prAdapter, _NetTypeIndex) \
1420                 {_prAdapter->rWifiVar.aePwrState[(_NetTypeIndex)] = PWR_STATE_PS;}
1421
1422 #define IS_NET_PWR_STATE_ACTIVE(_prAdapter, _NetTypeIndex) \
1423                 (_prAdapter->rWifiVar.aePwrState[(_NetTypeIndex)] == PWR_STATE_ACTIVE)
1424
1425 #define IS_NET_PWR_STATE_IDLE(_prAdapter, _NetTypeIndex) \
1426                 (_prAdapter->rWifiVar.aePwrState[(_NetTypeIndex)] == PWR_STATE_IDLE)
1427
1428 #define IS_SCN_PWR_STATE_ACTIVE(_prAdapter) \
1429                 (_prAdapter->rWifiVar.rScanInfo.eScanPwrState == SCAN_PWR_STATE_ACTIVE)
1430
1431 #define IS_SCN_PWR_STATE_IDLE(_prAdapter) \
1432                 (_prAdapter->rWifiVar.rScanInfo.eScanPwrState == SCAN_PWR_STATE_IDLE)
1433
1434 /*******************************************************************************
1435 *                  F U N C T I O N   D E C L A R A T I O N S
1436 ********************************************************************************
1437 */
1438
1439
1440 /*******************************************************************************
1441 *                              F U N C T I O N S
1442 ********************************************************************************
1443 */
1444
1445 #endif /* _ADAPTER_H */
1446
1447