1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
4 * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved.
6 * Modifications for inclusion into the Linux staging tree are
7 * Copyright(c) 2010 Larry Finger. All rights reserved.
10 * WLAN FAE <wlanfae@realtek.com>
11 * Larry Finger <Larry.Finger@lwfinger.net>
13 ******************************************************************************/
14 #ifndef __WLAN_BSSDEF_H__
15 #define __WLAN_BSSDEF_H__
19 #define NDIS_802_11_LENGTH_SSID 32
20 #define NDIS_802_11_LENGTH_RATES 8
21 #define NDIS_802_11_LENGTH_RATES_EX 16
23 struct ndis_802_11_ssid {
28 enum NDIS_802_11_NETWORK_TYPE {
33 Ndis802_11NetworkTypeMax /* not a real type, defined as an upper bound*/
36 struct NDIS_802_11_CONFIGURATION_FH {
37 u32 Length; /* Length of structure */
38 u32 HopPattern; /* As defined by 802.11, MSB set */
39 u32 HopSet; /* to one if non-802.11 */
40 u32 DwellTime; /* units are Kusec */
44 * FW will only save the channel number in DSConfig.
45 * ODI Handler will convert the channel number to freq. number.
47 struct NDIS_802_11_CONFIGURATION {
48 u32 Length; /* Length of structure */
49 u32 BeaconPeriod; /* units are Kusec */
50 u32 ATIMWindow; /* units are Kusec */
51 u32 DSConfig; /* Frequency, units are kHz */
52 struct NDIS_802_11_CONFIGURATION_FH FHConfig;
55 enum NDIS_802_11_NETWORK_INFRASTRUCTURE {
57 Ndis802_11Infrastructure,
58 Ndis802_11AutoUnknown,
59 Ndis802_11InfrastructureMax, /*Not a real value,defined as upper bound*/
63 struct NDIS_802_11_FIXED_IEs {
69 struct wlan_bssid_ex {
71 unsigned char MacAddress[6];
73 struct ndis_802_11_ssid Ssid;
76 enum NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
77 struct NDIS_802_11_CONFIGURATION Configuration;
78 enum NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
79 u8 rates[NDIS_802_11_LENGTH_RATES_EX];
80 /* number of content bytes in EIs, which varies */
82 /*(timestamp, beacon interval, and capability information) */
86 enum NDIS_802_11_AUTHENTICATION_MODE {
87 Ndis802_11AuthModeOpen,
88 Ndis802_11AuthModeShared,
89 Ndis802_11AuthModeAutoSwitch,
90 Ndis802_11AuthModeWPA,
91 Ndis802_11AuthModeWPAPSK,
92 Ndis802_11AuthModeWPANone,
93 Ndis802_11AuthModeMax /* Not a real mode, defined as upper bound */
98 Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
99 Ndis802_11WEPDisabled,
100 Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
101 Ndis802_11WEPKeyAbsent,
102 Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
103 Ndis802_11WEPNotSupported,
104 Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
105 Ndis802_11Encryption2Enabled,
106 Ndis802_11Encryption2KeyAbsent,
107 Ndis802_11Encryption3Enabled,
108 Ndis802_11Encryption3KeyAbsent
111 #define NDIS_802_11_AI_REQFI_CAPABILITIES 1
112 #define NDIS_802_11_AI_REQFI_LISTENINTERVAL 2
113 #define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS 4
115 #define NDIS_802_11_AI_RESFI_CAPABILITIES 1
116 #define NDIS_802_11_AI_RESFI_STATUSCODE 2
117 #define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4
119 struct NDIS_802_11_AI_REQFI {
122 unsigned char CurrentAPAddress[6];
125 struct NDIS_802_11_AI_RESFI {
131 struct NDIS_802_11_ASSOCIATION_INFORMATION {
133 u16 AvailableRequestFixedIEs;
134 struct NDIS_802_11_AI_REQFI RequestFixedIEs;
136 u32 OffsetRequestIEs;
137 u16 AvailableResponseFixedIEs;
138 struct NDIS_802_11_AI_RESFI ResponseFixedIEs;
139 u32 ResponseIELength;
140 u32 OffsetResponseIEs;
143 /* Key mapping keys require a BSSID*/
144 struct NDIS_802_11_KEY {
145 u32 Length; /* Length of this structure */
147 u32 KeyLength; /* length of key in bytes */
148 unsigned char BSSID[6];
149 unsigned long long KeyRSC;
150 u8 KeyMaterial[32]; /* variable length */
153 struct NDIS_802_11_REMOVE_KEY {
154 u32 Length; /* Length of this structure */
156 unsigned char BSSID[6];
159 struct NDIS_802_11_WEP {
160 u32 Length; /* Length of this structure */
161 u32 KeyIndex; /* 0 is the per-client key,
162 * 1-N are the global keys
164 u32 KeyLength; /* length of key in bytes */
165 u8 KeyMaterial[16]; /* variable length depending on above field */
168 /* mask for authentication/integrity fields */
169 #define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS 0x0f
170 #define NDIS_802_11_AUTH_REQUEST_REAUTH 0x01
171 #define NDIS_802_11_AUTH_REQUEST_KEYUPDATE 0x02
172 #define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR 0x06
173 #define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E
175 /* MIC check time, 60 seconds. */
176 #define MIC_CHECK_TIME 60000000
178 #ifndef Ndis802_11APMode
179 #define Ndis802_11APMode (Ndis802_11InfrastructureMax + 1)
182 struct wlan_network {
183 struct list_head list;
184 int network_type; /*refer to ieee80211.h for WIRELESS_11A/B/G */
185 int fixed; /* set to fixed when not to be removed asi
188 unsigned int last_scanned; /*timestamp for the network */
189 int aid; /*will only be valid when a BSS is joined. */
191 struct wlan_bssid_ex network; /*must be the last item */
194 enum VRTL_CARRIER_SENSE {
219 #define NUM_PRE_AUTH_KEY 16
220 #define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY
222 #endif /* #ifndef WLAN_BSSDEF_H_ */