1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 ******************************************************************************/
20 #ifndef __WLAN_BSSDEF_H__
21 #define __WLAN_BSSDEF_H__
29 #define NDIS_802_11_LENGTH_SSID 32
30 #define NDIS_802_11_LENGTH_RATES 8
31 #define NDIS_802_11_LENGTH_RATES_EX 16
33 typedef unsigned char NDIS_802_11_MAC_ADDRESS[6];
34 typedef long NDIS_802_11_RSSI; /* in dBm */
35 typedef unsigned char NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES]; /* Set of 8 data rates */
36 typedef unsigned char NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX]; /* Set of 16 data rates */
39 typedef ULONG NDIS_802_11_KEY_INDEX;
40 typedef unsigned long long NDIS_802_11_KEY_RSC;
43 typedef struct _NDIS_802_11_SSID {
46 } NDIS_802_11_SSID, *PNDIS_802_11_SSID;
48 typedef enum _NDIS_802_11_NETWORK_TYPE {
53 Ndis802_11NetworkTypeMax /* not a real type, defined as an upper bound */
54 } NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE;
56 typedef struct _NDIS_802_11_CONFIGURATION_FH {
57 ULONG Length; /* Length of structure */
58 ULONG HopPattern; /* As defined by 802.11, MSB set */
59 ULONG HopSet; /* to one if non-802.11 */
60 ULONG DwellTime; /* units are Kusec */
61 } NDIS_802_11_CONFIGURATION_FH, *PNDIS_802_11_CONFIGURATION_FH;
65 FW will only save the channel number in DSConfig.
66 ODI Handler will convert the channel number to freq. number.
68 typedef struct _NDIS_802_11_CONFIGURATION {
69 ULONG Length; /* Length of structure */
70 ULONG BeaconPeriod; /* units are Kusec */
71 ULONG ATIMWindow; /* units are Kusec */
72 ULONG DSConfig; /* channel number */
73 NDIS_802_11_CONFIGURATION_FH FHConfig;
74 } NDIS_802_11_CONFIGURATION, *PNDIS_802_11_CONFIGURATION;
78 typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE {
80 Ndis802_11Infrastructure,
81 Ndis802_11AutoUnknown,
82 Ndis802_11InfrastructureMax, /* Not a real value, defined as upper bound */
85 } NDIS_802_11_NETWORK_INFRASTRUCTURE, *PNDIS_802_11_NETWORK_INFRASTRUCTURE;
91 typedef struct _NDIS_802_11_FIXED_IEs {
93 USHORT BeaconInterval;
95 } NDIS_802_11_FIXED_IEs, *PNDIS_802_11_FIXED_IEs;
99 typedef struct _NDIS_802_11_VARIABLE_IEs {
103 } NDIS_802_11_VARIABLE_IEs, *PNDIS_802_11_VARIABLE_IEs;
111 Length is the 4 bytes multiples of the sume of
112 sizeof (NDIS_802_11_MAC_ADDRESS) + 2 + sizeof (NDIS_802_11_SSID) + sizeof (ULONG)
113 + sizeof (NDIS_802_11_RSSI) + sizeof (NDIS_802_11_NETWORK_TYPE) + sizeof (NDIS_802_11_CONFIGURATION)
114 + sizeof (NDIS_802_11_RATES_EX) + IELength
116 Except the IELength, all other fields are fixed length. Therefore, we can define a marco to present the
121 typedef struct _NDIS_WLAN_BSSID_EX {
123 NDIS_802_11_MAC_ADDRESS MacAddress;
124 UCHAR Reserved[2];/* [0]: IS beacon frame, [1]:optimum_antenna=>For antenna diversity; */
125 NDIS_802_11_SSID Ssid;
127 NDIS_802_11_RSSI Rssi;
128 NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
129 NDIS_802_11_CONFIGURATION Configuration;
130 NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
131 NDIS_802_11_RATES_EX SupportedRates;
133 UCHAR IEs[MAX_IE_SZ]; /* (timestamp, beacon interval, and capability information) */
134 } NDIS_WLAN_BSSID_EX, *PNDIS_WLAN_BSSID_EX;
137 typedef struct _NDIS_802_11_BSSID_LIST_EX {
139 NDIS_WLAN_BSSID_EX Bssid[1];
140 } NDIS_802_11_BSSID_LIST_EX, *PNDIS_802_11_BSSID_LIST_EX;
143 typedef enum _NDIS_802_11_AUTHENTICATION_MODE {
144 Ndis802_11AuthModeOpen,
145 Ndis802_11AuthModeShared,
146 Ndis802_11AuthModeAutoSwitch,
147 Ndis802_11AuthModeWPA,
148 Ndis802_11AuthModeWPAPSK,
149 Ndis802_11AuthModeWPANone,
150 Ndis802_11AuthModeWAPI,
151 Ndis802_11AuthModeMax /* Not a real mode, defined as upper bound */
152 } NDIS_802_11_AUTHENTICATION_MODE, *PNDIS_802_11_AUTHENTICATION_MODE;
154 typedef enum _NDIS_802_11_WEP_STATUS {
155 Ndis802_11WEPEnabled,
156 Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
157 Ndis802_11WEPDisabled,
158 Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
159 Ndis802_11WEPKeyAbsent,
160 Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
161 Ndis802_11WEPNotSupported,
162 Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
163 Ndis802_11Encryption2Enabled,
164 Ndis802_11Encryption2KeyAbsent,
165 Ndis802_11Encryption3Enabled,
166 Ndis802_11Encryption3KeyAbsent,
167 Ndis802_11_EncrypteionWAPI
168 } NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS,
169 NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS;
172 #define NDIS_802_11_AI_REQFI_CAPABILITIES 1
173 #define NDIS_802_11_AI_REQFI_LISTENINTERVAL 2
174 #define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS 4
176 #define NDIS_802_11_AI_RESFI_CAPABILITIES 1
177 #define NDIS_802_11_AI_RESFI_STATUSCODE 2
178 #define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4
180 typedef struct _NDIS_802_11_AI_REQFI {
182 USHORT ListenInterval;
183 NDIS_802_11_MAC_ADDRESS CurrentAPAddress;
184 } NDIS_802_11_AI_REQFI, *PNDIS_802_11_AI_REQFI;
186 typedef struct _NDIS_802_11_AI_RESFI {
189 USHORT AssociationId;
190 } NDIS_802_11_AI_RESFI, *PNDIS_802_11_AI_RESFI;
192 typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION {
194 USHORT AvailableRequestFixedIEs;
195 NDIS_802_11_AI_REQFI RequestFixedIEs;
196 ULONG RequestIELength;
197 ULONG OffsetRequestIEs;
198 USHORT AvailableResponseFixedIEs;
199 NDIS_802_11_AI_RESFI ResponseFixedIEs;
200 ULONG ResponseIELength;
201 ULONG OffsetResponseIEs;
202 } NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION;
204 typedef enum _NDIS_802_11_RELOAD_DEFAULTS {
205 Ndis802_11ReloadWEPKeys
206 } NDIS_802_11_RELOAD_DEFAULTS, *PNDIS_802_11_RELOAD_DEFAULTS;
209 /* Key mapping keys require a BSSID */
210 typedef struct _NDIS_802_11_KEY {
211 ULONG Length; /* Length of this structure */
213 ULONG KeyLength; /* length of key in bytes */
214 NDIS_802_11_MAC_ADDRESS BSSID;
215 NDIS_802_11_KEY_RSC KeyRSC;
216 UCHAR KeyMaterial[32]; /* variable length depending on above field */
217 } NDIS_802_11_KEY, *PNDIS_802_11_KEY;
219 typedef struct _NDIS_802_11_REMOVE_KEY {
220 ULONG Length; /* Length of this structure */
222 NDIS_802_11_MAC_ADDRESS BSSID;
223 } NDIS_802_11_REMOVE_KEY, *PNDIS_802_11_REMOVE_KEY;
225 typedef struct _NDIS_802_11_WEP {
226 ULONG Length; /* Length of this structure */
227 ULONG KeyIndex; /* 0 is the per-client key, 1-N are the global keys */
228 ULONG KeyLength; /* length of key in bytes */
229 UCHAR KeyMaterial[16];/* variable length depending on above field */
230 } NDIS_802_11_WEP, *PNDIS_802_11_WEP;
232 typedef struct _NDIS_802_11_AUTHENTICATION_REQUEST {
233 ULONG Length; /* Length of structure */
234 NDIS_802_11_MAC_ADDRESS Bssid;
236 } NDIS_802_11_AUTHENTICATION_REQUEST, *PNDIS_802_11_AUTHENTICATION_REQUEST;
238 typedef enum _NDIS_802_11_STATUS_TYPE {
239 Ndis802_11StatusType_Authentication,
240 Ndis802_11StatusType_MediaStreamMode,
241 Ndis802_11StatusType_PMKID_CandidateList,
242 Ndis802_11StatusTypeMax /* not a real type, defined as an upper bound */
243 } NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE;
245 typedef struct _NDIS_802_11_STATUS_INDICATION {
246 NDIS_802_11_STATUS_TYPE StatusType;
247 } NDIS_802_11_STATUS_INDICATION, *PNDIS_802_11_STATUS_INDICATION;
249 /* mask for authentication/integrity fields */
250 #define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS 0x0f
251 #define NDIS_802_11_AUTH_REQUEST_REAUTH 0x01
252 #define NDIS_802_11_AUTH_REQUEST_KEYUPDATE 0x02
253 #define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR 0x06
254 #define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E
256 /* MIC check time, 60 seconds. */
257 #define MIC_CHECK_TIME 60000000
259 typedef struct _NDIS_802_11_AUTHENTICATION_EVENT {
260 NDIS_802_11_STATUS_INDICATION Status;
261 NDIS_802_11_AUTHENTICATION_REQUEST Request[1];
262 } NDIS_802_11_AUTHENTICATION_EVENT, *PNDIS_802_11_AUTHENTICATION_EVENT;
264 typedef struct _NDIS_802_11_TEST {
268 NDIS_802_11_AUTHENTICATION_EVENT AuthenticationEvent;
269 NDIS_802_11_RSSI RssiTrigger;
271 } NDIS_802_11_TEST, *PNDIS_802_11_TEST;
274 #endif /* end of #ifdef PLATFORM_LINUX */
276 #ifdef PLATFORM_FREEBSD
278 #define NDIS_802_11_LENGTH_SSID 32
279 #define NDIS_802_11_LENGTH_RATES 8
280 #define NDIS_802_11_LENGTH_RATES_EX 16
282 typedef unsigned char NDIS_802_11_MAC_ADDRESS[6];
283 typedef long NDIS_802_11_RSSI; /* in dBm */
284 typedef unsigned char NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES]; /* Set of 8 data rates */
285 typedef unsigned char NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX]; /* Set of 16 data rates */
288 typedef ULONG NDIS_802_11_KEY_INDEX;
289 typedef unsigned long long NDIS_802_11_KEY_RSC;
292 typedef struct _NDIS_802_11_SSID {
295 } NDIS_802_11_SSID, *PNDIS_802_11_SSID;
297 typedef enum _NDIS_802_11_NETWORK_TYPE {
302 Ndis802_11NetworkTypeMax /* not a real type, defined as an upper bound */
303 } NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE;
305 typedef struct _NDIS_802_11_CONFIGURATION_FH {
306 ULONG Length; /* Length of structure */
307 ULONG HopPattern; /* As defined by 802.11, MSB set */
308 ULONG HopSet; /* to one if non-802.11 */
309 ULONG DwellTime; /* units are Kusec */
310 } NDIS_802_11_CONFIGURATION_FH, *PNDIS_802_11_CONFIGURATION_FH;
314 FW will only save the channel number in DSConfig.
315 ODI Handler will convert the channel number to freq. number.
317 typedef struct _NDIS_802_11_CONFIGURATION {
318 ULONG Length; /* Length of structure */
319 ULONG BeaconPeriod; /* units are Kusec */
320 ULONG ATIMWindow; /* units are Kusec */
321 ULONG DSConfig; /* channel number */
322 NDIS_802_11_CONFIGURATION_FH FHConfig;
323 } NDIS_802_11_CONFIGURATION, *PNDIS_802_11_CONFIGURATION;
327 typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE {
329 Ndis802_11Infrastructure,
330 Ndis802_11AutoUnknown,
331 Ndis802_11InfrastructureMax, /* Not a real value, defined as upper bound */
333 } NDIS_802_11_NETWORK_INFRASTRUCTURE, *PNDIS_802_11_NETWORK_INFRASTRUCTURE;
339 typedef struct _NDIS_802_11_FIXED_IEs {
341 USHORT BeaconInterval;
343 } NDIS_802_11_FIXED_IEs, *PNDIS_802_11_FIXED_IEs;
347 typedef struct _NDIS_802_11_VARIABLE_IEs {
351 } NDIS_802_11_VARIABLE_IEs, *PNDIS_802_11_VARIABLE_IEs;
359 Length is the 4 bytes multiples of the sume of
360 sizeof (NDIS_802_11_MAC_ADDRESS) + 2 + sizeof (NDIS_802_11_SSID) + sizeof (ULONG)
361 + sizeof (NDIS_802_11_RSSI) + sizeof (NDIS_802_11_NETWORK_TYPE) + sizeof (NDIS_802_11_CONFIGURATION)
362 + sizeof (NDIS_802_11_RATES_EX) + IELength
364 Except the IELength, all other fields are fixed length. Therefore, we can define a marco to present the
369 typedef struct _NDIS_WLAN_BSSID_EX {
371 NDIS_802_11_MAC_ADDRESS MacAddress;
372 UCHAR Reserved[2];/* [0]: IS beacon frame, [1]:optimum_antenna=>For antenna diversity; */
373 NDIS_802_11_SSID Ssid;
375 NDIS_802_11_RSSI Rssi;
376 NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
377 NDIS_802_11_CONFIGURATION Configuration;
378 NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
379 NDIS_802_11_RATES_EX SupportedRates;
381 UCHAR IEs[MAX_IE_SZ]; /* (timestamp, beacon interval, and capability information) */
382 } NDIS_WLAN_BSSID_EX, *PNDIS_WLAN_BSSID_EX;
385 typedef struct _NDIS_802_11_BSSID_LIST_EX {
387 NDIS_WLAN_BSSID_EX Bssid[1];
388 } NDIS_802_11_BSSID_LIST_EX, *PNDIS_802_11_BSSID_LIST_EX;
391 typedef enum _NDIS_802_11_AUTHENTICATION_MODE {
392 Ndis802_11AuthModeOpen,
393 Ndis802_11AuthModeShared,
394 Ndis802_11AuthModeAutoSwitch,
395 Ndis802_11AuthModeWPA,
396 Ndis802_11AuthModeWPAPSK,
397 Ndis802_11AuthModeWPANone,
398 Ndis802_11AuthModeMax /* Not a real mode, defined as upper bound */
399 } NDIS_802_11_AUTHENTICATION_MODE, *PNDIS_802_11_AUTHENTICATION_MODE;
401 typedef enum _NDIS_802_11_WEP_STATUS {
402 Ndis802_11WEPEnabled,
403 Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
404 Ndis802_11WEPDisabled,
405 Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
406 Ndis802_11WEPKeyAbsent,
407 Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
408 Ndis802_11WEPNotSupported,
409 Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
410 Ndis802_11Encryption2Enabled,
411 Ndis802_11Encryption2KeyAbsent,
412 Ndis802_11Encryption3Enabled,
413 Ndis802_11Encryption3KeyAbsent
414 } NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS,
415 NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS;
418 #define NDIS_802_11_AI_REQFI_CAPABILITIES 1
419 #define NDIS_802_11_AI_REQFI_LISTENINTERVAL 2
420 #define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS 4
422 #define NDIS_802_11_AI_RESFI_CAPABILITIES 1
423 #define NDIS_802_11_AI_RESFI_STATUSCODE 2
424 #define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4
426 typedef struct _NDIS_802_11_AI_REQFI {
428 USHORT ListenInterval;
429 NDIS_802_11_MAC_ADDRESS CurrentAPAddress;
430 } NDIS_802_11_AI_REQFI, *PNDIS_802_11_AI_REQFI;
432 typedef struct _NDIS_802_11_AI_RESFI {
435 USHORT AssociationId;
436 } NDIS_802_11_AI_RESFI, *PNDIS_802_11_AI_RESFI;
438 typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION {
440 USHORT AvailableRequestFixedIEs;
441 NDIS_802_11_AI_REQFI RequestFixedIEs;
442 ULONG RequestIELength;
443 ULONG OffsetRequestIEs;
444 USHORT AvailableResponseFixedIEs;
445 NDIS_802_11_AI_RESFI ResponseFixedIEs;
446 ULONG ResponseIELength;
447 ULONG OffsetResponseIEs;
448 } NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION;
450 typedef enum _NDIS_802_11_RELOAD_DEFAULTS {
451 Ndis802_11ReloadWEPKeys
452 } NDIS_802_11_RELOAD_DEFAULTS, *PNDIS_802_11_RELOAD_DEFAULTS;
455 /* Key mapping keys require a BSSID */
456 typedef struct _NDIS_802_11_KEY {
457 ULONG Length; /* Length of this structure */
459 ULONG KeyLength; /* length of key in bytes */
460 NDIS_802_11_MAC_ADDRESS BSSID;
461 NDIS_802_11_KEY_RSC KeyRSC;
462 UCHAR KeyMaterial[32]; /* variable length depending on above field */
463 } NDIS_802_11_KEY, *PNDIS_802_11_KEY;
465 typedef struct _NDIS_802_11_REMOVE_KEY {
466 ULONG Length; /* Length of this structure */
468 NDIS_802_11_MAC_ADDRESS BSSID;
469 } NDIS_802_11_REMOVE_KEY, *PNDIS_802_11_REMOVE_KEY;
471 typedef struct _NDIS_802_11_WEP {
472 ULONG Length; /* Length of this structure */
473 ULONG KeyIndex; /* 0 is the per-client key, 1-N are the global keys */
474 ULONG KeyLength; /* length of key in bytes */
475 UCHAR KeyMaterial[16];/* variable length depending on above field */
476 } NDIS_802_11_WEP, *PNDIS_802_11_WEP;
478 typedef struct _NDIS_802_11_AUTHENTICATION_REQUEST {
479 ULONG Length; /* Length of structure */
480 NDIS_802_11_MAC_ADDRESS Bssid;
482 } NDIS_802_11_AUTHENTICATION_REQUEST, *PNDIS_802_11_AUTHENTICATION_REQUEST;
484 typedef enum _NDIS_802_11_STATUS_TYPE {
485 Ndis802_11StatusType_Authentication,
486 Ndis802_11StatusType_MediaStreamMode,
487 Ndis802_11StatusType_PMKID_CandidateList,
488 Ndis802_11StatusTypeMax /* not a real type, defined as an upper bound */
489 } NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE;
491 typedef struct _NDIS_802_11_STATUS_INDICATION {
492 NDIS_802_11_STATUS_TYPE StatusType;
493 } NDIS_802_11_STATUS_INDICATION, *PNDIS_802_11_STATUS_INDICATION;
495 /* mask for authentication/integrity fields */
496 #define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS 0x0f
497 #define NDIS_802_11_AUTH_REQUEST_REAUTH 0x01
498 #define NDIS_802_11_AUTH_REQUEST_KEYUPDATE 0x02
499 #define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR 0x06
500 #define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E
502 /* MIC check time, 60 seconds. */
503 #define MIC_CHECK_TIME 60000000
505 typedef struct _NDIS_802_11_AUTHENTICATION_EVENT {
506 NDIS_802_11_STATUS_INDICATION Status;
507 NDIS_802_11_AUTHENTICATION_REQUEST Request[1];
508 } NDIS_802_11_AUTHENTICATION_EVENT, *PNDIS_802_11_AUTHENTICATION_EVENT;
510 typedef struct _NDIS_802_11_TEST {
514 NDIS_802_11_AUTHENTICATION_EVENT AuthenticationEvent;
515 NDIS_802_11_RSSI RssiTrigger;
517 } NDIS_802_11_TEST, *PNDIS_802_11_TEST;
520 #endif /* PLATFORM_FREEBSD */
521 #ifndef Ndis802_11APMode
522 #define Ndis802_11APMode (Ndis802_11InfrastructureMax+1)
525 typedef struct _WLAN_PHY_INFO {
526 u8 SignalStrength;/* (in percentage) */
527 u8 SignalQuality;/* (in percentage) */
528 u8 Optimum_antenna; /* for Antenna diversity */
530 } WLAN_PHY_INFO, *PWLAN_PHY_INFO;
532 typedef struct _WLAN_BCN_INFO {
533 /* these infor get from rtw_get_encrypt_info when
534 * * translate scan to UI */
535 u8 encryp_protocol;/* ENCRYP_PROTOCOL_E: OPEN/WEP/WPA/WPA2/WAPI */
536 int group_cipher; /* WPA/WPA2 group cipher */
537 int pairwise_cipher;/* //WPA/WPA2/WEP pairwise cipher */
540 /* bwmode 20/40 and ch_offset UP/LOW */
541 unsigned short ht_cap_info;
542 unsigned char ht_info_infos_0;
543 } WLAN_BCN_INFO, *PWLAN_BCN_INFO;
545 /* temporally add #pragma pack for structure alignment issue of
546 * WLAN_BSSID_EX and get_WLAN_BSSID_EX_sz()
548 #ifdef PLATFORM_WINDOWS
552 typedef struct _WLAN_BSSID_EX {
554 NDIS_802_11_MAC_ADDRESS MacAddress;
555 UCHAR Reserved[2];/* [0]: IS beacon frame */
556 NDIS_802_11_SSID Ssid;
558 NDIS_802_11_RSSI Rssi;/* (in dBM,raw data ,get from PHY) */
559 NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
560 NDIS_802_11_CONFIGURATION Configuration;
561 NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
562 NDIS_802_11_RATES_EX SupportedRates;
563 WLAN_PHY_INFO PhyInfo;
565 UCHAR IEs[MAX_IE_SZ]; /* (timestamp, beacon interval, and capability information) */
567 #ifndef PLATFORM_WINDOWS
568 __attribute__((packed))
570 WLAN_BSSID_EX, *PWLAN_BSSID_EX;
571 #ifdef PLATFORM_WINDOWS
575 #define BSS_EX_IES(bss_ex) ((bss_ex)->IEs)
576 #define BSS_EX_IES_LEN(bss_ex) ((bss_ex)->IELength)
577 #define BSS_EX_FIXED_IE_OFFSET(bss_ex) ((bss_ex)->Reserved[0] == 2 ? 0 : 12)
578 #define BSS_EX_TLV_IES(bss_ex) (BSS_EX_IES((bss_ex)) + BSS_EX_FIXED_IE_OFFSET((bss_ex)))
579 #define BSS_EX_TLV_IES_LEN(bss_ex) (BSS_EX_IES_LEN((bss_ex)) - BSS_EX_FIXED_IE_OFFSET((bss_ex)))
581 __inline static uint get_WLAN_BSSID_EX_sz(WLAN_BSSID_EX *bss)
586 t_len = sizeof(ULONG)
587 + sizeof(NDIS_802_11_MAC_ADDRESS)
589 + sizeof(NDIS_802_11_SSID)
591 + sizeof(NDIS_802_11_RSSI)
592 + sizeof(NDIS_802_11_NETWORK_TYPE)
593 + sizeof(NDIS_802_11_CONFIGURATION)
594 + sizeof(NDIS_802_11_NETWORK_INFRASTRUCTURE)
595 + sizeof(NDIS_802_11_RATES_EX)
596 /* all new member add here */
597 + sizeof(WLAN_PHY_INFO)
598 /* all new member add here */
603 return sizeof(WLAN_BSSID_EX) - MAX_IE_SZ + bss->IELength;
607 struct wlan_network {
609 int network_type; /* refer to ieee80211.h for WIRELESS_11A/B/G */
610 int fixed; /* set to fixed when not to be removed as site-surveying */
611 unsigned long last_scanned; /* timestamp for the network */
612 int aid; /* will only be valid when a BSS is joinned. */
614 WLAN_BSSID_EX network; /* must be the last item */
615 WLAN_BCN_INFO BcnInfo;
616 #ifdef PLATFORM_WINDOWS
617 unsigned char iebuf[MAX_IE_SZ];
622 enum VRTL_CARRIER_SENSE {
653 #define NUM_PRE_AUTH_KEY 16
654 #define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY
660 #ifndef PLATFORM_OS_CE
661 typedef struct _PMKID_CANDIDATE {
662 NDIS_802_11_MAC_ADDRESS BSSID;
664 } PMKID_CANDIDATE, *PPMKID_CANDIDATE;
666 typedef struct _NDIS_802_11_PMKID_CANDIDATE_LIST {
667 ULONG Version; /* Version of the structure */
668 ULONG NumCandidates; /* No. of pmkid candidates */
669 PMKID_CANDIDATE CandidateList[1];
670 } NDIS_802_11_PMKID_CANDIDATE_LIST, *PNDIS_802_11_PMKID_CANDIDATE_LIST;
673 typedef struct _NDIS_802_11_AUTHENTICATION_ENCRYPTION {
674 NDIS_802_11_AUTHENTICATION_MODE AuthModeSupported;
675 NDIS_802_11_ENCRYPTION_STATUS EncryptStatusSupported;
677 } NDIS_802_11_AUTHENTICATION_ENCRYPTION, *PNDIS_802_11_AUTHENTICATION_ENCRYPTION;
679 typedef struct _NDIS_802_11_CAPABILITY {
683 ULONG NoOfAuthEncryptPairsSupported;
684 NDIS_802_11_AUTHENTICATION_ENCRYPTION AuthenticationEncryptionSupported[1];
686 } NDIS_802_11_CAPABILITY, *PNDIS_802_11_CAPABILITY;
690 #endif /* #ifndef WLAN_BSSDEF_H_ */