Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
[sfrench/cifs-2.6.git] / drivers / staging / rt3070 / 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
43 #define TRUE                            1
44 #define FALSE                           0
45 //
46 // IEEE 802.11 Structures and definitions
47 //
48 #define MAX_TX_POWER_LEVEL              100   /* mW */
49 #define MAX_RSSI_TRIGGER                -10    /* dBm */
50 #define MIN_RSSI_TRIGGER                -200   /* dBm */
51 #define MAX_FRAG_THRESHOLD              2346  /* byte count */
52 #define MIN_FRAG_THRESHOLD              256   /* byte count */
53 #define MAX_RTS_THRESHOLD               2347  /* byte count */
54
55 // new types for Media Specific Indications
56 // Extension channel offset
57 #define EXTCHA_NONE                     0
58 #define EXTCHA_ABOVE            0x1
59 #define EXTCHA_BELOW            0x3
60
61 // BW
62 #define BAND_WIDTH_20           0
63 #define BAND_WIDTH_40           1
64 #define BAND_WIDTH_BOTH         2
65 #define BAND_WIDTH_10           3       // 802.11j has 10MHz. This definition is for internal usage. doesn't fill in the IE or other field.
66 // SHORTGI
67 #define GAP_INTERVAL_400        1       // only support in HT mode
68 #define GAP_INTERVAL_800        0
69 #define GAP_INTERVAL_BOTH       2
70
71 #define NdisMediaStateConnected                 1
72 #define NdisMediaStateDisconnected              0
73
74 #define NDIS_802_11_LENGTH_SSID         32
75 #define NDIS_802_11_LENGTH_RATES        8
76 #define NDIS_802_11_LENGTH_RATES_EX     16
77 #define MAC_ADDR_LENGTH                 6
78 #define MAX_NUM_OF_CHS                                  49 // 14 channels @2.4G +  12@UNII + 4 @MMAC + 11 @HiperLAN2 + 7 @Japan + 1 as NULL terminationc
79 #define MAX_NUMBER_OF_EVENT                             10  // entry # in EVENT table
80 #define MAX_NUMBER_OF_MAC                               32 // if MAX_MBSSID_NUM is 8, this value can't be larger than 211
81 #define MAX_NUMBER_OF_ACL                               64
82 #define MAX_LENGTH_OF_SUPPORT_RATES             12    // 1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54
83 #define MAX_NUMBER_OF_DLS_ENTRY                 4
84
85
86
87 #ifndef UNDER_CE
88 // OID definition, since NDIS 5.0 didn't define these, we need to define for our own
89 //#if _WIN32_WINNT<=0x0500
90
91 #define OID_GEN_MACHINE_NAME               0x0001021A
92
93 #ifdef RALINK_ATE
94 #define RT_QUERY_ATE_TXDONE_COUNT                       0x0401
95 #endif // RALINK_ATE //
96 #define RT_QUERY_SIGNAL_CONTEXT                         0x0402
97 #define RT_SET_IAPP_PID                         0x0404
98 #define RT_SET_APD_PID                                          0x0405
99 #define RT_SET_DEL_MAC_ENTRY                            0x0406
100
101 //
102 // IEEE 802.11 OIDs
103 //
104 #define OID_GET_SET_TOGGLE                      0x8000
105
106 #define OID_802_11_NETWORK_TYPES_SUPPORTED                      0x0103
107 #define OID_802_11_NETWORK_TYPE_IN_USE                          0x0104
108 #define OID_802_11_RSSI_TRIGGER                                         0x0107
109 #define RT_OID_802_11_RSSI                                                      0x0108 //rt2860 only , kathy
110 #define RT_OID_802_11_RSSI_1                                            0x0109 //rt2860 only , kathy
111 #define RT_OID_802_11_RSSI_2                                            0x010A //rt2860 only , kathy
112 #define OID_802_11_NUMBER_OF_ANTENNAS                           0x010B
113 #define OID_802_11_RX_ANTENNA_SELECTED                          0x010C
114 #define OID_802_11_TX_ANTENNA_SELECTED                          0x010D
115 #define OID_802_11_SUPPORTED_RATES                                      0x010E
116 #define OID_802_11_ADD_WEP                                                      0x0112
117 #define OID_802_11_REMOVE_WEP                                           0x0113
118 #define OID_802_11_DISASSOCIATE                                         0x0114
119 #define OID_802_11_PRIVACY_FILTER                                       0x0118
120 #define OID_802_11_ASSOCIATION_INFORMATION                      0x011E
121 #define OID_802_11_TEST                                                         0x011F
122 #define RT_OID_802_11_COUNTRY_REGION                            0x0507
123 #define OID_802_11_BSSID_LIST_SCAN                                      0x0508
124 #define OID_802_11_SSID                                                         0x0509
125 #define OID_802_11_BSSID                                                        0x050A
126 #define RT_OID_802_11_RADIO                                                     0x050B
127 #define RT_OID_802_11_PHY_MODE                                          0x050C
128 #define RT_OID_802_11_STA_CONFIG                                        0x050D
129 #define OID_802_11_DESIRED_RATES                                        0x050E
130 #define RT_OID_802_11_PREAMBLE                                          0x050F
131 #define OID_802_11_WEP_STATUS                                           0x0510
132 #define OID_802_11_AUTHENTICATION_MODE                          0x0511
133 #define OID_802_11_INFRASTRUCTURE_MODE                          0x0512
134 #define RT_OID_802_11_RESET_COUNTERS                            0x0513
135 #define OID_802_11_RTS_THRESHOLD                                        0x0514
136 #define OID_802_11_FRAGMENTATION_THRESHOLD                      0x0515
137 #define OID_802_11_POWER_MODE                                           0x0516
138 #define OID_802_11_TX_POWER_LEVEL                                       0x0517
139 #define RT_OID_802_11_ADD_WPA                                           0x0518
140 #define OID_802_11_REMOVE_KEY                                           0x0519
141 #define OID_802_11_ADD_KEY                                                      0x0520
142 #define OID_802_11_CONFIGURATION                                        0x0521
143 #define OID_802_11_TX_PACKET_BURST                                      0x0522
144 #define RT_OID_802_11_QUERY_NOISE_LEVEL                         0x0523
145 #define RT_OID_802_11_EXTRA_INFO                                        0x0524
146 #ifdef  DBG
147 #define RT_OID_802_11_HARDWARE_REGISTER                         0x0525
148 #endif
149 #define OID_802_11_ENCRYPTION_STATUS            OID_802_11_WEP_STATUS
150 #define OID_802_11_DEAUTHENTICATION                 0x0526
151 #define OID_802_11_DROP_UNENCRYPTED                 0x0527
152 #define OID_802_11_MIC_FAILURE_REPORT_FRAME         0x0528
153
154 // For 802.1x daemin using to require current driver configuration
155 #define OID_802_11_RADIUS_QUERY_SETTING                         0x0540
156
157 #define RT_OID_DEVICE_NAME                                                      0x0607
158 #define RT_OID_VERSION_INFO                                                     0x0608
159 #define OID_802_11_BSSID_LIST                                           0x0609
160 #define OID_802_3_CURRENT_ADDRESS                                       0x060A
161 #define OID_GEN_MEDIA_CONNECT_STATUS                            0x060B
162 #define RT_OID_802_11_QUERY_LINK_STATUS                         0x060C
163 #define OID_802_11_RSSI                                                         0x060D
164 #define OID_802_11_STATISTICS                                           0x060E
165 #define OID_GEN_RCV_OK                                                          0x060F
166 #define OID_GEN_RCV_NO_BUFFER                                           0x0610
167 #define RT_OID_802_11_QUERY_EEPROM_VERSION                      0x0611
168 #define RT_OID_802_11_QUERY_FIRMWARE_VERSION            0x0612
169 #define RT_OID_802_11_QUERY_LAST_RX_RATE                        0x0613
170 #define RT_OID_802_11_TX_POWER_LEVEL_1                          0x0614
171 #define RT_OID_802_11_QUERY_PIDVID                                      0x0615
172 //for WPA_SUPPLICANT_SUPPORT
173 #define OID_SET_COUNTERMEASURES                     0x0616
174 #define OID_802_11_SET_IEEE8021X                    0x0617
175 #define OID_802_11_SET_IEEE8021X_REQUIRE_KEY        0x0618
176 #define OID_802_11_PMKID                            0x0620
177 #define RT_OID_WPA_SUPPLICANT_SUPPORT               0x0621
178 #define RT_OID_WE_VERSION_COMPILED                  0x0622
179 #define RT_OID_NEW_DRIVER                           0x0623
180
181
182 //rt2860 , kathy
183 #define RT_OID_802_11_SNR_0                                                     0x0630
184 #define RT_OID_802_11_SNR_1                                                     0x0631
185 #define RT_OID_802_11_QUERY_LAST_TX_RATE                        0x0632
186 #define RT_OID_802_11_QUERY_HT_PHYMODE                          0x0633
187 #define RT_OID_802_11_SET_HT_PHYMODE                            0x0634
188 #define OID_802_11_RELOAD_DEFAULTS                                      0x0635
189 #define RT_OID_802_11_QUERY_APSD_SETTING                        0x0636
190 #define RT_OID_802_11_SET_APSD_SETTING                          0x0637
191 #define RT_OID_802_11_QUERY_APSD_PSM                            0x0638
192 #define RT_OID_802_11_SET_APSD_PSM                                      0x0639
193 #define RT_OID_802_11_QUERY_DLS                                         0x063A
194 #define RT_OID_802_11_SET_DLS                                           0x063B
195 #define RT_OID_802_11_QUERY_DLS_PARAM                           0x063C
196 #define RT_OID_802_11_SET_DLS_PARAM                                     0x063D
197 #define RT_OID_802_11_QUERY_WMM                         0x063E
198 #define RT_OID_802_11_SET_WMM                                           0x063F
199 #define RT_OID_802_11_QUERY_IMME_BA_CAP                         0x0640
200 #define RT_OID_802_11_SET_IMME_BA_CAP                           0x0641
201 #define RT_OID_802_11_QUERY_BATABLE                                     0x0642
202 #define RT_OID_802_11_ADD_IMME_BA                                       0x0643
203 #define RT_OID_802_11_TEAR_IMME_BA                                      0x0644
204 #define RT_OID_DRIVER_DEVICE_NAME                   0x0645
205 #define RT_OID_802_11_QUERY_DAT_HT_PHYMODE          0x0646
206 #define RT_OID_QUERY_MULTIPLE_CARD_SUPPORT          0x0647
207
208 // Ralink defined OIDs
209 // Dennis Lee move to platform specific
210
211 #define RT_OID_802_11_BSSID                                       (OID_GET_SET_TOGGLE | OID_802_11_BSSID)
212 #define RT_OID_802_11_SSID                                        (OID_GET_SET_TOGGLE | OID_802_11_SSID)
213 #define RT_OID_802_11_INFRASTRUCTURE_MODE         (OID_GET_SET_TOGGLE | OID_802_11_INFRASTRUCTURE_MODE)
214 #define RT_OID_802_11_ADD_WEP                             (OID_GET_SET_TOGGLE | OID_802_11_ADD_WEP)
215 #define RT_OID_802_11_ADD_KEY                             (OID_GET_SET_TOGGLE | OID_802_11_ADD_KEY)
216 #define RT_OID_802_11_REMOVE_WEP                          (OID_GET_SET_TOGGLE | OID_802_11_REMOVE_WEP)
217 #define RT_OID_802_11_REMOVE_KEY                          (OID_GET_SET_TOGGLE | OID_802_11_REMOVE_KEY)
218 #define RT_OID_802_11_DISASSOCIATE                        (OID_GET_SET_TOGGLE | OID_802_11_DISASSOCIATE)
219 #define RT_OID_802_11_AUTHENTICATION_MODE         (OID_GET_SET_TOGGLE | OID_802_11_AUTHENTICATION_MODE)
220 #define RT_OID_802_11_PRIVACY_FILTER              (OID_GET_SET_TOGGLE | OID_802_11_PRIVACY_FILTER)
221 #define RT_OID_802_11_BSSID_LIST_SCAN             (OID_GET_SET_TOGGLE | OID_802_11_BSSID_LIST_SCAN)
222 #define RT_OID_802_11_WEP_STATUS                          (OID_GET_SET_TOGGLE | OID_802_11_WEP_STATUS)
223 #define RT_OID_802_11_RELOAD_DEFAULTS             (OID_GET_SET_TOGGLE | OID_802_11_RELOAD_DEFAULTS)
224 #define RT_OID_802_11_NETWORK_TYPE_IN_USE         (OID_GET_SET_TOGGLE | OID_802_11_NETWORK_TYPE_IN_USE)
225 #define RT_OID_802_11_TX_POWER_LEVEL              (OID_GET_SET_TOGGLE | OID_802_11_TX_POWER_LEVEL)
226 #define RT_OID_802_11_RSSI_TRIGGER                        (OID_GET_SET_TOGGLE | OID_802_11_RSSI_TRIGGER)
227 #define RT_OID_802_11_FRAGMENTATION_THRESHOLD (OID_GET_SET_TOGGLE |     OID_802_11_FRAGMENTATION_THRESHOLD)
228 #define RT_OID_802_11_RTS_THRESHOLD                       (OID_GET_SET_TOGGLE | OID_802_11_RTS_THRESHOLD)
229 #define RT_OID_802_11_RX_ANTENNA_SELECTED         (OID_GET_SET_TOGGLE | OID_802_11_RX_ANTENNA_SELECTED)
230 #define RT_OID_802_11_TX_ANTENNA_SELECTED         (OID_GET_SET_TOGGLE | OID_802_11_TX_ANTENNA_SELECTED)
231 #define RT_OID_802_11_SUPPORTED_RATES             (OID_GET_SET_TOGGLE | OID_802_11_SUPPORTED_RATES)
232 #define RT_OID_802_11_DESIRED_RATES                       (OID_GET_SET_TOGGLE | OID_802_11_DESIRED_RATES)
233 #define RT_OID_802_11_CONFIGURATION                       (OID_GET_SET_TOGGLE | OID_802_11_CONFIGURATION)
234 #define RT_OID_802_11_POWER_MODE                          (OID_GET_SET_TOGGLE | OID_802_11_POWER_MODE)
235
236
237
238 typedef enum _NDIS_802_11_STATUS_TYPE
239 {
240     Ndis802_11StatusType_Authentication,
241     Ndis802_11StatusType_MediaStreamMode,
242     Ndis802_11StatusType_PMKID_CandidateList,
243     Ndis802_11StatusTypeMax    // not a real type, defined as an upper bound
244 } NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE;
245
246 typedef UCHAR   NDIS_802_11_MAC_ADDRESS[6];
247
248 typedef struct _NDIS_802_11_STATUS_INDICATION
249 {
250     NDIS_802_11_STATUS_TYPE StatusType;
251 } NDIS_802_11_STATUS_INDICATION, *PNDIS_802_11_STATUS_INDICATION;
252
253 // mask for authentication/integrity fields
254 #define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS        0x0f
255
256 #define NDIS_802_11_AUTH_REQUEST_REAUTH             0x01
257 #define NDIS_802_11_AUTH_REQUEST_KEYUPDATE          0x02
258 #define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR     0x06
259 #define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR        0x0E
260
261 typedef struct _NDIS_802_11_AUTHENTICATION_REQUEST
262 {
263     ULONG Length;            // Length of structure
264     NDIS_802_11_MAC_ADDRESS Bssid;
265     ULONG Flags;
266 } NDIS_802_11_AUTHENTICATION_REQUEST, *PNDIS_802_11_AUTHENTICATION_REQUEST;
267
268 //Added new types for PMKID Candidate lists.
269 typedef struct _PMKID_CANDIDATE {
270     NDIS_802_11_MAC_ADDRESS BSSID;
271     ULONG Flags;
272 } PMKID_CANDIDATE, *PPMKID_CANDIDATE;
273
274 typedef struct _NDIS_802_11_PMKID_CANDIDATE_LIST
275 {
276     ULONG Version;       // Version of the structure
277     ULONG NumCandidates; // No. of pmkid candidates
278     PMKID_CANDIDATE CandidateList[1];
279 } NDIS_802_11_PMKID_CANDIDATE_LIST, *PNDIS_802_11_PMKID_CANDIDATE_LIST;
280
281 //Flags for PMKID Candidate list structure
282 #define NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED     0x01
283
284 // Added new types for OFDM 5G and 2.4G
285 typedef enum _NDIS_802_11_NETWORK_TYPE
286 {
287    Ndis802_11FH,
288    Ndis802_11DS,
289     Ndis802_11OFDM5,
290     Ndis802_11OFDM5_N,
291     Ndis802_11OFDM24,
292     Ndis802_11OFDM24_N,
293    Ndis802_11Automode,
294     Ndis802_11NetworkTypeMax    // not a real type, defined as an upper bound
295 } NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE;
296
297 typedef struct _NDIS_802_11_NETWORK_TYPE_LIST
298 {
299     UINT                       NumberOfItems;  // in list below, at least 1
300    NDIS_802_11_NETWORK_TYPE    NetworkType [1];
301 } NDIS_802_11_NETWORK_TYPE_LIST, *PNDIS_802_11_NETWORK_TYPE_LIST;
302
303 typedef enum _NDIS_802_11_POWER_MODE
304 {
305     Ndis802_11PowerModeCAM,
306     Ndis802_11PowerModeMAX_PSP,
307     Ndis802_11PowerModeFast_PSP,
308     Ndis802_11PowerModeLegacy_PSP,
309     Ndis802_11PowerModeMax      // not a real mode, defined as an upper bound
310 } NDIS_802_11_POWER_MODE, *PNDIS_802_11_POWER_MODE;
311
312 typedef ULONG   NDIS_802_11_TX_POWER_LEVEL; // in milliwatts
313
314 //
315 // Received Signal Strength Indication
316 //
317 typedef LONG    NDIS_802_11_RSSI;           // in dBm
318
319 typedef struct _NDIS_802_11_CONFIGURATION_FH
320 {
321    ULONG           Length;            // Length of structure
322    ULONG           HopPattern;        // As defined by 802.11, MSB set
323    ULONG           HopSet;            // to one if non-802.11
324    ULONG           DwellTime;         // units are Kusec
325 } NDIS_802_11_CONFIGURATION_FH, *PNDIS_802_11_CONFIGURATION_FH;
326
327 typedef struct _NDIS_802_11_CONFIGURATION
328 {
329    ULONG                           Length;             // Length of structure
330    ULONG                           BeaconPeriod;       // units are Kusec
331    ULONG                           ATIMWindow;         // units are Kusec
332    ULONG                           DSConfig;           // Frequency, units are kHz
333    NDIS_802_11_CONFIGURATION_FH    FHConfig;
334 } NDIS_802_11_CONFIGURATION, *PNDIS_802_11_CONFIGURATION;
335
336 typedef struct _NDIS_802_11_STATISTICS
337 {
338    ULONG           Length;             // Length of structure
339    LARGE_INTEGER   TransmittedFragmentCount;
340    LARGE_INTEGER   MulticastTransmittedFrameCount;
341    LARGE_INTEGER   FailedCount;
342    LARGE_INTEGER   RetryCount;
343    LARGE_INTEGER   MultipleRetryCount;
344    LARGE_INTEGER   RTSSuccessCount;
345    LARGE_INTEGER   RTSFailureCount;
346    LARGE_INTEGER   ACKFailureCount;
347    LARGE_INTEGER   FrameDuplicateCount;
348    LARGE_INTEGER   ReceivedFragmentCount;
349    LARGE_INTEGER   MulticastReceivedFrameCount;
350    LARGE_INTEGER   FCSErrorCount;
351    LARGE_INTEGER   TKIPLocalMICFailures;
352    LARGE_INTEGER   TKIPRemoteMICErrors;
353    LARGE_INTEGER   TKIPICVErrors;
354    LARGE_INTEGER   TKIPCounterMeasuresInvoked;
355    LARGE_INTEGER   TKIPReplays;
356    LARGE_INTEGER   CCMPFormatErrors;
357    LARGE_INTEGER   CCMPReplays;
358    LARGE_INTEGER   CCMPDecryptErrors;
359    LARGE_INTEGER   FourWayHandshakeFailures;
360 } NDIS_802_11_STATISTICS, *PNDIS_802_11_STATISTICS;
361
362 typedef  ULONG  NDIS_802_11_KEY_INDEX;
363 typedef ULONGLONG   NDIS_802_11_KEY_RSC;
364
365 #define MAX_RADIUS_SRV_NUM                      2         // 802.1x failover number
366
367 typedef struct PACKED _RADIUS_SRV_INFO {
368         UINT32                  radius_ip;
369         UINT32                  radius_port;
370         UCHAR                   radius_key[64];
371         UCHAR                   radius_key_len;
372 } RADIUS_SRV_INFO, *PRADIUS_SRV_INFO;
373
374 typedef struct PACKED _RADIUS_KEY_INFO
375 {
376         UCHAR                   radius_srv_num;
377         RADIUS_SRV_INFO radius_srv_info[MAX_RADIUS_SRV_NUM];
378         UCHAR                   ieee8021xWEP;            // dynamic WEP
379     UCHAR           key_index;
380     UCHAR           key_length;          // length of key in bytes
381     UCHAR           key_material[13];
382 } RADIUS_KEY_INFO, *PRADIUS_KEY_INFO;
383
384 // It's used by 802.1x daemon to require relative configuration
385 typedef struct PACKED _RADIUS_CONF
386 {
387     UINT32          Length;             // Length of this structure
388     UCHAR                       mbss_num;                       // indicate multiple BSS number
389         UINT32                  own_ip_addr;
390         UINT32                  retry_interval;
391         UINT32                  session_timeout_interval;
392         UCHAR                   EAPifname[IFNAMSIZ];
393         UCHAR                   EAPifname_len;
394         UCHAR                   PreAuthifname[IFNAMSIZ];
395         UCHAR                   PreAuthifname_len;
396         RADIUS_KEY_INFO RadiusInfo[8/*MAX_MBSSID_NUM*/];
397 } RADIUS_CONF, *PRADIUS_CONF;
398
399
400
401 #ifdef CONFIG_STA_SUPPORT
402 // Key mapping keys require a BSSID
403 typedef struct _NDIS_802_11_KEY
404 {
405     UINT           Length;             // Length of this structure
406     UINT           KeyIndex;
407     UINT           KeyLength;          // length of key in bytes
408     NDIS_802_11_MAC_ADDRESS BSSID;
409     NDIS_802_11_KEY_RSC KeyRSC;
410     UCHAR           KeyMaterial[1];     // variable length depending on above field
411 } NDIS_802_11_KEY, *PNDIS_802_11_KEY;
412 #endif // CONFIG_STA_SUPPORT //
413
414 typedef struct _NDIS_802_11_REMOVE_KEY
415 {
416     UINT           Length;             // Length of this structure
417     UINT           KeyIndex;
418     NDIS_802_11_MAC_ADDRESS BSSID;
419 } NDIS_802_11_REMOVE_KEY, *PNDIS_802_11_REMOVE_KEY;
420
421 typedef struct _NDIS_802_11_WEP
422 {
423    UINT     Length;        // Length of this structure
424    UINT     KeyIndex;           // 0 is the per-client key, 1-N are the
425                                         // global keys
426    UINT     KeyLength;     // length of key in bytes
427    UCHAR     KeyMaterial[1];// variable length depending on above field
428 } NDIS_802_11_WEP, *PNDIS_802_11_WEP;
429
430
431 typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE
432 {
433    Ndis802_11IBSS,
434    Ndis802_11Infrastructure,
435    Ndis802_11AutoUnknown,
436    Ndis802_11Monitor,
437    Ndis802_11InfrastructureMax     // Not a real value, defined as upper bound
438 } NDIS_802_11_NETWORK_INFRASTRUCTURE, *PNDIS_802_11_NETWORK_INFRASTRUCTURE;
439
440 // Add new authentication modes
441 typedef enum _NDIS_802_11_AUTHENTICATION_MODE
442 {
443    Ndis802_11AuthModeOpen,
444    Ndis802_11AuthModeShared,
445    Ndis802_11AuthModeAutoSwitch,
446     Ndis802_11AuthModeWPA,
447     Ndis802_11AuthModeWPAPSK,
448     Ndis802_11AuthModeWPANone,
449    Ndis802_11AuthModeWPA2,
450    Ndis802_11AuthModeWPA2PSK,
451         Ndis802_11AuthModeWPA1WPA2,
452         Ndis802_11AuthModeWPA1PSKWPA2PSK,
453    Ndis802_11AuthModeMax           // Not a real mode, defined as upper bound
454 } NDIS_802_11_AUTHENTICATION_MODE, *PNDIS_802_11_AUTHENTICATION_MODE;
455
456 typedef UCHAR   NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES];        // Set of 8 data rates
457 typedef UCHAR   NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX];  // Set of 16 data rates
458
459 typedef struct PACKED _NDIS_802_11_SSID
460 {
461     UINT   SsidLength;         // length of SSID field below, in bytes;
462                                 // this can be zero.
463     UCHAR   Ssid[NDIS_802_11_LENGTH_SSID];           // SSID information field
464 } NDIS_802_11_SSID, *PNDIS_802_11_SSID;
465
466
467 typedef struct PACKED _NDIS_WLAN_BSSID
468 {
469    ULONG                               Length;     // Length of this structure
470    NDIS_802_11_MAC_ADDRESS             MacAddress; // BSSID
471    UCHAR                               Reserved[2];
472    NDIS_802_11_SSID                    Ssid;       // SSID
473    ULONG                               Privacy;    // WEP encryption requirement
474    NDIS_802_11_RSSI                    Rssi;       // receive signal strength in dBm
475    NDIS_802_11_NETWORK_TYPE            NetworkTypeInUse;
476    NDIS_802_11_CONFIGURATION           Configuration;
477    NDIS_802_11_NETWORK_INFRASTRUCTURE  InfrastructureMode;
478    NDIS_802_11_RATES                   SupportedRates;
479 } NDIS_WLAN_BSSID, *PNDIS_WLAN_BSSID;
480
481 typedef struct PACKED _NDIS_802_11_BSSID_LIST
482 {
483    UINT           NumberOfItems;      // in list below, at least 1
484    NDIS_WLAN_BSSID Bssid[1];
485 } NDIS_802_11_BSSID_LIST, *PNDIS_802_11_BSSID_LIST;
486
487 // Added Capabilities, IELength and IEs for each BSSID
488 typedef struct PACKED _NDIS_WLAN_BSSID_EX
489 {
490     ULONG                               Length;             // Length of this structure
491     NDIS_802_11_MAC_ADDRESS             MacAddress;         // BSSID
492     UCHAR                               Reserved[2];
493     NDIS_802_11_SSID                    Ssid;               // SSID
494     UINT                                Privacy;            // WEP encryption requirement
495     NDIS_802_11_RSSI                    Rssi;               // receive signal
496                                                             // strength in dBm
497     NDIS_802_11_NETWORK_TYPE            NetworkTypeInUse;
498     NDIS_802_11_CONFIGURATION           Configuration;
499     NDIS_802_11_NETWORK_INFRASTRUCTURE  InfrastructureMode;
500     NDIS_802_11_RATES_EX                SupportedRates;
501     ULONG                               IELength;
502     UCHAR                               IEs[1];
503 } NDIS_WLAN_BSSID_EX, *PNDIS_WLAN_BSSID_EX;
504
505 typedef struct PACKED _NDIS_802_11_BSSID_LIST_EX
506 {
507     UINT                   NumberOfItems;      // in list below, at least 1
508     NDIS_WLAN_BSSID_EX      Bssid[1];
509 } NDIS_802_11_BSSID_LIST_EX, *PNDIS_802_11_BSSID_LIST_EX;
510
511 typedef struct PACKED _NDIS_802_11_FIXED_IEs
512 {
513     UCHAR Timestamp[8];
514     USHORT BeaconInterval;
515     USHORT Capabilities;
516 } NDIS_802_11_FIXED_IEs, *PNDIS_802_11_FIXED_IEs;
517
518 typedef struct _NDIS_802_11_VARIABLE_IEs
519 {
520     UCHAR ElementID;
521     UCHAR Length;    // Number of bytes in data field
522     UCHAR data[1];
523 } NDIS_802_11_VARIABLE_IEs, *PNDIS_802_11_VARIABLE_IEs;
524
525 typedef  ULONG   NDIS_802_11_FRAGMENTATION_THRESHOLD;
526
527 typedef  ULONG   NDIS_802_11_RTS_THRESHOLD;
528
529 typedef  ULONG   NDIS_802_11_ANTENNA;
530
531 typedef enum _NDIS_802_11_PRIVACY_FILTER
532 {
533    Ndis802_11PrivFilterAcceptAll,
534    Ndis802_11PrivFilter8021xWEP
535 } NDIS_802_11_PRIVACY_FILTER, *PNDIS_802_11_PRIVACY_FILTER;
536
537 // Added new encryption types
538 // Also aliased typedef to new name
539 typedef enum _NDIS_802_11_WEP_STATUS
540 {
541    Ndis802_11WEPEnabled,
542     Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
543    Ndis802_11WEPDisabled,
544     Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
545    Ndis802_11WEPKeyAbsent,
546     Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
547    Ndis802_11WEPNotSupported,
548     Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
549     Ndis802_11Encryption2Enabled,
550     Ndis802_11Encryption2KeyAbsent,
551     Ndis802_11Encryption3Enabled,
552     Ndis802_11Encryption3KeyAbsent,
553     Ndis802_11Encryption4Enabled,       // TKIP or AES mix
554     Ndis802_11Encryption4KeyAbsent,
555 } NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS,
556   NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS;
557
558 typedef enum _NDIS_802_11_RELOAD_DEFAULTS
559 {
560    Ndis802_11ReloadWEPKeys
561 } NDIS_802_11_RELOAD_DEFAULTS, *PNDIS_802_11_RELOAD_DEFAULTS;
562
563 #define NDIS_802_11_AI_REQFI_CAPABILITIES      1
564 #define NDIS_802_11_AI_REQFI_LISTENINTERVAL    2
565 #define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS  4
566
567 #define NDIS_802_11_AI_RESFI_CAPABILITIES      1
568 #define NDIS_802_11_AI_RESFI_STATUSCODE        2
569 #define NDIS_802_11_AI_RESFI_ASSOCIATIONID     4
570
571 typedef struct _NDIS_802_11_AI_REQFI
572 {
573     USHORT Capabilities;
574     USHORT ListenInterval;
575     NDIS_802_11_MAC_ADDRESS  CurrentAPAddress;
576 } NDIS_802_11_AI_REQFI, *PNDIS_802_11_AI_REQFI;
577
578 typedef struct _NDIS_802_11_AI_RESFI
579 {
580     USHORT Capabilities;
581     USHORT StatusCode;
582     USHORT AssociationId;
583 } NDIS_802_11_AI_RESFI, *PNDIS_802_11_AI_RESFI;
584
585 typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION
586 {
587     ULONG                   Length;
588     USHORT                  AvailableRequestFixedIEs;
589     NDIS_802_11_AI_REQFI    RequestFixedIEs;
590     ULONG                   RequestIELength;
591     ULONG                   OffsetRequestIEs;
592     USHORT                  AvailableResponseFixedIEs;
593     NDIS_802_11_AI_RESFI    ResponseFixedIEs;
594     ULONG                   ResponseIELength;
595     ULONG                   OffsetResponseIEs;
596 } NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION;
597
598 typedef struct _NDIS_802_11_AUTHENTICATION_EVENT
599 {
600     NDIS_802_11_STATUS_INDICATION       Status;
601     NDIS_802_11_AUTHENTICATION_REQUEST  Request[1];
602 } NDIS_802_11_AUTHENTICATION_EVENT, *PNDIS_802_11_AUTHENTICATION_EVENT;
603
604 /*
605 typedef struct _NDIS_802_11_TEST
606 {
607     ULONG Length;
608     ULONG Type;
609     union
610     {
611         NDIS_802_11_AUTHENTICATION_EVENT AuthenticationEvent;
612         NDIS_802_11_RSSI RssiTrigger;
613     };
614 } NDIS_802_11_TEST, *PNDIS_802_11_TEST;
615  */
616
617 // 802.11 Media stream constraints, associated with OID_802_11_MEDIA_STREAM_MODE
618 typedef enum _NDIS_802_11_MEDIA_STREAM_MODE
619 {
620     Ndis802_11MediaStreamOff,
621     Ndis802_11MediaStreamOn,
622 } NDIS_802_11_MEDIA_STREAM_MODE, *PNDIS_802_11_MEDIA_STREAM_MODE;
623
624 // PMKID Structures
625 typedef UCHAR   NDIS_802_11_PMKID_VALUE[16];
626
627 #ifdef CONFIG_STA_SUPPORT
628 typedef struct _BSSID_INFO
629 {
630     NDIS_802_11_MAC_ADDRESS BSSID;
631     NDIS_802_11_PMKID_VALUE PMKID;
632 } BSSID_INFO, *PBSSID_INFO;
633
634 typedef struct _NDIS_802_11_PMKID
635 {
636     UINT    Length;
637     UINT    BSSIDInfoCount;
638     BSSID_INFO BSSIDInfo[1];
639 } NDIS_802_11_PMKID, *PNDIS_802_11_PMKID;
640 #endif // CONFIG_STA_SUPPORT //
641
642
643 typedef struct _NDIS_802_11_AUTHENTICATION_ENCRYPTION
644 {
645     NDIS_802_11_AUTHENTICATION_MODE AuthModeSupported;
646     NDIS_802_11_ENCRYPTION_STATUS EncryptStatusSupported;
647 } NDIS_802_11_AUTHENTICATION_ENCRYPTION, *PNDIS_802_11_AUTHENTICATION_ENCRYPTION;
648
649 typedef struct _NDIS_802_11_CAPABILITY
650 {
651      ULONG Length;
652      ULONG Version;
653      ULONG NoOfPMKIDs;
654      ULONG NoOfAuthEncryptPairsSupported;
655      NDIS_802_11_AUTHENTICATION_ENCRYPTION AuthenticationEncryptionSupported[1];
656 } NDIS_802_11_CAPABILITY, *PNDIS_802_11_CAPABILITY;
657
658 //#endif //of WIN 2k
659 #endif //UNDER_CE
660
661 #if WIRELESS_EXT <= 11
662 #ifndef SIOCDEVPRIVATE
663 #define SIOCDEVPRIVATE                              0x8BE0
664 #endif
665 #define SIOCIWFIRSTPRIV                                                         SIOCDEVPRIVATE
666 #endif
667
668 #ifdef CONFIG_STA_SUPPORT
669 #define RT_PRIV_IOCTL_EXT                                                       (SIOCIWFIRSTPRIV + 0x01) // Sync. with AP for wsc upnp daemon
670 #define RTPRIV_IOCTL_SET                                                        (SIOCIWFIRSTPRIV + 0x02)
671
672 #ifdef DBG
673 #define RTPRIV_IOCTL_BBP                            (SIOCIWFIRSTPRIV + 0x03)
674 #define RTPRIV_IOCTL_MAC                            (SIOCIWFIRSTPRIV + 0x05)
675 #define RTPRIV_IOCTL_RF                             (SIOCIWFIRSTPRIV + 0x13)
676 #define RTPRIV_IOCTL_E2P                            (SIOCIWFIRSTPRIV + 0x07)
677 #endif
678
679 #ifdef RALINK_ATE
680 #ifdef RALINK_28xx_QA
681 #define RTPRIV_IOCTL_ATE                                                        (SIOCIWFIRSTPRIV + 0x08)
682 #endif // RALINK_28xx_QA //
683 #endif // RALINK_ATE //
684
685 #define RTPRIV_IOCTL_STATISTICS                     (SIOCIWFIRSTPRIV + 0x09)
686 #define RTPRIV_IOCTL_ADD_PMKID_CACHE                (SIOCIWFIRSTPRIV + 0x0A)
687 #define RTPRIV_IOCTL_RADIUS_DATA                    (SIOCIWFIRSTPRIV + 0x0C)
688 #define RTPRIV_IOCTL_GSITESURVEY                                        (SIOCIWFIRSTPRIV + 0x0D)
689 #define RT_PRIV_IOCTL                                                           (SIOCIWFIRSTPRIV + 0x0E) // Sync. with RT61 (for wpa_supplicant)
690 #define RTPRIV_IOCTL_GET_MAC_TABLE                                      (SIOCIWFIRSTPRIV + 0x0F)
691
692 #define RTPRIV_IOCTL_SHOW                                                       (SIOCIWFIRSTPRIV + 0x11)
693 enum {
694     SHOW_CONN_STATUS = 4,
695     SHOW_DRVIER_VERION = 5,
696     SHOW_BA_INFO = 6,
697         SHOW_DESC_INFO = 7,
698 #ifdef RT2870
699         SHOW_RXBULK_INFO = 8,
700         SHOW_TXBULK_INFO = 9,
701 #endif // RT2870 //
702     RAIO_OFF = 10,
703     RAIO_ON = 11,
704 #ifdef QOS_DLS_SUPPORT
705         SHOW_DLS_ENTRY_INFO = 19,
706 #endif // QOS_DLS_SUPPORT //
707         SHOW_CFG_VALUE = 20,
708 };
709
710
711 #endif // CONFIG_STA_SUPPORT //
712
713
714
715 #ifdef SNMP_SUPPORT
716 //SNMP ieee 802dot11, kathy , 2008_0220
717 // dot11res(3)
718 #define RT_OID_802_11_MANUFACTUREROUI                   0x0700
719 #define RT_OID_802_11_MANUFACTURERNAME                  0x0701
720 #define RT_OID_802_11_RESOURCETYPEIDNAME                0x0702
721
722 // dot11smt(1)
723 #define RT_OID_802_11_PRIVACYOPTIONIMPLEMENTED  0x0703
724 #define RT_OID_802_11_POWERMANAGEMENTMODE               0x0704
725 #define OID_802_11_WEPDEFAULTKEYVALUE                   0x0705 // read , write
726 #define OID_802_11_WEPDEFAULTKEYID                              0x0706
727 #define RT_OID_802_11_WEPKEYMAPPINGLENGTH               0x0707
728 #define OID_802_11_SHORTRETRYLIMIT                              0x0708
729 #define OID_802_11_LONGRETRYLIMIT                               0x0709
730 #define RT_OID_802_11_PRODUCTID                                 0x0710
731 #define RT_OID_802_11_MANUFACTUREID                             0x0711
732
733 // //dot11Phy(4)
734 #define OID_802_11_CURRENTCHANNEL                               0x0712
735
736 //dot11mac
737 #define RT_OID_802_11_MAC_ADDRESS                               0x0713
738 #endif // SNMP_SUPPORT //
739
740 #define OID_802_11_BUILD_CHANNEL_EX                             0x0714
741 #define OID_802_11_GET_CH_LIST                                  0x0715
742 #define OID_802_11_GET_COUNTRY_CODE                             0x0716
743 #define OID_802_11_GET_CHANNEL_GEOGRAPHY                0x0717
744
745 //#define RT_OID_802_11_STATISTICS              (OID_GET_SET_TOGGLE | OID_802_11_STATISTICS)
746
747 #ifdef CONFIG_STA_SUPPORT
748 #define RT_OID_WSC_SET_PASSPHRASE                   0x0740 // passphrase for wpa(2)-psk
749 #define RT_OID_WSC_DRIVER_AUTO_CONNECT              0x0741
750 #define RT_OID_WSC_QUERY_DEFAULT_PROFILE            0x0742
751 #define RT_OID_WSC_SET_CONN_BY_PROFILE_INDEX        0x0743
752 #define RT_OID_WSC_SET_ACTION                       0x0744
753 #define RT_OID_WSC_SET_SSID                         0x0745
754 #define RT_OID_WSC_SET_PIN_CODE                     0x0746
755 #define RT_OID_WSC_SET_MODE                         0x0747 // PIN or PBC
756 #define RT_OID_WSC_SET_CONF_MODE                    0x0748 // Enrollee or Registrar
757 #define RT_OID_WSC_SET_PROFILE                      0x0749
758 #endif // CONFIG_STA_SUPPORT //
759 #define RT_OID_802_11_WSC_QUERY_PROFILE                         0x0750
760 // for consistency with RT61
761 #define RT_OID_WSC_QUERY_STATUS                                         0x0751
762 #define RT_OID_WSC_PIN_CODE                                                     0x0752
763 #define RT_OID_WSC_UUID                                                         0x0753
764 #define RT_OID_WSC_SET_SELECTED_REGISTRAR                       0x0754
765 #define RT_OID_WSC_EAPMSG                                                       0x0755
766 #define RT_OID_WSC_MANUFACTURER                                         0x0756
767 #define RT_OID_WSC_MODEL_NAME                                           0x0757
768 #define RT_OID_WSC_MODEL_NO                                                     0x0758
769 #define RT_OID_WSC_SERIAL_NO                                            0x0759
770 #define RT_OID_WSC_MAC_ADDRESS                                          0x0760
771
772 #ifdef LLTD_SUPPORT
773 // for consistency with RT61
774 #define RT_OID_GET_PHY_MODE                         0x761
775 #endif // LLTD_SUPPORT //
776
777 #ifdef NINTENDO_AP
778 //#define RT_OID_NINTENDO                             0x0D010770
779 #define RT_OID_802_11_NINTENDO_GET_TABLE                        0x0771 //((RT_OID_NINTENDO + 0x01) & 0xffff)
780 #define RT_OID_802_11_NINTENDO_SET_TABLE                        0x0772 //((RT_OID_NINTENDO + 0x02) & 0xffff)
781 #define RT_OID_802_11_NINTENDO_CAPABLE                          0x0773 //((RT_OID_NINTENDO + 0x03) & 0xffff)
782 #endif // NINTENDO_AP //
783
784 //Add Paul Chen for Accton
785 //#define RT_OID_TX_POWER_LEVEL                 0xFF020010
786 //#define RT_OID_SET_TX_POWER_LEVEL               (OID_GET_SET_TOGGLE | RT_OID_TX_POWER_LEVEL)
787
788 // New for MeetingHouse Api support
789 #define OID_MH_802_1X_SUPPORTED               0xFFEDC100
790
791 // MIMO Tx parameter, ShortGI, MCS, STBC, etc.  these are fields in TXWI. Don't change this definition!!!
792 typedef union  _HTTRANSMIT_SETTING {
793 #ifdef RT_BIG_ENDIAN
794         struct  {
795         USHORT          MODE:2; // Use definition MODE_xxx.
796 //      USHORT          rsv:3;
797         USHORT          TxBF:1;
798         USHORT          rsv:2;
799         USHORT          STBC:2; //SPACE
800         USHORT          ShortGI:1;
801         USHORT          BW:1;   //channel bandwidth 20MHz or 40 MHz
802         USHORT          MCS:7;                 // MCS
803         }       field;
804 #else
805         struct  {
806         USHORT          MCS:7;                 // MCS
807         USHORT          BW:1;   //channel bandwidth 20MHz or 40 MHz
808         USHORT          ShortGI:1;
809         USHORT          STBC:2; //SPACE
810 //      USHORT          rsv:3;
811         USHORT          rsv:2;
812         USHORT          TxBF:1;
813         USHORT          MODE:2; // Use definition MODE_xxx.
814         }       field;
815 #endif
816         USHORT          word;
817  } HTTRANSMIT_SETTING, *PHTTRANSMIT_SETTING;
818
819 typedef enum _RT_802_11_PREAMBLE {
820     Rt802_11PreambleLong,
821     Rt802_11PreambleShort,
822     Rt802_11PreambleAuto
823 } RT_802_11_PREAMBLE, *PRT_802_11_PREAMBLE;
824
825 // Only for STA, need to sync with AP
826 // 2005-03-08 match current RaConfig.
827 typedef enum _RT_802_11_PHY_MODE {
828         PHY_11BG_MIXED = 0,
829         PHY_11B,
830         PHY_11A,
831         PHY_11ABG_MIXED,
832         PHY_11G,
833 #ifdef DOT11_N_SUPPORT
834         PHY_11ABGN_MIXED,       // both band   5
835         PHY_11N_2_4G,           // 11n-only with 2.4G band      6
836         PHY_11GN_MIXED, // 2.4G band      7
837         PHY_11AN_MIXED, // 5G  band       8
838         PHY_11BGN_MIXED,        // if check 802.11b.      9
839         PHY_11AGN_MIXED,        // if check 802.11b.      10
840         PHY_11N_5G,                     // 11n-only with 5G band                11
841 #endif // DOT11_N_SUPPORT //
842 } RT_802_11_PHY_MODE;
843
844 // put all proprietery for-query objects here to reduce # of Query_OID
845 typedef struct _RT_802_11_LINK_STATUS {
846     ULONG   CurrTxRate;         // in units of 0.5Mbps
847     ULONG   ChannelQuality;     // 0..100 %
848     ULONG   TxByteCount;        // both ok and fail
849     ULONG   RxByteCount;        // both ok and fail
850     ULONG       CentralChannel;         // 40MHz central channel number
851 } RT_802_11_LINK_STATUS, *PRT_802_11_LINK_STATUS;
852
853 typedef struct _RT_802_11_EVENT_LOG {
854     LARGE_INTEGER   SystemTime;  // timestammp via NdisGetCurrentSystemTime()
855     UCHAR           Addr[MAC_ADDR_LENGTH];
856     USHORT          Event;       // EVENT_xxx
857 } RT_802_11_EVENT_LOG, *PRT_802_11_EVENT_LOG;
858
859 typedef struct _RT_802_11_EVENT_TABLE {
860     ULONG       Num;
861     ULONG       Rsv;     // to align Log[] at LARGE_INEGER boundary
862     RT_802_11_EVENT_LOG   Log[MAX_NUMBER_OF_EVENT];
863 } RT_802_11_EVENT_TABLE, PRT_802_11_EVENT_TABLE;
864
865 // MIMO Tx parameter, ShortGI, MCS, STBC, etc.  these are fields in TXWI. Don't change this definition!!!
866 typedef union  _MACHTTRANSMIT_SETTING {
867         struct  {
868         USHORT          MCS:7;                 // MCS
869         USHORT          BW:1;   //channel bandwidth 20MHz or 40 MHz
870         USHORT          ShortGI:1;
871         USHORT          STBC:2; //SPACE
872         USHORT          rsv:3;
873         USHORT          MODE:2; // Use definition MODE_xxx.
874         }       field;
875         USHORT          word;
876  } MACHTTRANSMIT_SETTING, *PMACHTTRANSMIT_SETTING;
877
878 typedef struct _RT_802_11_MAC_ENTRY {
879     UCHAR       Addr[MAC_ADDR_LENGTH];
880     UCHAR       Aid;
881     UCHAR       Psm;     // 0:PWR_ACTIVE, 1:PWR_SAVE
882     UCHAR               MimoPs;  // 0:MMPS_STATIC, 1:MMPS_DYNAMIC, 3:MMPS_Enabled
883     CHAR                AvgRssi0;
884         CHAR            AvgRssi1;
885         CHAR            AvgRssi2;
886         UINT32          ConnectedTime;
887     MACHTTRANSMIT_SETTING       TxRate;
888 } RT_802_11_MAC_ENTRY, *PRT_802_11_MAC_ENTRY;
889
890 typedef struct _RT_802_11_MAC_TABLE {
891     ULONG       Num;
892     RT_802_11_MAC_ENTRY Entry[MAX_NUMBER_OF_MAC];
893 } RT_802_11_MAC_TABLE, *PRT_802_11_MAC_TABLE;
894
895 // structure for query/set hardware register - MAC, BBP, RF register
896 typedef struct _RT_802_11_HARDWARE_REGISTER {
897     ULONG   HardwareType;       // 0:MAC, 1:BBP, 2:RF register, 3:EEPROM
898     ULONG   Offset;             // Q/S register offset addr
899     ULONG   Data;               // R/W data buffer
900 } RT_802_11_HARDWARE_REGISTER, *PRT_802_11_HARDWARE_REGISTER;
901
902 // structure to tune BBP R17 "RX AGC VGC init"
903 //typedef struct _RT_802_11_RX_AGC_VGC_TUNING {
904 //    UCHAR   FalseCcaLowerThreshold;  // 0-255, def 10
905 //    UCHAR   FalseCcaUpperThreshold;  // 0-255, def 100
906 //    UCHAR   VgcDelta;                // R17 +-= VgcDelta whenever flase CCA over UpprThreshold
907 //                                     // or lower than LowerThresholdupper threshold
908 //    UCHAR   VgcUpperBound;           // max value of R17
909 //} RT_802_11_RX_AGC_VGC_TUNING, *PRT_802_11_RX_AGC_VGC_TUNING;
910
911 typedef struct _RT_802_11_AP_CONFIG {
912     ULONG   EnableTxBurst;      // 0-disable, 1-enable
913     ULONG   EnableTurboRate;    // 0-disable, 1-enable 72/100mbps turbo rate
914     ULONG   IsolateInterStaTraffic;     // 0-disable, 1-enable isolation
915     ULONG   HideSsid;           // 0-disable, 1-enable hiding
916     ULONG   UseBGProtection;    // 0-AUTO, 1-always ON, 2-always OFF
917     ULONG   UseShortSlotTime;   // 0-no use, 1-use 9-us short slot time
918     ULONG   Rsv1;               // must be 0
919     ULONG   SystemErrorBitmap;  // ignore upon SET, return system error upon QUERY
920 } RT_802_11_AP_CONFIG, *PRT_802_11_AP_CONFIG;
921
922 // structure to query/set STA_CONFIG
923 typedef struct _RT_802_11_STA_CONFIG {
924     ULONG   EnableTxBurst;      // 0-disable, 1-enable
925     ULONG   EnableTurboRate;    // 0-disable, 1-enable 72/100mbps turbo rate
926     ULONG   UseBGProtection;    // 0-AUTO, 1-always ON, 2-always OFF
927     ULONG   UseShortSlotTime;   // 0-no use, 1-use 9-us short slot time when applicable
928     ULONG   AdhocMode;                  // 0-11b rates only (WIFI spec), 1 - b/g mixed, 2 - g only
929     ULONG   HwRadioStatus;      // 0-OFF, 1-ON, default is 1, Read-Only
930     ULONG   Rsv1;               // must be 0
931     ULONG   SystemErrorBitmap;  // ignore upon SET, return system error upon QUERY
932 } RT_802_11_STA_CONFIG, *PRT_802_11_STA_CONFIG;
933
934 //
935 //  For OID Query or Set about BA structure
936 //
937 typedef struct  _OID_BACAP_STRUC        {
938                 UCHAR           RxBAWinLimit;
939                 UCHAR           TxBAWinLimit;
940                 UCHAR           Policy; // 0: DELAY_BA 1:IMMED_BA  (//BA Policy subfiled value in ADDBA frame)   2:BA-not use. other value invalid
941                 UCHAR           MpduDensity;    // 0: DELAY_BA 1:IMMED_BA  (//BA Policy subfiled value in ADDBA frame)   2:BA-not use. other value invalid
942                 UCHAR           AmsduEnable;    //Enable AMSDU transmisstion
943                 UCHAR           AmsduSize;      // 0:3839, 1:7935 bytes. UINT  MSDUSizeToBytes[]        = { 3839, 7935};
944                 UCHAR           MMPSmode;       // MIMO power save more, 0:static, 1:dynamic, 2:rsv, 3:mimo enable
945                 BOOLEAN         AutoBA; // Auto BA will automatically
946 } OID_BACAP_STRUC, *POID_BACAP_STRUC;
947
948 typedef struct _RT_802_11_ACL_ENTRY {
949     UCHAR   Addr[MAC_ADDR_LENGTH];
950     USHORT  Rsv;
951 } RT_802_11_ACL_ENTRY, *PRT_802_11_ACL_ENTRY;
952
953 typedef struct PACKED _RT_802_11_ACL {
954     ULONG   Policy;             // 0-disable, 1-positive list, 2-negative list
955     ULONG   Num;
956     RT_802_11_ACL_ENTRY Entry[MAX_NUMBER_OF_ACL];
957 } RT_802_11_ACL, *PRT_802_11_ACL;
958
959 typedef struct _RT_802_11_WDS {
960     ULONG                                               Num;
961     NDIS_802_11_MAC_ADDRESS             Entry[24/*MAX_NUM_OF_WDS_LINK*/];
962         ULONG                                           KeyLength;
963         UCHAR                                           KeyMaterial[32];
964 } RT_802_11_WDS, *PRT_802_11_WDS;
965
966 typedef struct _RT_802_11_TX_RATES_ {
967     UCHAR       SupRateLen;
968     UCHAR       SupRate[MAX_LENGTH_OF_SUPPORT_RATES];
969     UCHAR       ExtRateLen;
970     UCHAR       ExtRate[MAX_LENGTH_OF_SUPPORT_RATES];
971 } RT_802_11_TX_RATES, *PRT_802_11_TX_RATES;
972
973
974 // Definition of extra information code
975 #define GENERAL_LINK_UP                 0x0                     // Link is Up
976 #define GENERAL_LINK_DOWN               0x1                     // Link is Down
977 #define HW_RADIO_OFF                    0x2                     // Hardware radio off
978 #define SW_RADIO_OFF                    0x3                     // Software radio off
979 #define AUTH_FAIL                               0x4                     // Open authentication fail
980 #define AUTH_FAIL_KEYS                  0x5                     // Shared authentication fail
981 #define ASSOC_FAIL                              0x6                     // Association failed
982 #define EAP_MIC_FAILURE                 0x7                     // Deauthencation because MIC failure
983 #define EAP_4WAY_TIMEOUT                0x8                     // Deauthencation on 4-way handshake timeout
984 #define EAP_GROUP_KEY_TIMEOUT   0x9                     // Deauthencation on group key handshake timeout
985 #define EAP_SUCCESS                             0xa                     // EAP succeed
986 #define DETECT_RADAR_SIGNAL             0xb         // Radar signal occur in current channel
987 #define EXTRA_INFO_MAX                  0xb                     // Indicate Last OID
988
989 #define EXTRA_INFO_CLEAR                0xffffffff
990
991 // This is OID setting structure. So only GF or MM as Mode. This is valid when our wirelss mode has 802.11n in use.
992 typedef struct {
993         RT_802_11_PHY_MODE              PhyMode;        //
994         UCHAR           TransmitNo;
995         UCHAR           HtMode;         //HTMODE_GF or HTMODE_MM
996         UCHAR           ExtOffset;      //extension channel above or below
997         UCHAR           MCS;
998         UCHAR           BW;
999         UCHAR           STBC;
1000         UCHAR           SHORTGI;
1001         UCHAR           rsv;
1002 } OID_SET_HT_PHYMODE, *POID_SET_HT_PHYMODE;
1003
1004 #ifdef NINTENDO_AP
1005 #define NINTENDO_MAX_ENTRY 16
1006 #define NINTENDO_SSID_NAME_LN 8
1007 #define NINTENDO_SSID_NAME "NWCUSBAP"
1008 #define NINTENDO_PROBE_REQ_FLAG_MASK 0x03
1009 #define NINTENDO_PROBE_REQ_ON 0x01
1010 #define NINTENDO_PROBE_REQ_SIGNAL 0x02
1011 #define NINTENDO_PROBE_RSP_ON 0x01
1012 #define NINTENDO_SSID_NICKNAME_LN 20
1013
1014 #define NINTENDO_WEPKEY_LN 13
1015
1016 typedef struct _NINTENDO_SSID
1017 {
1018         UCHAR   NINTENDOFixChar[NINTENDO_SSID_NAME_LN];
1019         UCHAR   zero1;
1020         UCHAR   registe;
1021         UCHAR   ID;
1022         UCHAR   zero2;
1023         UCHAR   NICKname[NINTENDO_SSID_NICKNAME_LN];
1024 } RT_NINTENDO_SSID, *PRT_NINTENDO_SSID;
1025
1026 typedef struct _NINTENDO_ENTRY
1027 {
1028         UCHAR   NICKname[NINTENDO_SSID_NICKNAME_LN];
1029     UCHAR   DS_Addr[ETH_LENGTH_OF_ADDRESS];
1030         UCHAR   registe;
1031         UCHAR   UserSpaceAck;
1032 } RT_NINTENDO_ENTRY, *PRT_NINTENDO_ENTRY;
1033
1034 //RTPRIV_IOCTL_NINTENDO_GET_TABLE
1035 //RTPRIV_IOCTL_NINTENDO_SET_TABLE
1036 typedef struct _NINTENDO_TABLE
1037 {
1038         UINT                            number;
1039         RT_NINTENDO_ENTRY       entry[NINTENDO_MAX_ENTRY];
1040 } RT_NINTENDO_TABLE, *PRT_NINTENDO_TABLE;
1041
1042 //RTPRIV_IOCTL_NINTENDO_SEED_WEPKEY
1043 typedef struct _NINTENDO_SEED_WEPKEY
1044 {
1045         UCHAR   seed[NINTENDO_SSID_NICKNAME_LN];
1046         UCHAR   wepkey[16];//use 13 for 104 bits wep key
1047 } RT_NINTENDO_SEED_WEPKEY, *PRT_NINTENDO_SEED_WEPKEY;
1048 #endif // NINTENDO_AP //
1049
1050 #ifdef LLTD_SUPPORT
1051 typedef struct _RT_LLTD_ASSOICATION_ENTRY {
1052     UCHAR           Addr[ETH_LENGTH_OF_ADDRESS];
1053     unsigned short  MOR;        // maximum operational rate
1054     UCHAR           phyMode;
1055 } RT_LLTD_ASSOICATION_ENTRY, *PRT_LLTD_ASSOICATION_ENTRY;
1056
1057 typedef struct _RT_LLTD_ASSOICATION_TABLE {
1058     unsigned int                Num;
1059     RT_LLTD_ASSOICATION_ENTRY   Entry[MAX_NUMBER_OF_MAC];
1060 } RT_LLTD_ASSOICATION_TABLE, *PRT_LLTD_ASSOICATION_TABLE;
1061 #endif // LLTD_SUPPORT //
1062
1063 #ifdef CONFIG_STA_SUPPORT
1064 #ifdef QOS_DLS_SUPPORT
1065 //rt2860, kathy 2007-0118
1066 // structure for DLS
1067 typedef struct _RT_802_11_DLS_UI {
1068         USHORT                                          TimeOut;                // unit: second , set by UI
1069         USHORT                                          CountDownTimer; // unit: second , used by driver only
1070         NDIS_802_11_MAC_ADDRESS         MacAddr;                // set by UI
1071         UCHAR                                           Status;                 // 0: none , 1: wait STAkey, 2: finish DLS setup , set by driver only
1072         BOOLEAN                                         Valid;                  // 1: valid , 0: invalid , set by UI, use to setup or tear down DLS link
1073 } RT_802_11_DLS_UI, *PRT_802_11_DLS_UI;
1074
1075 typedef struct _RT_802_11_DLS_INFO {
1076         RT_802_11_DLS_UI        Entry[MAX_NUMBER_OF_DLS_ENTRY];
1077         UCHAR                           num;
1078 } RT_802_11_DLS_INFO, *PRT_802_11_DLS_INFO;
1079
1080 typedef enum _RT_802_11_DLS_MODE {
1081     DLS_NONE,
1082     DLS_WAIT_KEY,
1083     DLS_FINISH
1084 } RT_802_11_DLS_MODE;
1085 #endif // QOS_DLS_SUPPORT //
1086
1087 #ifdef WPA_SUPPLICANT_SUPPORT
1088 #ifndef NATIVE_WPA_SUPPLICANT_SUPPORT
1089 #define RT_ASSOC_EVENT_FLAG                         0x0101
1090 #define RT_DISASSOC_EVENT_FLAG                      0x0102
1091 #define RT_REQIE_EVENT_FLAG                         0x0103
1092 #define RT_RESPIE_EVENT_FLAG                        0x0104
1093 #define RT_ASSOCINFO_EVENT_FLAG                     0x0105
1094 #define RT_PMKIDCAND_FLAG                           0x0106
1095 #define RT_INTERFACE_DOWN                           0x0107
1096 #define RT_INTERFACE_UP                             0x0108
1097 #endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
1098 #endif // WPA_SUPPLICANT_SUPPORT //
1099 #endif // CONFIG_STA_SUPPORT //
1100
1101
1102 #define MAX_CUSTOM_LEN 128
1103
1104 #ifdef CONFIG_STA_SUPPORT
1105 typedef enum _RT_802_11_D_CLIENT_MODE
1106 {
1107    Rt802_11_D_None,
1108    Rt802_11_D_Flexible,
1109    Rt802_11_D_Strict,
1110 } RT_802_11_D_CLIENT_MODE, *PRT_802_11_D_CLIENT_MODE;
1111 #endif // CONFIG_STA_SUPPORT //
1112
1113 typedef struct _RT_CHANNEL_LIST_INFO
1114 {
1115         UCHAR ChannelList[MAX_NUM_OF_CHS];   // list all supported channels for site survey
1116         UCHAR ChannelListNum; // number of channel in ChannelList[]
1117 } RT_CHANNEL_LIST_INFO, *PRT_CHANNEL_LIST_INFO;
1118
1119 // WSC configured credential
1120 typedef struct  _WSC_CREDENTIAL
1121 {
1122         NDIS_802_11_SSID        SSID;                           // mandatory
1123         USHORT                          AuthType;                       // mandatory, 1: open, 2: wpa-psk, 4: shared, 8:wpa, 0x10: wpa2, 0x20: wpa2-psk
1124         USHORT                          EncrType;                       // mandatory, 1: none, 2: wep, 4: tkip, 8: aes
1125         UCHAR                           Key[64];                        // mandatory, Maximum 64 byte
1126         USHORT                          KeyLength;
1127         UCHAR                           MacAddr[6];                     // mandatory, AP MAC address
1128         UCHAR                           KeyIndex;                       // optional, default is 1
1129         UCHAR                           Rsvd[3];                        // Make alignment
1130 }       WSC_CREDENTIAL, *PWSC_CREDENTIAL;
1131
1132 // WSC configured profiles
1133 typedef struct  _WSC_PROFILE
1134 {
1135         UINT                    ProfileCnt;
1136         WSC_CREDENTIAL  Profile[8];                             // Support up to 8 profiles
1137 }       WSC_PROFILE, *PWSC_PROFILE;
1138
1139
1140
1141 #endif // _OID_H_
1142