Staging: rt28x0: fix comments in *.h files
[safe/jmp/linux-2.6] / drivers / staging / rt2860 / oid.h
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 /*#include <linux/wireless.h> */
41
42 #ifndef TRUE
43 #define TRUE                            1
44 #endif
45 #ifndef FALSE
46 #define FALSE                           0
47 #endif
48 /* */
49 /* IEEE 802.11 Structures and definitions */
50 /* */
51 #define MAX_TX_POWER_LEVEL              100     /* mW */
52 #define MAX_RSSI_TRIGGER                -10     /* dBm */
53 #define MIN_RSSI_TRIGGER                -200    /* dBm */
54 #define MAX_FRAG_THRESHOLD              2346    /* byte count */
55 #define MIN_FRAG_THRESHOLD              256     /* byte count */
56 #define MAX_RTS_THRESHOLD               2347    /* byte count */
57
58 /* new types for Media Specific Indications */
59 /* Extension channel offset */
60 #define EXTCHA_NONE                     0
61 #define EXTCHA_ABOVE            0x1
62 #define EXTCHA_BELOW            0x3
63
64 /* BW */
65 #define BAND_WIDTH_20           0
66 #define BAND_WIDTH_40           1
67 #define BAND_WIDTH_BOTH         2
68 #define BAND_WIDTH_10           3       /* 802.11j has 10MHz. This definition is for internal usage. doesn't fill in the IE or other field. */
69 /* SHORTGI */
70 #define GAP_INTERVAL_400        1       /* only support in HT mode */
71 #define GAP_INTERVAL_800        0
72 #define GAP_INTERVAL_BOTH       2
73
74 #define NdisMediaStateConnected                 1
75 #define NdisMediaStateDisconnected              0
76
77 #define NDIS_802_11_LENGTH_SSID         32
78 #define NDIS_802_11_LENGTH_RATES        8
79 #define NDIS_802_11_LENGTH_RATES_EX     16
80 #define MAC_ADDR_LENGTH                 6
81 /*#define MAX_NUM_OF_CHS                                        49 // 14 channels @2.4G +  12@UNII + 4 @MMAC + 11 @HiperLAN2 + 7 @Japan + 1 as NULL terminationc */
82 #define MAX_NUM_OF_CHS                          54      /* 14 channels @2.4G +  12@UNII(lower/middle) + 16@HiperLAN2 + 11@UNII(upper) + 0 @Japan + 1 as NULL termination */
83 #define MAX_NUMBER_OF_EVENT                             10      /* entry # in EVENT table */
84 #define MAX_NUMBER_OF_MAC                               32      /* if MAX_MBSSID_NUM is 8, this value can't be larger than 211 */
85 #define MAX_NUMBER_OF_ACL                               64
86 #define MAX_LENGTH_OF_SUPPORT_RATES             12      /* 1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54 */
87 #define MAX_NUMBER_OF_DLS_ENTRY                 4
88
89 #define RT_QUERY_SIGNAL_CONTEXT                         0x0402
90 #define RT_SET_IAPP_PID                         0x0404
91 #define RT_SET_APD_PID                                          0x0405
92 #define RT_SET_DEL_MAC_ENTRY                            0x0406
93 #define RT_QUERY_EVENT_TABLE                    0x0407
94 /* */
95 /* IEEE 802.11 OIDs */
96 /* */
97 #define OID_GET_SET_TOGGLE                      0x8000
98 #define OID_GET_SET_FROM_UI                     0x4000
99
100 #define OID_802_11_ADD_WEP                      0x0112
101 #define OID_802_11_DISASSOCIATE                 0x0114
102 #define OID_802_11_BSSID_LIST_SCAN              0x0508
103 #define OID_802_11_SSID                         0x0509
104 #define OID_802_11_BSSID                        0x050A
105 #define OID_802_11_MIC_FAILURE_REPORT_FRAME     0x0528
106
107 #define RT_OID_DEVICE_NAME                                                      0x0607
108 #define RT_OID_VERSION_INFO                                                     0x0608
109 #define OID_802_11_BSSID_LIST                                           0x0609
110 #define OID_802_3_CURRENT_ADDRESS                                       0x060A
111 #define OID_GEN_MEDIA_CONNECT_STATUS                            0x060B
112 #define RT_OID_802_11_QUERY_LINK_STATUS                         0x060C
113 #define OID_802_11_RSSI                                                         0x060D
114 #define OID_802_11_STATISTICS                                           0x060E
115 #define OID_GEN_RCV_OK                                                          0x060F
116 #define OID_GEN_RCV_NO_BUFFER                                           0x0610
117 #define RT_OID_802_11_QUERY_EEPROM_VERSION                      0x0611
118 #define RT_OID_802_11_QUERY_FIRMWARE_VERSION            0x0612
119 #define RT_OID_802_11_QUERY_LAST_RX_RATE                        0x0613
120 #define RT_OID_802_11_TX_POWER_LEVEL_1                          0x0614
121 #define RT_OID_802_11_QUERY_PIDVID                                      0x0615
122 /*for WPA_SUPPLICANT_SUPPORT */
123 #define OID_SET_COUNTERMEASURES                     0x0616
124 #define RT_OID_WPA_SUPPLICANT_SUPPORT               0x0621
125 #define RT_OID_WE_VERSION_COMPILED                  0x0622
126 #define RT_OID_NEW_DRIVER                           0x0623
127
128 #define RT_OID_DRIVER_DEVICE_NAME                   0x0645
129 #define RT_OID_QUERY_MULTIPLE_CARD_SUPPORT          0x0647
130
131 typedef enum _NDIS_802_11_STATUS_TYPE {
132         Ndis802_11StatusType_Authentication,
133         Ndis802_11StatusType_MediaStreamMode,
134         Ndis802_11StatusType_PMKID_CandidateList,
135         Ndis802_11StatusTypeMax /* not a real type, defined as an upper bound */
136 } NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE;
137
138 typedef UCHAR NDIS_802_11_MAC_ADDRESS[6];
139
140 typedef struct _NDIS_802_11_STATUS_INDICATION {
141         NDIS_802_11_STATUS_TYPE StatusType;
142 } NDIS_802_11_STATUS_INDICATION, *PNDIS_802_11_STATUS_INDICATION;
143
144 /* mask for authentication/integrity fields */
145 #define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS        0x0f
146
147 #define NDIS_802_11_AUTH_REQUEST_REAUTH             0x01
148 #define NDIS_802_11_AUTH_REQUEST_KEYUPDATE          0x02
149 #define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR     0x06
150 #define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR        0x0E
151
152 typedef struct _NDIS_802_11_AUTHENTICATION_REQUEST {
153         ULONG Length;           /* Length of structure */
154         NDIS_802_11_MAC_ADDRESS Bssid;
155         ULONG Flags;
156 } NDIS_802_11_AUTHENTICATION_REQUEST, *PNDIS_802_11_AUTHENTICATION_REQUEST;
157
158 /*Added new types for PMKID Candidate lists. */
159 typedef struct _PMKID_CANDIDATE {
160         NDIS_802_11_MAC_ADDRESS BSSID;
161         ULONG Flags;
162 } PMKID_CANDIDATE, *PPMKID_CANDIDATE;
163
164 typedef struct _NDIS_802_11_PMKID_CANDIDATE_LIST {
165         ULONG Version;          /* Version of the structure */
166         ULONG NumCandidates;    /* No. of pmkid candidates */
167         PMKID_CANDIDATE CandidateList[1];
168 } NDIS_802_11_PMKID_CANDIDATE_LIST, *PNDIS_802_11_PMKID_CANDIDATE_LIST;
169
170 /*Flags for PMKID Candidate list structure */
171 #define NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED     0x01
172
173 /* Added new types for OFDM 5G and 2.4G */
174 typedef enum _NDIS_802_11_NETWORK_TYPE {
175         Ndis802_11FH,
176         Ndis802_11DS,
177         Ndis802_11OFDM5,
178         Ndis802_11OFDM24,
179         Ndis802_11Automode,
180         Ndis802_11OFDM5_N,
181         Ndis802_11OFDM24_N,
182         Ndis802_11NetworkTypeMax        /* not a real type, defined as an upper bound */
183 } NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE;
184
185 typedef struct _NDIS_802_11_NETWORK_TYPE_LIST {
186         UINT NumberOfItems;     /* in list below, at least 1 */
187         NDIS_802_11_NETWORK_TYPE NetworkType[1];
188 } NDIS_802_11_NETWORK_TYPE_LIST, *PNDIS_802_11_NETWORK_TYPE_LIST;
189
190 typedef enum _NDIS_802_11_POWER_MODE {
191         Ndis802_11PowerModeCAM,
192         Ndis802_11PowerModeMAX_PSP,
193         Ndis802_11PowerModeFast_PSP,
194         Ndis802_11PowerModeLegacy_PSP,
195         Ndis802_11PowerModeMax  /* not a real mode, defined as an upper bound */
196 } NDIS_802_11_POWER_MODE, *PNDIS_802_11_POWER_MODE;
197
198 typedef ULONG NDIS_802_11_TX_POWER_LEVEL;       /* in milliwatts */
199
200 /* */
201 /* Received Signal Strength Indication */
202 /* */
203 typedef LONG NDIS_802_11_RSSI;  /* in dBm */
204
205 typedef struct _NDIS_802_11_CONFIGURATION_FH {
206         ULONG Length;           /* Length of structure */
207         ULONG HopPattern;       /* As defined by 802.11, MSB set */
208         ULONG HopSet;           /* to one if non-802.11 */
209         ULONG DwellTime;        /* units are Kusec */
210 } NDIS_802_11_CONFIGURATION_FH, *PNDIS_802_11_CONFIGURATION_FH;
211
212 typedef struct _NDIS_802_11_CONFIGURATION {
213         ULONG Length;           /* Length of structure */
214         ULONG BeaconPeriod;     /* units are Kusec */
215         ULONG ATIMWindow;       /* units are Kusec */
216         ULONG DSConfig;         /* Frequency, units are kHz */
217         NDIS_802_11_CONFIGURATION_FH FHConfig;
218 } NDIS_802_11_CONFIGURATION, *PNDIS_802_11_CONFIGURATION;
219
220 typedef struct _NDIS_802_11_STATISTICS {
221         ULONG Length;           /* Length of structure */
222         LARGE_INTEGER TransmittedFragmentCount;
223         LARGE_INTEGER MulticastTransmittedFrameCount;
224         LARGE_INTEGER FailedCount;
225         LARGE_INTEGER RetryCount;
226         LARGE_INTEGER MultipleRetryCount;
227         LARGE_INTEGER RTSSuccessCount;
228         LARGE_INTEGER RTSFailureCount;
229         LARGE_INTEGER ACKFailureCount;
230         LARGE_INTEGER FrameDuplicateCount;
231         LARGE_INTEGER ReceivedFragmentCount;
232         LARGE_INTEGER MulticastReceivedFrameCount;
233         LARGE_INTEGER FCSErrorCount;
234         LARGE_INTEGER TKIPLocalMICFailures;
235         LARGE_INTEGER TKIPRemoteMICErrors;
236         LARGE_INTEGER TKIPICVErrors;
237         LARGE_INTEGER TKIPCounterMeasuresInvoked;
238         LARGE_INTEGER TKIPReplays;
239         LARGE_INTEGER CCMPFormatErrors;
240         LARGE_INTEGER CCMPReplays;
241         LARGE_INTEGER CCMPDecryptErrors;
242         LARGE_INTEGER FourWayHandshakeFailures;
243 } NDIS_802_11_STATISTICS, *PNDIS_802_11_STATISTICS;
244
245 typedef ULONG NDIS_802_11_KEY_INDEX;
246 typedef ULONGLONG NDIS_802_11_KEY_RSC;
247
248 #define MAX_RADIUS_SRV_NUM                      2       /* 802.1x failover number */
249
250 typedef struct PACKED _RADIUS_SRV_INFO {
251         UINT32 radius_ip;
252         UINT32 radius_port;
253         UCHAR radius_key[64];
254         UCHAR radius_key_len;
255 } RADIUS_SRV_INFO, *PRADIUS_SRV_INFO;
256
257 typedef struct PACKED _RADIUS_KEY_INFO {
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         UINT32 Length;          /* Length of this structure */
269         UCHAR mbss_num;         /* indicate multiple BSS number */
270         UINT32 own_ip_addr;
271         UINT32 retry_interval;
272         UINT32 session_timeout_interval;
273         UCHAR EAPifname[8][IFNAMSIZ];
274         UCHAR EAPifname_len[8];
275         UCHAR PreAuthifname[8][IFNAMSIZ];
276         UCHAR PreAuthifname_len[8];
277         RADIUS_KEY_INFO RadiusInfo[8];
278 } RADIUS_CONF, *PRADIUS_CONF;
279
280 /* Key mapping keys require a BSSID */
281 typedef struct _NDIS_802_11_KEY {
282         UINT Length;            /* Length of this structure */
283         UINT KeyIndex;
284         UINT KeyLength;         /* length of key in bytes */
285         NDIS_802_11_MAC_ADDRESS BSSID;
286         NDIS_802_11_KEY_RSC KeyRSC;
287         UCHAR KeyMaterial[1];   /* variable length depending on above field */
288 } NDIS_802_11_KEY, *PNDIS_802_11_KEY;
289
290 typedef struct _NDIS_802_11_PASSPHRASE {
291         UINT KeyLength;         /* length of key in bytes */
292         NDIS_802_11_MAC_ADDRESS BSSID;
293         UCHAR KeyMaterial[1];   /* variable length depending on above field */
294 } NDIS_802_11_PASSPHRASE, *PNDIS_802_11_PASSPHRASE;
295
296 typedef struct _NDIS_802_11_REMOVE_KEY {
297         UINT Length;            /* Length of this structure */
298         UINT KeyIndex;
299         NDIS_802_11_MAC_ADDRESS BSSID;
300 } NDIS_802_11_REMOVE_KEY, *PNDIS_802_11_REMOVE_KEY;
301
302 typedef struct _NDIS_802_11_WEP {
303         UINT Length;            /* Length of this structure */
304         UINT KeyIndex;          /* 0 is the per-client key, 1-N are the */
305         /* global keys */
306         UINT KeyLength;         /* length of key in bytes */
307         UCHAR KeyMaterial[1];   /* variable length depending on above field */
308 } NDIS_802_11_WEP, *PNDIS_802_11_WEP;
309
310 typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE {
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         Ndis802_11AuthModeOpen,
321         Ndis802_11AuthModeShared,
322         Ndis802_11AuthModeAutoSwitch,
323         Ndis802_11AuthModeWPA,
324         Ndis802_11AuthModeWPAPSK,
325         Ndis802_11AuthModeWPANone,
326         Ndis802_11AuthModeWPA2,
327         Ndis802_11AuthModeWPA2PSK,
328         Ndis802_11AuthModeWPA1WPA2,
329         Ndis802_11AuthModeWPA1PSKWPA2PSK,
330         Ndis802_11AuthModeMax   /* Not a real mode, defined as upper bound */
331 } NDIS_802_11_AUTHENTICATION_MODE, *PNDIS_802_11_AUTHENTICATION_MODE;
332
333 typedef UCHAR NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES];      /* Set of 8 data rates */
334 typedef UCHAR NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX];        /* Set of 16 data rates */
335
336 typedef struct PACKED _NDIS_802_11_SSID {
337         UINT SsidLength;        /* length of SSID field below, in bytes; */
338         /* this can be zero. */
339         UCHAR Ssid[NDIS_802_11_LENGTH_SSID];    /* SSID information field */
340 } NDIS_802_11_SSID, *PNDIS_802_11_SSID;
341
342 typedef struct PACKED _NDIS_WLAN_BSSID {
343         ULONG Length;           /* Length of this structure */
344         NDIS_802_11_MAC_ADDRESS MacAddress;     /* BSSID */
345         UCHAR Reserved[2];
346         NDIS_802_11_SSID Ssid;  /* SSID */
347         ULONG Privacy;          /* WEP encryption requirement */
348         NDIS_802_11_RSSI Rssi;  /* receive signal strength in dBm */
349         NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
350         NDIS_802_11_CONFIGURATION Configuration;
351         NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
352         NDIS_802_11_RATES SupportedRates;
353 } NDIS_WLAN_BSSID, *PNDIS_WLAN_BSSID;
354
355 typedef struct PACKED _NDIS_802_11_BSSID_LIST {
356         UINT NumberOfItems;     /* in list below, at least 1 */
357         NDIS_WLAN_BSSID Bssid[1];
358 } NDIS_802_11_BSSID_LIST, *PNDIS_802_11_BSSID_LIST;
359
360 /* Added Capabilities, IELength and IEs for each BSSID */
361 typedef struct PACKED _NDIS_WLAN_BSSID_EX {
362         ULONG Length;           /* Length of this structure */
363         NDIS_802_11_MAC_ADDRESS MacAddress;     /* BSSID */
364         UCHAR Reserved[2];
365         NDIS_802_11_SSID Ssid;  /* SSID */
366         UINT Privacy;           /* WEP encryption requirement */
367         NDIS_802_11_RSSI Rssi;  /* receive signal */
368         /* strength in dBm */
369         NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
370         NDIS_802_11_CONFIGURATION Configuration;
371         NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
372         NDIS_802_11_RATES_EX SupportedRates;
373         ULONG IELength;
374         UCHAR IEs[1];
375 } NDIS_WLAN_BSSID_EX, *PNDIS_WLAN_BSSID_EX;
376
377 typedef struct PACKED _NDIS_802_11_BSSID_LIST_EX {
378         UINT NumberOfItems;     /* in list below, at least 1 */
379         NDIS_WLAN_BSSID_EX Bssid[1];
380 } NDIS_802_11_BSSID_LIST_EX, *PNDIS_802_11_BSSID_LIST_EX;
381
382 typedef struct PACKED _NDIS_802_11_FIXED_IEs {
383         UCHAR Timestamp[8];
384         USHORT BeaconInterval;
385         USHORT Capabilities;
386 } NDIS_802_11_FIXED_IEs, *PNDIS_802_11_FIXED_IEs;
387
388 typedef struct _NDIS_802_11_VARIABLE_IEs {
389         UCHAR ElementID;
390         UCHAR Length;           /* Number of bytes in data field */
391         UCHAR data[1];
392 } NDIS_802_11_VARIABLE_IEs, *PNDIS_802_11_VARIABLE_IEs;
393
394 typedef ULONG NDIS_802_11_FRAGMENTATION_THRESHOLD;
395
396 typedef ULONG NDIS_802_11_RTS_THRESHOLD;
397
398 typedef ULONG NDIS_802_11_ANTENNA;
399
400 typedef enum _NDIS_802_11_PRIVACY_FILTER {
401         Ndis802_11PrivFilterAcceptAll,
402         Ndis802_11PrivFilter8021xWEP
403 } NDIS_802_11_PRIVACY_FILTER, *PNDIS_802_11_PRIVACY_FILTER;
404
405 /* Added new encryption types */
406 /* Also aliased typedef to new name */
407 typedef enum _NDIS_802_11_WEP_STATUS {
408         Ndis802_11WEPEnabled,
409         Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
410         Ndis802_11WEPDisabled,
411         Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
412         Ndis802_11WEPKeyAbsent,
413         Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
414         Ndis802_11WEPNotSupported,
415         Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
416         Ndis802_11Encryption2Enabled,
417         Ndis802_11Encryption2KeyAbsent,
418         Ndis802_11Encryption3Enabled,
419         Ndis802_11Encryption3KeyAbsent,
420         Ndis802_11Encryption4Enabled,   /* TKIP or AES mix */
421         Ndis802_11Encryption4KeyAbsent,
422         Ndis802_11GroupWEP40Enabled,
423         Ndis802_11GroupWEP104Enabled,
424 } NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS,
425     NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS;
426
427 typedef enum _NDIS_802_11_RELOAD_DEFAULTS {
428         Ndis802_11ReloadWEPKeys
429 } NDIS_802_11_RELOAD_DEFAULTS, *PNDIS_802_11_RELOAD_DEFAULTS;
430
431 #define NDIS_802_11_AI_REQFI_CAPABILITIES      1
432 #define NDIS_802_11_AI_REQFI_LISTENINTERVAL    2
433 #define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS  4
434
435 #define NDIS_802_11_AI_RESFI_CAPABILITIES      1
436 #define NDIS_802_11_AI_RESFI_STATUSCODE        2
437 #define NDIS_802_11_AI_RESFI_ASSOCIATIONID     4
438
439 typedef struct _NDIS_802_11_AI_REQFI {
440         USHORT Capabilities;
441         USHORT ListenInterval;
442         NDIS_802_11_MAC_ADDRESS CurrentAPAddress;
443 } NDIS_802_11_AI_REQFI, *PNDIS_802_11_AI_REQFI;
444
445 typedef struct _NDIS_802_11_AI_RESFI {
446         USHORT Capabilities;
447         USHORT StatusCode;
448         USHORT AssociationId;
449 } NDIS_802_11_AI_RESFI, *PNDIS_802_11_AI_RESFI;
450
451 typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION {
452         ULONG Length;
453         USHORT AvailableRequestFixedIEs;
454         NDIS_802_11_AI_REQFI RequestFixedIEs;
455         ULONG RequestIELength;
456         ULONG OffsetRequestIEs;
457         USHORT AvailableResponseFixedIEs;
458         NDIS_802_11_AI_RESFI ResponseFixedIEs;
459         ULONG ResponseIELength;
460         ULONG OffsetResponseIEs;
461 } NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION;
462
463 typedef struct _NDIS_802_11_AUTHENTICATION_EVENT {
464         NDIS_802_11_STATUS_INDICATION Status;
465         NDIS_802_11_AUTHENTICATION_REQUEST Request[1];
466 } NDIS_802_11_AUTHENTICATION_EVENT, *PNDIS_802_11_AUTHENTICATION_EVENT;
467
468 /* 802.11 Media stream constraints, associated with OID_802_11_MEDIA_STREAM_MODE */
469 typedef enum _NDIS_802_11_MEDIA_STREAM_MODE {
470         Ndis802_11MediaStreamOff,
471         Ndis802_11MediaStreamOn,
472 } NDIS_802_11_MEDIA_STREAM_MODE, *PNDIS_802_11_MEDIA_STREAM_MODE;
473
474 /* PMKID Structures */
475 typedef UCHAR NDIS_802_11_PMKID_VALUE[16];
476
477 typedef struct _BSSID_INFO {
478         NDIS_802_11_MAC_ADDRESS BSSID;
479         NDIS_802_11_PMKID_VALUE PMKID;
480 } BSSID_INFO, *PBSSID_INFO;
481
482 typedef struct _NDIS_802_11_PMKID {
483         UINT Length;
484         UINT BSSIDInfoCount;
485         BSSID_INFO BSSIDInfo[1];
486 } NDIS_802_11_PMKID, *PNDIS_802_11_PMKID;
487
488 typedef struct _NDIS_802_11_AUTHENTICATION_ENCRYPTION {
489         NDIS_802_11_AUTHENTICATION_MODE AuthModeSupported;
490         NDIS_802_11_ENCRYPTION_STATUS EncryptStatusSupported;
491 } NDIS_802_11_AUTHENTICATION_ENCRYPTION,
492     *PNDIS_802_11_AUTHENTICATION_ENCRYPTION;
493
494 typedef struct _NDIS_802_11_CAPABILITY {
495         ULONG Length;
496         ULONG Version;
497         ULONG NoOfPMKIDs;
498         ULONG NoOfAuthEncryptPairsSupported;
499         NDIS_802_11_AUTHENTICATION_ENCRYPTION
500             AuthenticationEncryptionSupported[1];
501 } NDIS_802_11_CAPABILITY, *PNDIS_802_11_CAPABILITY;
502
503 #define RT_PRIV_IOCTL                                                   (SIOCIWFIRSTPRIV + 0x01)        /* Sync. with AP for wsc upnp daemon */
504 #define RTPRIV_IOCTL_SET                                                        (SIOCIWFIRSTPRIV + 0x02)
505
506 #define RTPRIV_IOCTL_STATISTICS                     (SIOCIWFIRSTPRIV + 0x09)
507 #define RTPRIV_IOCTL_ADD_PMKID_CACHE                (SIOCIWFIRSTPRIV + 0x0A)
508 #define RTPRIV_IOCTL_RADIUS_DATA                    (SIOCIWFIRSTPRIV + 0x0C)
509 #define RTPRIV_IOCTL_GSITESURVEY                                        (SIOCIWFIRSTPRIV + 0x0D)
510 #define RT_PRIV_IOCTL_EXT                                                       (SIOCIWFIRSTPRIV + 0x0E)        /* Sync. with RT61 (for wpa_supplicant) */
511 #define RTPRIV_IOCTL_GET_MAC_TABLE                                      (SIOCIWFIRSTPRIV + 0x0F)
512
513 #define RTPRIV_IOCTL_SHOW                                                       (SIOCIWFIRSTPRIV + 0x11)
514 enum {
515         SHOW_CONN_STATUS = 4,
516         SHOW_DRVIER_VERION = 5,
517         SHOW_BA_INFO = 6,
518         SHOW_DESC_INFO = 7,
519 #ifdef RTMP_MAC_USB
520         SHOW_RXBULK_INFO = 8,
521         SHOW_TXBULK_INFO = 9,
522 #endif /* RTMP_MAC_USB // */
523         RAIO_OFF = 10,
524         RAIO_ON = 11,
525         SHOW_CFG_VALUE = 20,
526         SHOW_ADHOC_ENTRY_INFO = 21,
527 };
528
529 #define OID_802_11_BUILD_CHANNEL_EX                             0x0714
530 #define OID_802_11_GET_CH_LIST                                  0x0715
531 #define OID_802_11_GET_COUNTRY_CODE                             0x0716
532 #define OID_802_11_GET_CHANNEL_GEOGRAPHY                0x0717
533
534 #define RT_OID_WSC_SET_PASSPHRASE                   0x0740      /* passphrase for wpa(2)-psk */
535 #define RT_OID_WSC_DRIVER_AUTO_CONNECT              0x0741
536 #define RT_OID_WSC_QUERY_DEFAULT_PROFILE            0x0742
537 #define RT_OID_WSC_SET_CONN_BY_PROFILE_INDEX        0x0743
538 #define RT_OID_WSC_SET_ACTION                       0x0744
539 #define RT_OID_WSC_SET_SSID                         0x0745
540 #define RT_OID_WSC_SET_PIN_CODE                     0x0746
541 #define RT_OID_WSC_SET_MODE                         0x0747      /* PIN or PBC */
542 #define RT_OID_WSC_SET_CONF_MODE                    0x0748      /* Enrollee or Registrar */
543 #define RT_OID_WSC_SET_PROFILE                      0x0749
544 #define RT_OID_WSC_CONFIG_STATUS                                        0x074F
545 #define RT_OID_802_11_WSC_QUERY_PROFILE                         0x0750
546 /* for consistency with RT61 */
547 #define RT_OID_WSC_QUERY_STATUS                                         0x0751
548 #define RT_OID_WSC_PIN_CODE                                                     0x0752
549 #define RT_OID_WSC_UUID                                                         0x0753
550 #define RT_OID_WSC_SET_SELECTED_REGISTRAR                       0x0754
551 #define RT_OID_WSC_EAPMSG                                                       0x0755
552 #define RT_OID_WSC_MANUFACTURER                                         0x0756
553 #define RT_OID_WSC_MODEL_NAME                                           0x0757
554 #define RT_OID_WSC_MODEL_NO                                                     0x0758
555 #define RT_OID_WSC_SERIAL_NO                                            0x0759
556 #define RT_OID_WSC_MAC_ADDRESS                                          0x0760
557
558 /* New for MeetingHouse Api support */
559 #define OID_MH_802_1X_SUPPORTED               0xFFEDC100
560
561 /* MIMO Tx parameter, ShortGI, MCS, STBC, etc.  these are fields in TXWI. Don't change this definition!!! */
562 typedef union _HTTRANSMIT_SETTING {
563         struct {
564                 USHORT MCS:7;   /* MCS */
565                 USHORT BW:1;    /*channel bandwidth 20MHz or 40 MHz */
566                 USHORT ShortGI:1;
567                 USHORT STBC:2;  /*SPACE */
568 /*      USHORT          rsv:3; */
569                 USHORT rsv:2;
570                 USHORT TxBF:1;
571                 USHORT MODE:2;  /* Use definition MODE_xxx. */
572         } field;
573         USHORT word;
574 } HTTRANSMIT_SETTING, *PHTTRANSMIT_SETTING;
575
576 typedef enum _RT_802_11_PREAMBLE {
577         Rt802_11PreambleLong,
578         Rt802_11PreambleShort,
579         Rt802_11PreambleAuto
580 } RT_802_11_PREAMBLE, *PRT_802_11_PREAMBLE;
581
582 typedef enum _RT_802_11_PHY_MODE {
583         PHY_11BG_MIXED = 0,
584         PHY_11B,
585         PHY_11A,
586         PHY_11ABG_MIXED,
587         PHY_11G,
588         PHY_11ABGN_MIXED,       /* both band   5 */
589         PHY_11N_2_4G,           /* 11n-only with 2.4G band      6 */
590         PHY_11GN_MIXED,         /* 2.4G band      7 */
591         PHY_11AN_MIXED,         /* 5G  band       8 */
592         PHY_11BGN_MIXED,        /* if check 802.11b.      9 */
593         PHY_11AGN_MIXED,        /* if check 802.11b.      10 */
594         PHY_11N_5G,             /* 11n-only with 5G band                11 */
595 } RT_802_11_PHY_MODE;
596
597 /* put all proprietery for-query objects here to reduce # of Query_OID */
598 typedef struct _RT_802_11_LINK_STATUS {
599         ULONG CurrTxRate;       /* in units of 0.5Mbps */
600         ULONG ChannelQuality;   /* 0..100 % */
601         ULONG TxByteCount;      /* both ok and fail */
602         ULONG RxByteCount;      /* both ok and fail */
603         ULONG CentralChannel;   /* 40MHz central channel number */
604 } RT_802_11_LINK_STATUS, *PRT_802_11_LINK_STATUS;
605
606 typedef struct _RT_802_11_EVENT_LOG {
607         LARGE_INTEGER SystemTime;       /* timestammp via NdisGetCurrentSystemTime() */
608         UCHAR Addr[MAC_ADDR_LENGTH];
609         USHORT Event;           /* EVENT_xxx */
610 } RT_802_11_EVENT_LOG, *PRT_802_11_EVENT_LOG;
611
612 typedef struct _RT_802_11_EVENT_TABLE {
613         ULONG Num;
614         ULONG Rsv;              /* to align Log[] at LARGE_INEGER boundary */
615         RT_802_11_EVENT_LOG Log[MAX_NUMBER_OF_EVENT];
616 } RT_802_11_EVENT_TABLE, PRT_802_11_EVENT_TABLE;
617
618 /* MIMO Tx parameter, ShortGI, MCS, STBC, etc.  these are fields in TXWI. Don't change this definition!!! */
619 typedef union _MACHTTRANSMIT_SETTING {
620         struct {
621                 USHORT MCS:7;   /* MCS */
622                 USHORT BW:1;    /*channel bandwidth 20MHz or 40 MHz */
623                 USHORT ShortGI:1;
624                 USHORT STBC:2;  /*SPACE */
625                 USHORT rsv:3;
626                 USHORT MODE:2;  /* Use definition MODE_xxx. */
627         } field;
628         USHORT word;
629 } MACHTTRANSMIT_SETTING, *PMACHTTRANSMIT_SETTING;
630
631 typedef struct _RT_802_11_MAC_ENTRY {
632         UCHAR Addr[MAC_ADDR_LENGTH];
633         UCHAR Aid;
634         UCHAR Psm;              /* 0:PWR_ACTIVE, 1:PWR_SAVE */
635         UCHAR MimoPs;           /* 0:MMPS_STATIC, 1:MMPS_DYNAMIC, 3:MMPS_Enabled */
636         CHAR AvgRssi0;
637         CHAR AvgRssi1;
638         CHAR AvgRssi2;
639         UINT32 ConnectedTime;
640         MACHTTRANSMIT_SETTING TxRate;
641 } RT_802_11_MAC_ENTRY, *PRT_802_11_MAC_ENTRY;
642
643 typedef struct _RT_802_11_MAC_TABLE {
644         ULONG Num;
645         RT_802_11_MAC_ENTRY Entry[MAX_NUMBER_OF_MAC];
646 } RT_802_11_MAC_TABLE, *PRT_802_11_MAC_TABLE;
647
648 /* structure for query/set hardware register - MAC, BBP, RF register */
649 typedef struct _RT_802_11_HARDWARE_REGISTER {
650         ULONG HardwareType;     /* 0:MAC, 1:BBP, 2:RF register, 3:EEPROM */
651         ULONG Offset;           /* Q/S register offset addr */
652         ULONG Data;             /* R/W data buffer */
653 } RT_802_11_HARDWARE_REGISTER, *PRT_802_11_HARDWARE_REGISTER;
654
655 typedef struct _RT_802_11_AP_CONFIG {
656         ULONG EnableTxBurst;    /* 0-disable, 1-enable */
657         ULONG EnableTurboRate;  /* 0-disable, 1-enable 72/100mbps turbo rate */
658         ULONG IsolateInterStaTraffic;   /* 0-disable, 1-enable isolation */
659         ULONG HideSsid;         /* 0-disable, 1-enable hiding */
660         ULONG UseBGProtection;  /* 0-AUTO, 1-always ON, 2-always OFF */
661         ULONG UseShortSlotTime; /* 0-no use, 1-use 9-us short slot time */
662         ULONG Rsv1;             /* must be 0 */
663         ULONG SystemErrorBitmap;        /* ignore upon SET, return system error upon QUERY */
664 } RT_802_11_AP_CONFIG, *PRT_802_11_AP_CONFIG;
665
666 /* structure to query/set STA_CONFIG */
667 typedef struct _RT_802_11_STA_CONFIG {
668         ULONG EnableTxBurst;    /* 0-disable, 1-enable */
669         ULONG EnableTurboRate;  /* 0-disable, 1-enable 72/100mbps turbo rate */
670         ULONG UseBGProtection;  /* 0-AUTO, 1-always ON, 2-always OFF */
671         ULONG UseShortSlotTime; /* 0-no use, 1-use 9-us short slot time when applicable */
672         ULONG AdhocMode;        /* 0-11b rates only (WIFI spec), 1 - b/g mixed, 2 - g only */
673         ULONG HwRadioStatus;    /* 0-OFF, 1-ON, default is 1, Read-Only */
674         ULONG Rsv1;             /* must be 0 */
675         ULONG SystemErrorBitmap;        /* ignore upon SET, return system error upon QUERY */
676 } RT_802_11_STA_CONFIG, *PRT_802_11_STA_CONFIG;
677
678 /* */
679 /*  For OID Query or Set about BA structure */
680 /* */
681 typedef struct _OID_BACAP_STRUC {
682         UCHAR RxBAWinLimit;
683         UCHAR TxBAWinLimit;
684         UCHAR Policy;           /* 0: DELAY_BA 1:IMMED_BA  (//BA Policy subfiled value in ADDBA frame)   2:BA-not use. other value invalid */
685         UCHAR MpduDensity;      /* 0: DELAY_BA 1:IMMED_BA  (//BA Policy subfiled value in ADDBA frame)   2:BA-not use. other value invalid */
686         UCHAR AmsduEnable;      /*Enable AMSDU transmisstion */
687         UCHAR AmsduSize;        /* 0:3839, 1:7935 bytes. UINT  MSDUSizeToBytes[]        = { 3839, 7935}; */
688         UCHAR MMPSmode;         /* MIMO power save more, 0:static, 1:dynamic, 2:rsv, 3:mimo enable */
689         BOOLEAN AutoBA;         /* Auto BA will automatically */
690 } OID_BACAP_STRUC, *POID_BACAP_STRUC;
691
692 typedef struct _RT_802_11_ACL_ENTRY {
693         UCHAR Addr[MAC_ADDR_LENGTH];
694         USHORT Rsv;
695 } RT_802_11_ACL_ENTRY, *PRT_802_11_ACL_ENTRY;
696
697 typedef struct PACKED _RT_802_11_ACL {
698         ULONG Policy;           /* 0-disable, 1-positive list, 2-negative list */
699         ULONG Num;
700         RT_802_11_ACL_ENTRY Entry[MAX_NUMBER_OF_ACL];
701 } RT_802_11_ACL, *PRT_802_11_ACL;
702
703 typedef struct _RT_802_11_WDS {
704         ULONG Num;
705         NDIS_802_11_MAC_ADDRESS Entry[24 /*MAX_NUM_OF_WDS_LINK */ ];
706         ULONG KeyLength;
707         UCHAR KeyMaterial[32];
708 } RT_802_11_WDS, *PRT_802_11_WDS;
709
710 typedef struct _RT_802_11_TX_RATES_ {
711         UCHAR SupRateLen;
712         UCHAR SupRate[MAX_LENGTH_OF_SUPPORT_RATES];
713         UCHAR ExtRateLen;
714         UCHAR ExtRate[MAX_LENGTH_OF_SUPPORT_RATES];
715 } RT_802_11_TX_RATES, *PRT_802_11_TX_RATES;
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 #define MAX_CUSTOM_LEN 128
748
749 typedef enum _RT_802_11_D_CLIENT_MODE {
750         Rt802_11_D_None,
751         Rt802_11_D_Flexible,
752         Rt802_11_D_Strict,
753 } RT_802_11_D_CLIENT_MODE, *PRT_802_11_D_CLIENT_MODE;
754
755 typedef struct _RT_CHANNEL_LIST_INFO {
756         UCHAR ChannelList[MAX_NUM_OF_CHS];      /* list all supported channels for site survey */
757         UCHAR ChannelListNum;   /* number of channel in ChannelList[] */
758 } RT_CHANNEL_LIST_INFO, *PRT_CHANNEL_LIST_INFO;
759
760 /* WSC configured credential */
761 typedef struct _WSC_CREDENTIAL {
762         NDIS_802_11_SSID SSID;  /* mandatory */
763         USHORT AuthType;        /* mandatory, 1: open, 2: wpa-psk, 4: shared, 8:wpa, 0x10: wpa2, 0x20: wpa2-psk */
764         USHORT EncrType;        /* mandatory, 1: none, 2: wep, 4: tkip, 8: aes */
765         UCHAR Key[64];          /* mandatory, Maximum 64 byte */
766         USHORT KeyLength;
767         UCHAR MacAddr[6];       /* mandatory, AP MAC address */
768         UCHAR KeyIndex;         /* optional, default is 1 */
769         UCHAR Rsvd[3];          /* Make alignment */
770 } WSC_CREDENTIAL, *PWSC_CREDENTIAL;
771
772 /* WSC configured profiles */
773 typedef struct _WSC_PROFILE {
774         UINT ProfileCnt;
775         UINT ApplyProfileIdx;   /* add by johnli, fix WPS test plan 5.1.1 */
776         WSC_CREDENTIAL Profile[8];      /* Support up to 8 profiles */
777 } WSC_PROFILE, *PWSC_PROFILE;
778
779 #endif /* _OID_H_ */