1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef __WLAN_BSSDEF_H__
16#define __WLAN_BSSDEF_H__
17
18
19#define MAX_IE_SZ 768
20
21
22#define NDIS_802_11_LENGTH_SSID 32
23#define NDIS_802_11_LENGTH_RATES 8
24#define NDIS_802_11_LENGTH_RATES_EX 16
25
26typedef unsigned char NDIS_802_11_MAC_ADDRESS[6];
27typedef unsigned char NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES];
28typedef unsigned char NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX];
29
30struct ndis_802_11_ssid {
31 u32 SsidLength;
32 u8 Ssid[32];
33};
34
35enum NDIS_802_11_NETWORK_TYPE {
36 Ndis802_11FH,
37 Ndis802_11DS,
38 Ndis802_11OFDM5,
39 Ndis802_11OFDM24,
40 Ndis802_11NetworkTypeMax
41};
42
43struct ndis_802_11_conf_fh {
44 u32 Length;
45 u32 HopPattern;
46 u32 HopSet;
47 u32 DwellTime;
48};
49
50
51
52
53
54struct ndis_802_11_conf {
55 u32 Length;
56 u32 BeaconPeriod;
57 u32 ATIMWindow;
58 u32 DSConfig;
59 struct ndis_802_11_conf_fh FHConfig;
60};
61
62enum NDIS_802_11_NETWORK_INFRASTRUCTURE {
63 Ndis802_11IBSS,
64 Ndis802_11Infrastructure,
65 Ndis802_11AutoUnknown,
66 Ndis802_11InfrastructureMax,
67 Ndis802_11APMode,
68};
69
70struct ndis_802_11_fix_ie {
71 u8 Timestamp[8];
72 u16 BeaconInterval;
73 u16 Capabilities;
74};
75
76struct ndis_80211_var_ie {
77 u8 ElementID;
78 u8 Length;
79 u8 data[1];
80};
81
82
83
84
85
86
87
88
89
90
91enum NDIS_802_11_AUTHENTICATION_MODE {
92 Ndis802_11AuthModeOpen,
93 Ndis802_11AuthModeShared,
94 Ndis802_11AuthModeAutoSwitch,
95 Ndis802_11AuthModeWPA,
96 Ndis802_11AuthModeWPAPSK,
97 Ndis802_11AuthModeWPANone,
98 Ndis802_11AuthModeWAPI,
99 Ndis802_11AuthModeMax
100};
101
102enum NDIS_802_11_WEP_STATUS {
103 Ndis802_11WEPEnabled,
104 Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
105 Ndis802_11WEPDisabled,
106 Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
107 Ndis802_11WEPKeyAbsent,
108 Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
109 Ndis802_11WEPNotSupported,
110 Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
111 Ndis802_11Encryption2Enabled,
112 Ndis802_11Encryption2KeyAbsent,
113 Ndis802_11Encryption3Enabled,
114 Ndis802_11Encryption3KeyAbsent,
115 Ndis802_11_EncrypteionWAPI
116};
117
118#define NDIS_802_11_AI_REQFI_CAPABILITIES 1
119#define NDIS_802_11_AI_REQFI_LISTENINTERVAL 2
120#define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS 4
121
122#define NDIS_802_11_AI_RESFI_CAPABILITIES 1
123#define NDIS_802_11_AI_RESFI_STATUSCODE 2
124#define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4
125
126struct ndis_802_11_ai_reqfi {
127 u16 Capabilities;
128 u16 ListenInterval;
129 NDIS_802_11_MAC_ADDRESS CurrentAPAddress;
130};
131
132struct ndis_801_11_ai_resfi {
133 u16 Capabilities;
134 u16 StatusCode;
135 u16 AssociationId;
136};
137
138typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION
139{
140 u32 Length;
141 u16 AvailableRequestFixedIEs;
142 struct ndis_802_11_ai_reqfi RequestFixedIEs;
143 u32 RequestIELength;
144 u32 OffsetRequestIEs;
145 u16 AvailableResponseFixedIEs;
146 struct ndis_801_11_ai_resfi ResponseFixedIEs;
147 u32 ResponseIELength;
148 u32 OffsetResponseIEs;
149} NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION;
150
151enum NDIS_802_11_RELOAD_DEFAULTS {
152 Ndis802_11ReloadWEPKeys
153};
154
155
156
157typedef struct _NDIS_802_11_KEY
158{
159 u32 Length;
160 u32 KeyIndex;
161 u32 KeyLength;
162 NDIS_802_11_MAC_ADDRESS BSSID;
163 unsigned long long KeyRSC;
164 u8 KeyMaterial[32];
165} NDIS_802_11_KEY, *PNDIS_802_11_KEY;
166
167typedef struct _NDIS_802_11_REMOVE_KEY
168{
169 u32 Length;
170 u32 KeyIndex;
171 NDIS_802_11_MAC_ADDRESS BSSID;
172} NDIS_802_11_REMOVE_KEY, *PNDIS_802_11_REMOVE_KEY;
173
174struct ndis_802_11_wep {
175 u32 Length;
176 u32 KeyIndex;
177 u32 KeyLength;
178 u8 KeyMaterial[16];
179};
180
181
182#define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS 0x0f
183#define NDIS_802_11_AUTH_REQUEST_REAUTH 0x01
184#define NDIS_802_11_AUTH_REQUEST_KEYUPDATE 0x02
185#define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR 0x06
186#define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E
187
188
189#define MIC_CHECK_TIME 60000000
190
191#ifndef Ndis802_11APMode
192#define Ndis802_11APMode (Ndis802_11InfrastructureMax+1)
193#endif
194
195struct wlan_phy_info {
196 u8 SignalStrength;
197 u8 SignalQuality;
198 u8 Optimum_antenna;
199 u8 Reserved_0;
200};
201
202struct wlan_bcn_info {
203
204
205 u8 encryp_protocol;
206 int group_cipher;
207 int pairwise_cipher;
208 int is_8021x;
209
210
211 unsigned short ht_cap_info;
212 unsigned char ht_info_infos_0;
213};
214
215
216
217
218struct wlan_bssid_ex {
219 u32 Length;
220 NDIS_802_11_MAC_ADDRESS MacAddress;
221 u8 Reserved[2];
222 struct ndis_802_11_ssid Ssid;
223 u32 Privacy;
224 long Rssi;
225 enum NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
226 struct ndis_802_11_conf Configuration;
227 enum NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
228 NDIS_802_11_RATES_EX SupportedRates;
229 struct wlan_phy_info PhyInfo;
230 u32 IELength;
231 u8 IEs[MAX_IE_SZ];
232} __packed;
233
234__inline static uint get_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss)
235{
236 return (sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + bss->IELength);
237}
238
239struct wlan_network {
240 struct list_head list;
241 int network_type;
242 int fixed;
243 unsigned long last_scanned;
244 int aid;
245 int join_res;
246 struct wlan_bssid_ex network;
247 struct wlan_bcn_info BcnInfo;
248};
249
250enum VRTL_CARRIER_SENSE {
251 DISABLE_VCS,
252 ENABLE_VCS,
253 AUTO_VCS
254};
255
256enum VCS_TYPE {
257 NONE_VCS,
258 RTS_CTS,
259 CTS_TO_SELF
260};
261
262#define PWR_CAM 0
263#define PWR_MINPS 1
264#define PWR_MAXPS 2
265#define PWR_UAPSD 3
266#define PWR_VOIP 4
267
268enum UAPSD_MAX_SP {
269 NO_LIMIT,
270 TWO_MSDU,
271 FOUR_MSDU,
272 SIX_MSDU
273};
274
275#define NUM_PRE_AUTH_KEY 16
276#define NUM_PMKID_CACHE NUM_PRE_AUTH_KEY
277
278#endif
279