Commit | Line | Data |
---|---|---|
91980990 GKH |
1 | /* |
2 | ************************************************************************* | |
3 | * Ralink Tech Inc. | |
4 | * 5F., No.36, Taiyuan St., Jhubei City, | |
5 | * Hsinchu County 302, | |
6 | * Taiwan, R.O.C. | |
7 | * | |
8 | * (c) Copyright 2002-2007, Ralink Technology, Inc. | |
9 | * | |
10 | * This program is free software; you can redistribute it and/or modify * | |
11 | * it under the terms of the GNU General Public License as published by * | |
12 | * the Free Software Foundation; either version 2 of the License, or * | |
13 | * (at your option) any later version. * | |
14 | * * | |
15 | * This program is distributed in the hope that it will be useful, * | |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | |
18 | * GNU General Public License for more details. * | |
19 | * * | |
20 | * You should have received a copy of the GNU General Public License * | |
21 | * along with this program; if not, write to the * | |
22 | * Free Software Foundation, Inc., * | |
23 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * | |
24 | * * | |
25 | ************************************************************************* | |
26 | ||
27 | Module Name: | |
28 | oid.h | |
29 | ||
30 | Abstract: | |
31 | ||
32 | Revision History: | |
33 | Who When What | |
34 | -------- ---------- ---------------------------------------------- | |
35 | Name Date Modification logs | |
36 | */ | |
37 | #ifndef _OID_H_ | |
38 | #define _OID_H_ | |
39 | ||
40 | ||
41 | #define TRUE 1 | |
42 | #define FALSE 0 | |
43 | // | |
44 | // IEEE 802.11 Structures and definitions | |
45 | // | |
46 | #define MAX_TX_POWER_LEVEL 100 /* mW */ | |
47 | #define MAX_RSSI_TRIGGER -10 /* dBm */ | |
48 | #define MIN_RSSI_TRIGGER -200 /* dBm */ | |
49 | #define MAX_FRAG_THRESHOLD 2346 /* byte count */ | |
50 | #define MIN_FRAG_THRESHOLD 256 /* byte count */ | |
51 | #define MAX_RTS_THRESHOLD 2347 /* byte count */ | |
52 | ||
53 | // new types for Media Specific Indications | |
54 | // Extension channel offset | |
55 | #define EXTCHA_NONE 0 | |
56 | #define EXTCHA_ABOVE 0x1 | |
57 | #define EXTCHA_BELOW 0x3 | |
58 | ||
59 | // BW | |
60 | #define BAND_WIDTH_20 0 | |
61 | #define BAND_WIDTH_40 1 | |
62 | #define BAND_WIDTH_BOTH 2 | |
63 | #define BAND_WIDTH_10 3 // 802.11j has 10MHz. This definition is for internal usage. doesn't fill in the IE or other field. | |
64 | // SHORTGI | |
65 | #define GAP_INTERVAL_400 1 // only support in HT mode | |
66 | #define GAP_INTERVAL_800 0 | |
67 | #define GAP_INTERVAL_BOTH 2 | |
68 | ||
69 | #define NdisMediaStateConnected 1 | |
70 | #define NdisMediaStateDisconnected 0 | |
71 | ||
72 | #define NDIS_802_11_LENGTH_SSID 32 | |
73 | #define NDIS_802_11_LENGTH_RATES 8 | |
74 | #define NDIS_802_11_LENGTH_RATES_EX 16 | |
75 | #define MAC_ADDR_LENGTH 6 | |
76 | #define MAX_NUM_OF_CHS 49 // 14 channels @2.4G + 12@UNII + 4 @MMAC + 11 @HiperLAN2 + 7 @Japan + 1 as NULL terminationc | |
77 | #define MAX_NUMBER_OF_EVENT 10 // entry # in EVENT table | |
78 | #define MAX_NUMBER_OF_MAC 32 // if MAX_MBSSID_NUM is 8, this value can't be larger than 211 | |
79 | #define MAX_NUMBER_OF_ACL 64 | |
80 | #define MAX_LENGTH_OF_SUPPORT_RATES 12 // 1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54 | |
81 | #define MAX_NUMBER_OF_DLS_ENTRY 4 | |
82 | ||
91980990 GKH |
83 | #define OID_GEN_MACHINE_NAME 0x0001021A |
84 | ||
91980990 GKH |
85 | #define RT_QUERY_SIGNAL_CONTEXT 0x0402 |
86 | #define RT_SET_IAPP_PID 0x0404 | |
87 | #define RT_SET_APD_PID 0x0405 | |
88 | #define RT_SET_DEL_MAC_ENTRY 0x0406 | |
89 | ||
90 | // | |
91 | // IEEE 802.11 OIDs | |
92 | // | |
93 | #define OID_GET_SET_TOGGLE 0x8000 | |
94 | ||
881abc9d BZ |
95 | #define OID_802_11_ADD_WEP 0x0112 |
96 | #define OID_802_11_DISASSOCIATE 0x0114 | |
97 | #define OID_802_11_BSSID_LIST_SCAN 0x0508 | |
98 | #define OID_802_11_SSID 0x0509 | |
99 | #define OID_802_11_BSSID 0x050A | |
100 | #define OID_802_11_MIC_FAILURE_REPORT_FRAME 0x0528 | |
91980990 GKH |
101 | |
102 | #define RT_OID_DEVICE_NAME 0x0607 | |
103 | #define RT_OID_VERSION_INFO 0x0608 | |
91980990 | 104 | #define OID_GEN_MEDIA_CONNECT_STATUS 0x060B |
91980990 GKH |
105 | #define OID_GEN_RCV_OK 0x060F |
106 | #define OID_GEN_RCV_NO_BUFFER 0x0610 | |
e08bae5a | 107 | |
91980990 | 108 | #define OID_SET_COUNTERMEASURES 0x0616 |
91980990 GKH |
109 | #define RT_OID_WPA_SUPPLICANT_SUPPORT 0x0621 |
110 | #define RT_OID_WE_VERSION_COMPILED 0x0622 | |
111 | #define RT_OID_NEW_DRIVER 0x0623 | |
112 | ||
91980990 | 113 | //rt2860 , kathy |
91980990 | 114 | #define RT_OID_DRIVER_DEVICE_NAME 0x0645 |
91980990 GKH |
115 | #define RT_OID_QUERY_MULTIPLE_CARD_SUPPORT 0x0647 |
116 | ||
117 | // Ralink defined OIDs | |
118 | // Dennis Lee move to platform specific | |
119 | ||
91980990 GKH |
120 | typedef enum _NDIS_802_11_STATUS_TYPE |
121 | { | |
122 | Ndis802_11StatusType_Authentication, | |
123 | Ndis802_11StatusType_MediaStreamMode, | |
124 | Ndis802_11StatusType_PMKID_CandidateList, | |
125 | Ndis802_11StatusTypeMax // not a real type, defined as an upper bound | |
126 | } NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE; | |
127 | ||
128 | typedef UCHAR NDIS_802_11_MAC_ADDRESS[6]; | |
129 | ||
130 | typedef struct _NDIS_802_11_STATUS_INDICATION | |
131 | { | |
132 | NDIS_802_11_STATUS_TYPE StatusType; | |
133 | } NDIS_802_11_STATUS_INDICATION, *PNDIS_802_11_STATUS_INDICATION; | |
134 | ||
135 | // mask for authentication/integrity fields | |
136 | #define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS 0x0f | |
137 | ||
138 | #define NDIS_802_11_AUTH_REQUEST_REAUTH 0x01 | |
139 | #define NDIS_802_11_AUTH_REQUEST_KEYUPDATE 0x02 | |
140 | #define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR 0x06 | |
141 | #define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E | |
142 | ||
143 | typedef struct _NDIS_802_11_AUTHENTICATION_REQUEST | |
144 | { | |
145 | ULONG Length; // Length of structure | |
146 | NDIS_802_11_MAC_ADDRESS Bssid; | |
147 | ULONG Flags; | |
148 | } NDIS_802_11_AUTHENTICATION_REQUEST, *PNDIS_802_11_AUTHENTICATION_REQUEST; | |
149 | ||
150 | //Added new types for PMKID Candidate lists. | |
151 | typedef struct _PMKID_CANDIDATE { | |
152 | NDIS_802_11_MAC_ADDRESS BSSID; | |
153 | ULONG Flags; | |
154 | } PMKID_CANDIDATE, *PPMKID_CANDIDATE; | |
155 | ||
156 | typedef struct _NDIS_802_11_PMKID_CANDIDATE_LIST | |
157 | { | |
158 | ULONG Version; // Version of the structure | |
159 | ULONG NumCandidates; // No. of pmkid candidates | |
160 | PMKID_CANDIDATE CandidateList[1]; | |
161 | } NDIS_802_11_PMKID_CANDIDATE_LIST, *PNDIS_802_11_PMKID_CANDIDATE_LIST; | |
162 | ||
163 | //Flags for PMKID Candidate list structure | |
164 | #define NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED 0x01 | |
165 | ||
166 | // Added new types for OFDM 5G and 2.4G | |
167 | typedef enum _NDIS_802_11_NETWORK_TYPE | |
168 | { | |
169 | Ndis802_11FH, | |
170 | Ndis802_11DS, | |
171 | Ndis802_11OFDM5, | |
172 | Ndis802_11OFDM5_N, | |
173 | Ndis802_11OFDM24, | |
174 | Ndis802_11OFDM24_N, | |
175 | Ndis802_11Automode, | |
176 | Ndis802_11NetworkTypeMax // not a real type, defined as an upper bound | |
177 | } NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE; | |
178 | ||
179 | typedef struct _NDIS_802_11_NETWORK_TYPE_LIST | |
180 | { | |
181 | UINT NumberOfItems; // in list below, at least 1 | |
182 | NDIS_802_11_NETWORK_TYPE NetworkType [1]; | |
183 | } NDIS_802_11_NETWORK_TYPE_LIST, *PNDIS_802_11_NETWORK_TYPE_LIST; | |
184 | ||
185 | typedef enum _NDIS_802_11_POWER_MODE | |
186 | { | |
187 | Ndis802_11PowerModeCAM, | |
188 | Ndis802_11PowerModeMAX_PSP, | |
189 | Ndis802_11PowerModeFast_PSP, | |
190 | Ndis802_11PowerModeLegacy_PSP, | |
191 | Ndis802_11PowerModeMax // not a real mode, defined as an upper bound | |
192 | } NDIS_802_11_POWER_MODE, *PNDIS_802_11_POWER_MODE; | |
193 | ||
194 | typedef ULONG NDIS_802_11_TX_POWER_LEVEL; // in milliwatts | |
195 | ||
196 | // | |
197 | // Received Signal Strength Indication | |
198 | // | |
199 | typedef LONG NDIS_802_11_RSSI; // in dBm | |
200 | ||
201 | typedef struct _NDIS_802_11_CONFIGURATION_FH | |
202 | { | |
203 | ULONG Length; // Length of structure | |
204 | ULONG HopPattern; // As defined by 802.11, MSB set | |
205 | ULONG HopSet; // to one if non-802.11 | |
206 | ULONG DwellTime; // units are Kusec | |
207 | } NDIS_802_11_CONFIGURATION_FH, *PNDIS_802_11_CONFIGURATION_FH; | |
208 | ||
209 | typedef struct _NDIS_802_11_CONFIGURATION | |
210 | { | |
211 | ULONG Length; // Length of structure | |
212 | ULONG BeaconPeriod; // units are Kusec | |
213 | ULONG ATIMWindow; // units are Kusec | |
214 | ULONG DSConfig; // Frequency, units are kHz | |
215 | NDIS_802_11_CONFIGURATION_FH FHConfig; | |
216 | } NDIS_802_11_CONFIGURATION, *PNDIS_802_11_CONFIGURATION; | |
217 | ||
218 | typedef struct _NDIS_802_11_STATISTICS | |
219 | { | |
220 | ULONG Length; // Length of structure | |
221 | LARGE_INTEGER TransmittedFragmentCount; | |
222 | LARGE_INTEGER MulticastTransmittedFrameCount; | |
223 | LARGE_INTEGER FailedCount; | |
224 | LARGE_INTEGER RetryCount; | |
225 | LARGE_INTEGER MultipleRetryCount; | |
226 | LARGE_INTEGER RTSSuccessCount; | |
227 | LARGE_INTEGER RTSFailureCount; | |
228 | LARGE_INTEGER ACKFailureCount; | |
229 | LARGE_INTEGER FrameDuplicateCount; | |
230 | LARGE_INTEGER ReceivedFragmentCount; | |
231 | LARGE_INTEGER MulticastReceivedFrameCount; | |
232 | LARGE_INTEGER FCSErrorCount; | |
233 | LARGE_INTEGER TKIPLocalMICFailures; | |
234 | LARGE_INTEGER TKIPRemoteMICErrors; | |
235 | LARGE_INTEGER TKIPICVErrors; | |
236 | LARGE_INTEGER TKIPCounterMeasuresInvoked; | |
237 | LARGE_INTEGER TKIPReplays; | |
238 | LARGE_INTEGER CCMPFormatErrors; | |
239 | LARGE_INTEGER CCMPReplays; | |
240 | LARGE_INTEGER CCMPDecryptErrors; | |
241 | LARGE_INTEGER FourWayHandshakeFailures; | |
242 | } NDIS_802_11_STATISTICS, *PNDIS_802_11_STATISTICS; | |
243 | ||
244 | typedef ULONG NDIS_802_11_KEY_INDEX; | |
245 | typedef ULONGLONG NDIS_802_11_KEY_RSC; | |
246 | ||
247 | #define MAX_RADIUS_SRV_NUM 2 // 802.1x failover number | |
248 | ||
249 | typedef struct PACKED _RADIUS_SRV_INFO { | |
250 | UINT32 radius_ip; | |
251 | UINT32 radius_port; | |
252 | UCHAR radius_key[64]; | |
253 | UCHAR radius_key_len; | |
254 | } RADIUS_SRV_INFO, *PRADIUS_SRV_INFO; | |
255 | ||
256 | typedef struct PACKED _RADIUS_KEY_INFO | |
257 | { | |
258 | UCHAR radius_srv_num; | |
259 | RADIUS_SRV_INFO radius_srv_info[MAX_RADIUS_SRV_NUM]; | |
260 | UCHAR ieee8021xWEP; // dynamic WEP | |
261 | UCHAR key_index; | |
262 | UCHAR key_length; // length of key in bytes | |
263 | UCHAR key_material[13]; | |
264 | } RADIUS_KEY_INFO, *PRADIUS_KEY_INFO; | |
265 | ||
266 | // It's used by 802.1x daemon to require relative configuration | |
267 | typedef struct PACKED _RADIUS_CONF | |
268 | { | |
269 | UINT32 Length; // Length of this structure | |
270 | UCHAR mbss_num; // indicate multiple BSS number | |
271 | UINT32 own_ip_addr; | |
272 | UINT32 retry_interval; | |
273 | UINT32 session_timeout_interval; | |
274 | UCHAR EAPifname[IFNAMSIZ]; | |
275 | UCHAR EAPifname_len; | |
276 | UCHAR PreAuthifname[IFNAMSIZ]; | |
277 | UCHAR PreAuthifname_len; | |
278 | RADIUS_KEY_INFO RadiusInfo[8/*MAX_MBSSID_NUM*/]; | |
279 | } RADIUS_CONF, *PRADIUS_CONF; | |
280 | ||
91980990 GKH |
281 | // Key mapping keys require a BSSID |
282 | typedef struct _NDIS_802_11_KEY | |
283 | { | |
284 | UINT Length; // Length of this structure | |
285 | UINT KeyIndex; | |
286 | UINT KeyLength; // length of key in bytes | |
287 | NDIS_802_11_MAC_ADDRESS BSSID; | |
288 | NDIS_802_11_KEY_RSC KeyRSC; | |
289 | UCHAR KeyMaterial[1]; // variable length depending on above field | |
290 | } NDIS_802_11_KEY, *PNDIS_802_11_KEY; | |
91980990 GKH |
291 | |
292 | typedef struct _NDIS_802_11_REMOVE_KEY | |
293 | { | |
294 | UINT Length; // Length of this structure | |
295 | UINT KeyIndex; | |
296 | NDIS_802_11_MAC_ADDRESS BSSID; | |
297 | } NDIS_802_11_REMOVE_KEY, *PNDIS_802_11_REMOVE_KEY; | |
298 | ||
299 | typedef struct _NDIS_802_11_WEP | |
300 | { | |
301 | UINT Length; // Length of this structure | |
302 | UINT KeyIndex; // 0 is the per-client key, 1-N are the | |
303 | // global keys | |
304 | UINT KeyLength; // length of key in bytes | |
305 | UCHAR KeyMaterial[1];// variable length depending on above field | |
306 | } NDIS_802_11_WEP, *PNDIS_802_11_WEP; | |
307 | ||
308 | ||
309 | typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE | |
310 | { | |
311 | Ndis802_11IBSS, | |
312 | Ndis802_11Infrastructure, | |
313 | Ndis802_11AutoUnknown, | |
314 | Ndis802_11Monitor, | |
315 | Ndis802_11InfrastructureMax // Not a real value, defined as upper bound | |
316 | } NDIS_802_11_NETWORK_INFRASTRUCTURE, *PNDIS_802_11_NETWORK_INFRASTRUCTURE; | |
317 | ||
318 | // Add new authentication modes | |
319 | typedef enum _NDIS_802_11_AUTHENTICATION_MODE | |
320 | { | |
321 | Ndis802_11AuthModeOpen, | |
322 | Ndis802_11AuthModeShared, | |
323 | Ndis802_11AuthModeAutoSwitch, | |
324 | Ndis802_11AuthModeWPA, | |
325 | Ndis802_11AuthModeWPAPSK, | |
326 | Ndis802_11AuthModeWPANone, | |
327 | Ndis802_11AuthModeWPA2, | |
328 | Ndis802_11AuthModeWPA2PSK, | |
329 | Ndis802_11AuthModeWPA1WPA2, | |
330 | Ndis802_11AuthModeWPA1PSKWPA2PSK, | |
331 | Ndis802_11AuthModeMax // Not a real mode, defined as upper bound | |
332 | } NDIS_802_11_AUTHENTICATION_MODE, *PNDIS_802_11_AUTHENTICATION_MODE; | |
333 | ||
334 | typedef UCHAR NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES]; // Set of 8 data rates | |
335 | typedef UCHAR NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX]; // Set of 16 data rates | |
336 | ||
337 | typedef struct PACKED _NDIS_802_11_SSID | |
338 | { | |
339 | UINT SsidLength; // length of SSID field below, in bytes; | |
340 | // this can be zero. | |
341 | UCHAR Ssid[NDIS_802_11_LENGTH_SSID]; // SSID information field | |
342 | } NDIS_802_11_SSID, *PNDIS_802_11_SSID; | |
343 | ||
344 | ||
345 | typedef struct PACKED _NDIS_WLAN_BSSID | |
346 | { | |
347 | ULONG Length; // Length of this structure | |
348 | NDIS_802_11_MAC_ADDRESS MacAddress; // BSSID | |
349 | UCHAR Reserved[2]; | |
350 | NDIS_802_11_SSID Ssid; // SSID | |
351 | ULONG Privacy; // WEP encryption requirement | |
352 | NDIS_802_11_RSSI Rssi; // receive signal strength in dBm | |
353 | NDIS_802_11_NETWORK_TYPE NetworkTypeInUse; | |
354 | NDIS_802_11_CONFIGURATION Configuration; | |
355 | NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode; | |
356 | NDIS_802_11_RATES SupportedRates; | |
357 | } NDIS_WLAN_BSSID, *PNDIS_WLAN_BSSID; | |
358 | ||
359 | typedef struct PACKED _NDIS_802_11_BSSID_LIST | |
360 | { | |
361 | UINT NumberOfItems; // in list below, at least 1 | |
362 | NDIS_WLAN_BSSID Bssid[1]; | |
363 | } NDIS_802_11_BSSID_LIST, *PNDIS_802_11_BSSID_LIST; | |
364 | ||
365 | // Added Capabilities, IELength and IEs for each BSSID | |
366 | typedef struct PACKED _NDIS_WLAN_BSSID_EX | |
367 | { | |
368 | ULONG Length; // Length of this structure | |
369 | NDIS_802_11_MAC_ADDRESS MacAddress; // BSSID | |
370 | UCHAR Reserved[2]; | |
371 | NDIS_802_11_SSID Ssid; // SSID | |
372 | UINT Privacy; // WEP encryption requirement | |
373 | NDIS_802_11_RSSI Rssi; // receive signal | |
374 | // strength in dBm | |
375 | NDIS_802_11_NETWORK_TYPE NetworkTypeInUse; | |
376 | NDIS_802_11_CONFIGURATION Configuration; | |
377 | NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode; | |
378 | NDIS_802_11_RATES_EX SupportedRates; | |
379 | ULONG IELength; | |
380 | UCHAR IEs[1]; | |
381 | } NDIS_WLAN_BSSID_EX, *PNDIS_WLAN_BSSID_EX; | |
382 | ||
383 | typedef struct PACKED _NDIS_802_11_BSSID_LIST_EX | |
384 | { | |
385 | UINT NumberOfItems; // in list below, at least 1 | |
386 | NDIS_WLAN_BSSID_EX Bssid[1]; | |
387 | } NDIS_802_11_BSSID_LIST_EX, *PNDIS_802_11_BSSID_LIST_EX; | |
388 | ||
389 | typedef struct PACKED _NDIS_802_11_FIXED_IEs | |
390 | { | |
391 | UCHAR Timestamp[8]; | |
392 | USHORT BeaconInterval; | |
393 | USHORT Capabilities; | |
394 | } NDIS_802_11_FIXED_IEs, *PNDIS_802_11_FIXED_IEs; | |
395 | ||
396 | typedef struct _NDIS_802_11_VARIABLE_IEs | |
397 | { | |
398 | UCHAR ElementID; | |
399 | UCHAR Length; // Number of bytes in data field | |
400 | UCHAR data[1]; | |
401 | } NDIS_802_11_VARIABLE_IEs, *PNDIS_802_11_VARIABLE_IEs; | |
402 | ||
403 | typedef ULONG NDIS_802_11_FRAGMENTATION_THRESHOLD; | |
404 | ||
405 | typedef ULONG NDIS_802_11_RTS_THRESHOLD; | |
406 | ||
407 | typedef ULONG NDIS_802_11_ANTENNA; | |
408 | ||
409 | typedef enum _NDIS_802_11_PRIVACY_FILTER | |
410 | { | |
411 | Ndis802_11PrivFilterAcceptAll, | |
412 | Ndis802_11PrivFilter8021xWEP | |
413 | } NDIS_802_11_PRIVACY_FILTER, *PNDIS_802_11_PRIVACY_FILTER; | |
414 | ||
415 | // Added new encryption types | |
416 | // Also aliased typedef to new name | |
417 | typedef enum _NDIS_802_11_WEP_STATUS | |
418 | { | |
419 | Ndis802_11WEPEnabled, | |
420 | Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled, | |
421 | Ndis802_11WEPDisabled, | |
422 | Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled, | |
423 | Ndis802_11WEPKeyAbsent, | |
424 | Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent, | |
425 | Ndis802_11WEPNotSupported, | |
426 | Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported, | |
427 | Ndis802_11Encryption2Enabled, | |
428 | Ndis802_11Encryption2KeyAbsent, | |
429 | Ndis802_11Encryption3Enabled, | |
430 | Ndis802_11Encryption3KeyAbsent, | |
431 | Ndis802_11Encryption4Enabled, // TKIP or AES mix | |
432 | Ndis802_11Encryption4KeyAbsent, | |
ed291e80 AM |
433 | Ndis802_11GroupWEP40Enabled, |
434 | Ndis802_11GroupWEP104Enabled, | |
91980990 GKH |
435 | } NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS, |
436 | NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS; | |
437 | ||
438 | typedef enum _NDIS_802_11_RELOAD_DEFAULTS | |
439 | { | |
440 | Ndis802_11ReloadWEPKeys | |
441 | } NDIS_802_11_RELOAD_DEFAULTS, *PNDIS_802_11_RELOAD_DEFAULTS; | |
442 | ||
443 | #define NDIS_802_11_AI_REQFI_CAPABILITIES 1 | |
444 | #define NDIS_802_11_AI_REQFI_LISTENINTERVAL 2 | |
445 | #define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS 4 | |
446 | ||
447 | #define NDIS_802_11_AI_RESFI_CAPABILITIES 1 | |
448 | #define NDIS_802_11_AI_RESFI_STATUSCODE 2 | |
449 | #define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4 | |
450 | ||
451 | typedef struct _NDIS_802_11_AI_REQFI | |
452 | { | |
453 | USHORT Capabilities; | |
454 | USHORT ListenInterval; | |
455 | NDIS_802_11_MAC_ADDRESS CurrentAPAddress; | |
456 | } NDIS_802_11_AI_REQFI, *PNDIS_802_11_AI_REQFI; | |
457 | ||
458 | typedef struct _NDIS_802_11_AI_RESFI | |
459 | { | |
460 | USHORT Capabilities; | |
461 | USHORT StatusCode; | |
462 | USHORT AssociationId; | |
463 | } NDIS_802_11_AI_RESFI, *PNDIS_802_11_AI_RESFI; | |
464 | ||
465 | typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION | |
466 | { | |
467 | ULONG Length; | |
468 | USHORT AvailableRequestFixedIEs; | |
469 | NDIS_802_11_AI_REQFI RequestFixedIEs; | |
470 | ULONG RequestIELength; | |
471 | ULONG OffsetRequestIEs; | |
472 | USHORT AvailableResponseFixedIEs; | |
473 | NDIS_802_11_AI_RESFI ResponseFixedIEs; | |
474 | ULONG ResponseIELength; | |
475 | ULONG OffsetResponseIEs; | |
476 | } NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION; | |
477 | ||
478 | typedef struct _NDIS_802_11_AUTHENTICATION_EVENT | |
479 | { | |
480 | NDIS_802_11_STATUS_INDICATION Status; | |
481 | NDIS_802_11_AUTHENTICATION_REQUEST Request[1]; | |
482 | } NDIS_802_11_AUTHENTICATION_EVENT, *PNDIS_802_11_AUTHENTICATION_EVENT; | |
483 | ||
484 | // 802.11 Media stream constraints, associated with OID_802_11_MEDIA_STREAM_MODE | |
485 | typedef enum _NDIS_802_11_MEDIA_STREAM_MODE | |
486 | { | |
487 | Ndis802_11MediaStreamOff, | |
488 | Ndis802_11MediaStreamOn, | |
489 | } NDIS_802_11_MEDIA_STREAM_MODE, *PNDIS_802_11_MEDIA_STREAM_MODE; | |
490 | ||
491 | // PMKID Structures | |
492 | typedef UCHAR NDIS_802_11_PMKID_VALUE[16]; | |
493 | ||
91980990 GKH |
494 | typedef struct _BSSID_INFO |
495 | { | |
496 | NDIS_802_11_MAC_ADDRESS BSSID; | |
497 | NDIS_802_11_PMKID_VALUE PMKID; | |
498 | } BSSID_INFO, *PBSSID_INFO; | |
499 | ||
500 | typedef struct _NDIS_802_11_PMKID | |
501 | { | |
502 | UINT Length; | |
503 | UINT BSSIDInfoCount; | |
504 | BSSID_INFO BSSIDInfo[1]; | |
505 | } NDIS_802_11_PMKID, *PNDIS_802_11_PMKID; | |
91980990 GKH |
506 | |
507 | typedef struct _NDIS_802_11_AUTHENTICATION_ENCRYPTION | |
508 | { | |
509 | NDIS_802_11_AUTHENTICATION_MODE AuthModeSupported; | |
510 | NDIS_802_11_ENCRYPTION_STATUS EncryptStatusSupported; | |
511 | } NDIS_802_11_AUTHENTICATION_ENCRYPTION, *PNDIS_802_11_AUTHENTICATION_ENCRYPTION; | |
512 | ||
513 | typedef struct _NDIS_802_11_CAPABILITY | |
514 | { | |
515 | ULONG Length; | |
516 | ULONG Version; | |
517 | ULONG NoOfPMKIDs; | |
518 | ULONG NoOfAuthEncryptPairsSupported; | |
519 | NDIS_802_11_AUTHENTICATION_ENCRYPTION AuthenticationEncryptionSupported[1]; | |
520 | } NDIS_802_11_CAPABILITY, *PNDIS_802_11_CAPABILITY; | |
521 | ||
3a32ed12 | 522 | #define RT_PRIV_IOCTL_EXT (SIOCIWFIRSTPRIV + 0x01) // Sync. with AP for wsc upnp daemon |
91980990 GKH |
523 | #define RTPRIV_IOCTL_SET (SIOCIWFIRSTPRIV + 0x02) |
524 | ||
91980990 GKH |
525 | #define RTPRIV_IOCTL_STATISTICS (SIOCIWFIRSTPRIV + 0x09) |
526 | #define RTPRIV_IOCTL_ADD_PMKID_CACHE (SIOCIWFIRSTPRIV + 0x0A) | |
527 | #define RTPRIV_IOCTL_RADIUS_DATA (SIOCIWFIRSTPRIV + 0x0C) | |
528 | #define RTPRIV_IOCTL_GSITESURVEY (SIOCIWFIRSTPRIV + 0x0D) | |
529 | #define RT_PRIV_IOCTL (SIOCIWFIRSTPRIV + 0x0E) // Sync. with RT61 (for wpa_supplicant) | |
530 | #define RTPRIV_IOCTL_GET_MAC_TABLE (SIOCIWFIRSTPRIV + 0x0F) | |
531 | ||
532 | #define RTPRIV_IOCTL_SHOW (SIOCIWFIRSTPRIV + 0x11) | |
533 | enum { | |
534 | SHOW_CONN_STATUS = 4, | |
535 | SHOW_DRVIER_VERION = 5, | |
536 | SHOW_BA_INFO = 6, | |
537 | SHOW_DESC_INFO = 7, | |
3a32ed12 BZ |
538 | #ifdef RT2870 |
539 | SHOW_RXBULK_INFO = 8, | |
540 | SHOW_TXBULK_INFO = 9, | |
541 | #endif // RT2870 // | |
91980990 GKH |
542 | RAIO_OFF = 10, |
543 | RAIO_ON = 11, | |
91980990 | 544 | SHOW_CFG_VALUE = 20, |
37843390 | 545 | #if !defined(RT2860) |
3a32ed12 BZ |
546 | SHOW_ADHOC_ENTRY_INFO = 21, |
547 | #endif | |
91980990 GKH |
548 | }; |
549 | ||
91980990 GKH |
550 | #ifdef LLTD_SUPPORT |
551 | // for consistency with RT61 | |
552 | #define RT_OID_GET_PHY_MODE 0x761 | |
553 | #endif // LLTD_SUPPORT // | |
554 | ||
3a32ed12 | 555 | #if defined(RT2860) || defined(RT30xx) |
91980990 GKH |
556 | // New for MeetingHouse Api support |
557 | #define OID_MH_802_1X_SUPPORTED 0xFFEDC100 | |
3a32ed12 | 558 | #endif |
91980990 GKH |
559 | |
560 | // MIMO Tx parameter, ShortGI, MCS, STBC, etc. these are fields in TXWI. Don't change this definition!!! | |
561 | typedef union _HTTRANSMIT_SETTING { | |
91980990 GKH |
562 | struct { |
563 | USHORT MCS:7; // MCS | |
564 | USHORT BW:1; //channel bandwidth 20MHz or 40 MHz | |
565 | USHORT ShortGI:1; | |
566 | USHORT STBC:2; //SPACE | |
567 | USHORT rsv:2; | |
568 | USHORT TxBF:1; | |
569 | USHORT MODE:2; // Use definition MODE_xxx. | |
570 | } field; | |
91980990 GKH |
571 | USHORT word; |
572 | } HTTRANSMIT_SETTING, *PHTTRANSMIT_SETTING; | |
573 | ||
574 | typedef enum _RT_802_11_PREAMBLE { | |
575 | Rt802_11PreambleLong, | |
576 | Rt802_11PreambleShort, | |
577 | Rt802_11PreambleAuto | |
578 | } RT_802_11_PREAMBLE, *PRT_802_11_PREAMBLE; | |
579 | ||
580 | // Only for STA, need to sync with AP | |
91980990 GKH |
581 | typedef enum _RT_802_11_PHY_MODE { |
582 | PHY_11BG_MIXED = 0, | |
583 | PHY_11B, | |
584 | PHY_11A, | |
585 | PHY_11ABG_MIXED, | |
586 | PHY_11G, | |
91980990 GKH |
587 | PHY_11ABGN_MIXED, // both band 5 |
588 | PHY_11N_2_4G, // 11n-only with 2.4G band 6 | |
589 | PHY_11GN_MIXED, // 2.4G band 7 | |
590 | PHY_11AN_MIXED, // 5G band 8 | |
591 | PHY_11BGN_MIXED, // if check 802.11b. 9 | |
592 | PHY_11AGN_MIXED, // if check 802.11b. 10 | |
593 | PHY_11N_5G, // 11n-only with 5G band 11 | |
91980990 GKH |
594 | } RT_802_11_PHY_MODE; |
595 | ||
596 | // put all proprietery for-query objects here to reduce # of Query_OID | |
597 | typedef struct _RT_802_11_LINK_STATUS { | |
598 | ULONG CurrTxRate; // in units of 0.5Mbps | |
599 | ULONG ChannelQuality; // 0..100 % | |
600 | ULONG TxByteCount; // both ok and fail | |
601 | ULONG RxByteCount; // both ok and fail | |
602 | ULONG CentralChannel; // 40MHz central channel number | |
603 | } RT_802_11_LINK_STATUS, *PRT_802_11_LINK_STATUS; | |
604 | ||
605 | typedef struct _RT_802_11_EVENT_LOG { | |
606 | LARGE_INTEGER SystemTime; // timestammp via NdisGetCurrentSystemTime() | |
607 | UCHAR Addr[MAC_ADDR_LENGTH]; | |
608 | USHORT Event; // EVENT_xxx | |
609 | } RT_802_11_EVENT_LOG, *PRT_802_11_EVENT_LOG; | |
610 | ||
611 | typedef struct _RT_802_11_EVENT_TABLE { | |
612 | ULONG Num; | |
613 | ULONG Rsv; // to align Log[] at LARGE_INEGER boundary | |
614 | RT_802_11_EVENT_LOG Log[MAX_NUMBER_OF_EVENT]; | |
615 | } RT_802_11_EVENT_TABLE, PRT_802_11_EVENT_TABLE; | |
616 | ||
617 | // MIMO Tx parameter, ShortGI, MCS, STBC, etc. these are fields in TXWI. Don't change this definition!!! | |
618 | typedef union _MACHTTRANSMIT_SETTING { | |
619 | struct { | |
620 | USHORT MCS:7; // MCS | |
621 | USHORT BW:1; //channel bandwidth 20MHz or 40 MHz | |
622 | USHORT ShortGI:1; | |
623 | USHORT STBC:2; //SPACE | |
624 | USHORT rsv:3; | |
625 | USHORT MODE:2; // Use definition MODE_xxx. | |
626 | } field; | |
627 | USHORT word; | |
628 | } MACHTTRANSMIT_SETTING, *PMACHTTRANSMIT_SETTING; | |
629 | ||
630 | typedef struct _RT_802_11_MAC_ENTRY { | |
631 | UCHAR Addr[MAC_ADDR_LENGTH]; | |
632 | UCHAR Aid; | |
633 | UCHAR Psm; // 0:PWR_ACTIVE, 1:PWR_SAVE | |
634 | UCHAR MimoPs; // 0:MMPS_STATIC, 1:MMPS_DYNAMIC, 3:MMPS_Enabled | |
635 | CHAR AvgRssi0; | |
636 | CHAR AvgRssi1; | |
637 | CHAR AvgRssi2; | |
638 | UINT32 ConnectedTime; | |
639 | MACHTTRANSMIT_SETTING TxRate; | |
640 | } RT_802_11_MAC_ENTRY, *PRT_802_11_MAC_ENTRY; | |
641 | ||
642 | typedef struct _RT_802_11_MAC_TABLE { | |
643 | ULONG Num; | |
644 | RT_802_11_MAC_ENTRY Entry[MAX_NUMBER_OF_MAC]; | |
645 | } RT_802_11_MAC_TABLE, *PRT_802_11_MAC_TABLE; | |
646 | ||
647 | // structure for query/set hardware register - MAC, BBP, RF register | |
648 | typedef struct _RT_802_11_HARDWARE_REGISTER { | |
649 | ULONG HardwareType; // 0:MAC, 1:BBP, 2:RF register, 3:EEPROM | |
650 | ULONG Offset; // Q/S register offset addr | |
651 | ULONG Data; // R/W data buffer | |
652 | } RT_802_11_HARDWARE_REGISTER, *PRT_802_11_HARDWARE_REGISTER; | |
653 | ||
654 | typedef struct _RT_802_11_AP_CONFIG { | |
655 | ULONG EnableTxBurst; // 0-disable, 1-enable | |
656 | ULONG EnableTurboRate; // 0-disable, 1-enable 72/100mbps turbo rate | |
657 | ULONG IsolateInterStaTraffic; // 0-disable, 1-enable isolation | |
658 | ULONG HideSsid; // 0-disable, 1-enable hiding | |
659 | ULONG UseBGProtection; // 0-AUTO, 1-always ON, 2-always OFF | |
660 | ULONG UseShortSlotTime; // 0-no use, 1-use 9-us short slot time | |
661 | ULONG Rsv1; // must be 0 | |
662 | ULONG SystemErrorBitmap; // ignore upon SET, return system error upon QUERY | |
663 | } RT_802_11_AP_CONFIG, *PRT_802_11_AP_CONFIG; | |
664 | ||
665 | // structure to query/set STA_CONFIG | |
666 | typedef struct _RT_802_11_STA_CONFIG { | |
667 | ULONG EnableTxBurst; // 0-disable, 1-enable | |
668 | ULONG EnableTurboRate; // 0-disable, 1-enable 72/100mbps turbo rate | |
669 | ULONG UseBGProtection; // 0-AUTO, 1-always ON, 2-always OFF | |
670 | ULONG UseShortSlotTime; // 0-no use, 1-use 9-us short slot time when applicable | |
671 | ULONG AdhocMode; // 0-11b rates only (WIFI spec), 1 - b/g mixed, 2 - g only | |
672 | ULONG HwRadioStatus; // 0-OFF, 1-ON, default is 1, Read-Only | |
673 | ULONG Rsv1; // must be 0 | |
674 | ULONG SystemErrorBitmap; // ignore upon SET, return system error upon QUERY | |
675 | } RT_802_11_STA_CONFIG, *PRT_802_11_STA_CONFIG; | |
676 | ||
677 | // | |
678 | // For OID Query or Set about BA structure | |
679 | // | |
680 | typedef struct _OID_BACAP_STRUC { | |
681 | UCHAR RxBAWinLimit; | |
682 | UCHAR TxBAWinLimit; | |
683 | UCHAR Policy; // 0: DELAY_BA 1:IMMED_BA (//BA Policy subfiled value in ADDBA frame) 2:BA-not use. other value invalid | |
684 | UCHAR MpduDensity; // 0: DELAY_BA 1:IMMED_BA (//BA Policy subfiled value in ADDBA frame) 2:BA-not use. other value invalid | |
685 | UCHAR AmsduEnable; //Enable AMSDU transmisstion | |
686 | UCHAR AmsduSize; // 0:3839, 1:7935 bytes. UINT MSDUSizeToBytes[] = { 3839, 7935}; | |
687 | UCHAR MMPSmode; // MIMO power save more, 0:static, 1:dynamic, 2:rsv, 3:mimo enable | |
688 | BOOLEAN AutoBA; // Auto BA will automatically | |
689 | } OID_BACAP_STRUC, *POID_BACAP_STRUC; | |
690 | ||
691 | typedef struct _RT_802_11_ACL_ENTRY { | |
692 | UCHAR Addr[MAC_ADDR_LENGTH]; | |
693 | USHORT Rsv; | |
694 | } RT_802_11_ACL_ENTRY, *PRT_802_11_ACL_ENTRY; | |
695 | ||
696 | typedef struct PACKED _RT_802_11_ACL { | |
697 | ULONG Policy; // 0-disable, 1-positive list, 2-negative list | |
698 | ULONG Num; | |
699 | RT_802_11_ACL_ENTRY Entry[MAX_NUMBER_OF_ACL]; | |
700 | } RT_802_11_ACL, *PRT_802_11_ACL; | |
701 | ||
702 | typedef struct _RT_802_11_WDS { | |
703 | ULONG Num; | |
704 | NDIS_802_11_MAC_ADDRESS Entry[24/*MAX_NUM_OF_WDS_LINK*/]; | |
705 | ULONG KeyLength; | |
706 | UCHAR KeyMaterial[32]; | |
707 | } RT_802_11_WDS, *PRT_802_11_WDS; | |
708 | ||
709 | typedef struct _RT_802_11_TX_RATES_ { | |
710 | UCHAR SupRateLen; | |
711 | UCHAR SupRate[MAX_LENGTH_OF_SUPPORT_RATES]; | |
712 | UCHAR ExtRateLen; | |
713 | UCHAR ExtRate[MAX_LENGTH_OF_SUPPORT_RATES]; | |
714 | } RT_802_11_TX_RATES, *PRT_802_11_TX_RATES; | |
715 | ||
716 | ||
717 | // Definition of extra information code | |
718 | #define GENERAL_LINK_UP 0x0 // Link is Up | |
719 | #define GENERAL_LINK_DOWN 0x1 // Link is Down | |
720 | #define HW_RADIO_OFF 0x2 // Hardware radio off | |
721 | #define SW_RADIO_OFF 0x3 // Software radio off | |
722 | #define AUTH_FAIL 0x4 // Open authentication fail | |
723 | #define AUTH_FAIL_KEYS 0x5 // Shared authentication fail | |
724 | #define ASSOC_FAIL 0x6 // Association failed | |
725 | #define EAP_MIC_FAILURE 0x7 // Deauthencation because MIC failure | |
726 | #define EAP_4WAY_TIMEOUT 0x8 // Deauthencation on 4-way handshake timeout | |
727 | #define EAP_GROUP_KEY_TIMEOUT 0x9 // Deauthencation on group key handshake timeout | |
728 | #define EAP_SUCCESS 0xa // EAP succeed | |
729 | #define DETECT_RADAR_SIGNAL 0xb // Radar signal occur in current channel | |
730 | #define EXTRA_INFO_MAX 0xb // Indicate Last OID | |
731 | ||
732 | #define EXTRA_INFO_CLEAR 0xffffffff | |
733 | ||
734 | // This is OID setting structure. So only GF or MM as Mode. This is valid when our wirelss mode has 802.11n in use. | |
735 | typedef struct { | |
736 | RT_802_11_PHY_MODE PhyMode; // | |
737 | UCHAR TransmitNo; | |
738 | UCHAR HtMode; //HTMODE_GF or HTMODE_MM | |
739 | UCHAR ExtOffset; //extension channel above or below | |
740 | UCHAR MCS; | |
741 | UCHAR BW; | |
742 | UCHAR STBC; | |
743 | UCHAR SHORTGI; | |
744 | UCHAR rsv; | |
745 | } OID_SET_HT_PHYMODE, *POID_SET_HT_PHYMODE; | |
746 | ||
747 | #ifdef LLTD_SUPPORT | |
748 | typedef struct _RT_LLTD_ASSOICATION_ENTRY { | |
749 | UCHAR Addr[ETH_LENGTH_OF_ADDRESS]; | |
750 | unsigned short MOR; // maximum operational rate | |
751 | UCHAR phyMode; | |
752 | } RT_LLTD_ASSOICATION_ENTRY, *PRT_LLTD_ASSOICATION_ENTRY; | |
753 | ||
754 | typedef struct _RT_LLTD_ASSOICATION_TABLE { | |
755 | unsigned int Num; | |
756 | RT_LLTD_ASSOICATION_ENTRY Entry[MAX_NUMBER_OF_MAC]; | |
757 | } RT_LLTD_ASSOICATION_TABLE, *PRT_LLTD_ASSOICATION_TABLE; | |
758 | #endif // LLTD_SUPPORT // | |
759 | ||
91980990 GKH |
760 | #define MAX_CUSTOM_LEN 128 |
761 | ||
91980990 GKH |
762 | typedef enum _RT_802_11_D_CLIENT_MODE |
763 | { | |
764 | Rt802_11_D_None, | |
765 | Rt802_11_D_Flexible, | |
766 | Rt802_11_D_Strict, | |
767 | } RT_802_11_D_CLIENT_MODE, *PRT_802_11_D_CLIENT_MODE; | |
91980990 GKH |
768 | |
769 | typedef struct _RT_CHANNEL_LIST_INFO | |
770 | { | |
771 | UCHAR ChannelList[MAX_NUM_OF_CHS]; // list all supported channels for site survey | |
772 | UCHAR ChannelListNum; // number of channel in ChannelList[] | |
773 | } RT_CHANNEL_LIST_INFO, *PRT_CHANNEL_LIST_INFO; | |
774 | ||
3a32ed12 BZ |
775 | #ifdef RT2870 |
776 | // WSC configured credential | |
777 | typedef struct _WSC_CREDENTIAL | |
778 | { | |
779 | NDIS_802_11_SSID SSID; // mandatory | |
780 | USHORT AuthType; // mandatory, 1: open, 2: wpa-psk, 4: shared, 8:wpa, 0x10: wpa2, 0x20: wpa2-psk | |
781 | USHORT EncrType; // mandatory, 1: none, 2: wep, 4: tkip, 8: aes | |
782 | UCHAR Key[64]; // mandatory, Maximum 64 byte | |
783 | USHORT KeyLength; | |
784 | UCHAR MacAddr[6]; // mandatory, AP MAC address | |
785 | UCHAR KeyIndex; // optional, default is 1 | |
786 | UCHAR Rsvd[3]; // Make alignment | |
787 | } WSC_CREDENTIAL, *PWSC_CREDENTIAL; | |
788 | ||
789 | // WSC configured profiles | |
790 | typedef struct _WSC_PROFILE | |
791 | { | |
792 | UINT ProfileCnt; | |
793 | WSC_CREDENTIAL Profile[8]; // Support up to 8 profiles | |
794 | } WSC_PROFILE, *PWSC_PROFILE; | |
795 | #endif | |
91980990 GKH |
796 | |
797 | #endif // _OID_H_ | |
798 |