Work around MinGW mangling of "host:/path"
[msysgit/historical-msysgit.git] / mingw / include / ddk / ndis.h
blobce573ac3c96e0aa3ad2f8e829a4d4b30dc957ad1
1 /*
2 * ndis.h
4 * Network Device Interface Specification definitions
6 * This file is part of the w32api package.
8 * Contributors:
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
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.
21 * DEFINES: i386 - Target platform is i386
22 * _NDIS_ - 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 * NDIS50_MINIPORT - Building NDIS 5.0 miniport driver
27 * NDIS51_MINIPORT - Building NDIS 5.1 miniport driver
29 #ifndef __NDIS_H
30 #define __NDIS_H
32 #if __GNUC__ >=3
33 #pragma GCC system_header
34 #endif
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
40 #include "ntddk.h"
41 #include "ntddndis.h"
42 #include "netpnp.h"
43 #include "netevent.h"
44 #include <winsock2.h>
46 #if defined(_NDIS_)
47 #define NDISAPI DECLSPEC_EXPORT
48 #else
49 #define NDISAPI DECLSPEC_IMPORT
50 #endif
52 #if defined(NDIS50_MINIPORT)
53 #ifndef NDIS50
54 #define NDIS50
55 #endif
56 #endif /* NDIS50_MINIPORT */
58 #if defined(NDIS51_MINIPORT)
59 #ifndef NDIS51
60 #define NDIS51
61 #endif
62 #endif /* NDIS51_MINIPORT */
64 /* NDIS 3.0 is default */
65 #if !defined(NDIS30) || !defined(NDIS40) || !defined(NDIS50) || !defined(NDIS51)
66 #define NDIS30
67 #endif /* !NDIS30 || !NDIS40 || !NDIS50 || !NDIS51 */
69 #if 1
70 /* FIXME: */
71 typedef PVOID QUEUED_CLOSE;
72 #endif
74 typedef ULONG NDIS_OID, *PNDIS_OID;
76 typedef struct _X_FILTER FDDI_FILTER, *PFDDI_FILTER;
77 typedef struct _X_FILTER TR_FILTER, *PTR_FILTER;
78 typedef struct _X_FILTER NULL_FILTER, *PNULL_FILTER;
80 typedef struct _REFERENCE {
81 KSPIN_LOCK SpinLock;
82 USHORT ReferenceCount;
83 BOOLEAN Closing;
84 } REFERENCE, * PREFERENCE;
87 /* NDIS base types */
89 typedef struct _NDIS_SPIN_LOCK {
90 KSPIN_LOCK SpinLock;
91 KIRQL OldIrql;
92 } NDIS_SPIN_LOCK, * PNDIS_SPIN_LOCK;
94 typedef struct _NDIS_EVENT {
95 KEVENT Event;
96 } NDIS_EVENT, *PNDIS_EVENT;
98 typedef PVOID NDIS_HANDLE, *PNDIS_HANDLE;
99 typedef int NDIS_STATUS, *PNDIS_STATUS;
101 typedef ANSI_STRING NDIS_ANSI_STRING, *PNDIS_ANSI_STRING;
102 typedef UNICODE_STRING NDIS_STRING, *PNDIS_STRING;
104 typedef MDL NDIS_BUFFER, *PNDIS_BUFFER;
105 typedef ULONG NDIS_ERROR_CODE, *PNDIS_ERROR_CODE;
108 /* NDIS_STATUS constants */
109 #define NDIS_STATUS_SUCCESS ((NDIS_STATUS)STATUS_SUCCESS)
110 #define NDIS_STATUS_PENDING ((NDIS_STATUS)STATUS_PENDING)
111 #define NDIS_STATUS_NOT_RECOGNIZED ((NDIS_STATUS)0x00010001L)
112 #define NDIS_STATUS_NOT_COPIED ((NDIS_STATUS)0x00010002L)
113 #define NDIS_STATUS_NOT_ACCEPTED ((NDIS_STATUS)0x00010003L)
114 #define NDIS_STATUS_CALL_ACTIVE ((NDIS_STATUS)0x00010007L)
115 #define NDIS_STATUS_ONLINE ((NDIS_STATUS)0x40010003L)
116 #define NDIS_STATUS_RESET_START ((NDIS_STATUS)0x40010004L)
117 #define NDIS_STATUS_RESET_END ((NDIS_STATUS)0x40010005L)
118 #define NDIS_STATUS_RING_STATUS ((NDIS_STATUS)0x40010006L)
119 #define NDIS_STATUS_CLOSED ((NDIS_STATUS)0x40010007L)
120 #define NDIS_STATUS_WAN_LINE_UP ((NDIS_STATUS)0x40010008L)
121 #define NDIS_STATUS_WAN_LINE_DOWN ((NDIS_STATUS)0x40010009L)
122 #define NDIS_STATUS_WAN_FRAGMENT ((NDIS_STATUS)0x4001000AL)
123 #define NDIS_STATUS_MEDIA_CONNECT ((NDIS_STATUS)0x4001000BL)
124 #define NDIS_STATUS_MEDIA_DISCONNECT ((NDIS_STATUS)0x4001000CL)
125 #define NDIS_STATUS_HARDWARE_LINE_UP ((NDIS_STATUS)0x4001000DL)
126 #define NDIS_STATUS_HARDWARE_LINE_DOWN ((NDIS_STATUS)0x4001000EL)
127 #define NDIS_STATUS_INTERFACE_UP ((NDIS_STATUS)0x4001000FL)
128 #define NDIS_STATUS_INTERFACE_DOWN ((NDIS_STATUS)0x40010010L)
129 #define NDIS_STATUS_MEDIA_BUSY ((NDIS_STATUS)0x40010011L)
130 #define NDIS_STATUS_MEDIA_SPECIFIC_INDICATION ((NDIS_STATUS)0x40010012L)
131 #define NDIS_STATUS_WW_INDICATION NDIS_STATUS_MEDIA_SPECIFIC_INDICATION
132 #define NDIS_STATUS_LINK_SPEED_CHANGE ((NDIS_STATUS)0x40010013L)
133 #define NDIS_STATUS_WAN_GET_STATS ((NDIS_STATUS)0x40010014L)
134 #define NDIS_STATUS_WAN_CO_FRAGMENT ((NDIS_STATUS)0x40010015L)
135 #define NDIS_STATUS_WAN_CO_LINKPARAMS ((NDIS_STATUS)0x40010016L)
137 #define NDIS_STATUS_NOT_RESETTABLE ((NDIS_STATUS)0x80010001L)
138 #define NDIS_STATUS_SOFT_ERRORS ((NDIS_STATUS)0x80010003L)
139 #define NDIS_STATUS_HARD_ERRORS ((NDIS_STATUS)0x80010004L)
140 #define NDIS_STATUS_BUFFER_OVERFLOW ((NDIS_STATUS)STATUS_BUFFER_OVERFLOW)
142 #define NDIS_STATUS_FAILURE ((NDIS_STATUS)STATUS_UNSUCCESSFUL)
143 #define NDIS_STATUS_RESOURCES ((NDIS_STATUS)STATUS_INSUFFICIENT_RESOURCES)
144 #define NDIS_STATUS_CLOSING ((NDIS_STATUS)0xC0010002L)
145 #define NDIS_STATUS_BAD_VERSION ((NDIS_STATUS)0xC0010004L)
146 #define NDIS_STATUS_BAD_CHARACTERISTICS ((NDIS_STATUS)0xC0010005L)
147 #define NDIS_STATUS_ADAPTER_NOT_FOUND ((NDIS_STATUS)0xC0010006L)
148 #define NDIS_STATUS_OPEN_FAILED ((NDIS_STATUS)0xC0010007L)
149 #define NDIS_STATUS_DEVICE_FAILED ((NDIS_STATUS)0xC0010008L)
150 #define NDIS_STATUS_MULTICAST_FULL ((NDIS_STATUS)0xC0010009L)
151 #define NDIS_STATUS_MULTICAST_EXISTS ((NDIS_STATUS)0xC001000AL)
152 #define NDIS_STATUS_MULTICAST_NOT_FOUND ((NDIS_STATUS)0xC001000BL)
153 #define NDIS_STATUS_REQUEST_ABORTED ((NDIS_STATUS)0xC001000CL)
154 #define NDIS_STATUS_RESET_IN_PROGRESS ((NDIS_STATUS)0xC001000DL)
155 #define NDIS_STATUS_CLOSING_INDICATING ((NDIS_STATUS)0xC001000EL)
156 #define NDIS_STATUS_NOT_SUPPORTED ((NDIS_STATUS)STATUS_NOT_SUPPORTED)
157 #define NDIS_STATUS_INVALID_PACKET ((NDIS_STATUS)0xC001000FL)
158 #define NDIS_STATUS_OPEN_LIST_FULL ((NDIS_STATUS)0xC0010010L)
159 #define NDIS_STATUS_ADAPTER_NOT_READY ((NDIS_STATUS)0xC0010011L)
160 #define NDIS_STATUS_ADAPTER_NOT_OPEN ((NDIS_STATUS)0xC0010012L)
161 #define NDIS_STATUS_NOT_INDICATING ((NDIS_STATUS)0xC0010013L)
162 #define NDIS_STATUS_INVALID_LENGTH ((NDIS_STATUS)0xC0010014L)
163 #define NDIS_STATUS_INVALID_DATA ((NDIS_STATUS)0xC0010015L)
164 #define NDIS_STATUS_BUFFER_TOO_SHORT ((NDIS_STATUS)0xC0010016L)
165 #define NDIS_STATUS_INVALID_OID ((NDIS_STATUS)0xC0010017L)
166 #define NDIS_STATUS_ADAPTER_REMOVED ((NDIS_STATUS)0xC0010018L)
167 #define NDIS_STATUS_UNSUPPORTED_MEDIA ((NDIS_STATUS)0xC0010019L)
168 #define NDIS_STATUS_GROUP_ADDRESS_IN_USE ((NDIS_STATUS)0xC001001AL)
169 #define NDIS_STATUS_FILE_NOT_FOUND ((NDIS_STATUS)0xC001001BL)
170 #define NDIS_STATUS_ERROR_READING_FILE ((NDIS_STATUS)0xC001001CL)
171 #define NDIS_STATUS_ALREADY_MAPPED ((NDIS_STATUS)0xC001001DL)
172 #define NDIS_STATUS_RESOURCE_CONFLICT ((NDIS_STATUS)0xC001001EL)
173 #define NDIS_STATUS_NO_CABLE ((NDIS_STATUS)0xC001001FL)
175 #define NDIS_STATUS_INVALID_SAP ((NDIS_STATUS)0xC0010020L)
176 #define NDIS_STATUS_SAP_IN_USE ((NDIS_STATUS)0xC0010021L)
177 #define NDIS_STATUS_INVALID_ADDRESS ((NDIS_STATUS)0xC0010022L)
178 #define NDIS_STATUS_VC_NOT_ACTIVATED ((NDIS_STATUS)0xC0010023L)
179 #define NDIS_STATUS_DEST_OUT_OF_ORDER ((NDIS_STATUS)0xC0010024L)
180 #define NDIS_STATUS_VC_NOT_AVAILABLE ((NDIS_STATUS)0xC0010025L)
181 #define NDIS_STATUS_CELLRATE_NOT_AVAILABLE ((NDIS_STATUS)0xC0010026L)
182 #define NDIS_STATUS_INCOMPATABLE_QOS ((NDIS_STATUS)0xC0010027L)
183 #define NDIS_STATUS_AAL_PARAMS_UNSUPPORTED ((NDIS_STATUS)0xC0010028L)
184 #define NDIS_STATUS_NO_ROUTE_TO_DESTINATION ((NDIS_STATUS)0xC0010029L)
186 #define NDIS_STATUS_TOKEN_RING_OPEN_ERROR ((NDIS_STATUS)0xC0011000L)
187 #define NDIS_STATUS_INVALID_DEVICE_REQUEST ((NDIS_STATUS)STATUS_INVALID_DEVICE_REQUEST)
188 #define NDIS_STATUS_NETWORK_UNREACHABLE ((NDIS_STATUS)STATUS_NETWORK_UNREACHABLE)
191 /* NDIS error codes for error logging */
193 #define NDIS_ERROR_CODE_RESOURCE_CONFLICT EVENT_NDIS_RESOURCE_CONFLICT
194 #define NDIS_ERROR_CODE_OUT_OF_RESOURCES EVENT_NDIS_OUT_OF_RESOURCE
195 #define NDIS_ERROR_CODE_HARDWARE_FAILURE EVENT_NDIS_HARDWARE_FAILURE
196 #define NDIS_ERROR_CODE_ADAPTER_NOT_FOUND EVENT_NDIS_ADAPTER_NOT_FOUND
197 #define NDIS_ERROR_CODE_INTERRUPT_CONNECT EVENT_NDIS_INTERRUPT_CONNECT
198 #define NDIS_ERROR_CODE_DRIVER_FAILURE EVENT_NDIS_DRIVER_FAILURE
199 #define NDIS_ERROR_CODE_BAD_VERSION EVENT_NDIS_BAD_VERSION
200 #define NDIS_ERROR_CODE_TIMEOUT EVENT_NDIS_TIMEOUT
201 #define NDIS_ERROR_CODE_NETWORK_ADDRESS EVENT_NDIS_NETWORK_ADDRESS
202 #define NDIS_ERROR_CODE_UNSUPPORTED_CONFIGURATION EVENT_NDIS_UNSUPPORTED_CONFIGURATION
203 #define NDIS_ERROR_CODE_INVALID_VALUE_FROM_ADAPTER EVENT_NDIS_INVALID_VALUE_FROM_ADAPTER
204 #define NDIS_ERROR_CODE_MISSING_CONFIGURATION_PARAMETER EVENT_NDIS_MISSING_CONFIGURATION_PARAMETER
205 #define NDIS_ERROR_CODE_BAD_IO_BASE_ADDRESS EVENT_NDIS_BAD_IO_BASE_ADDRESS
206 #define NDIS_ERROR_CODE_RECEIVE_SPACE_SMALL EVENT_NDIS_RECEIVE_SPACE_SMALL
207 #define NDIS_ERROR_CODE_ADAPTER_DISABLED EVENT_NDIS_ADAPTER_DISABLED
210 /* Memory allocation flags. Used by Ndis[Allocate|Free]Memory */
211 #define NDIS_MEMORY_CONTIGUOUS 0x00000001
212 #define NDIS_MEMORY_NONCACHED 0x00000002
214 /* NIC attribute flags. Used by NdisMSetAttributes(Ex) */
215 #define NDIS_ATTRIBUTE_IGNORE_PACKET_TIMEOUT 0x00000001
216 #define NDIS_ATTRIBUTE_IGNORE_REQUEST_TIMEOUT 0x00000002
217 #define NDIS_ATTRIBUTE_IGNORE_TOKEN_RING_ERRORS 0x00000004
218 #define NDIS_ATTRIBUTE_BUS_MASTER 0x00000008
219 #define NDIS_ATTRIBUTE_INTERMEDIATE_DRIVER 0x00000010
220 #define NDIS_ATTRIBUTE_DESERIALIZE 0x00000020
221 #define NDIS_ATTRIBUTE_NO_HALT_ON_SUSPEND 0x00000040
222 #define NDIS_ATTRIBUTE_SURPRISE_REMOVE_OK 0x00000080
223 #define NDIS_ATTRIBUTE_NOT_CO_NDIS 0x00000100
224 #define NDIS_ATTRIBUTE_USES_SAFE_BUFFER_APIS 0x00000200
227 /* Lock */
229 typedef union _NDIS_RW_LOCK_REFCOUNT {
230 UINT RefCount;
231 UCHAR cacheLine[16];
232 } NDIS_RW_LOCK_REFCOUNT;
234 typedef struct _NDIS_RW_LOCK {
235 union {
236 struct {
237 KSPIN_LOCK SpinLock;
238 PVOID Context;
239 } s;
240 UCHAR Reserved[16];
241 } u;
243 NDIS_RW_LOCK_REFCOUNT RefCount[MAXIMUM_PROCESSORS];
244 } NDIS_RW_LOCK, *PNDIS_RW_LOCK;
246 typedef struct _LOCK_STATE {
247 USHORT LockState;
248 KIRQL OldIrql;
249 } LOCK_STATE, *PLOCK_STATE;
253 /* Timer */
255 typedef VOID DDKAPI
256 (*PNDIS_TIMER_FUNCTION)(
257 /*IN*/ PVOID SystemSpecific1,
258 /*IN*/ PVOID FunctionContext,
259 /*IN*/ PVOID SystemSpecific2,
260 /*IN*/ PVOID SystemSpecific3);
262 typedef struct _NDIS_TIMER {
263 KTIMER Timer;
264 KDPC Dpc;
265 } NDIS_TIMER, *PNDIS_TIMER;
269 /* Hardware */
271 typedef CM_MCA_POS_DATA NDIS_MCA_POS_DATA, *PNDIS_MCA_POS_DATA;
272 typedef CM_EISA_SLOT_INFORMATION NDIS_EISA_SLOT_INFORMATION, *PNDIS_EISA_SLOT_INFORMATION;
273 typedef CM_EISA_FUNCTION_INFORMATION NDIS_EISA_FUNCTION_INFORMATION, *PNDIS_EISA_FUNCTION_INFORMATION;
274 typedef CM_PARTIAL_RESOURCE_LIST NDIS_RESOURCE_LIST, *PNDIS_RESOURCE_LIST;
276 /* Hardware status codes (OID_GEN_HARDWARE_STATUS) */
277 typedef enum _NDIS_HARDWARE_STATUS {
278 NdisHardwareStatusReady,
279 NdisHardwareStatusInitializing,
280 NdisHardwareStatusReset,
281 NdisHardwareStatusClosing,
282 NdisHardwareStatusNotReady
283 } NDIS_HARDWARE_STATUS, *PNDIS_HARDWARE_STATUS;
285 /* OID_GEN_GET_TIME_CAPS */
286 typedef struct _GEN_GET_TIME_CAPS {
287 ULONG Flags;
288 ULONG ClockPrecision;
289 } GEN_GET_TIME_CAPS, *PGEN_GET_TIME_CAPS;
291 /* Flag bits */
292 #define READABLE_LOCAL_CLOCK 0x00000001
293 #define CLOCK_NETWORK_DERIVED 0x00000002
294 #define CLOCK_PRECISION 0x00000004
295 #define RECEIVE_TIME_INDICATION_CAPABLE 0x00000008
296 #define TIMED_SEND_CAPABLE 0x00000010
297 #define TIME_STAMP_CAPABLE 0x00000020
299 /* OID_GEN_GET_NETCARD_TIME */
300 typedef struct _GEN_GET_NETCARD_TIME {
301 ULONGLONG ReadTime;
302 } GEN_GET_NETCARD_TIME, *PGEN_GET_NETCARD_TIME;
304 /* NDIS driver medium (OID_GEN_MEDIA_SUPPORTED / OID_GEN_MEDIA_IN_USE) */
305 typedef enum _NDIS_MEDIUM {
306 NdisMedium802_3,
307 NdisMedium802_5,
308 NdisMediumFddi,
309 NdisMediumWan,
310 NdisMediumLocalTalk,
311 NdisMediumDix,
312 NdisMediumArcnetRaw,
313 NdisMediumArcnet878_2,
314 NdisMediumAtm,
315 NdisMediumWirelessWan,
316 NdisMediumIrda,
317 NdisMediumBpc,
318 NdisMediumCoWan,
319 NdisMedium1394,
320 NdisMediumMax
321 } NDIS_MEDIUM, *PNDIS_MEDIUM;
323 /* NDIS packet filter bits (OID_GEN_CURRENT_PACKET_FILTER) */
324 #define NDIS_PACKET_TYPE_DIRECTED 0x00000001
325 #define NDIS_PACKET_TYPE_MULTICAST 0x00000002
326 #define NDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004
327 #define NDIS_PACKET_TYPE_BROADCAST 0x00000008
328 #define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010
329 #define NDIS_PACKET_TYPE_PROMISCUOUS 0x00000020
330 #define NDIS_PACKET_TYPE_SMT 0x00000040
331 #define NDIS_PACKET_TYPE_ALL_LOCAL 0x00000080
332 #define NDIS_PACKET_TYPE_GROUP 0x00001000
333 #define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00002000
334 #define NDIS_PACKET_TYPE_FUNCTIONAL 0x00004000
335 #define NDIS_PACKET_TYPE_MAC_FRAME 0x00008000
337 /* NDIS protocol option bits (OID_GEN_PROTOCOL_OPTIONS) */
338 #define NDIS_PROT_OPTION_ESTIMATED_LENGTH 0x00000001
339 #define NDIS_PROT_OPTION_NO_LOOPBACK 0x00000002
340 #define NDIS_PROT_OPTION_NO_RSVD_ON_RCVPKT 0x00000004
342 /* NDIS MAC option bits (OID_GEN_MAC_OPTIONS) */
343 #define NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA 0x00000001
344 #define NDIS_MAC_OPTION_RECEIVE_SERIALIZED 0x00000002
345 #define NDIS_MAC_OPTION_TRANSFERS_NOT_PEND 0x00000004
346 #define NDIS_MAC_OPTION_NO_LOOPBACK 0x00000008
347 #define NDIS_MAC_OPTION_FULL_DUPLEX 0x00000010
348 #define NDIS_MAC_OPTION_EOTX_INDICATION 0x00000020
349 #define NDIS_MAC_OPTION_8021P_PRIORITY 0x00000040
350 #define NDIS_MAC_OPTION_RESERVED 0x80000000
352 /* State of the LAN media (OID_GEN_MEDIA_CONNECT_STATUS) */
353 typedef enum _NDIS_MEDIA_STATE {
354 NdisMediaStateConnected,
355 NdisMediaStateDisconnected
356 } NDIS_MEDIA_STATE, *PNDIS_MEDIA_STATE;
358 /* OID_GEN_SUPPORTED_GUIDS */
359 typedef struct _NDIS_GUID {
360 GUID Guid;
361 union {
362 NDIS_OID Oid;
363 NDIS_STATUS Status;
364 } u;
365 ULONG Size;
366 ULONG Flags;
367 } NDIS_GUID, *PNDIS_GUID;
369 #define NDIS_GUID_TO_OID 0x00000001
370 #define NDIS_GUID_TO_STATUS 0x00000002
371 #define NDIS_GUID_ANSI_STRING 0x00000004
372 #define NDIS_GUID_UNICODE_STRING 0x00000008
373 #define NDIS_GUID_ARRAY 0x00000010
376 typedef struct _NDIS_PACKET_POOL {
377 NDIS_SPIN_LOCK SpinLock;
378 struct _NDIS_PACKET *FreeList;
379 UINT PacketLength;
380 UCHAR Buffer[1];
381 } NDIS_PACKET_POOL, * PNDIS_PACKET_POOL;
383 /* NDIS_PACKET_PRIVATE.Flags constants */
384 #define fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO 0x40
385 #define fPACKET_ALLOCATED_BY_NDIS 0x80
387 typedef struct _NDIS_PACKET_PRIVATE {
388 UINT PhysicalCount;
389 UINT TotalLength;
390 PNDIS_BUFFER Head;
391 PNDIS_BUFFER Tail;
392 PNDIS_PACKET_POOL Pool;
393 UINT Count;
394 ULONG Flags;
395 BOOLEAN ValidCounts;
396 UCHAR NdisPacketFlags;
397 USHORT NdisPacketOobOffset;
398 } NDIS_PACKET_PRIVATE, * PNDIS_PACKET_PRIVATE;
400 typedef struct _NDIS_PACKET {
401 NDIS_PACKET_PRIVATE Private;
402 union {
403 struct {
404 UCHAR MiniportReserved[2 * sizeof(PVOID)];
405 UCHAR WrapperReserved[2 * sizeof(PVOID)];
406 } s1;
407 struct {
408 UCHAR MiniportReservedEx[3 * sizeof(PVOID)];
409 UCHAR WrapperReservedEx[sizeof(PVOID)];
410 } s2;
411 struct {
412 UCHAR MacReserved[4 * sizeof(PVOID)];
413 } s3;
414 } u;
415 ULONG_PTR Reserved[2];
416 UCHAR ProtocolReserved[1];
417 } NDIS_PACKET, *PNDIS_PACKET, **PPNDIS_PACKET;
419 typedef enum _NDIS_CLASS_ID {
420 NdisClass802_3Priority,
421 NdisClassWirelessWanMbxMailbox,
422 NdisClassIrdaPacketInfo,
423 NdisClassAtmAALInfo
424 } NDIS_CLASS_ID;
426 typedef struct MediaSpecificInformation {
427 UINT NextEntryOffset;
428 NDIS_CLASS_ID ClassId;
429 UINT Size;
430 UCHAR ClassInformation[1];
431 } MEDIA_SPECIFIC_INFORMATION;
433 typedef struct _NDIS_PACKET_OOB_DATA {
434 _ANONYMOUS_UNION union {
435 ULONGLONG TimeToSend;
436 ULONGLONG TimeSent;
437 } DUMMYUNIONNAME;
438 ULONGLONG TimeReceived;
439 UINT HeaderSize;
440 UINT SizeMediaSpecificInfo;
441 PVOID MediaSpecificInformation;
442 NDIS_STATUS Status;
443 } NDIS_PACKET_OOB_DATA, *PNDIS_PACKET_OOB_DATA;
445 typedef struct _NDIS_PM_PACKET_PATTERN {
446 ULONG Priority;
447 ULONG Reserved;
448 ULONG MaskSize;
449 ULONG PatternOffset;
450 ULONG PatternSize;
451 ULONG PatternFlags;
452 } NDIS_PM_PACKET_PATTERN, *PNDIS_PM_PACKET_PATTERN;
455 /* Request types used by NdisRequest */
456 typedef enum _NDIS_REQUEST_TYPE {
457 NdisRequestQueryInformation,
458 NdisRequestSetInformation,
459 NdisRequestQueryStatistics,
460 NdisRequestOpen,
461 NdisRequestClose,
462 NdisRequestSend,
463 NdisRequestTransferData,
464 NdisRequestReset,
465 NdisRequestGeneric1,
466 NdisRequestGeneric2,
467 NdisRequestGeneric3,
468 NdisRequestGeneric4
469 } NDIS_REQUEST_TYPE, *PNDIS_REQUEST_TYPE;
471 typedef struct _NDIS_REQUEST {
472 UCHAR MacReserved[4 * sizeof(PVOID)];
473 NDIS_REQUEST_TYPE RequestType;
474 union _DATA {
475 struct QUERY_INFORMATION {
476 NDIS_OID Oid;
477 PVOID InformationBuffer;
478 UINT InformationBufferLength;
479 UINT BytesWritten;
480 UINT BytesNeeded;
481 } QUERY_INFORMATION;
482 struct SET_INFORMATION {
483 NDIS_OID Oid;
484 PVOID InformationBuffer;
485 UINT InformationBufferLength;
486 UINT BytesRead;
487 UINT BytesNeeded;
488 } SET_INFORMATION;
489 } DATA;
490 #if (defined(NDIS50) || defined(NDIS51))
491 UCHAR NdisReserved[9 * sizeof(PVOID)];
492 union {
493 UCHAR CallMgrReserved[2 * sizeof(PVOID)];
494 UCHAR ProtocolReserved[2 * sizeof(PVOID)];
496 UCHAR MiniportReserved[2 * sizeof(PVOID)];
497 #endif
498 } NDIS_REQUEST, *PNDIS_REQUEST;
502 /* Wide Area Networks definitions */
504 typedef struct _NDIS_WAN_PACKET {
505 LIST_ENTRY WanPacketQueue;
506 PUCHAR CurrentBuffer;
507 ULONG CurrentLength;
508 PUCHAR StartBuffer;
509 PUCHAR EndBuffer;
510 PVOID ProtocolReserved1;
511 PVOID ProtocolReserved2;
512 PVOID ProtocolReserved3;
513 PVOID ProtocolReserved4;
514 PVOID MacReserved1;
515 PVOID MacReserved2;
516 PVOID MacReserved3;
517 PVOID MacReserved4;
518 } NDIS_WAN_PACKET, *PNDIS_WAN_PACKET;
522 /* DMA channel information */
524 typedef struct _NDIS_DMA_DESCRIPTION {
525 BOOLEAN DemandMode;
526 BOOLEAN AutoInitialize;
527 BOOLEAN DmaChannelSpecified;
528 DMA_WIDTH DmaWidth;
529 DMA_SPEED DmaSpeed;
530 ULONG DmaPort;
531 ULONG DmaChannel;
532 } NDIS_DMA_DESCRIPTION, *PNDIS_DMA_DESCRIPTION;
534 typedef struct _NDIS_DMA_BLOCK {
535 PVOID MapRegisterBase;
536 KEVENT AllocationEvent;
537 PADAPTER_OBJECT SystemAdapterObject;
538 PVOID Miniport;
539 BOOLEAN InProgress;
540 } NDIS_DMA_BLOCK, *PNDIS_DMA_BLOCK;
543 /* Possible hardware architecture */
544 typedef enum _NDIS_INTERFACE_TYPE {
545 NdisInterfaceInternal = Internal,
546 NdisInterfaceIsa = Isa,
547 NdisInterfaceEisa = Eisa,
548 NdisInterfaceMca = MicroChannel,
549 NdisInterfaceTurboChannel = TurboChannel,
550 NdisInterfacePci = PCIBus,
551 NdisInterfacePcMcia = PCMCIABus,
552 NdisInterfaceCBus = CBus,
553 NdisInterfaceMPIBus = MPIBus,
554 NdisInterfaceMPSABus = MPSABus,
555 NdisInterfaceProcessorInternal = ProcessorInternal,
556 NdisInterfaceInternalPowerBus = InternalPowerBus,
557 NdisInterfacePNPISABus = PNPISABus,
558 NdisInterfacePNPBus = PNPBus,
559 NdisMaximumInterfaceType
560 } NDIS_INTERFACE_TYPE, *PNDIS_INTERFACE_TYPE;
562 #define NdisInterruptLevelSensitive LevelSensitive
563 #define NdisInterruptLatched Latched
564 typedef KINTERRUPT_MODE NDIS_INTERRUPT_MODE, *PNDIS_INTERRUPT_MODE;
567 typedef enum _NDIS_PARAMETER_TYPE {
568 NdisParameterInteger,
569 NdisParameterHexInteger,
570 NdisParameterString,
571 NdisParameterMultiString,
572 NdisParameterBinary
573 } NDIS_PARAMETER_TYPE, *PNDIS_PARAMETER_TYPE;
575 typedef struct {
576 USHORT Length;
577 PVOID Buffer;
578 } BINARY_DATA;
580 typedef struct _NDIS_CONFIGURATION_PARAMETER {
581 NDIS_PARAMETER_TYPE ParameterType;
582 union {
583 ULONG IntegerData;
584 NDIS_STRING StringData;
585 BINARY_DATA BinaryData;
586 } ParameterData;
587 } NDIS_CONFIGURATION_PARAMETER, *PNDIS_CONFIGURATION_PARAMETER;
590 typedef PHYSICAL_ADDRESS NDIS_PHYSICAL_ADDRESS, *PNDIS_PHYSICAL_ADDRESS;
592 typedef struct _NDIS_PHYSICAL_ADDRESS_UNIT {
593 NDIS_PHYSICAL_ADDRESS PhysicalAddress;
594 UINT Length;
595 } NDIS_PHYSICAL_ADDRESS_UNIT, *PNDIS_PHYSICAL_ADDRESS_UNIT;
597 typedef struct _NDIS_WAN_LINE_DOWN {
598 UCHAR RemoteAddress[6];
599 UCHAR LocalAddress[6];
600 } NDIS_WAN_LINE_DOWN, *PNDIS_WAN_LINE_DOWN;
602 typedef struct _NDIS_WAN_LINE_UP {
603 ULONG LinkSpeed;
604 ULONG MaximumTotalSize;
605 NDIS_WAN_QUALITY Quality;
606 USHORT SendWindow;
607 UCHAR RemoteAddress[6];
608 /*OUT*/ UCHAR LocalAddress[6];
609 ULONG ProtocolBufferLength;
610 PUCHAR ProtocolBuffer;
611 USHORT ProtocolType;
612 NDIS_STRING DeviceName;
613 } NDIS_WAN_LINE_UP, *PNDIS_WAN_LINE_UP;
616 typedef VOID DDKAPI
617 (*ADAPTER_SHUTDOWN_HANDLER)(
618 /*IN*/ PVOID ShutdownContext);
621 typedef struct _OID_LIST OID_LIST, *POID_LIST;
623 /* PnP state */
625 typedef enum _NDIS_PNP_DEVICE_STATE {
626 NdisPnPDeviceAdded,
627 NdisPnPDeviceStarted,
628 NdisPnPDeviceQueryStopped,
629 NdisPnPDeviceStopped,
630 NdisPnPDeviceQueryRemoved,
631 NdisPnPDeviceRemoved,
632 NdisPnPDeviceSurpriseRemoved
633 } NDIS_PNP_DEVICE_STATE;
635 #define NDIS_DEVICE_NOT_STOPPABLE 0x00000001
636 #define NDIS_DEVICE_NOT_REMOVEABLE 0x00000002
637 #define NDIS_DEVICE_NOT_SUSPENDABLE 0x00000004
638 #define NDIS_DEVICE_DISABLE_PM 0x00000008
639 #define NDIS_DEVICE_DISABLE_WAKE_UP 0x00000010
640 #define NDIS_DEVICE_DISABLE_WAKE_ON_RECONNECT 0x00000020
641 #define NDIS_DEVICE_RESERVED 0x00000040
642 #define NDIS_DEVICE_DISABLE_WAKE_ON_MAGIC_PACKET 0x00000080
643 #define NDIS_DEVICE_DISABLE_WAKE_ON_PATTERN_MATCH 0x00000100
646 /* OID_GEN_NETWORK_LAYER_ADDRESSES */
647 typedef struct _NETWORK_ADDRESS {
648 USHORT AddressLength;
649 USHORT AddressType;
650 UCHAR Address[1];
651 } NETWORK_ADDRESS, *PNETWORK_ADDRESS;
653 typedef struct _NETWORK_ADDRESS_LIST {
654 LONG AddressCount;
655 USHORT AddressType;
656 NETWORK_ADDRESS Address[1];
657 } NETWORK_ADDRESS_LIST, *PNETWORK_ADDRESS_LIST;
659 /* Protocol types supported by NDIS */
660 #define NDIS_PROTOCOL_ID_DEFAULT 0x00
661 #define NDIS_PROTOCOL_ID_TCP_IP 0x02
662 #define NDIS_PROTOCOL_ID_IPX 0x06
663 #define NDIS_PROTOCOL_ID_NBF 0x07
664 #define NDIS_PROTOCOL_ID_MAX 0x0F
665 #define NDIS_PROTOCOL_ID_MASK 0x0F
668 /* OID_GEN_TRANSPORT_HEADER_OFFSET */
669 typedef struct _TRANSPORT_HEADER_OFFSET {
670 USHORT ProtocolType;
671 USHORT HeaderOffset;
672 } TRANSPORT_HEADER_OFFSET, *PTRANSPORT_HEADER_OFFSET;
675 /* OID_GEN_CO_LINK_SPEED / OID_GEN_CO_MINIMUM_LINK_SPEED */
676 typedef struct _NDIS_CO_LINK_SPEED {
677 ULONG Outbound;
678 ULONG Inbound;
679 } NDIS_CO_LINK_SPEED, *PNDIS_CO_LINK_SPEED;
681 typedef ULONG NDIS_AF, *PNDIS_AF;
682 #define CO_ADDRESS_FAMILY_Q2931 ((NDIS_AF)0x1)
683 #define CO_ADDRESS_FAMILY_PSCHED ((NDIS_AF)0x2)
684 #define CO_ADDRESS_FAMILY_L2TP ((NDIS_AF)0x3)
685 #define CO_ADDRESS_FAMILY_IRDA ((NDIS_AF)0x4)
686 #define CO_ADDRESS_FAMILY_1394 ((NDIS_AF)0x5)
687 #define CO_ADDRESS_FAMILY_PPP ((NDIS_AF)0x6)
688 #define CO_ADDRESS_FAMILY_TAPI ((NDIS_AF)0x800)
689 #define CO_ADDRESS_FAMILY_TAPI_PROXY ((NDIS_AF)0x801)
691 #define CO_ADDRESS_FAMILY_PROXY 0x80000000
693 typedef struct {
694 NDIS_AF AddressFamily;
695 ULONG MajorVersion;
696 ULONG MinorVersion;
697 } CO_ADDRESS_FAMILY, *PCO_ADDRESS_FAMILY;
699 typedef struct _CO_FLOW_PARAMETERS {
700 ULONG TokenRate;
701 ULONG TokenBucketSize;
702 ULONG PeakBandwidth;
703 ULONG Latency;
704 ULONG DelayVariation;
705 SERVICETYPE ServiceType;
706 ULONG MaxSduSize;
707 ULONG MinimumPolicedSize;
708 } CO_FLOW_PARAMETERS, *PCO_FLOW_PARAMETERS;
710 typedef struct _CO_SPECIFIC_PARAMETERS {
711 ULONG ParamType;
712 ULONG Length;
713 UCHAR Parameters[1];
714 } CO_SPECIFIC_PARAMETERS, *PCO_SPECIFIC_PARAMETERS;
716 typedef struct _CO_CALL_MANAGER_PARAMETERS {
717 CO_FLOW_PARAMETERS Transmit;
718 CO_FLOW_PARAMETERS Receive;
719 CO_SPECIFIC_PARAMETERS CallMgrSpecific;
720 } CO_CALL_MANAGER_PARAMETERS, *PCO_CALL_MANAGER_PARAMETERS;
722 /* CO_MEDIA_PARAMETERS.Flags constants */
723 #define RECEIVE_TIME_INDICATION 0x00000001
724 #define USE_TIME_STAMPS 0x00000002
725 #define TRANSMIT_VC 0x00000004
726 #define RECEIVE_VC 0x00000008
727 #define INDICATE_ERRED_PACKETS 0x00000010
728 #define INDICATE_END_OF_TX 0x00000020
729 #define RESERVE_RESOURCES_VC 0x00000040
730 #define ROUND_DOWN_FLOW 0x00000080
731 #define ROUND_UP_FLOW 0x00000100
733 typedef struct _CO_MEDIA_PARAMETERS {
734 ULONG Flags;
735 ULONG ReceivePriority;
736 ULONG ReceiveSizeHint;
737 CO_SPECIFIC_PARAMETERS MediaSpecific;
738 } CO_MEDIA_PARAMETERS, *PCO_MEDIA_PARAMETERS;
740 /* CO_CALL_PARAMETERS.Flags constants */
741 #define PERMANENT_VC 0x00000001
742 #define CALL_PARAMETERS_CHANGED 0x00000002
743 #define QUERY_CALL_PARAMETERS 0x00000004
744 #define BROADCAST_VC 0x00000008
745 #define MULTIPOINT_VC 0x00000010
747 typedef struct _CO_CALL_PARAMETERS {
748 ULONG Flags;
749 PCO_CALL_MANAGER_PARAMETERS CallMgrParameters;
750 PCO_MEDIA_PARAMETERS MediaParameters;
751 } CO_CALL_PARAMETERS, *PCO_CALL_PARAMETERS;
753 typedef struct _CO_SAP {
754 ULONG SapType;
755 ULONG SapLength;
756 UCHAR Sap[1];
757 } CO_SAP, *PCO_SAP;
759 typedef struct _NDIS_IPSEC_PACKET_INFO {
760 _ANONYMOUS_UNION union {
761 struct {
762 NDIS_HANDLE OffloadHandle;
763 NDIS_HANDLE NextOffloadHandle;
764 } Transmit;
765 struct {
766 ULONG SA_DELETE_REQ : 1;
767 ULONG CRYPTO_DONE : 1;
768 ULONG NEXT_CRYPTO_DONE : 1;
769 ULONG CryptoStatus;
770 } Receive;
771 } DUMMYUNIONNAME;
772 } NDIS_IPSEC_PACKET_INFO, *PNDIS_IPSEC_PACKET_INFO;
774 /* NDIS_MAC_FRAGMENT.Errors constants */
775 #define WAN_ERROR_CRC 0x00000001
776 #define WAN_ERROR_FRAMING 0x00000002
777 #define WAN_ERROR_HARDWAREOVERRUN 0x00000004
778 #define WAN_ERROR_BUFFEROVERRUN 0x00000008
779 #define WAN_ERROR_TIMEOUT 0x00000010
780 #define WAN_ERROR_ALIGNMENT 0x00000020
782 typedef struct _NDIS_MAC_FRAGMENT {
783 NDIS_HANDLE NdisLinkContext;
784 ULONG Errors;
785 } NDIS_MAC_FRAGMENT, *PNDIS_MAC_FRAGMENT;
787 typedef struct _NDIS_MAC_LINE_DOWN {
788 NDIS_HANDLE NdisLinkContext;
789 } NDIS_MAC_LINE_DOWN, *PNDIS_MAC_LINE_DOWN;
791 typedef struct _NDIS_MAC_LINE_UP {
792 ULONG LinkSpeed;
793 NDIS_WAN_QUALITY Quality;
794 USHORT SendWindow;
795 NDIS_HANDLE ConnectionWrapperID;
796 NDIS_HANDLE NdisLinkHandle;
797 NDIS_HANDLE NdisLinkContext;
798 } NDIS_MAC_LINE_UP, *PNDIS_MAC_LINE_UP;
800 typedef struct _NDIS_PACKET_8021Q_INFO {
801 _ANONYMOUS_UNION union {
802 struct {
803 UINT32 UserPriority : 3;
804 UINT32 CanonicalFormatId : 1;
805 UINT32 VlanId : 12;
806 UINT32 Reserved : 16;
807 } TagHeader;
808 PVOID Value;
809 } DUMMYUNIONNAME;
810 } NDIS_PACKET_8021Q_INFO, *PNDIS_PACKET_8021Q_INFO;
812 typedef enum _NDIS_PER_PACKET_INFO {
813 TcpIpChecksumPacketInfo,
814 IpSecPacketInfo,
815 TcpLargeSendPacketInfo,
816 ClassificationHandlePacketInfo,
817 NdisReserved,
818 ScatterGatherListPacketInfo,
819 Ieee8021QInfo,
820 OriginalPacketInfo,
821 PacketCancelId,
822 MaxPerPacketInfo
823 } NDIS_PER_PACKET_INFO, *PNDIS_PER_PACKET_INFO;
825 typedef struct _NDIS_PACKET_EXTENSION {
826 PVOID NdisPacketInfo[MaxPerPacketInfo];
827 } NDIS_PACKET_EXTENSION, *PNDIS_PACKET_EXTENSION;
830 * PNDIS_PACKET
831 * NDIS_GET_ORIGINAL_PACKET(
832 * IN PNDIS_PACKET Packet);
834 #define NDIS_GET_ORIGINAL_PACKET(Packet) \
835 NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, OriginalPacketInfo)
838 * PVOID
839 * NDIS_GET_PACKET_CANCEL_ID(
840 * IN PNDIS_PACKET Packet);
842 #define NDIS_GET_PACKET_CANCEL_ID(Packet) \
843 NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, PacketCancelId)
846 * PNDIS_PACKET_EXTENSION
847 * NDIS_PACKET_EXTENSION_FROM_PACKET(
848 * IN PNDIS_PACKET Packet);
850 #define NDIS_PACKET_EXTENSION_FROM_PACKET(Packet) \
851 ((PNDIS_PACKET_EXTENSION)((PUCHAR)(Packet) \
852 + (Packet)->Private.NdisPacketOobOffset + sizeof(NDIS_PACKET_OOB_DATA)))
855 * PVOID
856 * NDIS_PER_PACKET_INFO_FROM_PACKET(
857 * IN OUT PNDIS_PACKET Packet,
858 * IN NDIS_PER_PACKET_INFO InfoType);
860 #define NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, InfoType) \
861 ((PNDIS_PACKET_EXTENSION)((PUCHAR)(Packet) + (Packet)->Private.NdisPacketOobOffset \
862 + sizeof(NDIS_PACKET_OOB_DATA)))->NdisPacketInfo[(InfoType)]
865 * VOID
866 * NDIS_SET_ORIGINAL_PACKET(
867 * IN OUT PNDIS_PACKET Packet,
868 * IN PNDIS_PACKET OriginalPacket);
870 #define NDIS_SET_ORIGINAL_PACKET(Packet, OriginalPacket) \
871 NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, OriginalPacketInfo) = (OriginalPacket)
874 * VOID
875 * NDIS_SET_PACKET_CANCEL_ID(
876 * IN PNDIS_PACKET Packet
877 * IN ULONG_PTR CancelId);
879 #define NDIS_SET_PACKET_CANCEL_ID(Packet, CancelId) \
880 NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, PacketCancelId) = (CancelId)
882 typedef enum _NDIS_TASK {
883 TcpIpChecksumNdisTask,
884 IpSecNdisTask,
885 TcpLargeSendNdisTask,
886 MaxNdisTask
887 } NDIS_TASK, *PNDIS_TASK;
889 typedef struct _NDIS_TASK_IPSEC {
890 struct {
891 ULONG AH_ESP_COMBINED;
892 ULONG TRANSPORT_TUNNEL_COMBINED;
893 ULONG V4_OPTIONS;
894 ULONG RESERVED;
895 } Supported;
897 struct {
898 ULONG MD5 : 1;
899 ULONG SHA_1 : 1;
900 ULONG Transport : 1;
901 ULONG Tunnel : 1;
902 ULONG Send : 1;
903 ULONG Receive : 1;
904 } V4AH;
906 struct {
907 ULONG DES : 1;
908 ULONG RESERVED : 1;
909 ULONG TRIPLE_DES : 1;
910 ULONG NULL_ESP : 1;
911 ULONG Transport : 1;
912 ULONG Tunnel : 1;
913 ULONG Send : 1;
914 ULONG Receive : 1;
915 } V4ESP;
916 } NDIS_TASK_IPSEC, *PNDIS_TASK_IPSEC;
918 typedef struct _NDIS_TASK_OFFLOAD {
919 ULONG Version;
920 ULONG Size;
921 NDIS_TASK Task;
922 ULONG OffsetNextTask;
923 ULONG TaskBufferLength;
924 UCHAR TaskBuffer[1];
925 } NDIS_TASK_OFFLOAD, *PNDIS_TASK_OFFLOAD;
927 /* NDIS_TASK_OFFLOAD_HEADER.Version constants */
928 #define NDIS_TASK_OFFLOAD_VERSION 1
930 typedef enum _NDIS_ENCAPSULATION {
931 UNSPECIFIED_Encapsulation,
932 NULL_Encapsulation,
933 IEEE_802_3_Encapsulation,
934 IEEE_802_5_Encapsulation,
935 LLC_SNAP_ROUTED_Encapsulation,
936 LLC_SNAP_BRIDGED_Encapsulation
937 } NDIS_ENCAPSULATION;
939 typedef struct _NDIS_ENCAPSULATION_FORMAT {
940 NDIS_ENCAPSULATION Encapsulation;
941 struct {
942 ULONG FixedHeaderSize : 1;
943 ULONG Reserved : 31;
944 } Flags;
945 ULONG EncapsulationHeaderSize;
946 } NDIS_ENCAPSULATION_FORMAT, *PNDIS_ENCAPSULATION_FORMAT;
948 typedef struct _NDIS_TASK_TCP_IP_CHECKSUM {
949 struct {
950 ULONG IpOptionsSupported:1;
951 ULONG TcpOptionsSupported:1;
952 ULONG TcpChecksum:1;
953 ULONG UdpChecksum:1;
954 ULONG IpChecksum:1;
955 } V4Transmit;
957 struct {
958 ULONG IpOptionsSupported : 1;
959 ULONG TcpOptionsSupported : 1;
960 ULONG TcpChecksum : 1;
961 ULONG UdpChecksum : 1;
962 ULONG IpChecksum : 1;
963 } V4Receive;
965 struct {
966 ULONG IpOptionsSupported : 1;
967 ULONG TcpOptionsSupported : 1;
968 ULONG TcpChecksum : 1;
969 ULONG UdpChecksum : 1;
970 } V6Transmit;
972 struct {
973 ULONG IpOptionsSupported : 1;
974 ULONG TcpOptionsSupported : 1;
975 ULONG TcpChecksum : 1;
976 ULONG UdpChecksum : 1;
977 } V6Receive;
978 } NDIS_TASK_TCP_IP_CHECKSUM, *PNDIS_TASK_TCP_IP_CHECKSUM;
980 typedef struct _NDIS_TASK_TCP_LARGE_SEND {
981 ULONG Version;
982 ULONG MaxOffLoadSize;
983 ULONG MinSegmentCount;
984 BOOLEAN TcpOptions;
985 BOOLEAN IpOptions;
986 } NDIS_TASK_TCP_LARGE_SEND, *PNDIS_TASK_TCP_LARGE_SEND;
988 typedef struct _NDIS_TCP_IP_CHECKSUM_PACKET_INFO {
989 _ANONYMOUS_UNION union {
990 struct {
991 ULONG NdisPacketChecksumV4 : 1;
992 ULONG NdisPacketChecksumV6 : 1;
993 ULONG NdisPacketTcpChecksum : 1;
994 ULONG NdisPacketUdpChecksum : 1;
995 ULONG NdisPacketIpChecksum : 1;
996 } Transmit;
998 struct {
999 ULONG NdisPacketTcpChecksumFailed : 1;
1000 ULONG NdisPacketUdpChecksumFailed : 1;
1001 ULONG NdisPacketIpChecksumFailed : 1;
1002 ULONG NdisPacketTcpChecksumSucceeded : 1;
1003 ULONG NdisPacketUdpChecksumSucceeded : 1;
1004 ULONG NdisPacketIpChecksumSucceeded : 1;
1005 ULONG NdisPacketLoopback : 1;
1006 } Receive;
1007 ULONG Value;
1008 } DUMMYUNIONNAME;
1009 } NDIS_TCP_IP_CHECKSUM_PACKET_INFO, *PNDIS_TCP_IP_CHECKSUM_PACKET_INFO;
1011 typedef struct _NDIS_WAN_CO_FRAGMENT {
1012 ULONG Errors;
1013 } NDIS_WAN_CO_FRAGMENT, *PNDIS_WAN_CO_FRAGMENT;
1015 typedef struct _NDIS_WAN_FRAGMENT {
1016 UCHAR RemoteAddress[6];
1017 UCHAR LocalAddress[6];
1018 } NDIS_WAN_FRAGMENT, *PNDIS_WAN_FRAGMENT;
1020 typedef struct _WAN_CO_LINKPARAMS {
1021 ULONG TransmitSpeed;
1022 ULONG ReceiveSpeed;
1023 ULONG SendWindow;
1024 } WAN_CO_LINKPARAMS, *PWAN_CO_LINKPARAMS;
1027 /* Call Manager */
1029 typedef VOID DDKAPI
1030 (*CM_ACTIVATE_VC_COMPLETE_HANDLER)(
1031 /*IN*/ NDIS_STATUS Status,
1032 /*IN*/ NDIS_HANDLE CallMgrVcContext,
1033 /*IN*/ PCO_CALL_PARAMETERS CallParameters);
1035 typedef NDIS_STATUS DDKAPI
1036 (*CM_ADD_PARTY_HANDLER)(
1037 /*IN*/ NDIS_HANDLE CallMgrVcContext,
1038 /*IN OUT*/ PCO_CALL_PARAMETERS CallParameters,
1039 /*IN*/ NDIS_HANDLE NdisPartyHandle,
1040 /*OUT*/ PNDIS_HANDLE CallMgrPartyContext);
1042 typedef NDIS_STATUS DDKAPI
1043 (*CM_CLOSE_AF_HANDLER)(
1044 /*IN*/ NDIS_HANDLE CallMgrAfContext);
1046 typedef NDIS_STATUS DDKAPI
1047 (*CM_CLOSE_CALL_HANDLER)(
1048 /*IN*/ NDIS_HANDLE CallMgrVcContext,
1049 /*IN*/ NDIS_HANDLE CallMgrPartyContext /*OPTIONAL*/,
1050 /*IN*/ PVOID CloseData /*OPTIONAL*/,
1051 /*IN*/ UINT Size /*OPTIONAL*/);
1053 typedef NDIS_STATUS DDKAPI
1054 (*CM_DEREG_SAP_HANDLER)(
1055 /*IN*/ NDIS_HANDLE CallMgrSapContext);
1057 typedef VOID DDKAPI
1058 (*CM_DEACTIVATE_VC_COMPLETE_HANDLER)(
1059 /*IN*/ NDIS_STATUS Status,
1060 /*IN*/ NDIS_HANDLE CallMgrVcContext);
1062 typedef NDIS_STATUS DDKAPI
1063 (*CM_DROP_PARTY_HANDLER)(
1064 /*IN*/ NDIS_HANDLE CallMgrPartyContext,
1065 /*IN*/ PVOID CloseData /*OPTIONAL*/,
1066 /*IN*/ UINT Size /*OPTIONAL*/);
1068 typedef VOID DDKAPI
1069 (*CM_INCOMING_CALL_COMPLETE_HANDLER)(
1070 /*IN*/ NDIS_STATUS Status,
1071 /*IN*/ NDIS_HANDLE CallMgrVcContext,
1072 /*IN*/ PCO_CALL_PARAMETERS CallParameters);
1074 typedef NDIS_STATUS DDKAPI
1075 (*CM_MAKE_CALL_HANDLER)(
1076 /*IN*/ NDIS_HANDLE CallMgrVcContext,
1077 /*IN OUT*/ PCO_CALL_PARAMETERS CallParameters,
1078 /*IN*/ NDIS_HANDLE NdisPartyHandle /*OPTIONAL*/,
1079 /*OUT*/ PNDIS_HANDLE CallMgrPartyContext /*OPTIONAL*/);
1081 typedef NDIS_STATUS DDKAPI
1082 (*CM_MODIFY_CALL_QOS_HANDLER)(
1083 /*IN*/ NDIS_HANDLE CallMgrVcContext,
1084 /*IN*/ PCO_CALL_PARAMETERS CallParameters);
1086 typedef NDIS_STATUS DDKAPI
1087 (*CM_OPEN_AF_HANDLER)(
1088 /*IN*/ NDIS_HANDLE CallMgrBindingContext,
1089 /*IN*/ PCO_ADDRESS_FAMILY AddressFamily,
1090 /*IN*/ NDIS_HANDLE NdisAfHandle,
1091 /*OUT*/ PNDIS_HANDLE CallMgrAfContext);
1093 typedef NDIS_STATUS DDKAPI
1094 (*CM_REG_SAP_HANDLER)(
1095 /*IN*/ NDIS_HANDLE CallMgrAfContext,
1096 /*IN*/ PCO_SAP Sap,
1097 /*IN*/ NDIS_HANDLE NdisSapHandle,
1098 /*OUT*/ PNDIS_HANDLE CallMgrSapContext);
1100 typedef NDIS_STATUS DDKAPI
1101 (*CO_CREATE_VC_HANDLER)(
1102 /*IN*/ NDIS_HANDLE ProtocolAfContext,
1103 /*IN*/ NDIS_HANDLE NdisVcHandle,
1104 /*OUT*/ PNDIS_HANDLE ProtocolVcContext);
1106 typedef NDIS_STATUS DDKAPI
1107 (*CO_DELETE_VC_HANDLER)(
1108 /*IN*/ NDIS_HANDLE ProtocolVcContext);
1110 typedef VOID DDKAPI
1111 (*CO_REQUEST_COMPLETE_HANDLER)(
1112 /*IN*/ NDIS_STATUS Status,
1113 /*IN*/ NDIS_HANDLE ProtocolAfContext /*OPTIONAL*/,
1114 /*IN*/ NDIS_HANDLE ProtocolVcContext /*OPTIONAL*/,
1115 /*IN*/ NDIS_HANDLE ProtocolPartyContext /*OPTIONAL*/,
1116 /*IN*/ PNDIS_REQUEST NdisRequest);
1118 typedef NDIS_STATUS DDKAPI
1119 (*CO_REQUEST_HANDLER)(
1120 /*IN*/ NDIS_HANDLE ProtocolAfContext,
1121 /*IN*/ NDIS_HANDLE ProtocolVcContext /*OPTIONAL*/,
1122 /*IN*/ NDIS_HANDLE ProtocolPartyContext /*OPTIONAL*/,
1123 /*IN OUT*/ PNDIS_REQUEST NdisRequest);
1125 typedef struct _NDIS_CALL_MANAGER_CHARACTERISTICS {
1126 UCHAR MajorVersion;
1127 UCHAR MinorVersion;
1128 USHORT Filler;
1129 UINT Reserved;
1130 CO_CREATE_VC_HANDLER CmCreateVcHandler;
1131 CO_DELETE_VC_HANDLER CmDeleteVcHandler;
1132 CM_OPEN_AF_HANDLER CmOpenAfHandler;
1133 CM_CLOSE_AF_HANDLER CmCloseAfHandler;
1134 CM_REG_SAP_HANDLER CmRegisterSapHandler;
1135 CM_DEREG_SAP_HANDLER CmDeregisterSapHandler;
1136 CM_MAKE_CALL_HANDLER CmMakeCallHandler;
1137 CM_CLOSE_CALL_HANDLER CmCloseCallHandler;
1138 CM_INCOMING_CALL_COMPLETE_HANDLER CmIncomingCallCompleteHandler;
1139 CM_ADD_PARTY_HANDLER CmAddPartyHandler;
1140 CM_DROP_PARTY_HANDLER CmDropPartyHandler;
1141 CM_ACTIVATE_VC_COMPLETE_HANDLER CmActivateVcCompleteHandler;
1142 CM_DEACTIVATE_VC_COMPLETE_HANDLER CmDeactivateVcCompleteHandler;
1143 CM_MODIFY_CALL_QOS_HANDLER CmModifyCallQoSHandler;
1144 CO_REQUEST_HANDLER CmRequestHandler;
1145 CO_REQUEST_COMPLETE_HANDLER CmRequestCompleteHandler;
1146 } NDIS_CALL_MANAGER_CHARACTERISTICS, *PNDIS_CALL_MANAGER_CHARACTERISTICS;
1150 /* Call Manager clients */
1152 typedef VOID (*CL_OPEN_AF_COMPLETE_HANDLER)(
1153 /*IN*/ NDIS_STATUS Status,
1154 /*IN*/ NDIS_HANDLE ProtocolAfContext,
1155 /*IN*/ NDIS_HANDLE NdisAfHandle);
1157 typedef VOID DDKAPI
1158 (*CL_CLOSE_AF_COMPLETE_HANDLER)(
1159 /*IN*/ NDIS_STATUS Status,
1160 /*IN*/ NDIS_HANDLE ProtocolAfContext);
1162 typedef VOID DDKAPI
1163 (*CL_REG_SAP_COMPLETE_HANDLER)(
1164 /*IN*/ NDIS_STATUS Status,
1165 /*IN*/ NDIS_HANDLE ProtocolSapContext,
1166 /*IN*/ PCO_SAP Sap,
1167 /*IN*/ NDIS_HANDLE NdisSapHandle);
1169 typedef VOID DDKAPI
1170 (*CL_DEREG_SAP_COMPLETE_HANDLER)(
1171 /*IN*/ NDIS_STATUS Status,
1172 /*IN*/ NDIS_HANDLE ProtocolSapContext);
1174 typedef VOID DDKAPI
1175 (*CL_MAKE_CALL_COMPLETE_HANDLER)(
1176 /*IN*/ NDIS_STATUS Status,
1177 /*IN*/ NDIS_HANDLE ProtocolVcContext,
1178 /*IN*/ NDIS_HANDLE NdisPartyHandle /*OPTIONAL*/,
1179 /*IN*/ PCO_CALL_PARAMETERS CallParameters);
1181 typedef VOID DDKAPI
1182 (*CL_MODIFY_CALL_QOS_COMPLETE_HANDLER)(
1183 /*IN*/ NDIS_STATUS Status,
1184 /*IN*/ NDIS_HANDLE ProtocolVcContext,
1185 /*IN*/ PCO_CALL_PARAMETERS CallParameters);
1187 typedef VOID DDKAPI
1188 (*CL_CLOSE_CALL_COMPLETE_HANDLER)(
1189 /*IN*/ NDIS_STATUS Status,
1190 /*IN*/ NDIS_HANDLE ProtocolVcContext,
1191 /*IN*/ NDIS_HANDLE ProtocolPartyContext /*OPTIONAL*/);
1193 typedef VOID DDKAPI
1194 (*CL_ADD_PARTY_COMPLETE_HANDLER)(
1195 /*IN*/ NDIS_STATUS Status,
1196 /*IN*/ NDIS_HANDLE ProtocolPartyContext,
1197 /*IN*/ NDIS_HANDLE NdisPartyHandle,
1198 /*IN*/ PCO_CALL_PARAMETERS CallParameters);
1200 typedef VOID DDKAPI
1201 (*CL_DROP_PARTY_COMPLETE_HANDLER)(
1202 /*IN*/ NDIS_STATUS Status,
1203 /*IN*/ NDIS_HANDLE ProtocolPartyContext);
1205 typedef NDIS_STATUS DDKAPI
1206 (*CL_INCOMING_CALL_HANDLER)(
1207 /*IN*/ NDIS_HANDLE ProtocolSapContext,
1208 /*IN*/ NDIS_HANDLE ProtocolVcContext,
1209 /*IN OUT*/ PCO_CALL_PARAMETERS CallParameters);
1211 typedef VOID DDKAPI
1212 (*CL_INCOMING_CALL_QOS_CHANGE_HANDLER)(
1213 /*IN*/ NDIS_HANDLE ProtocolVcContext,
1214 /*IN*/ PCO_CALL_PARAMETERS CallParameters);
1216 typedef VOID DDKAPI
1217 (*CL_INCOMING_CLOSE_CALL_HANDLER)(
1218 /*IN*/ NDIS_STATUS CloseStatus,
1219 /*IN*/ NDIS_HANDLE ProtocolVcContext,
1220 /*IN*/ PVOID CloseData /*OPTIONAL*/,
1221 /*IN*/ UINT Size /*OPTIONAL*/);
1223 typedef VOID DDKAPI
1224 (*CL_INCOMING_DROP_PARTY_HANDLER)(
1225 /*IN*/ NDIS_STATUS DropStatus,
1226 /*IN*/ NDIS_HANDLE ProtocolPartyContext,
1227 /*IN*/ PVOID CloseData /*OPTIONAL*/,
1228 /*IN*/ UINT Size /*OPTIONAL*/);
1230 typedef VOID DDKAPI
1231 (*CL_CALL_CONNECTED_HANDLER)(
1232 /*IN*/ NDIS_HANDLE ProtocolVcContext);
1235 typedef struct _NDIS_CLIENT_CHARACTERISTICS {
1236 UCHAR MajorVersion;
1237 UCHAR MinorVersion;
1238 USHORT Filler;
1239 UINT Reserved;
1240 CO_CREATE_VC_HANDLER ClCreateVcHandler;
1241 CO_DELETE_VC_HANDLER ClDeleteVcHandler;
1242 CO_REQUEST_HANDLER ClRequestHandler;
1243 CO_REQUEST_COMPLETE_HANDLER ClRequestCompleteHandler;
1244 CL_OPEN_AF_COMPLETE_HANDLER ClOpenAfCompleteHandler;
1245 CL_CLOSE_AF_COMPLETE_HANDLER ClCloseAfCompleteHandler;
1246 CL_REG_SAP_COMPLETE_HANDLER ClRegisterSapCompleteHandler;
1247 CL_DEREG_SAP_COMPLETE_HANDLER ClDeregisterSapCompleteHandler;
1248 CL_MAKE_CALL_COMPLETE_HANDLER ClMakeCallCompleteHandler;
1249 CL_MODIFY_CALL_QOS_COMPLETE_HANDLER ClModifyCallQoSCompleteHandler;
1250 CL_CLOSE_CALL_COMPLETE_HANDLER ClCloseCallCompleteHandler;
1251 CL_ADD_PARTY_COMPLETE_HANDLER ClAddPartyCompleteHandler;
1252 CL_DROP_PARTY_COMPLETE_HANDLER ClDropPartyCompleteHandler;
1253 CL_INCOMING_CALL_HANDLER ClIncomingCallHandler;
1254 CL_INCOMING_CALL_QOS_CHANGE_HANDLER ClIncomingCallQoSChangeHandler;
1255 CL_INCOMING_CLOSE_CALL_HANDLER ClIncomingCloseCallHandler;
1256 CL_INCOMING_DROP_PARTY_HANDLER ClIncomingDropPartyHandler;
1257 CL_CALL_CONNECTED_HANDLER ClCallConnectedHandler;
1258 } NDIS_CLIENT_CHARACTERISTICS, *PNDIS_CLIENT_CHARACTERISTICS;
1261 /* NDIS protocol structures */
1263 /* Prototypes for NDIS 3.0 protocol characteristics */
1265 typedef VOID DDKAPI
1266 (*OPEN_ADAPTER_COMPLETE_HANDLER)(
1267 /*IN*/ NDIS_HANDLE ProtocolBindingContext,
1268 /*IN*/ NDIS_STATUS Status,
1269 /*IN*/ NDIS_STATUS OpenErrorStatus);
1271 typedef VOID DDKAPI
1272 (*CLOSE_ADAPTER_COMPLETE_HANDLER)(
1273 /*IN*/ NDIS_HANDLE ProtocolBindingContext,
1274 /*IN*/ NDIS_STATUS Status);
1276 typedef VOID DDKAPI
1277 (*RESET_COMPLETE_HANDLER)(
1278 /*IN*/ NDIS_HANDLE ProtocolBindingContext,
1279 /*IN*/ NDIS_STATUS Status);
1281 typedef VOID DDKAPI
1282 (*REQUEST_COMPLETE_HANDLER)(
1283 /*IN*/ NDIS_HANDLE ProtocolBindingContext,
1284 /*IN*/ PNDIS_REQUEST NdisRequest,
1285 /*IN*/ NDIS_STATUS Status);
1287 typedef VOID DDKAPI
1288 (*STATUS_HANDLER)(
1289 /*IN*/ NDIS_HANDLE ProtocolBindingContext,
1290 /*IN*/ NDIS_STATUS GeneralStatus,
1291 /*IN*/ PVOID StatusBuffer,
1292 /*IN*/ UINT StatusBufferSize);
1294 typedef VOID DDKAPI
1295 (*STATUS_COMPLETE_HANDLER)(
1296 /*IN*/ NDIS_HANDLE ProtocolBindingContext);
1298 typedef VOID DDKAPI
1299 (*SEND_COMPLETE_HANDLER)(
1300 /*IN*/ NDIS_HANDLE ProtocolBindingContext,
1301 /*IN*/ PNDIS_PACKET Packet,
1302 /*IN*/ NDIS_STATUS Status);
1304 typedef VOID DDKAPI
1305 (*WAN_SEND_COMPLETE_HANDLER)(
1306 /*IN*/ NDIS_HANDLE ProtocolBindingContext,
1307 /*IN*/ PNDIS_WAN_PACKET Packet,
1308 /*IN*/ NDIS_STATUS Status);
1310 typedef VOID DDKAPI
1311 (*TRANSFER_DATA_COMPLETE_HANDLER)(
1312 /*IN*/ NDIS_HANDLE ProtocolBindingContext,
1313 /*IN*/ PNDIS_PACKET Packet,
1314 /*IN*/ NDIS_STATUS Status,
1315 /*IN*/ UINT BytesTransferred);
1317 typedef VOID DDKAPI
1318 (*WAN_TRANSFER_DATA_COMPLETE_HANDLER)(
1319 VOID);
1322 typedef NDIS_STATUS DDKAPI
1323 (*RECEIVE_HANDLER)(
1324 /*IN*/ NDIS_HANDLE ProtocolBindingContext,
1325 /*IN*/ NDIS_HANDLE MacReceiveContext,
1326 /*IN*/ PVOID HeaderBuffer,
1327 /*IN*/ UINT HeaderBufferSize,
1328 /*IN*/ PVOID LookAheadBuffer,
1329 /*IN*/ UINT LookaheadBufferSize,
1330 /*IN*/ UINT PacketSize);
1332 typedef NDIS_STATUS DDKAPI
1333 (*WAN_RECEIVE_HANDLER)(
1334 /*IN*/ NDIS_HANDLE NdisLinkHandle,
1335 /*IN*/ PUCHAR Packet,
1336 /*IN*/ ULONG PacketSize);
1338 typedef VOID DDKAPI
1339 (*RECEIVE_COMPLETE_HANDLER)(
1340 /*IN*/ NDIS_HANDLE ProtocolBindingContext);
1343 /* Protocol characteristics for NDIS 3.0 protocols */
1345 #define NDIS30_PROTOCOL_CHARACTERISTICS_S \
1346 UCHAR MajorNdisVersion; \
1347 UCHAR MinorNdisVersion; \
1348 _ANONYMOUS_UNION union { \
1349 UINT Reserved; \
1350 UINT Flags; \
1351 } DUMMYUNIONNAME; \
1352 OPEN_ADAPTER_COMPLETE_HANDLER OpenAdapterCompleteHandler; \
1353 CLOSE_ADAPTER_COMPLETE_HANDLER CloseAdapterCompleteHandler; \
1354 _ANONYMOUS_UNION union { \
1355 SEND_COMPLETE_HANDLER SendCompleteHandler; \
1356 WAN_SEND_COMPLETE_HANDLER WanSendCompleteHandler; \
1357 } DUMMYUNIONNAME2; \
1358 _ANONYMOUS_UNION union { \
1359 TRANSFER_DATA_COMPLETE_HANDLER TransferDataCompleteHandler; \
1360 WAN_TRANSFER_DATA_COMPLETE_HANDLER WanTransferDataCompleteHandler; \
1361 } DUMMYUNIONNAME3; \
1362 RESET_COMPLETE_HANDLER ResetCompleteHandler; \
1363 REQUEST_COMPLETE_HANDLER RequestCompleteHandler; \
1364 _ANONYMOUS_UNION union { \
1365 RECEIVE_HANDLER ReceiveHandler; \
1366 WAN_RECEIVE_HANDLER WanReceiveHandler; \
1367 } DUMMYUNIONNAME4; \
1368 RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler; \
1369 STATUS_HANDLER StatusHandler; \
1370 STATUS_COMPLETE_HANDLER StatusCompleteHandler; \
1371 NDIS_STRING Name;
1373 typedef struct _NDIS30_PROTOCOL_CHARACTERISTICS {
1374 NDIS30_PROTOCOL_CHARACTERISTICS_S
1375 } NDIS30_PROTOCOL_CHARACTERISTICS, *PNDIS30_PROTOCOL_CHARACTERISTICS;
1378 /* Prototypes for NDIS 4.0 protocol characteristics */
1380 typedef INT DDKAPI
1381 (*RECEIVE_PACKET_HANDLER)(
1382 /*IN*/ NDIS_HANDLE ProtocolBindingContext,
1383 /*IN*/ PNDIS_PACKET Packet);
1385 typedef VOID DDKAPI
1386 (*BIND_HANDLER)(
1387 /*OUT*/ PNDIS_STATUS Status,
1388 /*IN*/ NDIS_HANDLE BindContext,
1389 /*IN*/ PNDIS_STRING DeviceName,
1390 /*IN*/ PVOID SystemSpecific1,
1391 /*IN*/ PVOID SystemSpecific2);
1393 typedef VOID DDKAPI
1394 (*UNBIND_HANDLER)(
1395 /*OUT*/ PNDIS_STATUS Status,
1396 /*IN*/ NDIS_HANDLE ProtocolBindingContext,
1397 /*IN*/ NDIS_HANDLE UnbindContext);
1399 typedef NDIS_STATUS DDKAPI
1400 (*PNP_EVENT_HANDLER)(
1401 /*IN*/ NDIS_HANDLE ProtocolBindingContext,
1402 /*IN*/ PNET_PNP_EVENT NetPnPEvent);
1404 typedef VOID DDKAPI
1405 (*UNLOAD_PROTOCOL_HANDLER)(
1406 VOID);
1409 /* Protocol characteristics for NDIS 4.0 protocols */
1411 #ifdef __cplusplus
1413 #define NDIS40_PROTOCOL_CHARACTERISTICS_S \
1414 NDIS30_PROTOCOL_CHARACTERISTICS Ndis30Chars; \
1415 RECEIVE_PACKET_HANDLER ReceivePacketHandler; \
1416 BIND_HANDLER BindAdapterHandler; \
1417 UNBIND_HANDLER UnbindAdapterHandler; \
1418 PNP_EVENT_HANDLER PnPEventHandler; \
1419 UNLOAD_PROTOCOL_HANDLER UnloadHandler;
1421 #else /* !__cplusplus */
1423 #define NDIS40_PROTOCOL_CHARACTERISTICS_S \
1424 NDIS30_PROTOCOL_CHARACTERISTICS_S \
1425 RECEIVE_PACKET_HANDLER ReceivePacketHandler; \
1426 BIND_HANDLER BindAdapterHandler; \
1427 UNBIND_HANDLER UnbindAdapterHandler; \
1428 PNP_EVENT_HANDLER PnPEventHandler; \
1429 UNLOAD_PROTOCOL_HANDLER UnloadHandler;
1431 #endif /* __cplusplus */
1433 typedef struct _NDIS40_PROTOCOL_CHARACTERISTICS {
1434 NDIS40_PROTOCOL_CHARACTERISTICS_S
1435 } NDIS40_PROTOCOL_CHARACTERISTICS, *PNDIS40_PROTOCOL_CHARACTERISTICS;
1437 /* Prototypes for NDIS 5.0 protocol characteristics */
1439 typedef VOID DDKAPI
1440 (*CO_SEND_COMPLETE_HANDLER)(
1441 /*IN*/ NDIS_STATUS Status,
1442 /*IN*/ NDIS_HANDLE ProtocolVcContext,
1443 /*IN*/ PNDIS_PACKET Packet);
1445 typedef VOID DDKAPI
1446 (*CO_STATUS_HANDLER)(
1447 /*IN*/ NDIS_HANDLE ProtocolBindingContext,
1448 /*IN*/ NDIS_HANDLE ProtocolVcContext /*OPTIONAL*/,
1449 /*IN*/ NDIS_STATUS GeneralStatus,
1450 /*IN*/ PVOID StatusBuffer,
1451 /*IN*/ UINT StatusBufferSize);
1453 typedef UINT DDKAPI
1454 (*CO_RECEIVE_PACKET_HANDLER)(
1455 /*IN*/ NDIS_HANDLE ProtocolBindingContext,
1456 /*IN*/ NDIS_HANDLE ProtocolVcContext,
1457 /*IN*/ PNDIS_PACKET Packet);
1459 typedef VOID DDKAPI
1460 (*CO_AF_REGISTER_NOTIFY_HANDLER)(
1461 /*IN*/ NDIS_HANDLE ProtocolBindingContext,
1462 /*IN*/ PCO_ADDRESS_FAMILY AddressFamily);
1464 #ifdef __cplusplus \
1466 #define NDIS50_PROTOCOL_CHARACTERISTICS_S \
1467 NDIS40_PROTOCOL_CHARACTERISTICS Ndis40Chars; \
1468 PVOID ReservedHandlers[4]; \
1469 CO_SEND_COMPLETE_HANDLER CoSendCompleteHandler; \
1470 CO_STATUS_HANDLER CoStatusHandler; \
1471 CO_RECEIVE_PACKET_HANDLER CoReceivePacketHandler; \
1472 CO_AF_REGISTER_NOTIFY_HANDLER CoAfRegisterNotifyHandler;
1474 #else /* !__cplusplus */
1476 #define NDIS50_PROTOCOL_CHARACTERISTICS_S \
1477 NDIS40_PROTOCOL_CHARACTERISTICS_S \
1478 PVOID ReservedHandlers[4]; \
1479 CO_SEND_COMPLETE_HANDLER CoSendCompleteHandler; \
1480 CO_STATUS_HANDLER CoStatusHandler; \
1481 CO_RECEIVE_PACKET_HANDLER CoReceivePacketHandler; \
1482 CO_AF_REGISTER_NOTIFY_HANDLER CoAfRegisterNotifyHandler;
1484 #endif /* !__cplusplus */
1486 typedef struct _NDIS50_PROTOCOL_CHARACTERISTICS {
1487 NDIS50_PROTOCOL_CHARACTERISTICS_S
1488 } NDIS50_PROTOCOL_CHARACTERISTICS, *PNDIS50_PROTOCOL_CHARACTERISTICS;
1490 #if defined(NDIS50) || defined(NDIS51)
1491 typedef struct _NDIS_PROTOCOL_CHARACTERISTICS {
1492 NDIS50_PROTOCOL_CHARACTERISTICS_S;
1493 } NDIS_PROTOCOL_CHARACTERISTICS, *PNDIS_PROTOCOL_CHARACTERISTICS;
1494 #elif defined(NDIS40)
1495 typedef struct _NDIS_PROTOCOL_CHARACTERISTICS {
1496 NDIS40_PROTOCOL_CHARACTERISTICS_S;
1497 } NDIS_PROTOCOL_CHARACTERISTICS, *PNDIS_PROTOCOL_CHARACTERISTICS;
1498 #elif defined(NDIS30)
1499 typedef struct _NDIS_PROTOCOL_CHARACTERISTICS {
1500 NDIS30_PROTOCOL_CHARACTERISTICS_S
1501 } NDIS_PROTOCOL_CHARACTERISTICS, *PNDIS_PROTOCOL_CHARACTERISTICS;
1502 #else
1503 #error Define an NDIS version
1504 #endif /* NDIS30 */
1508 /* Buffer management routines */
1510 NDISAPI
1511 VOID
1512 DDKAPI
1513 NdisAllocateBuffer(
1514 /*OUT*/ PNDIS_STATUS Status,
1515 /*OUT*/ PNDIS_BUFFER *Buffer,
1516 /*IN*/ NDIS_HANDLE PoolHandle,
1517 /*IN*/ PVOID VirtualAddress,
1518 /*IN*/ UINT Length);
1521 NDISAPI
1522 VOID
1523 DDKAPI
1524 NdisAllocateBufferPool(
1525 /*OUT*/ PNDIS_STATUS Status,
1526 /*OUT*/ PNDIS_HANDLE PoolHandle,
1527 /*IN*/ UINT NumberOfDescriptors);
1529 NDISAPI
1530 VOID
1531 DDKAPI
1532 NdisAllocatePacket(
1533 /*OUT*/ PNDIS_STATUS Status,
1534 /*OUT*/ PNDIS_PACKET *Packet,
1535 /*IN*/ NDIS_HANDLE PoolHandle);
1537 NDISAPI
1538 VOID
1539 DDKAPI
1540 NdisAllocatePacketPool(
1541 /*OUT*/ PNDIS_STATUS Status,
1542 /*OUT*/ PNDIS_HANDLE PoolHandle,
1543 /*IN*/ UINT NumberOfDescriptors,
1544 /*IN*/ UINT ProtocolReservedLength);
1546 NDISAPI
1547 VOID
1548 DDKAPI
1549 NdisCopyBuffer(
1550 /*OUT*/ PNDIS_STATUS Status,
1551 /*OUT*/ PNDIS_BUFFER *Buffer,
1552 /*IN*/ NDIS_HANDLE PoolHandle,
1553 /*IN*/ PVOID MemoryDescriptor,
1554 /*IN*/ UINT Offset,
1555 /*IN*/ UINT Length);
1557 NDISAPI
1558 VOID
1559 DDKAPI
1560 NdisCopyFromPacketToPacket(
1561 /*IN*/ PNDIS_PACKET Destination,
1562 /*IN*/ UINT DestinationOffset,
1563 /*IN*/ UINT BytesToCopy,
1564 /*IN*/ PNDIS_PACKET Source,
1565 /*IN*/ UINT SourceOffset,
1566 /*OUT*/ PUINT BytesCopied);
1568 NDISAPI
1569 VOID
1570 DDKAPI
1571 NdisDprAllocatePacket(
1572 /*OUT*/ PNDIS_STATUS Status,
1573 /*OUT*/ PNDIS_PACKET *Packet,
1574 /*IN*/ NDIS_HANDLE PoolHandle);
1576 NDISAPI
1577 VOID
1578 DDKAPI
1579 NdisDprAllocatePacketNonInterlocked(
1580 /*OUT*/ PNDIS_STATUS Status,
1581 /*OUT*/ PNDIS_PACKET *Packet,
1582 /*IN*/ NDIS_HANDLE PoolHandle);
1584 NDISAPI
1585 VOID
1586 DDKAPI
1587 NdisDprFreePacket(
1588 /*IN*/ PNDIS_PACKET Packet);
1590 NDISAPI
1591 VOID
1592 DDKAPI
1593 NdisDprFreePacketNonInterlocked(
1594 /*IN*/ PNDIS_PACKET Packet);
1596 NDISAPI
1597 VOID
1598 DDKAPI
1599 NdisFreeBufferPool(
1600 /*IN*/ NDIS_HANDLE PoolHandle);
1602 NDISAPI
1603 VOID
1604 DDKAPI
1605 NdisFreePacket(
1606 /*IN*/ PNDIS_PACKET Packet);
1608 NDISAPI
1609 VOID
1610 DDKAPI
1611 NdisFreePacketPool(
1612 /*IN*/ NDIS_HANDLE PoolHandle);
1614 NDISAPI
1615 VOID
1616 DDKAPI
1617 NdisReturnPackets(
1618 /*IN*/ PNDIS_PACKET *PacketsToReturn,
1619 /*IN*/ UINT NumberOfPackets);
1621 NDISAPI
1622 VOID
1623 DDKAPI
1624 NdisUnchainBufferAtBack(
1625 /*IN OUT*/ PNDIS_PACKET Packet,
1626 /*OUT*/ PNDIS_BUFFER *Buffer);
1628 NDISAPI
1629 VOID
1630 DDKAPI
1631 NdisUnchainBufferAtFront(
1632 /*IN OUT*/ PNDIS_PACKET Packet,
1633 /*OUT*/ PNDIS_BUFFER *Buffer);
1635 NDISAPI
1636 VOID
1637 DDKAPI
1638 NdisAdjustBufferLength(
1639 /*IN*/ PNDIS_BUFFER Buffer,
1640 /*IN*/ UINT Length);
1642 NDISAPI
1643 ULONG
1644 DDKAPI
1645 NdisBufferLength(
1646 /*IN*/ PNDIS_BUFFER Buffer);
1648 NDISAPI
1649 PVOID
1650 DDKAPI
1651 NdisBufferVirtualAddress(
1652 /*IN*/ PNDIS_BUFFER Buffer);
1654 NDISAPI
1655 ULONG
1656 DDKAPI
1657 NDIS_BUFFER_TO_SPAN_PAGES(
1658 /*IN*/ PNDIS_BUFFER Buffer);
1660 NDISAPI
1661 VOID
1662 DDKAPI
1663 NdisFreeBuffer(
1664 /*IN*/ PNDIS_BUFFER Buffer);
1666 NDISAPI
1667 VOID
1668 DDKAPI
1669 NdisGetBufferPhysicalArraySize(
1670 /*IN*/ PNDIS_BUFFER Buffer,
1671 /*OUT*/ PUINT ArraySize);
1673 NDISAPI
1674 VOID
1675 DDKAPI
1676 NdisGetFirstBufferFromPacket(
1677 /*IN*/ PNDIS_PACKET _Packet,
1678 /*OUT*/ PNDIS_BUFFER *_FirstBuffer,
1679 /*OUT*/ PVOID *_FirstBufferVA,
1680 /*OUT*/ PUINT _FirstBufferLength,
1681 /*OUT*/ PUINT _TotalBufferLength);
1683 NDISAPI
1684 VOID
1685 DDKAPI
1686 NdisQueryBuffer(
1687 /*IN*/ PNDIS_BUFFER Buffer,
1688 /*OUT*/ PVOID *VirtualAddress /*OPTIONAL*/,
1689 /*OUT*/ PUINT Length);
1691 NDISAPI
1692 VOID
1693 DDKAPI
1694 NdisQueryBufferOffset(
1695 /*IN*/ PNDIS_BUFFER Buffer,
1696 /*OUT*/ PUINT Offset,
1697 /*OUT*/ PUINT Length);
1699 NDISAPI
1700 VOID
1701 DDKAPI
1702 NdisFreeBuffer(
1703 /*IN*/ PNDIS_BUFFER Buffer);
1707 * VOID
1708 * NdisGetBufferPhysicalArraySize(
1709 * IN PNDIS_BUFFER Buffer,
1710 * OUT PUINT ArraySize);
1712 #define NdisGetBufferPhysicalArraySize(Buffer, \
1713 ArraySize) \
1715 (*(ArraySize) = NDIS_BUFFER_TO_SPAN_PAGES(Buffer)) \
1720 * VOID
1721 * NdisGetFirstBufferFromPacket(
1722 * IN PNDIS_PACKET _Packet,
1723 * OUT PNDIS_BUFFER * _FirstBuffer,
1724 * OUT PVOID * _FirstBufferVA,
1725 * OUT PUINT _FirstBufferLength,
1726 * OUT PUINT _TotalBufferLength)
1728 #define NdisGetFirstBufferFromPacket(_Packet, \
1729 _FirstBuffer, \
1730 _FirstBufferVA, \
1731 _FirstBufferLength, \
1732 _TotalBufferLength) \
1734 PNDIS_BUFFER _Buffer; \
1736 _Buffer = (_Packet)->Private.Head; \
1737 *(_FirstBuffer) = _Buffer; \
1738 if (_Buffer != NULL) \
1740 *(_FirstBufferVA) = MmGetSystemAddressForMdl(_Buffer); \
1741 *(_FirstBufferLength) = MmGetMdlByteCount(_Buffer); \
1742 _Buffer = _Buffer->Next; \
1743 *(_TotalBufferLength) = *(_FirstBufferLength); \
1744 while (_Buffer != NULL) { \
1745 *(_TotalBufferLength) += MmGetMdlByteCount(_Buffer); \
1746 _Buffer = _Buffer->Next; \
1749 else \
1751 *(_FirstBufferVA) = 0; \
1752 *(_FirstBufferLength) = 0; \
1753 *(_TotalBufferLength) = 0; \
1758 * VOID
1759 * NdisQueryBuffer(
1760 * IN PNDIS_BUFFER Buffer,
1761 * OUT PVOID *VirtualAddress OPTIONAL,
1762 * OUT PUINT Length)
1764 #define NdisQueryBuffer(Buffer, \
1765 VirtualAddress, \
1766 Length) \
1768 if (VirtualAddress) \
1769 *((PVOID*)VirtualAddress) = MmGetSystemAddressForMdl(Buffer); \
1771 *((PUINT)Length) = MmGetMdlByteCount(Buffer); \
1776 * VOID
1777 * NdisQueryBufferOffset(
1778 * IN PNDIS_BUFFER Buffer,
1779 * OUT PUINT Offset,
1780 * OUT PUINT Length);
1782 #define NdisQueryBufferOffset(Buffer, \
1783 Offset, \
1784 Length) \
1786 *((PUINT)Offset) = MmGetMdlByteOffset(Buffer); \
1787 *((PUINT)Length) = MmGetMdlByteCount(Buffer); \
1792 * PVOID
1793 * NDIS_BUFFER_LINKAGE(
1794 * IN PNDIS_BUFFER Buffer);
1796 #define NDIS_BUFFER_LINKAGE(Buffer)(Buffer)->Next;
1800 * VOID
1801 * NdisChainBufferAtBack(
1802 * IN OUT PNDIS_PACKET Packet,
1803 * IN OUT PNDIS_BUFFER Buffer)
1805 #define NdisChainBufferAtBack(Packet, \
1806 Buffer) \
1808 PNDIS_BUFFER NdisBuffer = (Buffer); \
1810 while (NdisBuffer->Next != NULL) \
1811 NdisBuffer = NdisBuffer->Next; \
1813 NdisBuffer->Next = NULL; \
1815 if ((Packet)->Private.Head != NULL) \
1816 (Packet)->Private.Tail->Next = (Buffer); \
1817 else \
1818 (Packet)->Private.Head = (Buffer); \
1820 (Packet)->Private.Tail = NdisBuffer; \
1821 (Packet)->Private.ValidCounts = FALSE; \
1826 * VOID
1827 * NdisChainBufferAtFront(
1828 * IN OUT PNDIS_PACKET Packet,
1829 * IN OUT PNDIS_BUFFER Buffer)
1831 #define NdisChainBufferAtFront(Packet, \
1832 Buffer) \
1834 PNDIS_BUFFER _NdisBuffer = (Buffer); \
1836 while (_NdisBuffer->Next != NULL) \
1837 _NdisBuffer = _NdisBuffer->Next; \
1839 if ((Packet)->Private.Head == NULL) \
1840 (Packet)->Private.Tail = _NdisBuffer; \
1842 _NdisBuffer->Next = (Packet)->Private.Head; \
1843 (Packet)->Private.Head = (Buffer); \
1844 (Packet)->Private.ValidCounts = FALSE; \
1849 * VOID
1850 * NdisGetNextBuffer(
1851 * IN PNDIS_BUFFER CurrentBuffer,
1852 * OUT PNDIS_BUFFER * NextBuffer)
1854 #define NdisGetNextBuffer(CurrentBuffer, \
1855 NextBuffer) \
1857 *(NextBuffer) = (CurrentBuffer)->Next; \
1862 * UINT
1863 * NdisGetPacketFlags(
1864 * IN PNDIS_PACKET Packet);
1866 #define NdisGetPacketFlags(Packet)(Packet)->Private.Flags;
1870 * VOID
1871 * NdisClearPacketFlags(
1872 * IN PNDIS_PACKET Packet,
1873 * IN UINT Flags);
1875 #define NdisClearPacketFlags(Packet, Flags) \
1876 (Packet)->Private.Flags &= ~(Flags)
1880 * VOID
1881 * NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO(
1882 * IN PNDIS_PACKET Packet,
1883 * IN PPVOID pMediaSpecificInfo,
1884 * IN PUINT pSizeMediaSpecificInfo);
1886 #define NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO(_Packet, \
1887 _pMediaSpecificInfo, \
1888 _pSizeMediaSpecificInfo) \
1890 if (!((_Packet)->Private.NdisPacketFlags & fPACKET_ALLOCATED_BY_NDIS) || \
1891 !((_Packet)->Private.NdisPacketFlags & fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO)) \
1893 *(_pMediaSpecificInfo) = NULL; \
1894 *(_pSizeMediaSpecificInfo) = 0; \
1896 else \
1898 *(_pMediaSpecificInfo) = ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
1899 (_Packet)->Private.NdisPacketOobOffset))->MediaSpecificInformation; \
1900 *(_pSizeMediaSpecificInfo) = ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
1901 (_Packet)->Private.NdisPacketOobOffset))->SizeMediaSpecificInfo; \
1907 * ULONG
1908 * NDIS_GET_PACKET_PROTOCOL_TYPE(
1909 * IN PNDIS_PACKET Packet);
1911 #define NDIS_GET_PACKET_PROTOCOL_TYPE(_Packet) \
1912 ((_Packet)->Private.Flags & NDIS_PROTOCOL_ID_MASK)
1915 * ULONG
1916 * NDIS_GET_PACKET_HEADER_SIZE(
1917 * IN PNDIS_PACKET Packet);
1919 #define NDIS_GET_PACKET_HEADER_SIZE(_Packet) \
1920 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
1921 (_Packet)->Private.NdisPacketOobOffset))->HeaderSize
1925 * NDIS_STATUS
1926 * NDIS_GET_PACKET_STATUS(
1927 * IN PNDIS_PACKET Packet);
1929 #define NDIS_GET_PACKET_STATUS(_Packet) \
1930 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
1931 (_Packet)->Private.NdisPacketOobOffset))->Status
1935 * ULONGLONG
1936 * NDIS_GET_PACKET_TIME_RECEIVED(
1937 * IN PNDIS_PACKET Packet);
1939 #define NDIS_GET_PACKET_TIME_RECEIVED(_Packet) \
1940 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
1941 (_Packet)->Private.NdisPacketOobOffset))->TimeReceived
1945 * ULONGLONG
1946 * NDIS_GET_PACKET_TIME_SENT(
1947 * IN PNDIS_PACKET Packet);
1949 #define NDIS_GET_PACKET_TIME_SENT(_Packet) \
1950 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
1951 (_Packet)->Private.NdisPacketOobOffset))->TimeSent
1955 * ULONGLONG
1956 * NDIS_GET_PACKET_TIME_TO_SEND(
1957 * IN PNDIS_PACKET Packet);
1959 #define NDIS_GET_PACKET_TIME_TO_SEND(_Packet) \
1960 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
1961 (_Packet)->Private.NdisPacketOobOffset))->TimeToSend
1965 * PNDIS_PACKET_OOB_DATA
1966 * NDIS_OOB_DATA_FROM_PACKET(
1967 * IN PNDIS_PACKET Packet);
1969 #define NDIS_OOB_DATA_FROM_PACKET(_Packet) \
1970 (PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
1971 (_Packet)->Private.NdisPacketOobOffset)
1975 * VOID
1976 * NdisQueryPacket(
1977 * IN PNDIS_PACKET Packet,
1978 * OUT PUINT PhysicalBufferCount OPTIONAL,
1979 * OUT PUINT BufferCount OPTIONAL,
1980 * OUT PNDIS_BUFFER *FirstBuffer OPTIONAL,
1981 * OUT PUINT TotalPacketLength OPTIONAL);
1983 #define NdisQueryPacket(Packet, \
1984 PhysicalBufferCount, \
1985 BufferCount, \
1986 FirstBuffer, \
1987 TotalPacketLength) \
1989 if (FirstBuffer) \
1990 *((PNDIS_BUFFER*)FirstBuffer) = (Packet)->Private.Head; \
1991 if ((TotalPacketLength) || (BufferCount) || (PhysicalBufferCount)) \
1993 if (!(Packet)->Private.ValidCounts) { \
1994 UINT _Offset; \
1995 UINT _PacketLength; \
1996 PNDIS_BUFFER _NdisBuffer; \
1997 UINT _PhysicalBufferCount = 0; \
1998 UINT _TotalPacketLength = 0; \
1999 UINT _Count = 0; \
2001 for (_NdisBuffer = (Packet)->Private.Head; \
2002 _NdisBuffer != (PNDIS_BUFFER)NULL; \
2003 _NdisBuffer = _NdisBuffer->Next) \
2005 _PhysicalBufferCount += NDIS_BUFFER_TO_SPAN_PAGES(_NdisBuffer); \
2006 NdisQueryBufferOffset(_NdisBuffer, &_Offset, &_PacketLength); \
2007 _TotalPacketLength += _PacketLength; \
2008 _Count++; \
2010 (Packet)->Private.PhysicalCount = _PhysicalBufferCount; \
2011 (Packet)->Private.TotalLength = _TotalPacketLength; \
2012 (Packet)->Private.Count = _Count; \
2013 (Packet)->Private.ValidCounts = TRUE; \
2016 if (PhysicalBufferCount) \
2017 *((PUINT)PhysicalBufferCount) = (Packet)->Private.PhysicalCount; \
2019 if (BufferCount) \
2020 *((PUINT)BufferCount) = (Packet)->Private.Count; \
2022 if (TotalPacketLength) \
2023 *((PUINT)TotalPacketLength) = (Packet)->Private.TotalLength; \
2028 * VOID
2029 * NdisQueryPacketLength(
2030 * IN PNDIS_PACKET Packet,
2031 * OUT PUINT PhysicalBufferCount OPTIONAL,
2032 * OUT PUINT BufferCount OPTIONAL,
2033 * OUT PNDIS_BUFFER *FirstBuffer OPTIONAL,
2034 * OUT PUINT TotalPacketLength OPTIONAL);
2036 #define NdisQueryPacketLength(Packet, \
2037 TotalPacketLength) \
2039 if ((TotalPacketLength)) \
2041 if (!(Packet)->Private.ValidCounts) { \
2042 UINT _Offset; \
2043 UINT _PacketLength; \
2044 PNDIS_BUFFER _NdisBuffer; \
2045 UINT _PhysicalBufferCount = 0; \
2046 UINT _TotalPacketLength = 0; \
2047 UINT _Count = 0; \
2049 for (_NdisBuffer = (Packet)->Private.Head; \
2050 _NdisBuffer != (PNDIS_BUFFER)NULL; \
2051 _NdisBuffer = _NdisBuffer->Next) \
2053 _PhysicalBufferCount += NDIS_BUFFER_TO_SPAN_PAGES(_NdisBuffer); \
2054 NdisQueryBufferOffset(_NdisBuffer, &_Offset, &_PacketLength); \
2055 _TotalPacketLength += _PacketLength; \
2056 _Count++; \
2058 (Packet)->Private.PhysicalCount = _PhysicalBufferCount; \
2059 (Packet)->Private.TotalLength = _TotalPacketLength; \
2060 (Packet)->Private.Count = _Count; \
2061 (Packet)->Private.ValidCounts = TRUE; \
2064 if (TotalPacketLength) \
2065 *((PUINT)TotalPacketLength) = (Packet)->Private.TotalLength; \
2071 * VOID
2072 * NdisRecalculatePacketCounts(
2073 * IN OUT PNDIS_PACKET Packet);
2075 #define NdisRecalculatePacketCounts(Packet) \
2077 PNDIS_BUFFER _Buffer = (Packet)->Private.Head; \
2078 if (_Buffer != NULL) \
2080 while (_Buffer->Next != NULL) \
2082 ´_Buffer = _Buffer->Next; \
2084 (Packet)->Private.Tail = _Buffer; \
2086 (Packet)->Private.ValidCounts = FALSE; \
2091 * VOID
2092 * NdisReinitializePacket(
2093 * IN OUT PNDIS_PACKET Packet);
2095 #define NdisReinitializePacketCounts(Packet) \
2097 (Packet)->Private.Head = (PNDIS_BUFFER)NULL; \
2098 (Packet)->Private.ValidCounts = FALSE; \
2103 * VOID
2104 * NdisSetPacketFlags(
2105 * IN PNDIS_PACKET Packet,
2106 * IN UINT Flags);
2108 #define NdisSetPacketFlags(Packet, Flags) \
2109 (Packet)->Private.Flags |= (Flags);
2113 * VOID
2114 * NDIS_SET_PACKET_HEADER_SIZE(
2115 * IN PNDIS_PACKET Packet,
2116 * IN UINT HdrSize);
2118 #define NDIS_SET_PACKET_HEADER_SIZE(_Packet, _HdrSize) \
2119 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
2120 (_Packet)->Private.NdisPacketOobOffset))->HeaderSize = (_HdrSize)
2124 * VOID
2125 * NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO(
2126 * IN PNDIS_PACKET Packet,
2127 * IN PVOID MediaSpecificInfo,
2128 * IN UINT SizeMediaSpecificInfo);
2130 #define NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO(_Packet, \
2131 _MediaSpecificInfo, \
2132 _SizeMediaSpecificInfo) \
2134 if ((_Packet)->Private.NdisPacketFlags & fPACKET_ALLOCATED_BY_NDIS) \
2136 (_Packet)->Private.NdisPacketFlags |= fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO; \
2137 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
2138 (_Packet)->Private.NdisPacketOobOffset))->MediaSpecificInformation = \
2139 (_MediaSpecificInfo); \
2140 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
2141 (_Packet)->Private.NdisPacketOobOffset))->SizeMediaSpecificInfo = \
2142 (_SizeMediaSpecificInfo); \
2148 * VOID
2149 * NDIS_SET_PACKET_STATUS(
2150 * IN PNDIS_PACKET Packet,
2151 * IN NDIS_STATUS Status);
2153 #define NDIS_SET_PACKET_STATUS(_Packet, _Status) \
2154 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
2155 (_Packet)->Private.NdisPacketOobOffset))->Status = (_Status)
2159 * VOID
2160 * NDIS_SET_PACKET_TIME_RECEIVED(
2161 * IN PNDIS_PACKET Packet,
2162 * IN ULONGLONG TimeReceived);
2164 #define NDIS_SET_PACKET_TIME_RECEIVED(_Packet, _TimeReceived) \
2165 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
2166 (_Packet)->Private.NdisPacketOobOffset))->TimeReceived = (_TimeReceived)
2170 * VOID
2171 * NDIS_SET_PACKET_TIME_SENT(
2172 * IN PNDIS_PACKET Packet,
2173 * IN ULONGLONG TimeSent);
2175 #define NDIS_SET_PACKET_TIME_SENT(_Packet, _TimeSent) \
2176 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
2177 (_Packet)->Private.NdisPacketOobOffset))->TimeSent = (_TimeSent)
2181 * VOID
2182 * NDIS_SET_PACKET_TIME_TO_SEND(
2183 * IN PNDIS_PACKET Packet,
2184 * IN ULONGLONG TimeToSend);
2186 #define NDIS_SET_PACKET_TIME_TO_SEND(_Packet, _TimeToSend) \
2187 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
2188 (_Packet)->Private.NdisPacketOobOffset))->TimeToSend = (_TimeToSend)
2192 * VOID
2193 * NdisSetSendFlags(
2194 * IN PNDIS_PACKET Packet,
2195 * IN UINT Flags);
2197 #define NdisSetSendFlags(_Packet,_Flags)(_Packet)->Private.Flags = (_Flags)
2201 /* Memory management routines */
2204 * VOID
2205 * NdisCreateLookaheadBufferFromSharedMemory(
2206 * IN PVOID pSharedMemory,
2207 * IN UINT LookaheadLength,
2208 * OUT PVOID *pLookaheadBuffer)
2210 #define NdisCreateLookaheadBufferFromSharedMemory(_pSharedMemory, \
2211 _LookaheadLength, \
2212 _pLookaheadBuffer) \
2213 ((*(_pLookaheadBuffer)) = (_pSharedMemory))
2216 * VOID
2217 * NdisDestroyLookaheadBufferFromSharedMemory(
2218 * IN PVOID pLookaheadBuffer)
2220 #define NdisDestroyLookaheadBufferFromSharedMemory(_pLookaheadBuffer)
2222 #if defined(i386)
2225 * VOID
2226 * NdisMoveFromMappedMemory(
2227 * OUT PVOID Destination,
2228 * IN PVOID Source,
2229 * IN ULONG Length);
2231 #define NdisMoveFromMappedMemory(Destination, Source, Length) \
2232 NdisMoveMappedMemory(Destination, Source, Length)
2235 * VOID
2236 * NdisMoveMappedMemory(
2237 * OUT PVOID Destination,
2238 * IN PVOID Source,
2239 * IN ULONG Length);
2241 #define NdisMoveMappedMemory(Destination, Source, Length) \
2242 RtlCopyMemory(Destination, Source, Length)
2245 * VOID
2246 * NdisMoveToMappedMemory(
2247 * OUT PVOID Destination,
2248 * IN PVOID Source,
2249 * IN ULONG Length);
2251 #define NdisMoveToMappedMemory(Destination, Source, Length) \
2252 NdisMoveMappedMemory(Destination, Source, Length)
2254 #endif /* i386 */
2257 * VOID
2258 * NdisMUpdateSharedMemory(
2259 * IN NDIS_HANDLE MiniportAdapterHandle,
2260 * IN ULONG Length,
2261 * IN PVOID VirtualAddress,
2262 * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
2264 #define NdisMUpdateSharedMemory(_H, _L, _V, _P) \
2265 NdisUpdateSharedMemory(_H, _L, _V, _P)
2267 NDISAPI
2268 NDIS_STATUS
2269 DDKAPI
2270 NdisAllocateMemory(
2271 /*OUT*/ PVOID *VirtualAddress,
2272 /*IN*/ UINT Length,
2273 /*IN*/ UINT MemoryFlags,
2274 /*IN*/ NDIS_PHYSICAL_ADDRESS HighestAcceptableAddress);
2276 NDISAPI
2277 VOID
2278 DDKAPI
2279 NdisFreeMemory(
2280 /*IN*/ PVOID VirtualAddress,
2281 /*IN*/ UINT Length,
2282 /*IN*/ UINT MemoryFlags);
2284 NDISAPI
2285 VOID
2286 DDKAPI
2287 NdisImmediateReadSharedMemory(
2288 /*IN*/ NDIS_HANDLE WrapperConfigurationContext,
2289 /*IN*/ ULONG SharedMemoryAddress,
2290 /*OUT*/ PUCHAR Buffer,
2291 /*IN*/ ULONG Length);
2293 NDISAPI
2294 VOID
2295 DDKAPI
2296 NdisImmediateWriteSharedMemory(
2297 /*IN*/ NDIS_HANDLE WrapperConfigurationContext,
2298 /*IN*/ ULONG SharedMemoryAddress,
2299 /*IN*/ PUCHAR Buffer,
2300 /*IN*/ ULONG Length);
2302 NDISAPI
2303 VOID
2304 DDKAPI
2305 NdisMAllocateSharedMemory(
2306 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
2307 /*IN*/ ULONG Length,
2308 /*IN*/ BOOLEAN Cached,
2309 /*OUT*/ PVOID *VirtualAddress,
2310 /*OUT*/ PNDIS_PHYSICAL_ADDRESS PhysicalAddress);
2312 NDISAPI
2313 NDIS_STATUS
2314 DDKAPI
2315 NdisMAllocateSharedMemoryAsync(
2316 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
2317 /*IN*/ ULONG Length,
2318 /*IN*/ BOOLEAN Cached,
2319 /*IN*/ PVOID Context);
2321 #if defined(NDIS50)
2323 #define NdisUpdateSharedMemory(NdisAdapterHandle, \
2324 Length, \
2325 VirtualAddress, \
2326 PhysicalAddress)
2328 #else
2330 NDISAPI
2331 VOID
2332 DDKAPI
2333 NdisUpdateSharedMemory(
2334 /*IN*/ NDIS_HANDLE NdisAdapterHandle,
2335 /*IN*/ ULONG Length,
2336 /*IN*/ PVOID VirtualAddress,
2337 /*IN*/ NDIS_PHYSICAL_ADDRESS PhysicalAddress);
2339 #endif /* defined(NDIS50) */
2342 * ULONG
2343 * NdisGetPhysicalAddressHigh(
2344 * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
2346 #define NdisGetPhysicalAddressHigh(PhysicalAddress) \
2347 ((PhysicalAddress).HighPart)
2350 * VOID
2351 * NdisSetPhysicalAddressHigh(
2352 * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
2353 * IN ULONG Value);
2355 #define NdisSetPhysicalAddressHigh(PhysicalAddress, Value) \
2356 ((PhysicalAddress).HighPart) = (Value)
2359 * ULONG
2360 * NdisGetPhysicalAddressLow(
2361 * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
2363 #define NdisGetPhysicalAddressLow(PhysicalAddress) \
2364 ((PhysicalAddress).LowPart)
2368 * VOID
2369 * NdisSetPhysicalAddressLow(
2370 * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
2371 * IN ULONG Value);
2373 #define NdisSetPhysicalAddressLow(PhysicalAddress, Value) \
2374 ((PhysicalAddress).LowPart) = (Value)
2377 * VOID
2378 * NDIS_PHYSICAL_ADDRESS_CONST(
2379 * IN ULONG Low,
2380 * IN LONG High);
2382 #define NDIS_PHYSICAL_ADDRESS_CONST(Low, High) \
2383 { {(ULONG)(Low), (LONG)(High)} }
2386 * ULONG
2387 * NdisEqualMemory(
2388 * IN CONST VOID *Source1,
2389 * IN CONST VOID *Source2,
2390 * IN ULONG Length);
2392 #define NdisEqualMemory(Source1, Source2, Length) \
2393 RtlEqualMemory(Source1, Source2, Length)
2396 * VOID
2397 * NdisFillMemory(
2398 * IN PVOID Destination,
2399 * IN ULONG Length,
2400 * IN UCHAR Fill);
2402 #define NdisFillMemory(Destination, Length, Fill) \
2403 RtlFillMemory(Destination, Length, Fill)
2406 * VOID
2407 * NdisZeroMappedMemory(
2408 * IN PVOID Destination,
2409 * IN ULONG Length);
2411 #define NdisZeroMappedMemory(Destination, Length) \
2412 RtlZeroMemory(Destination, Length)
2415 * VOID
2416 * NdisMoveMemory(
2417 * OUT PVOID Destination,
2418 * IN PVOID Source,
2419 * IN ULONG Length);
2421 #define NdisMoveMemory(Destination, Source, Length) \
2422 RtlCopyMemory(Destination, Source, Length)
2426 * VOID
2427 * NdisRetrieveUlong(
2428 * IN PULONG DestinationAddress,
2429 * IN PULONG SourceAddress);
2431 #define NdisRetrieveUlong(DestinationAddress, SourceAddress) \
2432 RtlRetrieveUlong(DestinationAddress, SourceAddress)
2436 * VOID
2437 * NdisStoreUlong(
2438 * IN PULONG DestinationAddress,
2439 * IN ULONG Value);
2441 #define NdisStoreUlong(DestinationAddress, Value) \
2442 RtlStoreUlong(DestinationAddress, Value)
2446 * VOID
2447 * NdisZeroMemory(
2448 * IN PVOID Destination,
2449 * IN ULONG Length)
2451 #define NdisZeroMemory(Destination, Length) \
2452 RtlZeroMemory(Destination, Length)
2456 /* Configuration routines */
2458 NDISAPI
2459 VOID
2460 DDKAPI
2461 NdisOpenConfiguration(
2462 /*OUT*/ PNDIS_STATUS Status,
2463 /*OUT*/ PNDIS_HANDLE ConfigurationHandle,
2464 /*IN*/ NDIS_HANDLE WrapperConfigurationContext);
2466 NDISAPI
2467 VOID
2468 DDKAPI
2469 NdisReadNetworkAddress(
2470 /*OUT*/ PNDIS_STATUS Status,
2471 /*OUT*/ PVOID *NetworkAddress,
2472 /*OUT*/ PUINT NetworkAddressLength,
2473 /*IN*/ NDIS_HANDLE ConfigurationHandle);
2475 NDISAPI
2476 VOID
2477 DDKAPI
2478 NdisReadEisaSlotInformation(
2479 /*OUT*/ PNDIS_STATUS Status,
2480 /*IN*/ NDIS_HANDLE WrapperConfigurationContext,
2481 /*OUT*/ PUINT SlotNumber,
2482 /*OUT*/ PNDIS_EISA_FUNCTION_INFORMATION EisaData);
2484 NDISAPI
2485 VOID
2486 DDKAPI
2487 NdisReadEisaSlotInformationEx(
2488 /*OUT*/ PNDIS_STATUS Status,
2489 /*IN*/ NDIS_HANDLE WrapperConfigurationContext,
2490 /*OUT*/ PUINT SlotNumber,
2491 /*OUT*/ PNDIS_EISA_FUNCTION_INFORMATION *EisaData,
2492 /*OUT*/ PUINT NumberOfFunctions);
2494 NDISAPI
2495 ULONG
2496 DDKAPI
2497 NdisReadPciSlotInformation(
2498 /*IN*/ NDIS_HANDLE NdisAdapterHandle,
2499 /*IN*/ ULONG SlotNumber,
2500 /*IN*/ ULONG Offset,
2501 /*IN*/ PVOID Buffer,
2502 /*IN*/ ULONG Length);
2504 NDISAPI
2505 ULONG
2506 DDKAPI
2507 NdisWritePciSlotInformation(
2508 /*IN*/ NDIS_HANDLE NdisAdapterHandle,
2509 /*IN*/ ULONG SlotNumber,
2510 /*IN*/ ULONG Offset,
2511 /*IN*/ PVOID Buffer,
2512 /*IN*/ ULONG Length);
2516 /* String management routines */
2518 NDISAPI
2519 NDIS_STATUS
2520 DDKAPI
2521 NdisAnsiStringToUnicodeString(
2522 /*IN OUT*/ PNDIS_STRING DestinationString,
2523 /*IN*/ PNDIS_ANSI_STRING SourceString);
2526 * BOOLEAN
2527 * NdisEqualString(
2528 * IN PNDIS_STRING String1,
2529 * IN PNDIS_STRING String2,
2530 * IN BOOLEAN CaseInsensitive);
2532 #define NdisEqualString(_String1, _String2, _CaseInsensitive) \
2533 RtlEqualUnicodeString(_String1, _String2, _CaseInsensitive)
2535 NDISAPI
2536 VOID
2537 DDKAPI
2538 NdisInitAnsiString(
2539 /*IN OUT*/ PNDIS_ANSI_STRING DestinationString,
2540 /*IN*/ PCSTR SourceString);
2542 NDISAPI
2543 VOID
2544 DDKAPI
2545 NdisInitUnicodeString(
2546 /*IN OUT*/ PNDIS_STRING DestinationString,
2547 /*IN*/ PCWSTR SourceString);
2549 NDISAPI
2550 NDIS_STATUS
2551 DDKAPI
2552 NdisUnicodeStringToAnsiString(
2553 /*IN OUT*/ PNDIS_ANSI_STRING DestinationString,
2554 /*IN*/ PNDIS_STRING SourceString);
2556 #define NdisFreeString(_s) NdisFreeMemory((_s).Buffer, (_s).MaximumLength, 0)
2557 #define NdisPrintString(_s) DbgPrint("%ls", (_s).Buffer)
2560 /* Spin lock reoutines */
2563 * VOID
2564 * NdisAllocateSpinLock(
2565 * IN PNDIS_SPIN_LOCK SpinLock);
2567 #define NdisAllocateSpinLock(_SpinLock) \
2568 KeInitializeSpinLock(&(_SpinLock)->SpinLock)
2571 * VOID
2572 * NdisFreeSpinLock(
2573 * IN PNDIS_SPIN_LOCK SpinLock);
2575 #define NdisFreeSpinLock(_SpinLock)
2578 * VOID
2579 * NdisAcquireSpinLock(
2580 * IN PNDIS_SPIN_LOCK SpinLock);
2582 #define NdisAcquireSpinLock(_SpinLock) \
2583 KeAcquireSpinLock(&(_SpinLock)->SpinLock, &(_SpinLock)->OldIrql)
2586 * VOID
2587 * NdisReleaseSpinLock(
2588 * IN PNDIS_SPIN_LOCK SpinLock);
2590 #define NdisReleaseSpinLock(_SpinLock) \
2591 KeReleaseSpinLock(&(_SpinLock)->SpinLock, (_SpinLock)->OldIrql)
2594 * VOID
2595 * NdisDprAcquireSpinLock(
2596 * IN PNDIS_SPIN_LOCK SpinLock);
2598 #define NdisDprAcquireSpinLock(_SpinLock) \
2600 KeAcquireSpinLockAtDpcLevel(&(_SpinLock)->SpinLock); \
2601 (_SpinLock)->OldIrql = DISPATCH_LEVEL; \
2605 * VOID
2606 * NdisDprReleaseSpinLock(
2607 * IN PNDIS_SPIN_LOCK SpinLock);
2609 #define NdisDprReleaseSpinLock(_SpinLock) \
2610 KeReleaseSpinLockFromDpcLevel(&(_SpinLock)->SpinLock)
2614 /* I/O routines */
2617 * VOID
2618 * NdisRawReadPortBufferUchar(
2619 * IN ULONG Port,
2620 * OUT PUCHAR Buffer,
2621 * IN ULONG Length);
2623 #define NdisRawReadPortBufferUchar(Port, Buffer, Length) \
2624 READ_PORT_BUFFER_UCHAR((PUCHAR)(Port), (PUCHAR)(Buffer), (Length))
2627 * VOID
2628 * NdisRawReadPortBufferUlong(
2629 * IN ULONG Port,
2630 * OUT PULONG Buffer,
2631 * IN ULONG Length);
2633 #define NdisRawReadPortBufferUlong(Port, Buffer, Length) \
2634 READ_PORT_BUFFER_ULONG((PULONG)(Port), (PULONG)(Buffer), (Length))
2637 * VOID
2638 * NdisRawReadPortBufferUshort(
2639 * IN ULONG Port,
2640 * OUT PUSHORT Buffer,
2641 * IN ULONG Length);
2643 #define NdisRawReadPortBufferUshort(Port, Buffer, Length) \
2644 READ_PORT_BUFFER_USHORT((PUSHORT)(Port), (PUSHORT)(Buffer), (Length))
2648 * VOID
2649 * NdisRawReadPortUchar(
2650 * IN ULONG Port,
2651 * OUT PUCHAR Data);
2653 #define NdisRawReadPortUchar(Port, Data) \
2654 *(Data) = READ_PORT_UCHAR((PUCHAR)(Port))
2657 * VOID
2658 * NdisRawReadPortUlong(
2659 * IN ULONG Port,
2660 * OUT PULONG Data);
2662 #define NdisRawReadPortUlong(Port, Data) \
2663 *(Data) = READ_PORT_ULONG((PULONG)(Port))
2666 * VOID
2667 * NdisRawReadPortUshort(
2668 * IN ULONG Port,
2669 * OUT PUSHORT Data);
2671 #define NdisRawReadPortUshort(Port, Data) \
2672 *(Data) = READ_PORT_USHORT((PUSHORT)(Port))
2676 * VOID
2677 * NdisRawWritePortBufferUchar(
2678 * IN ULONG Port,
2679 * IN PUCHAR Buffer,
2680 * IN ULONG Length);
2682 #define NdisRawWritePortBufferUchar(Port, Buffer, Length) \
2683 WRITE_PORT_BUFFER_UCHAR((PUCHAR)(Port), (PUCHAR)(Buffer), (Length))
2686 * VOID
2687 * NdisRawWritePortBufferUlong(
2688 * IN ULONG Port,
2689 * IN PULONG Buffer,
2690 * IN ULONG Length);
2692 #define NdisRawWritePortBufferUlong(Port, Buffer, Length) \
2693 WRITE_PORT_BUFFER_ULONG((PULONG)(Port), (PULONG)(Buffer), (Length))
2696 * VOID
2697 * NdisRawWritePortBufferUshort(
2698 * IN ULONG Port,
2699 * IN PUSHORT Buffer,
2700 * IN ULONG Length);
2702 #define NdisRawWritePortBufferUshort(Port, Buffer, Length) \
2703 WRITE_PORT_BUFFER_USHORT((PUSHORT)(Port), (PUSHORT)(Buffer), (Length))
2707 * VOID
2708 * NdisRawWritePortUchar(
2709 * IN ULONG Port,
2710 * IN UCHAR Data);
2712 #define NdisRawWritePortUchar(Port, Data) \
2713 WRITE_PORT_UCHAR((PUCHAR)(Port), (UCHAR)(Data))
2716 * VOID
2717 * NdisRawWritePortUlong(
2718 * IN ULONG Port,
2719 * IN ULONG Data);
2721 #define NdisRawWritePortUlong(Port, Data) \
2722 WRITE_PORT_ULONG((PULONG)(Port), (ULONG)(Data))
2725 * VOID
2726 * NdisRawWritePortUshort(
2727 * IN ULONG Port,
2728 * IN USHORT Data);
2730 #define NdisRawWritePortUshort(Port, Data) \
2731 WRITE_PORT_USHORT((PUSHORT)(Port), (USHORT)(Data))
2735 * VOID
2736 * NdisReadRegisterUchar(
2737 * IN PUCHAR Register,
2738 * OUT PUCHAR Data);
2740 #define NdisReadRegisterUchar(Register, Data) \
2741 *(Data) = *(Register)
2744 * VOID
2745 * NdisReadRegisterUlong(
2746 * IN PULONG Register,
2747 * OUT PULONG Data);
2749 #define NdisReadRegisterUlong(Register, Data) \
2750 *(Data) = *(Register)
2753 * VOID
2754 * NdisReadRegisterUshort(
2755 * IN PUSHORT Register,
2756 * OUT PUSHORT Data);
2758 #define NdisReadRegisterUshort(Register, Data) \
2759 *(Data) = *(Register)
2762 * VOID
2763 * NdisReadRegisterUchar(
2764 * IN PUCHAR Register,
2765 * IN UCHAR Data);
2767 #define NdisWriteRegisterUchar(Register, Data) \
2768 WRITE_REGISTER_UCHAR((Register), (Data))
2771 * VOID
2772 * NdisReadRegisterUlong(
2773 * IN PULONG Register,
2774 * IN ULONG Data);
2776 #define NdisWriteRegisterUlong(Register, Data) \
2777 WRITE_REGISTER_ULONG((Register), (Data))
2780 * VOID
2781 * NdisReadRegisterUshort(
2782 * IN PUSHORT Register,
2783 * IN USHORT Data);
2785 #define NdisWriteRegisterUshort(Register, Data) \
2786 WRITE_REGISTER_USHORT((Register), (Data))
2789 /* Linked lists */
2792 * VOID
2793 * NdisInitializeListHead(
2794 * IN PLIST_ENTRY ListHead);
2796 #define NdisInitializeListHead(_ListHead) \
2797 InitializeListHead(_ListHead)
2800 * PLIST_ENTRY
2801 * NdisInterlockedInsertHeadList(
2802 * IN PLIST_ENTRY ListHead,
2803 * IN PLIST_ENTRY ListEntry,
2804 * IN PNDIS_SPIN_LOCK SpinLock);
2806 #define NdisInterlockedInsertHeadList(_ListHead, _ListEntry, _SpinLock) \
2807 ExInterlockedInsertHeadList(_ListHead, _ListEntry, &(_SpinLock)->SpinLock)
2810 * PLIST_ENTRY
2811 * NdisInterlockedInsertTailList(
2812 * IN PLIST_ENTRY ListHead,
2813 * IN PLIST_ENTRY ListEntry,
2814 * IN PNDIS_SPIN_LOCK SpinLock);
2816 #define NdisInterlockedInsertTailList(_ListHead, _ListEntry, _SpinLock) \
2817 ExInterlockedInsertTailList(_ListHead, _ListEntry, &(_SpinLock)->SpinLock)
2820 * PLIST_ENTRY
2821 * NdisInterlockedRemoveHeadList(
2822 * IN PLIST_ENTRY ListHead,
2823 * IN PNDIS_SPIN_LOCK SpinLock);
2825 #define NdisInterlockedRemoveHeadList(_ListHead, _SpinLock) \
2826 ExInterlockedRemoveHeadList(_ListHead, &(_SpinLock)->SpinLock)
2829 * VOID
2830 * NdisInitializeSListHead(
2831 * IN PSLIST_HEADER SListHead);
2833 #define NdisInitializeSListHead(SListHead) ExInitializeSListHead(SListHead)
2836 * USHORT NdisQueryDepthSList(
2837 * IN PSLIST_HEADER SListHead);
2839 #define NdisQueryDepthSList(SListHead) ExQueryDepthSList(SListHead)
2843 /* Interlocked routines */
2846 * LONG
2847 * NdisInterlockedDecrement(
2848 * IN PLONG Addend);
2850 #define NdisInterlockedDecrement(Addend) InterlockedDecrement(Addend)
2853 * LONG
2854 * NdisInterlockedIncrement(
2855 * IN PLONG Addend);
2857 #define NdisInterlockedIncrement(Addend) InterlockedIncrement(Addend)
2860 * VOID
2861 * NdisInterlockedAddUlong(
2862 * IN PULONG Addend,
2863 * IN ULONG Increment,
2864 * IN PNDIS_SPIN_LOCK SpinLock);
2866 #define NdisInterlockedAddUlong(_Addend, _Increment, _SpinLock) \
2867 ExInterlockedAddUlong(_Addend, _Increment, &(_SpinLock)->SpinLock)
2871 /* Miscellaneous routines */
2873 NDISAPI
2874 VOID
2875 DDKAPI
2876 NdisCloseConfiguration(
2877 /*IN*/ NDIS_HANDLE ConfigurationHandle);
2879 NDISAPI
2880 VOID
2881 DDKAPI
2882 NdisReadConfiguration(
2883 /*OUT*/ PNDIS_STATUS Status,
2884 /*OUT*/ PNDIS_CONFIGURATION_PARAMETER *ParameterValue,
2885 /*IN*/ NDIS_HANDLE ConfigurationHandle,
2886 /*IN*/ PNDIS_STRING Keyword,
2887 /*IN*/ NDIS_PARAMETER_TYPE ParameterType);
2889 NDISAPI
2890 VOID
2891 DDKAPI
2892 NdisWriteConfiguration(
2893 /*OUT*/ PNDIS_STATUS Status,
2894 /*IN*/ NDIS_HANDLE WrapperConfigurationContext,
2895 /*IN*/ PNDIS_STRING Keyword,
2896 /*IN*/ PNDIS_CONFIGURATION_PARAMETER *ParameterValue);
2898 NDISAPI
2899 VOID
2900 DDKCDECLAPI
2901 NdisWriteErrorLogEntry(
2902 /*IN*/ NDIS_HANDLE NdisAdapterHandle,
2903 /*IN*/ NDIS_ERROR_CODE ErrorCode,
2904 /*IN*/ ULONG NumberOfErrorValues,
2905 /*IN*/ ...);
2908 * VOID
2909 * NdisStallExecution(
2910 * IN UINT MicrosecondsToStall)
2912 #define NdisStallExecution KeStallExecutionProcessor
2915 * VOID
2916 * NdisGetCurrentSystemTime(
2917 * IN PLARGE_INTEGER pSystemTime);
2919 #define NdisGetCurrentSystemTime KeQuerySystemTime
2921 NDISAPI
2922 VOID
2923 DDKAPI
2924 NdisGetCurrentProcessorCpuUsage(
2925 /*OUT*/ PULONG pCpuUsage);
2929 /* NDIS helper macros */
2932 * VOID
2933 * NDIS_INIT_FUNCTION(FunctionName)
2935 #define NDIS_INIT_FUNCTION(FunctionName) \
2936 alloc_text(init, FunctionName)
2939 * VOID
2940 * NDIS_PAGABLE_FUNCTION(FunctionName)
2942 #define NDIS_PAGEABLE_FUNCTION(FunctionName) \
2943 alloc_text(page, FunctionName)
2945 #define NDIS_PAGABLE_FUNCTION NDIS_PAGEABLE_FUNCTION
2948 /* NDIS 4.0 extensions */
2950 NDISAPI
2951 VOID
2952 DDKAPI
2953 NdisMFreeSharedMemory(
2954 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
2955 /*IN*/ ULONG Length,
2956 /*IN*/ BOOLEAN Cached,
2957 /*IN*/ PVOID VirtualAddress,
2958 /*IN*/ NDIS_PHYSICAL_ADDRESS PhysicalAddress);
2960 NDISAPI
2961 VOID
2962 DDKAPI
2963 NdisMWanIndicateReceive(
2964 /*OUT*/ PNDIS_STATUS Status,
2965 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
2966 /*IN*/ NDIS_HANDLE NdisLinkContext,
2967 /*IN*/ PUCHAR PacketBuffer,
2968 /*IN*/ UINT PacketSize);
2970 NDISAPI
2971 VOID
2972 DDKAPI
2973 NdisMWanIndicateReceiveComplete(
2974 /*IN*/ NDIS_HANDLE MiniportAdapterHandle);
2976 NDISAPI
2977 VOID
2978 DDKAPI
2979 NdisMWanSendComplete(
2980 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
2981 /*IN*/ PNDIS_WAN_PACKET Packet,
2982 /*IN*/ NDIS_STATUS Status);
2984 NDISAPI
2985 NDIS_STATUS
2986 DDKAPI
2987 NdisPciAssignResources(
2988 /*IN*/ NDIS_HANDLE NdisMacHandle,
2989 /*IN*/ NDIS_HANDLE NdisWrapperHandle,
2990 /*IN*/ NDIS_HANDLE WrapperConfigurationContext,
2991 /*IN*/ ULONG SlotNumber,
2992 /*OUT*/ PNDIS_RESOURCE_LIST *AssignedResources);
2995 /* NDIS 5.0 extensions */
2997 NDISAPI
2998 VOID
2999 DDKAPI
3000 NdisAcquireReadWriteLock(
3001 /*IN*/ PNDIS_RW_LOCK Lock,
3002 /*IN*/ BOOLEAN fWrite,
3003 /*IN*/ PLOCK_STATE LockState);
3005 NDISAPI
3006 NDIS_STATUS
3007 DDKAPI
3008 NdisAllocateMemoryWithTag(
3009 /*OUT*/ PVOID *VirtualAddress,
3010 /*IN*/ UINT Length,
3011 /*IN*/ ULONG Tag);
3013 NDISAPI
3014 VOID
3015 DDKAPI
3016 NdisAllocatePacketPoolEx(
3017 /*OUT*/ PNDIS_STATUS Status,
3018 /*OUT*/ PNDIS_HANDLE PoolHandle,
3019 /*IN*/ UINT NumberOfDescriptors,
3020 /*IN*/ UINT NumberOfOverflowDescriptors,
3021 /*IN*/ UINT ProtocolReservedLength);
3023 NDISAPI
3024 VOID
3025 DDKAPI
3026 NdisCompletePnPEvent(
3027 /*IN*/ NDIS_STATUS Status,
3028 /*IN*/ NDIS_HANDLE NdisBindingHandle,
3029 /*IN*/ PNET_PNP_EVENT NetPnPEvent);
3031 NDISAPI
3032 VOID
3033 DDKAPI
3034 NdisGetCurrentProcessorCounts(
3035 /*OUT*/ PULONG pIdleCount,
3036 /*OUT*/ PULONG pKernelAndUser,
3037 /*OUT*/ PULONG pIndex);
3039 NDISAPI
3040 VOID
3041 DDKAPI
3042 NdisGetDriverHandle(
3043 /*IN*/ PNDIS_HANDLE NdisBindingHandle,
3044 /*OUT*/ PNDIS_HANDLE NdisDriverHandle);
3046 NDISAPI
3047 PNDIS_PACKET
3048 DDKAPI
3049 NdisGetReceivedPacket(
3050 /*IN*/ PNDIS_HANDLE NdisBindingHandle,
3051 /*IN*/ PNDIS_HANDLE MacContext);
3053 NDISAPI
3054 VOID
3055 DDKAPI
3056 NdisGetSystemUptime(
3057 /*OUT*/ PULONG pSystemUpTime);
3059 NDISAPI
3060 VOID
3061 DDKAPI
3062 NdisInitializeReadWriteLock(
3063 /*IN*/ PNDIS_RW_LOCK Lock);
3065 NDISAPI
3066 NDIS_STATUS
3067 DDKAPI
3068 NdisMDeregisterDevice(
3069 /*IN*/ NDIS_HANDLE NdisDeviceHandle);
3071 NDISAPI
3072 VOID
3073 DDKAPI
3074 NdisMGetDeviceProperty(
3075 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
3076 /*IN OUT*/ PDEVICE_OBJECT *PhysicalDeviceObject /*OPTIONAL*/,
3077 /*IN OUT*/ PDEVICE_OBJECT *FunctionalDeviceObject /*OPTIONAL*/,
3078 /*IN OUT*/ PDEVICE_OBJECT *NextDeviceObject /*OPTIONAL*/,
3079 /*IN OUT*/ PCM_RESOURCE_LIST *AllocatedResources /*OPTIONAL*/,
3080 /*IN OUT*/ PCM_RESOURCE_LIST *AllocatedResourcesTranslated /*OPTIONAL*/);
3082 NDISAPI
3083 NDIS_STATUS
3084 DDKAPI
3085 NdisMInitializeScatterGatherDma(
3086 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
3087 /*IN*/ BOOLEAN Dma64BitAddresses,
3088 /*IN*/ ULONG MaximumPhysicalMapping);
3090 NDISAPI
3091 NDIS_STATUS
3092 DDKAPI
3093 NdisMPromoteMiniport(
3094 /*IN*/ NDIS_HANDLE MiniportAdapterHandle);
3096 NDISAPI
3097 NDIS_STATUS
3098 DDKAPI
3099 NdisMQueryAdapterInstanceName(
3100 /*OUT*/ PNDIS_STRING AdapterInstanceName,
3101 /*IN*/ NDIS_HANDLE MiniportAdapterHandle);
3103 NDISAPI
3104 NDIS_STATUS
3105 DDKAPI
3106 NdisMRegisterDevice(
3107 /*IN*/ NDIS_HANDLE NdisWrapperHandle,
3108 /*IN*/ PNDIS_STRING DeviceName,
3109 /*IN*/ PNDIS_STRING SymbolicName,
3110 /*IN*/ PDRIVER_DISPATCH MajorFunctions[],
3111 /*OUT*/ PDEVICE_OBJECT *pDeviceObject,
3112 /*OUT*/ NDIS_HANDLE *NdisDeviceHandle);
3114 NDISAPI
3115 VOID
3116 DDKAPI
3117 NdisMRegisterUnloadHandler(
3118 /*IN*/ NDIS_HANDLE NdisWrapperHandle,
3119 /*IN*/ PDRIVER_UNLOAD UnloadHandler);
3121 NDISAPI
3122 NDIS_STATUS
3123 DDKAPI
3124 NdisMRemoveMiniport(
3125 /*IN*/ NDIS_HANDLE MiniportAdapterHandle);
3127 NDISAPI
3128 NDIS_STATUS
3129 DDKAPI
3130 NdisMSetMiniportSecondary(
3131 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
3132 /*IN*/ NDIS_HANDLE PrimaryMiniportAdapterHandle);
3134 NDISAPI
3135 VOID
3136 DDKAPI
3137 NdisOpenConfigurationKeyByIndex(
3138 /*OUT*/ PNDIS_STATUS Status,
3139 /*IN*/ NDIS_HANDLE ConfigurationHandle,
3140 /*IN*/ ULONG Index,
3141 /*OUT*/ PNDIS_STRING KeyName,
3142 /*OUT*/ PNDIS_HANDLE KeyHandle);
3144 NDISAPI
3145 VOID
3146 DDKAPI
3147 NdisOpenConfigurationKeyByName(
3148 /*OUT*/ PNDIS_STATUS Status,
3149 /*IN*/ NDIS_HANDLE ConfigurationHandle,
3150 /*IN*/ PNDIS_STRING SubKeyName,
3151 /*OUT*/ PNDIS_HANDLE SubKeyHandle);
3153 NDISAPI
3154 UINT
3155 DDKAPI
3156 NdisPacketPoolUsage(
3157 /*IN*/ NDIS_HANDLE PoolHandle);
3159 NDISAPI
3160 NDIS_STATUS
3161 DDKAPI
3162 NdisQueryAdapterInstanceName(
3163 /*OUT*/ PNDIS_STRING AdapterInstanceName,
3164 /*IN*/ NDIS_HANDLE NdisBindingHandle);
3166 NDISAPI
3167 ULONG
3168 DDKAPI
3169 NdisReadPcmciaAttributeMemory(
3170 /*IN*/ NDIS_HANDLE NdisAdapterHandle,
3171 /*IN*/ ULONG Offset,
3172 /*IN*/ PVOID Buffer,
3173 /*IN*/ ULONG Length);
3175 NDISAPI
3176 VOID
3177 DDKAPI
3178 NdisReleaseReadWriteLock(
3179 /*IN*/ PNDIS_RW_LOCK Lock,
3180 /*IN*/ PLOCK_STATE LockState);
3182 NDISAPI
3183 NDIS_STATUS
3184 DDKAPI
3185 NdisWriteEventLogEntry(
3186 /*IN*/ PVOID LogHandle,
3187 /*IN*/ NDIS_STATUS EventCode,
3188 /*IN*/ ULONG UniqueEventValue,
3189 /*IN*/ USHORT NumStrings,
3190 /*IN*/ PVOID StringsList /*OPTIONAL*/,
3191 /*IN*/ ULONG DataSize,
3192 /*IN*/ PVOID Data /*OPTIONAL*/);
3194 NDISAPI
3195 ULONG
3196 DDKAPI
3197 NdisWritePcmciaAttributeMemory(
3198 /*IN*/ NDIS_HANDLE NdisAdapterHandle,
3199 /*IN*/ ULONG Offset,
3200 /*IN*/ PVOID Buffer,
3201 /*IN*/ ULONG Length);
3204 /* Connectionless services */
3206 NDISAPI
3207 NDIS_STATUS
3208 DDKAPI
3209 NdisClAddParty(
3210 /*IN*/ NDIS_HANDLE NdisVcHandle,
3211 /*IN*/ NDIS_HANDLE ProtocolPartyContext,
3212 /*IN OUT*/ PCO_CALL_PARAMETERS CallParameters,
3213 /*OUT*/ PNDIS_HANDLE NdisPartyHandle);
3215 NDISAPI
3216 NDIS_STATUS
3217 DDKAPI
3218 NdisClCloseAddressFamily(
3219 /*IN*/ NDIS_HANDLE NdisAfHandle);
3221 NDISAPI
3222 NDIS_STATUS
3223 DDKAPI
3224 NdisClCloseCall(
3225 /*IN*/ NDIS_HANDLE NdisVcHandle,
3226 /*IN*/ NDIS_HANDLE NdisPartyHandle /*OPTIONAL*/,
3227 /*IN*/ PVOID Buffer /*OPTIONAL*/,
3228 /*IN*/ UINT Size);
3230 NDISAPI
3231 NDIS_STATUS
3232 DDKAPI
3233 NdisClDeregisterSap(
3234 /*IN*/ NDIS_HANDLE NdisSapHandle);
3236 NDISAPI
3237 NDIS_STATUS
3238 DDKAPI
3239 NdisClDropParty(
3240 /*IN*/ NDIS_HANDLE NdisPartyHandle,
3241 /*IN*/ PVOID Buffer /*OPTIONAL*/,
3242 /*IN*/ UINT Size);
3244 NDISAPI
3245 VOID
3246 DDKAPI
3247 NdisClIncomingCallComplete(
3248 /*IN*/ NDIS_STATUS Status,
3249 /*IN*/ NDIS_HANDLE NdisVcHandle,
3250 /*IN*/ PCO_CALL_PARAMETERS CallParameters);
3252 NDISAPI
3253 NDIS_STATUS
3254 DDKAPI
3255 NdisClMakeCall(
3256 /*IN*/ NDIS_HANDLE NdisVcHandle,
3257 /*IN OUT*/ PCO_CALL_PARAMETERS CallParameters,
3258 /*IN*/ NDIS_HANDLE ProtocolPartyContext /*OPTIONAL*/,
3259 /*OUT*/ PNDIS_HANDLE NdisPartyHandle /*OPTIONAL*/);
3261 NDISAPI
3262 NDIS_STATUS
3263 DDKAPI
3264 NdisClModifyCallQoS(
3265 /*IN*/ NDIS_HANDLE NdisVcHandle,
3266 /*IN*/ PCO_CALL_PARAMETERS CallParameters);
3269 NDISAPI
3270 NDIS_STATUS
3271 DDKAPI
3272 NdisClOpenAddressFamily(
3273 /*IN*/ NDIS_HANDLE NdisBindingHandle,
3274 /*IN*/ PCO_ADDRESS_FAMILY AddressFamily,
3275 /*IN*/ NDIS_HANDLE ProtocolAfContext,
3276 /*IN*/ PNDIS_CLIENT_CHARACTERISTICS ClCharacteristics,
3277 /*IN*/ UINT SizeOfClCharacteristics,
3278 /*OUT*/ PNDIS_HANDLE NdisAfHandle);
3280 NDISAPI
3281 NDIS_STATUS
3282 DDKAPI
3283 NdisClRegisterSap(
3284 /*IN*/ NDIS_HANDLE NdisAfHandle,
3285 /*IN*/ NDIS_HANDLE ProtocolSapContext,
3286 /*IN*/ PCO_SAP Sap,
3287 /*OUT*/ PNDIS_HANDLE NdisSapHandle);
3290 /* Call Manager services */
3292 NDISAPI
3293 NDIS_STATUS
3294 DDKAPI
3295 NdisCmActivateVc(
3296 /*IN*/ NDIS_HANDLE NdisVcHandle,
3297 /*IN OUT*/ PCO_CALL_PARAMETERS CallParameters);
3299 NDISAPI
3300 VOID
3301 DDKAPI
3302 NdisCmAddPartyComplete(
3303 /*IN*/ NDIS_STATUS Status,
3304 /*IN*/ NDIS_HANDLE NdisPartyHandle,
3305 /*IN*/ NDIS_HANDLE CallMgrPartyContext /*OPTIONAL*/,
3306 /*IN*/ PCO_CALL_PARAMETERS CallParameters);
3308 NDISAPI
3309 VOID
3310 DDKAPI
3311 NdisCmCloseAddressFamilyComplete(
3312 /*IN*/ NDIS_STATUS Status,
3313 /*IN*/ NDIS_HANDLE NdisAfHandle);
3315 NDISAPI
3316 VOID
3317 DDKAPI
3318 NdisCmCloseCallComplete(
3319 /*IN*/ NDIS_STATUS Status,
3320 /*IN*/ NDIS_HANDLE NdisVcHandle,
3321 /*IN*/ NDIS_HANDLE NdisPartyHandle /*OPTIONAL*/);
3323 NDISAPI
3324 NDIS_STATUS
3325 DDKAPI
3326 NdisCmDeactivateVc(
3327 /*IN*/ NDIS_HANDLE NdisVcHandle);
3329 NDISAPI
3330 VOID
3331 DDKAPI
3332 NdisCmDeregisterSapComplete(
3333 /*IN*/ NDIS_STATUS Status,
3334 /*IN*/ NDIS_HANDLE NdisSapHandle);
3336 NDISAPI
3337 VOID
3338 DDKAPI
3339 NdisCmDispatchCallConnected(
3340 /*IN*/ NDIS_HANDLE NdisVcHandle);
3342 NDISAPI
3343 NDIS_STATUS
3344 DDKAPI
3345 NdisCmDispatchIncomingCall(
3346 /*IN*/ NDIS_HANDLE NdisSapHandle,
3347 /*IN*/ NDIS_HANDLE NdisVcHandle,
3348 /*IN*/ PCO_CALL_PARAMETERS CallParameters);
3350 NDISAPI
3351 VOID
3352 DDKAPI
3353 NdisCmDispatchIncomingCallQoSChange(
3354 /*IN*/ NDIS_HANDLE NdisVcHandle,
3355 /*IN*/ PCO_CALL_PARAMETERS CallParameters);
3357 NDISAPI
3358 VOID
3359 DDKAPI
3360 NdisCmDispatchIncomingCloseCall(
3361 /*IN*/ NDIS_STATUS CloseStatus,
3362 /*IN*/ NDIS_HANDLE NdisVcHandle,
3363 /*IN*/ PVOID Buffer /*OPTIONAL*/,
3364 /*IN*/ UINT Size);
3366 NDISAPI
3367 VOID
3368 DDKAPI
3369 NdisCmDispatchIncomingDropParty(
3370 /*IN*/ NDIS_STATUS DropStatus,
3371 /*IN*/ NDIS_HANDLE NdisPartyHandle,
3372 /*IN*/ PVOID Buffer /*OPTIONAL*/,
3373 /*IN*/ UINT Size);
3375 NDISAPI
3376 VOID
3377 DDKAPI
3378 NdisCmDropPartyComplete(
3379 /*IN*/ NDIS_STATUS Status,
3380 /*IN*/ NDIS_HANDLE NdisPartyHandle);
3382 NDISAPI
3383 VOID
3384 DDKAPI
3385 NdisCmMakeCallComplete(
3386 /*IN*/ NDIS_STATUS Status,
3387 /*IN*/ NDIS_HANDLE NdisVcHandle,
3388 /*IN*/ NDIS_HANDLE NdisPartyHandle /*OPTIONAL*/,
3389 /*IN*/ NDIS_HANDLE CallMgrPartyContext /*OPTIONAL*/,
3390 /*IN*/ PCO_CALL_PARAMETERS CallParameters);
3392 NDISAPI
3393 VOID
3394 DDKAPI
3395 NdisCmModifyCallQoSComplete(
3396 /*IN*/ NDIS_STATUS Status,
3397 /*IN*/ NDIS_HANDLE NdisVcHandle,
3398 /*IN*/ PCO_CALL_PARAMETERS CallParameters);
3400 NDISAPI
3401 VOID
3402 DDKAPI
3403 NdisCmOpenAddressFamilyComplete(
3404 /*IN*/ NDIS_STATUS Status,
3405 /*IN*/ NDIS_HANDLE NdisAfHandle,
3406 /*IN*/ NDIS_HANDLE CallMgrAfContext);
3408 NDISAPI
3409 NDIS_STATUS
3410 DDKAPI
3411 NdisCmRegisterAddressFamily(
3412 /*IN*/ NDIS_HANDLE NdisBindingHandle,
3413 /*IN*/ PCO_ADDRESS_FAMILY AddressFamily,
3414 /*IN*/ PNDIS_CALL_MANAGER_CHARACTERISTICS CmCharacteristics,
3415 /*IN*/ UINT SizeOfCmCharacteristics);
3417 NDISAPI
3418 VOID
3419 DDKAPI
3420 NdisCmRegisterSapComplete(
3421 /*IN*/ NDIS_STATUS Status,
3422 /*IN*/ NDIS_HANDLE NdisSapHandle,
3423 /*IN*/ NDIS_HANDLE CallMgrSapContext);
3426 NDISAPI
3427 NDIS_STATUS
3428 DDKAPI
3429 NdisMCmActivateVc(
3430 /*IN*/ NDIS_HANDLE NdisVcHandle,
3431 /*IN*/ PCO_CALL_PARAMETERS CallParameters);
3433 NDISAPI
3434 NDIS_STATUS
3435 DDKAPI
3436 NdisMCmCreateVc(
3437 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
3438 /*IN*/ NDIS_HANDLE NdisAfHandle,
3439 /*IN*/ NDIS_HANDLE MiniportVcContext,
3440 /*OUT*/ PNDIS_HANDLE NdisVcHandle);
3442 NDISAPI
3443 NDIS_STATUS
3444 DDKAPI
3445 NdisMCmDeactivateVc(
3446 /*IN*/ NDIS_HANDLE NdisVcHandle);
3448 NDISAPI
3449 NDIS_STATUS
3450 DDKAPI
3451 NdisMCmDeleteVc(
3452 /*IN*/ NDIS_HANDLE NdisVcHandle);
3454 NDISAPI
3455 NDIS_STATUS
3456 DDKAPI
3457 NdisMCmRegisterAddressFamily(
3458 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
3459 /*IN*/ PCO_ADDRESS_FAMILY AddressFamily,
3460 /*IN*/ PNDIS_CALL_MANAGER_CHARACTERISTICS CmCharacteristics,
3461 /*IN*/ UINT SizeOfCmCharacteristics);
3463 NDISAPI
3464 NDIS_STATUS
3465 DDKAPI
3466 NdisMCmRequest(
3467 /*IN*/ NDIS_HANDLE NdisAfHandle,
3468 /*IN*/ NDIS_HANDLE NdisVcHandle /*OPTIONAL*/,
3469 /*IN*/ NDIS_HANDLE NdisPartyHandle /*OPTIONAL*/,
3470 /*IN OUT*/ PNDIS_REQUEST NdisRequest);
3473 /* Connection-oriented services */
3475 NDISAPI
3476 NDIS_STATUS
3477 DDKAPI
3478 NdisCoCreateVc(
3479 /*IN*/ NDIS_HANDLE NdisBindingHandle,
3480 /*IN*/ NDIS_HANDLE NdisAfHandle /*OPTIONAL*/,
3481 /*IN*/ NDIS_HANDLE ProtocolVcContext,
3482 /*IN OUT*/ PNDIS_HANDLE NdisVcHandle);
3484 NDISAPI
3485 NDIS_STATUS
3486 DDKAPI
3487 NdisCoDeleteVc(
3488 /*IN*/ NDIS_HANDLE NdisVcHandle);
3490 NDISAPI
3491 NDIS_STATUS
3492 DDKAPI
3493 NdisCoRequest(
3494 /*IN*/ NDIS_HANDLE NdisBindingHandle,
3495 /*IN*/ NDIS_HANDLE NdisAfHandle /*OPTIONAL*/,
3496 /*IN*/ NDIS_HANDLE NdisVcHandle /*OPTIONAL*/,
3497 /*IN*/ NDIS_HANDLE NdisPartyHandle /*OPTIONAL*/,
3498 /*IN OUT*/ PNDIS_REQUEST NdisRequest);
3500 NDISAPI
3501 VOID
3502 DDKAPI
3503 NdisCoRequestComplete(
3504 /*IN*/ NDIS_STATUS Status,
3505 /*IN*/ NDIS_HANDLE NdisAfHandle,
3506 /*IN*/ NDIS_HANDLE NdisVcHandle /*OPTIONAL*/,
3507 /*IN*/ NDIS_HANDLE NdisPartyHandle /*OPTIONAL*/,
3508 /*IN*/ PNDIS_REQUEST NdisRequest);
3510 NDISAPI
3511 VOID
3512 DDKAPI
3513 NdisCoSendPackets(
3514 /*IN*/ NDIS_HANDLE NdisVcHandle,
3515 /*IN*/ PPNDIS_PACKET PacketArray,
3516 /*IN*/ UINT NumberOfPackets);
3518 NDISAPI
3519 VOID
3520 DDKAPI
3521 NdisMCoActivateVcComplete(
3522 /*IN*/ NDIS_STATUS Status,
3523 /*IN*/ NDIS_HANDLE NdisVcHandle,
3524 /*IN*/ PCO_CALL_PARAMETERS CallParameters);
3526 NDISAPI
3527 VOID
3528 DDKAPI
3529 NdisMCoDeactivateVcComplete(
3530 /*IN*/ NDIS_STATUS Status,
3531 /*IN*/ NDIS_HANDLE NdisVcHandle);
3533 NDISAPI
3534 VOID
3535 DDKAPI
3536 NdisMCoIndicateReceivePacket(
3537 /*IN*/ NDIS_HANDLE NdisVcHandle,
3538 /*IN*/ PPNDIS_PACKET PacketArray,
3539 /*IN*/ UINT NumberOfPackets);
3541 NDISAPI
3542 VOID
3543 DDKAPI
3544 NdisMCoIndicateStatus(
3545 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
3546 /*IN*/ NDIS_HANDLE NdisVcHandle /*OPTIONAL*/,
3547 /*IN*/ NDIS_STATUS GeneralStatus,
3548 /*IN*/ PVOID StatusBuffer /*OPTIONAL*/,
3549 /*IN*/ ULONG StatusBufferSize);
3551 NDISAPI
3552 VOID
3553 DDKAPI
3554 NdisMCoReceiveComplete(
3555 /*IN*/ NDIS_HANDLE MiniportAdapterHandle);
3557 NDISAPI
3558 VOID
3559 DDKAPI
3560 NdisMCoRequestComplete(
3561 /*IN*/ NDIS_STATUS Status,
3562 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
3563 /*IN*/ PNDIS_REQUEST Request);
3565 NDISAPI
3566 VOID
3567 DDKAPI
3568 NdisMCoSendComplete(
3569 /*IN*/ NDIS_STATUS Status,
3570 /*IN*/ NDIS_HANDLE NdisVcHandle,
3571 /*IN*/ PNDIS_PACKET Packet);
3574 /* NDIS 5.0 extensions for intermediate drivers */
3576 NDISAPI
3577 VOID
3578 DDKAPI
3579 NdisIMAssociateMiniport(
3580 /*IN*/ NDIS_HANDLE DriverHandle,
3581 /*IN*/ NDIS_HANDLE ProtocolHandle);
3583 NDISAPI
3584 NDIS_STATUS
3585 DDKAPI
3586 NdisIMCancelInitializeDeviceInstance(
3587 /*IN*/ NDIS_HANDLE DriverHandle,
3588 /*IN*/ PNDIS_STRING DeviceInstance);
3590 NDISAPI
3591 VOID
3592 DDKAPI
3593 NdisIMCopySendCompletePerPacketInfo(
3594 /*IN*/ PNDIS_PACKET DstPacket,
3595 /*IN*/ PNDIS_PACKET SrcPacket);
3597 NDISAPI
3598 VOID
3599 DDKAPI
3600 NdisIMCopySendPerPacketInfo(
3601 /*IN*/ PNDIS_PACKET DstPacket,
3602 /*IN*/ PNDIS_PACKET SrcPacket);
3604 NDISAPI
3605 VOID
3606 DDKAPI
3607 NdisIMDeregisterLayeredMiniport(
3608 /*IN*/ NDIS_HANDLE DriverHandle);
3610 NDISAPI
3611 NDIS_HANDLE
3612 DDKAPI
3613 NdisIMGetBindingContext(
3614 /*IN*/ NDIS_HANDLE NdisBindingHandle);
3616 NDISAPI
3617 NDIS_HANDLE
3618 DDKAPI
3619 NdisIMGetDeviceContext(
3620 /*IN*/ NDIS_HANDLE MiniportAdapterHandle);
3622 NDISAPI
3623 NDIS_STATUS
3624 DDKAPI
3625 NdisIMInitializeDeviceInstanceEx(
3626 /*IN*/ NDIS_HANDLE DriverHandle,
3627 /*IN*/ PNDIS_STRING DriverInstance,
3628 /*IN*/ NDIS_HANDLE DeviceContext /*OPTIONAL*/);
3630 NDISAPI
3631 PSINGLE_LIST_ENTRY
3632 DDKAPI
3633 NdisInterlockedPopEntrySList(
3634 /*IN*/ PSLIST_HEADER ListHead,
3635 /*IN*/ PKSPIN_LOCK Lock);
3637 NDISAPI
3638 PSINGLE_LIST_ENTRY
3639 DDKAPI
3640 NdisInterlockedPushEntrySList(
3641 /*IN*/ PSLIST_HEADER ListHead,
3642 /*IN*/ PSINGLE_LIST_ENTRY ListEntry,
3643 /*IN*/ PKSPIN_LOCK Lock);
3645 NDISAPI
3646 VOID
3647 DDKAPI
3648 NdisQueryBufferSafe(
3649 /*IN*/ PNDIS_BUFFER Buffer,
3650 /*OUT*/ PVOID *VirtualAddress /*OPTIONAL*/,
3651 /*OUT*/ PUINT Length,
3652 /*IN*/ UINT Priority);
3655 /* Prototypes for NDIS_MINIPORT_CHARACTERISTICS */
3657 typedef BOOLEAN DDKAPI
3658 (*W_CHECK_FOR_HANG_HANDLER)(
3659 /*IN*/ NDIS_HANDLE MiniportAdapterContext);
3661 typedef VOID DDKAPI
3662 (*W_DISABLE_INTERRUPT_HANDLER)(
3663 /*IN*/ NDIS_HANDLE MiniportAdapterContext);
3665 typedef VOID DDKAPI
3666 (*W_ENABLE_INTERRUPT_HANDLER)(
3667 /*IN*/ NDIS_HANDLE MiniportAdapterContext);
3669 typedef VOID DDKAPI
3670 (*W_HALT_HANDLER)(
3671 /*IN*/ NDIS_HANDLE MiniportAdapterContext);
3673 typedef VOID DDKAPI
3674 (*W_HANDLE_INTERRUPT_HANDLER)(
3675 /*IN*/ NDIS_HANDLE MiniportAdapterContext);
3677 typedef NDIS_STATUS DDKAPI
3678 (*W_INITIALIZE_HANDLER)(
3679 /*OUT*/ PNDIS_STATUS OpenErrorStatus,
3680 /*OUT*/ PUINT SelectedMediumIndex,
3681 /*IN*/ PNDIS_MEDIUM MediumArray,
3682 /*IN*/ UINT MediumArraySize,
3683 /*IN*/ NDIS_HANDLE MiniportAdapterContext,
3684 /*IN*/ NDIS_HANDLE WrapperConfigurationContext);
3686 typedef VOID DDKAPI
3687 (*W_ISR_HANDLER)(
3688 /*OUT*/ PBOOLEAN InterruptRecognized,
3689 /*OUT*/ PBOOLEAN QueueMiniportHandleInterrupt,
3690 /*IN*/ NDIS_HANDLE MiniportAdapterContext);
3692 typedef NDIS_STATUS DDKAPI
3693 (*W_QUERY_INFORMATION_HANDLER)(
3694 /*IN*/ NDIS_HANDLE MiniportAdapterContext,
3695 /*IN*/ NDIS_OID Oid,
3696 /*IN*/ PVOID InformationBuffer,
3697 /*IN*/ ULONG InformationBufferLength,
3698 /*OUT*/ PULONG BytesWritten,
3699 /*OUT*/ PULONG BytesNeeded);
3701 typedef NDIS_STATUS DDKAPI
3702 (*W_RECONFIGURE_HANDLER)(
3703 /*OUT*/ PNDIS_STATUS OpenErrorStatus,
3704 /*IN*/ NDIS_HANDLE MiniportAdapterContext,
3705 /*IN*/ NDIS_HANDLE WrapperConfigurationContext);
3707 typedef NDIS_STATUS DDKAPI
3708 (*W_RESET_HANDLER)(
3709 /*OUT*/ PBOOLEAN AddressingReset,
3710 /*IN*/ NDIS_HANDLE MiniportAdapterContext);
3712 typedef NDIS_STATUS DDKAPI
3713 (*W_SEND_HANDLER)(
3714 /*IN*/ NDIS_HANDLE MiniportAdapterContext,
3715 /*IN*/ PNDIS_PACKET Packet,
3716 /*IN*/ UINT Flags);
3718 typedef NDIS_STATUS DDKAPI
3719 (*WM_SEND_HANDLER)(
3720 /*IN*/ NDIS_HANDLE MiniportAdapterContext,
3721 /*IN*/ NDIS_HANDLE NdisLinkHandle,
3722 /*IN*/ PNDIS_WAN_PACKET Packet);
3724 typedef NDIS_STATUS DDKAPI
3725 (*W_SET_INFORMATION_HANDLER)(
3726 /*IN*/ NDIS_HANDLE MiniportAdapterContext,
3727 /*IN*/ NDIS_OID Oid,
3728 /*IN*/ PVOID InformationBuffer,
3729 /*IN*/ ULONG InformationBufferLength,
3730 /*OUT*/ PULONG BytesRead,
3731 /*OUT*/ PULONG BytesNeeded);
3733 typedef NDIS_STATUS DDKAPI
3734 (*W_TRANSFER_DATA_HANDLER)(
3735 /*OUT*/ PNDIS_PACKET Packet,
3736 /*OUT*/ PUINT BytesTransferred,
3737 /*IN*/ NDIS_HANDLE MiniportAdapterContext,
3738 /*IN*/ NDIS_HANDLE MiniportReceiveContext,
3739 /*IN*/ UINT ByteOffset,
3740 /*IN*/ UINT BytesToTransfer);
3742 typedef NDIS_STATUS DDKAPI
3743 (*WM_TRANSFER_DATA_HANDLER)(
3744 VOID);
3747 /* NDIS structures available only to miniport drivers */
3749 #define NDIS30_MINIPORT_CHARACTERISTICS_S \
3750 UCHAR MajorNdisVersion; \
3751 UCHAR MinorNdisVersion; \
3752 UINT Reserved; \
3753 W_CHECK_FOR_HANG_HANDLER CheckForHangHandler; \
3754 W_DISABLE_INTERRUPT_HANDLER DisableInterruptHandler; \
3755 W_ENABLE_INTERRUPT_HANDLER EnableInterruptHandler; \
3756 W_HALT_HANDLER HaltHandler; \
3757 W_HANDLE_INTERRUPT_HANDLER HandleInterruptHandler; \
3758 W_INITIALIZE_HANDLER InitializeHandler; \
3759 W_ISR_HANDLER ISRHandler; \
3760 W_QUERY_INFORMATION_HANDLER QueryInformationHandler; \
3761 W_RECONFIGURE_HANDLER ReconfigureHandler; \
3762 W_RESET_HANDLER ResetHandler; \
3763 _ANONYMOUS_UNION union { \
3764 W_SEND_HANDLER SendHandler; \
3765 WM_SEND_HANDLER WanSendHandler; \
3766 } _UNION_NAME(u1); \
3767 W_SET_INFORMATION_HANDLER SetInformationHandler; \
3768 _ANONYMOUS_UNION union { \
3769 W_TRANSFER_DATA_HANDLER TransferDataHandler; \
3770 WM_TRANSFER_DATA_HANDLER WanTransferDataHandler; \
3771 } _UNION_NAME(u2);
3773 typedef struct _NDIS30_MINIPORT_CHARACTERISTICS {
3774 NDIS30_MINIPORT_CHARACTERISTICS_S
3775 } NDIS30_MINIPORT_CHARACTERISTICS, *PSNDIS30_MINIPORT_CHARACTERISTICS;
3778 /* Extensions for NDIS 4.0 miniports */
3780 typedef VOID DDKAPI
3781 (*W_SEND_PACKETS_HANDLER)(
3782 /*IN*/ NDIS_HANDLE MiniportAdapterContext,
3783 /*IN*/ PPNDIS_PACKET PacketArray,
3784 /*IN*/ UINT NumberOfPackets);
3786 typedef VOID DDKAPI
3787 (*W_RETURN_PACKET_HANDLER)(
3788 /*IN*/ NDIS_HANDLE MiniportAdapterContext,
3789 /*IN*/ PNDIS_PACKET Packet);
3791 typedef VOID DDKAPI
3792 (*W_ALLOCATE_COMPLETE_HANDLER)(
3793 /*IN*/ NDIS_HANDLE MiniportAdapterContext,
3794 /*IN*/ PVOID VirtualAddress,
3795 /*IN*/ PNDIS_PHYSICAL_ADDRESS PhysicalAddress,
3796 /*IN*/ ULONG Length,
3797 /*IN*/ PVOID Context);
3799 #ifdef __cplusplus
3801 #define NDIS40_MINIPORT_CHARACTERISTICS_S \
3802 NDIS30_MINIPORT_CHARACTERISTICS Ndis30Chars; \
3803 W_RETURN_PACKET_HANDLER ReturnPacketHandler; \
3804 W_SEND_PACKETS_HANDLER SendPacketsHandler; \
3805 W_ALLOCATE_COMPLETE_HANDLER AllocateCompleteHandler;
3807 #else /* !__cplusplus */
3809 #define NDIS40_MINIPORT_CHARACTERISTICS_S \
3810 NDIS30_MINIPORT_CHARACTERISTICS_S \
3811 W_RETURN_PACKET_HANDLER ReturnPacketHandler; \
3812 W_SEND_PACKETS_HANDLER SendPacketsHandler; \
3813 W_ALLOCATE_COMPLETE_HANDLER AllocateCompleteHandler;
3815 #endif /* !__cplusplus */
3817 typedef struct _NDIS40_MINIPORT_CHARACTERISTICS {
3818 NDIS40_MINIPORT_CHARACTERISTICS_S
3819 } NDIS40_MINIPORT_CHARACTERISTICS, *PNDIS40_MINIPORT_CHARACTERISTICS;
3822 /* Extensions for NDIS 5.0 miniports */
3824 typedef NDIS_STATUS DDKAPI
3825 (*W_CO_CREATE_VC_HANDLER)(
3826 /*IN*/ NDIS_HANDLE MiniportAdapterContext,
3827 /*IN*/ NDIS_HANDLE NdisVcHandle,
3828 /*OUT*/ PNDIS_HANDLE MiniportVcContext);
3830 typedef NDIS_STATUS DDKAPI
3831 (*W_CO_DELETE_VC_HANDLER)(
3832 /*IN*/ NDIS_HANDLE MiniportVcContext);
3834 typedef NDIS_STATUS DDKAPI
3835 (*W_CO_ACTIVATE_VC_HANDLER)(
3836 /*IN*/ NDIS_HANDLE MiniportVcContext,
3837 /*IN OUT*/ PCO_CALL_PARAMETERS CallParameters);
3839 typedef NDIS_STATUS DDKAPI
3840 (*W_CO_DEACTIVATE_VC_HANDLER)(
3841 /*IN*/ NDIS_HANDLE MiniportVcContext);
3843 typedef VOID DDKAPI
3844 (*W_CO_SEND_PACKETS_HANDLER)(
3845 /*IN*/ NDIS_HANDLE MiniportVcContext,
3846 /*IN*/ PPNDIS_PACKET PacketArray,
3847 /*IN*/ UINT NumberOfPackets);
3849 typedef NDIS_STATUS DDKAPI
3850 (*W_CO_REQUEST_HANDLER)(
3851 /*IN*/ NDIS_HANDLE MiniportAdapterContext,
3852 /*IN*/ NDIS_HANDLE MiniportVcContext /*OPTIONAL*/,
3853 /*IN OUT*/ PNDIS_REQUEST NdisRequest);
3855 #ifdef __cplusplus
3857 #define NDIS50_MINIPORT_CHARACTERISTICS_S \
3858 NDIS40_MINIPORT_CHARACTERISTICS Ndis40Chars; \
3859 W_CO_CREATE_VC_HANDLER CoCreateVcHandler; \
3860 W_CO_DELETE_VC_HANDLER CoDeleteVcHandler; \
3861 W_CO_ACTIVATE_VC_HANDLER CoActivateVcHandler; \
3862 W_CO_DEACTIVATE_VC_HANDLER CoDeactivateVcHandler; \
3863 W_CO_SEND_PACKETS_HANDLER CoSendPacketsHandler; \
3864 W_CO_REQUEST_HANDLER CoRequestHandler;
3866 #else /* !__cplusplus */
3868 #define NDIS50_MINIPORT_CHARACTERISTICS_S \
3869 NDIS40_MINIPORT_CHARACTERISTICS_S \
3870 W_CO_CREATE_VC_HANDLER CoCreateVcHandler; \
3871 W_CO_DELETE_VC_HANDLER CoDeleteVcHandler; \
3872 W_CO_ACTIVATE_VC_HANDLER CoActivateVcHandler; \
3873 W_CO_DEACTIVATE_VC_HANDLER CoDeactivateVcHandler; \
3874 W_CO_SEND_PACKETS_HANDLER CoSendPacketsHandler; \
3875 W_CO_REQUEST_HANDLER CoRequestHandler;
3877 #endif /* !__cplusplus */
3879 typedef struct _NDIS50_MINIPORT_CHARACTERISTICS {
3880 NDIS50_MINIPORT_CHARACTERISTICS_S
3881 } NDIS50_MINIPORT_CHARACTERISTICS, *PSNDIS50_MINIPORT_CHARACTERISTICS;
3884 /* Extensions for NDIS 5.1 miniports */
3886 typedef VOID DDKAPI
3887 (*W_CANCEL_SEND_PACKETS_HANDLER)(
3888 /*IN*/ NDIS_HANDLE MiniportAdapterContext,
3889 /*IN*/ PVOID CancelId);
3892 #if defined(NDIS51)
3893 typedef struct _NDIS_MINIPORT_CHARACTERISTICS {
3894 NDIS50_MINIPORT_CHARACTERISTICS_S
3895 } NDIS_MINIPORT_CHARACTERISTICS, *PNDIS_MINIPORT_CHARACTERISTICS;
3896 #elif defined(NDIS50)
3897 typedef struct _NDIS_MINIPORT_CHARACTERISTICS {
3898 NDIS50_MINIPORT_CHARACTERISTICS_S
3899 } NDIS_MINIPORT_CHARACTERISTICS, *PNDIS_MINIPORT_CHARACTERISTICS;
3900 #elif defined(NDIS40)
3901 typedef struct _NDIS_MINIPORT_CHARACTERISTICS {
3902 NDIS40_MINIPORT_CHARACTERISTICS_S
3903 } NDIS_MINIPORT_CHARACTERISTICS, *PNDIS_MINIPORT_CHARACTERISTICS;
3904 #elif defined(NDIS30)
3905 typedef struct _NDIS_MINIPORT_CHARACTERISTICS {
3906 NDIS30_MINIPORT_CHARACTERISTICS_S
3907 } NDIS_MINIPORT_CHARACTERISTICS, *PNDIS_MINIPORT_CHARACTERISTICS;
3908 #endif /* NDIS30 */
3911 typedef NDIS_STATUS DDKAPI
3912 (*SEND_HANDLER)(
3913 /*IN*/ NDIS_HANDLE MacBindingHandle,
3914 /*IN*/ PNDIS_PACKET Packet);
3916 typedef NDIS_STATUS DDKAPI
3917 (*TRANSFER_DATA_HANDLER)(
3918 /*IN*/ NDIS_HANDLE MacBindingHandle,
3919 /*IN*/ NDIS_HANDLE MacReceiveContext,
3920 /*IN*/ UINT ByteOffset,
3921 /*IN*/ UINT BytesToTransfer,
3922 /*OUT*/ PNDIS_PACKET Packet,
3923 /*OUT*/ PUINT BytesTransferred);
3925 typedef NDIS_STATUS DDKAPI
3926 (*RESET_HANDLER)(
3927 /*IN*/ NDIS_HANDLE MacBindingHandle);
3929 typedef NDIS_STATUS DDKAPI
3930 (*REQUEST_HANDLER)(
3931 /*IN*/ NDIS_HANDLE MacBindingHandle,
3932 /*IN*/ PNDIS_REQUEST NdisRequest);
3936 /* Structures available only to full MAC drivers */
3938 typedef BOOLEAN DDKAPI
3939 (*PNDIS_INTERRUPT_SERVICE)(
3940 /*IN*/ PVOID InterruptContext);
3942 typedef VOID DDKAPI
3943 (*PNDIS_DEFERRED_PROCESSING)(
3944 /*IN*/ PVOID SystemSpecific1,
3945 /*IN*/ PVOID InterruptContext,
3946 /*IN*/ PVOID SystemSpecific2,
3947 /*IN*/ PVOID SystemSpecific3);
3951 typedef struct _NDIS_MINIPORT_BLOCK NDIS_MINIPORT_BLOCK, *PNDIS_MINIPORT_BLOCK;
3952 typedef struct _NDIS_PROTOCOL_BLOCK NDIS_PROTOCOL_BLOCK, *PNDIS_PROTOCOL_BLOCK;
3953 typedef struct _NDIS_OPEN_BLOCK NDIS_OPEN_BLOCK, *PNDIS_OPEN_BLOCK;
3954 typedef struct _NDIS_M_DRIVER_BLOCK NDIS_M_DRIVER_BLOCK, *PNDIS_M_DRIVER_BLOCK;
3955 typedef struct _NDIS_AF_LIST NDIS_AF_LIST, *PNDIS_AF_LIST;
3958 typedef struct _NDIS_MINIPORT_INTERRUPT {
3959 PKINTERRUPT InterruptObject;
3960 KSPIN_LOCK DpcCountLock;
3961 PVOID MiniportIdField;
3962 W_ISR_HANDLER MiniportIsr;
3963 W_HANDLE_INTERRUPT_HANDLER MiniportDpc;
3964 KDPC InterruptDpc;
3965 PNDIS_MINIPORT_BLOCK Miniport;
3966 UCHAR DpcCount;
3967 BOOLEAN Filler1;
3968 KEVENT DpcsCompletedEvent;
3969 BOOLEAN SharedInterrupt;
3970 BOOLEAN IsrRequested;
3971 } NDIS_MINIPORT_INTERRUPT, *PNDIS_MINIPORT_INTERRUPT;
3973 typedef struct _NDIS_MINIPORT_TIMER {
3974 KTIMER Timer;
3975 KDPC Dpc;
3976 PNDIS_TIMER_FUNCTION MiniportTimerFunction;
3977 PVOID MiniportTimerContext;
3978 PNDIS_MINIPORT_BLOCK Miniport;
3979 struct _NDIS_MINIPORT_TIMER *NextDeferredTimer;
3980 } NDIS_MINIPORT_TIMER, *PNDIS_MINIPORT_TIMER;
3982 typedef struct _NDIS_INTERRUPT {
3983 PKINTERRUPT InterruptObject;
3984 KSPIN_LOCK DpcCountLock;
3985 PNDIS_INTERRUPT_SERVICE MacIsr;
3986 PNDIS_DEFERRED_PROCESSING MacDpc;
3987 KDPC InterruptDpc;
3988 PVOID InterruptContext;
3989 UCHAR DpcCount;
3990 BOOLEAN Removing;
3991 KEVENT DpcsCompletedEvent;
3992 } NDIS_INTERRUPT, *PNDIS_INTERRUPT;
3995 typedef struct _MAP_REGISTER_ENTRY {
3996 PVOID MapRegister;
3997 BOOLEAN WriteToDevice;
3998 } MAP_REGISTER_ENTRY, *PMAP_REGISTER_ENTRY;
4001 typedef enum _NDIS_WORK_ITEM_TYPE {
4002 NdisWorkItemRequest,
4003 NdisWorkItemSend,
4004 NdisWorkItemReturnPackets,
4005 NdisWorkItemResetRequested,
4006 NdisWorkItemResetInProgress,
4007 NdisWorkItemHalt,
4008 NdisWorkItemSendLoopback,
4009 NdisWorkItemMiniportCallback,
4010 NdisMaxWorkItems
4011 } NDIS_WORK_ITEM_TYPE, *PNDIS_WORK_ITEM_TYPE;
4013 #define NUMBER_OF_WORK_ITEM_TYPES NdisMaxWorkItems
4014 #define NUMBER_OF_SINGLE_WORK_ITEMS 6
4016 typedef struct _NDIS_MINIPORT_WORK_ITEM {
4017 SINGLE_LIST_ENTRY Link;
4018 NDIS_WORK_ITEM_TYPE WorkItemType;
4019 PVOID WorkItemContext;
4020 } NDIS_MINIPORT_WORK_ITEM, *PNDIS_MINIPORT_WORK_ITEM;
4023 typedef struct _NDIS_BIND_PATHS {
4024 UINT Number;
4025 NDIS_STRING Paths[1];
4026 } NDIS_BIND_PATHS, *PNDIS_BIND_PATHS;
4028 #define DECLARE_UNKNOWN_STRUCT(BaseName) \
4029 typedef struct _##BaseName BaseName, *P##BaseName;
4031 #define DECLARE_UNKNOWN_PROTOTYPE(Name) \
4032 typedef VOID (*(Name))(VOID);
4034 #define ETH_LENGTH_OF_ADDRESS 6
4036 DECLARE_UNKNOWN_STRUCT(ETH_BINDING_INFO)
4038 DECLARE_UNKNOWN_PROTOTYPE(ETH_ADDRESS_CHANGE)
4039 DECLARE_UNKNOWN_PROTOTYPE(ETH_FILTER_CHANGE)
4040 DECLARE_UNKNOWN_PROTOTYPE(ETH_DEFERRED_CLOSE)
4042 typedef struct _ETH_FILTER {
4043 PNDIS_SPIN_LOCK Lock;
4044 CHAR (*MCastAddressBuf)[ETH_LENGTH_OF_ADDRESS];
4045 struct _NDIS_MINIPORT_BLOCK *Miniport;
4046 UINT CombinedPacketFilter;
4047 PETH_BINDING_INFO OpenList;
4048 ETH_ADDRESS_CHANGE AddressChangeAction;
4049 ETH_FILTER_CHANGE FilterChangeAction;
4050 ETH_DEFERRED_CLOSE CloseAction;
4051 UINT MaxMulticastAddresses;
4052 UINT NumAddresses;
4053 UCHAR AdapterAddress[ETH_LENGTH_OF_ADDRESS];
4054 UINT OldCombinedPacketFilter;
4055 CHAR (*OldMCastAddressBuf)[ETH_LENGTH_OF_ADDRESS];
4056 UINT OldNumAddresses;
4057 PETH_BINDING_INFO DirectedList;
4058 PETH_BINDING_INFO BMList;
4059 PETH_BINDING_INFO MCastSet;
4060 #if defined(_NDIS_)
4061 UINT NumOpens;
4062 PVOID BindListLock;
4063 #endif
4064 } ETH_FILTER, *PETH_FILTER;
4066 typedef VOID DDKAPI
4067 (*ETH_RCV_COMPLETE_HANDLER)(
4068 /*IN*/ PETH_FILTER Filter);
4070 typedef VOID DDKAPI
4071 (*ETH_RCV_INDICATE_HANDLER)(
4072 /*IN*/ PETH_FILTER Filter,
4073 /*IN*/ NDIS_HANDLE MacReceiveContext,
4074 /*IN*/ PCHAR Address,
4075 /*IN*/ PVOID HeaderBuffer,
4076 /*IN*/ UINT HeaderBufferSize,
4077 /*IN*/ PVOID LookaheadBuffer,
4078 /*IN*/ UINT LookaheadBufferSize,
4079 /*IN*/ UINT PacketSize);
4081 typedef VOID DDKAPI
4082 (*FDDI_RCV_COMPLETE_HANDLER)(
4083 /*IN*/ PFDDI_FILTER Filter);
4085 typedef VOID DDKAPI
4086 (*FDDI_RCV_INDICATE_HANDLER)(
4087 /*IN*/ PFDDI_FILTER Filter,
4088 /*IN*/ NDIS_HANDLE MacReceiveContext,
4089 /*IN*/ PCHAR Address,
4090 /*IN*/ UINT AddressLength,
4091 /*IN*/ PVOID HeaderBuffer,
4092 /*IN*/ UINT HeaderBufferSize,
4093 /*IN*/ PVOID LookaheadBuffer,
4094 /*IN*/ UINT LookaheadBufferSize,
4095 /*IN*/ UINT PacketSize);
4097 typedef VOID DDKAPI
4098 (*FILTER_PACKET_INDICATION_HANDLER)(
4099 /*IN*/ NDIS_HANDLE Miniport,
4100 /*IN*/ PPNDIS_PACKET PacketArray,
4101 /*IN*/ UINT NumberOfPackets);
4103 typedef VOID DDKAPI
4104 (*TR_RCV_COMPLETE_HANDLER)(
4105 /*IN*/ PTR_FILTER Filter);
4107 typedef VOID DDKAPI
4108 (*TR_RCV_INDICATE_HANDLER)(
4109 /*IN*/ PTR_FILTER Filter,
4110 /*IN*/ NDIS_HANDLE MacReceiveContext,
4111 /*IN*/ PVOID HeaderBuffer,
4112 /*IN*/ UINT HeaderBufferSize,
4113 /*IN*/ PVOID LookaheadBuffer,
4114 /*IN*/ UINT LookaheadBufferSize,
4115 /*IN*/ UINT PacketSize);
4117 typedef VOID DDKAPI
4118 (*WAN_RCV_COMPLETE_HANDLER)(
4119 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
4120 /*IN*/ NDIS_HANDLE NdisLinkContext);
4122 typedef VOID DDKAPI
4123 (*WAN_RCV_HANDLER)(
4124 /*OUT*/ PNDIS_STATUS Status,
4125 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
4126 /*IN*/ NDIS_HANDLE NdisLinkContext,
4127 /*IN*/ PUCHAR Packet,
4128 /*IN*/ ULONG PacketSize);
4130 typedef VOID DDKFASTAPI
4131 (*NDIS_M_DEQUEUE_WORK_ITEM)(
4132 /*IN*/ PNDIS_MINIPORT_BLOCK Miniport,
4133 /*IN*/ NDIS_WORK_ITEM_TYPE WorkItemType,
4134 /*OUT*/ PVOID *WorkItemContext);
4136 typedef NDIS_STATUS DDKFASTAPI
4137 (*NDIS_M_QUEUE_NEW_WORK_ITEM)(
4138 /*IN*/ PNDIS_MINIPORT_BLOCK Miniport,
4139 /*IN*/ NDIS_WORK_ITEM_TYPE WorkItemType,
4140 /*IN*/ PVOID WorkItemContext);
4142 typedef NDIS_STATUS DDKFASTAPI
4143 (*NDIS_M_QUEUE_WORK_ITEM)(
4144 /*IN*/ PNDIS_MINIPORT_BLOCK Miniport,
4145 /*IN*/ NDIS_WORK_ITEM_TYPE WorkItemType,
4146 /*IN*/ PVOID WorkItemContext);
4148 typedef VOID DDKAPI
4149 (*NDIS_M_REQ_COMPLETE_HANDLER)(
4150 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
4151 /*IN*/ NDIS_STATUS Status);
4153 typedef VOID DDKAPI
4154 (*NDIS_M_RESET_COMPLETE_HANDLER)(
4155 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
4156 /*IN*/ NDIS_STATUS Status,
4157 /*IN*/ BOOLEAN AddressingReset);
4159 typedef VOID DDKAPI
4160 (*NDIS_M_SEND_COMPLETE_HANDLER)(
4161 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
4162 /*IN*/ PNDIS_PACKET Packet,
4163 /*IN*/ NDIS_STATUS Status);
4165 typedef VOID DDKAPI
4166 (*NDIS_M_SEND_RESOURCES_HANDLER)(
4167 /*IN*/ NDIS_HANDLE MiniportAdapterHandle);
4169 typedef BOOLEAN DDKFASTAPI
4170 (*NDIS_M_START_SENDS)(
4171 /*IN*/ PNDIS_MINIPORT_BLOCK Miniport);
4173 typedef VOID DDKAPI
4174 (*NDIS_M_STATUS_HANDLER)(
4175 /*IN*/ NDIS_HANDLE MiniportHandle,
4176 /*IN*/ NDIS_STATUS GeneralStatus,
4177 /*IN*/ PVOID StatusBuffer,
4178 /*IN*/ UINT StatusBufferSize);
4180 typedef VOID DDKAPI
4181 (*NDIS_M_STS_COMPLETE_HANDLER)(
4182 /*IN*/ NDIS_HANDLE MiniportAdapterHandle);
4184 typedef VOID DDKAPI
4185 (*NDIS_M_TD_COMPLETE_HANDLER)(
4186 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
4187 /*IN*/ PNDIS_PACKET Packet,
4188 /*IN*/ NDIS_STATUS Status,
4189 /*IN*/ UINT BytesTransferred);
4191 typedef VOID (DDKAPI *NDIS_WM_SEND_COMPLETE_HANDLER)(
4192 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
4193 /*IN*/ PVOID Packet,
4194 /*IN*/ NDIS_STATUS Status);
4197 #if ARCNET
4199 #define ARC_SEND_BUFFERS 8
4200 #define ARC_HEADER_SIZE 4
4202 typedef struct _NDIS_ARC_BUF {
4203 NDIS_HANDLE ArcnetBufferPool;
4204 PUCHAR ArcnetLookaheadBuffer;
4205 UINT NumFree;
4206 ARC_BUFFER_LIST ArcnetBuffers[ARC_SEND_BUFFERS];
4207 } NDIS_ARC_BUF, *PNDIS_ARC_BUF;
4209 #endif /* ARCNET */
4211 #define NDIS_MINIPORT_WORK_QUEUE_SIZE 10
4213 typedef struct _NDIS_LOG {
4214 PNDIS_MINIPORT_BLOCK Miniport;
4215 KSPIN_LOCK LogLock;
4216 PIRP Irp;
4217 UINT TotalSize;
4218 UINT CurrentSize;
4219 UINT InPtr;
4220 UINT OutPtr;
4221 UCHAR LogBuf[1];
4222 } NDIS_LOG, *PNDIS_LOG;
4224 typedef struct _FILTERDBS {
4225 _ANONYMOUS_UNION union {
4226 PETH_FILTER EthDB;
4227 PNULL_FILTER NullDB;
4228 } DUMMYUNIONNAME;
4229 PTR_FILTER TrDB;
4230 PFDDI_FILTER FddiDB;
4231 #if ARCNET
4232 PARC_FILTER ArcDB;
4233 #else /* !ARCNET */
4234 PVOID XXXDB;
4235 #endif /* !ARCNET */
4236 } FILTERDBS, *PFILTERDBS;
4239 struct _NDIS_MINIPORT_BLOCK {
4240 PVOID Signature;
4241 PNDIS_MINIPORT_BLOCK NextMiniport;
4242 PNDIS_M_DRIVER_BLOCK DriverHandle;
4243 NDIS_HANDLE MiniportAdapterContext;
4244 UNICODE_STRING MiniportName;
4245 PNDIS_BIND_PATHS BindPaths;
4246 NDIS_HANDLE OpenQueue;
4247 REFERENCE Ref;
4248 NDIS_HANDLE DeviceContext;
4249 UCHAR Padding1;
4250 UCHAR LockAcquired;
4251 UCHAR PmodeOpens;
4252 UCHAR AssignedProcessor;
4253 KSPIN_LOCK Lock;
4254 PNDIS_REQUEST MediaRequest;
4255 PNDIS_MINIPORT_INTERRUPT Interrupt;
4256 ULONG Flags;
4257 ULONG PnPFlags;
4258 LIST_ENTRY PacketList;
4259 PNDIS_PACKET FirstPendingPacket;
4260 PNDIS_PACKET ReturnPacketsQueue;
4261 ULONG RequestBuffer;
4262 PVOID SetMCastBuffer;
4263 PNDIS_MINIPORT_BLOCK PrimaryMiniport;
4264 PVOID WrapperContext;
4265 PVOID BusDataContext;
4266 ULONG PnPCapabilities;
4267 PCM_RESOURCE_LIST Resources;
4268 NDIS_TIMER WakeUpDpcTimer;
4269 UNICODE_STRING BaseName;
4270 UNICODE_STRING SymbolicLinkName;
4271 ULONG CheckForHangSeconds;
4272 USHORT CFHangTicks;
4273 USHORT CFHangCurrentTick;
4274 NDIS_STATUS ResetStatus;
4275 NDIS_HANDLE ResetOpen;
4276 FILTERDBS FilterDbs;
4277 FILTER_PACKET_INDICATION_HANDLER PacketIndicateHandler;
4278 NDIS_M_SEND_COMPLETE_HANDLER SendCompleteHandler;
4279 NDIS_M_SEND_RESOURCES_HANDLER SendResourcesHandler;
4280 NDIS_M_RESET_COMPLETE_HANDLER ResetCompleteHandler;
4281 NDIS_MEDIUM MediaType;
4282 ULONG BusNumber;
4283 NDIS_INTERFACE_TYPE BusType;
4284 NDIS_INTERFACE_TYPE AdapterType;
4285 PDEVICE_OBJECT DeviceObject;
4286 PDEVICE_OBJECT PhysicalDeviceObject;
4287 PDEVICE_OBJECT NextDeviceObject;
4288 PMAP_REGISTER_ENTRY MapRegisters;
4289 PNDIS_AF_LIST CallMgrAfList;
4290 PVOID MiniportThread;
4291 PVOID SetInfoBuf;
4292 USHORT SetInfoBufLen;
4293 USHORT MaxSendPackets;
4294 NDIS_STATUS FakeStatus;
4295 PVOID LockHandler;
4296 PUNICODE_STRING pAdapterInstanceName;
4297 PNDIS_MINIPORT_TIMER TimerQueue;
4298 UINT MacOptions;
4299 PNDIS_REQUEST PendingRequest;
4300 UINT MaximumLongAddresses;
4301 UINT MaximumShortAddresses;
4302 UINT CurrentLookahead;
4303 UINT MaximumLookahead;
4304 W_HANDLE_INTERRUPT_HANDLER HandleInterruptHandler;
4305 W_DISABLE_INTERRUPT_HANDLER DisableInterruptHandler;
4306 W_ENABLE_INTERRUPT_HANDLER EnableInterruptHandler;
4307 W_SEND_PACKETS_HANDLER SendPacketsHandler;
4308 NDIS_M_START_SENDS DeferredSendHandler;
4309 ETH_RCV_INDICATE_HANDLER EthRxIndicateHandler;
4310 TR_RCV_INDICATE_HANDLER TrRxIndicateHandler;
4311 FDDI_RCV_INDICATE_HANDLER FddiRxIndicateHandler;
4312 ETH_RCV_COMPLETE_HANDLER EthRxCompleteHandler;
4313 TR_RCV_COMPLETE_HANDLER TrRxCompleteHandler;
4314 FDDI_RCV_COMPLETE_HANDLER FddiRxCompleteHandler;
4315 NDIS_M_STATUS_HANDLER StatusHandler;
4316 NDIS_M_STS_COMPLETE_HANDLER StatusCompleteHandler;
4317 NDIS_M_TD_COMPLETE_HANDLER TDCompleteHandler;
4318 NDIS_M_REQ_COMPLETE_HANDLER QueryCompleteHandler;
4319 NDIS_M_REQ_COMPLETE_HANDLER SetCompleteHandler;
4320 NDIS_WM_SEND_COMPLETE_HANDLER WanSendCompleteHandler;
4321 WAN_RCV_HANDLER WanRcvHandler;
4322 WAN_RCV_COMPLETE_HANDLER WanRcvCompleteHandler;
4323 #if defined(_NDIS_)
4324 PNDIS_MINIPORT_BLOCK NextGlobalMiniport;
4325 SINGLE_LIST_ENTRY WorkQueue[NUMBER_OF_WORK_ITEM_TYPES];
4326 SINGLE_LIST_ENTRY SingleWorkItems[NUMBER_OF_SINGLE_WORK_ITEMS];
4327 UCHAR SendFlags;
4328 UCHAR TrResetRing;
4329 UCHAR ArcnetAddress;
4330 UCHAR XState;
4331 _ANONYMOUS_UNION union {
4332 #if ARCNET
4333 PNDIS_ARC_BUF ArcBuf;
4334 #endif
4335 PVOID BusInterface;
4336 } DUMMYUNIONNAME;
4337 PNDIS_LOG Log;
4338 ULONG SlotNumber;
4339 PCM_RESOURCE_LIST AllocatedResources;
4340 PCM_RESOURCE_LIST AllocatedResourcesTranslated;
4341 SINGLE_LIST_ENTRY PatternList;
4342 NDIS_PNP_CAPABILITIES PMCapabilities;
4343 DEVICE_CAPABILITIES DeviceCaps;
4344 ULONG WakeUpEnable;
4345 DEVICE_POWER_STATE CurrentDevicePowerState;
4346 PIRP pIrpWaitWake;
4347 SYSTEM_POWER_STATE WaitWakeSystemState;
4348 LARGE_INTEGER VcIndex;
4349 KSPIN_LOCK VcCountLock;
4350 LIST_ENTRY WmiEnabledVcs;
4351 PNDIS_GUID pNdisGuidMap;
4352 PNDIS_GUID pCustomGuidMap;
4353 USHORT VcCount;
4354 USHORT cNdisGuidMap;
4355 USHORT cCustomGuidMap;
4356 USHORT CurrentMapRegister;
4357 PKEVENT AllocationEvent;
4358 USHORT BaseMapRegistersNeeded;
4359 USHORT SGMapRegistersNeeded;
4360 ULONG MaximumPhysicalMapping;
4361 NDIS_TIMER MediaDisconnectTimer;
4362 USHORT MediaDisconnectTimeOut;
4363 USHORT InstanceNumber;
4364 NDIS_EVENT OpenReadyEvent;
4365 NDIS_PNP_DEVICE_STATE PnPDeviceState;
4366 NDIS_PNP_DEVICE_STATE OldPnPDeviceState;
4367 PGET_SET_DEVICE_DATA SetBusData;
4368 PGET_SET_DEVICE_DATA GetBusData;
4369 KDPC DeferredDpc;
4370 #if 0
4371 /* FIXME: */
4372 NDIS_STATS NdisStats;
4373 #else
4374 ULONG NdisStats;
4375 #endif
4376 PNDIS_PACKET IndicatedPacket[MAXIMUM_PROCESSORS];
4377 PKEVENT RemoveReadyEvent;
4378 PKEVENT AllOpensClosedEvent;
4379 PKEVENT AllRequestsCompletedEvent;
4380 ULONG InitTimeMs;
4381 NDIS_MINIPORT_WORK_ITEM WorkItemBuffer[NUMBER_OF_SINGLE_WORK_ITEMS];
4382 PDMA_ADAPTER SystemAdapterObject;
4383 ULONG DriverVerifyFlags;
4384 POID_LIST OidList;
4385 USHORT InternalResetCount;
4386 USHORT MiniportResetCount;
4387 USHORT MediaSenseConnectCount;
4388 USHORT MediaSenseDisconnectCount;
4389 PNDIS_PACKET *xPackets;
4390 ULONG UserModeOpenReferences;
4391 _ANONYMOUS_UNION union {
4392 PVOID SavedSendHandler;
4393 PVOID SavedWanSendHandler;
4394 } DUMMYUNIONNAME2;
4395 PVOID SavedSendPacketsHandler;
4396 PVOID SavedCancelSendPacketsHandler;
4397 W_SEND_PACKETS_HANDLER WSendPacketsHandler;
4398 ULONG MiniportAttributes;
4399 PDMA_ADAPTER SavedSystemAdapterObject;
4400 USHORT NumOpens;
4401 USHORT CFHangXTicks;
4402 ULONG RequestCount;
4403 ULONG IndicatedPacketsCount;
4404 ULONG PhysicalMediumType;
4405 PNDIS_REQUEST LastRequest;
4406 LONG DmaAdapterRefCount;
4407 PVOID FakeMac;
4408 ULONG LockDbg;
4409 ULONG LockDbgX;
4410 PVOID LockThread;
4411 ULONG InfoFlags;
4412 KSPIN_LOCK TimerQueueLock;
4413 PKEVENT ResetCompletedEvent;
4414 PKEVENT QueuedBindingCompletedEvent;
4415 PKEVENT DmaResourcesReleasedEvent;
4416 FILTER_PACKET_INDICATION_HANDLER SavedPacketIndicateHandler;
4417 ULONG RegisteredInterrupts;
4418 PNPAGED_LOOKASIDE_LIST SGListLookasideList;
4419 ULONG ScatterGatherListSize;
4420 #endif /* _NDIS_ */
4424 /* Handler prototypes for NDIS_OPEN_BLOCK */
4426 typedef NDIS_STATUS (DDKAPI *WAN_SEND_HANDLER)(
4427 /*IN*/ NDIS_HANDLE MacBindingHandle,
4428 /*IN*/ NDIS_HANDLE LinkHandle,
4429 /*IN*/ PVOID Packet);
4431 /* NDIS 4.0 extension */
4433 typedef VOID (DDKAPI *SEND_PACKETS_HANDLER)(
4434 /*IN*/ NDIS_HANDLE MiniportAdapterContext,
4435 /*IN*/ PPNDIS_PACKET PacketArray,
4436 /*IN*/ UINT NumberOfPackets);
4439 typedef struct _NDIS_COMMON_OPEN_BLOCK {
4440 PVOID MacHandle;
4441 NDIS_HANDLE BindingHandle;
4442 PNDIS_MINIPORT_BLOCK MiniportHandle;
4443 PNDIS_PROTOCOL_BLOCK ProtocolHandle;
4444 NDIS_HANDLE ProtocolBindingContext;
4445 PNDIS_OPEN_BLOCK MiniportNextOpen;
4446 PNDIS_OPEN_BLOCK ProtocolNextOpen;
4447 NDIS_HANDLE MiniportAdapterContext;
4448 BOOLEAN Reserved1;
4449 BOOLEAN Reserved2;
4450 BOOLEAN Reserved3;
4451 BOOLEAN Reserved4;
4452 PNDIS_STRING BindDeviceName;
4453 KSPIN_LOCK Reserved5;
4454 PNDIS_STRING RootDeviceName;
4455 _ANONYMOUS_UNION union {
4456 SEND_HANDLER SendHandler;
4457 WAN_SEND_HANDLER WanSendHandler;
4458 } DUMMYUNIONNAME;
4459 TRANSFER_DATA_HANDLER TransferDataHandler;
4460 SEND_COMPLETE_HANDLER SendCompleteHandler;
4461 TRANSFER_DATA_COMPLETE_HANDLER TransferDataCompleteHandler;
4462 RECEIVE_HANDLER ReceiveHandler;
4463 RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler;
4464 WAN_RECEIVE_HANDLER WanReceiveHandler;
4465 REQUEST_COMPLETE_HANDLER RequestCompleteHandler;
4466 RECEIVE_PACKET_HANDLER ReceivePacketHandler;
4467 SEND_PACKETS_HANDLER SendPacketsHandler;
4468 RESET_HANDLER ResetHandler;
4469 REQUEST_HANDLER RequestHandler;
4470 RESET_COMPLETE_HANDLER ResetCompleteHandler;
4471 STATUS_HANDLER StatusHandler;
4472 STATUS_COMPLETE_HANDLER StatusCompleteHandler;
4473 #if defined(_NDIS_)
4474 ULONG Flags;
4475 ULONG References;
4476 KSPIN_LOCK SpinLock;
4477 NDIS_HANDLE FilterHandle;
4478 ULONG ProtocolOptions;
4479 USHORT CurrentLookahead;
4480 USHORT ConnectDampTicks;
4481 USHORT DisconnectDampTicks;
4482 W_SEND_HANDLER WSendHandler;
4483 W_TRANSFER_DATA_HANDLER WTransferDataHandler;
4484 W_SEND_PACKETS_HANDLER WSendPacketsHandler;
4485 W_CANCEL_SEND_PACKETS_HANDLER CancelSendPacketsHandler;
4486 ULONG WakeUpEnable;
4487 PKEVENT CloseCompleteEvent;
4488 QUEUED_CLOSE QC;
4489 ULONG AfReferences;
4490 PNDIS_OPEN_BLOCK NextGlobalOpen;
4491 #endif /* _NDIS_ */
4492 } NDIS_COMMON_OPEN_BLOCK;
4494 struct _NDIS_OPEN_BLOCK
4496 NDIS_COMMON_OPEN_BLOCK NdisCommonOpenBlock;
4497 #if defined(_NDIS_)
4498 struct _NDIS_OPEN_CO
4500 struct _NDIS_CO_AF_BLOCK * NextAf;
4501 W_CO_CREATE_VC_HANDLER MiniportCoCreateVcHandler;
4502 W_CO_REQUEST_HANDLER MiniportCoRequestHandler;
4503 CO_CREATE_VC_HANDLER CoCreateVcHandler;
4504 CO_DELETE_VC_HANDLER CoDeleteVcHandler;
4505 PVOID CmActivateVcCompleteHandler;
4506 PVOID CmDeactivateVcCompleteHandler;
4507 PVOID CoRequestCompleteHandler;
4508 LIST_ENTRY ActiveVcHead;
4509 LIST_ENTRY InactiveVcHead;
4510 LONG PendingAfNotifications;
4511 PKEVENT AfNotifyCompleteEvent;
4513 #endif /* _NDIS_ */
4518 /* Routines for NDIS miniport drivers */
4520 NDISAPI
4521 VOID
4522 DDKAPI
4523 NdisInitializeWrapper(
4524 /*OUT*/ PNDIS_HANDLE NdisWrapperHandle,
4525 /*IN*/ PVOID SystemSpecific1,
4526 /*IN*/ PVOID SystemSpecific2,
4527 /*IN*/ PVOID SystemSpecific3);
4529 NDISAPI
4530 NDIS_STATUS
4531 DDKAPI
4532 NdisMAllocateMapRegisters(
4533 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
4534 /*IN*/ UINT DmaChannel,
4535 /*IN*/ BOOLEAN Dma32BitAddresses,
4536 /*IN*/ ULONG PhysicalMapRegistersNeeded,
4537 /*IN*/ ULONG MaximumPhysicalMapping);
4540 * VOID
4541 * NdisMArcIndicateReceive(
4542 * IN NDIS_HANDLE MiniportAdapterHandle,
4543 * IN PUCHAR HeaderBuffer,
4544 * IN PUCHAR DataBuffer,
4545 * IN UINT Length);
4547 #define NdisMArcIndicateReceive(MiniportAdapterHandle, \
4548 HeaderBuffer, \
4549 DataBuffer, \
4550 Length) \
4552 ArcFilterDprIndicateReceive( \
4553 (((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FilterDbs.ArcDB), \
4554 (HeaderBuffer), \
4555 (DataBuffer), \
4556 (Length)); \
4560 * VOID
4561 * NdisMArcIndicateReceiveComplete(
4562 * IN NDIS_HANDLE MiniportAdapterHandle);
4564 #define NdisMArcIndicateReceiveComplete(MiniportAdapterHandle) \
4566 if (((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->EthDB) \
4568 NdisMEthIndicateReceiveComplete(_H); \
4571 ArcFilterDprIndicateReceiveComplete( \
4572 ((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->ArcDB); \
4575 NDISAPI
4576 VOID
4577 DDKAPI
4578 NdisMCloseLog(
4579 /*IN*/ NDIS_HANDLE LogHandle);
4581 NDISAPI
4582 NDIS_STATUS
4583 DDKAPI
4584 NdisMCreateLog(
4585 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
4586 /*IN*/ UINT Size,
4587 /*OUT*/ PNDIS_HANDLE LogHandle);
4589 NDISAPI
4590 VOID
4591 DDKAPI
4592 NdisMDeregisterAdapterShutdownHandler(
4593 /*IN*/ NDIS_HANDLE MiniportHandle);
4595 NDISAPI
4596 VOID
4597 DDKAPI
4598 NdisMDeregisterInterrupt(
4599 /*IN*/ PNDIS_MINIPORT_INTERRUPT Interrupt);
4601 NDISAPI
4602 VOID
4603 DDKAPI
4604 NdisMDeregisterIoPortRange(
4605 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
4606 /*IN*/ UINT InitialPort,
4607 /*IN*/ UINT NumberOfPorts,
4608 /*IN*/ PVOID PortOffset);
4611 * VOID
4612 * NdisMEthIndicateReceive(
4613 * IN NDIS_HANDLE MiniportAdapterHandle,
4614 * IN NDIS_HANDLE MiniportReceiveContext,
4615 * IN PVOID HeaderBuffer,
4616 * IN UINT HeaderBufferSize,
4617 * IN PVOID LookaheadBuffer,
4618 * IN UINT LookaheadBufferSize,
4619 * IN UINT PacketSize);
4621 #define NdisMEthIndicateReceive(MiniportAdapterHandle, \
4622 MiniportReceiveContext, \
4623 HeaderBuffer, \
4624 HeaderBufferSize, \
4625 LookaheadBuffer, \
4626 LookaheadBufferSize, \
4627 PacketSize) \
4629 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->EthRxIndicateHandler)( \
4630 (((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FilterDbs.EthDB), \
4631 (MiniportReceiveContext), \
4632 (HeaderBuffer), \
4633 (HeaderBuffer), \
4634 (HeaderBufferSize), \
4635 (LookaheadBuffer), \
4636 (LookaheadBufferSize), \
4637 (PacketSize)); \
4641 * VOID
4642 * NdisMEthIndicateReceiveComplete(
4643 * IN NDIS_HANDLE MiniportAdapterHandle);
4645 #define NdisMEthIndicateReceiveComplete(MiniportAdapterHandle) \
4647 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->EthRxCompleteHandler)( \
4648 ((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->FilterDbs.EthDB); \
4652 * VOID
4653 * NdisMFddiIndicateReceive(
4654 * IN NDIS_HANDLE MiniportAdapterHandle,
4655 * IN NDIS_HANDLE MiniportReceiveContext,
4656 * IN PVOID HeaderBuffer,
4657 * IN UINT HeaderBufferSize,
4658 * IN PVOID LookaheadBuffer,
4659 * IN UINT LookaheadBufferSize,
4660 * IN UINT PacketSize);
4662 #define NdisMFddiIndicateReceive(MiniportAdapterHandle, \
4663 MiniportReceiveContext, \
4664 HeaderBuffer, \
4665 HeaderBufferSize, \
4666 LookaheadBuffer, \
4667 LookaheadBufferSize, \
4668 PacketSize) \
4670 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FddiRxIndicateHandler)( \
4671 (((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FilterDbs.FddiDB), \
4672 (MiniportReceiveContext), \
4673 (PUCHAR)(HeaderBuffer) + 1, \
4674 (((*(PUCHAR*)(HeaderBuffer)) & 0x40) ? \
4675 FDDI_LENGTH_OF_LONG_ADDRESS : \
4676 FDDI_LENGTH_OF_SHORT_ADDRESS), \
4677 (HeaderBuffer), \
4678 (HeaderBufferSize), \
4679 (LookaheadBuffer), \
4680 (LookaheadBufferSize), \
4681 (PacketSize)); \
4687 * VOID
4688 * NdisMFddiIndicateReceiveComplete(
4689 * IN NDIS_HANDLE MiniportAdapterHandle);
4691 #define NdisMFddiIndicateReceiveComplete(MiniportAdapterHandle) \
4693 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FddiRxCompleteHandler)( \
4694 ((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->FilterDbs.FddiDB); \
4697 NDISAPI
4698 VOID
4699 DDKAPI
4700 NdisMFlushLog(
4701 /*IN*/ NDIS_HANDLE LogHandle);
4703 NDISAPI
4704 VOID
4705 DDKAPI
4706 NdisMFreeMapRegisters(
4707 /*IN*/ NDIS_HANDLE MiniportAdapterHandle);
4710 * VOID
4711 * NdisMIndicateStatus(
4712 * IN NDIS_HANDLE MiniportAdapterHandle,
4713 * IN NDIS_STATUS GeneralStatus,
4714 * IN PVOID StatusBuffer,
4715 * IN UINT StatusBufferSize);
4718 #define NdisMIndicateStatus(MiniportAdapterHandle, \
4719 GeneralStatus, StatusBuffer, StatusBufferSize) \
4720 (*((PNDIS_MINIPORT_BLOCK)(_M))->StatusHandler)( \
4721 MiniportAdapterHandle, GeneralStatus, StatusBuffer, StatusBufferSize)
4724 * VOID
4725 * NdisMIndicateStatusComplete(
4726 * IN NDIS_HANDLE MiniportAdapterHandle);
4728 #define NdisMIndicateStatusComplete(MiniportAdapterHandle) \
4729 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->StatusCompleteHandler)( \
4730 MiniportAdapterHandle)
4733 * VOID
4734 * NdisMInitializeWrapper(
4735 * OUT PNDIS_HANDLE NdisWrapperHandle,
4736 * IN PVOID SystemSpecific1,
4737 * IN PVOID SystemSpecific2,
4738 * IN PVOID SystemSpecific3);
4740 #define NdisMInitializeWrapper(NdisWrapperHandle, \
4741 SystemSpecific1, \
4742 SystemSpecific2, \
4743 SystemSpecific3) \
4744 NdisInitializeWrapper((NdisWrapperHandle), \
4745 (SystemSpecific1), \
4746 (SystemSpecific2), \
4747 (SystemSpecific3))
4749 NDISAPI
4750 NDIS_STATUS
4751 DDKAPI
4752 NdisMMapIoSpace(
4753 /*OUT*/ PVOID *VirtualAddress,
4754 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
4755 /*IN*/ NDIS_PHYSICAL_ADDRESS PhysicalAddress,
4756 /*IN*/ UINT Length);
4759 * VOID
4760 * NdisMQueryInformationComplete(
4761 * IN NDIS_HANDLE MiniportAdapterHandle,
4762 * IN NDIS_STATUS Status);
4764 #define NdisMQueryInformationComplete(MiniportAdapterHandle, Status) \
4765 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->QueryCompleteHandler)(MiniportAdapterHandle, Status)
4767 NDISAPI
4768 VOID
4769 DDKAPI
4770 NdisMRegisterAdapterShutdownHandler(
4771 /*IN*/ NDIS_HANDLE MiniportHandle,
4772 /*IN*/ PVOID ShutdownContext,
4773 /*IN*/ ADAPTER_SHUTDOWN_HANDLER ShutdownHandler);
4775 NDISAPI
4776 NDIS_STATUS
4777 DDKAPI
4778 NdisMRegisterInterrupt(
4779 /*OUT*/ PNDIS_MINIPORT_INTERRUPT Interrupt,
4780 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
4781 /*IN*/ UINT InterruptVector,
4782 /*IN*/ UINT InterruptLevel,
4783 /*IN*/ BOOLEAN RequestIsr,
4784 /*IN*/ BOOLEAN SharedInterrupt,
4785 /*IN*/ NDIS_INTERRUPT_MODE InterruptMode);
4787 NDISAPI
4788 NDIS_STATUS
4789 DDKAPI
4790 NdisMRegisterIoPortRange(
4791 /*OUT*/ PVOID *PortOffset,
4792 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
4793 /*IN*/ UINT InitialPort,
4794 /*IN*/ UINT NumberOfPorts);
4796 NDISAPI
4797 NDIS_STATUS
4798 DDKAPI
4799 NdisMRegisterMiniport(
4800 /*IN*/ NDIS_HANDLE NdisWrapperHandle,
4801 /*IN*/ PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics,
4802 /*IN*/ UINT CharacteristicsLength);
4805 #if !defined(_NDIS_)
4808 * VOID
4809 * NdisMResetComplete(
4810 * IN NDIS_HANDLE MiniportAdapterHandle,
4811 * IN NDIS_STATUS Status,
4812 * IN BOOLEAN AddressingReset);
4814 #define NdisMResetComplete(MiniportAdapterHandle, \
4815 Status, \
4816 AddressingReset) \
4818 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->ResetCompleteHandler)( \
4819 MiniportAdapterHandle, Status, AddressingReset); \
4823 * VOID
4824 * NdisMSendComplete(
4825 * IN NDIS_HANDLE MiniportAdapterHandle,
4826 * IN PNDIS_PACKET Packet,
4827 * IN NDIS_STATUS Status);
4829 #define NdisMSendComplete(MiniportAdapterHandle, \
4830 Packet, \
4831 Status) \
4833 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->SendCompleteHandler)( \
4834 MiniportAdapterHandle, Packet, Status); \
4838 * VOID
4839 * NdisMSendResourcesAvailable(
4840 * IN NDIS_HANDLE MiniportAdapterHandle);
4842 #define NdisMSendResourcesAvailable(MiniportAdapterHandle) \
4844 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->SendResourcesHandler)( \
4845 MiniportAdapterHandle); \
4849 * VOID
4850 * NdisMTransferDataComplete(
4851 * IN NDIS_HANDLE MiniportAdapterHandle,
4852 * IN PNDIS_PACKET Packet,
4853 * IN NDIS_STATUS Status,
4854 * IN UINT BytesTransferred);
4856 #define NdisMTransferDataComplete(MiniportAdapterHandle, \
4857 Packet, \
4858 Status, \
4859 BytesTransferred) \
4861 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->TDCompleteHandler)( \
4862 MiniportAdapterHandle, Packet, Status, BytesTransferred) \
4865 #endif /* !_NDIS_ */
4869 * VOID
4870 * NdisMSetAttributes(
4871 * IN NDIS_HANDLE MiniportAdapterHandle,
4872 * IN NDIS_HANDLE MiniportAdapterContext,
4873 * IN BOOLEAN BusMaster,
4874 * IN NDIS_INTERFACE_TYPE AdapterType);
4876 #define NdisMSetAttributes(MiniportAdapterHandle, \
4877 MiniportAdapterContext, \
4878 BusMaster, \
4879 AdapterType) \
4880 NdisMSetAttributesEx(MiniportAdapterHandle, \
4881 MiniportAdapterContext, \
4882 0, \
4883 (BusMaster) ? NDIS_ATTRIBUTE_BUS_MASTER : 0, \
4884 AdapterType)
4886 NDISAPI
4887 VOID
4888 DDKAPI
4889 NdisMSetAttributesEx(
4890 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
4891 /*IN*/ NDIS_HANDLE MiniportAdapterContext,
4892 /*IN*/ UINT CheckForHangTimeInSeconds /*OPTIONAL*/,
4893 /*IN*/ ULONG AttributeFlags,
4894 /*IN*/ NDIS_INTERFACE_TYPE AdapterType);
4897 * VOID
4898 * NdisMSetInformationComplete(
4899 * IN NDIS_HANDLE MiniportAdapterHandle,
4900 * IN NDIS_STATUS Status);
4902 #define NdisMSetInformationComplete(MiniportAdapterHandle, \
4903 Status) \
4904 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->SetCompleteHandler)( \
4905 MiniportAdapterHandle, Status)
4907 NDISAPI
4908 VOID
4909 DDKAPI
4910 NdisMSleep(
4911 /*IN*/ ULONG MicrosecondsToSleep);
4913 NDISAPI
4914 BOOLEAN
4915 DDKAPI
4916 NdisMSynchronizeWithInterrupt(
4917 /*IN*/ PNDIS_MINIPORT_INTERRUPT Interrupt,
4918 /*IN*/ PVOID SynchronizeFunction,
4919 /*IN*/ PVOID SynchronizeContext);
4922 * VOID
4923 * NdisMTrIndicateReceive(
4924 * IN NDIS_HANDLE MiniportAdapterHandle,
4925 * IN NDIS_HANDLE MiniportReceiveContext,
4926 * IN PVOID HeaderBuffer,
4927 * IN UINT HeaderBufferSize,
4928 * IN PVOID LookaheadBuffer,
4929 * IN UINT LookaheadBufferSize,
4930 * IN UINT PacketSize);
4932 #define NdisMTrIndicateReceive(MiniportAdapterHandle, \
4933 MiniportReceiveContext, \
4934 HeaderBuffer, \
4935 HeaderBufferSize, \
4936 LookaheadBuffer, \
4937 LookaheadBufferSize, \
4938 PacketSize) \
4940 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->TrRxIndicateHandler)( \
4941 (((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FilterDbs.TrDB), \
4942 (MiniportReceiveContext), \
4943 (HeaderBuffer), \
4944 (HeaderBuffer), \
4945 (HeaderBufferSize), \
4946 (LookaheadBuffer), \
4947 (LookaheadBufferSize), \
4948 (PacketSize)); \
4952 * VOID
4953 * NdisMTrIndicateReceiveComplete(
4954 * IN NDIS_HANDLE MiniportAdapterHandle);
4956 #define NdisMTrIndicateReceiveComplete(MiniportAdapterHandle) \
4958 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->TrRxCompleteHandler)( \
4959 ((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->FilterDbs.TrDB); \
4962 NDISAPI
4963 NDIS_STATUS
4964 DDKAPI
4965 NdisMWriteLogData(
4966 /*IN*/ NDIS_HANDLE LogHandle,
4967 /*IN*/ PVOID LogBuffer,
4968 /*IN*/ UINT LogBufferSize);
4970 NDISAPI
4971 VOID
4972 DDKAPI
4973 NdisMQueryAdapterResources(
4974 /*OUT*/ PNDIS_STATUS Status,
4975 /*IN*/ NDIS_HANDLE WrapperConfigurationContext,
4976 /*OUT*/ PNDIS_RESOURCE_LIST ResourceList,
4977 /*IN OUT*/ PUINT BufferSize);
4979 NDISAPI
4980 VOID
4981 DDKAPI
4982 NdisTerminateWrapper(
4983 /*IN*/ NDIS_HANDLE NdisWrapperHandle,
4984 /*IN*/ PVOID SystemSpecific);
4986 NDISAPI
4987 VOID
4988 DDKAPI
4989 NdisMUnmapIoSpace(
4990 /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
4991 /*IN*/ PVOID VirtualAddress,
4992 /*IN*/ UINT Length);
4996 /* NDIS intermediate miniport structures */
4998 typedef VOID (DDKAPI *W_MINIPORT_CALLBACK)(
4999 /*IN*/ NDIS_HANDLE MiniportAdapterContext,
5000 /*IN*/ PVOID CallbackContext);
5004 /* Routines for intermediate miniport drivers */
5006 NDISAPI
5007 NDIS_STATUS
5008 DDKAPI
5009 NdisIMDeInitializeDeviceInstance(
5010 /*IN*/ NDIS_HANDLE NdisMiniportHandle);
5013 * NDIS_STATUS
5014 * NdisIMInitializeDeviceInstance(
5015 * IN NDIS_HANDLE DriverHandle,
5016 * IN PNDIS_STRING DeviceInstance);
5018 #define NdisIMInitializeDeviceInstance(DriverHandle, DeviceInstance) \
5019 NdisIMInitializeDeviceInstanceEx(DriverHandle, DeviceInstance, NULL)
5021 NDISAPI
5022 NDIS_STATUS
5023 DDKAPI
5024 NdisIMRegisterLayeredMiniport(
5025 /*IN*/ NDIS_HANDLE NdisWrapperHandle,
5026 /*IN*/ PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics,
5027 /*IN*/ UINT CharacteristicsLength,
5028 /*OUT*/ PNDIS_HANDLE DriverHandle);
5031 /* Functions obsoleted by NDIS 5.0 */
5033 NDISAPI
5034 VOID
5035 DDKAPI
5036 NdisFreeDmaChannel(
5037 /*IN*/ PNDIS_HANDLE NdisDmaHandle);
5039 NDISAPI
5040 VOID
5041 DDKAPI
5042 NdisSetupDmaTransfer(
5043 /*OUT*/ PNDIS_STATUS Status,
5044 /*IN*/ PNDIS_HANDLE NdisDmaHandle,
5045 /*IN*/ PNDIS_BUFFER Buffer,
5046 /*IN*/ ULONG Offset,
5047 /*IN*/ ULONG Length,
5048 /*IN*/ BOOLEAN WriteToDevice);
5050 NDISAPI
5051 NTSTATUS
5052 DDKAPI
5053 NdisUpcaseUnicodeString(
5054 /*OUT*/ PUNICODE_STRING DestinationString,
5055 /*IN*/ PUNICODE_STRING SourceString);
5058 /* Routines for NDIS protocol drivers */
5060 NDISAPI
5061 VOID
5062 DDKAPI
5063 NdisRequest(
5064 /*OUT*/ PNDIS_STATUS Status,
5065 /*IN*/ NDIS_HANDLE NdisBindingHandle,
5066 /*IN*/ PNDIS_REQUEST NdisRequest);
5068 NDISAPI
5069 VOID
5070 DDKAPI
5071 NdisReset(
5072 /*OUT*/ PNDIS_STATUS Status,
5073 /*IN*/ NDIS_HANDLE NdisBindingHandle);
5075 NDISAPI
5076 VOID
5077 DDKAPI
5078 NdisSend(
5079 /*OUT*/ PNDIS_STATUS Status,
5080 /*IN*/ NDIS_HANDLE NdisBindingHandle,
5081 /*IN*/ PNDIS_PACKET Packet);
5083 NDISAPI
5084 VOID
5085 DDKAPI
5086 NdisSendPackets(
5087 /*IN*/ NDIS_HANDLE NdisBindingHandle,
5088 /*IN*/ PPNDIS_PACKET PacketArray,
5089 /*IN*/ UINT NumberOfPackets);
5091 NDISAPI
5092 VOID
5093 DDKAPI
5094 NdisTransferData(
5095 /*OUT*/ PNDIS_STATUS Status,
5096 /*IN*/ NDIS_HANDLE NdisBindingHandle,
5097 /*IN*/ NDIS_HANDLE MacReceiveContext,
5098 /*IN*/ UINT ByteOffset,
5099 /*IN*/ UINT BytesToTransfer,
5100 /*IN OUT*/ PNDIS_PACKET Packet,
5101 /*OUT*/ PUINT BytesTransferred);
5103 NDISAPI
5104 VOID
5105 DDKAPI
5106 NdisCloseAdapter(
5107 /*OUT*/ PNDIS_STATUS Status,
5108 /*IN*/ NDIS_HANDLE NdisBindingHandle);
5110 NDISAPI
5111 VOID
5112 DDKAPI
5113 NdisCompleteBindAdapter(
5114 /*IN*/ NDIS_HANDLE BindAdapterContext,
5115 /*IN*/ NDIS_STATUS Status,
5116 /*IN*/ NDIS_STATUS OpenStatus);
5118 NDISAPI
5119 VOID
5120 DDKAPI
5121 NdisCompleteUnbindAdapter(
5122 /*IN*/ NDIS_HANDLE UnbindAdapterContext,
5123 /*IN*/ NDIS_STATUS Status);
5125 NDISAPI
5126 VOID
5127 DDKAPI
5128 NdisDeregisterProtocol(
5129 /*OUT*/ PNDIS_STATUS Status,
5130 /*IN*/ NDIS_HANDLE NdisProtocolHandle);
5132 NDISAPI
5133 VOID
5134 DDKAPI
5135 NdisOpenAdapter(
5136 /*OUT*/ PNDIS_STATUS Status,
5137 /*OUT*/ PNDIS_STATUS OpenErrorStatus,
5138 /*OUT*/ PNDIS_HANDLE NdisBindingHandle,
5139 /*OUT*/ PUINT SelectedMediumIndex,
5140 /*IN*/ PNDIS_MEDIUM MediumArray,
5141 /*IN*/ UINT MediumArraySize,
5142 /*IN*/ NDIS_HANDLE NdisProtocolHandle,
5143 /*IN*/ NDIS_HANDLE ProtocolBindingContext,
5144 /*IN*/ PNDIS_STRING AdapterName,
5145 /*IN*/ UINT OpenOptions,
5146 /*IN*/ PSTRING AddressingInformation);
5148 NDISAPI
5149 VOID
5150 DDKAPI
5151 NdisOpenProtocolConfiguration(
5152 /*OUT*/ PNDIS_STATUS Status,
5153 /*OUT*/ PNDIS_HANDLE ConfigurationHandle,
5154 /*IN*/ PNDIS_STRING ProtocolSection);
5156 NDISAPI
5157 VOID
5158 DDKAPI
5159 NdisRegisterProtocol(
5160 /*OUT*/ PNDIS_STATUS Status,
5161 /*OUT*/ PNDIS_HANDLE NdisProtocolHandle,
5162 /*IN*/ PNDIS_PROTOCOL_CHARACTERISTICS ProtocolCharacteristics,
5163 /*IN*/ UINT CharacteristicsLength);
5165 /* Obsoleted in Windows XP */
5167 /* Prototypes for NDIS_MAC_CHARACTERISTICS */
5169 typedef NDIS_STATUS (*OPEN_ADAPTER_HANDLER)(
5170 /*OUT*/ PNDIS_STATUS OpenErrorStatus,
5171 /*OUT*/ NDIS_HANDLE *MacBindingHandle,
5172 /*OUT*/ PUINT SelectedMediumIndex,
5173 /*IN*/ PNDIS_MEDIUM MediumArray,
5174 /*IN*/ UINT MediumArraySize,
5175 /*IN*/ NDIS_HANDLE NdisBindingContext,
5176 /*IN*/ NDIS_HANDLE MacAdapterContext,
5177 /*IN*/ UINT OpenOptions,
5178 /*IN*/ PSTRING AddressingInformation /*OPTIONAL*/);
5180 typedef NDIS_STATUS (DDKAPI *CLOSE_ADAPTER_HANDLER)(
5181 /*IN*/ NDIS_HANDLE MacBindingHandle);
5183 typedef NDIS_STATUS (DDKAPI *WAN_TRANSFER_DATA_HANDLER)(
5184 VOID);
5186 typedef NDIS_STATUS (DDKAPI *QUERY_GLOBAL_STATISTICS_HANDLER)(
5187 /*IN*/ NDIS_HANDLE MacAdapterContext,
5188 /*IN*/ PNDIS_REQUEST NdisRequest);
5190 typedef VOID (DDKAPI *UNLOAD_MAC_HANDLER)(
5191 /*IN*/ NDIS_HANDLE MacMacContext);
5193 typedef NDIS_STATUS (DDKAPI *ADD_ADAPTER_HANDLER)(
5194 /*IN*/ NDIS_HANDLE MacMacContext,
5195 /*IN*/ NDIS_HANDLE WrapperConfigurationContext,
5196 /*IN*/ PNDIS_STRING AdapterName);
5198 typedef VOID (*REMOVE_ADAPTER_HANDLER)(
5199 /*IN*/ NDIS_HANDLE MacAdapterContext);
5201 typedef struct _NDIS_MAC_CHARACTERISTICS {
5202 UCHAR MajorNdisVersion;
5203 UCHAR MinorNdisVersion;
5204 UINT Reserved;
5205 OPEN_ADAPTER_HANDLER OpenAdapterHandler;
5206 CLOSE_ADAPTER_HANDLER CloseAdapterHandler;
5207 SEND_HANDLER SendHandler;
5208 TRANSFER_DATA_HANDLER TransferDataHandler;
5209 RESET_HANDLER ResetHandler;
5210 REQUEST_HANDLER RequestHandler;
5211 QUERY_GLOBAL_STATISTICS_HANDLER QueryGlobalStatisticsHandler;
5212 UNLOAD_MAC_HANDLER UnloadMacHandler;
5213 ADD_ADAPTER_HANDLER AddAdapterHandler;
5214 REMOVE_ADAPTER_HANDLER RemoveAdapterHandler;
5215 NDIS_STRING Name;
5216 } NDIS_MAC_CHARACTERISTICS, *PNDIS_MAC_CHARACTERISTICS;
5218 typedef NDIS_MAC_CHARACTERISTICS NDIS_WAN_MAC_CHARACTERISTICS;
5219 typedef NDIS_WAN_MAC_CHARACTERISTICS *PNDIS_WAN_MAC_CHARACTERISTICS;
5221 #ifdef __cplusplus
5223 #endif
5225 #endif /* __NDIS_H */
5227 /* EOF */