• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/staging/rt2860/
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
131typedef 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
138typedef u8 NDIS_802_11_MAC_ADDRESS[6];
139
140struct rt_ndis_802_11_status_indication {
141	NDIS_802_11_STATUS_TYPE StatusType;
142};
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
152struct rt_ndis_802_11_authentication_request {
153	unsigned long Length;		/* Length of structure */
154	NDIS_802_11_MAC_ADDRESS Bssid;
155	unsigned long Flags;
156};
157
158/*Added new types for PMKID Candidate lists. */
159struct rt_pmkid_candidate {
160	NDIS_802_11_MAC_ADDRESS BSSID;
161	unsigned long Flags;
162};
163
164struct rt_ndis_802_11_pmkid_candidate_list {
165	unsigned long Version;		/* Version of the structure */
166	unsigned long NumCandidates;	/* No. of pmkid candidates */
167	struct rt_pmkid_candidate CandidateList[1];
168};
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 */
174typedef 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
185struct rt_ndis_802_11_network_type_list {
186	u32 NumberOfItems;	/* in list below, at least 1 */
187	NDIS_802_11_NETWORK_TYPE NetworkType[1];
188};
189
190typedef 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
198typedef unsigned long NDIS_802_11_TX_POWER_LEVEL;	/* in milliwatts */
199
200/* */
201/* Received Signal Strength Indication */
202/* */
203typedef long NDIS_802_11_RSSI;	/* in dBm */
204
205struct rt_ndis_802_11_configuration_fh {
206	unsigned long Length;		/* Length of structure */
207	unsigned long HopPattern;	/* As defined by 802.11, MSB set */
208	unsigned long HopSet;		/* to one if non-802.11 */
209	unsigned long DwellTime;	/* units are Kusec */
210};
211
212struct rt_ndis_802_11_configuration {
213	unsigned long Length;		/* Length of structure */
214	unsigned long BeaconPeriod;	/* units are Kusec */
215	unsigned long ATIMWindow;	/* units are Kusec */
216	unsigned long DSConfig;		/* Frequency, units are kHz */
217	struct rt_ndis_802_11_configuration_fh FHConfig;
218};
219
220struct rt_ndis_802_11_statistics {
221	unsigned long 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};
244
245typedef unsigned long NDIS_802_11_KEY_INDEX;
246typedef unsigned long long NDIS_802_11_KEY_RSC;
247
248#define MAX_RADIUS_SRV_NUM			2	/* 802.1x failover number */
249
250struct PACKED rt_radius_srv_info {
251	u32 radius_ip;
252	u32 radius_port;
253	u8 radius_key[64];
254	u8 radius_key_len;
255};
256
257struct PACKED rt_radius_key_info {
258	u8 radius_srv_num;
259	struct rt_radius_srv_info radius_srv_info[MAX_RADIUS_SRV_NUM];
260	u8 ieee8021xWEP;	/* dynamic WEP */
261	u8 key_index;
262	u8 key_length;	/* length of key in bytes */
263	u8 key_material[13];
264};
265
266/* It's used by 802.1x daemon to require relative configuration */
267struct PACKED rt_radius_conf {
268	u32 Length;		/* Length of this structure */
269	u8 mbss_num;		/* indicate multiple BSS number */
270	u32 own_ip_addr;
271	u32 retry_interval;
272	u32 session_timeout_interval;
273	u8 EAPifname[8][IFNAMSIZ];
274	u8 EAPifname_len[8];
275	u8 PreAuthifname[8][IFNAMSIZ];
276	u8 PreAuthifname_len[8];
277	struct rt_radius_key_info RadiusInfo[8];
278};
279
280/* Key mapping keys require a BSSID */
281struct rt_ndis_802_11_key {
282	u32 Length;		/* Length of this structure */
283	u32 KeyIndex;
284	u32 KeyLength;		/* length of key in bytes */
285	NDIS_802_11_MAC_ADDRESS BSSID;
286	NDIS_802_11_KEY_RSC KeyRSC;
287	u8 KeyMaterial[1];	/* variable length depending on above field */
288};
289
290struct rt_ndis_802_11_passphrase {
291	u32 KeyLength;		/* length of key in bytes */
292	NDIS_802_11_MAC_ADDRESS BSSID;
293	u8 KeyMaterial[1];	/* variable length depending on above field */
294};
295
296struct rt_ndis_802_11_remove_key {
297	u32 Length;		/* Length of this structure */
298	u32 KeyIndex;
299	NDIS_802_11_MAC_ADDRESS BSSID;
300};
301
302struct rt_ndis_802_11_wep {
303	u32 Length;		/* Length of this structure */
304	u32 KeyIndex;		/* 0 is the per-client key, 1-N are the */
305	/* global keys */
306	u32 KeyLength;		/* length of key in bytes */
307	u8 KeyMaterial[1];	/* variable length depending on above field */
308};
309
310typedef 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 */
319typedef 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
333typedef u8 NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES];	/* Set of 8 data rates */
334typedef u8 NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX];	/* Set of 16 data rates */
335
336struct PACKED rt_ndis_802_11_ssid {
337	u32 SsidLength;	/* length of SSID field below, in bytes; */
338	/* this can be zero. */
339	u8 Ssid[NDIS_802_11_LENGTH_SSID];	/* SSID information field */
340};
341
342struct PACKED rt_ndis_wlan_bssid {
343	unsigned long Length;		/* Length of this structure */
344	NDIS_802_11_MAC_ADDRESS MacAddress;	/* BSSID */
345	u8 Reserved[2];
346	struct rt_ndis_802_11_ssid Ssid;	/* SSID */
347	unsigned long Privacy;		/* WEP encryption requirement */
348	NDIS_802_11_RSSI Rssi;	/* receive signal strength in dBm */
349	NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
350	struct rt_ndis_802_11_configuration Configuration;
351	NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
352	NDIS_802_11_RATES SupportedRates;
353};
354
355struct PACKED rt_ndis_802_11_bssid_list {
356	u32 NumberOfItems;	/* in list below, at least 1 */
357	struct rt_ndis_wlan_bssid Bssid[1];
358};
359
360/* Added Capabilities, IELength and IEs for each BSSID */
361struct PACKED rt_ndis_wlan_bssid_ex {
362	unsigned long Length;		/* Length of this structure */
363	NDIS_802_11_MAC_ADDRESS MacAddress;	/* BSSID */
364	u8 Reserved[2];
365	struct rt_ndis_802_11_ssid Ssid;	/* SSID */
366	u32 Privacy;		/* WEP encryption requirement */
367	NDIS_802_11_RSSI Rssi;	/* receive signal */
368	/* strength in dBm */
369	NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
370	struct rt_ndis_802_11_configuration Configuration;
371	NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
372	NDIS_802_11_RATES_EX SupportedRates;
373	unsigned long IELength;
374	u8 IEs[1];
375};
376
377struct PACKED rt_ndis_802_11_bssid_list_ex {
378	u32 NumberOfItems;	/* in list below, at least 1 */
379	struct rt_ndis_wlan_bssid_ex Bssid[1];
380};
381
382struct PACKED rt_ndis_802_11_fixed_ies {
383	u8 Timestamp[8];
384	u16 BeaconInterval;
385	u16 Capabilities;
386};
387
388struct rt_ndis_802_11_variable_ies {
389	u8 ElementID;
390	u8 Length;		/* Number of bytes in data field */
391	u8 data[1];
392};
393
394typedef unsigned long NDIS_802_11_FRAGMENTATION_THRESHOLD;
395
396typedef unsigned long NDIS_802_11_RTS_THRESHOLD;
397
398typedef unsigned long NDIS_802_11_ANTENNA;
399
400typedef 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 */
407typedef 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
427typedef 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
439struct rt_ndis_802_11_ai_reqfi {
440	u16 Capabilities;
441	u16 ListenInterval;
442	NDIS_802_11_MAC_ADDRESS CurrentAPAddress;
443};
444
445struct rt_ndis_802_11_ai_resfi {
446	u16 Capabilities;
447	u16 StatusCode;
448	u16 AssociationId;
449};
450
451struct rt_ndis_802_11_association_information {
452	unsigned long Length;
453	u16 AvailableRequestFixedIEs;
454	struct rt_ndis_802_11_ai_reqfi RequestFixedIEs;
455	unsigned long RequestIELength;
456	unsigned long OffsetRequestIEs;
457	u16 AvailableResponseFixedIEs;
458	struct rt_ndis_802_11_ai_resfi ResponseFixedIEs;
459	unsigned long ResponseIELength;
460	unsigned long OffsetResponseIEs;
461};
462
463struct rt_ndis_802_11_authentication_event {
464	struct rt_ndis_802_11_status_indication Status;
465	struct rt_ndis_802_11_authentication_request Request[1];
466};
467
468/* 802.11 Media stream constraints, associated with OID_802_11_MEDIA_STREAM_MODE */
469typedef 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 */
475typedef u8 NDIS_802_11_PMKID_VALUE[16];
476
477struct rt_bssid_info {
478	NDIS_802_11_MAC_ADDRESS BSSID;
479	NDIS_802_11_PMKID_VALUE PMKID;
480};
481
482struct rt_ndis_802_11_pmkid {
483	u32 Length;
484	u32 BSSIDInfoCount;
485	struct rt_bssid_info BSSIDInfo[1];
486};
487
488struct rt_ndis_802_11_authentication_encryption {
489	NDIS_802_11_AUTHENTICATION_MODE AuthModeSupported;
490	NDIS_802_11_ENCRYPTION_STATUS EncryptStatusSupported;
491};
492
493struct rt_ndis_802_11_capability {
494	unsigned long Length;
495	unsigned long Version;
496	unsigned long NoOfPMKIDs;
497	unsigned long NoOfAuthEncryptPairsSupported;
498	struct rt_ndis_802_11_authentication_encryption
499	    AuthenticationEncryptionSupported[1];
500};
501
502#define RT_PRIV_IOCTL							(SIOCIWFIRSTPRIV + 0x01)	/* Sync. with AP for wsc upnp daemon */
503#define RTPRIV_IOCTL_SET							(SIOCIWFIRSTPRIV + 0x02)
504
505#define RTPRIV_IOCTL_STATISTICS                     (SIOCIWFIRSTPRIV + 0x09)
506#define RTPRIV_IOCTL_ADD_PMKID_CACHE                (SIOCIWFIRSTPRIV + 0x0A)
507#define RTPRIV_IOCTL_RADIUS_DATA                    (SIOCIWFIRSTPRIV + 0x0C)
508#define RTPRIV_IOCTL_GSITESURVEY					(SIOCIWFIRSTPRIV + 0x0D)
509#define RT_PRIV_IOCTL_EXT							(SIOCIWFIRSTPRIV + 0x0E)	/* Sync. with RT61 (for wpa_supplicant) */
510#define RTPRIV_IOCTL_GET_MAC_TABLE					(SIOCIWFIRSTPRIV + 0x0F)
511
512#define RTPRIV_IOCTL_SHOW							(SIOCIWFIRSTPRIV + 0x11)
513enum {
514	SHOW_CONN_STATUS = 4,
515	SHOW_DRVIER_VERION = 5,
516	SHOW_BA_INFO = 6,
517	SHOW_DESC_INFO = 7,
518#ifdef RTMP_MAC_USB
519	SHOW_RXBULK_INFO = 8,
520	SHOW_TXBULK_INFO = 9,
521#endif /* RTMP_MAC_USB // */
522	RAIO_OFF = 10,
523	RAIO_ON = 11,
524	SHOW_CFG_VALUE = 20,
525	SHOW_ADHOC_ENTRY_INFO = 21,
526};
527
528#define OID_802_11_BUILD_CHANNEL_EX				0x0714
529#define OID_802_11_GET_CH_LIST					0x0715
530#define OID_802_11_GET_COUNTRY_CODE				0x0716
531#define OID_802_11_GET_CHANNEL_GEOGRAPHY		0x0717
532
533#define RT_OID_WSC_SET_PASSPHRASE                   0x0740	/* passphrase for wpa(2)-psk */
534#define RT_OID_WSC_DRIVER_AUTO_CONNECT              0x0741
535#define RT_OID_WSC_QUERY_DEFAULT_PROFILE            0x0742
536#define RT_OID_WSC_SET_CONN_BY_PROFILE_INDEX        0x0743
537#define RT_OID_WSC_SET_ACTION                       0x0744
538#define RT_OID_WSC_SET_SSID                         0x0745
539#define RT_OID_WSC_SET_PIN_CODE                     0x0746
540#define RT_OID_WSC_SET_MODE                         0x0747	/* PIN or PBC */
541#define RT_OID_WSC_SET_CONF_MODE                    0x0748	/* Enrollee or Registrar */
542#define RT_OID_WSC_SET_PROFILE                      0x0749
543#define	RT_OID_WSC_CONFIG_STATUS					0x074F
544#define RT_OID_802_11_WSC_QUERY_PROFILE				0x0750
545/* for consistency with RT61 */
546#define RT_OID_WSC_QUERY_STATUS						0x0751
547#define RT_OID_WSC_PIN_CODE							0x0752
548#define RT_OID_WSC_UUID								0x0753
549#define RT_OID_WSC_SET_SELECTED_REGISTRAR			0x0754
550#define RT_OID_WSC_EAPMSG							0x0755
551#define RT_OID_WSC_MANUFACTURER						0x0756
552#define RT_OID_WSC_MODEL_NAME						0x0757
553#define RT_OID_WSC_MODEL_NO							0x0758
554#define RT_OID_WSC_SERIAL_NO						0x0759
555#define RT_OID_WSC_MAC_ADDRESS						0x0760
556
557/* New for MeetingHouse Api support */
558#define OID_MH_802_1X_SUPPORTED               0xFFEDC100
559
560/* MIMO Tx parameter, ShortGI, MCS, STBC, etc.  these are fields in TXWI. Don't change this definition! */
561typedef union _HTTRANSMIT_SETTING {
562	struct {
563		u16 MCS:7;	/* MCS */
564		u16 BW:1;	/*channel bandwidth 20MHz or 40 MHz */
565		u16 ShortGI:1;
566		u16 STBC:2;	/*SPACE */
567/*      u16          rsv:3; */
568		u16 rsv:2;
569		u16 TxBF:1;
570		u16 MODE:2;	/* Use definition MODE_xxx. */
571	} field;
572	u16 word;
573} HTTRANSMIT_SETTING, *PHTTRANSMIT_SETTING;
574
575typedef enum _RT_802_11_PREAMBLE {
576	Rt802_11PreambleLong,
577	Rt802_11PreambleShort,
578	Rt802_11PreambleAuto
579} RT_802_11_PREAMBLE, *PRT_802_11_PREAMBLE;
580
581typedef enum _RT_802_11_PHY_MODE {
582	PHY_11BG_MIXED = 0,
583	PHY_11B,
584	PHY_11A,
585	PHY_11ABG_MIXED,
586	PHY_11G,
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 */
594} RT_802_11_PHY_MODE;
595
596/* put all proprietery for-query objects here to reduce # of Query_OID */
597struct rt_802_11_link_status {
598	unsigned long CurrTxRate;	/* in units of 0.5Mbps */
599	unsigned long ChannelQuality;	/* 0..100 % */
600	unsigned long TxByteCount;	/* both ok and fail */
601	unsigned long RxByteCount;	/* both ok and fail */
602	unsigned long CentralChannel;	/* 40MHz central channel number */
603};
604
605struct rt_802_11_event_log {
606	LARGE_INTEGER SystemTime;	/* timestammp via NdisGetCurrentSystemTime() */
607	u8 Addr[MAC_ADDR_LENGTH];
608	u16 Event;		/* EVENT_xxx */
609};
610
611struct rt_802_11_event_table {
612	unsigned long Num;
613	unsigned long Rsv;		/* to align Log[] at LARGE_INEGER boundary */
614	struct rt_802_11_event_log Log[MAX_NUMBER_OF_EVENT];
615};
616
617/* MIMO Tx parameter, ShortGI, MCS, STBC, etc.  these are fields in TXWI. Don't change this definition! */
618typedef union _MACHTTRANSMIT_SETTING {
619	struct {
620		u16 MCS:7;	/* MCS */
621		u16 BW:1;	/*channel bandwidth 20MHz or 40 MHz */
622		u16 ShortGI:1;
623		u16 STBC:2;	/*SPACE */
624		u16 rsv:3;
625		u16 MODE:2;	/* Use definition MODE_xxx. */
626	} field;
627	u16 word;
628} MACHTTRANSMIT_SETTING, *PMACHTTRANSMIT_SETTING;
629
630struct rt_802_11_mac_entry {
631	u8 Addr[MAC_ADDR_LENGTH];
632	u8 Aid;
633	u8 Psm;		/* 0:PWR_ACTIVE, 1:PWR_SAVE */
634	u8 MimoPs;		/* 0:MMPS_STATIC, 1:MMPS_DYNAMIC, 3:MMPS_Enabled */
635	char AvgRssi0;
636	char AvgRssi1;
637	char AvgRssi2;
638	u32 ConnectedTime;
639	MACHTTRANSMIT_SETTING TxRate;
640};
641
642struct rt_802_11_mac_table {
643	unsigned long Num;
644	struct rt_802_11_mac_entry Entry[MAX_NUMBER_OF_MAC];
645};
646
647/* structure for query/set hardware register - MAC, BBP, RF register */
648struct rt_802_11_hardware_register {
649	unsigned long HardwareType;	/* 0:MAC, 1:BBP, 2:RF register, 3:EEPROM */
650	unsigned long Offset;		/* Q/S register offset addr */
651	unsigned long Data;		/* R/W data buffer */
652};
653
654struct rt_802_11_ap_config {
655	unsigned long EnableTxBurst;	/* 0-disable, 1-enable */
656	unsigned long EnableTurboRate;	/* 0-disable, 1-enable 72/100mbps turbo rate */
657	unsigned long IsolateInterStaTraffic;	/* 0-disable, 1-enable isolation */
658	unsigned long HideSsid;		/* 0-disable, 1-enable hiding */
659	unsigned long UseBGProtection;	/* 0-AUTO, 1-always ON, 2-always OFF */
660	unsigned long UseShortSlotTime;	/* 0-no use, 1-use 9-us short slot time */
661	unsigned long Rsv1;		/* must be 0 */
662	unsigned long SystemErrorBitmap;	/* ignore upon SET, return system error upon QUERY */
663};
664
665/* structure to query/set STA_CONFIG */
666struct rt_802_11_sta_config {
667	unsigned long EnableTxBurst;	/* 0-disable, 1-enable */
668	unsigned long EnableTurboRate;	/* 0-disable, 1-enable 72/100mbps turbo rate */
669	unsigned long UseBGProtection;	/* 0-AUTO, 1-always ON, 2-always OFF */
670	unsigned long UseShortSlotTime;	/* 0-no use, 1-use 9-us short slot time when applicable */
671	unsigned long AdhocMode;	/* 0-11b rates only (WIFI spec), 1 - b/g mixed, 2 - g only */
672	unsigned long HwRadioStatus;	/* 0-OFF, 1-ON, default is 1, Read-Only */
673	unsigned long Rsv1;		/* must be 0 */
674	unsigned long SystemErrorBitmap;	/* ignore upon SET, return system error upon QUERY */
675};
676
677/* */
678/*  For OID Query or Set about BA structure */
679/* */
680struct rt_oid_bacap {
681	u8 RxBAWinLimit;
682	u8 TxBAWinLimit;
683	u8 Policy;		/* 0: DELAY_BA 1:IMMED_BA  (//BA Policy subfiled value in ADDBA frame)   2:BA-not use. other value invalid */
684	u8 MpduDensity;	/* 0: DELAY_BA 1:IMMED_BA  (//BA Policy subfiled value in ADDBA frame)   2:BA-not use. other value invalid */
685	u8 AmsduEnable;	/*Enable AMSDU transmisstion */
686	u8 AmsduSize;	/* 0:3839, 1:7935 bytes. u32  MSDUSizeToBytes[]        = { 3839, 7935}; */
687	u8 MMPSmode;		/* MIMO power save more, 0:static, 1:dynamic, 2:rsv, 3:mimo enable */
688	BOOLEAN AutoBA;		/* Auto BA will automatically */
689};
690
691struct rt_802_11_acl_entry {
692	u8 Addr[MAC_ADDR_LENGTH];
693	u16 Rsv;
694};
695
696struct PACKED rt_rt_802_11_acl {
697	unsigned long Policy;		/* 0-disable, 1-positive list, 2-negative list */
698	unsigned long Num;
699	struct rt_802_11_acl_entry Entry[MAX_NUMBER_OF_ACL];
700};
701
702struct rt_802_11_wds {
703	unsigned long Num;
704	NDIS_802_11_MAC_ADDRESS Entry[24 /*MAX_NUM_OF_WDS_LINK */ ];
705	unsigned long KeyLength;
706	u8 KeyMaterial[32];
707};
708
709struct rt_802_11_tx_rates {
710	u8 SupRateLen;
711	u8 SupRate[MAX_LENGTH_OF_SUPPORT_RATES];
712	u8 ExtRateLen;
713	u8 ExtRate[MAX_LENGTH_OF_SUPPORT_RATES];
714};
715
716/* Definition of extra information code */
717#define	GENERAL_LINK_UP			0x0	/* Link is Up */
718#define	GENERAL_LINK_DOWN		0x1	/* Link is Down */
719#define	HW_RADIO_OFF			0x2	/* Hardware radio off */
720#define	SW_RADIO_OFF			0x3	/* Software radio off */
721#define	AUTH_FAIL				0x4	/* Open authentication fail */
722#define	AUTH_FAIL_KEYS			0x5	/* Shared authentication fail */
723#define	ASSOC_FAIL				0x6	/* Association failed */
724#define	EAP_MIC_FAILURE			0x7	/* Deauthencation because MIC failure */
725#define	EAP_4WAY_TIMEOUT		0x8	/* Deauthencation on 4-way handshake timeout */
726#define	EAP_GROUP_KEY_TIMEOUT	0x9	/* Deauthencation on group key handshake timeout */
727#define	EAP_SUCCESS				0xa	/* EAP succeed */
728#define	DETECT_RADAR_SIGNAL		0xb	/* Radar signal occur in current channel */
729#define EXTRA_INFO_MAX			0xb	/* Indicate Last OID */
730
731#define EXTRA_INFO_CLEAR		0xffffffff
732
733/* This is OID setting structure. So only GF or MM as Mode. This is valid when our wirelss mode has 802.11n in use. */
734struct rt_oid_set_ht_phymode {
735	RT_802_11_PHY_MODE PhyMode;	/* */
736	u8 TransmitNo;
737	u8 HtMode;		/*HTMODE_GF or HTMODE_MM */
738	u8 ExtOffset;	/*extension channel above or below */
739	u8 MCS;
740	u8 BW;
741	u8 STBC;
742	u8 SHORTGI;
743	u8 rsv;
744};
745
746#define MAX_CUSTOM_LEN 128
747
748typedef enum _RT_802_11_D_CLIENT_MODE {
749	Rt802_11_D_None,
750	Rt802_11_D_Flexible,
751	Rt802_11_D_Strict,
752} RT_802_11_D_CLIENT_MODE, *PRT_802_11_D_CLIENT_MODE;
753
754struct rt_channel_list_info {
755	u8 ChannelList[MAX_NUM_OF_CHS];	/* list all supported channels for site survey */
756	u8 ChannelListNum;	/* number of channel in ChannelList[] */
757};
758
759/* WSC configured credential */
760struct rt_wsc_credential {
761	struct rt_ndis_802_11_ssid SSID;	/* mandatory */
762	u16 AuthType;	/* mandatory, 1: open, 2: wpa-psk, 4: shared, 8:wpa, 0x10: wpa2, 0x20: wpa2-psk */
763	u16 EncrType;	/* mandatory, 1: none, 2: wep, 4: tkip, 8: aes */
764	u8 Key[64];		/* mandatory, Maximum 64 byte */
765	u16 KeyLength;
766	u8 MacAddr[6];	/* mandatory, AP MAC address */
767	u8 KeyIndex;		/* optional, default is 1 */
768	u8 Rsvd[3];		/* Make alignment */
769};
770
771/* WSC configured profiles */
772struct rt_wsc_profile {
773	u32 ProfileCnt;
774	u32 ApplyProfileIdx;	/* add by johnli, fix WPS test plan 5.1.1 */
775	struct rt_wsc_credential Profile[8];	/* Support up to 8 profiles */
776};
777
778#endif /* _OID_H_ */
779