b8b63cdc1078ebf4838f702b0f4a7678a884102e
[reactos.git] / sdk / include / psdk / ntddndis.h
1 /*
2 * ntddndis.h
3 *
4 * NDIS device driver interface
5 *
6 * This file is part of the w32api package.
7 *
8 * Contributors:
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10 *
11 * THIS SOFTWARE IS NOT COPYRIGHTED
12 *
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
15 *
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 */
22
23 #ifndef _NTDDNDIS_
24 #define _NTDDNDIS_
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 typedef enum _NDIS_WAN_QUALITY {
31 NdisWanRaw,
32 NdisWanErrorControl,
33 NdisWanReliable
34 } NDIS_WAN_QUALITY, *PNDIS_WAN_QUALITY;
35
36 typedef enum _NDIS_DEVICE_POWER_STATE {
37 NdisDeviceStateUnspecified = 0,
38 NdisDeviceStateD0,
39 NdisDeviceStateD1,
40 NdisDeviceStateD2,
41 NdisDeviceStateD3,
42 NdisDeviceStateMaximum
43 } NDIS_DEVICE_POWER_STATE, *PNDIS_DEVICE_POWER_STATE;
44
45 typedef enum _NDIS_802_11_WEP_STATUS
46 {
47 Ndis802_11WEPEnabled,
48 Ndis802_11WEPDisabled,
49 Ndis802_11WEPKeyAbsent,
50 Ndis802_11WEPNotSupported
51 } NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS;
52
53 typedef enum _NDIS_802_11_AUTHENTICATION_MODE
54 {
55 Ndis802_11AuthModeOpen,
56 Ndis802_11AuthModeShared,
57 Ndis802_11AuthModeAutoSwitch,
58 Ndis802_11AuthModeMax
59 } NDIS_802_11_AUTHENTICATION_MODE, *PNDIS_802_11_AUTHENTICATION_MODE;
60
61 typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE
62 {
63 Ndis802_11IBSS,
64 Ndis802_11Infrastructure,
65 Ndis802_11AutoUnknown,
66 Ndis802_11InfrastructureMax
67 } NDIS_802_11_NETWORK_INFRASTRUCTURE, *PNDIS_802_11_NETWORK_INFRASTRUCTURE;
68
69 typedef enum _NDIS_802_11_NETWORK_TYPE
70 {
71 Ndis802_11FH,
72 Ndis802_11DS,
73 Ndis802_11OFDM5,
74 Ndis802_11OFDM24,
75 Ndis802_11Automode,
76 Ndis802_11NetworkTypeMax
77 } NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE;
78
79 typedef struct _NDIS_OBJECT_HEADER
80 {
81 UCHAR Type;
82 UCHAR Revision;
83 USHORT Size;
84 } NDIS_OBJECT_HEADER, *PNDIS_OBJECT_HEADER;
85
86 #define NDIS_802_11_LENGTH_SSID 32
87 #define NDIS_802_11_LENGTH_RATES 8
88
89 typedef UCHAR NDIS_802_11_MAC_ADDRESS[6];
90 typedef LONG NDIS_802_11_RSSI;
91 typedef UCHAR NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES];
92
93 typedef struct _NDIS_802_11_SSID
94 {
95 ULONG SsidLength;
96 UCHAR Ssid[NDIS_802_11_LENGTH_SSID];
97 } NDIS_802_11_SSID, *PNDIS_802_11_SSID;
98
99 typedef struct _NDIS_802_11_CONFIGURATION_FH
100 {
101 ULONG Length;
102 ULONG HopPattern;
103 ULONG HopSet;
104 ULONG DwellTime;
105 } NDIS_802_11_CONFIGURATION_FH, *PNDIS_802_11_CONFIGURATION_FH;
106
107 typedef struct _NDIS_802_11_CONFIGURATION
108 {
109 ULONG Length;
110 ULONG BeaconPeriod;
111 ULONG ATIMWindow;
112 ULONG DSConfig;
113 NDIS_802_11_CONFIGURATION_FH FHConfig;
114 } NDIS_802_11_CONFIGURATION, *PNDIS_802_11_CONFIGURATION;
115
116 typedef struct _NDIS_WLAN_BSSID
117 {
118 ULONG Length;
119 NDIS_802_11_MAC_ADDRESS MacAddress;
120 UCHAR Reserved[2];
121 NDIS_802_11_SSID Ssid;
122 ULONG Privacy;
123 NDIS_802_11_RSSI Rssi;
124 NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
125 NDIS_802_11_CONFIGURATION Configuration;
126 NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
127 NDIS_802_11_RATES SupportedRates;
128 } NDIS_WLAN_BSSID, *PNDIS_WLAN_BSSID;
129
130 typedef struct _NDIS_802_11_BSSID_LIST
131 {
132 ULONG NumberOfItems;
133 NDIS_WLAN_BSSID Bssid[1];
134 } NDIS_802_11_BSSID_LIST, *PNDIS_802_11_BSSID_LIST;
135
136 typedef struct _NDIS_802_11_WEP
137 {
138 ULONG Length;
139 ULONG KeyIndex;
140 ULONG KeyLength;
141 UCHAR KeyMaterial[1];
142 } NDIS_802_11_WEP, *PNDIS_802_11_WEP;
143
144 typedef struct _NDIS_PM_WAKE_UP_CAPABILITIES {
145 NDIS_DEVICE_POWER_STATE MinMagicPacketWakeUp;
146 NDIS_DEVICE_POWER_STATE MinPatternWakeUp;
147 NDIS_DEVICE_POWER_STATE MinLinkChangeWakeUp;
148 } NDIS_PM_WAKE_UP_CAPABILITIES, *PNDIS_PM_WAKE_UP_CAPABILITIES;
149
150 /* NDIS_PNP_CAPABILITIES.Flags constants */
151 #define NDIS_DEVICE_WAKE_UP_ENABLE 0x00000001
152 #define NDIS_DEVICE_WAKE_ON_PATTERN_MATCH_ENABLE 0x00000002
153 #define NDIS_DEVICE_WAKE_ON_MAGIC_PACKET_ENABLE 0x00000004
154
155 typedef struct _NDIS_PNP_CAPABILITIES {
156 ULONG Flags;
157 NDIS_PM_WAKE_UP_CAPABILITIES WakeUpCapabilities;
158 } NDIS_PNP_CAPABILITIES, *PNDIS_PNP_CAPABILITIES;
159
160 /* NDIS driver medium (OID_GEN_MEDIA_SUPPORTED / OID_GEN_MEDIA_IN_USE) */
161 typedef enum _NDIS_MEDIUM {
162 NdisMedium802_3,
163 NdisMedium802_5,
164 NdisMediumFddi,
165 NdisMediumWan,
166 NdisMediumLocalTalk,
167 NdisMediumDix,
168 NdisMediumArcnetRaw,
169 NdisMediumArcnet878_2,
170 NdisMediumAtm,
171 NdisMediumWirelessWan,
172 NdisMediumIrda,
173 NdisMediumBpc,
174 NdisMediumCoWan,
175 NdisMedium1394,
176 NdisMediumMax
177 } NDIS_MEDIUM, *PNDIS_MEDIUM;
178
179 typedef enum _NDIS_PHYSICAL_MEDIUM
180 {
181 NdisPhysicalMediumUnspecified,
182 NdisPhysicalMediumWirelessLan,
183 NdisPhysicalMediumCableModem,
184 NdisPhysicalMediumPhoneLine,
185 NdisPhysicalMediumPowerLine,
186 NdisPhysicalMediumDSL,
187 NdisPhysicalMediumFibreChannel,
188 NdisPhysicalMedium1394,
189 NdisPhysicalMediumWirelessWan,
190 NdisPhysicalMediumNative802_11,
191 NdisPhysicalMediumBluetooth,
192 NdisPhysicalMediumInfiniband,
193 NdisPhysicalMediumWiMax,
194 NdisPhysicalMediumUWB,
195 NdisPhysicalMedium802_3,
196 NdisPhysicalMedium802_5,
197 NdisPhysicalMediumIrda,
198 NdisPhysicalMediumWiredWAN,
199 NdisPhysicalMediumWiredCoWan,
200 NdisPhysicalMediumOther,
201 NdisPhysicalMediumMax
202 } NDIS_PHYSICAL_MEDIUM, *PNDIS_PHYSICAL_MEDIUM;
203
204 typedef ULONG NDIS_OID, *PNDIS_OID;
205
206 /* Required Object IDs (OIDs) */
207 #define OID_GEN_SUPPORTED_LIST 0x00010101
208 #define OID_GEN_HARDWARE_STATUS 0x00010102
209 #define OID_GEN_MEDIA_SUPPORTED 0x00010103
210 #define OID_GEN_MEDIA_IN_USE 0x00010104
211 #define OID_GEN_MAXIMUM_LOOKAHEAD 0x00010105
212 #define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106
213 #define OID_GEN_LINK_SPEED 0x00010107
214 #define OID_GEN_TRANSMIT_BUFFER_SPACE 0x00010108
215 #define OID_GEN_RECEIVE_BUFFER_SPACE 0x00010109
216 #define OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010A
217 #define OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010B
218 #define OID_GEN_VENDOR_ID 0x0001010C
219 #define OID_GEN_VENDOR_DESCRIPTION 0x0001010D
220 #define OID_GEN_CURRENT_PACKET_FILTER 0x0001010E
221 #define OID_GEN_CURRENT_LOOKAHEAD 0x0001010F
222 #define OID_GEN_DRIVER_VERSION 0x00010110
223 #define OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111
224 #define OID_GEN_PROTOCOL_OPTIONS 0x00010112
225 #define OID_GEN_MAC_OPTIONS 0x00010113
226 #define OID_GEN_MEDIA_CONNECT_STATUS 0x00010114
227 #define OID_GEN_MAXIMUM_SEND_PACKETS 0x00010115
228 #define OID_GEN_VENDOR_DRIVER_VERSION 0x00010116
229 #define OID_GEN_SUPPORTED_GUIDS 0x00010117
230 #define OID_GEN_NETWORK_LAYER_ADDRESSES 0x00010118
231 #define OID_GEN_TRANSPORT_HEADER_OFFSET 0x00010119
232 #define OID_GEN_MACHINE_NAME 0x0001021A
233 #define OID_GEN_RNDIS_CONFIG_PARAMETER 0x0001021B
234 #define OID_GEN_VLAN_ID 0x0001021C
235
236 /* Optional OIDs */
237 #define OID_GEN_MEDIA_CAPABILITIES 0x00010201
238 #define OID_GEN_PHYSICAL_MEDIUM 0x00010202
239
240 /* Required statistics OIDs */
241 #define OID_GEN_XMIT_OK 0x00020101
242 #define OID_GEN_RCV_OK 0x00020102
243 #define OID_GEN_XMIT_ERROR 0x00020103
244 #define OID_GEN_RCV_ERROR 0x00020104
245 #define OID_GEN_RCV_NO_BUFFER 0x00020105
246
247 /* Optional statistics OIDs */
248 #define OID_GEN_DIRECTED_BYTES_XMIT 0x00020201
249 #define OID_GEN_DIRECTED_FRAMES_XMIT 0x00020202
250 #define OID_GEN_MULTICAST_BYTES_XMIT 0x00020203
251 #define OID_GEN_MULTICAST_FRAMES_XMIT 0x00020204
252 #define OID_GEN_BROADCAST_BYTES_XMIT 0x00020205
253 #define OID_GEN_BROADCAST_FRAMES_XMIT 0x00020206
254 #define OID_GEN_DIRECTED_BYTES_RCV 0x00020207
255 #define OID_GEN_DIRECTED_FRAMES_RCV 0x00020208
256 #define OID_GEN_MULTICAST_BYTES_RCV 0x00020209
257 #define OID_GEN_MULTICAST_FRAMES_RCV 0x0002020A
258 #define OID_GEN_BROADCAST_BYTES_RCV 0x0002020B
259 #define OID_GEN_BROADCAST_FRAMES_RCV 0x0002020C
260 #define OID_GEN_RCV_CRC_ERROR 0x0002020D
261 #define OID_GEN_TRANSMIT_QUEUE_LENGTH 0x0002020E
262 #define OID_GEN_GET_TIME_CAPS 0x0002020F
263 #define OID_GEN_GET_NETCARD_TIME 0x00020210
264 #define OID_GEN_NETCARD_LOAD 0x00020211
265 #define OID_GEN_DEVICE_PROFILE 0x00020212
266 #define OID_GEN_INIT_TIME_MS 0x00020213
267 #define OID_GEN_RESET_COUNTS 0x00020214
268 #define OID_GEN_MEDIA_SENSE_COUNTS 0x00020215
269 #define OID_GEN_FRIENDLY_NAME 0x00020216
270 #define OID_GEN_MINIPORT_INFO 0x00020217
271 #define OID_GEN_RESET_VERIFY_PARAMETERS 0x00020218
272
273 /* IEEE 802.3 (Ethernet) OIDs */
274 #define NDIS_802_3_MAC_OPTION_PRIORITY 0x00000001
275
276 #define OID_802_3_PERMANENT_ADDRESS 0x01010101
277 #define OID_802_3_CURRENT_ADDRESS 0x01010102
278 #define OID_802_3_MULTICAST_LIST 0x01010103
279 #define OID_802_3_MAXIMUM_LIST_SIZE 0x01010104
280 #define OID_802_3_MAC_OPTIONS 0x01010105
281 #define OID_802_3_RCV_ERROR_ALIGNMENT 0x01020101
282 #define OID_802_3_XMIT_ONE_COLLISION 0x01020102
283 #define OID_802_3_XMIT_MORE_COLLISIONS 0x01020103
284 #define OID_802_3_XMIT_DEFERRED 0x01020201
285 #define OID_802_3_XMIT_MAX_COLLISIONS 0x01020202
286 #define OID_802_3_RCV_OVERRUN 0x01020203
287 #define OID_802_3_XMIT_UNDERRUN 0x01020204
288 #define OID_802_3_XMIT_HEARTBEAT_FAILURE 0x01020205
289 #define OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206
290 #define OID_802_3_XMIT_LATE_COLLISIONS 0x01020207
291
292 /* IEEE 802.11 (WLAN) OIDs */
293 #define OID_802_11_BSSID 0x0D010101
294 #define OID_802_11_SSID 0x0D010102
295 #define OID_802_11_NETWORK_TYPES_SUPPORTED 0x0D010203
296 #define OID_802_11_NETWORK_TYPE_IN_USE 0x0D010204
297 #define OID_802_11_TX_POWER_LEVEL 0x0D010205
298 #define OID_802_11_RSSI 0x0D010206
299 #define OID_802_11_RSSI_TRIGGER 0x0D010207
300 #define OID_802_11_INFRASTRUCTURE_MODE 0x0D010108
301 #define OID_802_11_FRAGMENTATION_THRESHOLD 0x0D010209
302 #define OID_802_11_RTS_THRESHOLD 0x0D01020A
303 #define OID_802_11_NUMBER_OF_ANTENNAS 0x0D01020B
304 #define OID_802_11_RX_ANTENNA_SELECTED 0x0D01020C
305 #define OID_802_11_TX_ANTENNA_SELECTED 0x0D01020D
306 #define OID_802_11_SUPPORTED_RATES 0x0D01020E
307 #define OID_802_11_DESIRED_RATES 0x0D010210
308 #define OID_802_11_CONFIGURATION 0x0D010211
309 #define OID_802_11_STATISTICS 0x0D020212
310 #define OID_802_11_ADD_WEP 0x0D010113
311 #define OID_802_11_REMOVE_WEP 0x0D010114
312 #define OID_802_11_DISASSOCIATE 0x0D010115
313 #define OID_802_11_POWER_MODE 0x0D010216
314 #define OID_802_11_BSSID_LIST 0x0D010217
315 #define OID_802_11_AUTHENTICATION_MODE 0x0D010118
316 #define OID_802_11_PRIVACY_FILTER 0x0D010119
317 #define OID_802_11_BSSID_LIST_SCAN 0x0D01011A
318 #define OID_802_11_WEP_STATUS 0x0D01011B
319 #define OID_802_11_RELOAD_DEFAULTS 0x0D01011C
320
321 /* PnP and Power Management (PM) OIDs */
322 #define OID_PNP_CAPABILITIES 0xFD010100
323 #define OID_PNP_SET_POWER 0xFD010101
324 #define OID_PNP_QUERY_POWER 0xFD010102
325 #define OID_PNP_ADD_WAKE_UP_PATTERN 0xFD010103
326 #define OID_PNP_REMOVE_WAKE_UP_PATTERN 0xFD010104
327 #define OID_PNP_WAKE_UP_PATTERN_LIST 0xFD010105
328 #define OID_PNP_ENABLE_WAKE_UP 0xFD010106
329
330 /* Optional PnP/PM statistics OIDs */
331 #define OID_PNP_WAKE_UP_OK 0xFD020200
332 #define OID_PNP_WAKE_UP_ERROR 0xFD020201
333
334 /* OID_GEN_MINIPORT_INFO constants */
335 #define NDIS_MINIPORT_BUS_MASTER 0x00000001
336 #define NDIS_MINIPORT_WDM_DRIVER 0x00000002
337 #define NDIS_MINIPORT_SG_LIST 0x00000004
338 #define NDIS_MINIPORT_SUPPORTS_MEDIA_QUERY 0x00000008
339 #define NDIS_MINIPORT_INDICATES_PACKETS 0x00000010
340 #define NDIS_MINIPORT_IGNORE_PACKET_QUEUE 0x00000020
341 #define NDIS_MINIPORT_IGNORE_REQUEST_QUEUE 0x00000040
342 #define NDIS_MINIPORT_IGNORE_TOKEN_RING_ERRORS 0x00000080
343 #define NDIS_MINIPORT_INTERMEDIATE_DRIVER 0x00000100
344 #define NDIS_MINIPORT_IS_NDIS_5 0x00000200
345 #define NDIS_MINIPORT_IS_CO 0x00000400
346 #define NDIS_MINIPORT_DESERIALIZE 0x00000800
347 #define NDIS_MINIPORT_REQUIRES_MEDIA_POLLING 0x00001000
348 #define NDIS_MINIPORT_SUPPORTS_MEDIA_SENSE 0x00002000
349 #define NDIS_MINIPORT_NETBOOT_CARD 0x00004000
350 #define NDIS_MINIPORT_PM_SUPPORTED 0x00008000
351 #define NDIS_MINIPORT_SUPPORTS_MAC_ADDRESS_OVERWRITE 0x00010000
352 #define NDIS_MINIPORT_USES_SAFE_BUFFER_APIS 0x00020000
353 #define NDIS_MINIPORT_HIDDEN 0x00040000
354 #define NDIS_MINIPORT_SWENUM 0x00080000
355 #define NDIS_MINIPORT_SURPRISE_REMOVE_OK 0x00100000
356 #define NDIS_MINIPORT_NO_HALT_ON_SUSPEND 0x00200000
357 #define NDIS_MINIPORT_HARDWARE_DEVICE 0x00400000
358 #define NDIS_MINIPORT_SUPPORTS_CANCEL_SEND_PACKETS 0x00800000
359 #define NDIS_MINIPORT_64BITS_DMA 0x01000000
360
361 #define IOCTL_NDIS_QUERY_GLOBAL_STATS CTL_CODE(FILE_DEVICE_PHYSICAL_NETCARD, \
362 0, \
363 METHOD_OUT_DIRECT, \
364 FILE_ANY_ACCESS)
365
366 /* Hardware status codes (OID_GEN_HARDWARE_STATUS) */
367 typedef enum _NDIS_HARDWARE_STATUS {
368 NdisHardwareStatusReady,
369 NdisHardwareStatusInitializing,
370 NdisHardwareStatusReset,
371 NdisHardwareStatusClosing,
372 NdisHardwareStatusNotReady
373 } NDIS_HARDWARE_STATUS, *PNDIS_HARDWARE_STATUS;
374
375 /* OID_GEN_GET_TIME_CAPS */
376 typedef struct _GEN_GET_TIME_CAPS {
377 ULONG Flags;
378 ULONG ClockPrecision;
379 } GEN_GET_TIME_CAPS, *PGEN_GET_TIME_CAPS;
380
381 /* OID_GEN_GET_NETCARD_TIME */
382 typedef struct _GEN_GET_NETCARD_TIME {
383 ULONGLONG ReadTime;
384 } GEN_GET_NETCARD_TIME, *PGEN_GET_NETCARD_TIME;
385
386 /* State of the LAN media (OID_GEN_MEDIA_CONNECT_STATUS) */
387 typedef enum _NDIS_MEDIA_STATE {
388 NdisMediaStateConnected,
389 NdisMediaStateDisconnected
390 } NDIS_MEDIA_STATE, *PNDIS_MEDIA_STATE;
391
392 #ifndef _NDIS_
393 typedef int NDIS_STATUS, *PNDIS_STATUS;
394 #endif
395
396 /* OID_GEN_SUPPORTED_GUIDS */
397 typedef struct _NDIS_GUID {
398 GUID Guid;
399 union {
400 NDIS_OID Oid;
401 NDIS_STATUS Status;
402 } u;
403 ULONG Size;
404 ULONG Flags;
405 } NDIS_GUID, *PNDIS_GUID;
406
407 typedef struct _NDIS_PM_PACKET_PATTERN {
408 ULONG Priority;
409 ULONG Reserved;
410 ULONG MaskSize;
411 ULONG PatternOffset;
412 ULONG PatternSize;
413 ULONG PatternFlags;
414 } NDIS_PM_PACKET_PATTERN, *PNDIS_PM_PACKET_PATTERN;
415
416 /* OID_GEN_NETWORK_LAYER_ADDRESSES */
417 typedef struct _NETWORK_ADDRESS {
418 USHORT AddressLength;
419 USHORT AddressType;
420 UCHAR Address[1];
421 } NETWORK_ADDRESS, *PNETWORK_ADDRESS;
422
423 typedef struct _NETWORK_ADDRESS_LIST {
424 LONG AddressCount;
425 USHORT AddressType;
426 NETWORK_ADDRESS Address[1];
427 } NETWORK_ADDRESS_LIST, *PNETWORK_ADDRESS_LIST;
428
429 /* OID_GEN_TRANSPORT_HEADER_OFFSET */
430 typedef struct _TRANSPORT_HEADER_OFFSET {
431 USHORT ProtocolType;
432 USHORT HeaderOffset;
433 } TRANSPORT_HEADER_OFFSET, *PTRANSPORT_HEADER_OFFSET;
434
435 /* OID_GEN_CO_LINK_SPEED / OID_GEN_CO_MINIMUM_LINK_SPEED */
436 typedef struct _NDIS_CO_LINK_SPEED {
437 ULONG Outbound;
438 ULONG Inbound;
439 } NDIS_CO_LINK_SPEED, *PNDIS_CO_LINK_SPEED;
440
441 #ifdef __cplusplus
442 }
443 #endif
444
445 #endif /* _NTDDNDIS_ */