2 ** $Id: //Department/DaVinci/BRANCHES/MT662X_593X_WIFI_DRIVER_V2_3/include/nic/wlan_def.h#1 $
6 \brief This file includes the basic definition of WLAN
10 /*******************************************************************************
11 * Copyright (c) 2007 MediaTek Inc.
13 * All rights reserved. Copying, compilation, modification, distribution
14 * or any other use whatsoever of this material is strictly prohibited
15 * except in accordance with a Software License Agreement with
17 ********************************************************************************
20 /*******************************************************************************
23 * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND
24 * AGREES THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK
25 * SOFTWARE") RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE
26 * PROVIDED TO BUYER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY
27 * DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
28 * LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
29 * PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE
30 * ANY WARRANTY WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY
31 * WHICH MAY BE USED BY, INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK
32 * SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY
33 * WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE
34 * FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION OR TO
35 * CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
37 * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
38 * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL
39 * BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT
40 * ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY
41 * BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
43 * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
44 * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT
45 * OF LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING
46 * THEREOF AND RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN
47 * FRANCISCO, CA, UNDER THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE
49 ********************************************************************************
56 * [WCXRP00001131] [MT6620 Wi-Fi][Driver][AIS] Implement connect-by-BSSID path
57 * add CONNECT_BY_BSSID policy
60 * [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP
61 * adding the 802.11w related function and define .
64 * [WCXRP00000806] [MT6620 Wi-Fi][Driver] Move the WPA/RSN IE and WAPI IE structure to mac.h and let the sw structure not align at byte
65 * Move the WAPI/RSN IE to mac.h and SW structure not align to byte,
66 * Notice needed update P2P.ko.
68 * 04 08 2011 eddie.chen
69 * [WCXRP00000617] [MT6620 Wi-Fi][DRV/FW] Fix for sigma
72 * 03 17 2011 yuche.tsai
74 * Resize the Secondary Device Type array when WiFi Direct is enabled.
76 * 01 25 2011 yuche.tsai
77 * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record.
78 * Change Station Type in Station Record, Modify MACRO definition for getting station type & network type index & Role.
80 * 01 25 2011 yuche.tsai
81 * [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record.
82 * Add new station type MACRO.
85 * [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant
86 * 1. Country code is from NVRAM or supplicant
87 * 2. Change band definition in CMD/EVENT.
89 * 10 11 2010 kevin.huang
90 * [WCXRP00000068] [MT6620 Wi-Fi][Driver][FW] Fix STA RECORD sync issue and remove unused code
91 * Update ENUM_STA_ROLE_INDEX_T by using a fixed base value
94 * [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by ENUM_NETWORK_TYPE_INDEX_T only
95 * remove ENUM_NETWORK_TYPE_T definitions
97 * 09 14 2010 chinghwa.yu
99 * Update OP_MODE_BOW and include bow_fsm.h.
101 * 09 03 2010 kevin.huang
103 * Refine #include sequence and solve recursive/nested #include issue
105 * 08 31 2010 kevin.huang
107 * Use LINK LIST operation to process SCAN result
109 * 08 29 2010 yuche.tsai
111 * Change P2P Descriptor List to a pointer and allocate it dynamically to avoid structure corrupt by BssDescriptor free.
113 * 08 16 2010 kevin.huang
115 * Refine AAA functions
117 * 08 12 2010 kevin.huang
119 * Refine bssProcessProbeRequest() and bssSendBeaconProbeResponse()
121 * 08 12 2010 yuche.tsai
123 * Add a pointer in BSS Descriptor for P2P Descriptor.
125 * 08 11 2010 yuche.tsai
127 * Add an Interface in BSS Descriptor.
129 * 08 05 2010 yuche.tsai
131 * Modify data structure for P2P Scan result.
133 * 07 26 2010 yuche.tsai
135 * Add an operation mode for P2P device.
139 * P2P/RSN/WAPI IEs need to be declared with compact structure.
141 * 07 21 2010 yuche.tsai
143 * Add for P2P Scan Result Parsing & Saving.
147 * adding the wapi code.
151 * 1) separate AIS_FSM state for two kinds of scanning. (OID triggered scan, and scan-for-connection)
152 * 2) eliminate PRE_BSS_DESC_T, Beacon/PrebResp is now parsed in single pass
153 * 3) implment DRV-SCN module, currently only accepts single scan request, other request will be directly dropped by returning BUSY
157 * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
159 * 06 28 2010 cm.chang
160 * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
161 * 1st draft code for RLM module
164 * [WPD00003833][MT6620 and MT5931] Driver migration
165 * modify Beacon/ProbeResp to complete parsing,
166 * because host software has looser memory usage restriction
168 * 06 21 2010 yuche.tsai
169 * [WPD00003839][MT6620 5931][P2P] Feature migration
170 * Add P2P present boolean flag in BSS & Pre-BSS descriptor.
173 * [WPD00003840][MT6620 5931] Security migration
174 * migration the security related function from firmware.
177 * [WPD00003833][MT6620 and MT5931] Driver migration
178 * auth.c is migrated.
181 * [WPD00003833][MT6620 and MT5931] Driver migration
182 * 1) migrate assoc.c.
183 * 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
184 * 3) add configuration options for CNM_MEM and RSN modules
185 * 4) add data path for management frames
186 * 5) eliminate rPacketInfo of MSDU_INFO_T
189 * [WPD00003833][MT6620 and MT5931] Driver migration
190 * add buildable & linkable ais_fsm.c
192 * related reference are still waiting to be resolved
195 * [WPD00003833][MT6620 and MT5931] Driver migration
196 * add definitions for module migration.
199 * [WPD00003833][MT6620 and MT5931] Driver migration
200 * move bss related data types to wlan_def.h to avoid recursive dependency.
203 * [WPD00003833][MT6620 and MT5931] Driver migration
207 * [WPD00003833][MT6620 and MT5931] Driver migration
208 * merge cnm_scan.h and hem_mbox.h
211 * [WPD00003833][MT6620 and MT5931] Driver migration
212 * merge wifi_var.h, precomp.h, cnm_timer.h (data type only)
214 * 06 06 2010 kevin.huang
215 * [WPD00003832][MT6620 5931] Create driver base
216 * [MT6620 5931] Create driver base
217 ** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:40 GMT mtk01426
225 /*******************************************************************************
226 * C O M P I L E R F L A G S
227 ********************************************************************************
230 /*******************************************************************************
231 * E X T E R N A L R E F E R E N C E S
232 ********************************************************************************
235 /*******************************************************************************
237 ********************************************************************************
239 /* disconnect reason */
240 #define DISCONNECT_REASON_CODE_RESERVED 0
241 #define DISCONNECT_REASON_CODE_RADIO_LOST 1
242 #define DISCONNECT_REASON_CODE_DEAUTHENTICATED 2
243 #define DISCONNECT_REASON_CODE_DISASSOCIATED 3
244 #define DISCONNECT_REASON_CODE_NEW_CONNECTION 4
246 /* The rate definitions */
247 #define TX_MODE_CCK 0x00
248 #define TX_MODE_OFDM 0x40
249 #define TX_MODE_HT_MM 0x80
250 #define TX_MODE_HT_GF 0xC0
252 #define RATE_CCK_SHORT_PREAMBLE 0x10
253 #define RATE_OFDM 0x20
255 #define PHY_RATE_1M 0x0
256 #define PHY_RATE_2M 0x1
257 #define PHY_RATE_5_5M 0x2
258 #define PHY_RATE_11M 0x3
259 #define PHY_RATE_6M 0xB
260 #define PHY_RATE_9M 0xF
261 #define PHY_RATE_12M 0xA
262 #define PHY_RATE_18M 0xE
263 #define PHY_RATE_24M 0x9
264 #define PHY_RATE_36M 0xD
265 #define PHY_RATE_48M 0x8
266 #define PHY_RATE_54M 0xC
267 #define PHY_RATE_MCS0 0x0
268 #define PHY_RATE_MCS1 0x1
269 #define PHY_RATE_MCS2 0x2
270 #define PHY_RATE_MCS3 0x3
271 #define PHY_RATE_MCS4 0x4
272 #define PHY_RATE_MCS5 0x5
273 #define PHY_RATE_MCS6 0x6
274 #define PHY_RATE_MCS7 0x7
275 #define PHY_RATE_MCS32 0x20
277 #define RATE_CCK_1M_LONG (TX_MODE_CCK | PHY_RATE_1M)
278 #define RATE_CCK_2M_LONG (TX_MODE_CCK | PHY_RATE_2M)
279 #define RATE_CCK_5_5M_LONG (TX_MODE_CCK | PHY_RATE_5_5M)
280 #define RATE_CCK_11M_LONG (TX_MODE_CCK | PHY_RATE_11M)
281 #define RATE_CCK_2M_SHORT (TX_MODE_CCK | PHY_RATE_2M | RATE_CCK_SHORT_PREAMBLE)
282 #define RATE_CCK_5_5M_SHORT (TX_MODE_CCK | PHY_RATE_5_5M | RATE_CCK_SHORT_PREAMBLE)
283 #define RATE_CCK_11M_SHORT (TX_MODE_CCK | PHY_RATE_11M | RATE_CCK_SHORT_PREAMBLE)
284 #define RATE_OFDM_6M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_6M)
285 #define RATE_OFDM_9M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_9M)
286 #define RATE_OFDM_12M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_12M)
287 #define RATE_OFDM_18M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_18M)
288 #define RATE_OFDM_24M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_24M)
289 #define RATE_OFDM_36M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_36M)
290 #define RATE_OFDM_48M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_48M)
291 #define RATE_OFDM_54M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_54M)
293 #define RATE_MM_MCS_0 (TX_MODE_HT_MM | PHY_RATE_MCS0)
294 #define RATE_MM_MCS_1 (TX_MODE_HT_MM | PHY_RATE_MCS1)
295 #define RATE_MM_MCS_2 (TX_MODE_HT_MM | PHY_RATE_MCS2)
296 #define RATE_MM_MCS_3 (TX_MODE_HT_MM | PHY_RATE_MCS3)
297 #define RATE_MM_MCS_4 (TX_MODE_HT_MM | PHY_RATE_MCS4)
298 #define RATE_MM_MCS_5 (TX_MODE_HT_MM | PHY_RATE_MCS5)
299 #define RATE_MM_MCS_6 (TX_MODE_HT_MM | PHY_RATE_MCS6)
300 #define RATE_MM_MCS_7 (TX_MODE_HT_MM | PHY_RATE_MCS7)
301 #define RATE_MM_MCS_32 (TX_MODE_HT_MM | PHY_RATE_MCS32)
303 #define RATE_GF_MCS_0 (TX_MODE_HT_GF | PHY_RATE_MCS0)
304 #define RATE_GF_MCS_1 (TX_MODE_HT_GF | PHY_RATE_MCS1)
305 #define RATE_GF_MCS_2 (TX_MODE_HT_GF | PHY_RATE_MCS2)
306 #define RATE_GF_MCS_3 (TX_MODE_HT_GF | PHY_RATE_MCS3)
307 #define RATE_GF_MCS_4 (TX_MODE_HT_GF | PHY_RATE_MCS4)
308 #define RATE_GF_MCS_5 (TX_MODE_HT_GF | PHY_RATE_MCS5)
309 #define RATE_GF_MCS_6 (TX_MODE_HT_GF | PHY_RATE_MCS6)
310 #define RATE_GF_MCS_7 (TX_MODE_HT_GF | PHY_RATE_MCS7)
311 #define RATE_GF_MCS_32 (TX_MODE_HT_GF | PHY_RATE_MCS32)
313 #define RATE_TX_MODE_MASK BITS(6,7)
314 #define RATE_TX_MODE_OFFSET 6
315 #define RATE_CODE_GET_TX_MODE(_ucRateCode) ((_ucRateCode & RATE_TX_MODE_MASK) >> RATE_TX_MODE_OFFSET)
316 #define RATE_PHY_RATE_MASK BITS(0,5)
317 #define RATE_PHY_RATE_OFFSET 0
318 #define RATE_CODE_GET_PHY_RATE(_ucRateCode) ((_ucRateCode & RATE_PHY_RATE_MASK) >> RATE_PHY_RATE_OFFSET)
319 #define RATE_PHY_RATE_SHORT_PREAMBLE BIT(4)
320 #define RATE_CODE_IS_SHORT_PREAMBLE(_ucRateCode) ((_ucRateCode & RATE_PHY_RATE_SHORT_PREAMBLE)?TRUE:FALSE)
323 #define CHNL_LIST_SZ_2G 14
324 #define CHNL_LIST_SZ_5G 14
326 /*! CNM(STA_RECORD_T) related definition */
327 #define CFG_STA_REC_NUM 20
329 /* PHY TYPE bit definitions */
330 #define PHY_TYPE_BIT_HR_DSSS BIT(PHY_TYPE_HR_DSSS_INDEX) /* HR/DSSS PHY (clause 18) */
331 #define PHY_TYPE_BIT_ERP BIT(PHY_TYPE_ERP_INDEX) /* ERP PHY (clause 19) */
332 #define PHY_TYPE_BIT_OFDM BIT(PHY_TYPE_OFDM_INDEX) /* OFDM 5 GHz PHY (clause 17) */
333 #define PHY_TYPE_BIT_HT BIT(PHY_TYPE_HT_INDEX) /* HT PHY (clause 20) */
336 /* PHY TYPE set definitions */
337 #define PHY_TYPE_SET_802_11ABGN (PHY_TYPE_BIT_OFDM | \
338 PHY_TYPE_BIT_HR_DSSS | \
342 #define PHY_TYPE_SET_802_11BGN (PHY_TYPE_BIT_HR_DSSS | \
346 #define PHY_TYPE_SET_802_11GN (PHY_TYPE_BIT_ERP | \
349 #define PHY_TYPE_SET_802_11AN (PHY_TYPE_BIT_OFDM | \
352 #define PHY_TYPE_SET_802_11ABG (PHY_TYPE_BIT_OFDM | \
353 PHY_TYPE_BIT_HR_DSSS | \
356 #define PHY_TYPE_SET_802_11BG (PHY_TYPE_BIT_HR_DSSS | \
359 #define PHY_TYPE_SET_802_11A (PHY_TYPE_BIT_OFDM)
361 #define PHY_TYPE_SET_802_11G (PHY_TYPE_BIT_ERP)
363 #define PHY_TYPE_SET_802_11B (PHY_TYPE_BIT_HR_DSSS)
365 #define PHY_TYPE_SET_802_11N (PHY_TYPE_BIT_HT)
368 /* Rate set bit definitions */
369 #define RATE_SET_BIT_1M BIT(RATE_1M_INDEX) /* Bit 0: 1M */
370 #define RATE_SET_BIT_2M BIT(RATE_2M_INDEX) /* Bit 1: 2M */
371 #define RATE_SET_BIT_5_5M BIT(RATE_5_5M_INDEX) /* Bit 2: 5.5M */
372 #define RATE_SET_BIT_11M BIT(RATE_11M_INDEX) /* Bit 3: 11M */
373 #define RATE_SET_BIT_22M BIT(RATE_22M_INDEX) /* Bit 4: 22M */
374 #define RATE_SET_BIT_33M BIT(RATE_33M_INDEX) /* Bit 5: 33M */
375 #define RATE_SET_BIT_6M BIT(RATE_6M_INDEX) /* Bit 6: 6M */
376 #define RATE_SET_BIT_9M BIT(RATE_9M_INDEX) /* Bit 7: 9M */
377 #define RATE_SET_BIT_12M BIT(RATE_12M_INDEX) /* Bit 8: 12M */
378 #define RATE_SET_BIT_18M BIT(RATE_18M_INDEX) /* Bit 9: 18M */
379 #define RATE_SET_BIT_24M BIT(RATE_24M_INDEX) /* Bit 10: 24M */
380 #define RATE_SET_BIT_36M BIT(RATE_36M_INDEX) /* Bit 11: 36M */
381 #define RATE_SET_BIT_48M BIT(RATE_48M_INDEX) /* Bit 12: 48M */
382 #define RATE_SET_BIT_54M BIT(RATE_54M_INDEX) /* Bit 13: 54M */
383 #define RATE_SET_BIT_HT_PHY BIT(RATE_HT_PHY_INDEX) /* Bit 14: BSS Selector */
386 /* Rate set definitions */
387 #define RATE_SET_HR_DSSS (RATE_SET_BIT_1M | \
389 RATE_SET_BIT_5_5M | \
392 #define RATE_SET_ERP (RATE_SET_BIT_1M | \
394 RATE_SET_BIT_5_5M | \
405 #define RATE_SET_ERP_P2P (RATE_SET_BIT_6M | \
414 #define RATE_SET_OFDM (RATE_SET_BIT_6M | \
423 #define RATE_SET_HT (RATE_SET_ERP)
424 //#define RATE_SET_HT (RATE_SET_ERP | RATE_SET_BIT_HT_PHY) /* NOTE(Kevin): TBD */
427 #define RATE_SET_ALL_ABG RATE_SET_ERP
429 #define BASIC_RATE_SET_HR_DSSS (RATE_SET_BIT_1M | \
432 #define BASIC_RATE_SET_HR_DSSS_ERP (RATE_SET_BIT_1M | \
434 RATE_SET_BIT_5_5M | \
437 #define BASIC_RATE_SET_ERP (RATE_SET_BIT_1M | \
439 RATE_SET_BIT_5_5M | \
445 #define BASIC_RATE_SET_OFDM (RATE_SET_BIT_6M | \
449 #define BASIC_RATE_SET_ERP_P2P (RATE_SET_BIT_6M | \
453 #define INITIAL_RATE_SET_RCPI_100 RATE_SET_ALL_ABG
455 #define INITIAL_RATE_SET_RCPI_80 (RATE_SET_BIT_1M | \
457 RATE_SET_BIT_5_5M | \
464 #define INITIAL_RATE_SET_RCPI_60 (RATE_SET_BIT_1M | \
466 RATE_SET_BIT_5_5M | \
470 #define INITIAL_RATE_SET(_rcpi) (INITIAL_RATE_SET_ ## _rcpi)
472 #define RCPI_100 100 /* -60 dBm */
473 #define RCPI_80 80 /* -70 dBm */
474 #define RCPI_60 60 /* -80 dBm */
477 /* The number of RCPI records used to calculate their average value */
478 #define MAX_NUM_RCPI_RECORDS 10
480 /* The number of RCPI records used to calculate their average value */
481 #define NO_RCPI_RECORDS -128
482 #define MAX_RCPI_DBM 0
483 #define MIN_RCPI_DBM -100
486 #define MAC_TX_RESERVED_FIELD 0 /* NOTE(Kevin): Should defined in tx.h */
488 #define MAX_ASSOC_ID (CFG_STA_REC_NUM) /* Available AID: 1 ~ 20(STA_REC_NUM) */
491 #define MAX_DEAUTH_INFO_COUNT 4 /* NOTE(Kevin): Used in auth.c */
492 #define MIN_DEAUTH_INTERVAL_MSEC 500 /* The minimum interval if continuously send Deauth Frame */
494 /* Authentication Type */
495 #define AUTH_TYPE_OPEN_SYSTEM BIT(AUTH_ALGORITHM_NUM_OPEN_SYSTEM)
496 #define AUTH_TYPE_SHARED_KEY BIT(AUTH_ALGORITHM_NUM_SHARED_KEY)
497 #define AUTH_TYPE_FAST_BSS_TRANSITION BIT(AUTH_ALGORITHM_NUM_FAST_BSS_TRANSITION)
499 /* Authentication Retry Limit */
500 #define TX_AUTH_ASSOCI_RETRY_LIMIT 6
501 #define TX_AUTH_ASSOCI_RETRY_LIMIT_FOR_ROAMING 1
503 /* WMM-2.2.1 WMM Information Element */
504 #define ELEM_MAX_LEN_WMM_INFO 7
506 /*******************************************************************************
508 ********************************************************************************
510 typedef UINT_16 PHY_TYPE, *P_PHY_TYPE;
511 typedef UINT_8 RCPI, *P_RCPI;
512 typedef UINT_8 ALC_VAL, *P_ALC_VAL;
514 typedef enum _ENUM_HW_BSSID_T {
520 typedef enum _ENUM_HW_MAC_ADDR_T {
524 } ENUM_HW_MAC_ADDR_T;
526 typedef enum _ENUM_HW_OP_MODE_T {
533 typedef enum _ENUM_TSF_T {
537 } ENUM_LOCAL_TSF_T, *P_ENUM_LOCAL_TSF_T;
539 typedef enum _HAL_TS_HW_UPDATE_MODE {
540 HAL_TSF_HW_UPDATE_BY_TICK_AND_RECEIVED_FRAME,
541 HAL_TSF_HW_UPDATE_BY_TICK_ONLY,
542 HAL_TSF_HW_UPDATE_BY_RECEIVED_FRAME_ONLY,
543 HAL_TSF_HW_UPDATE_BY_TICK_AND_RECEIVED_FRAME_AD_HOC
544 } HAL_TSF_HW_UPDATE_MODE;
547 typedef enum _ENUM_AC_T {
553 } ENUM_AC_T, *P_ENUM_AC_T;
556 /* The Type of Network been activated */
557 typedef enum _ENUM_NETWORK_TYPE_INDEX_T {
558 NETWORK_TYPE_AIS_INDEX = 0,
559 NETWORK_TYPE_P2P_INDEX,
560 NETWORK_TYPE_BOW_INDEX,
561 NETWORK_TYPE_INDEX_NUM
562 } ENUM_NETWORK_TYPE_INDEX_T;
565 /* The Type of STA Type. */
566 typedef enum _ENUM_STA_TYPE_INDEX_T {
567 STA_TYPE_LEGACY_INDEX = 0,
572 ENUM_STA_TYPE_INDEX_T;
574 #define STA_ROLE_BASE_INDEX 4
576 typedef enum _ENUM_STA_ROLE_INDEX_T {
577 STA_ROLE_ADHOC_INDEX = STA_ROLE_BASE_INDEX, //4
578 STA_ROLE_CLIENT_INDEX,
581 } ENUM_STA_ROLE_INDEX_T;
583 /* The Power State of a specific Network */
584 typedef enum _ENUM_PWR_STATE_T {
591 typedef enum _ENUM_PHY_TYPE_INDEX_T {
592 //PHY_TYPE_DSSS_INDEX, /* DSSS PHY (clause 15) -- Not used anymore */
593 PHY_TYPE_HR_DSSS_INDEX = 0, /* HR/DSSS PHY (clause 18) */
594 PHY_TYPE_ERP_INDEX, /* ERP PHY (clause 19) */
595 PHY_TYPE_ERP_P2P_INDEX, /* ERP PHY (clause 19) w/o HR/DSSS */
596 PHY_TYPE_OFDM_INDEX, /* OFDM 5 GHz PHY (clause 17) */
597 PHY_TYPE_HT_INDEX, /* HT PHY (clause 20) */
598 PHY_TYPE_INDEX_NUM // 5
599 } ENUM_PHY_TYPE_INDEX_T, *P_ENUM_PHY_TYPE_INDEX_T;
601 typedef enum _ENUM_ACPI_STATE_T {
608 /* The operation mode of a specific Network */
609 typedef enum _ENUM_OP_MODE_T {
610 OP_MODE_INFRASTRUCTURE = 0, /* Infrastructure/GC */
611 OP_MODE_IBSS, /* AdHoc */
612 OP_MODE_ACCESS_POINT, /* For GO */
613 OP_MODE_P2P_DEVICE, /* P2P Device */
616 } ENUM_OP_MODE_T, *P_ENUM_OP_MODE_T;
618 typedef enum _ENUM_CHNL_EXT_T {
623 } ENUM_CHNL_EXT_T, *P_ENUM_CHNL_EXT_T;
625 /* This starting freq of the band is unit of kHz */
626 typedef enum _ENUM_BAND_T {
631 } ENUM_BAND_T, *P_ENUM_BAND_T;
633 /* Provide supported channel list to other components in array format */
634 typedef struct _RF_CHANNEL_INFO_T {
637 } RF_CHANNEL_INFO_T, *P_RF_CHANNEL_INFO_T;
639 typedef enum _ENUM_RATE_INDEX_T {
640 RATE_1M_INDEX = 0, /* 1M */
641 RATE_2M_INDEX, /* 2M */
642 RATE_5_5M_INDEX, /* 5.5M */
643 RATE_11M_INDEX, /* 11M */
644 RATE_22M_INDEX, /* 22M */
645 RATE_33M_INDEX, /* 33M */
646 RATE_6M_INDEX, /* 6M */
647 RATE_9M_INDEX, /* 9M */
648 RATE_12M_INDEX, /* 12M */
649 RATE_18M_INDEX, /* 18M */
650 RATE_24M_INDEX, /* 24M */
651 RATE_36M_INDEX, /* 36M */
652 RATE_48M_INDEX, /* 48M */
653 RATE_54M_INDEX, /* 54M */
654 RATE_HT_PHY_INDEX, /* BSS Selector - HT PHY */
656 } ENUM_RATE_INDEX_T, *P_ENUM_RATE_INDEX_T;
658 typedef enum _ENUM_HT_RATE_INDEX_T {
659 HT_RATE_MCS0_INDEX = 0,
669 } ENUM_HT_RATE_INDEX_T, *P_ENUM_HT_RATE_INDEX_T;
671 typedef enum _ENUM_PREMABLE_OPTION_T {
672 PREAMBLE_DEFAULT_LONG_NONE = 0, /* LONG for PHY_TYPE_HR_DSSS, NONE for PHY_TYPE_OFDM */
673 PREAMBLE_OPTION_SHORT, /* SHORT mandatory for PHY_TYPE_ERP, SHORT option for PHY_TYPE_HR_DSSS */
674 PREAMBLE_HT_MIXED_MODE,
675 PREAMBLE_HT_GREEN_FIELD,
677 } ENUM_PREMABLE_OPTION_T, *P_ENUM_PREMABLE_OPTION_T;
679 typedef enum _ENUM_MODULATION_SYSTEM_T {
680 MODULATION_SYSTEM_CCK = 0,
681 MODULATION_SYSTEM_OFDM,
682 MODULATION_SYSTEM_HT20,
683 MODULATION_SYSTEM_HT40,
684 MODULATION_SYSTEM_NUM
685 } ENUM_MODULATION_SYSTEM_T, *P_ENUM_MODULATION_SYSTEM_T;
687 typedef enum _ENUM_MODULATION_TYPE_T {
688 MODULATION_TYPE_CCK_BPSK = 0,
689 MODULATION_TYPE_QPSK,
690 MODULATION_TYPE_16QAM,
691 MODULATION_TYPE_64QAM,
693 } ENUM_MODULATION_TYPE_T, *P_ENUM_MODULATION_TYPE_T;
695 typedef enum _ENUM_PS_FORWARDING_TYPE_T {
696 PS_FORWARDING_TYPE_NON_PS = 0,
697 PS_FORWARDING_TYPE_DELIVERY_ENABLED,
698 PS_FORWARDING_TYPE_NON_DELIVERY_ENABLED,
699 PS_FORWARDING_MORE_DATA_ENABLED,
700 PS_FORWARDING_TYPE_NUM
701 } ENUM_PS_FORWARDING_TYPE_T, *P_ENUM_PS_FORWARDING_TYPE_T;
703 typedef struct _DEAUTH_INFO_T {
704 UINT_8 aucRxAddr[MAC_ADDR_LEN];
705 OS_SYSTIME rLastSendTime;
706 } DEAUTH_INFO_T, *P_DEAUTH_INFO_T;
708 /*----------------------------------------------------------------------------*/
709 /* Information Element (IE) handlers */
710 /*----------------------------------------------------------------------------*/
711 typedef VOID (*PFN_APPEND_IE_FUNC)(P_ADAPTER_T, P_MSDU_INFO_T);
712 typedef VOID (*PFN_HANDLE_IE_FUNC)(P_ADAPTER_T, P_SW_RFB_T, P_IE_HDR_T);
713 typedef VOID (*PFN_VERIFY_IE_FUNC)(P_ADAPTER_T, P_SW_RFB_T, P_IE_HDR_T, PUINT_16);
714 typedef UINT_32 (*PFN_CALCULATE_VAR_IE_LEN_FUNC)(P_ADAPTER_T, ENUM_NETWORK_TYPE_INDEX_T, P_STA_RECORD_T);
716 typedef struct _APPEND_IE_ENTRY_T {
717 UINT_16 u2EstimatedIELen;
718 PFN_APPEND_IE_FUNC pfnAppendIE;
719 } APPEND_IE_ENTRY_T, *P_APPEND_IE_ENTRY_T;
721 typedef struct _APPEND_VAR_IE_ENTRY_T {
722 UINT_16 u2EstimatedFixedIELen; /* For Fixed Length */
723 PFN_CALCULATE_VAR_IE_LEN_FUNC pfnCalculateVariableIELen;
724 PFN_APPEND_IE_FUNC pfnAppendIE;
725 } APPEND_VAR_IE_ENTRY_T, *P_APPEND_VAR_IE_ENTRY_T;
727 typedef struct _HANDLE_IE_ENTRY_T {
729 PFN_HANDLE_IE_FUNC pfnHandleIE;
730 } HANDLE_IE_ENTRY_T, *P_HANDLE_IE_ENTRY_T;
732 typedef struct _VERIFY_IE_ENTRY_T {
734 PFN_VERIFY_IE_FUNC pfnVarifyIE;
735 } VERIFY_IE_ENTRY_T, *P_VERIFY_IE_ENTRY_T;
737 /*----------------------------------------------------------------------------*/
738 /* Parameters of User Configuration */
739 /*----------------------------------------------------------------------------*/
740 typedef enum _ENUM_PARAM_CONNECTION_POLICY_T {
741 CONNECT_BY_SSID_BEST_RSSI = 0,
742 CONNECT_BY_SSID_GOOD_RSSI_MIN_CH_LOAD,
743 CONNECT_BY_SSID_ANY, /* NOTE(Kevin): Needed by WHQL */
745 CONNECT_BY_CUSTOMIZED_RULE /* NOTE(Kevin): TBD */
746 } ENUM_PARAM_CONNECTION_POLICY_T, *P_ENUM_PARAM_CONNECTION_POLICY_T;
748 typedef enum _ENUM_PARAM_PREAMBLE_TYPE_T {
749 PREAMBLE_TYPE_LONG = 0,
751 PREAMBLE_TYPE_AUTO /*!< Try preamble short first, if fail tray preamble long. */
752 } ENUM_PARAM_PREAMBLE_TYPE_T, *P_ENUM_PARAM_PREAMBLE_TYPE_T;
754 /* This is enum defined for user to select a phy config listed in combo box */
755 typedef enum _ENUM_PARAM_PHY_CONFIG_T {
756 PHY_CONFIG_802_11ABG = 0, /*!< Can associated with 802.11abg AP but without n capability, Scan dual band. */
757 PHY_CONFIG_802_11BG, /*!< Can associated with 802_11bg AP, Scan single band and not report 5G BSSs. */
758 PHY_CONFIG_802_11G, /*!< Can associated with 802_11g only AP, Scan single band and not report 5G BSSs. */
759 PHY_CONFIG_802_11A, /*!< Can associated with 802_11a only AP, Scan single band and not report 2.4G BSSs. */
760 PHY_CONFIG_802_11B, /*!< Can associated with 802_11b only AP, Scan single band and not report 5G BSSs. */
761 PHY_CONFIG_802_11ABGN, /*!< Can associated with 802.11abgn AP, Scan dual band. */
762 PHY_CONFIG_802_11BGN, /*!< Can associated with 802_11bgn AP, Scan single band and not report 5G BSSs. */
763 PHY_CONFIG_802_11AN, /*!< Can associated with 802_11an AP, Scan single band and not report 2.4G BSSs. */
764 PHY_CONFIG_802_11GN, /*!< Can associated with 802_11gn AP, Scan single band and not report 5G BSSs. */
766 } ENUM_PARAM_PHY_CONFIG_T, *P_ENUM_PARAM_PHY_CONFIG_T;
768 /* This is enum defined for user to select an AP Mode */
769 typedef enum _ENUM_PARAM_AP_MODE_T {
770 AP_MODE_11B = 0, /*!< Create 11b BSS if we support 802.11abg/802.11bg. */
771 AP_MODE_MIXED_11BG, /*!< Create 11bg mixed BSS if we support 802.11abg/802.11bg/802.11g. */
772 AP_MODE_11G, /*!< Create 11g only BSS if we support 802.11abg/802.11bg/802.11g. */
773 AP_MODE_11G_P2P, /*!< Create 11g only BSS for P2P if we support 802.11abg/802.11bg/802.11g. */
774 AP_MODE_11A, /*!< Create 11a only BSS if we support 802.11abg. */
776 } ENUM_PARAM_AP_MODE_T, *P_ENUM_PARAM_AP_MODE_T;
779 /* Masks for determining the Network Type or the Station Role, given the ENUM_STA_TYPE_T */
780 #define NETWORK_TYPE_AIS_MASK BIT(NETWORK_TYPE_AIS_INDEX)
781 #define NETWORK_TYPE_P2P_MASK BIT(NETWORK_TYPE_P2P_INDEX)
782 #define NETWORK_TYPE_BOW_MASK BIT(NETWORK_TYPE_BOW_INDEX)
783 #define STA_TYPE_LEGACY_MASK BIT(STA_TYPE_LEGACY_INDEX)
784 #define STA_TYPE_P2P_MASK BIT(STA_TYPE_P2P_INDEX)
785 #define STA_TYPE_BOW_MASK BIT(STA_TYPE_BOW_INDEX)
786 #define STA_TYPE_ADHOC_MASK BIT(STA_ROLE_ADHOC_INDEX)
787 #define STA_TYPE_CLIENT_MASK BIT(STA_ROLE_CLIENT_INDEX)
788 #define STA_TYPE_AP_MASK BIT(STA_ROLE_AP_INDEX)
789 #define STA_TYPE_DLS_MASK BIT(STA_ROLE_DLS_INDEX)
791 /* Macros for obtaining the Network Type or the Station Role, given the ENUM_STA_TYPE_T */
792 #define IS_STA_IN_AIS(_prStaRec) ((_prStaRec)->ucNetTypeIndex == NETWORK_TYPE_AIS_INDEX)
793 #define IS_STA_IN_P2P(_prStaRec) ((_prStaRec)->ucNetTypeIndex == NETWORK_TYPE_P2P_INDEX)
794 #define IS_STA_IN_BOW(_prStaRec) ((_prStaRec)->ucNetTypeIndex == NETWORK_TYPE_BOW_INDEX)
795 #define IS_STA_LEGACY_TYPE(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_LEGACY_MASK)
796 #define IS_STA_P2P_TYPE(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_P2P_MASK)
797 #define IS_STA_BOW_TYPE(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_BOW_MASK)
798 #define IS_ADHOC_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_ADHOC_MASK)
799 #define IS_CLIENT_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_CLIENT_MASK)
800 #define IS_AP_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_AP_MASK)
801 #define IS_DLS_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_DLS_MASK)
803 /* The ENUM_STA_TYPE_T accounts for ENUM_NETWORK_TYPE_T and ENUM_STA_ROLE_INDEX_T.
804 * * It is a merged version of Network Type and STA Role.
806 typedef enum _ENUM_STA_TYPE_T {
807 STA_TYPE_LEGACY_AP = (STA_TYPE_LEGACY_MASK | STA_TYPE_AP_MASK),
808 STA_TYPE_LEGACY_CLIENT = (STA_TYPE_LEGACY_MASK | STA_TYPE_CLIENT_MASK),
809 STA_TYPE_ADHOC_PEER = (STA_TYPE_LEGACY_MASK | STA_TYPE_ADHOC_MASK),
810 #if CFG_ENABLE_WIFI_DIRECT
811 STA_TYPE_P2P_GO = (STA_TYPE_P2P_MASK | STA_TYPE_AP_MASK),
812 STA_TYPE_P2P_GC = (STA_TYPE_P2P_MASK | STA_TYPE_CLIENT_MASK),
814 #if CFG_ENABLE_BT_OVER_WIFI
815 STA_TYPE_BOW_AP = (STA_TYPE_BOW_MASK | STA_TYPE_AP_MASK),
816 STA_TYPE_BOW_CLIENT = (STA_TYPE_BOW_MASK | STA_TYPE_CLIENT_MASK),
818 STA_TYPE_DLS_PEER = (STA_TYPE_LEGACY_MASK | STA_TYPE_DLS_MASK)
819 } ENUM_STA_TYPE_T, *P_ENUM_STA_TYPE_T;
821 /* The type of BSS we discovered */
822 typedef enum _ENUM_BSS_TYPE_T {
823 BSS_TYPE_INFRASTRUCTURE = 1,
828 } ENUM_BSS_TYPE_T, *P_ENUM_BSS_TYPE_T;
830 /*----------------------------------------------------------------------------*/
832 /*----------------------------------------------------------------------------*/
833 //#if defined(WINDOWS_DDK) || defined(WINDOWS_CE)
837 #define MAX_NUM_SUPPORTED_CIPHER_SUITES 8 /* max number of supported cipher suites */
838 #if CFG_SUPPORT_802_11W
839 #define MAX_NUM_SUPPORTED_AKM_SUITES 8 /* max number of supported AKM suites */
841 #define MAX_NUM_SUPPORTED_AKM_SUITES 6 /* max number of supported AKM suites */
844 /* Structure of RSN Information */
845 typedef struct _RSN_INFO_T {
848 UINT_32 u4GroupKeyCipherSuite;
849 UINT_32 u4PairwiseKeyCipherSuiteCount;
850 UINT_32 au4PairwiseKeyCipherSuite[MAX_NUM_SUPPORTED_CIPHER_SUITES];
851 UINT_32 u4AuthKeyMgtSuiteCount;
852 UINT_32 au4AuthKeyMgtSuite[MAX_NUM_SUPPORTED_AKM_SUITES];
854 BOOLEAN fgRsnCapPresent;
855 } /*__KAL_ATTRIB_PACKED__*/ RSN_INFO_T, *P_RSN_INFO_T;
857 #define MAX_NUM_SUPPORTED_WAPI_AKM_SUITES 1 /* max number of supported AKM suites */
858 #define MAX_NUM_SUPPORTED_WAPI_CIPHER_SUITES 1 /* max number of supported cipher suites */
860 /* Structure of WAPI Information */
861 typedef struct _WAPI_INFO_T {
865 UINT_32 u4AuthKeyMgtSuiteCount;
866 UINT_32 au4AuthKeyMgtSuite[MAX_NUM_SUPPORTED_WAPI_AKM_SUITES];
867 UINT_32 u4PairwiseKeyCipherSuiteCount;
868 UINT_32 au4PairwiseKeyCipherSuite[MAX_NUM_SUPPORTED_WAPI_CIPHER_SUITES];
869 UINT_32 u4GroupKeyCipherSuite;
872 UINT_8 aucBkid[1][16];
873 } /* __KAL_ATTRIB_PACKED__*/ WAPI_INFO_T, *P_WAPI_INFO_T;
875 //#if defined(WINDOWS_DDK) || defined(WINDOWS_CE)
880 #if CFG_ENABLE_WIFI_DIRECT
882 typedef struct _P2P_DEVICE_TYPE_T {
883 UINT_16 u2CategoryID;
884 UINT_16 u2SubCategoryID;
885 } P2P_DEVICE_TYPE_T, *P_P2P_DEVICE_TYPE_T;
887 typedef struct _P2P_DEVICE_DESC_T {
888 LINK_ENTRY_T rLinkEntry;
889 BOOLEAN fgDevInfoValid;
890 UINT_8 aucDeviceAddr[MAC_ADDR_LEN]; /* Device Address. */
891 UINT_8 aucInterfaceAddr[MAC_ADDR_LEN]; /* Interface Address. */
892 UINT_8 ucDeviceCapabilityBitmap;
893 UINT_8 ucGroupCapabilityBitmap;
894 UINT_16 u2ConfigMethod; /* Configure Method support. */
895 P2P_DEVICE_TYPE_T rPriDevType;
896 UINT_8 ucSecDevTypeNum;
897 P2P_DEVICE_TYPE_T arSecDevType[8]; // Reference to P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT
898 UINT_16 u2NameLength;
899 UINT_8 aucName[32]; // Reference to WPS_ATTRI_MAX_LEN_DEVICE_NAME
900 // TODO: Service Information or PasswordID valid?
901 } P2P_DEVICE_DESC_T, *P_P2P_DEVICE_DESC_T;
906 /*******************************************************************************
907 * P U B L I C D A T A
908 ********************************************************************************
911 /*******************************************************************************
912 * P R I V A T E D A T A
913 ********************************************************************************
915 static const UINT_8 aucRateIndex2RateCode[PREAMBLE_OPTION_NUM][RATE_NUM] = {
916 { /* Long Preamble */
917 RATE_CCK_1M_LONG, /* RATE_1M_INDEX = 0 */
918 RATE_CCK_2M_LONG, /* RATE_2M_INDEX */
919 RATE_CCK_5_5M_LONG, /* RATE_5_5M_INDEX */
920 RATE_CCK_11M_LONG, /* RATE_11M_INDEX */
921 RATE_CCK_1M_LONG, /* RATE_22M_INDEX - Not supported */
922 RATE_CCK_1M_LONG, /* RATE_33M_INDEX - Not supported */
923 RATE_OFDM_6M, /* RATE_6M_INDEX */
924 RATE_OFDM_9M, /* RATE_9M_INDEX */
925 RATE_OFDM_12M, /* RATE_12M_INDEX */
926 RATE_OFDM_18M, /* RATE_18M_INDEX */
927 RATE_OFDM_24M, /* RATE_24M_INDEX */
928 RATE_OFDM_36M, /* RATE_36M_INDEX */
929 RATE_OFDM_48M, /* RATE_48M_INDEX */
930 RATE_OFDM_54M, /* RATE_54M_INDEX */
932 { /* Short Preamble */
933 RATE_CCK_1M_LONG, /* RATE_1M_INDEX = 0 */
934 RATE_CCK_2M_SHORT, /* RATE_2M_INDEX */
935 RATE_CCK_5_5M_SHORT, /* RATE_5_5M_INDEX */
936 RATE_CCK_11M_SHORT, /* RATE_11M_INDEX */
937 RATE_CCK_1M_LONG, /* RATE_22M_INDEX - Not supported */
938 RATE_CCK_1M_LONG, /* RATE_33M_INDEX - Not supported */
939 RATE_OFDM_6M, /* RATE_6M_INDEX */
940 RATE_OFDM_9M, /* RATE_9M_INDEX */
941 RATE_OFDM_12M, /* RATE_12M_INDEX */
942 RATE_OFDM_18M, /* RATE_18M_INDEX */
943 RATE_OFDM_24M, /* RATE_24M_INDEX */
944 RATE_OFDM_36M, /* RATE_36M_INDEX */
945 RATE_OFDM_48M, /* RATE_48M_INDEX */
946 RATE_OFDM_54M, /* RATE_54M_INDEX */
948 { /* Mixed Mode(Option) */
949 RATE_MM_MCS_0, /* RATE_MCS0_INDEX, */
950 RATE_MM_MCS_1, /* RATE_MCS1_INDEX, */
951 RATE_MM_MCS_2, /* RATE_MCS2_INDEX, */
952 RATE_MM_MCS_3, /* RATE_MCS3_INDEX, */
953 RATE_MM_MCS_4, /* RATE_MCS4_INDEX, */
954 RATE_MM_MCS_5, /* RATE_MCS5_INDEX, */
955 RATE_MM_MCS_6, /* RATE_MCS6_INDEX, */
956 RATE_MM_MCS_7, /* RATE_MCS7_INDEX, */
957 RATE_MM_MCS_32 /* RATE_MCS32_INDEX, */
959 { /* Green Field(Option) */
960 RATE_GF_MCS_0, /* RATE_MCS0_INDEX, */
961 RATE_GF_MCS_1, /* RATE_MCS1_INDEX, */
962 RATE_GF_MCS_2, /* RATE_MCS2_INDEX, */
963 RATE_GF_MCS_3, /* RATE_MCS3_INDEX, */
964 RATE_GF_MCS_4, /* RATE_MCS4_INDEX, */
965 RATE_GF_MCS_5, /* RATE_MCS5_INDEX, */
966 RATE_GF_MCS_6, /* RATE_MCS6_INDEX, */
967 RATE_GF_MCS_7, /* RATE_MCS7_INDEX, */
968 RATE_GF_MCS_32 /* RATE_MCS32_INDEX, */
972 static const UINT_8 aucRateTableSize[PREAMBLE_OPTION_NUM] = {
980 /*******************************************************************************
982 ********************************************************************************
984 /* Macros to get and set the wireless LAN frame fields those are 16/32 bits in
986 #define WLAN_GET_FIELD_16(_memAddr_p, _value_p) \
988 PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
989 *(PUINT_16)(_value_p) = ((UINT_16) __cp[0]) | ((UINT_16) __cp[1] << 8); \
992 #define WLAN_GET_FIELD_BE16(_memAddr_p, _value_p) \
994 PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
995 *(PUINT_16)(_value_p) = ((UINT_16) __cp[0] << 8) | ((UINT_16) __cp[1]); \
998 #define WLAN_GET_FIELD_32(_memAddr_p, _value_p) \
1000 PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
1001 *(PUINT_32)(_value_p) = ((UINT_32) __cp[0]) | ((UINT_32) __cp[1] << 8) | \
1002 ((UINT_32) __cp[2] << 16) | ((UINT_32) __cp[3] << 24); \
1005 #define WLAN_GET_FIELD_64(_memAddr_p, _value_p) \
1007 PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
1008 *(PUINT_64)(_value_p) = \
1009 ((UINT_64) __cp[0]) | ((UINT_64) __cp[1] << 8) | \
1010 ((UINT_64) __cp[2] << 16) | ((UINT_64) __cp[3] << 24) | \
1011 ((UINT_64) __cp[4] << 32) | ((UINT_64) __cp[5] << 40) | \
1012 ((UINT_64) __cp[6] << 48) | ((UINT_64) __cp[7] << 56); \
1015 #define WLAN_SET_FIELD_16(_memAddr_p, _value) \
1017 PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
1018 __cp[0] = (UINT_8) (_value); \
1019 __cp[1] = (UINT_8) ((_value) >> 8); \
1022 #define WLAN_SET_FIELD_BE16(_memAddr_p, _value) \
1024 PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
1025 __cp[0] = (UINT_8) ((_value) >> 8); \
1026 __cp[1] = (UINT_8) (_value); \
1029 #define WLAN_SET_FIELD_32(_memAddr_p, _value) \
1031 PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
1032 __cp[0] = (UINT_8) (_value); \
1033 __cp[1] = (UINT_8) ((_value) >> 8); \
1034 __cp[2] = (UINT_8) ((_value) >> 16); \
1035 __cp[3] = (UINT_8) ((_value) >> 24); \
1040 /*******************************************************************************
1041 * F U N C T I O N D E C L A R A T I O N S
1042 ********************************************************************************
1046 /*******************************************************************************
1048 ********************************************************************************
1051 #endif /* _WLAN_DEF_H */