[DDK][PSDK] Add some missing NDIS definitions/types. Caught by Benjamin Aerni.
[reactos.git] / sdk / include / ddk / ndis.h
1 /*
2 * ndis.h
3 *
4 * Network Device Interface Specification definitions
5 *
6 * This file is part of the ReactOS DDK 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 * DEFINES: i386 - Target platform is i386
22 * NDIS_WRAPPER - Define only for NDIS library
23 * NDIS_MINIPORT_DRIVER - Define only for NDIS miniport drivers
24 * NDIS40 - Use NDIS 4.0 structures by default
25 * NDIS50 - Use NDIS 5.0 structures by default
26 * NDIS51 - Use NDIS 5.1 structures by default
27 * NDIS40_MINIPORT - Building NDIS 4.0 miniport driver
28 * NDIS50_MINIPORT - Building NDIS 5.0 miniport driver
29 * NDIS51_MINIPORT - Building NDIS 5.1 miniport driver
30 */
31
32 #ifndef _NDIS_
33 #define _NDIS_
34
35 #ifndef NDIS_WDM
36 #define NDIS_WDM 0
37 #endif
38
39 #include "ntddk.h"
40 #include "netpnp.h"
41 #include "ntstatus.h"
42 #include "netevent.h"
43 #include <qos.h>
44
45 typedef _Return_type_success_(return >= 0) int NDIS_STATUS, *PNDIS_STATUS;
46
47 #include "ntddndis.h"
48
49 #if !defined(_WINDEF_H)
50 typedef unsigned int UINT, *PUINT;
51 #endif
52
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56
57 __drv_Mode_impl(NDIS_INCLUDED)
58
59 #ifndef __NET_PNP__
60 #define __NET_PNP__
61
62 typedef enum _NET_DEVICE_POWER_STATE {
63 NetDeviceStateUnspecified = 0,
64 NetDeviceStateD0,
65 NetDeviceStateD1,
66 NetDeviceStateD2,
67 NetDeviceStateD3,
68 NetDeviceStateMaximum
69 } NET_DEVICE_POWER_STATE, *PNET_DEVICE_POWER_STATE;
70
71 typedef enum _NET_PNP_EVENT_CODE {
72 NetEventSetPower,
73 NetEventQueryPower,
74 NetEventQueryRemoveDevice,
75 NetEventCancelRemoveDevice,
76 NetEventReconfigure,
77 NetEventBindList,
78 NetEventBindsComplete,
79 NetEventPnPCapabilities,
80 NetEventPause,
81 NetEventRestart,
82 NetEventPortActivation,
83 NetEventPortDeactivation,
84 NetEventIMReEnableDevice,
85 NetEventMaximum
86 } NET_PNP_EVENT_CODE, *PNET_PNP_EVENT_CODE;
87
88 typedef struct _NET_PNP_EVENT {
89 NET_PNP_EVENT_CODE NetEvent;
90 PVOID Buffer;
91 ULONG BufferLength;
92 ULONG_PTR NdisReserved[4];
93 ULONG_PTR TransportReserved[4];
94 ULONG_PTR TdiReserved[4];
95 ULONG_PTR TdiClientReserved[4];
96 } NET_PNP_EVENT, *PNET_PNP_EVENT;
97
98 #endif /* __NET_PNP__ */
99
100 #if !defined(NDIS_WRAPPER)
101
102 #if (defined(NDIS_MINIPORT_MAJOR_VERSION) || \
103 (defined(NDIS_MINIPORT_MINOR_VERSION)) || \
104 (defined(NDIS_PROTOCOL_MAJOR_VERSION)) || \
105 (defined(NDIS_PROTOCOL_MINOR_VERSION)) || \
106 (defined(NDIS_FILTER_MAJOR_VERSION)) || \
107 (defined(NDIS_FILTER_MINOR_VERSION)))
108 #error "Driver should not redefine NDIS reserved macros"
109 #endif
110
111 #if defined(NDIS_MINIPORT_DRIVER)
112
113 #if defined(NDIS620_MINIPORT)
114 #define NDIS_MINIPORT_MAJOR_VERSION 6
115 #define NDIS_MINIPORT_MINOR_VERSION 20
116 #elif defined(NDIS61_MINIPORT)
117 #define NDIS_MINIPORT_MAJOR_VERSION 6
118 #define NDIS_MINIPORT_MINOR_VERSION 1
119 #elif defined(NDIS60_MINIPORT)
120 #define NDIS_MINIPORT_MAJOR_VERSION 6
121 #define NDIS_MINIPORT_MINOR_VERSION 0
122 #elif defined(NDIS51_MINIPORT)
123 #define NDIS_MINIPORT_MAJOR_VERSION 5
124 #define NDIS_MINIPORT_MINOR_VERSION 1
125 #elif defined(NDIS50_MINIPORT)
126 #define NDIS_MINIPORT_MAJOR_VERSION 5
127 #define NDIS_MINIPORT_MINOR_VERSION 0
128 #else
129 #error "Only NDIS miniport drivers with version >= 5 are supported"
130 #endif
131
132 #if ((NDIS_MINIPORT_MAJOR_VERSION == 6) && \
133 (NDIS_MINIPORT_MINOR_VERSION != 20) && \
134 (NDIS_MINIPORT_MINOR_VERSION != 1) && \
135 (NDIS_MINIPORT_MINOR_VERSION != 0))
136 #error "Invalid miniport major/minor version combination"
137 #elif ((NDIS_MINIPORT_MAJOR_VERSION == 5) && \
138 (NDIS_MINIPORT_MINOR_VERSION != 1) && \
139 (NDIS_MINIPORT_MINOR_VERSION != 0))
140 #error "Invalid miniport major/minor version combination"
141 #endif
142
143 #if (NDIS_MINIPORT_MAJOR_VERSION == 6) && \
144 ((NDIS_MINIPORT_MINOR_VERSION == 20 && NTDDI_VERSION < NTDDI_WIN7) || \
145 (NDIS_MINIPORT_MINOR_VERSION == 1 && NTDDI_VERSION < NTDDI_VISTA) || \
146 (NDIS_MINIPORT_MINOR_VERSION == 0 && NTDDI_VERSION < NTDDI_VISTA))
147 #error "Wrong NDIS/DDI version"
148 #elif ((NDIS_MINIPORT_MAJOR_VERSION == 5) && \
149 (((NDIS_MINIPORT_MINOR_VERSION == 1) && (NTDDI_VERSION < NTDDI_WINXP)) || \
150 ((NDIS_MINIPORT_MINOR_VERSION == 0) && (NTDDI_VERSION < NTDDI_WIN2K))))
151 #error "Wrong NDIS/DDI version"
152 #endif
153
154
155 #endif /* defined(NDIS_MINIPORT_DRIVER) */
156
157 #if defined(NDIS30)
158 #error "Only NDIS Protocol drivers version 4 or later are supported"
159 #endif
160
161 #if defined(NDIS620)
162 #define NDIS_PROTOCOL_MAJOR_VERSION 6
163 #define NDIS_PROTOCOL_MINOR_VERSION 20
164 #define NDIS_FILTER_MAJOR_VERSION 6
165 #define NDIS_FILTER_MINOR_VERSION 20
166 #elif defined(NDIS61)
167 #define NDIS_PROTOCOL_MAJOR_VERSION 6
168 #define NDIS_PROTOCOL_MINOR_VERSION 1
169 #define NDIS_FILTER_MAJOR_VERSION 6
170 #define NDIS_FILTER_MINOR_VERSION 1
171 #elif defined(NDIS60)
172 #define NDIS_PROTOCOL_MAJOR_VERSION 6
173 #define NDIS_PROTOCOL_MINOR_VERSION 0
174 #define NDIS_FILTER_MAJOR_VERSION 6
175 #define NDIS_FILTER_MINOR_VERSION 0
176 #elif defined(NDIS51)
177 #define NDIS_PROTOCOL_MAJOR_VERSION 5
178 #define NDIS_PROTOCOL_MINOR_VERSION 1
179 #elif defined(NDIS50)
180 #define NDIS_PROTOCOL_MAJOR_VERSION 5
181 #define NDIS_PROTOCOL_MINOR_VERSION 0
182 #elif defined(NDIS40)
183 #define NDIS_PROTOCOL_MAJOR_VERSION 4
184 #define NDIS_PROTOCOL_MINOR_VERSION 0
185 #endif
186
187 #if !defined(NDIS_MINIPORT_DRIVER) && !defined(NDIS_PROTOCOL_MAJOR_VERSION)
188 #define NDIS40
189 #define NDIS_PROTOCOL_MAJOR_VERSION 4
190 #define NDIS_PROTOCOL_MINOR_VERSION 0
191 #endif
192
193 #if defined(NDIS_FILTER_MAJOR_VERSION)
194
195 #if ((NDIS_FILTER_MAJOR_VERSION == 6) && \
196 (NDIS_FILTER_MINOR_VERSION != 20) && \
197 (NDIS_FILTER_MINOR_VERSION != 1) && \
198 (NDIS_FILTER_MINOR_VERSION != 0))
199 #error "Invalid Filter version"
200 #endif
201
202 #endif /* defined(NDIS_FILTER_MAJOR_VERSION) */
203
204
205 #if defined(NDIS_PROTOCOL_MAJOR_VERSION)
206
207 #if ((NDIS_PROTOCOL_MAJOR_VERSION == 6) && \
208 (NDIS_PROTOCOL_MINOR_VERSION != 20) && \
209 (NDIS_PROTOCOL_MINOR_VERSION != 1) && \
210 (NDIS_PROTOCOL_MINOR_VERSION != 0))
211 #error "Invalid Protocol version"
212 #elif ((NDIS_PROTOCOL_MAJOR_VERSION == 5) && \
213 (NDIS_PROTOCOL_MINOR_VERSION != 1) && (NDIS_PROTOCOL_MINOR_VERSION != 0))
214 #error "Invalid Protocol version"
215 #elif ((NDIS_PROTOCOL_MAJOR_VERSION == 4) && (NDIS_PROTOCOL_MINOR_VERSION != 0))
216 #error "Invalid Protocol major/minor version"
217 #endif
218
219 #if ((NDIS_PROTOCOL_MAJOR_VERSION == 6) && (NTDDI_VERSION < NTDDI_VISTA))
220 #error "Wrong NDIS/DDI version"
221 #endif
222
223 #endif /* defined(NDIS_PROTOCOL_MAJOR_VERSION) */
224
225 #endif /* !defined(NDIS_WRAPPER) */
226
227 #if !defined(NDIS_LEGACY_MINIPORT)
228
229 #if ((defined(NDIS_MINIPORT_DRIVER) && (NDIS_MINIPORT_MAJOR_VERSION < 6)) || NDIS_WRAPPER)
230 #define NDIS_LEGACY_MINIPORT 1
231 #else
232 #define NDIS_LEGACY_MINIPORT 0
233 #endif
234
235 #endif /* !defined(NDIS_LEGACY_MINIPORT) */
236
237 #if !defined(NDIS_LEGACY_PROTOCOL)
238
239 #if ((defined(NDIS_PROTOCOL_MAJOR_VERSION) && (NDIS_PROTOCOL_MAJOR_VERSION < 6)) || NDIS_WRAPPER)
240 #define NDIS_LEGACY_PROTOCOL 1
241 #else
242 #define NDIS_LEGACY_PROTOCOL 0
243 #endif
244
245 #endif /* !defined(NDIS_LEGACY_PROTOCOL) */
246
247 #if !defined(NDIS_LEGACY_DRIVER)
248
249 #if (NDIS_LEGACY_MINIPORT || NDIS_LEGACY_PROTOCOL || NDIS_WRAPPER)
250 #define NDIS_LEGACY_DRIVER 1
251 #else
252 #define NDIS_LEGACY_DRIVER 0
253 #endif
254
255 #endif /* !defined(NDIS_LEGACY_DRIVER) */
256
257 #if !defined(NDIS_SUPPORT_NDIS6)
258
259 #if ((defined (NDIS_MINIPORT_MAJOR_VERSION) && (NDIS_MINIPORT_MAJOR_VERSION >= 6)) || \
260 (defined (NDIS60)) || NDIS_WRAPPER)
261 #define NDIS_SUPPORT_NDIS6 1
262 #else
263 #define NDIS_SUPPORT_NDIS6 0
264 #endif
265
266 #endif /* !defined(NDIS_SUPPORT_NDIS6) */
267
268 #if !defined(NDIS_SUPPORT_NDIS61)
269 #if (((defined (NDIS_MINIPORT_MAJOR_VERSION) && (NDIS_MINIPORT_MAJOR_VERSION >= 6)) && \
270 (defined (NDIS_MINIPORT_MINOR_VERSION) && (NDIS_MINIPORT_MINOR_VERSION >= 1))) || \
271 (defined (NDIS61)) || NDIS_WRAPPER)
272 #define NDIS_SUPPORT_NDIS61 1
273 #else
274 #define NDIS_SUPPORT_NDIS61 0
275 #endif
276 #endif /* !defined(NDIS_SUPPORT_NDIS61) */
277
278 #if !defined(NDIS_SUPPORT_NDIS620)
279
280 #if (((defined (NDIS_MINIPORT_MAJOR_VERSION) && (NDIS_MINIPORT_MAJOR_VERSION >= 6)) && \
281 (defined (NDIS_MINIPORT_MINOR_VERSION) && (NDIS_MINIPORT_MINOR_VERSION >= 20))) || \
282 (defined (NDIS620)) || NDIS_WRAPPER)
283 #define NDIS_SUPPORT_NDIS620 1
284 #else
285 #define NDIS_SUPPORT_NDIS620 0
286 #endif
287
288 #endif /* !defined(NDIS_SUPPORT_NDIS620) */
289
290 #if (NDIS_SUPPORT_NDIS620)
291 #undef NDIS_SUPPORT_NDIS61
292 #define NDIS_SUPPORT_NDIS61 1
293 #endif
294
295 #if (NDIS_SUPPORT_NDIS61)
296 #undef NDIS_SUPPORT_NDIS6
297 #define NDIS_SUPPORT_NDIS6 1
298 #endif
299
300 #if defined(NDIS61_MINIPORT) || defined(NDIS60_MINIPORT) || defined(NDIS61) || \
301 defined(NDIS60) || defined(NDIS_WRAPPER) || defined(NDIS_LEGACY_DRIVER)
302 #define NDIS_SUPPORT_60_COMPATIBLE_API 1
303 #else
304 #define NDIS_SUPPORT_60_COMPATIBLE_API 0
305 #endif
306
307 #if defined(NDIS_WRAPPER)
308 #define NDISAPI
309 #else
310 #define NDISAPI DECLSPEC_IMPORT
311 #endif
312
313 typedef PVOID QUEUED_CLOSE; //FIXME : Doesn't exist in public headers
314
315 typedef struct _X_FILTER FDDI_FILTER, *PFDDI_FILTER;
316 typedef struct _X_FILTER TR_FILTER, *PTR_FILTER;
317 typedef struct _X_FILTER NULL_FILTER, *PNULL_FILTER;
318
319 typedef struct _NDIS_MINIPORT_BLOCK NDIS_MINIPORT_BLOCK, *PNDIS_MINIPORT_BLOCK;
320
321 typedef struct _REFERENCE {
322 KSPIN_LOCK SpinLock;
323 USHORT ReferenceCount;
324 BOOLEAN Closing;
325 } REFERENCE, *PREFERENCE;
326
327 /* NDIS base types */
328
329 typedef struct _NDIS_SPIN_LOCK {
330 KSPIN_LOCK SpinLock;
331 KIRQL OldIrql;
332 } NDIS_SPIN_LOCK, *PNDIS_SPIN_LOCK;
333
334 typedef struct _NDIS_EVENT {
335 KEVENT Event;
336 } NDIS_EVENT, *PNDIS_EVENT;
337
338 typedef PVOID NDIS_HANDLE, *PNDIS_HANDLE;
339
340 typedef ANSI_STRING NDIS_ANSI_STRING, *PNDIS_ANSI_STRING;
341 typedef UNICODE_STRING NDIS_STRING, *PNDIS_STRING;
342
343 typedef MDL NDIS_BUFFER, *PNDIS_BUFFER;
344
345 /* NDIS_STATUS constants */
346 #define NDIS_STATUS_SUCCESS ((NDIS_STATUS)STATUS_SUCCESS)
347 #define NDIS_STATUS_PENDING ((NDIS_STATUS)STATUS_PENDING)
348 #define NDIS_STATUS_NOT_RECOGNIZED ((NDIS_STATUS)0x00010001L)
349 #define NDIS_STATUS_NOT_COPIED ((NDIS_STATUS)0x00010002L)
350 #define NDIS_STATUS_NOT_ACCEPTED ((NDIS_STATUS)0x00010003L)
351 #define NDIS_STATUS_CALL_ACTIVE ((NDIS_STATUS)0x00010007L)
352 #define NDIS_STATUS_INDICATION_REQUIRED ((NDIS_STATUS)STATUS_NDIS_INDICATION_REQUIRED)
353 #define NDIS_STATUS_ONLINE ((NDIS_STATUS)0x40010003L)
354 #define NDIS_STATUS_RESET_START ((NDIS_STATUS)0x40010004L)
355 #define NDIS_STATUS_RESET_END ((NDIS_STATUS)0x40010005L)
356 #define NDIS_STATUS_RING_STATUS ((NDIS_STATUS)0x40010006L)
357 #define NDIS_STATUS_CLOSED ((NDIS_STATUS)0x40010007L)
358 #define NDIS_STATUS_WAN_LINE_UP ((NDIS_STATUS)0x40010008L)
359 #define NDIS_STATUS_WAN_LINE_DOWN ((NDIS_STATUS)0x40010009L)
360 #define NDIS_STATUS_WAN_FRAGMENT ((NDIS_STATUS)0x4001000AL)
361 #define NDIS_STATUS_MEDIA_CONNECT ((NDIS_STATUS)0x4001000BL)
362 #define NDIS_STATUS_MEDIA_DISCONNECT ((NDIS_STATUS)0x4001000CL)
363 #define NDIS_STATUS_HARDWARE_LINE_UP ((NDIS_STATUS)0x4001000DL)
364 #define NDIS_STATUS_HARDWARE_LINE_DOWN ((NDIS_STATUS)0x4001000EL)
365 #define NDIS_STATUS_INTERFACE_UP ((NDIS_STATUS)0x4001000FL)
366 #define NDIS_STATUS_INTERFACE_DOWN ((NDIS_STATUS)0x40010010L)
367 #define NDIS_STATUS_MEDIA_BUSY ((NDIS_STATUS)0x40010011L)
368 #define NDIS_STATUS_MEDIA_SPECIFIC_INDICATION ((NDIS_STATUS)0x40010012L)
369 #define NDIS_STATUS_WW_INDICATION NDIS_STATUS_MEDIA_SPECIFIC_INDICATION
370 #define NDIS_STATUS_LINK_SPEED_CHANGE ((NDIS_STATUS)0x40010013L)
371 #define NDIS_STATUS_WAN_GET_STATS ((NDIS_STATUS)0x40010014L)
372 #define NDIS_STATUS_WAN_CO_FRAGMENT ((NDIS_STATUS)0x40010015L)
373 #define NDIS_STATUS_WAN_CO_LINKPARAMS ((NDIS_STATUS)0x40010016L)
374 #if NDIS_SUPPORT_NDIS6
375 #define NDIS_STATUS_LINK_STATE ((NDIS_STATUS)0x40010017L)
376 #define NDIS_STATUS_NETWORK_CHANGE ((NDIS_STATUS)0x40010018L)
377 #define NDIS_STATUS_MEDIA_SPECIFIC_INDICATION_EX ((NDIS_STATUS)0x40010019L)
378 #define NDIS_STATUS_PORT_STATE ((NDIS_STATUS)0x40010022L)
379 #define NDIS_STATUS_OPER_STATUS ((NDIS_STATUS)0x40010023L)
380 #define NDIS_STATUS_PACKET_FILTER ((NDIS_STATUS)0x40010024L)
381 #endif /* NDIS_SUPPORT_NDIS6 */
382 #define NDIS_STATUS_WAN_CO_MTULINKPARAMS ((NDIS_STATUS)0x40010025L)
383
384 #if NDIS_SUPPORT_NDIS6
385
386 #define NDIS_STATUS_IP_OPER_STATUS ((NDIS_STATUS)0x40010026L)
387
388 #define NDIS_STATUS_OFFLOAD_PAUSE ((NDIS_STATUS)0x40020001L)
389 #define NDIS_STATUS_UPLOAD_ALL ((NDIS_STATUS)0x40020002L)
390 #define NDIS_STATUS_OFFLOAD_RESUME ((NDIS_STATUS)0x40020003L)
391 #define NDIS_STATUS_OFFLOAD_PARTIAL_SUCCESS ((NDIS_STATUS)0x40020004L)
392 #define NDIS_STATUS_OFFLOAD_STATE_INVALID ((NDIS_STATUS)0x40020005L)
393 #define NDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG ((NDIS_STATUS)0x40020006L)
394 #define NDIS_STATUS_TASK_OFFLOAD_HARDWARE_CAPABILITIES ((NDIS_STATUS)0x40020007L)
395 #define NDIS_STATUS_OFFLOAD_ENCASPULATION_CHANGE ((NDIS_STATUS)0x40020008L)
396 #define NDIS_STATUS_TCP_CONNECTION_OFFLOAD_HARDWARE_CAPABILITIES ((NDIS_STATUS)0x4002000BL)
397
398 #if (NDIS_SUPPORT_NDIS61)
399 #define NDIS_STATUS_HD_SPLIT_CURRENT_CONFIG ((NDIS_STATUS)0x4002000CL)
400 #endif
401
402 #if (NDIS_SUPPORT_NDIS620)
403 #define NDIS_STATUS_RECEIVE_QUEUE_STATE ((NDIS_STATUS)0x4002000DL)
404 #endif
405
406 #define NDIS_STATUS_OFFLOAD_IM_RESERVED1 ((NDIS_STATUS)0x40020100L)
407 #define NDIS_STATUS_OFFLOAD_IM_RESERVED2 ((NDIS_STATUS)0x40020101L)
408 #define NDIS_STATUS_OFFLOAD_IM_RESERVED3 ((NDIS_STATUS)0x40020102L)
409
410 #define NDIS_STATUS_DOT11_SCAN_CONFIRM ((NDIS_STATUS)0x40030000L)
411 #define NDIS_STATUS_DOT11_MPDU_MAX_LENGTH_CHANGED ((NDIS_STATUS)0x40030001L)
412 #define NDIS_STATUS_DOT11_ASSOCIATION_START ((NDIS_STATUS)0x40030002L)
413 #define NDIS_STATUS_DOT11_ASSOCIATION_COMPLETION ((NDIS_STATUS)0x40030003L)
414 #define NDIS_STATUS_DOT11_CONNECTION_START ((NDIS_STATUS)0x40030004L)
415 #define NDIS_STATUS_DOT11_CONNECTION_COMPLETION ((NDIS_STATUS)0x40030005L)
416 #define NDIS_STATUS_DOT11_ROAMING_START ((NDIS_STATUS)0x40030006L)
417 #define NDIS_STATUS_DOT11_ROAMING_COMPLETION ((NDIS_STATUS)0x40030007L)
418 #define NDIS_STATUS_DOT11_DISASSOCIATION ((NDIS_STATUS)0x40030008L)
419 #define NDIS_STATUS_DOT11_TKIPMIC_FAILURE ((NDIS_STATUS)0x40030009L)
420 #define NDIS_STATUS_DOT11_PMKID_CANDIDATE_LIST ((NDIS_STATUS)0x4003000AL)
421 #define NDIS_STATUS_DOT11_PHY_STATE_CHANGED ((NDIS_STATUS)0x4003000BL)
422 #define NDIS_STATUS_DOT11_LINK_QUALITY ((NDIS_STATUS)0x4003000CL)
423 #define NDIS_STATUS_DOT11_INCOMING_ASSOC_STARTED ((NDIS_STATUS)0x4003000DL)
424 #define NDIS_STATUS_DOT11_INCOMING_ASSOC_REQUEST_RECEIVED ((NDIS_STATUS)0x4003000EL)
425 #define NDIS_STATUS_DOT11_INCOMING_ASSOC_COMPLETION ((NDIS_STATUS)0x4003000FL)
426 #define NDIS_STATUS_DOT11_STOP_AP ((NDIS_STATUS)0x40030010L)
427 #define NDIS_STATUS_DOT11_PHY_FREQUENCY_ADOPTED ((NDIS_STATUS)0x40030011L)
428 #define NDIS_STATUS_DOT11_CAN_SUSTAIN_AP ((NDIS_STATUS)0x40030012L)
429
430 #define NDIS_STATUS_WWAN_DEVICE_CAPS ((NDIS_STATUS)0x40041000)
431 #define NDIS_STATUS_WWAN_READY_INFO ((NDIS_STATUS)0x40041001)
432 #define NDIS_STATUS_WWAN_RADIO_STATE ((NDIS_STATUS)0x40041002)
433 #define NDIS_STATUS_WWAN_PIN_INFO ((NDIS_STATUS)0x40041003)
434 #define NDIS_STATUS_WWAN_PIN_LIST ((NDIS_STATUS)0x40041004)
435 #define NDIS_STATUS_WWAN_HOME_PROVIDER ((NDIS_STATUS)0x40041005)
436 #define NDIS_STATUS_WWAN_PREFERRED_PROVIDERS ((NDIS_STATUS)0x40041006)
437 #define NDIS_STATUS_WWAN_VISIBLE_PROVIDERS ((NDIS_STATUS)0x40041007)
438 #define NDIS_STATUS_WWAN_REGISTER_STATE ((NDIS_STATUS)0x40041008)
439 #define NDIS_STATUS_WWAN_PACKET_SERVICE ((NDIS_STATUS)0x40041009)
440 #define NDIS_STATUS_WWAN_SIGNAL_STATE ((NDIS_STATUS)0x4004100a)
441 #define NDIS_STATUS_WWAN_CONTEXT_STATE ((NDIS_STATUS)0x4004100b)
442 #define NDIS_STATUS_WWAN_PROVISIONED_CONTEXTS ((NDIS_STATUS)0x4004100c)
443 #define NDIS_STATUS_WWAN_SERVICE_ACTIVATION ((NDIS_STATUS)0x4004100d)
444 #define NDIS_STATUS_WWAN_SMS_CONFIGURATION ((NDIS_STATUS)0x4004100e)
445 #define NDIS_STATUS_WWAN_SMS_RECEIVE ((NDIS_STATUS)0x4004100f)
446 #define NDIS_STATUS_WWAN_SMS_SEND ((NDIS_STATUS)0x40041010)
447 #define NDIS_STATUS_WWAN_SMS_DELETE ((NDIS_STATUS)0x40041011)
448 #define NDIS_STATUS_WWAN_SMS_STATUS ((NDIS_STATUS)0x40041012)
449 #define NDIS_STATUS_WWAN_DNS_ADDRESS ((NDIS_STATUS)0x40041013)
450
451 #define NDIS_STATUS_WWAN_VENDOR_SPECIFIC ((NDIS_STATUS)0x40043000)
452
453 #endif /* NDIS_SUPPORT_NDIS6 */
454
455 #if (NDIS_SUPPORT_NDIS620)
456 #define NDIS_STATUS_PM_WOL_PATTERN_REJECTED ((NDIS_STATUS)0x40030051L)
457 #define NDIS_STATUS_PM_OFFLOAD_REJECTED ((NDIS_STATUS)0x40030052L)
458 #define NDIS_STATUS_PM_CAPABILITIES_CHANGE ((NDIS_STATUS)0x40030053L)
459 #endif
460
461 #define NDIS_STATUS_NOT_RESETTABLE ((NDIS_STATUS)0x80010001L)
462 #define NDIS_STATUS_SOFT_ERRORS ((NDIS_STATUS)0x80010003L)
463 #define NDIS_STATUS_HARD_ERRORS ((NDIS_STATUS)0x80010004L)
464 #define NDIS_STATUS_BUFFER_OVERFLOW ((NDIS_STATUS)STATUS_BUFFER_OVERFLOW)
465 #define NDIS_STATUS_FAILURE ((NDIS_STATUS)STATUS_UNSUCCESSFUL)
466 #define NDIS_STATUS_RESOURCES ((NDIS_STATUS)STATUS_INSUFFICIENT_RESOURCES)
467 #define NDIS_STATUS_CLOSING ((NDIS_STATUS)0xC0010002L)
468 #define NDIS_STATUS_BAD_VERSION ((NDIS_STATUS)0xC0010004L)
469 #define NDIS_STATUS_BAD_CHARACTERISTICS ((NDIS_STATUS)0xC0010005L)
470 #define NDIS_STATUS_ADAPTER_NOT_FOUND ((NDIS_STATUS)0xC0010006L)
471 #define NDIS_STATUS_OPEN_FAILED ((NDIS_STATUS)0xC0010007L)
472 #define NDIS_STATUS_DEVICE_FAILED ((NDIS_STATUS)0xC0010008L)
473 #define NDIS_STATUS_MULTICAST_FULL ((NDIS_STATUS)0xC0010009L)
474 #define NDIS_STATUS_MULTICAST_EXISTS ((NDIS_STATUS)0xC001000AL)
475 #define NDIS_STATUS_MULTICAST_NOT_FOUND ((NDIS_STATUS)0xC001000BL)
476 #define NDIS_STATUS_REQUEST_ABORTED ((NDIS_STATUS)0xC001000CL)
477 #define NDIS_STATUS_RESET_IN_PROGRESS ((NDIS_STATUS)0xC001000DL)
478 #define NDIS_STATUS_CLOSING_INDICATING ((NDIS_STATUS)0xC001000EL)
479 #define NDIS_STATUS_NOT_SUPPORTED ((NDIS_STATUS)STATUS_NOT_SUPPORTED)
480 #define NDIS_STATUS_INVALID_PACKET ((NDIS_STATUS)0xC001000FL)
481 #define NDIS_STATUS_OPEN_LIST_FULL ((NDIS_STATUS)0xC0010010L)
482 #define NDIS_STATUS_ADAPTER_NOT_READY ((NDIS_STATUS)0xC0010011L)
483 #define NDIS_STATUS_ADAPTER_NOT_OPEN ((NDIS_STATUS)0xC0010012L)
484 #define NDIS_STATUS_NOT_INDICATING ((NDIS_STATUS)0xC0010013L)
485 #define NDIS_STATUS_INVALID_LENGTH ((NDIS_STATUS)0xC0010014L)
486 #define NDIS_STATUS_INVALID_DATA ((NDIS_STATUS)0xC0010015L)
487 #define NDIS_STATUS_BUFFER_TOO_SHORT ((NDIS_STATUS)0xC0010016L)
488 #define NDIS_STATUS_INVALID_OID ((NDIS_STATUS)0xC0010017L)
489 #define NDIS_STATUS_ADAPTER_REMOVED ((NDIS_STATUS)0xC0010018L)
490 #define NDIS_STATUS_UNSUPPORTED_MEDIA ((NDIS_STATUS)0xC0010019L)
491 #define NDIS_STATUS_GROUP_ADDRESS_IN_USE ((NDIS_STATUS)0xC001001AL)
492 #define NDIS_STATUS_FILE_NOT_FOUND ((NDIS_STATUS)0xC001001BL)
493 #define NDIS_STATUS_ERROR_READING_FILE ((NDIS_STATUS)0xC001001CL)
494 #define NDIS_STATUS_ALREADY_MAPPED ((NDIS_STATUS)0xC001001DL)
495 #define NDIS_STATUS_RESOURCE_CONFLICT ((NDIS_STATUS)0xC001001EL)
496 #define NDIS_STATUS_NO_CABLE ((NDIS_STATUS)0xC001001FL)
497
498 #define NDIS_STATUS_INVALID_SAP ((NDIS_STATUS)0xC0010020L)
499 #define NDIS_STATUS_SAP_IN_USE ((NDIS_STATUS)0xC0010021L)
500 #define NDIS_STATUS_INVALID_ADDRESS ((NDIS_STATUS)0xC0010022L)
501 #define NDIS_STATUS_VC_NOT_ACTIVATED ((NDIS_STATUS)0xC0010023L)
502 #define NDIS_STATUS_DEST_OUT_OF_ORDER ((NDIS_STATUS)0xC0010024L)
503 #define NDIS_STATUS_VC_NOT_AVAILABLE ((NDIS_STATUS)0xC0010025L)
504 #define NDIS_STATUS_CELLRATE_NOT_AVAILABLE ((NDIS_STATUS)0xC0010026L)
505 #define NDIS_STATUS_INCOMPATABLE_QOS ((NDIS_STATUS)0xC0010027L)
506 #define NDIS_STATUS_AAL_PARAMS_UNSUPPORTED ((NDIS_STATUS)0xC0010028L)
507 #define NDIS_STATUS_NO_ROUTE_TO_DESTINATION ((NDIS_STATUS)0xC0010029L)
508
509 #define NDIS_STATUS_TOKEN_RING_OPEN_ERROR ((NDIS_STATUS)0xC0011000L)
510 #define NDIS_STATUS_INVALID_DEVICE_REQUEST ((NDIS_STATUS)STATUS_INVALID_DEVICE_REQUEST)
511 #define NDIS_STATUS_NETWORK_UNREACHABLE ((NDIS_STATUS)STATUS_NETWORK_UNREACHABLE)
512 #define NDIS_STATUS_HOST_UNREACHABLE ((NDIS_STATUS)STATUS_HOST_UNREACHABLE)
513
514 #if NDIS_SUPPORT_NDIS6
515
516 #define NDIS_STATUS_SEND_ABORTED ((NDIS_STATUS)STATUS_NDIS_REQUEST_ABORTED)
517 #define NDIS_STATUS_PAUSED ((NDIS_STATUS)STATUS_NDIS_PAUSED)
518 #define NDIS_STATUS_INTERFACE_NOT_FOUND ((NDIS_STATUS)STATUS_NDIS_INTERFACE_NOT_FOUND)
519 #define NDIS_STATUS_INVALID_PARAMETER ((NDIS_STATUS)STATUS_INVALID_PARAMETER)
520 #define NDIS_STATUS_UNSUPPORTED_REVISION ((NDIS_STATUS)STATUS_NDIS_UNSUPPORTED_REVISION)
521 #define NDIS_STATUS_INVALID_PORT ((NDIS_STATUS)STATUS_NDIS_INVALID_PORT)
522 #define NDIS_STATUS_INVALID_PORT_STATE ((NDIS_STATUS)STATUS_NDIS_INVALID_PORT_STATE)
523 #define NDIS_STATUS_INVALID_STATE ((NDIS_STATUS)STATUS_INVALID_DEVICE_STATE)
524 #define NDIS_STATUS_MEDIA_DISCONNECTED ((NDIS_STATUS)STATUS_NDIS_MEDIA_DISCONNECTED)
525 #define NDIS_STATUS_LOW_POWER_STATE ((NDIS_STATUS)STATUS_NDIS_LOW_POWER_STATE)
526 #define NDIS_STATUS_DOT11_AUTO_CONFIG_ENABLED ((NDIS_STATUS)STATUS_NDIS_DOT11_AUTO_CONFIG_ENABLED)
527 #define NDIS_STATUS_DOT11_MEDIA_IN_USE ((NDIS_STATUS)STATUS_NDIS_DOT11_MEDIA_IN_USE)
528 #define NDIS_STATUS_DOT11_POWER_STATE_INVALID ((NDIS_STATUS)STATUS_NDIS_DOT11_POWER_STATE_INVALID)
529 #define NDIS_STATUS_UPLOAD_IN_PROGRESS ((NDIS_STATUS)0xC0231001L)
530 #define NDIS_STATUS_REQUEST_UPLOAD ((NDIS_STATUS)0xC0231002L)
531 #define NDIS_STATUS_UPLOAD_REQUESTED ((NDIS_STATUS)0xC0231003L)
532 #define NDIS_STATUS_OFFLOAD_TCP_ENTRIES ((NDIS_STATUS)0xC0231004L)
533 #define NDIS_STATUS_OFFLOAD_PATH_ENTRIES ((NDIS_STATUS)0xC0231005L)
534 #define NDIS_STATUS_OFFLOAD_NEIGHBOR_ENTRIES ((NDIS_STATUS)0xC0231006L)
535 #define NDIS_STATUS_OFFLOAD_IP_ADDRESS_ENTRIES ((NDIS_STATUS)0xC0231007L)
536 #define NDIS_STATUS_OFFLOAD_HW_ADDRESS_ENTRIES ((NDIS_STATUS)0xC0231008L)
537 #define NDIS_STATUS_OFFLOAD_VLAN_ENTRIES ((NDIS_STATUS)0xC0231009L)
538 #define NDIS_STATUS_OFFLOAD_TCP_XMIT_BUFFER ((NDIS_STATUS)0xC023100AL)
539 #define NDIS_STATUS_OFFLOAD_TCP_RCV_BUFFER ((NDIS_STATUS)0xC023100BL)
540 #define NDIS_STATUS_OFFLOAD_TCP_RCV_WINDOW ((NDIS_STATUS)0xC023100CL)
541 #define NDIS_STATUS_OFFLOAD_VLAN_MISMATCH ((NDIS_STATUS)0xC023100DL)
542 #define NDIS_STATUS_OFFLOAD_DATA_NOT_ACCEPTED ((NDIS_STATUS)0xC023100EL)
543 #define NDIS_STATUS_OFFLOAD_POLICY ((NDIS_STATUS)0xC023100FL)
544 #define NDIS_STATUS_OFFLOAD_DATA_PARTIALLY_ACCEPTED ((NDIS_STATUS)0xC0231010L)
545 #define NDIS_STATUS_OFFLOAD_REQUEST_RESET ((NDIS_STATUS)0xC0231011L)
546
547 #if NDIS_SUPPORT_NDIS620
548 #define NDIS_STATUS_PM_WOL_PATTERN_LIST_FULL ((NDIS_STATUS)STATUS_NDIS_PM_WOL_PATTERN_LIST_FULL)
549 #define NDIS_STATUS_PM_PROTOCOL_OFFLOAD_LIST_FULL ((NDIS_STATUS)STATUS_NDIS_PM_PROTOCOL_OFFLOAD_LIST_FULL)
550 #endif
551
552 #endif /* NDIS_SUPPORT_NDIS6 */
553
554 #if (NDIS_SUPPORT_NDIS620)
555 #define NDIS_STATUS_OFFLOAD_CONNECTION_REJECTED ((NDIS_STATUS)STATUS_NDIS_OFFLOAD_CONNECTION_REJECTED)
556 #endif
557
558 /* NDIS error codes for error logging */
559
560 #define NDIS_ERROR_CODE ULONG
561
562 #define NDIS_ERROR_CODE_RESOURCE_CONFLICT EVENT_NDIS_RESOURCE_CONFLICT
563 #define NDIS_ERROR_CODE_OUT_OF_RESOURCES EVENT_NDIS_OUT_OF_RESOURCE
564 #define NDIS_ERROR_CODE_HARDWARE_FAILURE EVENT_NDIS_HARDWARE_FAILURE
565 #define NDIS_ERROR_CODE_ADAPTER_NOT_FOUND EVENT_NDIS_ADAPTER_NOT_FOUND
566 #define NDIS_ERROR_CODE_INTERRUPT_CONNECT EVENT_NDIS_INTERRUPT_CONNECT
567 #define NDIS_ERROR_CODE_DRIVER_FAILURE EVENT_NDIS_DRIVER_FAILURE
568 #define NDIS_ERROR_CODE_BAD_VERSION EVENT_NDIS_BAD_VERSION
569 #define NDIS_ERROR_CODE_TIMEOUT EVENT_NDIS_TIMEOUT
570 #define NDIS_ERROR_CODE_NETWORK_ADDRESS EVENT_NDIS_NETWORK_ADDRESS
571 #define NDIS_ERROR_CODE_UNSUPPORTED_CONFIGURATION EVENT_NDIS_UNSUPPORTED_CONFIGURATION
572 #define NDIS_ERROR_CODE_INVALID_VALUE_FROM_ADAPTER EVENT_NDIS_INVALID_VALUE_FROM_ADAPTER
573 #define NDIS_ERROR_CODE_MISSING_CONFIGURATION_PARAMETER EVENT_NDIS_MISSING_CONFIGURATION_PARAMETER
574 #define NDIS_ERROR_CODE_BAD_IO_BASE_ADDRESS EVENT_NDIS_BAD_IO_BASE_ADDRESS
575 #define NDIS_ERROR_CODE_RECEIVE_SPACE_SMALL EVENT_NDIS_RECEIVE_SPACE_SMALL
576 #define NDIS_ERROR_CODE_ADAPTER_DISABLED EVENT_NDIS_ADAPTER_DISABLED
577
578 /* Memory allocation flags. Used by Ndis[Allocate|Free]Memory */
579 #define NDIS_MEMORY_CONTIGUOUS 0x00000001
580 #define NDIS_MEMORY_NONCACHED 0x00000002
581
582 /* NIC attribute flags. Used by NdisMSetAttributes(Ex) */
583 #define NDIS_ATTRIBUTE_IGNORE_PACKET_TIMEOUT 0x00000001
584 #define NDIS_ATTRIBUTE_IGNORE_REQUEST_TIMEOUT 0x00000002
585 #define NDIS_ATTRIBUTE_IGNORE_TOKEN_RING_ERRORS 0x00000004
586 #define NDIS_ATTRIBUTE_BUS_MASTER 0x00000008
587 #define NDIS_ATTRIBUTE_INTERMEDIATE_DRIVER 0x00000010
588 #define NDIS_ATTRIBUTE_DESERIALIZE 0x00000020
589 #define NDIS_ATTRIBUTE_NO_HALT_ON_SUSPEND 0x00000040
590 #define NDIS_ATTRIBUTE_SURPRISE_REMOVE_OK 0x00000080
591 #define NDIS_ATTRIBUTE_NOT_CO_NDIS 0x00000100
592 #define NDIS_ATTRIBUTE_USES_SAFE_BUFFER_APIS 0x00000200
593
594 /* Lock */
595
596 #if NDIS_SUPPORT_60_COMPATIBLE_API
597
598 typedef union _NDIS_RW_LOCK_REFCOUNT {
599 UINT RefCount;
600 UCHAR cacheLine[16];
601 } NDIS_RW_LOCK_REFCOUNT;
602
603 typedef struct _NDIS_RW_LOCK {
604 __MINGW_EXTENSION union {
605 __MINGW_EXTENSION struct {
606 KSPIN_LOCK SpinLock;
607 PVOID Context;
608 };
609 UCHAR Reserved[16];
610 };
611 __MINGW_EXTENSION union {
612 NDIS_RW_LOCK_REFCOUNT RefCount[MAXIMUM_PROCESSORS];
613 ULONG RefCountEx[sizeof(NDIS_RW_LOCK_REFCOUNT)/sizeof(ULONG) * MAXIMUM_PROCESSORS];
614 __MINGW_EXTENSION struct {
615 KSPIN_LOCK RefCountLock;
616 volatile ULONG SharedRefCount;
617 volatile BOOLEAN WriterWaiting;
618 };
619 };
620 } NDIS_RW_LOCK, *PNDIS_RW_LOCK;
621
622 typedef struct _LOCK_STATE {
623 USHORT LockState;
624 KIRQL OldIrql;
625 } LOCK_STATE, *PLOCK_STATE;
626
627 #endif /* NDIS_SUPPORT_60_COMPATIBLE_API */
628
629 /* Timer */
630
631 _IRQL_requires_(DISPATCH_LEVEL)
632 _IRQL_requires_same_
633 _Function_class_(NDIS_TIMER_FUNCTION)
634 typedef VOID
635 (NTAPI NDIS_TIMER_FUNCTION)(
636 _In_ PVOID SystemSpecific1,
637 _In_ PVOID FunctionContext,
638 _In_ PVOID SystemSpecific2,
639 _In_ PVOID SystemSpecific3);
640 typedef NDIS_TIMER_FUNCTION *PNDIS_TIMER_FUNCTION;
641
642 typedef struct _NDIS_TIMER {
643 KTIMER Timer;
644 KDPC Dpc;
645 } NDIS_TIMER, *PNDIS_TIMER;
646
647 /* Hardware */
648
649 typedef CM_MCA_POS_DATA NDIS_MCA_POS_DATA, *PNDIS_MCA_POS_DATA;
650 typedef CM_EISA_SLOT_INFORMATION NDIS_EISA_SLOT_INFORMATION, *PNDIS_EISA_SLOT_INFORMATION;
651 typedef CM_EISA_FUNCTION_INFORMATION NDIS_EISA_FUNCTION_INFORMATION, *PNDIS_EISA_FUNCTION_INFORMATION;
652 typedef CM_PARTIAL_RESOURCE_LIST NDIS_RESOURCE_LIST, *PNDIS_RESOURCE_LIST;
653
654 /* Flag bits */
655 #define READABLE_LOCAL_CLOCK 0x00000001
656 #define CLOCK_NETWORK_DERIVED 0x00000002
657 #define CLOCK_PRECISION 0x00000004
658 #define RECEIVE_TIME_INDICATION_CAPABLE 0x00000008
659 #define TIMED_SEND_CAPABLE 0x00000010
660 #define TIME_STAMP_CAPABLE 0x00000020
661
662 /* NDIS packet filter bits (OID_GEN_CURRENT_PACKET_FILTER) */
663 #define NDIS_PACKET_TYPE_DIRECTED 0x00000001
664 #define NDIS_PACKET_TYPE_MULTICAST 0x00000002
665 #define NDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004
666 #define NDIS_PACKET_TYPE_BROADCAST 0x00000008
667 #define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010
668 #define NDIS_PACKET_TYPE_PROMISCUOUS 0x00000020
669 #define NDIS_PACKET_TYPE_SMT 0x00000040
670 #define NDIS_PACKET_TYPE_ALL_LOCAL 0x00000080
671 #define NDIS_PACKET_TYPE_GROUP 0x00001000
672 #define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00002000
673 #define NDIS_PACKET_TYPE_FUNCTIONAL 0x00004000
674 #define NDIS_PACKET_TYPE_MAC_FRAME 0x00008000
675
676 /* NDIS protocol option bits (OID_GEN_PROTOCOL_OPTIONS) */
677 #define NDIS_PROT_OPTION_ESTIMATED_LENGTH 0x00000001
678 #define NDIS_PROT_OPTION_NO_LOOPBACK 0x00000002
679 #define NDIS_PROT_OPTION_NO_RSVD_ON_RCVPKT 0x00000004
680
681 /* NDIS MAC option bits (OID_GEN_MAC_OPTIONS) */
682 #define NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA 0x00000001
683 #define NDIS_MAC_OPTION_RECEIVE_SERIALIZED 0x00000002
684 #define NDIS_MAC_OPTION_TRANSFERS_NOT_PEND 0x00000004
685 #define NDIS_MAC_OPTION_NO_LOOPBACK 0x00000008
686 #define NDIS_MAC_OPTION_FULL_DUPLEX 0x00000010
687 #define NDIS_MAC_OPTION_EOTX_INDICATION 0x00000020
688 #define NDIS_MAC_OPTION_8021P_PRIORITY 0x00000040
689 #define NDIS_MAC_OPTION_RESERVED 0x80000000
690
691 #define NDIS_GUID_TO_OID 0x00000001
692 #define NDIS_GUID_TO_STATUS 0x00000002
693 #define NDIS_GUID_ANSI_STRING 0x00000004
694 #define NDIS_GUID_UNICODE_STRING 0x00000008
695 #define NDIS_GUID_ARRAY 0x00000010
696
697 #if NDIS_LEGACY_DRIVER
698
699 /* NDIS_PACKET_PRIVATE.Flags constants */
700 #define fPACKET_WRAPPER_RESERVED 0x3f
701 #define fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO 0x40
702 #define fPACKET_ALLOCATED_BY_NDIS 0x80
703
704 #define NDIS_FLAGS_PROTOCOL_ID_MASK 0x0000000f
705 #define NDIS_FLAGS_MULTICAST_PACKET 0x00000010
706 #define NDIS_FLAGS_RESERVED2 0x00000020
707 #define NDIS_FLAGS_RESERVED3 0x00000040
708 #define NDIS_FLAGS_DONT_LOOPBACK 0x00000080
709 #define NDIS_FLAGS_IS_LOOPBACK_PACKET 0x00000100
710 #define NDIS_FLAGS_LOOPBACK_ONLY 0x00000200
711 #define NDIS_FLAGS_RESERVED4 0x00000400
712 #define NDIS_FLAGS_DOUBLE_BUFFERED 0x00000800
713 #define NDIS_FLAGS_SENT_AT_DPC 0x00001000
714 #define NDIS_FLAGS_USES_SG_BUFFER_LIST 0x00002000
715 #define NDIS_FLAGS_USES_ORIGINAL_PACKET 0x00004000
716 #define NDIS_FLAGS_PADDED 0x00010000
717 #define NDIS_FLAGS_XLATE_AT_TOP 0x00020000
718
719 typedef NDIS_HANDLE PNDIS_PACKET_POOL;
720
721 typedef struct _NDIS_PACKET_PRIVATE {
722 UINT PhysicalCount;
723 UINT TotalLength;
724 PNDIS_BUFFER Head;
725 PNDIS_BUFFER Tail;
726 PNDIS_PACKET_POOL Pool;
727 UINT Count;
728 ULONG Flags;
729 BOOLEAN ValidCounts;
730 UCHAR NdisPacketFlags;
731 USHORT NdisPacketOobOffset;
732 } NDIS_PACKET_PRIVATE, *PNDIS_PACKET_PRIVATE;
733
734 typedef struct _NDIS_PACKET {
735 NDIS_PACKET_PRIVATE Private;
736 __MINGW_EXTENSION union {
737 __MINGW_EXTENSION struct {
738 UCHAR MiniportReserved[2 * sizeof(PVOID)];
739 UCHAR WrapperReserved[2 * sizeof(PVOID)];
740 };
741 __MINGW_EXTENSION struct {
742 UCHAR MiniportReservedEx[3 * sizeof(PVOID)];
743 UCHAR WrapperReservedEx[sizeof(PVOID)];
744 };
745 __MINGW_EXTENSION struct {
746 UCHAR MacReserved[4 * sizeof(PVOID)];
747 };
748 };
749 ULONG_PTR Reserved[2];
750 UCHAR ProtocolReserved[1];
751 } NDIS_PACKET, *PNDIS_PACKET, **PPNDIS_PACKET;
752
753 typedef struct _NDIS_PACKET_STACK {
754 ULONG_PTR IMReserved[2];
755 ULONG_PTR NdisReserved[4];
756 } NDIS_PACKET_STACK, *PNDIS_PACKET_STACK;
757
758 #endif /* NDIS_LEGACY_DRIVER */
759
760 typedef enum _NDIS_CLASS_ID {
761 NdisClass802_3Priority,
762 NdisClassWirelessWanMbxMailbox,
763 NdisClassIrdaPacketInfo,
764 NdisClassAtmAALInfo
765 } NDIS_CLASS_ID;
766
767 typedef struct _MEDIA_SPECIFIC_INFORMATION {
768 UINT NextEntryOffset;
769 NDIS_CLASS_ID ClassId;
770 UINT Size;
771 UCHAR ClassInformation[1];
772 } MEDIA_SPECIFIC_INFORMATION, *PMEDIA_SPECIFIC_INFORMATION;
773
774 #if NDIS_LEGACY_DRIVER
775 typedef struct _NDIS_PACKET_OOB_DATA {
776 __MINGW_EXTENSION union {
777 ULONGLONG TimeToSend;
778 ULONGLONG TimeSent;
779 };
780 ULONGLONG TimeReceived;
781 UINT HeaderSize;
782 UINT SizeMediaSpecificInfo;
783 PVOID MediaSpecificInformation;
784 NDIS_STATUS Status;
785 } NDIS_PACKET_OOB_DATA, *PNDIS_PACKET_OOB_DATA;
786 #endif
787
788 /* Request types used by NdisRequest */
789 typedef enum _NDIS_REQUEST_TYPE {
790 NdisRequestQueryInformation,
791 NdisRequestSetInformation,
792 NdisRequestQueryStatistics,
793 NdisRequestOpen,
794 NdisRequestClose,
795 NdisRequestSend,
796 NdisRequestTransferData,
797 NdisRequestReset,
798 NdisRequestGeneric1,
799 NdisRequestGeneric2,
800 NdisRequestGeneric3,
801 NdisRequestGeneric4,
802 #if NDIS_SUPPORT_NDIS6
803 NdisRequestMethod,
804 #endif
805 } NDIS_REQUEST_TYPE, *PNDIS_REQUEST_TYPE;
806
807 #if NDIS_LEGACY_DRIVER
808 typedef struct _NDIS_REQUEST {
809 UCHAR MacReserved[4 * sizeof(PVOID)];
810 NDIS_REQUEST_TYPE RequestType;
811 union _DATA {
812 struct QUERY_INFORMATION {
813 NDIS_OID Oid;
814 PVOID InformationBuffer;
815 UINT InformationBufferLength;
816 UINT BytesWritten;
817 UINT BytesNeeded;
818 } QUERY_INFORMATION;
819 struct SET_INFORMATION {
820 NDIS_OID Oid;
821 PVOID InformationBuffer;
822 UINT InformationBufferLength;
823 UINT BytesRead;
824 UINT BytesNeeded;
825 } SET_INFORMATION;
826 } DATA;
827 #if (defined(NDIS50) || defined(NDIS51) || defined(NDIS50_MINIPORT) || defined(NDIS51_MINIPORT))
828 UCHAR NdisReserved[9 * sizeof(PVOID)];
829 __MINGW_EXTENSION union {
830 UCHAR CallMgrReserved[2 * sizeof(PVOID)];
831 UCHAR ProtocolReserved[2 * sizeof(PVOID)];
832 };
833 UCHAR MiniportReserved[2 * sizeof(PVOID)];
834 #endif
835 } NDIS_REQUEST, *PNDIS_REQUEST;
836 #endif /* NDIS_LEGACY_DRIVER */
837
838 /* Wide Area Networks definitions */
839
840 #if NDIS_LEGACY_DRIVER
841 typedef struct _NDIS_WAN_PACKET {
842 LIST_ENTRY WanPacketQueue;
843 PUCHAR CurrentBuffer;
844 ULONG CurrentLength;
845 PUCHAR StartBuffer;
846 PUCHAR EndBuffer;
847 PVOID ProtocolReserved1;
848 PVOID ProtocolReserved2;
849 PVOID ProtocolReserved3;
850 PVOID ProtocolReserved4;
851 PVOID MacReserved1;
852 PVOID MacReserved2;
853 PVOID MacReserved3;
854 PVOID MacReserved4;
855 } NDIS_WAN_PACKET, *PNDIS_WAN_PACKET;
856 #endif
857
858 /* DMA channel information */
859
860 typedef struct _NDIS_DMA_DESCRIPTION {
861 BOOLEAN DemandMode;
862 BOOLEAN AutoInitialize;
863 BOOLEAN DmaChannelSpecified;
864 DMA_WIDTH DmaWidth;
865 DMA_SPEED DmaSpeed;
866 ULONG DmaPort;
867 ULONG DmaChannel;
868 } NDIS_DMA_DESCRIPTION, *PNDIS_DMA_DESCRIPTION;
869
870 typedef struct _NDIS_DMA_BLOCK {
871 PVOID MapRegisterBase;
872 KEVENT AllocationEvent;
873 PADAPTER_OBJECT SystemAdapterObject;
874 PVOID Miniport;
875 BOOLEAN InProgress;
876 } NDIS_DMA_BLOCK, *PNDIS_DMA_BLOCK;
877
878 typedef UCHAR NDIS_DMA_SIZE;
879
880 #define NDIS_DMA_24BITS ((NDIS_DMA_SIZE)0)
881 #define NDIS_DMA_32BITS ((NDIS_DMA_SIZE)1)
882 #define NDIS_DMA_64BITS ((NDIS_DMA_SIZE)2)
883
884 typedef enum _NDIS_PROCESSOR_TYPE {
885 NdisProcessorX86,
886 NdisProcessorMips,
887 NdisProcessorAlpha,
888 NdisProcessorPpc,
889 NdisProcessorAmd64,
890 NdisProcessorIA64
891 } NDIS_PROCESSOR_TYPE, *PNDIS_PROCESSOR_TYPE;
892
893 typedef enum _NDIS_ENVIRONMENT_TYPE {
894 NdisEnvironmentWindows,
895 NdisEnvironmentWindowsNt
896 } NDIS_ENVIRONMENT_TYPE, *PNDIS_ENVIRONMENT_TYPE;
897
898 /* Possible hardware architecture */
899 typedef enum _NDIS_INTERFACE_TYPE {
900 NdisInterfaceInternal = Internal,
901 NdisInterfaceIsa = Isa,
902 NdisInterfaceEisa = Eisa,
903 NdisInterfaceMca = MicroChannel,
904 NdisInterfaceTurboChannel = TurboChannel,
905 NdisInterfacePci = PCIBus,
906 NdisInterfacePcMcia = PCMCIABus,
907 NdisInterfaceCBus = CBus,
908 NdisInterfaceMPIBus = MPIBus,
909 NdisInterfaceMPSABus = MPSABus,
910 NdisInterfaceProcessorInternal = ProcessorInternal,
911 NdisInterfaceInternalPowerBus = InternalPowerBus,
912 NdisInterfacePNPISABus = PNPISABus,
913 NdisInterfacePNPBus = PNPBus,
914 NdisInterfaceUSB,
915 NdisInterfaceIrda,
916 NdisInterface1394,
917 NdisMaximumInterfaceType
918 } NDIS_INTERFACE_TYPE, *PNDIS_INTERFACE_TYPE;
919
920 #define NdisInterruptLevelSensitive LevelSensitive
921 #define NdisInterruptLatched Latched
922
923 typedef KINTERRUPT_MODE NDIS_INTERRUPT_MODE, *PNDIS_INTERRUPT_MODE;
924
925 typedef enum _NDIS_PARAMETER_TYPE {
926 NdisParameterInteger,
927 NdisParameterHexInteger,
928 NdisParameterString,
929 NdisParameterMultiString,
930 NdisParameterBinary
931 } NDIS_PARAMETER_TYPE, *PNDIS_PARAMETER_TYPE;
932
933 typedef struct _BINARY_DATA {
934 USHORT Length;
935 _Field_size_bytes_(Length) PVOID Buffer;
936 } BINARY_DATA;
937
938 typedef struct _NDIS_CONFIGURATION_PARAMETER {
939 NDIS_PARAMETER_TYPE ParameterType;
940 union {
941 ULONG IntegerData;
942 NDIS_STRING StringData;
943 BINARY_DATA BinaryData;
944 } ParameterData;
945 } NDIS_CONFIGURATION_PARAMETER, *PNDIS_CONFIGURATION_PARAMETER;
946
947 typedef PHYSICAL_ADDRESS NDIS_PHYSICAL_ADDRESS, *PNDIS_PHYSICAL_ADDRESS;
948
949 typedef struct _NDIS_PHYSICAL_ADDRESS_UNIT {
950 NDIS_PHYSICAL_ADDRESS PhysicalAddress;
951 UINT Length;
952 } NDIS_PHYSICAL_ADDRESS_UNIT, *PNDIS_PHYSICAL_ADDRESS_UNIT;
953
954 typedef struct _NDIS_WAN_LINE_DOWN {
955 UCHAR RemoteAddress[6];
956 UCHAR LocalAddress[6];
957 } NDIS_WAN_LINE_DOWN, *PNDIS_WAN_LINE_DOWN;
958
959 typedef struct _NDIS_WAN_LINE_UP {
960 ULONG LinkSpeed;
961 ULONG MaximumTotalSize;
962 NDIS_WAN_QUALITY Quality;
963 USHORT SendWindow;
964 UCHAR RemoteAddress[6];
965 OUT UCHAR LocalAddress[6];
966 ULONG ProtocolBufferLength;
967 PUCHAR ProtocolBuffer;
968 USHORT ProtocolType;
969 NDIS_STRING DeviceName;
970 } NDIS_WAN_LINE_UP, *PNDIS_WAN_LINE_UP;
971
972 typedef NTSTATUS
973 (NTAPI *TDI_REGISTER_CALLBACK)(
974 _In_ PUNICODE_STRING DeviceName,
975 _Out_ HANDLE *TdiHandle);
976
977 typedef NTSTATUS
978 (NTAPI *TDI_PNP_HANDLER)(
979 _In_ PUNICODE_STRING UpperComponent,
980 _In_ PUNICODE_STRING LowerComponent,
981 _In_ PUNICODE_STRING BindList,
982 _In_ PVOID ReconfigBuffer,
983 _In_ UINT ReconfigBufferSize,
984 _In_ UINT Operation);
985
986 typedef struct _OID_LIST OID_LIST, *POID_LIST;
987
988 /* PnP state */
989 typedef enum _NDIS_PNP_DEVICE_STATE {
990 NdisPnPDeviceAdded,
991 NdisPnPDeviceStarted,
992 NdisPnPDeviceQueryStopped,
993 NdisPnPDeviceStopped,
994 NdisPnPDeviceQueryRemoved,
995 NdisPnPDeviceRemoved,
996 NdisPnPDeviceSurpriseRemoved
997 } NDIS_PNP_DEVICE_STATE;
998
999 typedef enum _NDIS_DEVICE_PNP_EVENT {
1000 NdisDevicePnPEventQueryRemoved,
1001 NdisDevicePnPEventRemoved,
1002 NdisDevicePnPEventSurpriseRemoved,
1003 NdisDevicePnPEventQueryStopped,
1004 NdisDevicePnPEventStopped,
1005 NdisDevicePnPEventPowerProfileChanged,
1006 #if NDIS_SUPPORT_NDIS6
1007 NdisDevicePnPEventFilterListChanged,
1008 #endif /* NDIS_SUPPORT_NDIS6 */
1009 NdisDevicePnPEventMaximum
1010 } NDIS_DEVICE_PNP_EVENT, *PNDIS_DEVICE_PNP_EVENT;
1011
1012 /* Power profiles */
1013 typedef enum _NDIS_POWER_PROFILE {
1014 NdisPowerProfileBattery,
1015 NdisPowerProfileAcOnLine
1016 } NDIS_POWER_PROFILE, *PNDIS_POWER_PROFILE;
1017
1018 #define NDIS_DEVICE_NOT_STOPPABLE 0x00000001
1019 #define NDIS_DEVICE_NOT_REMOVEABLE 0x00000002
1020 #define NDIS_DEVICE_NOT_SUSPENDABLE 0x00000004
1021 #define NDIS_DEVICE_DISABLE_PM 0x00000008
1022 #define NDIS_DEVICE_DISABLE_WAKE_UP 0x00000010
1023 #define NDIS_DEVICE_DISABLE_WAKE_ON_RECONNECT 0x00000020
1024 #define NDIS_DEVICE_RESERVED 0x00000040
1025 #define NDIS_DEVICE_DISABLE_WAKE_ON_MAGIC_PACKET 0x00000080
1026 #define NDIS_DEVICE_DISABLE_WAKE_ON_PATTERN_MATCH 0x00000100
1027
1028 /* Protocol types supported by NDIS */
1029 #define NDIS_PROTOCOL_ID_DEFAULT 0x00
1030 #define NDIS_PROTOCOL_ID_TCP_IP 0x02
1031 #define NDIS_PROTOCOL_ID_IPX 0x06
1032 #define NDIS_PROTOCOL_ID_NBF 0x07
1033 #define NDIS_PROTOCOL_ID_MAX 0x0F
1034 #define NDIS_PROTOCOL_ID_MASK 0x0F
1035
1036 typedef ULONG NDIS_AF, *PNDIS_AF;
1037
1038 #define CO_ADDRESS_FAMILY_Q2931 ((NDIS_AF)0x1)
1039 #define CO_ADDRESS_FAMILY_PSCHED ((NDIS_AF)0x2)
1040 #define CO_ADDRESS_FAMILY_L2TP ((NDIS_AF)0x3)
1041 #define CO_ADDRESS_FAMILY_IRDA ((NDIS_AF)0x4)
1042 #define CO_ADDRESS_FAMILY_1394 ((NDIS_AF)0x5)
1043 #define CO_ADDRESS_FAMILY_PPP ((NDIS_AF)0x6)
1044 #define CO_ADDRESS_FAMILY_INFINIBAND ((NDIS_AF)0x7)
1045 #define CO_ADDRESS_FAMILY_TAPI ((NDIS_AF)0x800)
1046 #define CO_ADDRESS_FAMILY_TAPI_PROXY ((NDIS_AF)0x801)
1047
1048 #define CO_ADDRESS_FAMILY_PROXY 0x80000000
1049
1050 typedef struct _CO_ADDRESS_FAMILY {
1051 NDIS_AF AddressFamily;
1052 ULONG MajorVersion;
1053 ULONG MinorVersion;
1054 } CO_ADDRESS_FAMILY, *PCO_ADDRESS_FAMILY;
1055
1056 typedef struct _CO_SPECIFIC_PARAMETERS {
1057 ULONG ParamType;
1058 ULONG Length;
1059 UCHAR Parameters[1];
1060 } CO_SPECIFIC_PARAMETERS, *PCO_SPECIFIC_PARAMETERS;
1061
1062 typedef struct _CO_CALL_MANAGER_PARAMETERS {
1063 FLOWSPEC Transmit;
1064 FLOWSPEC Receive;
1065 CO_SPECIFIC_PARAMETERS CallMgrSpecific;
1066 } CO_CALL_MANAGER_PARAMETERS, *PCO_CALL_MANAGER_PARAMETERS;
1067
1068 /* CO_MEDIA_PARAMETERS.Flags constants */
1069 #define RECEIVE_TIME_INDICATION 0x00000001
1070 #define USE_TIME_STAMPS 0x00000002
1071 #define TRANSMIT_VC 0x00000004
1072 #define RECEIVE_VC 0x00000008
1073 #define INDICATE_ERRED_PACKETS 0x00000010
1074 #define INDICATE_END_OF_TX 0x00000020
1075 #define RESERVE_RESOURCES_VC 0x00000040
1076 #define ROUND_DOWN_FLOW 0x00000080
1077 #define ROUND_UP_FLOW 0x00000100
1078
1079 typedef struct _CO_MEDIA_PARAMETERS {
1080 ULONG Flags;
1081 ULONG ReceivePriority;
1082 ULONG ReceiveSizeHint;
1083 CO_SPECIFIC_PARAMETERS MediaSpecific;
1084 } CO_MEDIA_PARAMETERS, *PCO_MEDIA_PARAMETERS;
1085
1086 /* CO_CALL_PARAMETERS.Flags constants */
1087 #define PERMANENT_VC 0x00000001
1088 #define CALL_PARAMETERS_CHANGED 0x00000002
1089 #define QUERY_CALL_PARAMETERS 0x00000004
1090 #define BROADCAST_VC 0x00000008
1091 #define MULTIPOINT_VC 0x00000010
1092
1093 typedef struct _CO_CALL_PARAMETERS {
1094 ULONG Flags;
1095 PCO_CALL_MANAGER_PARAMETERS CallMgrParameters;
1096 PCO_MEDIA_PARAMETERS MediaParameters;
1097 } CO_CALL_PARAMETERS, *PCO_CALL_PARAMETERS;
1098
1099 typedef struct _CO_SAP {
1100 ULONG SapType;
1101 ULONG SapLength;
1102 UCHAR Sap[1];
1103 } CO_SAP, *PCO_SAP;
1104
1105 #if NDIS_LEGACY_DRIVER
1106 typedef struct _NDIS_IPSEC_PACKET_INFO {
1107 __MINGW_EXTENSION union {
1108 struct {
1109 NDIS_HANDLE OffloadHandle;
1110 NDIS_HANDLE NextOffloadHandle;
1111 } Transmit;
1112 struct {
1113 ULONG SA_DELETE_REQ:1;
1114 ULONG CRYPTO_DONE:1;
1115 ULONG NEXT_CRYPTO_DONE:1;
1116 ULONG CryptoStatus;
1117 } Receive;
1118 };
1119 } NDIS_IPSEC_PACKET_INFO, *PNDIS_IPSEC_PACKET_INFO;
1120 #endif
1121
1122 #if (NDIS_SUPPORT_NDIS6 || NDIS60)
1123 typedef struct _NDIS_IPSEC_OFFLOAD_V1_NET_BUFFER_LIST_INFO {
1124 __MINGW_EXTENSION union {
1125 struct {
1126 NDIS_HANDLE OffloadHandle;
1127 } Transmit;
1128 struct {
1129 USHORT SaDeleteReq:1;
1130 USHORT CryptoDone:1;
1131 USHORT NextCryptoDone:1;
1132 USHORT Pad:13;
1133 USHORT CryptoStatus;
1134 } Receive;
1135 };
1136 } NDIS_IPSEC_OFFLOAD_V1_NET_BUFFER_LIST_INFO, *PNDIS_IPSEC_OFFLOAD_V1_NET_BUFFER_LIST_INFO;
1137 #endif
1138
1139 /* NDIS_MAC_FRAGMENT.Errors constants */
1140 #define WAN_ERROR_CRC 0x00000001
1141 #define WAN_ERROR_FRAMING 0x00000002
1142 #define WAN_ERROR_HARDWAREOVERRUN 0x00000004
1143 #define WAN_ERROR_BUFFEROVERRUN 0x00000008
1144 #define WAN_ERROR_TIMEOUT 0x00000010
1145 #define WAN_ERROR_ALIGNMENT 0x00000020
1146
1147 typedef struct _NDIS_MAC_FRAGMENT {
1148 NDIS_HANDLE NdisLinkContext;
1149 ULONG Errors;
1150 } NDIS_MAC_FRAGMENT, *PNDIS_MAC_FRAGMENT;
1151
1152 typedef struct _NDIS_MAC_LINE_DOWN {
1153 NDIS_HANDLE NdisLinkContext;
1154 } NDIS_MAC_LINE_DOWN, *PNDIS_MAC_LINE_DOWN;
1155
1156 typedef struct _NDIS_MAC_LINE_UP {
1157 ULONG LinkSpeed;
1158 NDIS_WAN_QUALITY Quality;
1159 USHORT SendWindow;
1160 NDIS_HANDLE ConnectionWrapperID;
1161 NDIS_HANDLE NdisLinkHandle;
1162 NDIS_HANDLE NdisLinkContext;
1163 } NDIS_MAC_LINE_UP, *PNDIS_MAC_LINE_UP;
1164
1165 typedef struct _NDIS_PACKET_8021Q_INFO {
1166 __MINGW_EXTENSION union {
1167 struct {
1168 UINT32 UserPriority:3;
1169 UINT32 CanonicalFormatId:1;
1170 UINT32 VlanId:12;
1171 UINT32 Reserved:16;
1172 } TagHeader;
1173 PVOID Value;
1174 };
1175 } NDIS_PACKET_8021Q_INFO, *PNDIS_PACKET_8021Q_INFO;
1176
1177 typedef enum _NDIS_PER_PACKET_INFO {
1178 TcpIpChecksumPacketInfo,
1179 IpSecPacketInfo,
1180 TcpLargeSendPacketInfo,
1181 ClassificationHandlePacketInfo,
1182 NdisReserved,
1183 ScatterGatherListPacketInfo,
1184 Ieee8021QInfo,
1185 OriginalPacketInfo,
1186 PacketCancelId,
1187 OriginalNetBufferList,
1188 CachedNetBufferList,
1189 ShortPacketPaddingInfo,
1190 MaxPerPacketInfo
1191 } NDIS_PER_PACKET_INFO, *PNDIS_PER_PACKET_INFO;
1192
1193 #if NDIS_LEGACY_DRIVER
1194
1195 typedef struct _NDIS_PACKET_EXTENSION {
1196 PVOID NdisPacketInfo[MaxPerPacketInfo];
1197 } NDIS_PACKET_EXTENSION, *PNDIS_PACKET_EXTENSION;
1198
1199 typedef enum _NDIS_TASK {
1200 TcpIpChecksumNdisTask,
1201 IpSecNdisTask,
1202 TcpLargeSendNdisTask,
1203 MaxNdisTask
1204 } NDIS_TASK, *PNDIS_TASK;
1205
1206 typedef enum _NDIS_ENCAPSULATION {
1207 UNSPECIFIED_Encapsulation,
1208 NULL_Encapsulation,
1209 IEEE_802_3_Encapsulation,
1210 IEEE_802_5_Encapsulation,
1211 LLC_SNAP_ROUTED_Encapsulation,
1212 LLC_SNAP_BRIDGED_Encapsulation
1213 } NDIS_ENCAPSULATION;
1214
1215 typedef struct _NDIS_ENCAPSULATION_FORMAT {
1216 NDIS_ENCAPSULATION Encapsulation;
1217 struct {
1218 ULONG FixedHeaderSize:1;
1219 ULONG Reserved:31;
1220 } Flags;
1221 ULONG EncapsulationHeaderSize;
1222 } NDIS_ENCAPSULATION_FORMAT, *PNDIS_ENCAPSULATION_FORMAT;
1223
1224 typedef struct _NDIS_TASK_OFFLOAD_HEADER {
1225 ULONG Version;
1226 ULONG Size;
1227 ULONG Reserved;
1228 ULONG OffsetFirstTask;
1229 NDIS_ENCAPSULATION_FORMAT EncapsulationFormat;
1230 } NDIS_TASK_OFFLOAD_HEADER, *PNDIS_TASK_OFFLOAD_HEADER;
1231
1232 typedef struct _NDIS_TASK_OFFLOAD {
1233 ULONG Version;
1234 ULONG Size;
1235 NDIS_TASK Task;
1236 ULONG OffsetNextTask;
1237 ULONG TaskBufferLength;
1238 UCHAR TaskBuffer[1];
1239 } NDIS_TASK_OFFLOAD, *PNDIS_TASK_OFFLOAD;
1240
1241 typedef struct _NDIS_TASK_TCP_IP_CHECKSUM {
1242 struct {
1243 ULONG IpOptionsSupported:1;
1244 ULONG TcpOptionsSupported:1;
1245 ULONG TcpChecksum:1;
1246 ULONG UdpChecksum:1;
1247 ULONG IpChecksum:1;
1248 } V4Transmit;
1249 struct {
1250 ULONG IpOptionsSupported:1;
1251 ULONG TcpOptionsSupported:1;
1252 ULONG TcpChecksum:1;
1253 ULONG UdpChecksum:1;
1254 ULONG IpChecksum:1;
1255 } V4Receive;
1256 struct {
1257 ULONG IpOptionsSupported:1;
1258 ULONG TcpOptionsSupported:1;
1259 ULONG TcpChecksum:1;
1260 ULONG UdpChecksum:1;
1261 } V6Transmit;
1262 struct {
1263 ULONG IpOptionsSupported:1;
1264 ULONG TcpOptionsSupported:1;
1265 ULONG TcpChecksum:1;
1266 ULONG UdpChecksum:1;
1267 } V6Receive;
1268 } NDIS_TASK_TCP_IP_CHECKSUM, *PNDIS_TASK_TCP_IP_CHECKSUM;
1269
1270 #define NDIS_TASK_TCP_LARGE_SEND_V0 0
1271
1272 typedef struct _NDIS_TASK_TCP_LARGE_SEND {
1273 ULONG Version;
1274 ULONG MaxOffLoadSize;
1275 ULONG MinSegmentCount;
1276 BOOLEAN TcpOptions;
1277 BOOLEAN IpOptions;
1278 } NDIS_TASK_TCP_LARGE_SEND, *PNDIS_TASK_TCP_LARGE_SEND;
1279
1280 typedef struct _NDIS_TASK_IPSEC {
1281 struct {
1282 ULONG AH_ESP_COMBINED;
1283 ULONG TRANSPORT_TUNNEL_COMBINED;
1284 ULONG V4_OPTIONS;
1285 ULONG RESERVED;
1286 } Supported;
1287 struct {
1288 ULONG MD5:1;
1289 ULONG SHA_1:1;
1290 ULONG Transport:1;
1291 ULONG Tunnel:1;
1292 ULONG Send:1;
1293 ULONG Receive:1;
1294 } V4AH;
1295 struct {
1296 ULONG DES:1;
1297 ULONG RESERVED:1;
1298 ULONG TRIPLE_DES:1;
1299 ULONG NULL_ESP:1;
1300 ULONG Transport:1;
1301 ULONG Tunnel:1;
1302 ULONG Send:1;
1303 ULONG Receive:1;
1304 } V4ESP;
1305 } NDIS_TASK_IPSEC, *PNDIS_TASK_IPSEC;
1306
1307 #endif /* NDIS_LEGACY_DRIVER */
1308
1309 #define IPSEC_TPT_UDPESP_ENCAPTYPE_IKE 0x00000001
1310 #define IPSEC_TUN_UDPESP_ENCAPTYPE_IKE 0x00000002
1311 #define IPSEC_TPTOVERTUN_UDPESP_ENCAPTYPE_IKE 0x00000004
1312 #define IPSEC_TPT_UDPESP_OVER_PURE_TUN_ENCAPTYPE_IKE 0x00000008
1313 #define IPSEC_TPT_UDPESP_ENCAPTYPE_OTHER 0x00000010
1314 #define IPSEC_TUN_UDPESP_ENCAPTYPE_OTHER 0x00000020
1315 #define IPSEC_TPTOVERTUN_UDPESP_ENCAPTYPE_OTHER 0x00000040
1316 #define IPSEC_TPT_UDPESP_OVER_PURE_TUN_ENCAPTYPE_OTHER 0x00000080
1317
1318 #if NDIS_LEGACY_DRIVER
1319
1320 /*
1321 * PNDIS_PACKET
1322 * NDIS_GET_ORIGINAL_PACKET(
1323 * IN PNDIS_PACKET Packet);
1324 */
1325 #define NDIS_GET_ORIGINAL_PACKET(Packet) \
1326 NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, OriginalPacketInfo)
1327
1328 /*
1329 * PVOID
1330 * NDIS_GET_PACKET_CANCEL_ID(
1331 * IN PNDIS_PACKET Packet);
1332 */
1333 #define NDIS_GET_PACKET_CANCEL_ID(Packet) \
1334 NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, PacketCancelId)
1335
1336 /*
1337 * PNDIS_PACKET_EXTENSION
1338 * NDIS_PACKET_EXTENSION_FROM_PACKET(
1339 * IN PNDIS_PACKET Packet);
1340 */
1341 #define NDIS_PACKET_EXTENSION_FROM_PACKET(Packet) \
1342 ((PNDIS_PACKET_EXTENSION)((PUCHAR)(Packet) \
1343 + (Packet)->Private.NdisPacketOobOffset + sizeof(NDIS_PACKET_OOB_DATA)))
1344
1345 /*
1346 * PVOID
1347 * NDIS_PER_PACKET_INFO_FROM_PACKET(
1348 * IN OUT PNDIS_PACKET Packet,
1349 * IN NDIS_PER_PACKET_INFO InfoType);
1350 */
1351 #define NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, InfoType) \
1352 ((PNDIS_PACKET_EXTENSION)((PUCHAR)(Packet) + (Packet)->Private.NdisPacketOobOffset \
1353 + sizeof(NDIS_PACKET_OOB_DATA)))->NdisPacketInfo[(InfoType)]
1354
1355 /*
1356 * VOID
1357 * NDIS_SET_ORIGINAL_PACKET(
1358 * IN OUT PNDIS_PACKET Packet,
1359 * IN PNDIS_PACKET OriginalPacket);
1360 */
1361 #define NDIS_SET_ORIGINAL_PACKET(Packet, OriginalPacket) \
1362 NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, OriginalPacketInfo) = (OriginalPacket)
1363
1364 /*
1365 * VOID
1366 * NDIS_SET_PACKET_CANCEL_ID(
1367 * IN PNDIS_PACKET Packet
1368 * IN ULONG_PTR CancelId);
1369 */
1370 #define NDIS_SET_PACKET_CANCEL_ID(Packet, CancelId) \
1371 NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, PacketCancelId) = (CancelId)
1372
1373 #define NdisSetPacketCancelId(_Packet, _CancelId) NDIS_SET_PACKET_CANCEL_ID(_Packet, _CancelId)
1374 #define NdisGetPacketCancelId(_Packet) NDIS_GET_PACKET_CANCEL_ID(_Packet)
1375
1376 #endif /* NDIS_LEGACY_DRIVER */
1377
1378 #if NDIS_SUPPORT_NDIS6
1379 typedef struct _NDIS_GENERIC_OBJECT {
1380 NDIS_OBJECT_HEADER Header;
1381 PVOID Caller;
1382 PVOID CallersCaller;
1383 PDRIVER_OBJECT DriverObject;
1384 } NDIS_GENERIC_OBJECT, *PNDIS_GENERIC_OBJECT;
1385 #endif
1386
1387 /* NDIS_TASK_OFFLOAD_HEADER.Version constants */
1388 #define NDIS_TASK_OFFLOAD_VERSION 1
1389
1390 #define MAX_HASHES 4
1391 #define TRUNCATED_HASH_LEN 12
1392
1393 #define CRYPTO_SUCCESS 0
1394 #define CRYPTO_GENERIC_ERROR 1
1395 #define CRYPTO_TRANSPORT_AH_AUTH_FAILED 2
1396 #define CRYPTO_TRANSPORT_ESP_AUTH_FAILED 3
1397 #define CRYPTO_TUNNEL_AH_AUTH_FAILED 4
1398 #define CRYPTO_TUNNEL_ESP_AUTH_FAILED 5
1399 #define CRYPTO_INVALID_PACKET_SYNTAX 6
1400 #define CRYPTO_INVALID_PROTOCOL 7
1401
1402 typedef struct _NDIS_TCP_IP_CHECKSUM_PACKET_INFO {
1403 __MINGW_EXTENSION union {
1404 struct {
1405 ULONG NdisPacketChecksumV4:1;
1406 ULONG NdisPacketChecksumV6:1;
1407 ULONG NdisPacketTcpChecksum:1;
1408 ULONG NdisPacketUdpChecksum:1;
1409 ULONG NdisPacketIpChecksum:1;
1410 } Transmit;
1411 struct {
1412 ULONG NdisPacketTcpChecksumFailed:1;
1413 ULONG NdisPacketUdpChecksumFailed:1;
1414 ULONG NdisPacketIpChecksumFailed:1;
1415 ULONG NdisPacketTcpChecksumSucceeded:1;
1416 ULONG NdisPacketUdpChecksumSucceeded:1;
1417 ULONG NdisPacketIpChecksumSucceeded:1;
1418 ULONG NdisPacketLoopback:1;
1419 } Receive;
1420 ULONG Value;
1421 };
1422 } NDIS_TCP_IP_CHECKSUM_PACKET_INFO, *PNDIS_TCP_IP_CHECKSUM_PACKET_INFO;
1423
1424 typedef struct _NDIS_WAN_CO_FRAGMENT {
1425 ULONG Errors;
1426 } NDIS_WAN_CO_FRAGMENT, *PNDIS_WAN_CO_FRAGMENT;
1427
1428 typedef struct _NDIS_WAN_FRAGMENT {
1429 UCHAR RemoteAddress[6];
1430 UCHAR LocalAddress[6];
1431 } NDIS_WAN_FRAGMENT, *PNDIS_WAN_FRAGMENT;
1432
1433 typedef struct _WAN_CO_LINKPARAMS {
1434 ULONG TransmitSpeed;
1435 ULONG ReceiveSpeed;
1436 ULONG SendWindow;
1437 } WAN_CO_LINKPARAMS, *PWAN_CO_LINKPARAMS;
1438
1439 typedef struct _NDIS_WAN_GET_STATS {
1440 UCHAR LocalAddress[6];
1441 ULONG BytesSent;
1442 ULONG BytesRcvd;
1443 ULONG FramesSent;
1444 ULONG FramesRcvd;
1445 ULONG CRCErrors;
1446 ULONG TimeoutErrors;
1447 ULONG AlignmentErrors;
1448 ULONG SerialOverrunErrors;
1449 ULONG FramingErrors;
1450 ULONG BufferOverrunErrors;
1451 ULONG BytesTransmittedUncompressed;
1452 ULONG BytesReceivedUncompressed;
1453 ULONG BytesTransmittedCompressed;
1454 ULONG BytesReceivedCompressed;
1455 } NDIS_WAN_GET_STATS, *PNDIS_WAN_GET_STATS;
1456
1457 /* Call Manager */
1458
1459 typedef VOID
1460 (NTAPI *CM_ACTIVATE_VC_COMPLETE_HANDLER)(
1461 IN NDIS_STATUS Status,
1462 IN NDIS_HANDLE CallMgrVcContext,
1463 IN PCO_CALL_PARAMETERS CallParameters);
1464
1465 typedef NDIS_STATUS
1466 (NTAPI *CM_ADD_PARTY_HANDLER)(
1467 IN NDIS_HANDLE CallMgrVcContext,
1468 IN OUT PCO_CALL_PARAMETERS CallParameters,
1469 IN NDIS_HANDLE NdisPartyHandle,
1470 OUT PNDIS_HANDLE CallMgrPartyContext);
1471
1472 typedef NDIS_STATUS
1473 (NTAPI *CM_CLOSE_AF_HANDLER)(
1474 IN NDIS_HANDLE CallMgrAfContext);
1475
1476 typedef NDIS_STATUS
1477 (NTAPI *CM_CLOSE_CALL_HANDLER)(
1478 IN NDIS_HANDLE CallMgrVcContext,
1479 IN NDIS_HANDLE CallMgrPartyContext OPTIONAL,
1480 IN PVOID CloseData OPTIONAL,
1481 IN UINT Size OPTIONAL);
1482
1483 typedef NDIS_STATUS
1484 (NTAPI *CM_DEREG_SAP_HANDLER)(
1485 IN NDIS_HANDLE CallMgrSapContext);
1486
1487 typedef VOID
1488 (NTAPI *CM_DEACTIVATE_VC_COMPLETE_HANDLER)(
1489 IN NDIS_STATUS Status,
1490 IN NDIS_HANDLE CallMgrVcContext);
1491
1492 typedef NDIS_STATUS
1493 (NTAPI *CM_DROP_PARTY_HANDLER)(
1494 IN NDIS_HANDLE CallMgrPartyContext,
1495 IN PVOID CloseData OPTIONAL,
1496 IN UINT Size OPTIONAL);
1497
1498 typedef VOID
1499 (NTAPI *CM_INCOMING_CALL_COMPLETE_HANDLER)(
1500 IN NDIS_STATUS Status,
1501 IN NDIS_HANDLE CallMgrVcContext,
1502 IN PCO_CALL_PARAMETERS CallParameters);
1503
1504 typedef NDIS_STATUS
1505 (NTAPI *CM_MAKE_CALL_HANDLER)(
1506 IN NDIS_HANDLE CallMgrVcContext,
1507 IN OUT PCO_CALL_PARAMETERS CallParameters,
1508 IN NDIS_HANDLE NdisPartyHandle OPTIONAL,
1509 OUT PNDIS_HANDLE CallMgrPartyContext OPTIONAL);
1510
1511 typedef NDIS_STATUS
1512 (NTAPI *CM_MODIFY_CALL_QOS_HANDLER)(
1513 IN NDIS_HANDLE CallMgrVcContext,
1514 IN PCO_CALL_PARAMETERS CallParameters);
1515
1516 typedef NDIS_STATUS
1517 (NTAPI *CM_OPEN_AF_HANDLER)(
1518 IN NDIS_HANDLE CallMgrBindingContext,
1519 IN PCO_ADDRESS_FAMILY AddressFamily,
1520 IN NDIS_HANDLE NdisAfHandle,
1521 OUT PNDIS_HANDLE CallMgrAfContext);
1522
1523 typedef NDIS_STATUS
1524 (NTAPI *CM_REG_SAP_HANDLER)(
1525 IN NDIS_HANDLE CallMgrAfContext,
1526 IN PCO_SAP Sap,
1527 IN NDIS_HANDLE NdisSapHandle,
1528 OUT PNDIS_HANDLE CallMgrSapContext);
1529
1530 typedef NDIS_STATUS
1531 (NTAPI *CO_CREATE_VC_HANDLER)(
1532 IN NDIS_HANDLE ProtocolAfContext,
1533 IN NDIS_HANDLE NdisVcHandle,
1534 OUT PNDIS_HANDLE ProtocolVcContext);
1535
1536 typedef NDIS_STATUS
1537 (NTAPI *CO_DELETE_VC_HANDLER)(
1538 IN NDIS_HANDLE ProtocolVcContext);
1539
1540 #define PROTOCOL_RESERVED_SIZE_IN_PACKET (4 * sizeof(PVOID))
1541
1542 /* Prototypes for NDIS 5.0 protocol characteristics */
1543
1544 _IRQL_requires_(PASSIVE_LEVEL)
1545 typedef VOID
1546 (NTAPI *CO_SEND_COMPLETE_HANDLER)(
1547 _In_ NDIS_STATUS Status,
1548 _In_ NDIS_HANDLE ProtocolVcContext,
1549 _In_ PNDIS_PACKET Packet);
1550
1551 _IRQL_requires_max_(DISPATCH_LEVEL)
1552 typedef VOID
1553 (NTAPI *CO_STATUS_HANDLER)(
1554 _In_ NDIS_HANDLE ProtocolBindingContext,
1555 _In_opt_ NDIS_HANDLE ProtocolVcContext,
1556 _In_ NDIS_STATUS GeneralStatus,
1557 _In_ PVOID StatusBuffer,
1558 _In_ UINT StatusBufferSize);
1559
1560 _IRQL_requires_max_(DISPATCH_LEVEL)
1561 typedef UINT
1562 (NTAPI *CO_RECEIVE_PACKET_HANDLER)(
1563 _In_ NDIS_HANDLE ProtocolBindingContext,
1564 _In_ NDIS_HANDLE ProtocolVcContext,
1565 _In_ PNDIS_PACKET Packet);
1566
1567 _IRQL_requires_max_(DISPATCH_LEVEL)
1568 typedef NDIS_STATUS
1569 (NTAPI *CO_REQUEST_HANDLER)(
1570 _In_ NDIS_HANDLE ProtocolAfContext,
1571 _In_opt_ NDIS_HANDLE ProtocolVcContext,
1572 _In_opt_ NDIS_HANDLE ProtocolPartyContext,
1573 _Inout_ PNDIS_REQUEST NdisRequest);
1574
1575 _IRQL_requires_max_(DISPATCH_LEVEL)
1576 typedef VOID
1577 (NTAPI *CO_REQUEST_COMPLETE_HANDLER)(
1578 _In_ NDIS_STATUS Status,
1579 _In_opt_ NDIS_HANDLE ProtocolAfContext,
1580 _In_opt_ NDIS_HANDLE ProtocolVcContext,
1581 _In_opt_ NDIS_HANDLE ProtocolPartyContext,
1582 _In_ PNDIS_REQUEST NdisRequest);
1583
1584 typedef struct _NDIS_CALL_MANAGER_CHARACTERISTICS {
1585 UCHAR MajorVersion;
1586 UCHAR MinorVersion;
1587 USHORT Filler;
1588 UINT Reserved;
1589 CO_CREATE_VC_HANDLER CmCreateVcHandler;
1590 CO_DELETE_VC_HANDLER CmDeleteVcHandler;
1591 CM_OPEN_AF_HANDLER CmOpenAfHandler;
1592 CM_CLOSE_AF_HANDLER CmCloseAfHandler;
1593 CM_REG_SAP_HANDLER CmRegisterSapHandler;
1594 CM_DEREG_SAP_HANDLER CmDeregisterSapHandler;
1595 CM_MAKE_CALL_HANDLER CmMakeCallHandler;
1596 CM_CLOSE_CALL_HANDLER CmCloseCallHandler;
1597 CM_INCOMING_CALL_COMPLETE_HANDLER CmIncomingCallCompleteHandler;
1598 CM_ADD_PARTY_HANDLER CmAddPartyHandler;
1599 CM_DROP_PARTY_HANDLER CmDropPartyHandler;
1600 CM_ACTIVATE_VC_COMPLETE_HANDLER CmActivateVcCompleteHandler;
1601 CM_DEACTIVATE_VC_COMPLETE_HANDLER CmDeactivateVcCompleteHandler;
1602 CM_MODIFY_CALL_QOS_HANDLER CmModifyCallQoSHandler;
1603 CO_REQUEST_HANDLER CmRequestHandler;
1604 CO_REQUEST_COMPLETE_HANDLER CmRequestCompleteHandler;
1605 } NDIS_CALL_MANAGER_CHARACTERISTICS, *PNDIS_CALL_MANAGER_CHARACTERISTICS;
1606
1607
1608
1609 /* Call Manager clients */
1610
1611 typedef VOID (*CL_OPEN_AF_COMPLETE_HANDLER)(
1612 IN NDIS_STATUS Status,
1613 IN NDIS_HANDLE ProtocolAfContext,
1614 IN NDIS_HANDLE NdisAfHandle);
1615
1616 typedef VOID
1617 (NTAPI *CL_CLOSE_AF_COMPLETE_HANDLER)(
1618 IN NDIS_STATUS Status,
1619 IN NDIS_HANDLE ProtocolAfContext);
1620
1621 typedef VOID
1622 (NTAPI *CL_REG_SAP_COMPLETE_HANDLER)(
1623 IN NDIS_STATUS Status,
1624 IN NDIS_HANDLE ProtocolSapContext,
1625 IN PCO_SAP Sap,
1626 IN NDIS_HANDLE NdisSapHandle);
1627
1628 typedef VOID
1629 (NTAPI *CL_DEREG_SAP_COMPLETE_HANDLER)(
1630 IN NDIS_STATUS Status,
1631 IN NDIS_HANDLE ProtocolSapContext);
1632
1633 typedef VOID
1634 (NTAPI *CL_MAKE_CALL_COMPLETE_HANDLER)(
1635 IN NDIS_STATUS Status,
1636 IN NDIS_HANDLE ProtocolVcContext,
1637 IN NDIS_HANDLE NdisPartyHandle OPTIONAL,
1638 IN PCO_CALL_PARAMETERS CallParameters);
1639
1640 typedef VOID
1641 (NTAPI *CL_MODIFY_CALL_QOS_COMPLETE_HANDLER)(
1642 IN NDIS_STATUS Status,
1643 IN NDIS_HANDLE ProtocolVcContext,
1644 IN PCO_CALL_PARAMETERS CallParameters);
1645
1646 typedef VOID
1647 (NTAPI *CL_CLOSE_CALL_COMPLETE_HANDLER)(
1648 IN NDIS_STATUS Status,
1649 IN NDIS_HANDLE ProtocolVcContext,
1650 IN NDIS_HANDLE ProtocolPartyContext OPTIONAL);
1651
1652 typedef VOID
1653 (NTAPI *CL_ADD_PARTY_COMPLETE_HANDLER)(
1654 IN NDIS_STATUS Status,
1655 IN NDIS_HANDLE ProtocolPartyContext,
1656 IN NDIS_HANDLE NdisPartyHandle,
1657 IN PCO_CALL_PARAMETERS CallParameters);
1658
1659 typedef VOID
1660 (NTAPI *CL_DROP_PARTY_COMPLETE_HANDLER)(
1661 IN NDIS_STATUS Status,
1662 IN NDIS_HANDLE ProtocolPartyContext);
1663
1664 typedef NDIS_STATUS
1665 (NTAPI *CL_INCOMING_CALL_HANDLER)(
1666 IN NDIS_HANDLE ProtocolSapContext,
1667 IN NDIS_HANDLE ProtocolVcContext,
1668 IN OUT PCO_CALL_PARAMETERS CallParameters);
1669
1670 typedef VOID
1671 (NTAPI *CL_INCOMING_CALL_QOS_CHANGE_HANDLER)(
1672 IN NDIS_HANDLE ProtocolVcContext,
1673 IN PCO_CALL_PARAMETERS CallParameters);
1674
1675 typedef VOID
1676 (NTAPI *CL_INCOMING_CLOSE_CALL_HANDLER)(
1677 IN NDIS_STATUS CloseStatus,
1678 IN NDIS_HANDLE ProtocolVcContext,
1679 IN PVOID CloseData OPTIONAL,
1680 IN UINT Size OPTIONAL);
1681
1682 typedef VOID
1683 (NTAPI *CL_INCOMING_DROP_PARTY_HANDLER)(
1684 IN NDIS_STATUS DropStatus,
1685 IN NDIS_HANDLE ProtocolPartyContext,
1686 IN PVOID CloseData OPTIONAL,
1687 IN UINT Size OPTIONAL);
1688
1689 typedef VOID
1690 (NTAPI *CL_CALL_CONNECTED_HANDLER)(
1691 IN NDIS_HANDLE ProtocolVcContext);
1692
1693
1694 typedef struct _NDIS_CLIENT_CHARACTERISTICS {
1695 UCHAR MajorVersion;
1696 UCHAR MinorVersion;
1697 USHORT Filler;
1698 UINT Reserved;
1699 CO_CREATE_VC_HANDLER ClCreateVcHandler;
1700 CO_DELETE_VC_HANDLER ClDeleteVcHandler;
1701 CO_REQUEST_HANDLER ClRequestHandler;
1702 CO_REQUEST_COMPLETE_HANDLER ClRequestCompleteHandler;
1703 CL_OPEN_AF_COMPLETE_HANDLER ClOpenAfCompleteHandler;
1704 CL_CLOSE_AF_COMPLETE_HANDLER ClCloseAfCompleteHandler;
1705 CL_REG_SAP_COMPLETE_HANDLER ClRegisterSapCompleteHandler;
1706 CL_DEREG_SAP_COMPLETE_HANDLER ClDeregisterSapCompleteHandler;
1707 CL_MAKE_CALL_COMPLETE_HANDLER ClMakeCallCompleteHandler;
1708 CL_MODIFY_CALL_QOS_COMPLETE_HANDLER ClModifyCallQoSCompleteHandler;
1709 CL_CLOSE_CALL_COMPLETE_HANDLER ClCloseCallCompleteHandler;
1710 CL_ADD_PARTY_COMPLETE_HANDLER ClAddPartyCompleteHandler;
1711 CL_DROP_PARTY_COMPLETE_HANDLER ClDropPartyCompleteHandler;
1712 CL_INCOMING_CALL_HANDLER ClIncomingCallHandler;
1713 CL_INCOMING_CALL_QOS_CHANGE_HANDLER ClIncomingCallQoSChangeHandler;
1714 CL_INCOMING_CLOSE_CALL_HANDLER ClIncomingCloseCallHandler;
1715 CL_INCOMING_DROP_PARTY_HANDLER ClIncomingDropPartyHandler;
1716 CL_CALL_CONNECTED_HANDLER ClCallConnectedHandler;
1717 } NDIS_CLIENT_CHARACTERISTICS, *PNDIS_CLIENT_CHARACTERISTICS;
1718
1719
1720 /* NDIS protocol structures */
1721
1722 /* Prototypes for NDIS 3.0 protocol characteristics */
1723
1724 typedef VOID
1725 (NTAPI *OPEN_ADAPTER_COMPLETE_HANDLER)(
1726 _In_ NDIS_HANDLE ProtocolBindingContext,
1727 _In_ NDIS_STATUS Status,
1728 _In_ NDIS_STATUS OpenErrorStatus);
1729
1730 typedef VOID
1731 (NTAPI *CLOSE_ADAPTER_COMPLETE_HANDLER)(
1732 _In_ NDIS_HANDLE ProtocolBindingContext,
1733 _In_ NDIS_STATUS Status);
1734
1735 typedef VOID
1736 (NTAPI *RESET_COMPLETE_HANDLER)(
1737 _In_ NDIS_HANDLE ProtocolBindingContext,
1738 _In_ NDIS_STATUS Status);
1739
1740 typedef VOID
1741 (NTAPI *REQUEST_COMPLETE_HANDLER)(
1742 _In_ NDIS_HANDLE ProtocolBindingContext,
1743 _In_ PNDIS_REQUEST NdisRequest,
1744 _In_ NDIS_STATUS Status);
1745
1746 typedef VOID
1747 (NTAPI *STATUS_HANDLER)(
1748 _In_ NDIS_HANDLE ProtocolBindingContext,
1749 _In_ NDIS_STATUS GeneralStatus,
1750 _In_ PVOID StatusBuffer,
1751 _In_ UINT StatusBufferSize);
1752
1753 typedef VOID
1754 (NTAPI *STATUS_COMPLETE_HANDLER)(
1755 _In_ NDIS_HANDLE ProtocolBindingContext);
1756
1757 typedef VOID
1758 (NTAPI *SEND_COMPLETE_HANDLER)(
1759 _In_ NDIS_HANDLE ProtocolBindingContext,
1760 _In_ PNDIS_PACKET Packet,
1761 _In_ NDIS_STATUS Status);
1762
1763 typedef VOID
1764 (NTAPI *WAN_SEND_COMPLETE_HANDLER)(
1765 _In_ NDIS_HANDLE ProtocolBindingContext,
1766 _In_ PNDIS_WAN_PACKET Packet,
1767 _In_ NDIS_STATUS Status);
1768
1769 typedef VOID
1770 (NTAPI *TRANSFER_DATA_COMPLETE_HANDLER)(
1771 _In_ NDIS_HANDLE ProtocolBindingContext,
1772 _In_ PNDIS_PACKET Packet,
1773 _In_ NDIS_STATUS Status,
1774 _In_ UINT BytesTransferred);
1775
1776 typedef VOID
1777 (NTAPI *WAN_TRANSFER_DATA_COMPLETE_HANDLER)(
1778 VOID);
1779
1780 typedef NDIS_STATUS
1781 (NTAPI *RECEIVE_HANDLER)(
1782 _In_ NDIS_HANDLE ProtocolBindingContext,
1783 _In_ NDIS_HANDLE MacReceiveContext,
1784 _In_ PVOID HeaderBuffer,
1785 _In_ UINT HeaderBufferSize,
1786 _In_ PVOID LookAheadBuffer,
1787 _In_ UINT LookaheadBufferSize,
1788 _In_ UINT PacketSize);
1789
1790 typedef NDIS_STATUS
1791 (NTAPI *WAN_RECEIVE_HANDLER)(
1792 _In_ NDIS_HANDLE NdisLinkHandle,
1793 _In_ PUCHAR Packet,
1794 _In_ ULONG PacketSize);
1795
1796 typedef VOID
1797 (NTAPI *RECEIVE_COMPLETE_HANDLER)(
1798 _In_ NDIS_HANDLE ProtocolBindingContext);
1799
1800 /* Protocol characteristics for NDIS 3.0 protocols */
1801
1802 #define NDIS30_PROTOCOL_CHARACTERISTICS_S \
1803 UCHAR MajorNdisVersion; \
1804 UCHAR MinorNdisVersion; \
1805 USHORT Filler; \
1806 _ANONYMOUS_UNION union { \
1807 UINT Reserved; \
1808 UINT Flags; \
1809 } DUMMYUNIONNAME; \
1810 OPEN_ADAPTER_COMPLETE_HANDLER OpenAdapterCompleteHandler; \
1811 CLOSE_ADAPTER_COMPLETE_HANDLER CloseAdapterCompleteHandler; \
1812 _ANONYMOUS_UNION union { \
1813 SEND_COMPLETE_HANDLER SendCompleteHandler; \
1814 WAN_SEND_COMPLETE_HANDLER WanSendCompleteHandler; \
1815 } DUMMYUNIONNAME2; \
1816 _ANONYMOUS_UNION union { \
1817 TRANSFER_DATA_COMPLETE_HANDLER TransferDataCompleteHandler; \
1818 WAN_TRANSFER_DATA_COMPLETE_HANDLER WanTransferDataCompleteHandler; \
1819 } DUMMYUNIONNAME3; \
1820 RESET_COMPLETE_HANDLER ResetCompleteHandler; \
1821 REQUEST_COMPLETE_HANDLER RequestCompleteHandler; \
1822 _ANONYMOUS_UNION union { \
1823 RECEIVE_HANDLER ReceiveHandler; \
1824 WAN_RECEIVE_HANDLER WanReceiveHandler; \
1825 } DUMMYUNIONNAME4; \
1826 RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler; \
1827 STATUS_HANDLER StatusHandler; \
1828 STATUS_COMPLETE_HANDLER StatusCompleteHandler; \
1829 NDIS_STRING Name;
1830
1831 typedef struct _NDIS30_PROTOCOL_CHARACTERISTICS {
1832 NDIS30_PROTOCOL_CHARACTERISTICS_S
1833 } NDIS30_PROTOCOL_CHARACTERISTICS, *PNDIS30_PROTOCOL_CHARACTERISTICS;
1834
1835
1836 /* Prototypes for NDIS 4.0 protocol characteristics */
1837
1838 typedef INT
1839 (NTAPI *RECEIVE_PACKET_HANDLER)(
1840 IN NDIS_HANDLE ProtocolBindingContext,
1841 IN PNDIS_PACKET Packet);
1842
1843 typedef VOID
1844 (NTAPI *BIND_HANDLER)(
1845 OUT PNDIS_STATUS Status,
1846 IN NDIS_HANDLE BindContext,
1847 IN PNDIS_STRING DeviceName,
1848 IN PVOID SystemSpecific1,
1849 IN PVOID SystemSpecific2);
1850
1851 typedef VOID
1852 (NTAPI *UNBIND_HANDLER)(
1853 OUT PNDIS_STATUS Status,
1854 IN NDIS_HANDLE ProtocolBindingContext,
1855 IN NDIS_HANDLE UnbindContext);
1856
1857 typedef NDIS_STATUS
1858 (NTAPI *PNP_EVENT_HANDLER)(
1859 IN NDIS_HANDLE ProtocolBindingContext,
1860 IN PNET_PNP_EVENT NetPnPEvent);
1861
1862 typedef VOID
1863 (NTAPI *UNLOAD_PROTOCOL_HANDLER)(
1864 VOID);
1865
1866 /* Protocol characteristics for NDIS 4.0 protocols */
1867
1868 typedef struct _NDIS40_PROTOCOL_CHARACTERISTICS {
1869 UCHAR MajorNdisVersion;
1870 UCHAR MinorNdisVersion;
1871 USHORT Filler;
1872 __MINGW_EXTENSION union {
1873 UINT Reserved;
1874 UINT Flags;
1875 };
1876 OPEN_ADAPTER_COMPLETE_HANDLER OpenAdapterCompleteHandler;
1877 CLOSE_ADAPTER_COMPLETE_HANDLER CloseAdapterCompleteHandler;
1878 __MINGW_EXTENSION union {
1879 SEND_COMPLETE_HANDLER SendCompleteHandler;
1880 WAN_SEND_COMPLETE_HANDLER WanSendCompleteHandler;
1881 };
1882 __MINGW_EXTENSION union {
1883 TRANSFER_DATA_COMPLETE_HANDLER TransferDataCompleteHandler;
1884 WAN_TRANSFER_DATA_COMPLETE_HANDLER WanTransferDataCompleteHandler;
1885 };
1886 RESET_COMPLETE_HANDLER ResetCompleteHandler;
1887 REQUEST_COMPLETE_HANDLER RequestCompleteHandler;
1888 __MINGW_EXTENSION union {
1889 RECEIVE_HANDLER ReceiveHandler;
1890 WAN_RECEIVE_HANDLER WanReceiveHandler;
1891 };
1892 RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler;
1893 STATUS_HANDLER StatusHandler;
1894 STATUS_COMPLETE_HANDLER StatusCompleteHandler;
1895 NDIS_STRING Name;
1896 RECEIVE_PACKET_HANDLER ReceivePacketHandler;
1897 BIND_HANDLER BindAdapterHandler;
1898 UNBIND_HANDLER UnbindAdapterHandler;
1899 PNP_EVENT_HANDLER PnPEventHandler;
1900 UNLOAD_PROTOCOL_HANDLER UnloadHandler;
1901 } NDIS40_PROTOCOL_CHARACTERISTICS;
1902
1903 typedef VOID
1904 (NTAPI PROTCOL_CO_AF_REGISTER_NOTIFY)(
1905 IN NDIS_HANDLE ProtocolBindingContext,
1906 IN PCO_ADDRESS_FAMILY AddressFamily);
1907 typedef PROTCOL_CO_AF_REGISTER_NOTIFY *CO_AF_REGISTER_NOTIFY_HANDLER;
1908
1909 #if NDIS_LEGACY_PROTOCOL
1910
1911 typedef struct _NDIS50_PROTOCOL_CHARACTERISTICS {
1912 #ifdef __cplusplus
1913 NDIS40_PROTOCOL_CHARACTERISTICS Ndis40Chars;
1914 #else
1915 NDIS40_PROTOCOL_CHARACTERISTICS;
1916 #endif
1917 PVOID ReservedHandlers[4];
1918 CO_SEND_COMPLETE_HANDLER CoSendCompleteHandler;
1919 CO_STATUS_HANDLER CoStatusHandler;
1920 CO_RECEIVE_PACKET_HANDLER CoReceivePacketHandler;
1921 CO_AF_REGISTER_NOTIFY_HANDLER CoAfRegisterNotifyHandler;
1922 } NDIS50_PROTOCOL_CHARACTERISTICS;
1923
1924 #if (defined(NDIS50) || defined(NDIS51))
1925 typedef NDIS50_PROTOCOL_CHARACTERISTICS NDIS_PROTOCOL_CHARACTERISTICS;
1926 #else
1927 typedef NDIS40_PROTOCOL_CHARACTERISTICS NDIS_PROTOCOL_CHARACTERISTICS;
1928 #endif
1929
1930 typedef NDIS_PROTOCOL_CHARACTERISTICS *PNDIS_PROTOCOL_CHARACTERISTICS;
1931
1932 #endif /* NDIS_LEGACY_PROTOCOL */
1933
1934 /* Prototypes for NDIS_MINIPORT_CHARACTERISTICS */
1935
1936 typedef BOOLEAN
1937 (NTAPI *W_CHECK_FOR_HANG_HANDLER)(
1938 _In_ NDIS_HANDLE MiniportAdapterContext);
1939
1940 typedef VOID
1941 (NTAPI *W_DISABLE_INTERRUPT_HANDLER)(
1942 _In_ NDIS_HANDLE MiniportAdapterContext);
1943
1944 typedef VOID
1945 (NTAPI *W_ENABLE_INTERRUPT_HANDLER)(
1946 _In_ NDIS_HANDLE MiniportAdapterContext);
1947
1948 typedef VOID
1949 (NTAPI *W_HALT_HANDLER)(
1950 _In_ NDIS_HANDLE MiniportAdapterContext);
1951
1952 typedef VOID
1953 (NTAPI *W_HANDLE_INTERRUPT_HANDLER)(
1954 _In_ NDIS_HANDLE MiniportAdapterContext);
1955
1956 typedef NDIS_STATUS
1957 (NTAPI *W_INITIALIZE_HANDLER)(
1958 _Out_ PNDIS_STATUS OpenErrorStatus,
1959 _Out_ PUINT SelectedMediumIndex,
1960 _In_ PNDIS_MEDIUM MediumArray,
1961 _In_ UINT MediumArraySize,
1962 _In_ NDIS_HANDLE MiniportAdapterContext,
1963 _In_ NDIS_HANDLE WrapperConfigurationContext);
1964
1965 typedef VOID
1966 (NTAPI *W_ISR_HANDLER)(
1967 _Out_ PBOOLEAN InterruptRecognized,
1968 _Out_ PBOOLEAN QueueMiniportHandleInterrupt,
1969 _In_ NDIS_HANDLE MiniportAdapterContext);
1970
1971 typedef NDIS_STATUS
1972 (NTAPI *W_QUERY_INFORMATION_HANDLER)(
1973 _In_ NDIS_HANDLE MiniportAdapterContext,
1974 _In_ NDIS_OID Oid,
1975 _In_ PVOID InformationBuffer,
1976 _In_ ULONG InformationBufferLength,
1977 _Out_ PULONG BytesWritten,
1978 _Out_ PULONG BytesNeeded);
1979
1980 typedef NDIS_STATUS
1981 (NTAPI *W_RECONFIGURE_HANDLER)(
1982 _Out_ PNDIS_STATUS OpenErrorStatus,
1983 _In_ NDIS_HANDLE MiniportAdapterContext,
1984 _In_ NDIS_HANDLE WrapperConfigurationContext);
1985
1986 typedef NDIS_STATUS
1987 (NTAPI *W_RESET_HANDLER)(
1988 _Out_ PBOOLEAN AddressingReset,
1989 _In_ NDIS_HANDLE MiniportAdapterContext);
1990
1991 typedef NDIS_STATUS
1992 (NTAPI *W_SEND_HANDLER)(
1993 _In_ NDIS_HANDLE MiniportAdapterContext,
1994 _In_ PNDIS_PACKET Packet,
1995 _In_ UINT Flags);
1996
1997 typedef NDIS_STATUS
1998 (NTAPI *WM_SEND_HANDLER)(
1999 _In_ NDIS_HANDLE MiniportAdapterContext,
2000 _In_ NDIS_HANDLE NdisLinkHandle,
2001 _In_ PNDIS_WAN_PACKET Packet);
2002
2003 typedef NDIS_STATUS
2004 (NTAPI *W_SET_INFORMATION_HANDLER)(
2005 _In_ NDIS_HANDLE MiniportAdapterContext,
2006 _In_ NDIS_OID Oid,
2007 _In_ PVOID InformationBuffer,
2008 _In_ ULONG InformationBufferLength,
2009 _Out_ PULONG BytesRead,
2010 _Out_ PULONG BytesNeeded);
2011
2012 typedef NDIS_STATUS
2013 (NTAPI *W_TRANSFER_DATA_HANDLER)(
2014 _Out_ PNDIS_PACKET Packet,
2015 _Out_ PUINT BytesTransferred,
2016 _In_ NDIS_HANDLE MiniportAdapterContext,
2017 _In_ NDIS_HANDLE MiniportReceiveContext,
2018 _In_ UINT ByteOffset,
2019 _In_ UINT BytesToTransfer);
2020
2021 typedef NDIS_STATUS
2022 (NTAPI *WM_TRANSFER_DATA_HANDLER)(VOID);
2023
2024 typedef VOID
2025 (NTAPI *ADAPTER_SHUTDOWN_HANDLER)(
2026 _In_ PVOID ShutdownContext);
2027
2028 typedef VOID
2029 (NTAPI *W_RETURN_PACKET_HANDLER)(
2030 _In_ NDIS_HANDLE MiniportAdapterContext,
2031 _In_ PNDIS_PACKET Packet);
2032
2033 typedef VOID
2034 (NTAPI *W_SEND_PACKETS_HANDLER)(
2035 _In_ NDIS_HANDLE MiniportAdapterContext,
2036 _In_ PPNDIS_PACKET PacketArray,
2037 _In_ UINT NumberOfPackets);
2038
2039 typedef VOID
2040 (NTAPI *W_ALLOCATE_COMPLETE_HANDLER)(
2041 _In_ NDIS_HANDLE MiniportAdapterContext,
2042 _In_ PVOID VirtualAddress,
2043 _In_ PNDIS_PHYSICAL_ADDRESS PhysicalAddress,
2044 _In_ ULONG Length,
2045 _In_ PVOID Context);
2046
2047 /* NDIS structures available only to miniport drivers */
2048
2049 #define NDIS30_MINIPORT_CHARACTERISTICS_S \
2050 UCHAR MajorNdisVersion; \
2051 UCHAR MinorNdisVersion; \
2052 UINT Reserved; \
2053 W_CHECK_FOR_HANG_HANDLER CheckForHangHandler; \
2054 W_DISABLE_INTERRUPT_HANDLER DisableInterruptHandler; \
2055 W_ENABLE_INTERRUPT_HANDLER EnableInterruptHandler; \
2056 W_HALT_HANDLER HaltHandler; \
2057 W_HANDLE_INTERRUPT_HANDLER HandleInterruptHandler; \
2058 W_INITIALIZE_HANDLER InitializeHandler; \
2059 W_ISR_HANDLER ISRHandler; \
2060 W_QUERY_INFORMATION_HANDLER QueryInformationHandler; \
2061 W_RECONFIGURE_HANDLER ReconfigureHandler; \
2062 W_RESET_HANDLER ResetHandler; \
2063 W_SEND_HANDLER SendHandler; \
2064 W_SET_INFORMATION_HANDLER SetInformationHandler; \
2065 W_TRANSFER_DATA_HANDLER TransferDataHandler;
2066
2067 typedef struct _NDIS30_MINIPORT_CHARACTERISTICS {
2068 NDIS30_MINIPORT_CHARACTERISTICS_S
2069 } NDIS30_MINIPORT_CHARACTERISTICS, *PSNDIS30_MINIPORT_CHARACTERISTICS;
2070
2071 #ifdef __cplusplus
2072
2073 #define NDIS40_MINIPORT_CHARACTERISTICS_S \
2074 NDIS30_MINIPORT_CHARACTERISTICS Ndis30Chars; \
2075 W_RETURN_PACKET_HANDLER ReturnPacketHandler; \
2076 W_SEND_PACKETS_HANDLER SendPacketsHandler; \
2077 W_ALLOCATE_COMPLETE_HANDLER AllocateCompleteHandler;
2078
2079 #else /* !__cplusplus */
2080
2081 #define NDIS40_MINIPORT_CHARACTERISTICS_S \
2082 NDIS30_MINIPORT_CHARACTERISTICS_S \
2083 W_RETURN_PACKET_HANDLER ReturnPacketHandler; \
2084 W_SEND_PACKETS_HANDLER SendPacketsHandler; \
2085 W_ALLOCATE_COMPLETE_HANDLER AllocateCompleteHandler;
2086
2087 #endif /* !__cplusplus */
2088
2089 typedef struct _NDIS40_MINIPORT_CHARACTERISTICS {
2090 NDIS40_MINIPORT_CHARACTERISTICS_S
2091 } NDIS40_MINIPORT_CHARACTERISTICS, *PNDIS40_MINIPORT_CHARACTERISTICS;
2092
2093 /* Extensions for NDIS 5.0 miniports */
2094
2095 _IRQL_requires_max_(DISPATCH_LEVEL)
2096 _Function_class_(MINIPORT_CO_CREATE_VC)
2097 typedef NDIS_STATUS
2098 (NTAPI MINIPORT_CO_CREATE_VC)(
2099 _In_ NDIS_HANDLE MiniportAdapterContext,
2100 _In_ NDIS_HANDLE NdisVcHandle,
2101 _Out_ PNDIS_HANDLE MiniportVcContext);
2102 typedef MINIPORT_CO_CREATE_VC *W_CO_CREATE_VC_HANDLER;
2103
2104 _IRQL_requires_max_(DISPATCH_LEVEL)
2105 _Function_class_(MINIPORT_CO_DELETE_VC)
2106 typedef NDIS_STATUS
2107 (NTAPI MINIPORT_CO_DELETE_VC)(
2108 _In_ NDIS_HANDLE MiniportVcContext);
2109 typedef MINIPORT_CO_DELETE_VC *W_CO_DELETE_VC_HANDLER;
2110
2111 _IRQL_requires_max_(DISPATCH_LEVEL)
2112 _Function_class_(MINIPORT_CO_ACTIVATE_VC)
2113 typedef NDIS_STATUS
2114 (NTAPI MINIPORT_CO_ACTIVATE_VC)(
2115 _In_ NDIS_HANDLE MiniportVcContext,
2116 _Inout_ PCO_CALL_PARAMETERS CallParameters);
2117 typedef MINIPORT_CO_ACTIVATE_VC *W_CO_ACTIVATE_VC_HANDLER;
2118
2119 _IRQL_requires_max_(DISPATCH_LEVEL)
2120 _Function_class_(MINIPORT_CO_DEACTIVATE_VC)
2121 typedef NDIS_STATUS
2122 (NTAPI MINIPORT_CO_DEACTIVATE_VC)(
2123 _In_ NDIS_HANDLE MiniportVcContext);
2124 typedef MINIPORT_CO_DEACTIVATE_VC *W_CO_DEACTIVATE_VC_HANDLER;
2125
2126 typedef VOID
2127 (NTAPI *W_CO_SEND_PACKETS_HANDLER)(
2128 _In_ NDIS_HANDLE MiniportVcContext,
2129 _In_ PPNDIS_PACKET PacketArray,
2130 _In_ UINT NumberOfPackets);
2131
2132 typedef NDIS_STATUS
2133 (NTAPI *W_CO_REQUEST_HANDLER)(
2134 _In_ NDIS_HANDLE MiniportAdapterContext,
2135 _In_opt_ NDIS_HANDLE MiniportVcContext,
2136 _Inout_ PNDIS_REQUEST NdisRequest);
2137
2138 #ifdef __cplusplus
2139
2140 #define NDIS50_MINIPORT_CHARACTERISTICS_S \
2141 NDIS40_MINIPORT_CHARACTERISTICS Ndis40Chars; \
2142 W_CO_CREATE_VC_HANDLER CoCreateVcHandler; \
2143 W_CO_DELETE_VC_HANDLER CoDeleteVcHandler; \
2144 W_CO_ACTIVATE_VC_HANDLER CoActivateVcHandler; \
2145 W_CO_DEACTIVATE_VC_HANDLER CoDeactivateVcHandler; \
2146 W_CO_SEND_PACKETS_HANDLER CoSendPacketsHandler; \
2147 W_CO_REQUEST_HANDLER CoRequestHandler;
2148
2149 #else /* !__cplusplus */
2150
2151 #define NDIS50_MINIPORT_CHARACTERISTICS_S \
2152 NDIS40_MINIPORT_CHARACTERISTICS_S \
2153 W_CO_CREATE_VC_HANDLER CoCreateVcHandler; \
2154 W_CO_DELETE_VC_HANDLER CoDeleteVcHandler; \
2155 W_CO_ACTIVATE_VC_HANDLER CoActivateVcHandler; \
2156 W_CO_DEACTIVATE_VC_HANDLER CoDeactivateVcHandler; \
2157 W_CO_SEND_PACKETS_HANDLER CoSendPacketsHandler; \
2158 W_CO_REQUEST_HANDLER CoRequestHandler;
2159
2160 #endif /* !__cplusplus */
2161
2162 typedef struct _NDIS50_MINIPORT_CHARACTERISTICS {
2163 NDIS50_MINIPORT_CHARACTERISTICS_S
2164 } NDIS50_MINIPORT_CHARACTERISTICS, *PSNDIS50_MINIPORT_CHARACTERISTICS;
2165
2166 /* Extensions for NDIS 5.1 miniports */
2167
2168 typedef VOID
2169 (NTAPI *W_CANCEL_SEND_PACKETS_HANDLER)(
2170 _In_ NDIS_HANDLE MiniportAdapterContext,
2171 _In_ PVOID CancelId);
2172
2173 typedef VOID
2174 (NTAPI *W_PNP_EVENT_NOTIFY_HANDLER)(
2175 _In_ NDIS_HANDLE MiniportAdapterContext,
2176 _In_ NDIS_DEVICE_PNP_EVENT PnPEvent,
2177 _In_ PVOID InformationBuffer,
2178 _In_ ULONG InformationBufferLength);
2179
2180 typedef VOID
2181 (NTAPI *W_MINIPORT_SHUTDOWN_HANDLER)(
2182 _In_ PVOID ShutdownContext);
2183
2184 #ifdef __cplusplus
2185
2186 #define NDIS51_MINIPORT_CHARACTERISTICS_S \
2187 NDIS50_MINIPORT_CHARACTERISTICS Ndis50Chars; \
2188 W_CANCEL_SEND_PACKETS_HANDLER CancelSendPacketsHandler; \
2189 W_PNP_EVENT_NOTIFY_HANDLER PnPEventNotifyHandler; \
2190 W_MINIPORT_SHUTDOWN_HANDLER AdapterShutdownHandler; \
2191 PVOID Reserved1; \
2192 PVOID Reserved2; \
2193 PVOID Reserved3; \
2194 PVOID Reserved4;
2195
2196 #else
2197
2198 #define NDIS51_MINIPORT_CHARACTERISTICS_S \
2199 NDIS50_MINIPORT_CHARACTERISTICS_S \
2200 W_CANCEL_SEND_PACKETS_HANDLER CancelSendPacketsHandler; \
2201 W_PNP_EVENT_NOTIFY_HANDLER PnPEventNotifyHandler; \
2202 W_MINIPORT_SHUTDOWN_HANDLER AdapterShutdownHandler; \
2203 PVOID Reserved1; \
2204 PVOID Reserved2; \
2205 PVOID Reserved3; \
2206 PVOID Reserved4;
2207
2208 #endif
2209
2210 typedef struct _NDIS51_MINIPORT_CHARACTERISTICS {
2211 NDIS51_MINIPORT_CHARACTERISTICS_S
2212 } NDIS51_MINIPORT_CHARACTERISTICS, *PSNDIS51_MINIPORT_CHARACTERISTICS;
2213
2214 #if defined(NDIS51_MINIPORT)
2215 typedef struct _NDIS_MINIPORT_CHARACTERISTICS {
2216 NDIS51_MINIPORT_CHARACTERISTICS_S
2217 } NDIS_MINIPORT_CHARACTERISTICS, *PNDIS_MINIPORT_CHARACTERISTICS;
2218 #elif defined(NDIS50_MINIPORT)
2219 typedef struct _NDIS_MINIPORT_CHARACTERISTICS {
2220 NDIS50_MINIPORT_CHARACTERISTICS_S
2221 } NDIS_MINIPORT_CHARACTERISTICS, *PNDIS_MINIPORT_CHARACTERISTICS;
2222 #elif defined(NDIS40_MINIPORT)
2223 typedef struct _NDIS_MINIPORT_CHARACTERISTICS {
2224 NDIS40_MINIPORT_CHARACTERISTICS_S
2225 } NDIS_MINIPORT_CHARACTERISTICS, *PNDIS_MINIPORT_CHARACTERISTICS;
2226 #else /* NDIS30 */
2227 typedef struct _NDIS_MINIPORT_CHARACTERISTICS {
2228 NDIS30_MINIPORT_CHARACTERISTICS_S
2229 } NDIS_MINIPORT_CHARACTERISTICS, *PNDIS_MINIPORT_CHARACTERISTICS;
2230 #endif
2231
2232 typedef struct _NDIS_MINIPORT_INTERRUPT {
2233 PKINTERRUPT InterruptObject;
2234 KSPIN_LOCK DpcCountLock;
2235 PVOID Reserved;
2236 W_ISR_HANDLER MiniportIsr;
2237 W_HANDLE_INTERRUPT_HANDLER MiniportDpc;
2238 KDPC InterruptDpc;
2239 PNDIS_MINIPORT_BLOCK Miniport;
2240 UCHAR DpcCount;
2241 BOOLEAN Filler1;
2242 KEVENT DpcsCompletedEvent;
2243 BOOLEAN SharedInterrupt;
2244 BOOLEAN IsrRequested;
2245 } NDIS_MINIPORT_INTERRUPT, *PNDIS_MINIPORT_INTERRUPT;
2246
2247 /* Structures available only to full MAC drivers */
2248
2249 typedef BOOLEAN
2250 (NTAPI *PNDIS_INTERRUPT_SERVICE)(
2251 IN PVOID InterruptContext);
2252
2253 typedef VOID
2254 (NTAPI *PNDIS_DEFERRED_PROCESSING)(
2255 IN PVOID SystemSpecific1,
2256 IN PVOID InterruptContext,
2257 IN PVOID SystemSpecific2,
2258 IN PVOID SystemSpecific3);
2259
2260 typedef struct _NDIS_WRAPPER_HANDLE NDIS_WRAPPER_HANDLE, *PNDIS_WRAPPER_HANDLE;
2261 typedef struct _NDIS_PROTOCOL_BLOCK NDIS_PROTOCOL_BLOCK, *PNDIS_PROTOCOL_BLOCK;
2262 typedef struct _NDIS_OPEN_BLOCK NDIS_OPEN_BLOCK, *PNDIS_OPEN_BLOCK;
2263 typedef struct _NDIS_M_DRIVER_BLOCK NDIS_M_DRIVER_BLOCK, *PNDIS_M_DRIVER_BLOCK;
2264 typedef struct _NDIS_OFFLOAD NDIS_OFFLOAD, *PNDIS_OFFLOAD;
2265 typedef struct _NDIS_AF_LIST NDIS_AF_LIST, *PNDIS_AF_LIST;
2266 typedef struct _X_FILTER ETH_FILTER, *PETH_FILTER;
2267 #if NDIS_SUPPORT_NDIS6
2268 typedef USHORT NET_FRAME_TYPE, *PNET_FRAME_TYPE;
2269 #endif
2270
2271 typedef struct _NDIS_MINIPORT_TIMER {
2272 KTIMER Timer;
2273 KDPC Dpc;
2274 PNDIS_TIMER_FUNCTION MiniportTimerFunction;
2275 PVOID MiniportTimerContext;
2276 PNDIS_MINIPORT_BLOCK Miniport;
2277 struct _NDIS_MINIPORT_TIMER *NextDeferredTimer;
2278 } NDIS_MINIPORT_TIMER, *PNDIS_MINIPORT_TIMER;
2279
2280 typedef struct _NDIS_INTERRUPT {
2281 PKINTERRUPT InterruptObject;
2282 KSPIN_LOCK DpcCountLock;
2283 PNDIS_INTERRUPT_SERVICE MacIsr;
2284 PNDIS_DEFERRED_PROCESSING MacDpc;
2285 KDPC InterruptDpc;
2286 PVOID InterruptContext;
2287 UCHAR DpcCount;
2288 BOOLEAN Removing;
2289 KEVENT DpcsCompletedEvent;
2290 } NDIS_INTERRUPT, *PNDIS_INTERRUPT;
2291
2292
2293 typedef enum _NDIS_WORK_ITEM_TYPE {
2294 NdisWorkItemRequest,
2295 NdisWorkItemSend,
2296 NdisWorkItemReturnPackets,
2297 NdisWorkItemResetRequested,
2298 NdisWorkItemResetInProgress,
2299 NdisWorkItemHalt,
2300 NdisWorkItemSendLoopback,
2301 NdisWorkItemMiniportCallback,
2302 NdisMaxWorkItems
2303 } NDIS_WORK_ITEM_TYPE, *PNDIS_WORK_ITEM_TYPE;
2304
2305 #define NUMBER_OF_WORK_ITEM_TYPES NdisMaxWorkItems
2306 #define NUMBER_OF_SINGLE_WORK_ITEMS 6
2307
2308 typedef struct _NDIS_MINIPORT_WORK_ITEM {
2309 SINGLE_LIST_ENTRY Link;
2310 NDIS_WORK_ITEM_TYPE WorkItemType;
2311 PVOID WorkItemContext;
2312 } NDIS_MINIPORT_WORK_ITEM, *PNDIS_MINIPORT_WORK_ITEM;
2313
2314 struct _NDIS_WORK_ITEM;
2315 typedef VOID (NTAPI *NDIS_PROC)(struct _NDIS_WORK_ITEM *, PVOID);
2316
2317 typedef struct _NDIS_WORK_ITEM {
2318 PVOID Context;
2319 NDIS_PROC Routine;
2320 UCHAR WrapperReserved[8*sizeof(PVOID)];
2321 } NDIS_WORK_ITEM, *PNDIS_WORK_ITEM;
2322
2323 typedef struct _NDIS_BIND_PATHS {
2324 UINT Number;
2325 NDIS_STRING Paths[1];
2326 } NDIS_BIND_PATHS, *PNDIS_BIND_PATHS;
2327
2328
2329 typedef VOID
2330 (NTAPI *ETH_RCV_COMPLETE_HANDLER)(
2331 _In_ PETH_FILTER Filter);
2332
2333 typedef VOID
2334 (NTAPI *ETH_RCV_INDICATE_HANDLER)(
2335 _In_ PETH_FILTER Filter,
2336 _In_ NDIS_HANDLE MacReceiveContext,
2337 _In_ PCHAR Address,
2338 _In_ PVOID HeaderBuffer,
2339 _In_ UINT HeaderBufferSize,
2340 _In_ PVOID LookaheadBuffer,
2341 _In_ UINT LookaheadBufferSize,
2342 _In_ UINT PacketSize);
2343
2344 typedef VOID
2345 (NTAPI *FDDI_RCV_COMPLETE_HANDLER)(
2346 IN PFDDI_FILTER Filter);
2347
2348 typedef VOID
2349 (NTAPI *FDDI_RCV_INDICATE_HANDLER)(
2350 IN PFDDI_FILTER Filter,
2351 IN NDIS_HANDLE MacReceiveContext,
2352 IN PCHAR Address,
2353 IN UINT AddressLength,
2354 IN PVOID HeaderBuffer,
2355 IN UINT HeaderBufferSize,
2356 IN PVOID LookaheadBuffer,
2357 IN UINT LookaheadBufferSize,
2358 IN UINT PacketSize);
2359
2360 typedef VOID
2361 (NTAPI *FILTER_PACKET_INDICATION_HANDLER)(
2362 _In_ NDIS_HANDLE Miniport,
2363 _In_ PPNDIS_PACKET PacketArray,
2364 _In_ UINT NumberOfPackets);
2365
2366 typedef VOID
2367 (NTAPI *TR_RCV_COMPLETE_HANDLER)(
2368 _In_ PTR_FILTER Filter);
2369
2370 typedef VOID
2371 (NTAPI *TR_RCV_INDICATE_HANDLER)(
2372 _In_ PTR_FILTER Filter,
2373 _In_ NDIS_HANDLE MacReceiveContext,
2374 _In_ PVOID HeaderBuffer,
2375 _In_ UINT HeaderBufferSize,
2376 _In_ PVOID LookaheadBuffer,
2377 _In_ UINT LookaheadBufferSize,
2378 _In_ UINT PacketSize);
2379
2380 typedef VOID
2381 (NTAPI *WAN_RCV_COMPLETE_HANDLER)(
2382 _In_ NDIS_HANDLE MiniportAdapterHandle,
2383 _In_ NDIS_HANDLE NdisLinkContext);
2384
2385 typedef VOID
2386 (NTAPI *WAN_RCV_HANDLER)(
2387 _Out_ PNDIS_STATUS Status,
2388 _In_ NDIS_HANDLE MiniportAdapterHandle,
2389 _In_ NDIS_HANDLE NdisLinkContext,
2390 _In_ PUCHAR Packet,
2391 _In_ ULONG PacketSize);
2392
2393 typedef VOID
2394 (FASTCALL *NDIS_M_DEQUEUE_WORK_ITEM)(
2395 IN PNDIS_MINIPORT_BLOCK Miniport,
2396 IN NDIS_WORK_ITEM_TYPE WorkItemType,
2397 OUT PVOID *WorkItemContext);
2398
2399 typedef NDIS_STATUS
2400 (FASTCALL *NDIS_M_QUEUE_NEW_WORK_ITEM)(
2401 IN PNDIS_MINIPORT_BLOCK Miniport,
2402 IN NDIS_WORK_ITEM_TYPE WorkItemType,
2403 IN PVOID WorkItemContext);
2404
2405 typedef NDIS_STATUS
2406 (FASTCALL *NDIS_M_QUEUE_WORK_ITEM)(
2407 IN PNDIS_MINIPORT_BLOCK Miniport,
2408 IN NDIS_WORK_ITEM_TYPE WorkItemType,
2409 IN PVOID WorkItemContext);
2410
2411 typedef VOID
2412 (NTAPI *NDIS_M_REQ_COMPLETE_HANDLER)(
2413 _In_ NDIS_HANDLE MiniportAdapterHandle,
2414 _In_ NDIS_STATUS Status);
2415
2416 typedef VOID
2417 (NTAPI *NDIS_M_RESET_COMPLETE_HANDLER)(
2418 _In_ NDIS_HANDLE MiniportAdapterHandle,
2419 _In_ NDIS_STATUS Status,
2420 _In_ BOOLEAN AddressingReset);
2421
2422 typedef VOID
2423 (NTAPI *NDIS_M_SEND_COMPLETE_HANDLER)(
2424 _In_ NDIS_HANDLE MiniportAdapterHandle,
2425 _In_ PNDIS_PACKET Packet,
2426 _In_ NDIS_STATUS Status);
2427
2428 typedef VOID
2429 (NTAPI *NDIS_M_SEND_RESOURCES_HANDLER)(
2430 _In_ NDIS_HANDLE MiniportAdapterHandle);
2431
2432 typedef BOOLEAN
2433 (FASTCALL *NDIS_M_START_SENDS)(
2434 _In_ PNDIS_MINIPORT_BLOCK Miniport);
2435
2436 typedef VOID
2437 (NTAPI *NDIS_M_STATUS_HANDLER)(
2438 _In_ NDIS_HANDLE MiniportHandle,
2439 _In_ NDIS_STATUS GeneralStatus,
2440 _In_ PVOID StatusBuffer,
2441 _In_ UINT StatusBufferSize);
2442
2443 typedef VOID
2444 (NTAPI *NDIS_M_STS_COMPLETE_HANDLER)(
2445 _In_ NDIS_HANDLE MiniportAdapterHandle);
2446
2447 typedef VOID
2448 (NTAPI *NDIS_M_TD_COMPLETE_HANDLER)(
2449 _In_ NDIS_HANDLE MiniportAdapterHandle,
2450 _In_ PNDIS_PACKET Packet,
2451 _In_ NDIS_STATUS Status,
2452 _In_ UINT BytesTransferred);
2453
2454 typedef VOID (NTAPI *NDIS_WM_SEND_COMPLETE_HANDLER)(
2455 _In_ NDIS_HANDLE MiniportAdapterHandle,
2456 _In_ PVOID Packet,
2457 _In_ NDIS_STATUS Status);
2458
2459
2460 #if ARCNET
2461
2462 #define ARC_SEND_BUFFERS 8
2463 #define ARC_HEADER_SIZE 4
2464
2465 typedef struct _NDIS_ARC_BUF {
2466 NDIS_HANDLE ArcnetBufferPool;
2467 PUCHAR ArcnetLookaheadBuffer;
2468 UINT NumFree;
2469 ARC_BUFFER_LIST ArcnetBuffers[ARC_SEND_BUFFERS];
2470 } NDIS_ARC_BUF, *PNDIS_ARC_BUF;
2471
2472 #endif /* ARCNET */
2473
2474 typedef struct _NDIS_LOG {
2475 PNDIS_MINIPORT_BLOCK Miniport;
2476 KSPIN_LOCK LogLock;
2477 PIRP Irp;
2478 UINT TotalSize;
2479 UINT CurrentSize;
2480 UINT InPtr;
2481 UINT OutPtr;
2482 UCHAR LogBuf[1];
2483 } NDIS_LOG, *PNDIS_LOG;
2484
2485 #if ARCNET
2486 #define FILTERDBS_ARCNET_S \
2487 PARC_FILTER ArcDB;
2488 #else /* !ARCNET */
2489 #define FILTERDBS_ARCNET_S \
2490 PVOID XXXDB;
2491 #endif /* !ARCNET */
2492
2493 #define FILTERDBS_S \
2494 _ANONYMOUS_UNION union { \
2495 PETH_FILTER EthDB; \
2496 PNULL_FILTER NullDB; \
2497 } DUMMYUNIONNAME; \
2498 PTR_FILTER TrDB; \
2499 PFDDI_FILTER FddiDB; \
2500 FILTERDBS_ARCNET_S
2501
2502 typedef struct _FILTERDBS {
2503 FILTERDBS_S
2504 } FILTERDBS, *PFILTERDBS;
2505
2506 struct _NDIS_MINIPORT_BLOCK {
2507 NDIS_OBJECT_HEADER Header;
2508 PNDIS_MINIPORT_BLOCK NextMiniport;
2509 PNDIS_M_DRIVER_BLOCK DriverHandle;
2510 NDIS_HANDLE MiniportAdapterContext;
2511 UNICODE_STRING MiniportName;
2512 PNDIS_BIND_PATHS BindPaths;
2513 NDIS_HANDLE OpenQueue;
2514 REFERENCE ShortRef;
2515 NDIS_HANDLE DeviceContext;
2516 UCHAR Padding1;
2517 UCHAR LockAcquired;
2518 UCHAR PmodeOpens;
2519 UCHAR AssignedProcessor;
2520 KSPIN_LOCK Lock;
2521 PNDIS_REQUEST MediaRequest;
2522 PNDIS_MINIPORT_INTERRUPT Interrupt;
2523 ULONG Flags;
2524 ULONG PnPFlags;
2525 LIST_ENTRY PacketList;
2526 PNDIS_PACKET FirstPendingPacket;
2527 PNDIS_PACKET ReturnPacketsQueue;
2528 ULONG RequestBuffer;
2529 PVOID SetMCastBuffer;
2530 PNDIS_MINIPORT_BLOCK PrimaryMiniport;
2531 PVOID WrapperContext;
2532 PVOID BusDataContext;
2533 ULONG PnPCapabilities;
2534 PCM_RESOURCE_LIST Resources;
2535 NDIS_TIMER WakeUpDpcTimer;
2536 UNICODE_STRING BaseName;
2537 UNICODE_STRING SymbolicLinkName;
2538 ULONG CheckForHangSeconds;
2539 USHORT CFHangTicks;
2540 USHORT CFHangCurrentTick;
2541 NDIS_STATUS ResetStatus;
2542 NDIS_HANDLE ResetOpen;
2543 FILTERDBS_S
2544 FILTER_PACKET_INDICATION_HANDLER PacketIndicateHandler;
2545 NDIS_M_SEND_COMPLETE_HANDLER SendCompleteHandler;
2546 NDIS_M_SEND_RESOURCES_HANDLER SendResourcesHandler;
2547 NDIS_M_RESET_COMPLETE_HANDLER ResetCompleteHandler;
2548 NDIS_MEDIUM MediaType;
2549 ULONG BusNumber;
2550 NDIS_INTERFACE_TYPE BusType;
2551 NDIS_INTERFACE_TYPE AdapterType;
2552 PDEVICE_OBJECT DeviceObject;
2553 PDEVICE_OBJECT PhysicalDeviceObject;
2554 PDEVICE_OBJECT NextDeviceObject;
2555 PMAP_REGISTER_ENTRY MapRegisters;
2556 PNDIS_AF_LIST CallMgrAfList;
2557 PVOID MiniportThread;
2558 PVOID SetInfoBuf;
2559 USHORT SetInfoBufLen;
2560 USHORT MaxSendPackets;
2561 NDIS_STATUS FakeStatus;
2562 PVOID LockHandler;
2563 PUNICODE_STRING pAdapterInstanceName;
2564 PNDIS_MINIPORT_TIMER TimerQueue;
2565 UINT MacOptions;
2566 PNDIS_REQUEST PendingRequest;
2567 UINT MaximumLongAddresses;
2568 UINT MaximumShortAddresses;
2569 UINT CurrentLookahead;
2570 UINT MaximumLookahead;
2571 W_HANDLE_INTERRUPT_HANDLER HandleInterruptHandler;
2572 W_DISABLE_INTERRUPT_HANDLER DisableInterruptHandler;
2573 W_ENABLE_INTERRUPT_HANDLER EnableInterruptHandler;
2574 W_SEND_PACKETS_HANDLER SendPacketsHandler;
2575 NDIS_M_START_SENDS DeferredSendHandler;
2576 ETH_RCV_INDICATE_HANDLER EthRxIndicateHandler;
2577 TR_RCV_INDICATE_HANDLER TrRxIndicateHandler;
2578 FDDI_RCV_INDICATE_HANDLER FddiRxIndicateHandler;
2579 ETH_RCV_COMPLETE_HANDLER EthRxCompleteHandler;
2580 TR_RCV_COMPLETE_HANDLER TrRxCompleteHandler;
2581 FDDI_RCV_COMPLETE_HANDLER FddiRxCompleteHandler;
2582 NDIS_M_STATUS_HANDLER StatusHandler;
2583 NDIS_M_STS_COMPLETE_HANDLER StatusCompleteHandler;
2584 NDIS_M_TD_COMPLETE_HANDLER TDCompleteHandler;
2585 NDIS_M_REQ_COMPLETE_HANDLER QueryCompleteHandler;
2586 NDIS_M_REQ_COMPLETE_HANDLER SetCompleteHandler;
2587 NDIS_WM_SEND_COMPLETE_HANDLER WanSendCompleteHandler;
2588 WAN_RCV_HANDLER WanRcvHandler;
2589 WAN_RCV_COMPLETE_HANDLER WanRcvCompleteHandler;
2590 #if defined(NDIS_WRAPPER)
2591 PNDIS_MINIPORT_BLOCK NextGlobalMiniport;
2592 SINGLE_LIST_ENTRY WorkQueue[NUMBER_OF_WORK_ITEM_TYPES];
2593 SINGLE_LIST_ENTRY SingleWorkItems[NUMBER_OF_SINGLE_WORK_ITEMS];
2594 UCHAR SendFlags;
2595 UCHAR TrResetRing;
2596 UCHAR ArcnetAddress;
2597 UCHAR XState;
2598 _ANONYMOUS_UNION union {
2599 #if ARCNET
2600 PNDIS_ARC_BUF ArcBuf;
2601 #endif
2602 PVOID BusInterface;
2603 } DUMMYUNIONNAME;
2604 PNDIS_LOG Log;
2605 ULONG SlotNumber;
2606 PCM_RESOURCE_LIST AllocatedResources;
2607 PCM_RESOURCE_LIST AllocatedResourcesTranslated;
2608 SINGLE_LIST_ENTRY PatternList;
2609 NDIS_PNP_CAPABILITIES PMCapabilities;
2610 DEVICE_CAPABILITIES DeviceCaps;
2611 ULONG WakeUpEnable;
2612 DEVICE_POWER_STATE CurrentDevicePowerState;
2613 PIRP pIrpWaitWake;
2614 SYSTEM_POWER_STATE WaitWakeSystemState;
2615 LARGE_INTEGER VcIndex;
2616 KSPIN_LOCK VcCountLock;
2617 LIST_ENTRY WmiEnabledVcs;
2618 PNDIS_GUID pNdisGuidMap;
2619 PNDIS_GUID pCustomGuidMap;
2620 USHORT VcCount;
2621 USHORT cNdisGuidMap;
2622 USHORT cCustomGuidMap;
2623 USHORT CurrentMapRegister;
2624 PKEVENT AllocationEvent;
2625 USHORT BaseMapRegistersNeeded;
2626 USHORT SGMapRegistersNeeded;
2627 ULONG MaximumPhysicalMapping;
2628 NDIS_TIMER MediaDisconnectTimer;
2629 USHORT MediaDisconnectTimeOut;
2630 USHORT InstanceNumber;
2631 NDIS_EVENT OpenReadyEvent;
2632 NDIS_PNP_DEVICE_STATE PnPDeviceState;
2633 NDIS_PNP_DEVICE_STATE OldPnPDeviceState;
2634 PGET_SET_DEVICE_DATA SetBusData;
2635 PGET_SET_DEVICE_DATA GetBusData;
2636 KDPC DeferredDpc;
2637 #if 0
2638 /* FIXME: */
2639 NDIS_STATS NdisStats;
2640 #else
2641 ULONG NdisStats;
2642 #endif
2643 PNDIS_PACKET IndicatedPacket[MAXIMUM_PROCESSORS];
2644 PKEVENT RemoveReadyEvent;
2645 PKEVENT AllOpensClosedEvent;
2646 PKEVENT AllRequestsCompletedEvent;
2647 ULONG InitTimeMs;
2648 NDIS_MINIPORT_WORK_ITEM WorkItemBuffer[NUMBER_OF_SINGLE_WORK_ITEMS];
2649 PDMA_ADAPTER SystemAdapterObject;
2650 ULONG DriverVerifyFlags;
2651 POID_LIST OidList;
2652 USHORT InternalResetCount;
2653 USHORT MiniportResetCount;
2654 USHORT MediaSenseConnectCount;
2655 USHORT MediaSenseDisconnectCount;
2656 PNDIS_PACKET *xPackets;
2657 ULONG UserModeOpenReferences;
2658 _ANONYMOUS_UNION union {
2659 PVOID SavedSendHandler;
2660 PVOID SavedWanSendHandler;
2661 } DUMMYUNIONNAME2;
2662 PVOID SavedSendPacketsHandler;
2663 PVOID SavedCancelSendPacketsHandler;
2664 W_SEND_PACKETS_HANDLER WSendPacketsHandler;
2665 ULONG MiniportAttributes;
2666 PDMA_ADAPTER SavedSystemAdapterObject;
2667 USHORT NumOpens;
2668 USHORT CFHangXTicks;
2669 ULONG RequestCount;
2670 ULONG IndicatedPacketsCount;
2671 ULONG PhysicalMediumType;
2672 PNDIS_REQUEST LastRequest;
2673 LONG DmaAdapterRefCount;
2674 PVOID FakeMac;
2675 ULONG LockDbg;
2676 ULONG LockDbgX;
2677 PVOID LockThread;
2678 ULONG InfoFlags;
2679 KSPIN_LOCK TimerQueueLock;
2680 PKEVENT ResetCompletedEvent;
2681 PKEVENT QueuedBindingCompletedEvent;
2682 PKEVENT DmaResourcesReleasedEvent;
2683 FILTER_PACKET_INDICATION_HANDLER SavedPacketIndicateHandler;
2684 ULONG RegisteredInterrupts;
2685 PNPAGED_LOOKASIDE_LIST SGListLookasideList;
2686 ULONG ScatterGatherListSize;
2687 #endif /* _NDIS_ */
2688 };
2689
2690 #if NDIS_LEGACY_DRIVER
2691
2692 typedef NDIS_STATUS
2693 (NTAPI *WAN_SEND_HANDLER)(
2694 _In_ NDIS_HANDLE MacBindingHandle,
2695 _In_ NDIS_HANDLE LinkHandle,
2696 _In_ PVOID Packet);
2697
2698 typedef VOID
2699 (NTAPI *SEND_PACKETS_HANDLER)(
2700 _In_ NDIS_HANDLE MiniportAdapterContext,
2701 _In_ PPNDIS_PACKET PacketArray,
2702 _In_ UINT NumberOfPackets);
2703
2704 typedef NDIS_STATUS
2705 (NTAPI *SEND_HANDLER)(
2706 _In_ NDIS_HANDLE NdisBindingHandle,
2707 _In_ PNDIS_PACKET Packet);
2708
2709 typedef NDIS_STATUS
2710 (NTAPI *TRANSFER_DATA_HANDLER)(
2711 _In_ NDIS_HANDLE NdisBindingHandle,
2712 _In_ NDIS_HANDLE MacReceiveContext,
2713 _In_ UINT ByteOffset,
2714 _In_ UINT BytesToTransfer,
2715 _Out_ PNDIS_PACKET Packet,
2716 _Out_ PUINT BytesTransferred);
2717
2718 typedef NDIS_STATUS
2719 (NTAPI *RESET_HANDLER)(
2720 _In_ NDIS_HANDLE NdisBindingHandle);
2721
2722 typedef NDIS_STATUS
2723 (NTAPI *REQUEST_HANDLER)(
2724 _In_ NDIS_HANDLE NdisBindingHandle,
2725 _In_ PNDIS_REQUEST NdisRequest);
2726
2727 #endif /* NDIS_LEGACY_DRIVER */
2728
2729 #if defined(NDIS_WRAPPER)
2730 #define NDIS_COMMON_OPEN_BLOCK_WRAPPER_S \
2731 ULONG Flags; \
2732 ULONG References; \
2733 KSPIN_LOCK SpinLock; \
2734 NDIS_HANDLE FilterHandle; \
2735 ULONG ProtocolOptions; \
2736 USHORT CurrentLookahead; \
2737 USHORT ConnectDampTicks; \
2738 USHORT DisconnectDampTicks; \
2739 W_SEND_HANDLER WSendHandler; \
2740 W_TRANSFER_DATA_HANDLER WTransferDataHandler; \
2741 W_SEND_PACKETS_HANDLER WSendPacketsHandler; \
2742 W_CANCEL_SEND_PACKETS_HANDLER CancelSendPacketsHandler; \
2743 ULONG WakeUpEnable; \
2744 PKEVENT CloseCompleteEvent; \
2745 QUEUED_CLOSE QC; \
2746 ULONG AfReferences; \
2747 PNDIS_OPEN_BLOCK NextGlobalOpen;
2748 #else
2749 #define NDIS_COMMON_OPEN_BLOCK_WRAPPER_S
2750 #endif
2751
2752 #define NDIS_COMMON_OPEN_BLOCK_S \
2753 PVOID MacHandle; \
2754 NDIS_HANDLE BindingHandle; \
2755 PNDIS_MINIPORT_BLOCK MiniportHandle; \
2756 PNDIS_PROTOCOL_BLOCK ProtocolHandle; \
2757 NDIS_HANDLE ProtocolBindingContext; \
2758 PNDIS_OPEN_BLOCK MiniportNextOpen; \
2759 PNDIS_OPEN_BLOCK ProtocolNextOpen; \
2760 NDIS_HANDLE MiniportAdapterContext; \
2761 BOOLEAN Reserved1; \
2762 BOOLEAN Reserved2; \
2763 BOOLEAN Reserved3; \
2764 BOOLEAN Reserved4; \
2765 PNDIS_STRING BindDeviceName; \
2766 KSPIN_LOCK Reserved5; \
2767 PNDIS_STRING RootDeviceName; \
2768 _ANONYMOUS_UNION union { \
2769 SEND_HANDLER SendHandler; \
2770 WAN_SEND_HANDLER WanSendHandler; \
2771 } DUMMYUNIONNAME; \
2772 TRANSFER_DATA_HANDLER TransferDataHandler; \
2773 SEND_COMPLETE_HANDLER SendCompleteHandler; \
2774 TRANSFER_DATA_COMPLETE_HANDLER TransferDataCompleteHandler; \
2775 RECEIVE_HANDLER ReceiveHandler; \
2776 RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler; \
2777 WAN_RECEIVE_HANDLER WanReceiveHandler; \
2778 REQUEST_COMPLETE_HANDLER RequestCompleteHandler; \
2779 RECEIVE_PACKET_HANDLER ReceivePacketHandler; \
2780 SEND_PACKETS_HANDLER SendPacketsHandler; \
2781 RESET_HANDLER ResetHandler; \
2782 REQUEST_HANDLER RequestHandler; \
2783 RESET_COMPLETE_HANDLER ResetCompleteHandler; \
2784 STATUS_HANDLER StatusHandler; \
2785 STATUS_COMPLETE_HANDLER StatusCompleteHandler; \
2786 NDIS_COMMON_OPEN_BLOCK_WRAPPER_S
2787
2788 typedef struct _NDIS_COMMON_OPEN_BLOCK {
2789 NDIS_COMMON_OPEN_BLOCK_S
2790 } NDIS_COMMON_OPEN_BLOCK;
2791
2792 struct _NDIS_OPEN_BLOCK
2793 {
2794 #ifdef __cplusplus
2795 NDIS_COMMON_OPEN_BLOCK NdisCommonOpenBlock;
2796 #else
2797 NDIS_COMMON_OPEN_BLOCK_S
2798 #endif
2799 };
2800
2801 #include <xfilter.h>
2802
2803 #define NDIS_M_MAX_LOOKAHEAD 526
2804
2805 _IRQL_requires_max_(DISPATCH_LEVEL)
2806 NDISAPI
2807 VOID
2808 NTAPI
2809 NdisInitializeTimer(
2810 _Inout_ PNDIS_TIMER Timer,
2811 _In_ PNDIS_TIMER_FUNCTION TimerFunction,
2812 _In_opt_ _Points_to_data_ PVOID FunctionContext);
2813
2814 _IRQL_requires_max_(DISPATCH_LEVEL)
2815 NDISAPI
2816 VOID
2817 NTAPI
2818 NdisCancelTimer(
2819 _In_ PNDIS_TIMER Timer,
2820 _Out_ _At_(*TimerCancelled, _Must_inspect_result_) PBOOLEAN TimerCancelled);
2821
2822 _IRQL_requires_max_(DISPATCH_LEVEL)
2823 NDISAPI
2824 VOID
2825 NTAPI
2826 NdisSetTimer(
2827 _In_ PNDIS_TIMER Timer,
2828 _In_ UINT MillisecondsToDelay);
2829
2830 NDISAPI
2831 VOID
2832 NTAPI
2833 NdisSetPeriodicTimer(
2834 _In_ PNDIS_TIMER NdisTimer,
2835 _In_ UINT MillisecondsPeriod);
2836
2837 _IRQL_requires_max_(DISPATCH_LEVEL)
2838 NDISAPI
2839 VOID
2840 NTAPI
2841 NdisSetTimerEx(
2842 _In_ PNDIS_TIMER NdisTimer,
2843 _In_ UINT MillisecondsToDelay,
2844 _In_ PVOID FunctionContext);
2845
2846 _IRQL_requires_(PASSIVE_LEVEL)
2847 NDISAPI
2848 PVOID
2849 NTAPI
2850 NdisGetRoutineAddress(
2851 _In_ PNDIS_STRING NdisRoutineName);
2852
2853 _IRQL_requires_max_(DISPATCH_LEVEL)
2854 NDISAPI
2855 UINT
2856 NTAPI
2857 NdisGetVersion(VOID);
2858
2859 #if NDIS_LEGACY_DRIVER
2860
2861 _IRQL_requires_max_(DISPATCH_LEVEL)
2862 NDISAPI
2863 VOID
2864 NTAPI
2865 NdisAllocateBuffer(
2866 _Out_ PNDIS_STATUS Status,
2867 _Out_ PNDIS_BUFFER *Buffer,
2868 _In_opt_ NDIS_HANDLE PoolHandle,
2869 _In_reads_bytes_(Length) PVOID VirtualAddress,
2870 _In_ UINT Length);
2871
2872 _IRQL_requires_max_(DISPATCH_LEVEL)
2873 NDISAPI
2874 VOID
2875 NTAPI
2876 NdisAllocateBufferPool(
2877 _Out_ PNDIS_STATUS Status,
2878 _Out_ PNDIS_HANDLE PoolHandle,
2879 _In_ UINT NumberOfDescriptors);
2880
2881 _IRQL_requires_max_(DISPATCH_LEVEL)
2882 NDISAPI
2883 VOID
2884 NTAPI
2885 NdisFreeBufferPool(
2886 _In_ NDIS_HANDLE PoolHandle);
2887
2888 /*
2889 NDISAPI
2890 VOID
2891 NTAPI
2892 NdisFreeBuffer(
2893 IN PNDIS_BUFFER Buffer);
2894 */
2895 #define NdisFreeBuffer IoFreeMdl
2896
2897 _IRQL_requires_max_(DISPATCH_LEVEL)
2898 NDISAPI
2899 VOID
2900 NTAPI
2901 NdisAllocatePacketPool(
2902 _Out_ PNDIS_STATUS Status,
2903 _Out_ PNDIS_HANDLE PoolHandle,
2904 _In_ UINT NumberOfDescriptors,
2905 _In_ UINT ProtocolReservedLength);
2906
2907 _IRQL_requires_max_(DISPATCH_LEVEL)
2908 NDISAPI
2909 VOID
2910 NTAPI
2911 NdisAllocatePacketPoolEx(
2912 _Out_ PNDIS_STATUS Status,
2913 _Out_ PNDIS_HANDLE PoolHandle,
2914 _In_ UINT NumberOfDescriptors,
2915 _In_ UINT NumberOfOverflowDescriptors,
2916 _In_ UINT ProtocolReservedLength);
2917
2918 _IRQL_requires_max_(DISPATCH_LEVEL)
2919 NDISAPI
2920 VOID
2921 NTAPI
2922 NdisSetPacketPoolProtocolId(
2923 _In_ NDIS_HANDLE PacketPoolHandle,
2924 _In_ UINT ProtocolId);
2925
2926 _IRQL_requires_max_(DISPATCH_LEVEL)
2927 NDISAPI
2928 UINT
2929 NTAPI
2930 NdisPacketPoolUsage(
2931 _In_ NDIS_HANDLE PoolHandle);
2932
2933 _IRQL_requires_max_(DISPATCH_LEVEL)
2934 NDISAPI
2935 UINT
2936 NTAPI
2937 NdisPacketSize(
2938 _In_ UINT ProtocolReservedSize);
2939
2940 _IRQL_requires_max_(DISPATCH_LEVEL)
2941 NDISAPI
2942 NDIS_HANDLE
2943 NTAPI
2944 NdisGetPoolFromPacket(
2945 _In_ PNDIS_PACKET Packet);
2946
2947 _IRQL_requires_max_(DISPATCH_LEVEL)
2948 NDISAPI
2949 PNDIS_PACKET_STACK
2950 NTAPI
2951 NdisIMGetCurrentPacketStack(
2952 _In_ PNDIS_PACKET Packet,
2953 _Out_ BOOLEAN *StacksRemaining);
2954
2955 _IRQL_requires_max_(DISPATCH_LEVEL)
2956 NDISAPI
2957 VOID
2958 NTAPI
2959 NdisFreePacketPool(
2960 _In_ NDIS_HANDLE PoolHandle);
2961
2962 _IRQL_requires_max_(DISPATCH_LEVEL)
2963 NDISAPI
2964 VOID
2965 NTAPI
2966 NdisFreePacket(
2967 _In_ PNDIS_PACKET Packet);
2968
2969 _IRQL_requires_(DISPATCH_LEVEL)
2970 NDISAPI
2971 VOID
2972 NTAPI
2973 NdisDprFreePacket(
2974 _In_ PNDIS_PACKET Packet);
2975
2976 _IRQL_requires_(DISPATCH_LEVEL)
2977 NDISAPI
2978 VOID
2979 NTAPI
2980 NdisDprFreePacketNonInterlocked(
2981 _In_ PNDIS_PACKET Packet);
2982
2983 _IRQL_requires_max_(DISPATCH_LEVEL)
2984 NDISAPI
2985 VOID
2986 NTAPI
2987 NdisAllocatePacket(
2988 _Out_ PNDIS_STATUS Status,
2989 _Out_ PNDIS_PACKET *Packet,
2990 _In_ NDIS_HANDLE PoolHandle);
2991
2992 _IRQL_requires_(DISPATCH_LEVEL)
2993 NDISAPI
2994 VOID
2995 NTAPI
2996 NdisDprAllocatePacket(
2997 _Out_ PNDIS_STATUS Status,
2998 _Out_ PNDIS_PACKET *Packet,
2999 _In_ NDIS_HANDLE PoolHandle);
3000
3001 _IRQL_requires_(DISPATCH_LEVEL)
3002 NDISAPI
3003 VOID
3004 NTAPI
3005 NdisDprAllocatePacketNonInterlocked(
3006 _Out_ PNDIS_STATUS Status,
3007 _Out_ PNDIS_PACKET *Packet,
3008 _In_ NDIS_HANDLE PoolHandle);
3009
3010 /*
3011 * VOID
3012 * NdisReinitializePacket(
3013 * IN OUT PNDIS_PACKET Packet);
3014 */
3015 #define NdisReinitializePacket(Packet) { \
3016 (Packet)->Private.Head = (PNDIS_BUFFER)NULL; \
3017 (Packet)->Private.ValidCounts = FALSE; \
3018 }
3019
3020 /*
3021 NDISAPI
3022 VOID
3023 NTAPI
3024 NdisQueryBuffer(
3025 IN PNDIS_BUFFER Buffer,
3026 OUT PVOID *VirtualAddress OPTIONAL,
3027 OUT PUINT Length);
3028 */
3029 #define NdisQueryBuffer(_Buffer, _VirtualAddress, _Length) { \
3030 if (ARGUMENT_PRESENT(_VirtualAddress)) { \
3031 *(PVOID *)(_VirtualAddress) = MmGetSystemAddressForMdl(_Buffer); \
3032 } \
3033 *(_Length) = MmGetMdlByteCount(_Buffer); \
3034 }
3035
3036 NDISAPI
3037 VOID
3038 NTAPI
3039 NdisGetFirstBufferFromPacket(
3040 IN PNDIS_PACKET _Packet,
3041 OUT PNDIS_BUFFER *_FirstBuffer,
3042 OUT PVOID *_FirstBufferVA,
3043 OUT PUINT _FirstBufferLength,
3044 OUT PUINT _TotalBufferLength);
3045
3046 /*
3047 * VOID
3048 * NdisGetFirstBufferFromPacketSafe(
3049 * IN PNDIS_PACKET _Packet,
3050 * OUT PNDIS_BUFFER * _FirstBuffer,
3051 * OUT PVOID * _FirstBufferVA,
3052 * OUT PUINT _FirstBufferLength,
3053 * OUT PUINT _TotalBufferLength),
3054 * IN MM_PAGE_PRIORITY _Priority)
3055 */
3056 #define NdisGetFirstBufferFromPacketSafe(_Packet, \
3057 _FirstBuffer, \
3058 _FirstBufferVA, \
3059 _FirstBufferLength, \
3060 _TotalBufferLength, \
3061 _Priority) \
3062 { \
3063 PNDIS_BUFFER _Buffer; \
3064 \
3065 _Buffer = (_Packet)->Private.Head; \
3066 *(_FirstBuffer) = _Buffer; \
3067 if (_Buffer != NULL) { \
3068 *(_FirstBufferVA) = MmGetSystemAddressForMdlSafe(_Buffer, _Priority); \
3069 *(_FirstBufferLength) = MmGetMdlByteCount(_Buffer); \
3070 _Buffer = _Buffer->Next; \
3071 *(_TotalBufferLength) = *(_FirstBufferLength); \
3072 while (_Buffer != NULL) { \
3073 *(_TotalBufferLength) += MmGetMdlByteCount(_Buffer); \
3074 _Buffer = _Buffer->Next; \
3075 } \
3076 } \
3077 else { \
3078 *(_FirstBufferVA) = 0; \
3079 *(_FirstBufferLength) = 0; \
3080 *(_TotalBufferLength) = 0; \
3081 } \
3082 }
3083
3084 /*
3085 * VOID
3086 * NdisRecalculatePacketCounts(
3087 * IN OUT PNDIS_PACKET Packet);
3088 */
3089 #define NdisRecalculatePacketCounts(Packet) { \
3090 PNDIS_BUFFER _Buffer = (Packet)->Private.Head; \
3091 if (_Buffer != NULL) { \
3092 while (_Buffer->Next != NULL) { \
3093 _Buffer = _Buffer->Next; \
3094 } \
3095 (Packet)->Private.Tail = _Buffer; \
3096 } \
3097 (Packet)->Private.ValidCounts = FALSE; \
3098 }
3099
3100 /*
3101 * VOID
3102 * NdisChainBufferAtFront(
3103 * IN OUT PNDIS_PACKET Packet,
3104 * IN OUT PNDIS_BUFFER Buffer)
3105 */
3106 #define NdisChainBufferAtFront(Packet, \
3107 Buffer) \
3108 { \
3109 PNDIS_BUFFER _NdisBuffer = (Buffer); \
3110 \
3111 while (_NdisBuffer->Next != NULL) \
3112 _NdisBuffer = _NdisBuffer->Next; \
3113 \
3114 if ((Packet)->Private.Head == NULL) \
3115 (Packet)->Private.Tail = _NdisBuffer; \
3116 \
3117 _NdisBuffer->Next = (Packet)->Private.Head; \
3118 (Packet)->Private.Head = (Buffer); \
3119 (Packet)->Private.ValidCounts = FALSE; \
3120 }
3121
3122 /*
3123 * VOID
3124 * NdisChainBufferAtBack(
3125 * IN OUT PNDIS_PACKET Packet,
3126 * IN OUT PNDIS_BUFFER Buffer)
3127 */
3128 #define NdisChainBufferAtBack(Packet, \
3129 Buffer) \
3130 { \
3131 PNDIS_BUFFER _NdisBuffer = (Buffer); \
3132 \
3133 while (_NdisBuffer->Next != NULL) \
3134 _NdisBuffer = _NdisBuffer->Next; \
3135 \
3136 _NdisBuffer->Next = NULL; \
3137 \
3138 if ((Packet)->Private.Head != NULL) \
3139 (Packet)->Private.Tail->Next = (Buffer); \
3140 else \
3141 (Packet)->Private.Head = (Buffer); \
3142 \
3143 (Packet)->Private.Tail = _NdisBuffer; \
3144 (Packet)->Private.ValidCounts = FALSE; \
3145 }
3146
3147 NDISAPI
3148 VOID
3149 NTAPI
3150 NdisUnchainBufferAtFront(
3151 IN OUT PNDIS_PACKET Packet,
3152 OUT PNDIS_BUFFER *Buffer);
3153
3154 NDISAPI
3155 VOID
3156 NTAPI
3157 NdisUnchainBufferAtBack(
3158 IN OUT PNDIS_PACKET Packet,
3159 OUT PNDIS_BUFFER *Buffer);
3160
3161 _IRQL_requires_max_(DISPATCH_LEVEL)
3162 NDISAPI
3163 VOID
3164 NTAPI
3165 NdisCopyFromPacketToPacket(
3166 _In_ PNDIS_PACKET Destination,
3167 _In_ UINT DestinationOffset,
3168 _In_ UINT BytesToCopy,
3169 _In_ PNDIS_PACKET Source,
3170 _In_ UINT SourceOffset,
3171 _Out_ PUINT BytesCopied);
3172
3173 NDISAPI
3174 VOID
3175 NTAPI
3176 NdisCopyFromPacketToPacketSafe(
3177 IN PNDIS_PACKET Destination,
3178 IN UINT DestinationOffset,
3179 IN UINT BytesToCopy,
3180 IN PNDIS_PACKET Source,
3181 IN UINT SourceOffset,
3182 OUT PUINT BytesCopied,
3183 IN MM_PAGE_PRIORITY Priority);
3184
3185 _IRQL_requires_max_(DISPATCH_LEVEL)
3186 __drv_preferredFunction("NdisAllocateMemoryWithTag", "Obsolete")
3187 NDISAPI
3188 NDIS_STATUS
3189 NTAPI
3190 NdisAllocateMemory(
3191 _At_(*VirtualAddress, __drv_allocatesMem(Mem)) _Outptr_result_bytebuffer_(Length)
3192 PVOID *VirtualAddress,
3193 _In_ UINT Length,
3194 _In_ UINT MemoryFlags,
3195 _In_ NDIS_PHYSICAL_ADDRESS HighestAcceptableAddress);
3196
3197 #define NdisInitializeWorkItem(_WI_, _R_, _C_) { \
3198 (_WI_)->Context = _C_; \
3199 (_WI_)->Routine = _R_; \
3200 }
3201
3202 _IRQL_requires_max_(DISPATCH_LEVEL)
3203 NDISAPI
3204 NDIS_STATUS
3205 NTAPI
3206 NdisScheduleWorkItem(
3207 _In_ __drv_aliasesMem PNDIS_WORK_ITEM WorkItem);
3208
3209 _IRQL_requires_max_(DISPATCH_LEVEL)
3210 NDISAPI
3211 VOID
3212 NTAPI
3213 NdisSetPacketStatus(
3214 _In_ PNDIS_PACKET Packet,
3215 _In_ NDIS_STATUS Status,
3216 _In_ NDIS_HANDLE Handle,
3217 _In_ ULONG Code);
3218
3219 #endif /* NDIS_LEGACY_DRIVER */
3220
3221 _IRQL_requires_(PASSIVE_LEVEL)
3222 NDISAPI
3223 VOID
3224 NTAPI
3225 NdisOpenFile(
3226 _Out_ PNDIS_STATUS Status,
3227 _Out_ PNDIS_HANDLE FileHandle,
3228 _Out_ PUINT FileLength,
3229 _In_ PNDIS_STRING FileName,
3230 _In_ NDIS_PHYSICAL_ADDRESS HighestAcceptableAddress);
3231
3232 _IRQL_requires_(PASSIVE_LEVEL)
3233 NDISAPI
3234 VOID
3235 NTAPI
3236 NdisCloseFile(
3237 _In_ NDIS_HANDLE FileHandle);
3238
3239 _IRQL_requires_max_(DISPATCH_LEVEL)
3240 NDISAPI
3241 VOID
3242 NTAPI
3243 NdisMapFile(
3244 _Out_ PNDIS_STATUS Status,
3245 _Out_ PVOID *MappedBuffer,
3246 _In_ NDIS_HANDLE FileHandle);
3247
3248 _IRQL_requires_(PASSIVE_LEVEL)
3249 NDISAPI
3250 VOID
3251 NTAPI
3252 NdisUnmapFile(
3253 _In_ NDIS_HANDLE FileHandle);
3254
3255 _IRQL_requires_max_(DISPATCH_LEVEL)
3256 NDISAPI
3257 ULONG
3258 NTAPI
3259 NdisGetSharedDataAlignment(VOID);
3260
3261 #define NdisFlushBuffer(Buffer,WriteToDevice) \
3262 KeFlushIoBuffers((Buffer),!(WriteToDevice), TRUE)
3263
3264 _IRQL_requires_max_(DISPATCH_LEVEL)
3265 NDISAPI
3266 VOID
3267 NTAPI
3268 NdisCopyBuffer(
3269 _Out_ PNDIS_STATUS Status,
3270 _Out_ PNDIS_BUFFER *Buffer,
3271 _In_ NDIS_HANDLE PoolHandle,
3272 _In_ PVOID MemoryDescriptor,
3273 _In_ UINT Offset,
3274 _In_ UINT Length);
3275
3276 /*
3277 * VOID
3278 * NdisCopyLookaheadData(
3279 * IN PVOID Destination,
3280 * IN PVOID Source,
3281 * IN ULONG Length,
3282 * IN ULONG ReceiveFlags);
3283 */
3284
3285 #if defined(_M_IX86) || defined(_M_AMD64)
3286 #define NdisCopyLookaheadData(Destination, Source, Length, MacOptions) \
3287 RtlCopyMemory(Destination, Source, Length)
3288 #else
3289 #define NdisCopyLookaheadData(Destination, Source, Length, MacOptions) \
3290 { \
3291 if ((MacOptions) & NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA) \
3292 { \
3293 RtlCopyMemory(Destination, Source, Length); \
3294 } \
3295 else \
3296 { \
3297 PUCHAR _Src = (PUCHAR)(Source); \
3298 PUCHAR _Dest = (PUCHAR)(Destination); \
3299 PUCHAR _End = _Dest + (Length); \
3300 while (_Dest < _End) \
3301 *_Dest++ = *_Src++; \
3302 } \
3303 }
3304 #endif
3305
3306 /*
3307 NDISAPI
3308 VOID
3309 NTAPI
3310 NdisAdjustBufferLength(
3311 IN PNDIS_BUFFER Buffer,
3312 IN UINT Length);
3313 */
3314 #define NdisAdjustBufferLength(Buffer, Length) \
3315 (((Buffer)->ByteCount) = (Length))
3316
3317 #if NDIS_SUPPORT_NDIS6
3318 #define NdisAdjustMdlLength(_Mdl, _Length) \
3319 (((_Mdl)->ByteCount) = (_Length))
3320 #endif
3321
3322 /*
3323 NDISAPI
3324 ULONG
3325 NTAPI
3326 NdisBufferLength(
3327 IN PNDIS_BUFFER Buffer);
3328 */
3329 #define NdisBufferLength MmGetMdlByteCount
3330
3331 /*
3332 NDISAPI
3333 PVOID
3334 NTAPI
3335 NdisBufferVirtualAddress(
3336 IN PNDIS_BUFFER Buffer);
3337 */
3338 #define NdisBufferVirtualAddress MmGetSystemAddressForMdl
3339
3340 #define NdisBufferVirtualAddressSafe MmGetSystemAddressForMdlSafe
3341
3342 NDISAPI
3343 ULONG
3344 NTAPI
3345 NDIS_BUFFER_TO_SPAN_PAGES(
3346 IN PNDIS_BUFFER Buffer);
3347
3348 /*
3349 NDISAPI
3350 VOID
3351 NTAPI
3352 NdisGetBufferPhysicalArraySize(
3353 IN PNDIS_BUFFER Buffer,
3354 OUT PUINT ArraySize);
3355 */
3356 #define NdisGetBufferPhysicalArraySize(Buffer, ArraySize) \
3357 (*(ArraySize) = NDIS_BUFFER_TO_SPAN_PAGES(Buffer))
3358
3359 /*
3360 NDISAPI
3361 VOID
3362 NTAPI
3363 NdisQueryBufferOffset(
3364 IN PNDIS_BUFFER Buffer,
3365 OUT PUINT Offset,
3366 OUT PUINT Length);
3367 */
3368 #define NdisQueryBufferOffset(_Buffer, _Offset, _Length) { \
3369 *(_Offset) = MmGetMdlByteOffset(_Buffer); \
3370 *(_Length) = MmGetMdlByteCount(_Buffer); \
3371 }
3372
3373 /*
3374 * PVOID
3375 * NDIS_BUFFER_LINKAGE(
3376 * IN PNDIS_BUFFER Buffer);
3377 */
3378 #define NDIS_BUFFER_LINKAGE(Buffer) (Buffer)->Next
3379
3380 /*
3381 * VOID
3382 * NdisGetNextBuffer(
3383 * IN PNDIS_BUFFER CurrentBuffer,
3384 * OUT PNDIS_BUFFER * NextBuffer)
3385 */
3386 #define NdisGetNextBuffer(CurrentBuffer, \
3387 NextBuffer) \
3388 { \
3389 *(NextBuffer) = (CurrentBuffer)->Next; \
3390 }
3391
3392 #if NDIS_LEGACY_DRIVER
3393
3394 #define NDIS_PACKET_FIRST_NDIS_BUFFER(_Packet) ((_Packet)->Private.Head)
3395 #define NDIS_PACKET_LAST_NDIS_BUFFER(_Packet) ((_Packet)->Private.Tail)
3396 #define NDIS_PACKET_VALID_COUNTS(_Packet) ((_Packet)->Private.ValidCounts)
3397
3398 /*
3399 * UINT
3400 * NdisGetPacketFlags(
3401 * IN PNDIS_PACKET Packet);
3402 */
3403 #define NdisGetPacketFlags(Packet) (Packet)->Private.Flags
3404
3405 /*
3406 * ULONG
3407 * NDIS_GET_PACKET_PROTOCOL_TYPE(
3408 * IN PNDIS_PACKET Packet);
3409 */
3410 #define NDIS_GET_PACKET_PROTOCOL_TYPE(_Packet) \
3411 ((_Packet)->Private.Flags & NDIS_PROTOCOL_ID_MASK)
3412
3413 /*
3414 * PNDIS_PACKET_OOB_DATA
3415 * NDIS_OOB_DATA_FROM_PACKET(
3416 * IN PNDIS_PACKET Packet);
3417 */
3418 #define NDIS_OOB_DATA_FROM_PACKET(_Packet) \
3419 (PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3420 (_Packet)->Private.NdisPacketOobOffset)
3421
3422 /*
3423 * ULONG
3424 * NDIS_GET_PACKET_HEADER_SIZE(
3425 * IN PNDIS_PACKET Packet);
3426 */
3427 #define NDIS_GET_PACKET_HEADER_SIZE(_Packet) \
3428 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3429 (_Packet)->Private.NdisPacketOobOffset))->HeaderSize
3430
3431 /*
3432 * NDIS_STATUS
3433 * NDIS_GET_PACKET_STATUS(
3434 * IN PNDIS_PACKET Packet);
3435 */
3436 #define NDIS_GET_PACKET_STATUS(_Packet) \
3437 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3438 (_Packet)->Private.NdisPacketOobOffset))->Status
3439
3440 /*
3441 * ULONGLONG
3442 * NDIS_GET_PACKET_TIME_TO_SEND(
3443 * IN PNDIS_PACKET Packet);
3444 */
3445 #define NDIS_GET_PACKET_TIME_TO_SEND(_Packet) \
3446 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3447 (_Packet)->Private.NdisPacketOobOffset))->TimeToSend
3448
3449 /*
3450 * ULONGLONG
3451 * NDIS_GET_PACKET_TIME_SENT(
3452 * IN PNDIS_PACKET Packet);
3453 */
3454 #define NDIS_GET_PACKET_TIME_SENT(_Packet) \
3455 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3456 (_Packet)->Private.NdisPacketOobOffset))->TimeSent
3457
3458 /*
3459 * ULONGLONG
3460 * NDIS_GET_PACKET_TIME_RECEIVED(
3461 * IN PNDIS_PACKET Packet);
3462 */
3463 #define NDIS_GET_PACKET_TIME_RECEIVED(_Packet) \
3464 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3465 (_Packet)->Private.NdisPacketOobOffset))->TimeReceived
3466
3467 /*
3468 * VOID
3469 * NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO(
3470 * IN PNDIS_PACKET Packet,
3471 * IN PPVOID pMediaSpecificInfo,
3472 * IN PUINT pSizeMediaSpecificInfo);
3473 */
3474 #define NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO(_Packet, \
3475 _pMediaSpecificInfo, \
3476 _pSizeMediaSpecificInfo) \
3477 { \
3478 if (!((_Packet)->Private.NdisPacketFlags & fPACKET_ALLOCATED_BY_NDIS) || \
3479 !((_Packet)->Private.NdisPacketFlags & fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO)) \
3480 { \
3481 *(_pMediaSpecificInfo) = NULL; \
3482 *(_pSizeMediaSpecificInfo) = 0; \
3483 } \
3484 else \
3485 { \
3486 *(_pMediaSpecificInfo) = ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3487 (_Packet)->Private.NdisPacketOobOffset))->MediaSpecificInformation; \
3488 *(_pSizeMediaSpecificInfo) = ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3489 (_Packet)->Private.NdisPacketOobOffset))->SizeMediaSpecificInfo; \
3490 } \
3491 }
3492
3493 /*
3494 * VOID
3495 * NDIS_SET_PACKET_HEADER_SIZE(
3496 * IN PNDIS_PACKET Packet,
3497 * IN UINT HdrSize);
3498 */
3499 #define NDIS_SET_PACKET_HEADER_SIZE(_Packet, _HdrSize) \
3500 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3501 (_Packet)->Private.NdisPacketOobOffset))->HeaderSize = (_HdrSize)
3502
3503 /*
3504 * VOID
3505 * NDIS_SET_PACKET_STATUS(
3506 * IN PNDIS_PACKET Packet,
3507 * IN NDIS_STATUS Status);
3508 */
3509 #define NDIS_SET_PACKET_STATUS(_Packet, _Status) \
3510 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3511 (_Packet)->Private.NdisPacketOobOffset))->Status = (_Status)
3512
3513 /*
3514 * VOID
3515 * NDIS_SET_PACKET_TIME_TO_SEND(
3516 * IN PNDIS_PACKET Packet,
3517 * IN ULONGLONG TimeToSend);
3518 */
3519 #define NDIS_SET_PACKET_TIME_TO_SEND(_Packet, _TimeToSend) \
3520 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3521 (_Packet)->Private.NdisPacketOobOffset))->TimeToSend = (_TimeToSend)
3522
3523 /*
3524 * VOID
3525 * NDIS_SET_PACKET_TIME_SENT(
3526 * IN PNDIS_PACKET Packet,
3527 * IN ULONGLONG TimeSent);
3528 */
3529 #define NDIS_SET_PACKET_TIME_SENT(_Packet, _TimeSent) \
3530 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3531 (_Packet)->Private.NdisPacketOobOffset))->TimeSent = (_TimeSent)
3532
3533 /*
3534 * VOID
3535 * NDIS_SET_PACKET_TIME_RECEIVED(
3536 * IN PNDIS_PACKET Packet,
3537 * IN ULONGLONG TimeReceived);
3538 */
3539 #define NDIS_SET_PACKET_TIME_RECEIVED(_Packet, _TimeReceived) \
3540 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3541 (_Packet)->Private.NdisPacketOobOffset))->TimeReceived = (_TimeReceived)
3542
3543 /*
3544 * VOID
3545 * NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO(
3546 * IN PNDIS_PACKET Packet,
3547 * IN PVOID MediaSpecificInfo,
3548 * IN UINT SizeMediaSpecificInfo);
3549 */
3550 #define NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO(_Packet, \
3551 _MediaSpecificInfo, \
3552 _SizeMediaSpecificInfo) \
3553 { \
3554 if ((_Packet)->Private.NdisPacketFlags & fPACKET_ALLOCATED_BY_NDIS) \
3555 { \
3556 (_Packet)->Private.NdisPacketFlags |= fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO; \
3557 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3558 (_Packet)->Private.NdisPacketOobOffset))->MediaSpecificInformation = \
3559 (_MediaSpecificInfo); \
3560 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
3561 (_Packet)->Private.NdisPacketOobOffset))->SizeMediaSpecificInfo = \
3562 (_SizeMediaSpecificInfo); \
3563 } \
3564 }
3565
3566 /*
3567 * VOID
3568 * NdisSetPacketFlags(
3569 * IN PNDIS_PACKET Packet,
3570 * IN UINT Flags);
3571 */
3572 #define NdisSetPacketFlags(Packet, Flags) (Packet)->Private.Flags |= (Flags)
3573
3574 /*
3575 * VOID
3576 * NdisClearPacketFlags(
3577 * IN PNDIS_PACKET Packet,
3578 * IN UINT Flags);
3579 */
3580 #define NdisClearPacketFlags(Packet, Flags) (Packet)->Private.Flags &= ~(Flags)
3581
3582 /*
3583 * VOID
3584 * NdisQueryPacket(
3585 * IN PNDIS_PACKET Packet,
3586 * OUT PUINT PhysicalBufferCount OPTIONAL,
3587 * OUT PUINT BufferCount OPTIONAL,
3588 * OUT PNDIS_BUFFER *FirstBuffer OPTIONAL,
3589 * OUT PUINT TotalPacketLength OPTIONAL);
3590 */
3591 static __inline
3592 VOID
3593 NdisQueryPacket(
3594 IN PNDIS_PACKET Packet,
3595 OUT PUINT PhysicalBufferCount OPTIONAL,
3596 OUT PUINT BufferCount OPTIONAL,
3597 OUT PNDIS_BUFFER *FirstBuffer OPTIONAL,
3598 OUT PUINT TotalPacketLength OPTIONAL)
3599 {
3600 if (FirstBuffer)
3601 *FirstBuffer = Packet->Private.Head;
3602 if (TotalPacketLength || BufferCount || PhysicalBufferCount) {
3603 if (!Packet->Private.ValidCounts) {
3604 UINT Offset;
3605 UINT PacketLength;
3606 PNDIS_BUFFER NdisBuffer;
3607 UINT _PhysicalBufferCount = 0;
3608 UINT _TotalPacketLength = 0;
3609 UINT Count = 0;
3610
3611 for (NdisBuffer = Packet->Private.Head;
3612 NdisBuffer != (PNDIS_BUFFER)NULL;
3613 NdisBuffer = NdisBuffer->Next) {
3614 _PhysicalBufferCount += NDIS_BUFFER_TO_SPAN_PAGES(NdisBuffer);
3615 NdisQueryBufferOffset(NdisBuffer, &Offset, &PacketLength);
3616 _TotalPacketLength += PacketLength;
3617 Count++;
3618 }
3619 Packet->Private.PhysicalCount = _PhysicalBufferCount;
3620 Packet->Private.TotalLength = _TotalPacketLength;
3621 Packet->Private.Count = Count;
3622 Packet->Private.ValidCounts = TRUE;
3623 }
3624
3625 if (PhysicalBufferCount)
3626 *PhysicalBufferCount = Packet->Private.PhysicalCount;
3627
3628 if (BufferCount)
3629 *BufferCount = Packet->Private.Count;
3630
3631 if (TotalPacketLength)
3632 *TotalPacketLength = Packet->Private.TotalLength;
3633 }
3634 }
3635
3636 /*
3637 * VOID
3638 * NdisQueryPacketLength(
3639 * IN PNDIS_PACKET Packet,
3640 * OUT PUINT PhysicalBufferCount OPTIONAL,
3641 * OUT PUINT BufferCount OPTIONAL,
3642 * OUT PNDIS_BUFFER *FirstBuffer OPTIONAL,
3643 * OUT PUINT TotalPacketLength OPTIONAL);
3644 */
3645 #define NdisQueryPacketLength(_Packet, \
3646 _TotalPacketLength) \
3647 { \
3648 if (!(_Packet)->Private.ValidCounts) { \
3649 NdisQueryPacket(_Packet, NULL, NULL, NULL, _TotalPacketLength); \
3650 } \
3651 else *(_TotalPacketLength) = (_Packet)->Private.TotalLength; \
3652 }
3653
3654 #endif /* NDIS_LEGACY_DRIVER */
3655
3656 /* Memory management routines */
3657
3658 /*
3659 NDISAPI
3660 VOID
3661 NTAPI
3662 NdisCreateLookaheadBufferFromSharedMemory(
3663 IN PVOID pSharedMemory,
3664 IN UINT LookaheadLength,
3665 OUT PVOID *pLookaheadBuffer);
3666 */
3667 #define NdisCreateLookaheadBufferFromSharedMemory(_S, _L, _B) ((*(_B)) = (_S))
3668
3669 NDISAPI
3670 VOID
3671 NTAPI
3672 NdisDestroyLookaheadBufferFromSharedMemory(
3673 IN PVOID pLookaheadBuffer);
3674
3675 #if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_ARM) || defined(_M_PPC)
3676
3677 /*
3678 * VOID
3679 * NdisMoveMappedMemory(
3680 * OUT PVOID Destination,
3681 * IN PVOID Source,
3682 * IN ULONG Length);
3683 */
3684 #define NdisMoveMappedMemory(Destination, Source, Length) \
3685 RtlCopyMemory(Destination, Source, Length)
3686
3687 /*
3688 * VOID
3689 * NdisZeroMappedMemory(
3690 * IN PVOID Destination,
3691 * IN ULONG Length);
3692 */
3693 #define NdisZeroMappedMemory(Destination, Length) \
3694 RtlZeroMemory(Destination, Length)
3695
3696 #else
3697
3698 #define NdisMoveMappedMemory(Destination, Source, Length) \
3699 { \
3700 PUCHAR _Dest = Destination, _Src = Source, _End = _Dest + Length; \
3701 while (_Dest < _End) \
3702 *_Dest++ = _Src++; \
3703 }
3704
3705 #define NdisZeroMappedMemory(Destination, Length) \
3706 { \
3707 PUCHAR _Dest = Destination, _End = _Dest + Length; \
3708 while (_Dest < _End) \
3709 *_Dest++ = 0; \
3710 }
3711
3712 #endif /* _M_IX86 or _M_AMD64 */
3713
3714 /*
3715 * VOID
3716 * NdisMoveFromMappedMemory(
3717 * OUT PVOID Destination,
3718 * IN PVOID Source,
3719 * IN ULONG Length);
3720 */
3721 #define NdisMoveFromMappedMemory(Destination, Source, Length) \
3722 NdisMoveMappedMemory(Destination, Source, Length)
3723
3724 /*
3725 * VOID
3726 * NdisMoveToMappedMemory(
3727 * OUT PVOID Destination,
3728 * IN PVOID Source,
3729 * IN ULONG Length);
3730 */
3731 #define NdisMoveToMappedMemory(Destination, Source, Length) \
3732 NdisMoveMappedMemory(Destination, Source, Length)
3733
3734 /*
3735 * VOID
3736 * NdisMUpdateSharedMemory(
3737 * IN NDIS_HANDLE MiniportAdapterHandle,
3738 * IN ULONG Length,
3739 * IN PVOID VirtualAddress,
3740 * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
3741 */
3742 #define NdisMUpdateSharedMemory(_H, _L, _V, _P) \
3743 NdisUpdateSharedMemory(_H, _L, _V, _P)
3744
3745 _When_(MemoryFlags==0, _IRQL_requires_max_(DISPATCH_LEVEL))
3746 _When_(MemoryFlags==NDIS_MEMORY_CONTIGUOUS, _IRQL_requires_(PASSIVE_LEVEL))
3747 _When_(MemoryFlags==NDIS_MEMORY_NONCACHED, _IRQL_requires_max_(APC_LEVEL))
3748 NDISAPI
3749 VOID
3750 NTAPI
3751 NdisFreeMemory(
3752 _In_reads_bytes_(Length) __drv_freesMem(Mem) PVOID VirtualAddress,
3753 _In_ UINT Length,
3754 _In_ _Pre_satisfies_(MemoryFlags == 0 || MemoryFlags == NDIS_MEMORY_NONCACHED || MemoryFlags == NDIS_MEMORY_CONTIGUOUS)
3755 UINT MemoryFlags);
3756
3757 NDISAPI
3758 VOID
3759 NTAPI
3760 NdisFreeMemoryWithTag(
3761 IN PVOID VirtualAddress,
3762 IN ULONG Tag);
3763
3764 NDISAPI
3765 VOID
3766 NTAPI
3767 NdisImmediateReadSharedMemory(
3768 IN NDIS_HANDLE WrapperConfigurationContext,
3769 IN ULONG SharedMemoryAddress,
3770 OUT PUCHAR Buffer,
3771 IN ULONG Length);
3772
3773 NDISAPI
3774 VOID
3775 NTAPI
3776 NdisImmediateWriteSharedMemory(
3777 IN NDIS_HANDLE WrapperConfigurationContext,
3778 IN ULONG SharedMemoryAddress,
3779 IN PUCHAR Buffer,
3780 IN ULONG Length);
3781
3782 _IRQL_requires_(PASSIVE_LEVEL)
3783 NDISAPI
3784 VOID
3785 NTAPI
3786 NdisMAllocateSharedMemory(
3787 _In_ NDIS_HANDLE MiniportAdapterHandle,
3788 _In_ ULONG Length,
3789 _In_ BOOLEAN Cached,
3790 _Outptr_result_bytebuffer_(Length) _At_(*VirtualAddress, _Must_inspect_result_)
3791 PVOID *VirtualAddress,
3792 _Out_ _At_(*PhysicalAddress, _Must_inspect_result_)
3793 PNDIS_PHYSICAL_ADDRESS PhysicalAddress);
3794
3795 _IRQL_requires_max_(DISPATCH_LEVEL)
3796 NDISAPI
3797 NDIS_STATUS
3798 NTAPI
3799 NdisMAllocateSharedMemoryAsync(
3800 _In_ NDIS_HANDLE MiniportAdapterHandle,
3801 _In_ ULONG Length,
3802 _In_ BOOLEAN Cached,
3803 _In_ PVOID Context);
3804
3805 #if defined(NDIS50)
3806
3807 #define NdisUpdateSharedMemory(NdisAdapterHandle, \
3808 Length, \
3809 VirtualAddress, \
3810 PhysicalAddress)
3811
3812 #else
3813
3814 NDISAPI
3815 VOID
3816 NTAPI
3817 NdisUpdateSharedMemory(
3818 IN NDIS_HANDLE NdisAdapterHandle,
3819 IN ULONG Length,
3820 IN PVOID VirtualAddress,
3821 IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
3822
3823 #endif /* defined(NDIS50) */
3824
3825 /*
3826 * ULONG
3827 * NdisGetPhysicalAddressHigh(