Changed GUID_DEFINED to _GUID_DEFINED for compatibility (prevent conflict) with mingw...
[reactos.git] / reactos / include / net / ndis.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS NDIS library
4 * FILE: include/net/ndis.h
5 * PURPOSE: Structures used by NDIS drivers
6 * DEFINES: i386 - Target platform is i386
7 * NDIS_WRAPPER - Define only for NDIS wrapper library
8 * NDIS_MINIPORT_DRIVER - Define only for NDIS miniport drivers
9 * BINARY_COMPATIBLE - 0 = Use macros for some features
10 * - 1 = Use imports for features not available
11 * NDIS40 - Use NDIS 4.0 structures by default
12 * NDIS50 - Use NDIS 5.0 structures by default
13 */
14 #ifndef __NDIS_H
15 #define __NDIS_H
16
17 #ifdef __cplusplus
18 extern "C"
19 {
20 #endif /* __cplusplus */
21
22 #ifdef NDIS50
23 #undef NDIS40
24 #define NDIS40
25 #endif
26
27
28 /* Windows 9x compatibillity for miniports on x86 platform */
29 #ifndef BINARY_COMPATIBLE
30 #if defined(NDIS_MINIPORT_DRIVER) && defined(i386)
31 #define BINARY_COMPATIBLE 1
32 #else
33 #define BINARY_COMPATIBLE 0
34 #endif
35 #endif
36
37 #ifndef UNALIGNED
38 #define UNALIGNED
39 #endif
40
41 #ifndef FASTCALL
42 #define FASTCALL __attribute__((fastcall))
43 #endif
44
45 /* The NDIS library export functions. NDIS miniport drivers import functions */
46 #ifdef NDIS_WRAPPER
47
48 #ifdef _MSC_VER
49 #define EXPIMP __declspec(dllexport)
50 #else
51 #define EXPIMP STDCALL
52 #endif
53
54 #else /* NDIS_WRAPPER */
55
56 #ifdef _MSC_VER
57 #define EXPIMP __declspec(dllimport)
58 #else
59 #define EXPIMP STDCALL
60 #endif
61
62 #endif /* NDIS_WRAPPER */
63
64
65
66 #ifdef NDIS_MINIPORT_DRIVER
67
68 #include "miniport.h"
69
70 #else /* NDIS_MINIPORT_DRIVER */
71
72 #ifdef _MSC_VER
73 #include <ntddk.h>
74
75 typedef ULONG ULONG_PTR, *PULONG_PTR;
76
77 #else /* _MSC_VER */
78 #include <ddk/ntddk.h>
79
80 /* FIXME: Missed some definitions in there */
81
82 typedef struct _DMA_CONFIGURATION_BYTE0
83 {
84 UCHAR Channel:3;
85 UCHAR Reserved:3;
86 UCHAR Shared:1;
87 UCHAR MoreEntries:1;
88 } DMA_CONFIGURATION_BYTE0;
89
90 typedef struct _DMA_CONFIGURATION_BYTE1
91 {
92 UCHAR Reserved0:2;
93 UCHAR TransferSize:2;
94 UCHAR Timing:2;
95 UCHAR Reserved1:2;
96 } DMA_CONFIGURATION_BYTE1;
97
98
99 typedef struct _EISA_MEMORY_TYPE
100 {
101 UCHAR ReadWrite:1;
102 UCHAR Cached:1;
103 UCHAR Reserved0:1;
104 UCHAR Type:2;
105 UCHAR Shared:1;
106 UCHAR Reserved1:1;
107 UCHAR MoreEntries:1;
108 } EISA_MEMORY_TYPE, *PEISA_MEMORY_TYPE;
109
110 typedef struct _EISA_MEMORY_CONFIGURATION
111 {
112 EISA_MEMORY_TYPE ConfigurationByte;
113 UCHAR DataSize;
114 USHORT AddressLowWord;
115 UCHAR AddressHighByte;
116 USHORT MemorySize;
117 } EISA_MEMORY_CONFIGURATION, *PEISA_MEMORY_CONFIGURATION;
118
119
120 typedef struct _EISA_IRQ_DESCRIPTOR
121 {
122 UCHAR Interrupt:4;
123 UCHAR Reserved:1;
124 UCHAR LevelTriggered:1;
125 UCHAR Shared:1;
126 UCHAR MoreEntries:1;
127 } EISA_IRQ_DESCRIPTOR, *PEISA_IRQ_DESCRIPTOR;
128
129 typedef struct _EISA_IRQ_CONFIGURATION
130 {
131 EISA_IRQ_DESCRIPTOR ConfigurationByte;
132 UCHAR Reserved;
133 } EISA_IRQ_CONFIGURATION, *PEISA_IRQ_CONFIGURATION;
134
135 typedef struct _EISA_DMA_CONFIGURATION
136 {
137 DMA_CONFIGURATION_BYTE0 ConfigurationByte0;
138 DMA_CONFIGURATION_BYTE1 ConfigurationByte1;
139 } EISA_DMA_CONFIGURATION, *PEISA_DMA_CONFIGURATION;
140
141
142 typedef struct _EISA_PORT_DESCRIPTOR
143 {
144 UCHAR NumberPorts:5;
145 UCHAR Reserved:1;
146 UCHAR Shared:1;
147 UCHAR MoreEntries:1;
148 } EISA_PORT_DESCRIPTOR, *PEISA_PORT_DESCRIPTOR;
149
150 typedef struct _EISA_PORT_CONFIGURATION
151 {
152 EISA_PORT_DESCRIPTOR Configuration;
153 USHORT PortAddress;
154 } EISA_PORT_CONFIGURATION, *PEISA_PORT_CONFIGURATION;
155
156 typedef struct _CM_EISA_SLOT_INFORMATION
157 {
158 UCHAR ReturnCode;
159 UCHAR ReturnFlags;
160 UCHAR MajorRevision;
161 UCHAR MinorRevision;
162 USHORT Checksum;
163 UCHAR NumberFunctions;
164 UCHAR FunctionInformation;
165 ULONG CompressedId;
166 } CM_EISA_SLOT_INFORMATION, *PCM_EISA_SLOT_INFORMATION;
167
168 typedef struct _CM_EISA_FUNCTION_INFORMATION
169 {
170 ULONG CompressedId;
171 UCHAR IdSlotFlags1;
172 UCHAR IdSlotFlags2;
173 UCHAR MinorRevision;
174 UCHAR MajorRevision;
175 UCHAR Selections[26];
176 UCHAR FunctionFlags;
177 UCHAR TypeString[80];
178 EISA_MEMORY_CONFIGURATION EisaMemory[9];
179 EISA_IRQ_CONFIGURATION EisaIrq[7];
180 EISA_DMA_CONFIGURATION EisaDma[4];
181 EISA_PORT_CONFIGURATION EisaPort[20];
182 UCHAR InitializationData[60];
183 } CM_EISA_FUNCTION_INFORMATION, *PCM_EISA_FUNCTION_INFORMATION;
184
185 #endif /* _MSC_VER */
186
187 /* FIXME: Missed some definitions in there */
188
189 typedef CONST CHAR *PCSTR;
190
191 #endif /* NDIS_MINIPORT_DRIVER */
192
193 #include "netevent.h"
194 #include "ndisoid.h"
195 #include "ntddndis.h"
196
197
198 #if defined(NDIS_MINIPORT_DRIVER) || !defined(_MSC_VER)
199
200 #ifndef _GUID_DEFINED
201 #define _GUID_DEFINED
202
203 typedef struct _GUID {
204 ULONG Data1;
205 USHORT Data2;
206 USHORT Data3;
207 UCHAR Data4[8];
208 } GUID;
209
210 #endif /* _GUID_DEFINED */
211
212 #endif /* NDIS_MINIPORT_DRIVER || _MSC_VER */
213
214
215 /* NDIS base types */
216
217 typedef struct _NDIS_SPIN_LOCK
218 {
219 KSPIN_LOCK SpinLock;
220 KIRQL OldIrql;
221 } NDIS_SPIN_LOCK, * PNDIS_SPIN_LOCK;
222
223 typedef struct _NDIS_EVENT
224 {
225 KEVENT Event;
226 } NDIS_EVENT, *PNDIS_EVENT;
227
228 typedef PVOID NDIS_HANDLE, *PNDIS_HANDLE;
229 typedef int NDIS_STATUS, *PNDIS_STATUS;
230
231 typedef UNICODE_STRING NDIS_STRING, *PNDIS_STRING;
232
233 typedef PCSTR NDIS_ANSI_STRING, *PNDIS_ANSI_STRING;
234
235 typedef MDL NDIS_BUFFER, *PNDIS_BUFFER;
236
237 /* NDIS_STATUS constants */
238 #define NDIS_STATUS_SUCCESS ((NDIS_STATUS)STATUS_SUCCESS)
239 #define NDIS_STATUS_PENDING ((NDIS_STATUS)STATUS_PENDING)
240 #define NDIS_STATUS_NOT_RECOGNIZED ((NDIS_STATUS)0x00010001L)
241 #define NDIS_STATUS_NOT_COPIED ((NDIS_STATUS)0x00010002L)
242 #define NDIS_STATUS_NOT_ACCEPTED ((NDIS_STATUS)0x00010003L)
243 #define NDIS_STATUS_CALL_ACTIVE ((NDIS_STATUS)0x00010007L)
244
245 #define NDIS_STATUS_ONLINE ((NDIS_STATUS)0x40010003L)
246 #define NDIS_STATUS_RESET_START ((NDIS_STATUS)0x40010004L)
247 #define NDIS_STATUS_RESET_END ((NDIS_STATUS)0x40010005L)
248 #define NDIS_STATUS_RING_STATUS ((NDIS_STATUS)0x40010006L)
249 #define NDIS_STATUS_CLOSED ((NDIS_STATUS)0x40010007L)
250 #define NDIS_STATUS_WAN_LINE_UP ((NDIS_STATUS)0x40010008L)
251 #define NDIS_STATUS_WAN_LINE_DOWN ((NDIS_STATUS)0x40010009L)
252 #define NDIS_STATUS_WAN_FRAGMENT ((NDIS_STATUS)0x4001000AL)
253 #define NDIS_STATUS_MEDIA_CONNECT ((NDIS_STATUS)0x4001000BL)
254 #define NDIS_STATUS_MEDIA_DISCONNECT ((NDIS_STATUS)0x4001000CL)
255 #define NDIS_STATUS_HARDWARE_LINE_UP ((NDIS_STATUS)0x4001000DL)
256 #define NDIS_STATUS_HARDWARE_LINE_DOWN ((NDIS_STATUS)0x4001000EL)
257 #define NDIS_STATUS_INTERFACE_UP ((NDIS_STATUS)0x4001000FL)
258 #define NDIS_STATUS_INTERFACE_DOWN ((NDIS_STATUS)0x40010010L)
259 #define NDIS_STATUS_MEDIA_BUSY ((NDIS_STATUS)0x40010011L)
260 #define NDIS_STATUS_WW_INDICATION ((NDIS_STATUS)0x40010012L)
261 #define NDIS_STATUS_TAPI_INDICATION ((NDIS_STATUS)0x40010080L)
262
263 #define NDIS_STATUS_NOT_RESETTABLE ((NDIS_STATUS)0x80010001L)
264 #define NDIS_STATUS_SOFT_ERRORS ((NDIS_STATUS)0x80010003L)
265 #define NDIS_STATUS_HARD_ERRORS ((NDIS_STATUS)0x80010004L)
266 #define NDIS_STATUS_BUFFER_OVERFLOW ((NDIS_STATUS)STATUS_BUFFER_OVERFLOW)
267
268 #define NDIS_STATUS_FAILURE ((NDIS_STATUS)STATUS_UNSUCCESSFUL)
269 #define NDIS_STATUS_RESOURCES ((NDIS_STATUS)STATUS_INSUFFICIENT_RESOURCES)
270 #define NDIS_STATUS_CLOSING ((NDIS_STATUS)0xC0010002L)
271 #define NDIS_STATUS_BAD_VERSION ((NDIS_STATUS)0xC0010004L)
272 #define NDIS_STATUS_BAD_CHARACTERISTICS ((NDIS_STATUS)0xC0010005L)
273 #define NDIS_STATUS_ADAPTER_NOT_FOUND ((NDIS_STATUS)0xC0010006L)
274 #define NDIS_STATUS_OPEN_FAILED ((NDIS_STATUS)0xC0010007L)
275 #define NDIS_STATUS_DEVICE_FAILED ((NDIS_STATUS)0xC0010008L)
276 #define NDIS_STATUS_MULTICAST_FULL ((NDIS_STATUS)0xC0010009L)
277 #define NDIS_STATUS_MULTICAST_EXISTS ((NDIS_STATUS)0xC001000AL)
278 #define NDIS_STATUS_MULTICAST_NOT_FOUND ((NDIS_STATUS)0xC001000BL)
279 #define NDIS_STATUS_REQUEST_ABORTED ((NDIS_STATUS)0xC001000CL)
280 #define NDIS_STATUS_RESET_IN_PROGRESS ((NDIS_STATUS)0xC001000DL)
281 #define NDIS_STATUS_CLOSING_INDICATING ((NDIS_STATUS)0xC001000EL)
282 #define NDIS_STATUS_NOT_SUPPORTED ((NDIS_STATUS)STATUS_NOT_SUPPORTED)
283 #define NDIS_STATUS_INVALID_PACKET ((NDIS_STATUS)0xC001000FL)
284 #define NDIS_STATUS_OPEN_LIST_FULL ((NDIS_STATUS)0xC0010010L)
285 #define NDIS_STATUS_ADAPTER_NOT_READY ((NDIS_STATUS)0xC0010011L)
286 #define NDIS_STATUS_ADAPTER_NOT_OPEN ((NDIS_STATUS)0xC0010012L)
287 #define NDIS_STATUS_NOT_INDICATING ((NDIS_STATUS)0xC0010013L)
288 #define NDIS_STATUS_INVALID_LENGTH ((NDIS_STATUS)0xC0010014L)
289 #define NDIS_STATUS_INVALID_DATA ((NDIS_STATUS)0xC0010015L)
290 #define NDIS_STATUS_BUFFER_TOO_SHORT ((NDIS_STATUS)0xC0010016L)
291 #define NDIS_STATUS_INVALID_OID ((NDIS_STATUS)0xC0010017L)
292 #define NDIS_STATUS_ADAPTER_REMOVED ((NDIS_STATUS)0xC0010018L)
293 #define NDIS_STATUS_UNSUPPORTED_MEDIA ((NDIS_STATUS)0xC0010019L)
294 #define NDIS_STATUS_GROUP_ADDRESS_IN_USE ((NDIS_STATUS)0xC001001AL)
295 #define NDIS_STATUS_FILE_NOT_FOUND ((NDIS_STATUS)0xC001001BL)
296 #define NDIS_STATUS_ERROR_READING_FILE ((NDIS_STATUS)0xC001001CL)
297 #define NDIS_STATUS_ALREADY_MAPPED ((NDIS_STATUS)0xC001001DL)
298 #define NDIS_STATUS_RESOURCE_CONFLICT ((NDIS_STATUS)0xC001001EL)
299 #define NDIS_STATUS_NO_CABLE ((NDIS_STATUS)0xC001001FL)
300
301 #define NDIS_STATUS_INVALID_SAP ((NDIS_STATUS)0xC0010020L)
302 #define NDIS_STATUS_SAP_IN_USE ((NDIS_STATUS)0xC0010021L)
303 #define NDIS_STATUS_INVALID_ADDRESS ((NDIS_STATUS)0xC0010022L)
304 #define NDIS_STATUS_VC_NOT_ACTIVATED ((NDIS_STATUS)0xC0010023L)
305 #define NDIS_STATUS_DEST_OUT_OF_ORDER ((NDIS_STATUS)0xC0010024L)
306 #define NDIS_STATUS_VC_NOT_AVAILABLE ((NDIS_STATUS)0xC0010025L)
307 #define NDIS_STATUS_CELLRATE_NOT_AVAILABLE ((NDIS_STATUS)0xC0010026L)
308 #define NDIS_STATUS_INCOMPATABLE_QOS ((NDIS_STATUS)0xC0010027L)
309 #define NDIS_STATUS_AAL_PARAMS_UNSUPPORTED ((NDIS_STATUS)0xC0010028L)
310 #define NDIS_STATUS_NO_ROUTE_TO_DESTINATION ((NDIS_STATUS)0xC0010029L)
311
312 #define NDIS_STATUS_TOKEN_RING_OPEN_ERROR ((NDIS_STATUS)0xC0011000L)
313
314
315 /* NDIS error codes for error logging */
316
317 #define NDIS_ERROR_CODE ULONG
318
319 #define NDIS_ERROR_CODE_RESOURCE_CONFLICT EVENT_NDIS_RESOURCE_CONFLICT
320 #define NDIS_ERROR_CODE_OUT_OF_RESOURCES EVENT_NDIS_OUT_OF_RESOURCE
321 #define NDIS_ERROR_CODE_HARDWARE_FAILURE EVENT_NDIS_HARDWARE_FAILURE
322 #define NDIS_ERROR_CODE_ADAPTER_NOT_FOUND EVENT_NDIS_ADAPTER_NOT_FOUND
323 #define NDIS_ERROR_CODE_INTERRUPT_CONNECT EVENT_NDIS_INTERRUPT_CONNECT
324 #define NDIS_ERROR_CODE_DRIVER_FAILURE EVENT_NDIS_DRIVER_FAILURE
325 #define NDIS_ERROR_CODE_BAD_VERSION EVENT_NDIS_BAD_VERSION
326 #define NDIS_ERROR_CODE_TIMEOUT EVENT_NDIS_TIMEOUT
327 #define NDIS_ERROR_CODE_NETWORK_ADDRESS EVENT_NDIS_NETWORK_ADDRESS
328 #define NDIS_ERROR_CODE_UNSUPPORTED_CONFIGURATION EVENT_NDIS_UNSUPPORTED_CONFIGURATION
329 #define NDIS_ERROR_CODE_INVALID_VALUE_FROM_ADAPTER EVENT_NDIS_INVALID_VALUE_FROM_ADAPTER
330 #define NDIS_ERROR_CODE_MISSING_CONFIGURATION_PARAMETER EVENT_NDIS_MISSING_CONFIGURATION_PARAMETER
331 #define NDIS_ERROR_CODE_BAD_IO_BASE_ADDRESS EVENT_NDIS_BAD_IO_BASE_ADDRESS
332 #define NDIS_ERROR_CODE_RECEIVE_SPACE_SMALL EVENT_NDIS_RECEIVE_SPACE_SMALL
333 #define NDIS_ERROR_CODE_ADAPTER_DISABLED EVENT_NDIS_ADAPTER_DISABLED
334
335
336 /* Memory allocation flags. Used by Ndis(Allocate|Free)Memory */
337 #define NDIS_MEMORY_CONTIGUOUS 0x00000001
338 #define NDIS_MEMORY_NONCACHED 0x00000002
339
340 /* NIC attribute flags. Used by NdisMSetAttributes(Ex) */
341 #define NDIS_ATTRIBUTE_IGNORE_PACKET_TIMEOUT 0x00000001
342 #define NDIS_ATTRIBUTE_IGNORE_REQUEST_TIMEOUT 0x00000002
343 #define NDIS_ATTRIBUTE_IGNORE_TOKEN_RING_ERRORS 0x00000004
344 #define NDIS_ATTRIBUTE_BUS_MASTER 0x00000008
345 #define NDIS_ATTRIBUTE_INTERMEDIATE_DRIVER 0x00000010
346
347
348
349 #define MAXIMUM_PROCESSORS 32
350
351
352
353 /* Lock */
354
355 typedef union _NDIS_RW_LOCK_REFCOUNT
356 {
357 UINT RefCount;
358 UCHAR cacheLine[16];
359 } NDIS_RW_LOCK_REFCOUNT;
360
361 typedef struct _NDIS_RW_LOCK
362 {
363 union
364 {
365 struct
366 {
367 KSPIN_LOCK SpinLock;
368 PVOID Context;
369 } s;
370 UCHAR Reserved[16];
371 } u;
372
373 NDIS_RW_LOCK_REFCOUNT RefCount[MAXIMUM_PROCESSORS];
374 } NDIS_RW_LOCK, *PNDIS_RW_LOCK;
375
376 typedef struct _LOCK_STATE
377 {
378 USHORT LockState;
379 KIRQL OldIrql;
380 } LOCK_STATE, *PLOCK_STATE;
381
382
383
384 /* Timer */
385
386 typedef VOID (*PNDIS_TIMER_FUNCTION)(
387 IN PVOID SystemSpecific1,
388 IN PVOID FunctionContext,
389 IN PVOID SystemSpecific2,
390 IN PVOID SystemSpecific3);
391
392 typedef struct _NDIS_TIMER
393 {
394 KTIMER Timer;
395 KDPC Dpc;
396 } NDIS_TIMER, *PNDIS_TIMER;
397
398
399
400 /* Hardware */
401
402 typedef CM_MCA_POS_DATA NDIS_MCA_POS_DATA, *PNDIS_MCA_POS_DATA;
403 typedef CM_EISA_SLOT_INFORMATION NDIS_EISA_SLOT_INFORMATION, *PNDIS_EISA_SLOT_INFORMATION;
404 typedef CM_EISA_FUNCTION_INFORMATION NDIS_EISA_FUNCTION_INFORMATION, *PNDIS_EISA_FUNCTION_INFORMATION;
405 typedef CM_PARTIAL_RESOURCE_LIST NDIS_RESOURCE_LIST, *PNDIS_RESOURCE_LIST;
406
407 /* Hardware status codes (OID_GEN_HARDWARE_STATUS) */
408 typedef enum _NDIS_HARDWARE_STATUS
409 {
410 NdisHardwareStatusReady,
411 NdisHardwareStatusInitializing,
412 NdisHardwareStatusReset,
413 NdisHardwareStatusClosing,
414 NdisHardwareStatusNotReady
415 } NDIS_HARDWARE_STATUS, *PNDIS_HARDWARE_STATUS;
416
417 /* OID_GEN_GET_TIME_CAPS */
418 typedef struct _GEN_GET_TIME_CAPS
419 {
420 ULONG Flags;
421 ULONG ClockPrecision;
422 } GEN_GET_TIME_CAPS, *PGEN_GET_TIME_CAPS;
423
424 /* Flag bits */
425 #define READABLE_LOCAL_CLOCK 0x00000001
426 #define CLOCK_NETWORK_DERIVED 0x00000002
427 #define CLOCK_PRECISION 0x00000004
428 #define RECEIVE_TIME_INDICATION_CAPABLE 0x00000008
429 #define TIMED_SEND_CAPABLE 0x00000010
430 #define TIME_STAMP_CAPABLE 0x00000020
431
432 /* OID_GEN_GET_NETCARD_TIME */
433 typedef struct _GEN_GET_NETCARD_TIME
434 {
435 ULONGLONG ReadTime;
436 } GEN_GET_NETCARD_TIME, *PGEN_GET_NETCARD_TIME;
437
438 /* NDIS driver medium (OID_GEN_MEDIA_SUPPORTED / OID_GEN_MEDIA_IN_USE) */
439 typedef enum _NDIS_MEDIUM
440 {
441 NdisMedium802_3,
442 NdisMedium802_5,
443 NdisMediumFddi,
444 NdisMediumWan,
445 NdisMediumLocalTalk,
446 NdisMediumDix, /* Defined for convenience, not a real medium */
447 NdisMediumArcnetRaw,
448 NdisMediumArcnet878_2,
449 NdisMediumAtm,
450 NdisMediumWirelessWan,
451 NdisMediumIrda,
452 NdisMediumBpc,
453 NdisMediumCoWan,
454 NdisMedium1394,
455 NdisMediumMax
456 } NDIS_MEDIUM, *PNDIS_MEDIUM;
457
458 /* NDIS packet filter bits (OID_GEN_CURRENT_PACKET_FILTER) */
459 #define NDIS_PACKET_TYPE_DIRECTED 0x00000001
460 #define NDIS_PACKET_TYPE_MULTICAST 0x00000002
461 #define NDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004
462 #define NDIS_PACKET_TYPE_BROADCAST 0x00000008
463 #define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010
464 #define NDIS_PACKET_TYPE_PROMISCUOUS 0x00000020
465 #define NDIS_PACKET_TYPE_SMT 0x00000040
466 #define NDIS_PACKET_TYPE_ALL_LOCAL 0x00000080
467 #define NDIS_PACKET_TYPE_GROUP 0x00001000
468 #define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00002000
469 #define NDIS_PACKET_TYPE_FUNCTIONAL 0x00004000
470 #define NDIS_PACKET_TYPE_MAC_FRAME 0x00008000
471
472 /* NDIS protocol option bits (OID_GEN_PROTOCOL_OPTIONS) */
473 #define NDIS_PROT_OPTION_ESTIMATED_LENGTH 0x00000001
474 #define NDIS_PROT_OPTION_NO_LOOPBACK 0x00000002
475 #define NDIS_PROT_OPTION_NO_RSVD_ON_RCVPKT 0x00000004
476
477 /* NDIS MAC option bits (OID_GEN_MAC_OPTIONS) */
478 #define NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA 0x00000001
479 #define NDIS_MAC_OPTION_RECEIVE_SERIALIZED 0x00000002
480 #define NDIS_MAC_OPTION_TRANSFERS_NOT_PEND 0x00000004
481 #define NDIS_MAC_OPTION_NO_LOOPBACK 0x00000008
482 #define NDIS_MAC_OPTION_FULL_DUPLEX 0x00000010
483 #define NDIS_MAC_OPTION_EOTX_INDICATION 0x00000020
484 #define NDIS_MAC_OPTION_8021P_PRIORITY 0x00000040
485 #define NDIS_MAC_OPTION_RESERVED 0x80000000
486
487 /* State of the LAN media (OID_GEN_MEDIA_CONNECT_STATUS) */
488 typedef enum _NDIS_MEDIA_STATE
489 {
490 NdisMediaStateConnected,
491 NdisMediaStateDisconnected
492 } NDIS_MEDIA_STATE, *PNDIS_MEDIA_STATE;
493
494 /* OID_GEN_SUPPORTED_GUIDS */
495 typedef struct _NDIS_GUID
496 {
497 GUID Guid;
498 union
499 {
500 NDIS_OID Oid;
501 NDIS_STATUS Status;
502 } u;
503 ULONG Size;
504 ULONG Flags;
505 } NDIS_GUID, *PNDIS_GUID;
506
507 #define NDIS_GUID_TO_OID 0x00000001
508 #define NDIS_GUID_TO_STATUS 0x00000002
509 #define NDIS_GUID_ANSI_STRING 0x00000004
510 #define NDIS_GUID_UNICODE_STRING 0x00000008
511 #define NDIS_GUID_ARRAY 0x00000010
512
513
514
515 typedef struct _NDIS_PACKET_POOL
516 {
517 NDIS_SPIN_LOCK SpinLock;
518 struct _NDIS_PACKET *FreeList;
519 UINT PacketLength;
520 UCHAR Buffer[1];
521 } NDIS_PACKET_POOL, * PNDIS_PACKET_POOL;
522
523 typedef struct _NDIS_PACKET_PRIVATE
524 {
525 UINT PhysicalCount;
526 UINT TotalLength;
527 PNDIS_BUFFER Head;
528 PNDIS_BUFFER Tail;
529 PNDIS_PACKET_POOL Pool;
530 UINT Count;
531 ULONG Flags; /* See fPACKET_xxx bits below */
532 BOOLEAN ValidCounts;
533 UCHAR NdisPacketFlags;
534 USHORT NdisPacketOobOffset;
535 } NDIS_PACKET_PRIVATE, * PNDIS_PACKET_PRIVATE;
536
537 #define fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO 0x40
538 #define fPACKET_ALLOCATED_BY_NDIS 0x80
539
540 typedef struct _NDIS_PACKET {
541 NDIS_PACKET_PRIVATE Private;
542 union {
543 struct {
544 UCHAR MiniportReserved[2*sizeof(PVOID)];
545 UCHAR WrapperReserved[2*sizeof(PVOID)];
546 } s1;
547 struct {
548 UCHAR MiniportReservedEx[3*sizeof(PVOID)];
549 UCHAR WrapperReservedEx[sizeof(PVOID)];
550 } s2;
551 struct {
552 UCHAR MacReserved[4*sizeof(PVOID)];
553 } s3;
554 } u;
555 ULONG_PTR Reserved[2];
556 UCHAR ProtocolReserved[1];
557 } NDIS_PACKET, *PNDIS_PACKET, **PPNDIS_PACKET;
558
559 typedef struct _NDIS_PACKET_OOB_DATA {
560 union {
561 ULONGLONG TimeToSend;
562 ULONGLONG TimeSent;
563 } u;
564 ULONGLONG TimeReceived;
565 UINT HeaderSize;
566 UINT SizeMediaSpecificInfo;
567 PVOID MediaSpecificInformation;
568 NDIS_STATUS Status;
569 } NDIS_PACKET_OOB_DATA, *PNDIS_PACKET_OOB_DATA;
570
571 typedef struct _NDIS_PM_PACKET_PATTERN
572 {
573 ULONG Priority;
574 ULONG Reserved;
575 ULONG MaskSize;
576 ULONG PatternOffset;
577 ULONG PatternSize;
578 ULONG PatternFlags;
579 } NDIS_PM_PACKET_PATTERN, *PNDIS_PM_PACKET_PATTERN;
580
581
582 /* Request types used by NdisRequest */
583 typedef enum _NDIS_REQUEST_TYPE
584 {
585 NdisRequestQueryInformation,
586 NdisRequestSetInformation,
587 NdisRequestQueryStatistics,
588 NdisRequestOpen,
589 NdisRequestClose,
590 NdisRequestSend,
591 NdisRequestTransferData,
592 NdisRequestReset,
593 NdisRequestGeneric1,
594 NdisRequestGeneric2,
595 NdisRequestGeneric3,
596 NdisRequestGeneric4
597 } NDIS_REQUEST_TYPE, *PNDIS_REQUEST_TYPE;
598
599 typedef struct _NDIS_REQUEST {
600 UCHAR MacReserved[16];
601 NDIS_REQUEST_TYPE RequestType;
602 union _DATA {
603 struct QUERY_INFORMATION {
604 NDIS_OID Oid;
605 PVOID InformationBuffer;
606 UINT InformationBufferLength;
607 UINT BytesWritten;
608 UINT BytesNeeded;
609 } QUERY_INFORMATION;
610 struct SET_INFORMATION {
611 NDIS_OID Oid;
612 PVOID InformationBuffer;
613 UINT InformationBufferLength;
614 UINT BytesRead;
615 UINT BytesNeeded;
616 } SET_INFORMATION;
617 } DATA;
618 } NDIS_REQUEST, *PNDIS_REQUEST;
619
620
621
622 /* Wide Area Networks definitions */
623
624 typedef struct _NDIS_WAN_PACKET
625 {
626 LIST_ENTRY WanPacketQueue;
627 PUCHAR CurrentBuffer;
628 ULONG CurrentLength;
629 PUCHAR StartBuffer;
630 PUCHAR EndBuffer;
631 PVOID ProtocolReserved1;
632 PVOID ProtocolReserved2;
633 PVOID ProtocolReserved3;
634 PVOID ProtocolReserved4;
635 PVOID MacReserved1;
636 PVOID MacReserved2;
637 PVOID MacReserved3;
638 PVOID MacReserved4;
639 } NDIS_WAN_PACKET, *PNDIS_WAN_PACKET;
640
641
642
643 /* DMA channel information */
644
645 typedef struct _NDIS_DMA_DESCRIPTION
646 {
647 BOOLEAN DemandMode;
648 BOOLEAN AutoInitialize;
649 BOOLEAN DmaChannelSpecified;
650 DMA_WIDTH DmaWidth;
651 DMA_SPEED DmaSpeed;
652 ULONG DmaPort;
653 ULONG DmaChannel;
654 } NDIS_DMA_DESCRIPTION, *PNDIS_DMA_DESCRIPTION;
655
656 typedef struct _NDIS_DMA_BLOCK
657 {
658 PVOID MapRegisterBase;
659 KEVENT AllocationEvent;
660 PADAPTER_OBJECT SystemAdapterObject;
661 BOOLEAN InProgress;
662 } NDIS_DMA_BLOCK, *PNDIS_DMA_BLOCK;
663
664
665 /* Possible hardware architecture */
666 typedef enum _NDIS_INTERFACE_TYPE
667 {
668 NdisInterfaceInternal = Internal,
669 NdisInterfaceIsa = Isa,
670 NdisInterfaceEisa = Eisa,
671 NdisInterfaceMca = MicroChannel,
672 NdisInterfaceTurboChannel = TurboChannel,
673 NdisInterfacePci = PCIBus,
674 NdisInterfacePcMcia = PCMCIABus
675 } NDIS_INTERFACE_TYPE, *PNDIS_INTERFACE_TYPE;
676
677 #define NdisInterruptLevelSensitive LevelSensitive
678 #define NdisInterruptLatched Latched
679 typedef KINTERRUPT_MODE NDIS_INTERRUPT_MODE, *PNDIS_INTERRUPT_MODE;
680
681
682 typedef enum _NDIS_PARAMETER_TYPE
683 {
684 NdisParameterInteger,
685 NdisParameterHexInteger,
686 NdisParameterString,
687 NdisParameterMultiString
688 } NDIS_PARAMETER_TYPE, *PNDIS_PARAMETER_TYPE;
689
690 typedef struct _NDIS_CONFIGURATION_PARAMETER
691 {
692 NDIS_PARAMETER_TYPE ParameterType;
693 union
694 {
695 ULONG IntegerData;
696 NDIS_STRING StringData;
697 } ParameterData;
698 } NDIS_CONFIGURATION_PARAMETER, *PNDIS_CONFIGURATION_PARAMETER;
699
700
701 typedef PHYSICAL_ADDRESS NDIS_PHYSICAL_ADDRESS, *PNDIS_PHYSICAL_ADDRESS;
702
703 typedef struct _NDIS_PHYSICAL_ADDRESS_UNIT
704 {
705 NDIS_PHYSICAL_ADDRESS PhysicalAddress;
706 UINT Length;
707 } NDIS_PHYSICAL_ADDRESS_UNIT, *PNDIS_PHYSICAL_ADDRESS_UNIT;
708
709
710 typedef VOID (*ADAPTER_SHUTDOWN_HANDLER)(
711 IN PVOID ShutdownContext);
712
713
714
715 #ifdef NDIS_WRAPPER
716
717 typedef struct _OID_LIST OID_LIST, *POID_LIST;
718
719 /* PnP state */
720
721 typedef enum _NDIS_PNP_DEVICE_STATE
722 {
723 NdisPnPDeviceAdded,
724 NdisPnPDeviceStarted,
725 NdisPnPDeviceQueryStopped,
726 NdisPnPDeviceStopped,
727 NdisPnPDeviceQueryRemoved,
728 NdisPnPDeviceRemoved,
729 NdisPnPDeviceSurpriseRemoved
730 } NDIS_PNP_DEVICE_STATE;
731
732 #define NDIS_DEVICE_NOT_STOPPABLE 0x00000001
733 #define NDIS_DEVICE_NOT_REMOVEABLE 0x00000002
734 #define NDIS_DEVICE_NOT_SUSPENDABLE 0x00000004
735 #define NDIS_DEVICE_DISABLE_PM 0x00000008
736 #define NDIS_DEVICE_DISABLE_WAKE_UP 0x00000010
737 #define NDIS_DEVICE_DISABLE_WAKE_ON_RECONNECT 0x00000020
738
739 #endif /* NDIS_WRAPPER */
740
741
742 #ifdef NDIS50
743
744 typedef struct _ATM_ADDRESS ATM_ADDRESS, *PATM_ADDRESS;
745
746
747 /* OID_GEN_NETWORK_LAYER_ADDRESSES */
748 typedef struct _NETWORK_ADDRESS
749 {
750 USHORT AddressLength;
751 USHORT AddressType;
752 UCHAR Address[1];
753 } NETWORK_ADDRESS, *PNETWORK_ADDRESS;
754
755 typedef struct _NETWORK_ADDRESS_LIST
756 {
757 LONG AddressCount;
758 USHORT AddressType;
759 NETWORK_ADDRESS Address[1];
760 } NETWORK_ADDRESS_LIST, *PNETWORK_ADDRESS_LIST;
761
762 /* Protocol types supported by NDIS */
763 #define NDIS_PROTOCOL_ID_DEFAULT 0x00
764 #define NDIS_PROTOCOL_ID_TCP_IP 0x02
765 #define NDIS_PROTOCOL_ID_IPX 0x06
766 #define NDIS_PROTOCOL_ID_NBF 0x07
767 #define NDIS_PROTOCOL_ID_MAX 0x0F
768 #define NDIS_PROTOCOL_ID_MASK 0x0F
769
770 /* OID_GEN_TRANSPORT_HEADER_OFFSET */
771 typedef struct _TRANSPORT_HEADER_OFFSET
772 {
773 USHORT ProtocolType;
774 USHORT HeaderOffset;
775 } TRANSPORT_HEADER_OFFSET, *PTRANSPORT_HEADER_OFFSET;
776
777
778 /* OID_GEN_CO_LINK_SPEED / OID_GEN_CO_MINIMUM_LINK_SPEED */
779 typedef struct _NDIS_CO_LINK_SPEED
780 {
781 ULONG Outbound;
782 ULONG Inbound;
783 } NDIS_CO_LINK_SPEED, *PNDIS_CO_LINK_SPEED;
784
785
786 typedef enum _NDIS_AF
787 {
788 CO_ADDRESS_FAMILY_Q2931 = 1,
789 CO_ADDRESS_FAMILY_SPANS,
790 } NDIS_AF, *PNDIS_AF;
791
792 typedef struct
793 {
794 NDIS_AF AddressFamily;
795 ULONG MajorVersion;
796 ULONG MinorVersion;
797 } CO_ADDRESS_FAMILY, *PCO_ADDRESS_FAMILY;
798
799 typedef enum
800 {
801 BestEffortService,
802 PredictiveService,
803 GuaranteedService
804 } GUARANTEE;
805
806 typedef struct _CO_FLOW_PARAMETERS
807 {
808 ULONG TokenRate; /* In Bytes/sec */
809 ULONG TokenBucketSize; /* In Bytes */
810 ULONG PeakBandwidth; /* In Bytes/sec */
811 ULONG Latency; /* In microseconds */
812 ULONG DelayVariation; /* In microseconds */
813 GUARANTEE LevelOfGuarantee; /* Guaranteed, Predictive or Best Effort */
814 ULONG CostOfCall; /* Reserved for future use, */
815 /* must be set to 0 now */
816 ULONG NetworkAvailability; /* read-only: 1 if accessible, 0 if not */
817 ULONG MaxSduSize; /* In Bytes */
818 } CO_FLOW_PARAMETERS, *PCO_FLOW_PARAMETERS;
819
820 typedef struct _CO_SPECIFIC_PARAMETERS
821 {
822 ULONG ParamType;
823 ULONG Length;
824 UCHAR Parameters[1];
825 } CO_SPECIFIC_PARAMETERS, *PCO_SPECIFIC_PARAMETERS;
826
827 typedef struct _CO_CALL_MANAGER_PARAMETERS {
828 CO_FLOW_PARAMETERS Transmit;
829 CO_FLOW_PARAMETERS Receive;
830 CO_SPECIFIC_PARAMETERS CallMgrSpecific;
831 } CO_CALL_MANAGER_PARAMETERS, *PCO_CALL_MANAGER_PARAMETERS;
832
833 typedef struct _CO_MEDIA_PARAMETERS
834 {
835 ULONG Flags;
836 ULONG ReceivePriority;
837 ULONG ReceiveSizeHint;
838 CO_SPECIFIC_PARAMETERS MediaSpecific;
839 } CO_MEDIA_PARAMETERS, *PCO_MEDIA_PARAMETERS;
840
841 /* Definitions for the flags in CO_MEDIA_PARAMETERS */
842 #define RECEIVE_TIME_INDICATION 0x00000001
843 #define USE_TIME_STAMPS 0x00000002
844 #define TRANSMIT_VC 0x00000004
845 #define RECEIVE_VC 0x00000008
846 #define INDICATE_ERRED_PACKETS 0x00000010
847 #define INDICATE_END_OF_TX 0x00000020
848 #define RESERVE_RESOURCES_VC 0x00000040
849 #define ROUND_DOWN_FLOW 0x00000080
850 #define ROUND_UP_FLOW 0x00000100
851
852 typedef struct _CO_CALL_PARAMETERS
853 {
854 ULONG Flags;
855 PCO_CALL_MANAGER_PARAMETERS CallMgrParameters;
856 PCO_MEDIA_PARAMETERS MediaParameters;
857 } CO_CALL_PARAMETERS, *PCO_CALL_PARAMETERS;
858
859 typedef struct _CO_SAP {
860 ULONG SapType;
861 ULONG SapLength;
862 UCHAR Sap[1];
863 } CO_SAP, *PCO_SAP;
864
865 typedef struct _NDIS_IPSEC_PACKET_INFO
866 {
867 union
868 {
869 struct
870 {
871 NDIS_HANDLE OffloadHandle;
872 NDIS_HANDLE NextOffloadHandle;
873 } Transmit;
874
875 struct
876 {
877 ULONG SA_DELETE_REQ:1;
878 ULONG CRYPTO_DONE:1;
879 ULONG NEXT_CRYPTO_DONE:1;
880 ULONG CryptoStatus;
881 } Receive;
882 } u;
883 } NDIS_IPSEC_PACKET_INFO, *PNDIS_IPSEC_PACKET_INFO;
884
885
886 /* Plug and play and power management */
887
888 /* PnP and PM event codes */
889 typedef enum _NET_PNP_EVENT_CODE
890 {
891 NetEventSetPower,
892 NetEventQueryPower,
893 NetEventQueryRemoveDevice,
894 NetEventCancelRemoveDevice,
895 NetEventReconfigure,
896 NetEventBindList,
897 NetEventBindsComplete,
898 NetEventPnPCapabilities,
899 NetEventMaximum
900 } NET_PNP_EVENT_CODE, *PNET_PNP_EVENT_CODE;
901
902 /* Networking PnP event indication structure */
903 typedef struct _NET_PNP_EVENT
904 {
905 /* Event code */
906 NET_PNP_EVENT_CODE NetEvent;
907 /* Event specific data */
908 PVOID Buffer;
909 /* Length of event specific data */
910 ULONG BufferLength;
911
912 /* Reserved areas */
913 ULONG_PTR NdisReserved[4];
914 ULONG_PTR TransportReserved[4];
915 ULONG_PTR TdiReserved[4];
916 ULONG_PTR TdiClientReserved[4];
917 } NET_PNP_EVENT, *PNET_PNP_EVENT;
918
919 /* Device power state structure */
920 typedef enum _NET_DEVICE_POWER_STATE
921 {
922 NetDeviceStateUnspecified = 0,
923 NetDeviceStateD0,
924 NetDeviceStateD1,
925 NetDeviceStateD2,
926 NetDeviceStateD3,
927 NetDeviceStateMaximum
928 } NET_DEVICE_POWER_STATE, *PNET_DEVICE_POWER_STATE;
929
930
931
932 /* Call Manager */
933
934 typedef NDIS_STATUS (*CO_CREATE_VC_HANDLER)(
935 IN NDIS_HANDLE ProtocolAfContext,
936 IN NDIS_HANDLE NdisVcHandle,
937 OUT PNDIS_HANDLE ProtocolVcContext);
938
939 typedef NDIS_STATUS (*CO_DELETE_VC_HANDLER)(
940 IN NDIS_HANDLE ProtocolVcContext);
941
942 typedef NDIS_STATUS (*CO_REQUEST_HANDLER)(
943 IN NDIS_HANDLE ProtocolAfContext,
944 IN NDIS_HANDLE ProtocolVcContext OPTIONAL,
945 IN NDIS_HANDLE ProtocolPartyContext OPTIONAL,
946 IN OUT PNDIS_REQUEST NdisRequest);
947
948 typedef VOID (*CO_REQUEST_COMPLETE_HANDLER)(
949 IN NDIS_STATUS Status,
950 IN NDIS_HANDLE ProtocolAfContext OPTIONAL,
951 IN NDIS_HANDLE ProtocolVcContext OPTIONAL,
952 IN NDIS_HANDLE ProtocolPartyContext OPTIONAL,
953 IN PNDIS_REQUEST NdisRequest);
954
955
956 typedef NDIS_STATUS (*CM_OPEN_AF_HANDLER)(
957 IN NDIS_HANDLE CallMgrBindingContext,
958 IN PCO_ADDRESS_FAMILY AddressFamily,
959 IN NDIS_HANDLE NdisAfHandle,
960 OUT PNDIS_HANDLE CallMgrAfContext
961 );
962
963 typedef
964 NDIS_STATUS
965 (*CM_CLOSE_AF_HANDLER)(
966 IN NDIS_HANDLE CallMgrAfContext
967 );
968
969 typedef
970 NDIS_STATUS
971 (*CM_REG_SAP_HANDLER)(
972 IN NDIS_HANDLE CallMgrAfContext,
973 IN PCO_SAP Sap,
974 IN NDIS_HANDLE NdisSapHandle,
975 OUT PNDIS_HANDLE CallMgrSapContext
976 );
977
978 typedef
979 NDIS_STATUS
980 (*CM_DEREG_SAP_HANDLER)(
981 IN NDIS_HANDLE CallMgrSapContext
982 );
983
984 typedef
985 NDIS_STATUS
986 (*CM_MAKE_CALL_HANDLER)(
987 IN NDIS_HANDLE CallMgrVcContext,
988 IN OUT PCO_CALL_PARAMETERS CallParameters,
989 IN NDIS_HANDLE NdisPartyHandle OPTIONAL,
990 OUT PNDIS_HANDLE CallMgrPartyContext OPTIONAL
991 );
992
993 typedef
994 NDIS_STATUS
995 (*CM_CLOSE_CALL_HANDLER)(
996 IN NDIS_HANDLE CallMgrVcContext,
997 IN NDIS_HANDLE CallMgrPartyContext OPTIONAL,
998 IN PVOID CloseData OPTIONAL,
999 IN UINT Size OPTIONAL
1000 );
1001
1002 typedef
1003 VOID
1004 (*CM_INCOMING_CALL_COMPLETE_HANDLER)(
1005 IN NDIS_STATUS Status,
1006 IN NDIS_HANDLE CallMgrVcContext,
1007 IN PCO_CALL_PARAMETERS CallParameters
1008 );
1009
1010 typedef
1011 NDIS_STATUS
1012 (*CM_ADD_PARTY_HANDLER)(
1013 IN NDIS_HANDLE CallMgrVcContext,
1014 IN OUT PCO_CALL_PARAMETERS CallParameters,
1015 IN NDIS_HANDLE NdisPartyHandle,
1016 OUT PNDIS_HANDLE CallMgrPartyContext
1017 );
1018
1019 typedef
1020 NDIS_STATUS
1021 (*CM_DROP_PARTY_HANDLER)(
1022 IN NDIS_HANDLE CallMgrPartyContext,
1023 IN PVOID CloseData OPTIONAL,
1024 IN UINT Size OPTIONAL
1025 );
1026
1027 typedef
1028 VOID
1029 (*CM_ACTIVATE_VC_COMPLETE_HANDLER)(
1030 IN NDIS_STATUS Status,
1031 IN NDIS_HANDLE CallMgrVcContext,
1032 IN PCO_CALL_PARAMETERS CallParameters
1033 );
1034
1035 typedef
1036 VOID
1037 (*CM_DEACTIVATE_VC_COMPLETE_HANDLER)(
1038 IN NDIS_STATUS Status,
1039 IN NDIS_HANDLE CallMgrVcContext
1040 );
1041
1042 typedef
1043 NDIS_STATUS
1044 (*CM_MODIFY_CALL_QOS_HANDLER)(
1045 IN NDIS_HANDLE CallMgrVcContext,
1046 IN PCO_CALL_PARAMETERS CallParameters
1047 );
1048
1049 typedef struct _NDIS_CALL_MANAGER_CHARACTERISTICS
1050 {
1051 UCHAR MajorVersion;
1052 UCHAR MinorVersion;
1053
1054 USHORT Filler;
1055 UINT Reserved;
1056
1057 CO_CREATE_VC_HANDLER CmCreateVcHandler;
1058 CO_DELETE_VC_HANDLER CmDeleteVcHandler;
1059 CM_OPEN_AF_HANDLER CmOpenAfHandler;
1060 CM_CLOSE_AF_HANDLER CmCloseAfHandler;
1061 CM_REG_SAP_HANDLER CmRegisterSapHandler;
1062 CM_DEREG_SAP_HANDLER CmDeregisterSapHandler;
1063 CM_MAKE_CALL_HANDLER CmMakeCallHandler;
1064 CM_CLOSE_CALL_HANDLER CmCloseCallHandler;
1065 CM_INCOMING_CALL_COMPLETE_HANDLER CmIncomingCallCompleteHandler;
1066 CM_ADD_PARTY_HANDLER CmAddPartyHandler;
1067 CM_DROP_PARTY_HANDLER CmDropPartyHandler;
1068 CM_ACTIVATE_VC_COMPLETE_HANDLER CmActivateVcCompleteHandler;
1069 CM_DEACTIVATE_VC_COMPLETE_HANDLER CmDeactivateVcCompleteHandler;
1070 CM_MODIFY_CALL_QOS_HANDLER CmModifyCallQoSHandler;
1071 CO_REQUEST_HANDLER CmRequestHandler;
1072 CO_REQUEST_COMPLETE_HANDLER CmRequestCompleteHandler;
1073 } NDIS_CALL_MANAGER_CHARACTERISTICS, *PNDIS_CALL_MANAGER_CHARACTERISTICS;
1074
1075
1076
1077 /* Call Manager clients */
1078
1079 typedef VOID (*CL_OPEN_AF_COMPLETE_HANDLER)(
1080 IN NDIS_STATUS Status,
1081 IN NDIS_HANDLE ProtocolAfContext,
1082 IN NDIS_HANDLE NdisAfHandle);
1083
1084 typedef VOID (*CL_CLOSE_AF_COMPLETE_HANDLER)(
1085 IN NDIS_STATUS Status,
1086 IN NDIS_HANDLE ProtocolAfContext);
1087
1088 typedef VOID (*CL_REG_SAP_COMPLETE_HANDLER)(
1089 IN NDIS_STATUS Status,
1090 IN NDIS_HANDLE ProtocolSapContext,
1091 IN PCO_SAP Sap,
1092 IN NDIS_HANDLE NdisSapHandle);
1093
1094 typedef VOID (*CL_DEREG_SAP_COMPLETE_HANDLER)(
1095 IN NDIS_STATUS Status,
1096 IN NDIS_HANDLE ProtocolSapContext);
1097
1098 typedef VOID (*CL_MAKE_CALL_COMPLETE_HANDLER)(
1099 IN NDIS_STATUS Status,
1100 IN NDIS_HANDLE ProtocolVcContext,
1101 IN NDIS_HANDLE NdisPartyHandle OPTIONAL,
1102 IN PCO_CALL_PARAMETERS CallParameters);
1103
1104 typedef VOID (*CL_MODIFY_CALL_QOS_COMPLETE_HANDLER)(
1105 IN NDIS_STATUS Status,
1106 IN NDIS_HANDLE ProtocolVcContext,
1107 IN PCO_CALL_PARAMETERS CallParameters);
1108
1109 typedef VOID (*CL_CLOSE_CALL_COMPLETE_HANDLER)(
1110 IN NDIS_STATUS Status,
1111 IN NDIS_HANDLE ProtocolVcContext,
1112 IN NDIS_HANDLE ProtocolPartyContext OPTIONAL);
1113
1114 typedef VOID (*CL_ADD_PARTY_COMPLETE_HANDLER)(
1115 IN NDIS_STATUS Status,
1116 IN NDIS_HANDLE ProtocolPartyContext,
1117 IN NDIS_HANDLE NdisPartyHandle,
1118 IN PCO_CALL_PARAMETERS CallParameters);
1119
1120 typedef VOID (*CL_DROP_PARTY_COMPLETE_HANDLER)(
1121 IN NDIS_STATUS Status,
1122 IN NDIS_HANDLE ProtocolPartyContext);
1123
1124 typedef NDIS_STATUS (*CL_INCOMING_CALL_HANDLER)(
1125 IN NDIS_HANDLE ProtocolSapContext,
1126 IN NDIS_HANDLE ProtocolVcContext,
1127 IN OUT PCO_CALL_PARAMETERS CallParameters);
1128
1129 typedef VOID (*CL_INCOMING_CALL_QOS_CHANGE_HANDLER)(
1130 IN NDIS_HANDLE ProtocolVcContext,
1131 IN PCO_CALL_PARAMETERS CallParameters);
1132
1133 typedef VOID (*CL_INCOMING_CLOSE_CALL_HANDLER)(
1134 IN NDIS_STATUS CloseStatus,
1135 IN NDIS_HANDLE ProtocolVcContext,
1136 IN PVOID CloseData OPTIONAL,
1137 IN UINT Size OPTIONAL);
1138
1139 typedef VOID (*CL_INCOMING_DROP_PARTY_HANDLER)(
1140 IN NDIS_STATUS DropStatus,
1141 IN NDIS_HANDLE ProtocolPartyContext,
1142 IN PVOID CloseData OPTIONAL,
1143 IN UINT Size OPTIONAL);
1144
1145 typedef VOID (*CL_CALL_CONNECTED_HANDLER)(
1146 IN NDIS_HANDLE ProtocolVcContext);
1147
1148
1149 typedef struct _NDIS_CLIENT_CHARACTERISTICS
1150 {
1151 UCHAR MajorVersion;
1152 UCHAR MinorVersion;
1153
1154 USHORT Filler;
1155 UINT Reserved;
1156
1157 CO_CREATE_VC_HANDLER ClCreateVcHandler;
1158 CO_DELETE_VC_HANDLER ClDeleteVcHandler;
1159 CO_REQUEST_HANDLER ClRequestHandler;
1160 CO_REQUEST_COMPLETE_HANDLER ClRequestCompleteHandler;
1161 CL_OPEN_AF_COMPLETE_HANDLER ClOpenAfCompleteHandler;
1162 CL_CLOSE_AF_COMPLETE_HANDLER ClCloseAfCompleteHandler;
1163 CL_REG_SAP_COMPLETE_HANDLER ClRegisterSapCompleteHandler;
1164 CL_DEREG_SAP_COMPLETE_HANDLER ClDeregisterSapCompleteHandler;
1165 CL_MAKE_CALL_COMPLETE_HANDLER ClMakeCallCompleteHandler;
1166 CL_MODIFY_CALL_QOS_COMPLETE_HANDLER ClModifyCallQoSCompleteHandler;
1167 CL_CLOSE_CALL_COMPLETE_HANDLER ClCloseCallCompleteHandler;
1168 CL_ADD_PARTY_COMPLETE_HANDLER ClAddPartyCompleteHandler;
1169 CL_DROP_PARTY_COMPLETE_HANDLER ClDropPartyCompleteHandler;
1170 CL_INCOMING_CALL_HANDLER ClIncomingCallHandler;
1171 CL_INCOMING_CALL_QOS_CHANGE_HANDLER ClIncomingCallQoSChangeHandler;
1172 CL_INCOMING_CLOSE_CALL_HANDLER ClIncomingCloseCallHandler;
1173 CL_INCOMING_DROP_PARTY_HANDLER ClIncomingDropPartyHandler;
1174 CL_CALL_CONNECTED_HANDLER ClCallConnectedHandler;
1175 } NDIS_CLIENT_CHARACTERISTICS, *PNDIS_CLIENT_CHARACTERISTICS;
1176
1177 #endif /* NDIS50 */
1178
1179
1180
1181 /* NDIS protocol structures */
1182
1183 /* Prototypes for NDIS 3.0 protocol characteristics */
1184
1185 typedef VOID (*OPEN_ADAPTER_COMPLETE_HANDLER)(
1186 IN NDIS_HANDLE ProtocolBindingContext,
1187 IN NDIS_STATUS Status,
1188 IN NDIS_STATUS OpenErrorStatus);
1189
1190 typedef VOID (*CLOSE_ADAPTER_COMPLETE_HANDLER)(
1191 IN NDIS_HANDLE ProtocolBindingContext,
1192 IN NDIS_STATUS Status);
1193
1194 typedef VOID (*RESET_COMPLETE_HANDLER)(
1195 IN NDIS_HANDLE ProtocolBindingContext,
1196 IN NDIS_STATUS Status);
1197
1198 typedef VOID (*REQUEST_COMPLETE_HANDLER)(
1199 IN NDIS_HANDLE ProtocolBindingContext,
1200 IN PNDIS_REQUEST NdisRequest,
1201 IN NDIS_STATUS Status);
1202
1203 typedef VOID (*STATUS_HANDLER)(
1204 IN NDIS_HANDLE ProtocolBindingContext,
1205 IN NDIS_STATUS GeneralStatus,
1206 IN PVOID StatusBuffer,
1207 IN UINT StatusBufferSize);
1208
1209 typedef VOID (*STATUS_COMPLETE_HANDLER)(
1210 IN NDIS_HANDLE ProtocolBindingContext);
1211
1212 typedef VOID (*SEND_COMPLETE_HANDLER)(
1213 IN NDIS_HANDLE ProtocolBindingContext,
1214 IN PNDIS_PACKET Packet,
1215 IN NDIS_STATUS Status);
1216
1217 typedef VOID (*WAN_SEND_COMPLETE_HANDLER)(
1218 IN NDIS_HANDLE ProtocolBindingContext,
1219 IN PNDIS_WAN_PACKET Packet,
1220 IN NDIS_STATUS Status);
1221
1222 typedef VOID (*TRANSFER_DATA_COMPLETE_HANDLER)(
1223 IN NDIS_HANDLE ProtocolBindingContext,
1224 IN PNDIS_PACKET Packet,
1225 IN NDIS_STATUS Status,
1226 IN UINT BytesTransferred);
1227
1228 typedef VOID (*WAN_TRANSFER_DATA_COMPLETE_HANDLER)(
1229 VOID);
1230
1231 typedef NDIS_STATUS (*RECEIVE_HANDLER)(
1232 IN NDIS_HANDLE ProtocolBindingContext,
1233 IN NDIS_HANDLE MacReceiveContext,
1234 IN PVOID HeaderBuffer,
1235 IN UINT HeaderBufferSize,
1236 IN PVOID LookAheadBuffer,
1237 IN UINT LookaheadBufferSize,
1238 IN UINT PacketSize);
1239
1240 typedef NDIS_STATUS (*WAN_RECEIVE_HANDLER)(
1241 IN NDIS_HANDLE NdisLinkHandle,
1242 IN PUCHAR Packet,
1243 IN ULONG PacketSize);
1244
1245 typedef VOID (*RECEIVE_COMPLETE_HANDLER)(
1246 IN NDIS_HANDLE ProtocolBindingContext);
1247
1248
1249 /* Protocol characteristics for NDIS 3.0 protocols */
1250 #ifdef _MSC_VER
1251 typedef struct _NDIS30_PROTOCOL_CHARACTERISTICS
1252 {
1253 UCHAR MajorNdisVersion;
1254 UCHAR MinorNdisVersion;
1255 union
1256 {
1257 UINT Reserved;
1258 UINT Flags;
1259 } u1;
1260 OPEN_ADAPTER_COMPLETE_HANDLER OpenAdapterCompleteHandler;
1261 CLOSE_ADAPTER_COMPLETE_HANDLER CloseAdapterCompleteHandler;
1262 union
1263 {
1264 SEND_COMPLETE_HANDLER SendCompleteHandler;
1265 WAN_SEND_COMPLETE_HANDLER WanSendCompleteHandler;
1266 } u2;
1267 union
1268 {
1269 TRANSFER_DATA_COMPLETE_HANDLER TransferDataCompleteHandler;
1270 WAN_TRANSFER_DATA_COMPLETE_HANDLER WanTransferDataCompleteHandler;
1271 } u3;
1272
1273 RESET_COMPLETE_HANDLER ResetCompleteHandler;
1274 REQUEST_COMPLETE_HANDLER RequestCompleteHandler;
1275 union
1276 {
1277 RECEIVE_HANDLER ReceiveHandler;
1278 WAN_RECEIVE_HANDLER WanReceiveHandler;
1279 } u4;
1280 RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler;
1281 STATUS_HANDLER StatusHandler;
1282 STATUS_COMPLETE_HANDLER StatusCompleteHandler;
1283 NDIS_STRING Name;
1284 } NDIS30_PROTOCOL_CHARACTERISTICS;
1285 typedef NDIS30_PROTOCOL_CHARACTERISTICS NDIS30_PROTOCOL_CHARACTERISTICS_S;
1286 #else
1287 #define NDIS30_PROTOCOL_CHARACTERISTICS \
1288 UCHAR MajorNdisVersion; \
1289 UCHAR MinorNdisVersion; \
1290 union \
1291 { \
1292 UINT Reserved; \
1293 UINT Flags; \
1294 } u1; \
1295 OPEN_ADAPTER_COMPLETE_HANDLER OpenAdapterCompleteHandler; \
1296 CLOSE_ADAPTER_COMPLETE_HANDLER CloseAdapterCompleteHandler; \
1297 union \
1298 { \
1299 SEND_COMPLETE_HANDLER SendCompleteHandler; \
1300 WAN_SEND_COMPLETE_HANDLER WanSendCompleteHandler; \
1301 } u2; \
1302 union \
1303 { \
1304 TRANSFER_DATA_COMPLETE_HANDLER TransferDataCompleteHandler; \
1305 WAN_TRANSFER_DATA_COMPLETE_HANDLER WanTransferDataCompleteHandler; \
1306 } u3; \
1307 RESET_COMPLETE_HANDLER ResetCompleteHandler; \
1308 REQUEST_COMPLETE_HANDLER RequestCompleteHandler; \
1309 union \
1310 { \
1311 RECEIVE_HANDLER ReceiveHandler; \
1312 WAN_RECEIVE_HANDLER WanReceiveHandler; \
1313 } u4; \
1314 RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler; \
1315 STATUS_HANDLER StatusHandler; \
1316 STATUS_COMPLETE_HANDLER StatusCompleteHandler; \
1317 NDIS_STRING Name;
1318 typedef struct _NDIS30_PROTOCOL_CHARACTERISTICS_S
1319 {
1320 NDIS30_PROTOCOL_CHARACTERISTICS;
1321 } NDIS30_PROTOCOL_CHARACTERISTICS_S, *PNDIS30_PROTOCOL_CHARACTERISTICS_S;
1322 #endif
1323
1324 /* Prototypes for NDIS 4.0 protocol characteristics */
1325
1326 typedef INT (*RECEIVE_PACKET_HANDLER)(
1327 IN NDIS_HANDLE ProtocolBindingContext,
1328 IN PNDIS_PACKET Packet);
1329
1330 typedef VOID (*BIND_HANDLER)(
1331 OUT PNDIS_STATUS Status,
1332 IN NDIS_HANDLE BindContext,
1333 IN PNDIS_STRING DeviceName,
1334 IN PVOID SystemSpecific1,
1335 IN PVOID SystemSpecific2);
1336
1337 typedef VOID (*UNBIND_HANDLER)(
1338 OUT PNDIS_STATUS Status,
1339 IN NDIS_HANDLE ProtocolBindingContext,
1340 IN NDIS_HANDLE UnbindContext);
1341
1342 typedef VOID (*TRANSLATE_HANDLER)(
1343 OUT PNDIS_STATUS Status,
1344 IN NDIS_HANDLE ProtocolBindingContext,
1345 OUT PNET_PNP_ID IdList,
1346 IN ULONG IdListLength,
1347 OUT PULONG BytesReturned);
1348
1349 typedef VOID (*UNLOAD_PROTOCOL_HANDLER)(
1350 VOID);
1351
1352
1353 /* Protocol characteristics for NDIS 4.0 protocols */
1354 #ifdef _MSC_VER
1355 typedef struct _NDIS40_PROTOCOL_CHARACTERISTICS
1356 {
1357 NDIS30_PROTOCOL_CHARACTERISTICS;
1358
1359 RECEIVE_PACKET_HANDLER ReceivePacketHandler;
1360 BIND_HANDLER BindAdapterHandler;
1361 UNBIND_HANDLER UnbindAdapterHandler;
1362 TRANSLATE_HANDLER TranslateHandler;
1363 UNLOAD_PROTOCOL_HANDLER UnloadHandler;
1364 } NDIS40_PROTOCOL_CHARACTERISTICS;
1365 typedef NDIS40_PROTOCOL_CHARACTERISTICS NDIS40_PROTOCOL_CHARACTERISTICS_S;
1366 #else
1367 #define NDIS40_PROTOCOL_CHARACTERISTICS \
1368 NDIS30_PROTOCOL_CHARACTERISTICS; \
1369 RECEIVE_PACKET_HANDLER ReceivePacketHandler; \
1370 BIND_HANDLER BindAdapterHandler; \
1371 UNBIND_HANDLER UnbindAdapterHandler; \
1372 TRANSLATE_HANDLER TranslateHandler; \
1373 UNLOAD_PROTOCOL_HANDLER UnloadHandler;
1374 typedef struct _NDIS40_PROTOCOL_CHARACTERISTICS_S
1375 {
1376 NDIS40_PROTOCOL_CHARACTERISTICS;
1377 } NDIS40_PROTOCOL_CHARACTERISTICS_S, *PNDIS40_PROTOCOL_CHARACTERISTICS_S;
1378 #endif
1379
1380
1381 /* Prototypes for NDIS 5.0 protocol characteristics */
1382
1383 #ifdef NDIS50
1384
1385 typedef VOID (*CO_SEND_COMPLETE_HANDLER)(
1386 IN NDIS_STATUS Status,
1387 IN NDIS_HANDLE ProtocolVcContext,
1388 IN PNDIS_PACKET Packet);
1389
1390 typedef VOID (*CO_STATUS_HANDLER)(
1391 IN NDIS_HANDLE ProtocolBindingContext,
1392 IN NDIS_HANDLE ProtocolVcContext OPTIONAL,
1393 IN NDIS_STATUS GeneralStatus,
1394 IN PVOID StatusBuffer,
1395 IN UINT StatusBufferSize);
1396
1397 typedef UINT (*CO_RECEIVE_PACKET_HANDLER)(
1398 IN NDIS_HANDLE ProtocolBindingContext,
1399 IN NDIS_HANDLE ProtocolVcContext,
1400 IN PNDIS_PACKET Packet);
1401
1402 typedef VOID (*CO_AF_REGISTER_NOTIFY_HANDLER)(
1403 IN NDIS_HANDLE ProtocolBindingContext,
1404 IN PCO_ADDRESS_FAMILY AddressFamily);
1405
1406 #ifdef _MSC_VER
1407 typedef struct _NDIS50_PROTOCOL_CHARACTERISTICS
1408 {
1409 NDIS40_PROTOCOL_CHARACTERISTICS;
1410
1411 PVOID ReservedHandlers[4];
1412
1413 CO_SEND_COMPLETE_HANDLER CoSendCompleteHandler;
1414 CO_STATUS_HANDLER CoStatusHandler;
1415 CO_RECEIVE_PACKET_HANDLER CoReceivePacketHandler;
1416 CO_AF_REGISTER_NOTIFY_HANDLER CoAfRegisterNotifyHandler;
1417 } NDIS50_PROTOCOL_CHARACTERISTICS;
1418 typedef NDIS50_PROTOCOL_CHARACTERISTICS NDIS50_PROTOCOL_CHARACTERISTICS_S;
1419 #else
1420 #define NDIS50_PROTOCOL_CHARACTERISTICS \
1421 NDIS40_PROTOCOL_CHARACTERISTICS; \
1422 PVOID ReservedHandlers[4]; \
1423 CO_SEND_COMPLETE_HANDLER CoSendCompleteHandler; \
1424 CO_STATUS_HANDLER CoStatusHandler; \
1425 CO_RECEIVE_PACKET_HANDLER CoReceivePacketHandler; \
1426 CO_AF_REGISTER_NOTIFY_HANDLER CoAfRegisterNotifyHandler;
1427 typedef struct _NDIS50_PROTOCOL_CHARACTERISTICS_S
1428 {
1429 NDIS50_PROTOCOL_CHARACTERISTICS;
1430 } NDIS50_PROTOCOL_CHARACTERISTICS_S, *PNDIS50_PROTOCOL_CHARACTERISTICS_S;
1431 #endif
1432 #endif /* NDIS50 */
1433
1434
1435 #ifndef NDIS50
1436 #ifndef NDIS40
1437 typedef struct _NDIS_PROTOCOL_CHARACTERISTICS
1438 {
1439 NDIS30_PROTOCOL_CHARACTERISTICS;
1440 } NDIS_PROTOCOL_CHARACTERISTICS;
1441 #else /* NDIS40 */
1442 typedef struct _NDIS_PROTOCOL_CHARACTERISTICS
1443 {
1444 NDIS40_PROTOCOL_CHARACTERISTICS;
1445 } NDIS_PROTOCOL_CHARACTERISTICS;
1446 #endif /* NDIS40 */
1447 #else /* NDIS50 */
1448 typedef struct _NDIS_PROTOCOL_CHARACTERISTICS
1449 {
1450 NDIS50_PROTOCOL_CHARACTERISTICS;
1451 } NDIS_PROTOCOL_CHARACTERISTICS;
1452 #endif /* NDIS50 */
1453
1454 typedef NDIS_PROTOCOL_CHARACTERISTICS *PNDIS_PROTOCOL_CHARACTERISTICS;
1455
1456
1457
1458 /* Buffer management routines */
1459
1460 VOID
1461 EXPIMP
1462 NdisAllocateBuffer(
1463 OUT PNDIS_STATUS Status,
1464 OUT PNDIS_BUFFER *Buffer,
1465 IN NDIS_HANDLE PoolHandle,
1466 IN PVOID VirtualAddress,
1467 IN UINT Length);
1468
1469 VOID
1470 EXPIMP
1471 NdisAllocateBufferPool(
1472 OUT PNDIS_STATUS Status,
1473 OUT PNDIS_HANDLE PoolHandle,
1474 IN UINT NumberOfDescriptors);
1475
1476 VOID
1477 EXPIMP
1478 NdisAllocatePacket(
1479 OUT PNDIS_STATUS Status,
1480 OUT PNDIS_PACKET *Packet,
1481 IN NDIS_HANDLE PoolHandle);
1482
1483 VOID
1484 EXPIMP
1485 NdisAllocatePacketPool(
1486 OUT PNDIS_STATUS Status,
1487 OUT PNDIS_HANDLE PoolHandle,
1488 IN UINT NumberOfDescriptors,
1489 IN UINT ProtocolReservedLength);
1490
1491 VOID
1492 EXPIMP
1493 NdisCopyBuffer(
1494 OUT PNDIS_STATUS Status,
1495 OUT PNDIS_BUFFER *Buffer,
1496 IN NDIS_HANDLE PoolHandle,
1497 IN PVOID MemoryDescriptor,
1498 IN UINT Offset,
1499 IN UINT Length);
1500
1501 VOID
1502 EXPIMP
1503 NdisCopyFromPacketToPacket(
1504 IN PNDIS_PACKET Destination,
1505 IN UINT DestinationOffset,
1506 IN UINT BytesToCopy,
1507 IN PNDIS_PACKET Source,
1508 IN UINT SourceOffset,
1509 OUT PUINT BytesCopied);
1510
1511 VOID
1512 EXPIMP
1513 NdisDprAllocatePacket(
1514 OUT PNDIS_STATUS Status,
1515 OUT PNDIS_PACKET *Packet,
1516 IN NDIS_HANDLE PoolHandle);
1517
1518 VOID
1519 EXPIMP
1520 NdisDprAllocatePacketNonInterlocked(
1521 OUT PNDIS_STATUS Status,
1522 OUT PNDIS_PACKET *Packet,
1523 IN NDIS_HANDLE PoolHandle);
1524
1525 VOID
1526 EXPIMP
1527 NdisDprFreePacket(
1528 IN PNDIS_PACKET Packet);
1529
1530 VOID
1531 EXPIMP
1532 NdisDprFreePacketNonInterlocked(
1533 IN PNDIS_PACKET Packet);
1534
1535 VOID
1536 EXPIMP
1537 NdisFreeBufferPool(
1538 IN NDIS_HANDLE PoolHandle);
1539
1540 VOID
1541 EXPIMP
1542 NdisFreePacket(
1543 IN PNDIS_PACKET Packet);
1544
1545 VOID
1546 EXPIMP
1547 NdisFreePacketPool(
1548 IN NDIS_HANDLE PoolHandle);
1549
1550 VOID
1551 EXPIMP
1552 NdisReturnPackets(
1553 IN PNDIS_PACKET *PacketsToReturn,
1554 IN UINT NumberOfPackets);
1555
1556 VOID
1557 EXPIMP
1558 NdisUnchainBufferAtBack(
1559 IN OUT PNDIS_PACKET Packet,
1560 OUT PNDIS_BUFFER *Buffer);
1561
1562 VOID
1563 EXPIMP
1564 NdisUnchainBufferAtFront(
1565 IN OUT PNDIS_PACKET Packet,
1566 OUT PNDIS_BUFFER *Buffer);
1567
1568 #if BINARY_COMPATIBLE
1569
1570 VOID
1571 EXPIMP
1572 NdisAdjustBufferLength(
1573 IN PNDIS_BUFFER Buffer,
1574 IN UINT Length);
1575
1576 ULONG
1577 EXPIMP
1578 NDIS_BUFFER_TO_SPAN_PAGES(
1579 IN PNDIS_BUFFER Buffer);
1580
1581 VOID
1582 EXPIMP
1583 NdisFreeBuffer(
1584 IN PNDIS_BUFFER Buffer);
1585
1586 VOID
1587 EXPIMP
1588 NdisGetBufferPhysicalArraySize(
1589 IN PNDIS_BUFFER Buffer,
1590 OUT PUINT ArraySize);
1591
1592 VOID
1593 EXPIMP
1594 NdisGetFirstBufferFromPacket(
1595 IN PNDIS_PACKET _Packet,
1596 OUT PNDIS_BUFFER *_FirstBuffer,
1597 OUT PVOID *_FirstBufferVA,
1598 OUT PUINT _FirstBufferLength,
1599 OUT PUINT _TotalBufferLength);
1600
1601 VOID
1602 EXPIMP
1603 NdisQueryBuffer(
1604 IN PNDIS_BUFFER Buffer,
1605 OUT PVOID *VirtualAddress OPTIONAL,
1606 OUT PUINT Length);
1607
1608 VOID
1609 EXPIMP
1610 NdisQueryBufferOffset(
1611 IN PNDIS_BUFFER Buffer,
1612 OUT PUINT Offset,
1613 OUT PUINT Length);
1614
1615 #else /* BINARY_COMPATIBLE */
1616
1617 /*
1618 * PVOID NdisAdjustBufferLength(
1619 * IN PNDIS_BUFFER Buffer,
1620 * IN UINT Length);
1621 */
1622 #define NdisAdjustBufferLength(Buffer, \
1623 Length) \
1624 { \
1625 (Buffer)->ByteCount = (Length); \
1626 }
1627
1628
1629 /*
1630 * ULONG NDIS_BUFFER_TO_SPAN_PAGES(
1631 * IN PNDIS_BUFFER Buffer);
1632 */
1633 #define NDIS_BUFFER_TO_SPAN_PAGES(Buffer) \
1634 ( \
1635 MmGetMdlByteCount(Buffer) == 0 ? \
1636 1 : \
1637 ADDRESS_AND_SIZE_TO_SPAN_PAGES( \
1638 MmGetMdlVirtualAddress(Buffer), \
1639 MmGetMdlByteCount(Buffer)) \
1640 )
1641
1642
1643 #if 0
1644
1645 /*
1646 * VOID NdisFreeBuffer(
1647 * IN PNDIS_BUFFER Buffer);
1648 */
1649 #define NdisFreeBuffer(Buffer) \
1650 { \
1651 IoFreeMdl(Buffer) /* ??? */ \
1652 }
1653
1654 #else
1655
1656 VOID
1657 EXPIMP
1658 NdisFreeBuffer(
1659 IN PNDIS_BUFFER Buffer);
1660
1661 #endif
1662
1663
1664 /*
1665 * VOID NdisGetBufferPhysicalArraySize(
1666 * IN PNDIS_BUFFER Buffer,
1667 * OUT PUINT ArraySize);
1668 */
1669 #define NdisGetBufferPhysicalArraySize(Buffer, \
1670 ArraySize) \
1671 { \
1672 }
1673
1674
1675 /*
1676 * VOID NdisGetFirstBufferFromPacket(
1677 * IN PNDIS_PACKET _Packet,
1678 * OUT PNDIS_BUFFER * _FirstBuffer,
1679 * OUT PVOID * _FirstBufferVA,
1680 * OUT PUINT _FirstBufferLength,
1681 * OUT PUINT _TotalBufferLength)
1682 */
1683 #define NdisGetFirstBufferFromPacket(Packet, \
1684 FirstBuffer, \
1685 FirstBufferVA, \
1686 FirstBufferLength, \
1687 TotalBufferLength) \
1688 { \
1689 PNDIS_BUFFER _Buffer; \
1690 \
1691 _Buffer = (Packet)->Private.Head; \
1692 *(FirstBuffer) = _Buffer; \
1693 *(FirstBufferVA) = MmGetMdlVirtualAddress(_Buffer); \
1694 if (_Buffer != NULL) { \
1695 *(FirstBufferLength) = MmGetMdlByteCount(_Buffer); \
1696 _Buffer = _Buffer->Next; \
1697 } else \
1698 *(FirstBufferLength) = 0; \
1699 *(TotalBufferLength) = *(FirstBufferLength); \
1700 while (_Buffer != NULL) { \
1701 *(TotalBufferLength) += MmGetMdlByteCount(_Buffer); \
1702 _Buffer = _Buffer->Next; \
1703 } \
1704 }
1705
1706 /*
1707 * VOID NdisQueryBuffer(
1708 * IN PNDIS_BUFFER Buffer,
1709 * OUT PVOID *VirtualAddress OPTIONAL,
1710 * OUT PUINT Length)
1711 */
1712 #define NdisQueryBuffer(Buffer, \
1713 VirtualAddress, \
1714 Length) \
1715 { \
1716 if (VirtualAddress) \
1717 *((PVOID*)VirtualAddress) = MmGetSystemAddressForMdl(Buffer); \
1718 \
1719 *((PUINT)Length) = MmGetMdlByteCount(Buffer); \
1720 }
1721
1722
1723 /*
1724 * VOID NdisQueryBufferOffset(
1725 * IN PNDIS_BUFFER Buffer,
1726 * OUT PUINT Offset,
1727 * OUT PUINT Length);
1728 */
1729 #define NdisQueryBufferOffset(Buffer, \
1730 Offset, \
1731 Length) \
1732 { \
1733 *((PUINT)Offset) = MmGetMdlByteOffset(Buffer); \
1734 *((PUINT)Length) = MmGetMdlByteCount(Buffer); \
1735 }
1736
1737 #endif /* BINARY_COMPATIBLE */
1738
1739
1740 /*
1741 * PVOID NDIS_BUFFER_LINKAGE(
1742 * IN PNDIS_BUFFER Buffer);
1743 */
1744 #define NDIS_BUFFER_LINKAGE(Buffer) \
1745 { \
1746 (Buffer)->Next; \
1747 }
1748
1749
1750 /*
1751 * VOID NdisChainBufferAtBack(
1752 * IN OUT PNDIS_PACKET Packet,
1753 * IN OUT PNDIS_BUFFER Buffer)
1754 */
1755 #define NdisChainBufferAtBack(Packet, \
1756 Buffer) \
1757 { \
1758 PNDIS_BUFFER NdisBuffer = (Buffer); \
1759 \
1760 while (NdisBuffer->Next != NULL) \
1761 NdisBuffer = NdisBuffer->Next; \
1762 \
1763 NdisBuffer->Next = NULL; \
1764 \
1765 if ((Packet)->Private.Head != NULL) \
1766 (Packet)->Private.Tail->Next = (Buffer); \
1767 else \
1768 (Packet)->Private.Head = (Buffer); \
1769 \
1770 (Packet)->Private.Tail = NdisBuffer; \
1771 (Packet)->Private.ValidCounts = FALSE; \
1772 }
1773
1774
1775 /*
1776 * VOID NdisChainBufferAtFront(
1777 * IN OUT PNDIS_PACKET Packet,
1778 * IN OUT PNDIS_BUFFER Buffer)
1779 */
1780 #define NdisChainBufferAtFront(Packet, \
1781 Buffer) \
1782 { \
1783 PNDIS_BUFFER _NdisBuffer = (Buffer); \
1784 \
1785 while (_NdisBuffer->Next != NULL) \
1786 _NdisBuffer = _NdisBuffer->Next; \
1787 \
1788 if ((Packet)->Private.Head == NULL) \
1789 (Packet)->Private.Tail = _NdisBuffer; \
1790 \
1791 _NdisBuffer->Next = (Packet)->Private.Head; \
1792 (Packet)->Private.Head = (Buffer); \
1793 (Packet)->Private.ValidCounts = FALSE; \
1794 }
1795
1796
1797 /*
1798 * VOID NdisGetNextBuffer(
1799 * IN PNDIS_BUFFER CurrentBuffer,
1800 * OUT PNDIS_BUFFER * NextBuffer)
1801 */
1802 #define NdisGetNextBuffer(CurrentBuffer, \
1803 NextBuffer) \
1804 { \
1805 *(NextBuffer) = (CurrentBuffer)->Next; \
1806 }
1807
1808
1809 /*
1810 * UINT NdisGetPacketFlags(
1811 * IN PNDIS_PACKET Packet);
1812 */
1813 #define NdisGetPacketFlags(Packet) \
1814 { \
1815 (Packet)->Private.Flags; \
1816 }
1817
1818
1819 /*
1820 * UINT NDIS_GET_PACKET_HEADER_SIZE(
1821 * IN PNDIS_PACKET Packet);
1822 */
1823 #define NDIS_GET_PACKET_HEADER_SIZE(Packet) \
1824 { \
1825 }
1826
1827
1828 /*
1829 * VOID NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO(
1830 * IN PNDIS_PACKET Packet,
1831 * IN PPVOID pMediaSpecificInfo,
1832 * IN PUINT pSizeMediaSpecificInfo);
1833 */
1834 #define NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO(Packet, \
1835 pMediaSpecificInfo, \
1836 pSizeMediaSpecificInfo) \
1837 { \
1838 }
1839
1840
1841 /*
1842 * VOID NDIS_STATUS NDIS_GET_PACKET_STATUS(
1843 * IN PNDIS_PACKET Packet);
1844 */
1845 #define NDIS_GET_PACKET_STATUS (Packet) \
1846 { \
1847 }
1848
1849
1850 /*
1851 * ULONGLONG NDIS_GET_PACKET_TIME_RECEIVED(
1852 * IN PNDIS_PACKET Packet);
1853 */
1854 #define NDIS_GET_PACKET_TIME_RECEIVED(Packet) \
1855 { \
1856 }
1857
1858
1859 /*
1860 * ULONGLONG NDIS_GET_PACKET_TIME_SENT(
1861 * IN PNDIS_PACKET Packet);
1862 */
1863 #define NDIS_GET_PACKET_TIME_SENT(Packet) \
1864 { \
1865 }
1866
1867
1868 /*
1869 * ULONGLONG NDIS_GET_PACKET_TIME_TO_SEND(
1870 * IN PNDIS_PACKET Packet);
1871 */
1872 #define NDIS_GET_PACKET_TIME_TO_SEND(Packet) \
1873 { \
1874 }
1875
1876
1877 /*
1878 * PNDIS_PACKET_OOB_DATA NDIS_OOB_DATA_FROM_PACKET(
1879 * IN PNDIS_PACKET _Packet);
1880 */
1881 #define NDIS_OOB_DATA_FROM_PACKET(_Packet) \
1882 { \
1883 }
1884
1885
1886 /*
1887 * VOID NdisQueryPacket(
1888 * IN PNDIS_PACKET Packet,
1889 * OUT PUINT PhysicalBufferCount OPTIONAL,
1890 * OUT PUINT BufferCount OPTIONAL,
1891 * OUT PNDIS_BUFFER *FirstBuffer OPTIONAL,
1892 * OUT PUINT TotalPacketLength OPTIONAL);
1893 */
1894 #define NdisQueryPacket(Packet, \
1895 PhysicalBufferCount, \
1896 BufferCount, \
1897 FirstBuffer, \
1898 TotalPacketLength) \
1899 { \
1900 if (FirstBuffer) \
1901 *((PNDIS_BUFFER*)FirstBuffer) = (Packet)->Private.Head; \
1902 if ((TotalPacketLength) || (BufferCount) || (PhysicalBufferCount)) { \
1903 if (!(Packet)->Private.ValidCounts) { \
1904 UINT _Offset; \
1905 UINT _PacketLength; \
1906 PNDIS_BUFFER _NdisBuffer; \
1907 UINT _PhysicalBufferCount = 0; \
1908 UINT _TotalPacketLength = 0; \
1909 UINT _Count = 0; \
1910 \
1911 for (_NdisBuffer = (Packet)->Private.Head; \
1912 _NdisBuffer != (PNDIS_BUFFER)NULL; \
1913 _NdisBuffer = _NdisBuffer->Next) { \
1914 _PhysicalBufferCount += NDIS_BUFFER_TO_SPAN_PAGES(_NdisBuffer); \
1915 NdisQueryBufferOffset(_NdisBuffer, &_Offset, &_PacketLength); \
1916 _TotalPacketLength += _PacketLength; \
1917 _Count++; \
1918 } \
1919 (Packet)->Private.PhysicalCount = _PhysicalBufferCount; \
1920 (Packet)->Private.TotalLength = _TotalPacketLength; \
1921 (Packet)->Private.Count = _Count; \
1922 (Packet)->Private.ValidCounts = TRUE; \
1923 } \
1924 \
1925 if (PhysicalBufferCount) \
1926 *((PUINT)PhysicalBufferCount) = (Packet)->Private.PhysicalCount; \
1927 \
1928 if (BufferCount) \
1929 *((PUINT)BufferCount) = (Packet)->Private.Count; \
1930 \
1931 if (TotalPacketLength) \
1932 *((PUINT)TotalPacketLength) = (Packet)->Private.TotalLength; \
1933 } \
1934 }
1935
1936
1937 /*
1938 * VOID NdisRecalculatePacketCounts(
1939 * IN OUT PNDIS_PACKET Packet);
1940 */
1941 #define NdisRecalculatePacketCounts(Packet) \
1942 { \
1943 }
1944
1945 VOID
1946 EXPIMP
1947 NdisReinitializePacket(
1948 IN OUT PNDIS_PACKET Packet);
1949
1950
1951 /*
1952 * VOID NdisSetPacketFlags(
1953 * IN PNDIS_PACKET Packet,
1954 * IN UINT Flags);
1955 */
1956 #define NdisSetPacketFlags(Packet, Flags) \
1957 (Packet)->Private.Flags = (Flags);
1958
1959
1960 /*
1961 * NDIS_SET_PACKET_HEADER_SIZE(
1962 * IN PNDIS_PACKET Packet,
1963 * IN UINT HdrSize);
1964 */
1965 #define NDIS_SET_PACKET_HEADER_SIZE(Packet, \
1966 HdrSize) \
1967 { \
1968 }
1969
1970
1971 /*
1972 * NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO(
1973 * IN PNDIS_PACKET Packet,
1974 * IN PVOID MediaSpecificInfo,
1975 * IN UINT SizeMediaSpecificInfo);
1976 */
1977 #define NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO(Packet, \
1978 MediaSpecificInfo, \
1979 SizeMediaSpecificInfo) \
1980 { \
1981 }
1982
1983
1984 /*
1985 * NDIS_SET_PACKET_STATUS(
1986 * IN PNDIS_PACKET Packet,
1987 * IN NDIS_STATUS Status);
1988 */
1989 #define NDIS_SET_PACKET_STATUS(Packet, \
1990 Status) \
1991 { \
1992 }
1993
1994
1995 /*
1996 * NDIS_SET_PACKET_TIME_RECEIVED(
1997 * IN PNDIS_PACKET Packet,
1998 * IN ULONGLONG TimeReceived);
1999 */
2000 #define NDIS_SET_PACKET_TIME_RECEIVED(Packet) \
2001 TimeReceived) \
2002 { \
2003 }
2004
2005
2006 /*
2007 * NDIS_SET_PACKET_TIME_SENT(
2008 * IN PNDIS_PACKET Packet,
2009 * IN ULONGLONG TimeSent);
2010 */
2011 #define NDIS_SET_PACKET_TIME_SENT(Packet, \
2012 TimeSent) \
2013 { \
2014 }
2015
2016
2017 /*
2018 *
2019 * NDIS_SET_PACKET_TIME_TO_SEND(
2020 * IN PNDIS_PACKET Packet,
2021 * IN ULONGLONG TimeToSend);
2022 */
2023 #define NDIS_SET_PACKET_TIME_TO_SEND(Packet, \
2024 TimeToSend) \
2025 { \
2026 }
2027
2028
2029 /*
2030 * VOID NdisSetSendFlags(
2031 * IN PNDIS_PACKET Packet,
2032 * IN UINT Flags);
2033 */
2034 #define NdisSetSendFlags(Packet, Flags)( \
2035 NdisSetPacketFlags((Packet), (Flags)))
2036
2037
2038
2039 /* Memory management routines */
2040
2041 VOID
2042 EXPIMP
2043 NdisCreateLookaheadBufferFromSharedMemory(
2044 IN PVOID pSharedMemory,
2045 IN UINT LookaheadLength,
2046 OUT PVOID *pLookaheadBuffer);
2047
2048 VOID
2049 EXPIMP
2050 NdisDestroyLookaheadBufferFromSharedMemory(
2051 IN PVOID pLookaheadBuffer);
2052
2053 VOID
2054 EXPIMP
2055 NdisMoveFromMappedMemory(
2056 OUT PVOID Destination,
2057 IN PVOID Source,
2058 IN ULONG Length);
2059
2060 VOID
2061 EXPIMP
2062 NdisMoveMappedMemory(
2063 OUT PVOID Destination,
2064 IN PVOID Source,
2065 IN ULONG Length);
2066
2067 VOID
2068 EXPIMP
2069 NdisMoveToMappedMemory(
2070 OUT PVOID Destination,
2071 IN PVOID Source,
2072 IN ULONG Length);
2073
2074 VOID
2075 EXPIMP
2076 NdisMUpdateSharedMemory(
2077 IN NDIS_HANDLE MiniportAdapterHandle,
2078 IN ULONG Length,
2079 IN PVOID VirtualAddress,
2080 IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
2081
2082 NDIS_STATUS
2083 EXPIMP
2084 NdisAllocateMemory(
2085 OUT PVOID *VirtualAddress,
2086 IN UINT Length,
2087 IN UINT MemoryFlags,
2088 IN NDIS_PHYSICAL_ADDRESS HighestAcceptableAddress);
2089
2090 VOID
2091 EXPIMP
2092 NdisFreeMemory(
2093 IN PVOID VirtualAddress,
2094 IN UINT Length,
2095 IN UINT MemoryFlags);
2096
2097 VOID
2098 EXPIMP
2099 NdisImmediateReadSharedMemory(
2100 IN NDIS_HANDLE WrapperConfigurationContext,
2101 IN ULONG SharedMemoryAddress,
2102 OUT PUCHAR Buffer,
2103 IN ULONG Length);
2104
2105 VOID
2106 EXPIMP
2107 NdisImmediateWriteSharedMemory(
2108 IN NDIS_HANDLE WrapperConfigurationContext,
2109 IN ULONG SharedMemoryAddress,
2110 IN PUCHAR Buffer,
2111 IN ULONG Length);
2112
2113 VOID
2114 EXPIMP
2115 NdisMAllocateSharedMemory(
2116 IN NDIS_HANDLE MiniportAdapterHandle,
2117 IN ULONG Length,
2118 IN BOOLEAN Cached,
2119 OUT PVOID *VirtualAddress,
2120 OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress);
2121
2122 NDIS_STATUS
2123 EXPIMP
2124 NdisMAllocateSharedMemoryAsync(
2125 IN NDIS_HANDLE MiniportAdapterHandle,
2126 IN ULONG Length,
2127 IN BOOLEAN Cached,
2128 IN PVOID Context);
2129
2130 VOID
2131 EXPIMP
2132 NdisMFreeSharedMemory(
2133 IN NDIS_HANDLE MiniportAdapterHandle,
2134 IN ULONG Length,
2135 IN BOOLEAN Cached,
2136 IN PVOID VirtualAddress,
2137 IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
2138
2139 VOID
2140 EXPIMP
2141 NdisUpdateSharedMemory(
2142 IN NDIS_HANDLE NdisAdapterHandle,
2143 IN ULONG Length,
2144 IN PVOID VirtualAddress,
2145 IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
2146
2147
2148 /*
2149 * ULONG NdisGetPhysicalAddressHigh(
2150 * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
2151 */
2152 #define NdisGetPhysicalAddressHigh(PhysicalAddress) \
2153 ((PhysicalAddress).HighPart)
2154
2155 /*
2156 * VOID NdisSetPhysicalAddressHigh(
2157 * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
2158 * IN ULONG Value);
2159 */
2160 #define NdisSetPhysicalAddressHigh(PhysicalAddress, Value) \
2161 ((PhysicalAddress).HighPart) = (Value)
2162
2163 /*
2164 * ULONG NdisGetPhysicalAddressLow(
2165 * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
2166 */
2167 #define NdisGetPhysicalAddressLow(PhysicalAddress) \
2168 ((PhysicalAddress).LowPart)
2169
2170
2171 /*
2172 * VOID NdisSetPhysicalAddressLow(
2173 * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
2174 * IN ULONG Value);
2175 */
2176 #define NdisSetPhysicalAddressLow(PhysicalAddress, Value) \
2177 ((PhysicalAddress).LowPart) = (Value)
2178
2179 /*
2180 * VOID NDIS_PHYSICAL_ADDRESS_CONST(
2181 * IN ULONG Low,
2182 * IN LONG High);
2183 */
2184 #define NDIS_PHYSICAL_ADDRESS_CONST(Low, High) \
2185 { {(ULONG)(Low), (LONG)(High)} }
2186
2187
2188 /*
2189 * VOID NdisMoveMemory(
2190 * OUT PVOID Destination,
2191 * IN PVOID Source,
2192 * IN ULONG Length);
2193 */
2194 #define NdisMoveMemory(Destination, Source, Length) \
2195 RtlCopyMemory(Destination, Source, Length)
2196
2197
2198 /*
2199 * VOID NdisRetrieveUlong(
2200 * IN PULONG DestinationAddress,
2201 * IN PULONG SourceAddress);
2202 */
2203 #define NdisRetrieveUlong(DestinationAddress, SourceAddress) \
2204 RtlRetrieveUlong(DestinationAddress, SourceAddress)
2205
2206
2207 /*
2208 * VOID NdisStoreUlong(
2209 * IN PULONG DestinationAddress,
2210 * IN ULONG Value);
2211 */
2212 #define NdisStoreUlong(DestinationAddress, Value) \
2213 RtlStoreUlong(DestinationAddress, Value)
2214
2215
2216 /*
2217 * VOID NdisZeroMemory(
2218 * IN PVOID Destination,
2219 * IN ULONG Length)
2220 */
2221 #define NdisZeroMemory(Destination, Length) \
2222 RtlZeroMemory(Destination, Length)
2223
2224
2225
2226 //
2227 // System processor count
2228 //
2229
2230 CCHAR
2231 EXPIMP
2232 NdisSystemProcessorCount(
2233 VOID
2234 );
2235
2236 VOID
2237 EXPIMP
2238 NdisImmediateReadPortUchar(
2239 IN NDIS_HANDLE WrapperConfigurationContext,
2240 IN ULONG Port,
2241 OUT PUCHAR Data
2242 );
2243
2244 VOID
2245 EXPIMP
2246 NdisImmediateReadPortUshort(
2247 IN NDIS_HANDLE WrapperConfigurationContext,
2248 IN ULONG Port,
2249 OUT PUSHORT Data
2250 );
2251
2252 VOID
2253 EXPIMP
2254 NdisImmediateReadPortUlong(
2255 IN NDIS_HANDLE WrapperConfigurationContext,
2256 IN ULONG Port,
2257 OUT PULONG Data
2258 );
2259
2260 VOID
2261 EXPIMP
2262 NdisImmediateWritePortUchar(
2263 IN NDIS_HANDLE WrapperConfigurationContext,
2264 IN ULONG Port,
2265 IN UCHAR Data
2266 );
2267
2268 VOID
2269 EXPIMP
2270 NdisImmediateWritePortUshort(
2271 IN NDIS_HANDLE WrapperConfigurationContext,
2272 IN ULONG Port,
2273 IN USHORT Data
2274 );
2275
2276 VOID
2277 EXPIMP
2278 NdisImmediateWritePortUlong(
2279 IN NDIS_HANDLE WrapperConfigurationContext,
2280 IN ULONG Port,
2281 IN ULONG Data
2282 );
2283
2284 VOID
2285 EXPIMP
2286 NdisImmediateReadSharedMemory(
2287 IN NDIS_HANDLE WrapperConfigurationContext,
2288 IN ULONG SharedMemoryAddress,
2289 IN PUCHAR Buffer,
2290 IN ULONG Length
2291 );
2292
2293 VOID
2294 EXPIMP
2295 NdisImmediateWriteSharedMemory(
2296 IN NDIS_HANDLE WrapperConfigurationContext,
2297 IN ULONG SharedMemoryAddress,
2298 IN PUCHAR Buffer,
2299 IN ULONG Length
2300 );
2301
2302 ULONG
2303 EXPIMP
2304 NdisImmediateReadPciSlotInformation(
2305 IN NDIS_HANDLE WrapperConfigurationContext,
2306 IN ULONG SlotNumber,
2307 IN ULONG Offset,
2308 IN PVOID Buffer,
2309 IN ULONG Length
2310 );
2311
2312 ULONG
2313 EXPIMP
2314 NdisImmediateWritePciSlotInformation(
2315 IN NDIS_HANDLE WrapperConfigurationContext,
2316 IN ULONG SlotNumber,
2317 IN ULONG Offset,
2318 IN PVOID Buffer,
2319 IN ULONG Length
2320 );
2321
2322 /* String management routines */
2323
2324 #if BINARY_COMPATIBLE
2325
2326 NDIS_STATUS
2327 EXPIMP
2328 NdisAnsiStringToUnicodeString(
2329 IN OUT PNDIS_STRING DestinationString,
2330 IN PNDIS_ANSI_STRING SourceString);
2331
2332 BOOLEAN
2333 EXPIMP
2334 NdisEqualString(
2335 IN PNDIS_STRING String1,
2336 IN PNDIS_STRING String2,
2337 IN BOOLEAN CaseInsensitive);
2338
2339 VOID
2340 EXPIMP
2341 NdisInitAnsiString(
2342 IN OUT PNDIS_ANSI_STRING DestinationString,
2343 IN PCSTR SourceString);
2344
2345 VOID
2346 EXPIMP
2347 NdisInitUnicodeString(
2348 IN OUT PNDIS_STRING DestinationString,
2349 IN PCWSTR SourceString);
2350
2351 NDIS_STATUS
2352 EXPIMP
2353 NdisUnicodeStringToAnsiString(
2354 IN OUT PNDIS_ANSI_STRING DestinationString,
2355 IN PNDIS_STRING SourceString);
2356
2357 #else /* BINARY_COMPATIBLE */
2358
2359 /*
2360 * NDIS_STATUS NdisAnsiStringToUnicodeString(
2361 * IN OUT PNDIS_STRING DestinationString,
2362 * IN PNDIS_ANSI_STRING SourceString);
2363 */
2364 #define NdisAnsiStringToUnicodeString(DestinationString, \
2365 SourceString) \
2366 RtlAnsiStringToUnicodeString((DestinationString), (SourceString), FALSE)
2367
2368 /*
2369 * BOOLEAN NdisEqualString(
2370 * IN PNDIS_STRING String1,
2371 * IN PNDIS_STRING String2,
2372 * IN BOOLEAN CaseInsensitive)
2373 */
2374 #define NdisEqualString(String1, \
2375 String2, \
2376 CaseInsensitive) \
2377 RtlEqualUnicodeString((String1), (String2), (CaseInsensitive))
2378
2379 /*
2380 * VOID NdisInitAnsiString(
2381 * IN OUT PNDIS_ANSI_STRING DestinationString,
2382 * IN PCSTR SourceString)
2383 */
2384 #define NdisInitAnsiString(DestinationString, \
2385 SourceString) \
2386 RtlInitString((DestinationString), (SourceString))
2387
2388 /*
2389 * VOID NdisInitUnicodeString(
2390 * IN OUT PNDIS_STRING DestinationString,
2391 * IN PCWSTR SourceString)
2392 */
2393 #define NdisInitUnicodeString(DestinationString, \
2394 SourceString) \
2395 RtlInitUnicodeString((DestinationString), (SourceString))
2396
2397 /*
2398 * NDIS_STATUS NdisUnicodeStringToAnsiString(
2399 * IN OUT PNDIS_ANSI_STRING DestinationString,
2400 * IN PNDIS_STRING SourceString)
2401 */
2402 #define NdisUnicodeStringToAnsiString(DestinationString, \
2403 SourceString) \
2404 RtlUnicodeStringToAnsiString((DestinationString), (SourceString), FALSE)
2405
2406 #endif /* BINARY_COMPATIBLE */
2407
2408 #define NdisFreeString(_s) NdisFreeMemory((s).Buffer, (s).MaximumLength, 0)
2409 #define NdisPrintString(_s) DbgPrint("%ls", (s).Buffer)
2410
2411
2412
2413 /* I/O routines */
2414
2415 /*
2416 * VOID NdisRawReadPortBufferUchar(
2417 * IN ULONG Port,
2418 * OUT PUCHAR Buffer,
2419 * IN ULONG Length);
2420 */
2421 #define NdisRawReadPortBufferUchar(Port, Buffer, Length) \
2422 READ_PORT_BUFFER_UCHAR((PUCHAR)(Port), (PUCHAR)(Buffer), (Length))
2423
2424 /*
2425 * VOID NdisRawReadPortBufferUlong(
2426 * IN ULONG Port,
2427 * OUT PULONG Buffer,
2428 * IN ULONG Length);
2429 */
2430 #define NdisRawReadPortBufferUlong(Port, Buffer, Length) \
2431 READ_PORT_BUFFER_ULONG((PULONG)(Port), (PULONG)(Buffer), (Length))
2432
2433 /*
2434 * VOID NdisRawReadPortBufferUshort(
2435 * IN ULONG Port,
2436 * OUT PUSHORT Buffer,
2437 * IN ULONG Length);
2438 */
2439 #define NdisRawReadPortBufferUshort(Port, Buffer, Length) \
2440 READ_PORT_BUFFER_USHORT((PUSHORT)(Port), (PUSHORT)(Buffer), (Length))
2441
2442
2443 /*
2444 * VOID NdisRawReadPortUchar(
2445 * IN ULONG Port,
2446 * OUT PUCHAR Data);
2447 */
2448 #define NdisRawReadPortUchar(Port, Data) \
2449 *(Data) = READ_PORT_UCHAR((PUCHAR)(Port))
2450
2451 /*
2452 * VOID NdisRawReadPortUlong(
2453 * IN ULONG Port,
2454 * OUT PULONG Data);
2455 */
2456 #define NdisRawReadPortUlong(Port, Data) \
2457 *(Data) = READ_PORT_ULONG((PULONG)(Port))
2458
2459 /*
2460 * VOID NdisRawReadPortUshort(
2461 * IN ULONG Port,
2462 * OUT PUSHORT Data);
2463 */
2464 #define NdisRawReadPortUshort(Port, Data) \
2465 *(Data) = READ_PORT_USHORT((PUSHORT)(Port))
2466
2467
2468 /*
2469 * VOID NdisRawWritePortBufferUchar(
2470 * IN ULONG Port,
2471 * IN PUCHAR Buffer,
2472 * IN ULONG Length);
2473 */
2474 #define NdisRawWritePortBufferUchar(Port, Buffer, Length) \
2475 WRITE_PORT_BUFFER_UCHAR((PUCHAR)(Port), (PUCHAR)(Buffer), (Length))
2476
2477 /*
2478 * VOID NdisRawWritePortBufferUlong(
2479 * IN ULONG Port,
2480 * IN PULONG Buffer,
2481 * IN ULONG Length);
2482 */
2483 #define NdisRawWritePortBufferUlong(Port, Buffer, Length) \
2484 WRITE_PORT_BUFFER_ULONG((PULONG)(Port), (PULONG)(Buffer), (Length))
2485
2486 /*
2487 * VOID NdisRawWritePortBufferUshort(
2488 * IN ULONG Port,
2489 * IN PUSHORT Buffer,
2490 * IN ULONG Length);
2491 */
2492 #define NdisRawWritePortBufferUshort(Port, Buffer, Length) \
2493 WRITE_PORT_BUFFER_USHORT((PUSHORT)(Port), (PUSHORT)(Buffer), (Length))
2494
2495
2496 /*
2497 * VOID NdisRawWritePortUchar(
2498 * IN ULONG Port,
2499 * IN UCHAR Data);
2500 */
2501 #define NdisRawWritePortUchar(Port, Data) \
2502 WRITE_PORT_UCHAR((PUCHAR)(Port), (UCHAR)(Data))
2503
2504 /*
2505 * VOID NdisRawWritePortUlong(
2506 * IN ULONG Port,
2507 * IN ULONG Data);
2508 */
2509 #define NdisRawWritePortUlong(Port, Data) \
2510 WRITE_PORT_ULONG((PULONG)(Port), (ULONG)(Data))
2511
2512 /*
2513 * VOID NdisRawWritePortUshort(
2514 * IN ULONG Port,
2515 * IN USHORT Data);
2516 */
2517 #define NdisRawWritePortUshort(Port, Data) \
2518 WRITE_PORT_USHORT((PUSHORT)(Port), (USHORT)(Data))
2519
2520
2521 /*
2522 * VOID NdisReadRegisterUchar(
2523 * IN PUCHAR Register,
2524 * OUT PUCHAR Data);
2525 */
2526 #define NdisReadRegisterUchar(Register, Data) \
2527 *((PUCHAR)(Data)) = *(Register)
2528
2529 /*
2530 * VOID NdisReadRegisterUlong(
2531 * IN PULONG Register,
2532 * OUT PULONG Data);
2533 */
2534 #define NdisReadRegisterUlong(Register, Data) \
2535 *((PULONG)(Data)) = *(Register)
2536
2537 /*
2538 * VOID NdisReadRegisterUshort(
2539 * IN PUSHORT Register,
2540 * OUT PUSHORT Data);
2541 */
2542 #define NdisReadRegisterUshort(Register, Data) \
2543 *((PUSHORT)(Data)) = *(Register)
2544
2545
2546 /*
2547 * VOID NdisReadRegisterUchar(
2548 * IN PUCHAR Register,
2549 * IN UCHAR Data);
2550 */
2551 #define NdisWriteRegisterUchar(Register, Data) \
2552 WRITE_REGISTER_UCHAR((Register), (Data))
2553
2554 /*
2555 * VOID NdisReadRegisterUlong(
2556 * IN PULONG Register,
2557 * IN ULONG Data);
2558 */
2559 #define NdisWriteRegisterUlong(Register, Data) \
2560 WRITE_REGISTER_ULONG((Register), (Data))
2561
2562 /*
2563 * VOID NdisReadRegisterUshort(
2564 * IN PUSHORT Register,
2565 * IN USHORT Data);
2566 */
2567 #define NdisWriteRegisterUshort(Register, Data) \
2568 WRITE_REGISTER_USHORT((Register), (Data))
2569
2570
2571 /* Linked lists */
2572
2573 VOID
2574 EXPIMP
2575 NdisInitializeListHead(
2576 IN PLIST_ENTRY ListHead);
2577
2578 VOID
2579 EXPIMP
2580 NdisInterlockedAddUlong(
2581 IN PULONG Addend,
2582 IN ULONG Increment,
2583 IN PNDIS_SPIN_LOCK SpinLock);
2584
2585 PLIST_ENTRY
2586 EXPIMP
2587 NdisInterlockedInsertHeadList(
2588 IN PLIST_ENTRY ListHead,
2589 IN PLIST_ENTRY ListEntry,
2590 IN PNDIS_SPIN_LOCK SpinLock);
2591
2592 PLIST_ENTRY
2593 EXPIMP
2594 NdisInterlockedInsertTailList(
2595 IN PLIST_ENTRY ListHead,
2596 IN PLIST_ENTRY ListEntry,
2597 IN PNDIS_SPIN_LOCK SpinLock);
2598
2599 PLIST_ENTRY
2600 EXPIMP
2601 NdisInterlockedRemoveHeadList(
2602 IN PLIST_ENTRY ListHead,
2603 IN PNDIS_SPIN_LOCK SpinLock);
2604
2605
2606 VOID
2607 EXPIMP
2608 NdisCloseConfiguration(
2609 IN NDIS_HANDLE ConfigurationHandle);
2610
2611 VOID
2612 EXPIMP
2613 NdisReadConfiguration(
2614 OUT PNDIS_STATUS Status,
2615 OUT PNDIS_CONFIGURATION_PARAMETER *ParameterValue,
2616 IN NDIS_HANDLE ConfigurationHandle,
2617 IN PNDIS_STRING Keyword,
2618 IN NDIS_PARAMETER_TYPE ParameterType);
2619
2620 VOID
2621 EXPIMP
2622 NdisWriteConfiguration(
2623 OUT PNDIS_STATUS Status,
2624 IN NDIS_HANDLE WrapperConfigurationContext,
2625 IN PNDIS_STRING Keyword,
2626 IN PNDIS_CONFIGURATION_PARAMETER *ParameterValue);
2627
2628 /*
2629 VOID
2630 EXPIMP
2631 NdisWriteErrorLogEntry(
2632 IN NDIS_HANDLE NdisAdapterHandle,
2633 IN NDIS_ERROR_CODE ErrorCode,
2634 IN ULONG NumberOfErrorValues,
2635 IN ULONG ...);
2636 */
2637
2638
2639
2640 /*
2641 * VOID NdisStallExecution(
2642 * IN UINT MicrosecondsToStall)
2643 */
2644 #define NdisStallExecution(MicroSecondsToStall) \
2645 KeStallExecutionProcessor(MicroSecondsToStall)
2646
2647
2648 #define NdisZeroMappedMemory(Destination,Length) RtlZeroMemory(Destination,Length)
2649 /* moved to ndis/memory.c by robd
2650 #define NdisMoveMappedMemory(Destination,Source,Length) RtlCopyMemory(Destination,Source,Length)
2651 */
2652 /* moved to ndis/control.c by robd
2653 #define NdisReinitializePacket(Packet) \
2654 { \
2655 (Packet)->Private.Head = (PNDIS_BUFFER)NULL; \
2656 (Packet)->Private.ValidCounts = FALSE; \
2657 }
2658 */
2659 VOID
2660 EXPIMP
2661 NdisInitializeEvent(
2662 IN PNDIS_EVENT Event
2663 );
2664
2665 VOID
2666 EXPIMP
2667 NdisSetEvent(
2668 IN PNDIS_EVENT Event
2669 );
2670
2671 VOID
2672 EXPIMP
2673 NdisResetEvent(
2674 IN PNDIS_EVENT Event
2675 );
2676
2677 BOOLEAN
2678 EXPIMP
2679 NdisWaitEvent(
2680 IN PNDIS_EVENT Event,
2681 IN UINT msToWait
2682 );
2683
2684
2685 /* NDIS helper macros */
2686
2687 /*
2688 * NDIS_INIT_FUNCTION(FunctionName)
2689 */
2690 #define NDIS_INIT_FUNCTION(FunctionName) \
2691 alloc_text(init, FunctionName)
2692
2693 /*
2694 * NDIS_PAGABLE_FUNCTION(FunctionName)
2695 */
2696 #define NDIS_PAGABLE_FUNCTION(FunctionName) \
2697 alloc_text(page, FunctionName)
2698
2699
2700
2701 /* NDIS 4.0 extensions */
2702
2703 #ifdef NDIS40
2704
2705 VOID
2706 EXPIMP
2707 NdisMFreeSharedMemory(
2708 IN NDIS_HANDLE MiniportAdapterHandle,
2709 IN ULONG Length,
2710 IN BOOLEAN Cached,
2711 IN PVOID VirtualAddress,
2712 IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
2713
2714 VOID
2715 EXPIMP
2716 NdisMWanIndicateReceive(
2717 OUT PNDIS_STATUS Status,
2718 IN NDIS_HANDLE MiniportAdapterHandle,
2719 IN NDIS_HANDLE NdisLinkContext,
2720 IN PUCHAR PacketBuffer,
2721 IN UINT PacketSize);
2722
2723 VOID
2724 EXPIMP
2725 NdisMWanIndicateReceiveComplete(
2726 IN NDIS_HANDLE MiniportAdapterHandle);
2727
2728 VOID
2729 EXPIMP
2730 NdisMWanSendComplete(
2731 IN NDIS_HANDLE MiniportAdapterHandle,
2732 IN PNDIS_WAN_PACKET Packet,
2733 IN NDIS_STATUS Status);
2734
2735 NDIS_STATUS
2736 EXPIMP
2737 NdisPciAssignResources(
2738 IN NDIS_HANDLE NdisMacHandle,
2739 IN NDIS_HANDLE NdisWrapperHandle,
2740 IN NDIS_HANDLE WrapperConfigurationContext,
2741 IN ULONG SlotNumber,
2742 OUT PNDIS_RESOURCE_LIST *AssignedResources);
2743
2744 VOID
2745 EXPIMP
2746 NdisReadEisaSlotInformationEx(
2747 OUT PNDIS_STATUS Status,
2748 IN NDIS_HANDLE WrapperConfigurationContext,
2749 OUT PUINT SlotNumber,
2750 OUT PNDIS_EISA_FUNCTION_INFORMATION *EisaData,
2751 OUT PUINT NumberOfFunctions);
2752
2753 VOID
2754 EXPIMP
2755 NdisReadMcaPosInformation(
2756 OUT PNDIS_STATUS Status,
2757 IN NDIS_HANDLE WrapperConfigurationContext,
2758 IN PUINT ChannelNumber,
2759 OUT PNDIS_MCA_POS_DATA McaData);
2760
2761 #endif /* NDIS40 */
2762
2763
2764 #if USE_KLOCKS
2765
2766 #define DISPATCH_LEVEL 2
2767
2768 #define NdisAllocateSpinLock(_SpinLock) KeInitializeSpinLock(&(_SpinLock)->SpinLock)
2769
2770 #define NdisFreeSpinLock(_SpinLock)
2771
2772 #define NdisAcquireSpinLock(_SpinLock) KeAcquireSpinLock(&(_SpinLock)->SpinLock, &(_SpinLock)->OldIrql)
2773
2774 #define NdisReleaseSpinLock(_SpinLock) KeReleaseSpinLock(&(_SpinLock)->SpinLock,(_SpinLock)->OldIrql)
2775
2776 #define NdisDprAcquireSpinLock(_SpinLock) \
2777 { \
2778 KeAcquireSpinLockAtDpcLevel(&(_SpinLock)->SpinLock); \
2779 (_SpinLock)->OldIrql = DISPATCH_LEVEL; \
2780 }
2781
2782 #define NdisDprReleaseSpinLock(_SpinLock) KeReleaseSpinLockFromDpcLevel(&(_SpinLock)->SpinLock)
2783
2784 #else
2785
2786 //
2787 // Ndis Spin Locks
2788 //
2789
2790 VOID
2791 EXPIMP
2792 NdisAllocateSpinLock(
2793 IN PNDIS_SPIN_LOCK SpinLock
2794 );
2795
2796
2797 VOID
2798 EXPIMP
2799 NdisFreeSpinLock(
2800 IN PNDIS_SPIN_LOCK SpinLock
2801 );
2802
2803
2804 VOID
2805 EXPIMP
2806 NdisAcquireSpinLock(
2807 IN PNDIS_SPIN_LOCK SpinLock
2808 );
2809
2810
2811 VOID
2812 EXPIMP
2813 NdisReleaseSpinLock(
2814 IN PNDIS_SPIN_LOCK SpinLock
2815 );
2816
2817
2818 VOID
2819 EXPIMP
2820 NdisDprAcquireSpinLock(
2821 IN PNDIS_SPIN_LOCK SpinLock
2822 );
2823
2824
2825 VOID
2826 EXPIMP
2827 NdisDprReleaseSpinLock(
2828 IN PNDIS_SPIN_LOCK SpinLock
2829 );
2830
2831 #endif
2832
2833 VOID
2834 EXPIMP
2835 NdisGetCurrentSystemTime(
2836 PLONGLONG pSystemTime
2837 );
2838
2839
2840 /* NDIS 5.0 extensions */
2841
2842 #ifdef NDIS50
2843
2844 VOID
2845 EXPIMP
2846 NdisAcquireReadWriteLock(
2847 IN PNDIS_RW_LOCK Lock,
2848 IN BOOLEAN fWrite,
2849 IN PLOCK_STATE LockState);
2850
2851 NDIS_STATUS
2852 EXPIMP
2853 NdisAllocateMemoryWithTag(
2854 OUT PVOID *VirtualAddress,
2855 IN UINT Length,
2856 IN ULONG Tag);
2857
2858 VOID
2859 EXPIMP
2860 NdisAllocatePacketPoolEx(
2861 OUT PNDIS_STATUS Status,
2862 OUT PNDIS_HANDLE PoolHandle,
2863 IN UINT NumberOfDescriptors,
2864 IN UINT NumberOfOverflowDescriptors,
2865 IN UINT ProtocolReservedLength);
2866
2867 ULONG
2868 EXPIMP
2869 NdisBufferLength(
2870 IN PNDIS_BUFFER Buffer);
2871
2872 PVOID
2873 EXPIMP
2874 NdisBufferVirtualAddress(
2875 IN PNDIS_BUFFER Buffer);
2876
2877 VOID
2878 EXPIMP
2879 NdisCompletePnPEvent(
2880 IN NDIS_STATUS Status,
2881 IN NDIS_HANDLE NdisBindingHandle,
2882 IN PNET_PNP_EVENT NetPnPEvent);
2883
2884 VOID
2885 EXPIMP
2886 NdisConvertStringToAtmAddress(
2887 OUT PNDIS_STATUS Status,
2888 IN PNDIS_STRING String,
2889 OUT PATM_ADDRESS AtmAddress);
2890
2891 VOID
2892 EXPIMP
2893 NdisGetCurrentProcessorCounts(
2894 OUT PULONG pIdleCount,
2895 OUT PULONG pKernelAndUser,
2896 OUT PULONG pIndex);
2897
2898 VOID
2899 EXPIMP
2900 NdisGetDriverHandle(
2901 IN PNDIS_HANDLE NdisBindingHandle,
2902 OUT PNDIS_HANDLE NdisDriverHandle);
2903
2904 PNDIS_PACKET
2905 EXPIMP
2906 NdisGetReceivedPacket(
2907 IN PNDIS_HANDLE NdisBindingHandle,
2908 IN PNDIS_HANDLE MacContext);
2909
2910 VOID
2911 EXPIMP
2912 NdisGetSystemUptime(
2913 OUT PULONG pSystemUpTime);
2914
2915 VOID
2916 EXPIMP
2917 NdisInitializeReadWriteLock(
2918 IN PNDIS_RW_LOCK Lock);
2919
2920 LONG
2921 EXPIMP
2922 NdisInterlockedDecrement(
2923 IN PLONG Addend);
2924
2925 LONG
2926 EXPIMP
2927 NdisInterlockedIncrement(
2928 IN PLONG Addend);
2929
2930 PSINGLE_LIST_ENTRY
2931 EXPIMP
2932 NdisInterlockedPopEntrySList(
2933 IN PSLIST_HEADER ListHead,
2934 IN PKSPIN_LOCK Lock);
2935
2936 PSINGLE_LIST_ENTRY
2937 EXPIMP
2938 NdisInterlockedPushEntrySList(
2939 IN PSLIST_HEADER ListHead,
2940 IN PSINGLE_LIST_ENTRY ListEntry,
2941 IN PKSPIN_LOCK Lock);
2942
2943
2944 NDIS_STATUS
2945 EXPIMP
2946 NdisMDeregisterDevice(
2947 IN NDIS_HANDLE NdisDeviceHandle);
2948
2949 VOID
2950 EXPIMP
2951 NdisMGetDeviceProperty(
2952 IN NDIS_HANDLE MiniportAdapterHandle,
2953 IN OUT PDEVICE_OBJECT *PhysicalDeviceObject OPTIONAL,
2954 IN OUT PDEVICE_OBJECT *FunctionalDeviceObject OPTIONAL,
2955 IN OUT PDEVICE_OBJECT *NextDeviceObject OPTIONAL,
2956 IN OUT PCM_RESOURCE_LIST *AllocatedResources OPTIONAL,
2957 IN OUT PCM_RESOURCE_LIST *AllocatedResourcesTranslated OPTIONAL);
2958
2959 NDIS_STATUS
2960 EXPIMP
2961 NdisMInitializeScatterGatherDma(
2962 IN NDIS_HANDLE MiniportAdapterHandle,
2963 IN BOOLEAN Dma64BitAddresses,
2964 IN ULONG MaximumPhysicalMapping);
2965
2966 NDIS_STATUS
2967 EXPIMP
2968 NdisMPromoteMiniport(
2969 IN NDIS_HANDLE MiniportAdapterHandle);
2970
2971 NDIS_STATUS
2972 EXPIMP
2973 NdisMQueryAdapterInstanceName(
2974 OUT PNDIS_STRING AdapterInstanceName,
2975 IN NDIS_HANDLE MiniportAdapterHandle);
2976
2977 NDIS_STATUS
2978 EXPIMP
2979 NdisMRegisterDevice(
2980 IN NDIS_HANDLE NdisWrapperHandle,
2981 IN PNDIS_STRING DeviceName,
2982 IN PNDIS_STRING SymbolicName,
2983 IN PDRIVER_DISPATCH MajorFunctions[],
2984 OUT PDEVICE_OBJECT *pDeviceObject,
2985 OUT NDIS_HANDLE *NdisDeviceHandle);
2986
2987 VOID
2988 EXPIMP
2989 NdisMRegisterUnloadHandler(
2990 IN NDIS_HANDLE NdisWrapperHandle,
2991 IN PDRIVER_UNLOAD UnloadHandler);
2992
2993 NDIS_STATUS
2994 EXPIMP
2995 NdisMRemoveMiniport(
2996 IN NDIS_HANDLE MiniportAdapterHandle);
2997
2998 NDIS_STATUS
2999 EXPIMP
3000 NdisMSetMiniportSecondary(
3001 IN NDIS_HANDLE MiniportAdapterHandle,
3002 IN NDIS_HANDLE PrimaryMiniportAdapterHandle);
3003
3004 VOID
3005 EXPIMP
3006 NdisOpenConfigurationKeyByIndex(
3007 OUT PNDIS_STATUS Status,
3008 IN NDIS_HANDLE ConfigurationHandle,
3009 IN ULONG Index,
3010 OUT PNDIS_STRING KeyName,
3011 OUT PNDIS_HANDLE KeyHandle);
3012
3013 VOID
3014 EXPIMP
3015 NdisOpenConfigurationKeyByName(
3016 OUT PNDIS_STATUS Status,
3017 IN NDIS_HANDLE ConfigurationHandle,
3018 IN PNDIS_STRING SubKeyName,
3019 OUT PNDIS_HANDLE SubKeyHandle);
3020
3021 UINT
3022 EXPIMP
3023 NdisPacketPoolUsage(
3024 IN NDIS_HANDLE PoolHandle);
3025
3026 NDIS_STATUS
3027 EXPIMP
3028 NdisQueryAdapterInstanceName(
3029 OUT PNDIS_STRING AdapterInstanceName,
3030 IN NDIS_HANDLE NdisBindingHandle);
3031
3032 VOID
3033 EXPIMP
3034 NdisQueryBufferSafe(
3035 IN PNDIS_BUFFER Buffer,
3036 OUT PVOID *VirtualAddress OPTIONAL,
3037 OUT PUINT Length,
3038 IN UINT Priority);
3039
3040 ULONG
3041 EXPIMP
3042 NdisReadPcmciaAttributeMemory(
3043 IN NDIS_HANDLE NdisAdapterHandle,
3044 IN ULONG Offset,
3045 IN PVOID Buffer,
3046 IN ULONG Length);
3047
3048 VOID
3049 EXPIMP
3050 NdisReleaseReadWriteLock(
3051 IN PNDIS_RW_LOCK Lock,
3052 IN PLOCK_STATE LockState);
3053
3054
3055 NDIS_STATUS
3056 EXPIMP
3057 NdisWriteEventLogEntry(
3058 IN PVOID LogHandle,
3059 IN NDIS_STATUS EventCode,
3060 IN ULONG UniqueEventValue,
3061 IN USHORT NumStrings,
3062 IN PVOID StringsList OPTIONAL,
3063 IN ULONG DataSize,
3064 IN PVOID Data OPTIONAL);
3065
3066 ULONG
3067 EXPIMP
3068 NdisWritePcmciaAttributeMemory(
3069 IN NDIS_HANDLE NdisAdapterHandle,
3070 IN ULONG Offset,
3071 IN PVOID Buffer,
3072 IN ULONG Length);
3073
3074
3075 /* Connectionless services */
3076
3077 NDIS_STATUS
3078 EXPIMP
3079 NdisClAddParty(
3080 IN NDIS_HANDLE NdisVcHandle,
3081 IN NDIS_HANDLE ProtocolPartyContext,
3082 IN OUT PCO_CALL_PARAMETERS CallParameters,
3083 OUT PNDIS_HANDLE NdisPartyHandle);
3084
3085 NDIS_STATUS
3086 EXPIMP
3087 NdisClCloseAddressFamily(
3088 IN NDIS_HANDLE NdisAfHandle);
3089
3090 NDIS_STATUS
3091 EXPIMP
3092 NdisClCloseCall(
3093 IN NDIS_HANDLE NdisVcHandle,
3094 IN NDIS_HANDLE NdisPartyHandle OPTIONAL,
3095 IN PVOID Buffer OPTIONAL,
3096 IN UINT Size);
3097
3098 NDIS_STATUS
3099 EXPIMP
3100 NdisClDeregisterSap(
3101 IN NDIS_HANDLE NdisSapHandle);
3102
3103 NDIS_STATUS
3104 EXPIMP
3105 NdisClDropParty(
3106 IN NDIS_HANDLE NdisPartyHandle,
3107 IN PVOID Buffer OPTIONAL,
3108 IN UINT Size);
3109
3110 VOID
3111 EXPIMP
3112 NdisClIncomingCallComplete(
3113 IN NDIS_STATUS Status,
3114 IN NDIS_HANDLE NdisVcHandle,
3115 IN PCO_CALL_PARAMETERS CallParameters);
3116
3117 NDIS_STATUS
3118 EXPIMP
3119 NdisClMakeCall(
3120 IN NDIS_HANDLE NdisVcHandle,
3121 IN OUT PCO_CALL_PARAMETERS CallParameters,
3122 IN NDIS_HANDLE ProtocolPartyContext OPTIONAL,
3123 OUT PNDIS_HANDLE NdisPartyHandle OPTIONAL);
3124
3125 NDIS_STATUS
3126 EXPIMP
3127 NdisClModifyCallQoS(
3128 IN NDIS_HANDLE NdisVcHandle,
3129 IN PCO_CALL_PARAMETERS CallParameters);
3130
3131
3132 NDIS_STATUS
3133 EXPIMP
3134 NdisClOpenAddressFamily(
3135 IN NDIS_HANDLE NdisBindingHandle,
3136 IN PCO_ADDRESS_FAMILY AddressFamily,
3137 IN NDIS_HANDLE ProtocolAfContext,
3138 IN PNDIS_CLIENT_CHARACTERISTICS ClCharacteristics,
3139 IN UINT SizeOfClCharacteristics,
3140 OUT PNDIS_HANDLE NdisAfHandle);
3141
3142 NDIS_STATUS
3143 EXPIMP
3144 NdisClRegisterSap(
3145 IN NDIS_HANDLE NdisAfHandle,
3146 IN NDIS_HANDLE ProtocolSapContext,
3147 IN PCO_SAP Sap,
3148 OUT PNDIS_HANDLE NdisSapHandle);
3149
3150
3151 /* Call Manager services */
3152
3153 NDIS_STATUS
3154 EXPIMP
3155 NdisCmActivateVc(
3156 IN NDIS_HANDLE NdisVcHandle,
3157 IN OUT PCO_CALL_PARAMETERS CallParameters);
3158
3159 VOID
3160 EXPIMP
3161 NdisCmAddPartyComplete(
3162 IN NDIS_STATUS Status,
3163 IN NDIS_HANDLE NdisPartyHandle,
3164 IN NDIS_HANDLE CallMgrPartyContext OPTIONAL,
3165 IN PCO_CALL_PARAMETERS CallParameters);
3166
3167 VOID
3168 EXPIMP
3169 NdisCmCloseAddressFamilyComplete(
3170 IN NDIS_STATUS Status,
3171 IN NDIS_HANDLE NdisAfHandle);
3172
3173 VOID
3174 EXPIMP
3175 NdisCmCloseCallComplete(
3176 IN NDIS_STATUS Status,
3177 IN NDIS_HANDLE NdisVcHandle,
3178 IN NDIS_HANDLE NdisPartyHandle OPTIONAL);
3179
3180 NDIS_STATUS
3181 EXPIMP
3182 NdisCmDeactivateVc(
3183 IN NDIS_HANDLE NdisVcHandle);
3184
3185 VOID
3186 EXPIMP
3187 NdisCmDeregisterSapComplete(
3188 IN NDIS_STATUS Status,
3189 IN NDIS_HANDLE NdisSapHandle);
3190
3191 VOID
3192 EXPIMP
3193 NdisCmDispatchCallConnected(
3194 IN NDIS_HANDLE NdisVcHandle);
3195
3196 NDIS_STATUS
3197 EXPIMP
3198 NdisCmDispatchIncomingCall(
3199 IN NDIS_HANDLE NdisSapHandle,
3200 IN NDIS_HANDLE NdisVcHandle,
3201 IN PCO_CALL_PARAMETERS CallParameters);
3202
3203 VOID
3204 EXPIMP
3205 NdisCmDispatchIncomingCallQoSChange(
3206 IN NDIS_HANDLE NdisVcHandle,
3207 IN PCO_CALL_PARAMETERS CallParameters);
3208
3209 VOID
3210 EXPIMP
3211 NdisCmDispatchIncomingCloseCall(
3212 IN NDIS_STATUS CloseStatus,
3213 IN NDIS_HANDLE NdisVcHandle,
3214 IN PVOID Buffer OPTIONAL,
3215 IN UINT Size);
3216
3217 VOID
3218 EXPIMP
3219 NdisCmDispatchIncomingDropParty(
3220 IN NDIS_STATUS DropStatus,
3221 IN NDIS_HANDLE NdisPartyHandle,
3222 IN PVOID Buffer OPTIONAL,
3223 IN UINT Size);
3224
3225 VOID
3226 EXPIMP
3227 NdisCmDropPartyComplete(
3228 IN NDIS_STATUS Status,
3229 IN NDIS_HANDLE NdisPartyHandle);
3230
3231 VOID
3232 EXPIMP
3233 NdisCmMakeCallComplete(
3234 IN NDIS_STATUS Status,
3235 IN NDIS_HANDLE NdisVcHandle,
3236 IN NDIS_HANDLE NdisPartyHandle OPTIONAL,
3237 IN NDIS_HANDLE CallMgrPartyContext OPTIONAL,
3238 IN PCO_CALL_PARAMETERS CallParameters);
3239
3240 VOID
3241 EXPIMP
3242 NdisCmModifyCallQoSComplete(
3243 IN NDIS_STATUS Status,
3244 IN NDIS_HANDLE NdisVcHandle,
3245 IN PCO_CALL_PARAMETERS CallParameters);
3246
3247 VOID
3248 EXPIMP
3249 NdisCmOpenAddressFamilyComplete(
3250 IN NDIS_STATUS Status,
3251 IN NDIS_HANDLE NdisAfHandle,
3252 IN NDIS_HANDLE CallMgrAfContext);
3253
3254 NDIS_STATUS
3255 EXPIMP
3256 NdisCmRegisterAddressFamily(
3257 IN NDIS_HANDLE NdisBindingHandle,
3258 IN PCO_ADDRESS_FAMILY AddressFamily,
3259 IN PNDIS_CALL_MANAGER_CHARACTERISTICS CmCharacteristics,
3260 IN UINT SizeOfCmCharacteristics);
3261
3262 VOID
3263 EXPIMP
3264 NdisCmRegisterSapComplete(
3265 IN NDIS_STATUS Status,
3266 IN NDIS_HANDLE NdisSapHandle,
3267 IN NDIS_HANDLE CallMgrSapContext);
3268
3269
3270 NDIS_STATUS
3271 EXPIMP
3272 NdisMCmActivateVc(
3273 IN NDIS_HANDLE NdisVcHandle,
3274 IN PCO_CALL_PARAMETERS CallParameters);
3275
3276 NDIS_STATUS
3277 EXPIMP
3278 NdisMCmCreateVc(
3279 IN NDIS_HANDLE MiniportAdapterHandle,
3280 IN NDIS_HANDLE NdisAfHandle,
3281 IN NDIS_HANDLE MiniportVcContext,
3282 OUT PNDIS_HANDLE NdisVcHandle);
3283
3284 NDIS_STATUS
3285 EXPIMP
3286 NdisMCmDeactivateVc(
3287 IN NDIS_HANDLE NdisVcHandle);
3288
3289 NDIS_STATUS
3290 EXPIMP
3291 NdisMCmDeleteVc(
3292 IN NDIS_HANDLE NdisVcHandle);
3293
3294 NDIS_STATUS
3295 EXPIMP
3296 NdisMCmRegisterAddressFamily(
3297 IN NDIS_HANDLE MiniportAdapterHandle,
3298 IN PCO_ADDRESS_FAMILY AddressFamily,
3299 IN PNDIS_CALL_MANAGER_CHARACTERISTICS CmCharacteristics,
3300 IN UINT SizeOfCmCharacteristics);
3301
3302 NDIS_STATUS
3303 EXPIMP
3304 NdisMCmRequest(
3305 IN NDIS_HANDLE NdisAfHandle,
3306 IN NDIS_HANDLE NdisVcHandle OPTIONAL,
3307 IN NDIS_HANDLE NdisPartyHandle OPTIONAL,
3308 IN OUT PNDIS_REQUEST NdisRequest);
3309
3310
3311 /* Connection-oriented services */
3312
3313 NDIS_STATUS
3314 EXPIMP
3315 NdisCoCreateVc(
3316 IN NDIS_HANDLE NdisBindingHandle,
3317 IN NDIS_HANDLE NdisAfHandle OPTIONAL,
3318 IN NDIS_HANDLE ProtocolVcContext,
3319 IN OUT PNDIS_HANDLE NdisVcHandle);
3320
3321 NDIS_STATUS
3322 EXPIMP
3323 NdisCoDeleteVc(
3324 IN NDIS_HANDLE NdisVcHandle);
3325
3326 NDIS_STATUS
3327 EXPIMP
3328 NdisCoRequest(
3329 IN NDIS_HANDLE NdisBindingHandle,
3330 IN NDIS_HANDLE NdisAfHandle OPTIONAL,
3331 IN NDIS_HANDLE NdisVcHandle OPTIONAL,
3332 IN NDIS_HANDLE NdisPartyHandle OPTIONAL,
3333 IN OUT PNDIS_REQUEST NdisRequest);
3334
3335 VOID
3336 EXPIMP
3337 NdisCoRequestComplete(
3338 IN NDIS_STATUS Status,
3339 IN NDIS_HANDLE NdisAfHandle,
3340 IN NDIS_HANDLE NdisVcHandle OPTIONAL,
3341 IN NDIS_HANDLE NdisPartyHandle OPTIONAL,
3342 IN PNDIS_REQUEST NdisRequest);
3343
3344 VOID
3345 EXPIMP
3346 NdisCoSendPackets(
3347 IN NDIS_HANDLE NdisVcHandle,
3348 IN PPNDIS_PACKET PacketArray,
3349 IN UINT NumberOfPackets);
3350
3351
3352 VOID
3353 EXPIMP
3354 NdisMCoActivateVcComplete(
3355 IN NDIS_STATUS Status,
3356 IN NDIS_HANDLE NdisVcHandle,
3357 IN PCO_CALL_PARAMETERS CallParameters);
3358
3359 VOID
3360 EXPIMP
3361 NdisMCoDeactivateVcComplete(
3362 IN NDIS_STATUS Status,
3363 IN NDIS_HANDLE NdisVcHandle);
3364
3365 VOID
3366 EXPIMP
3367 NdisMCoIndicateReceivePacket(
3368 IN NDIS_HANDLE NdisVcHandle,
3369 IN PPNDIS_PACKET PacketArray,
3370 IN UINT NumberOfPackets);
3371
3372 VOID
3373 EXPIMP
3374 NdisMCoIndicateStatus(
3375 IN NDIS_HANDLE MiniportAdapterHandle,
3376 IN NDIS_HANDLE NdisVcHandle OPTIONAL,
3377 IN NDIS_STATUS GeneralStatus,
3378 IN PVOID StatusBuffer OPTIONAL,
3379 IN ULONG StatusBufferSize);
3380
3381 VOID
3382 EXPIMP
3383 NdisMCoReceiveComplete(
3384 IN NDIS_HANDLE MiniportAdapterHandle);
3385
3386 VOID
3387 EXPIMP
3388 NdisMCoRequestComplete(
3389 IN NDIS_STATUS Status,
3390 IN NDIS_HANDLE MiniportAdapterHandle,
3391 IN PNDIS_REQUEST Request);
3392
3393 VOID
3394 EXPIMP
3395 NdisMCoSendComplete(
3396 IN NDIS_STATUS Status,
3397 IN NDIS_HANDLE NdisVcHandle,
3398 IN PNDIS_PACKET Packet);
3399
3400
3401 /* NDIS 5.0 extensions for intermediate drivers */
3402
3403 VOID
3404 EXPIMP
3405 NdisIMAssociateMiniport(
3406 IN NDIS_HANDLE DriverHandle,
3407 IN NDIS_HANDLE ProtocolHandle);
3408
3409 NDIS_STATUS
3410 EXPIMP
3411 NdisIMCancelInitializeDeviceInstance(
3412 IN NDIS_HANDLE DriverHandle,
3413 IN PNDIS_STRING DeviceInstance);
3414
3415 VOID
3416 EXPIMP
3417 NdisIMCopySendCompletePerPacketInfo(
3418 IN PNDIS_PACKET DstPacket,
3419 IN PNDIS_PACKET SrcPacket);
3420
3421 VOID
3422 EXPIMP
3423 NdisIMCopySendPerPacketInfo(
3424 IN PNDIS_PACKET DstPacket,
3425 IN PNDIS_PACKET SrcPacket);
3426
3427 VOID
3428 EXPIMP
3429 NdisIMDeregisterLayeredMiniport(
3430 IN NDIS_HANDLE DriverHandle);
3431
3432 NDIS_HANDLE
3433 EXPIMP
3434 NdisIMGetBindingContext(
3435 IN NDIS_HANDLE NdisBindingHandle);
3436
3437 NDIS_HANDLE
3438 EXPIMP
3439 NdisIMGetDeviceContext(
3440 IN NDIS_HANDLE MiniportAdapterHandle);
3441
3442 NDIS_STATUS
3443 EXPIMP
3444 NdisIMInitializeDeviceInstanceEx(
3445 IN NDIS_HANDLE DriverHandle,
3446 IN PNDIS_STRING DriverInstance,
3447 IN NDIS_HANDLE DeviceContext OPTIONAL);
3448
3449 #endif /* NDIS50 */
3450
3451
3452
3453 /* Prototypes for NDIS_MINIPORT_CHARACTERISTICS */
3454
3455 typedef BOOLEAN (*W_CHECK_FOR_HANG_HANDLER)(
3456 IN NDIS_HANDLE MiniportAdapterContext);
3457
3458 typedef VOID (*W_DISABLE_INTERRUPT_HANDLER)(
3459 IN NDIS_HANDLE MiniportAdapterContext);
3460
3461 typedef VOID (*W_ENABLE_INTERRUPT_HANDLER)(
3462 IN NDIS_HANDLE MiniportAdapterContext);
3463
3464 typedef VOID (*W_HALT_HANDLER)(
3465 IN NDIS_HANDLE MiniportAdapterContext);
3466
3467 typedef VOID (*W_HANDLE_INTERRUPT_HANDLER)(
3468 IN NDIS_HANDLE MiniportAdapterContext);
3469
3470 typedef NDIS_STATUS (*W_INITIALIZE_HANDLER)(
3471 OUT PNDIS_STATUS OpenErrorStatus,
3472 OUT PUINT SelectedMediumIndex,
3473 IN PNDIS_MEDIUM MediumArray,
3474 IN UINT MediumArraySize,
3475 IN NDIS_HANDLE MiniportAdapterContext,
3476 IN NDIS_HANDLE WrapperConfigurationContext);
3477
3478 typedef VOID (*W_ISR_HANDLER)(
3479 OUT PBOOLEAN InterruptRecognized,
3480 OUT PBOOLEAN QueueMiniportHandleInterrupt,
3481 IN NDIS_HANDLE MiniportAdapterContext);
3482
3483 typedef NDIS_STATUS (*W_QUERY_INFORMATION_HANDLER)(
3484 IN NDIS_HANDLE MiniportAdapterContext,
3485 IN NDIS_OID Oid,
3486 IN PVOID InformationBuffer,
3487 IN ULONG InformationBufferLength,
3488 OUT PULONG BytesWritten,
3489 OUT PULONG BytesNeeded);
3490
3491 typedef NDIS_STATUS (*W_RECONFIGURE_HANDLER)(
3492 OUT PNDIS_STATUS OpenErrorStatus,
3493 IN NDIS_HANDLE MiniportAdapterContext,
3494 IN NDIS_HANDLE WrapperConfigurationContext);
3495
3496 typedef NDIS_STATUS (*W_RESET_HANDLER)(
3497 OUT PBOOLEAN AddressingReset,
3498 IN NDIS_HANDLE MiniportAdapterContext);
3499
3500 typedef NDIS_STATUS (*W_SEND_HANDLER)(
3501 IN NDIS_HANDLE MiniportAdapterContext,
3502 IN PNDIS_PACKET Packet,
3503 IN UINT Flags);
3504
3505 typedef NDIS_STATUS (*WM_SEND_HANDLER)(
3506 IN NDIS_HANDLE MiniportAdapterContext,
3507 IN NDIS_HANDLE NdisLinkHandle,
3508 IN PNDIS_WAN_PACKET Packet);
3509
3510 typedef NDIS_STATUS (*W_SET_INFORMATION_HANDLER)(
3511 IN NDIS_HANDLE MiniportAdapterContext,
3512 IN NDIS_OID Oid,
3513 IN PVOID InformationBuffer,
3514 IN ULONG InformationBufferLength,
3515 OUT PULONG BytesRead,
3516 OUT PULONG BytesNeeded);
3517
3518 typedef NDIS_STATUS (*W_TRANSFER_DATA_HANDLER)(
3519 OUT PNDIS_PACKET Packet,
3520 OUT PUINT BytesTransferred,
3521 IN NDIS_HANDLE MiniportAdapterContext,
3522 IN NDIS_HANDLE MiniportReceiveContext,
3523 IN UINT ByteOffset,
3524 IN UINT BytesToTransfer);
3525
3526 typedef NDIS_STATUS (*WM_TRANSFER_DATA_HANDLER)(
3527 VOID);
3528
3529
3530
3531 /* NDIS structures available only to miniport drivers */
3532
3533 /* Technology specific defines */
3534
3535 #define DECLARE_UNKNOWN_STRUCT(BaseName) \
3536 typedef struct _##BaseName BaseName, *P##BaseName;
3537
3538 #define DECLARE_UNKNOWN_PROTOTYPE(Name) \
3539 typedef VOID (*##Name)(VOID);
3540
3541
3542 /* ARCnet */
3543
3544 typedef struct _ARC_BUFFER_LIST
3545 {
3546 PVOID Buffer;
3547 UINT Size;
3548 UINT BytesLeft;
3549 struct _ARC_BUFFER_LIST *Next;
3550 } ARC_BUFFER_LIST, *PARC_BUFFER_LIST;
3551
3552 DECLARE_UNKNOWN_STRUCT(ARC_FILTER)
3553
3554
3555 VOID
3556 EXPIMP
3557 ArcFilterDprIndicateReceive(
3558 IN PARC_FILTER Filter,
3559 IN PUCHAR pRawHeader,
3560 IN PUCHAR pData,
3561 IN UINT Length);
3562
3563 VOID
3564 EXPIMP
3565 ArcFilterDprIndicateReceiveComplete(
3566 IN PARC_FILTER Filter);
3567
3568
3569 /* Ethernet */
3570
3571 #define ETH_LENGTH_OF_ADDRESS 6
3572
3573 DECLARE_UNKNOWN_STRUCT(ETH_BINDING_INFO);
3574
3575 DECLARE_UNKNOWN_PROTOTYPE(ETH_ADDRESS_CHANGE)
3576 DECLARE_UNKNOWN_PROTOTYPE(ETH_FILTER_CHANGE)
3577 DECLARE_UNKNOWN_PROTOTYPE(ETH_DEFERRED_CLOSE)
3578
3579 typedef struct _ETH_FILTER
3580 {
3581 PNDIS_SPIN_LOCK Lock;
3582 CHAR (*MCastAddressBuf)[ETH_LENGTH_OF_ADDRESS];
3583 struct _NDIS_MINIPORT_BLOCK *Miniport;
3584 UINT CombinedPacketFilter;
3585 PETH_BINDING_INFO OpenList;
3586 ETH_ADDRESS_CHANGE AddressChangeAction;
3587 ETH_FILTER_CHANGE FilterChangeAction;
3588 ETH_DEFERRED_CLOSE CloseAction;
3589 UINT MaxMulticastAddresses;
3590 UINT NumAddresses;
3591 UCHAR AdapterAddress[ETH_LENGTH_OF_ADDRESS];
3592 UINT OldCombinedPacketFilter;
3593 CHAR (*OldMCastAddressBuf)[ETH_LENGTH_OF_ADDRESS];
3594 UINT OldNumAddresses;
3595 PETH_BINDING_INFO DirectedList;
3596 PETH_BINDING_INFO BMList;
3597 PETH_BINDING_INFO MCastSet;
3598 #if 0
3599 #ifdef NDIS_WRAPPER
3600 UINT NumOpens;
3601 NDIS_RW_LOCK BindListLock;
3602 #endif
3603 #endif
3604 } ETH_FILTER, *PETH_FILTER;
3605
3606
3607 NDIS_STATUS
3608 EXPIMP
3609 EthChangeFilterAddresses(
3610 IN PETH_FILTER Filter,
3611 IN NDIS_HANDLE NdisFilterHandle,
3612 IN PNDIS_REQUEST NdisRequest,
3613 IN UINT AddressCount,
3614 IN CHAR Addresses[] [ETH_LENGTH_OF_ADDRESS],
3615 IN BOOLEAN Set);
3616
3617 BOOLEAN
3618 EXPIMP
3619 EthCreateFilter(
3620 IN UINT MaximumMulticastAddresses,
3621 IN ETH_ADDRESS_CHANGE AddressChangeAction,
3622 IN ETH_FILTER_CHANGE FilterChangeAction,
3623 IN ETH_DEFERRED_CLOSE CloseAction,
3624 IN PUCHAR AdapterAddress,
3625 IN PNDIS_SPIN_LOCK Lock,
3626 OUT PETH_FILTER *Filter);
3627
3628 VOID
3629 EXPIMP
3630 EthDeleteFilter(
3631 IN PETH_FILTER Filter);
3632
3633 NDIS_STATUS
3634 EXPIMP
3635 EthDeleteFilterOpenAdapter(
3636 IN PETH_FILTER Filter,
3637 IN NDIS_HANDLE NdisFilterHandle,
3638 IN PNDIS_REQUEST NdisRequest);
3639
3640 NDIS_STATUS
3641 EXPIMP
3642 EthFilterAdjust(
3643 IN PETH_FILTER Filter,
3644 IN NDIS_HANDLE NdisFilterHandle,
3645 IN PNDIS_REQUEST NdisRequest,
3646 IN UINT FilterClasses,
3647 IN BOOLEAN Set);
3648
3649 VOID
3650 EXPIMP
3651 EthFilterIndicateReceive(
3652 IN PETH_FILTER Filter,
3653 IN NDIS_HANDLE MacReceiveContext,
3654 IN PCHAR Address,
3655 IN PVOID HeaderBuffer,
3656 IN UINT HeaderBufferSize,
3657 IN PVOID LookaheadBuffer,
3658 IN UINT LookaheadBufferSize,
3659 IN UINT PacketSize);
3660
3661 VOID
3662 EXPIMP
3663 EthFilterIndicateReceiveComplete(
3664 IN PETH_FILTER Filter);
3665
3666 BOOLEAN
3667 EXPIMP
3668 EthNoteFilterOpenAdapter(
3669 IN PETH_FILTER Filter,
3670 IN NDIS_HANDLE MacBindingHandle,
3671 IN NDIS_HANDLE NdisBindingContext,
3672 OUT PNDIS_HANDLE NdisFilterHandle);
3673
3674 UINT
3675 EXPIMP
3676 EthNumberOfOpenFilterAddresses(
3677 IN PETH_FILTER Filter,
3678 IN NDIS_HANDLE NdisFilterHandle);
3679
3680 VOID
3681 EXPIMP
3682 EthQueryGlobalFilterAddresses (
3683 OUT PNDIS_STATUS Status,
3684 IN PETH_FILTER Filter,
3685 IN UINT SizeOfArray,
3686 OUT PUINT NumberOfAddresses,
3687 IN OUT CHAR AddressArray[] [ETH_LENGTH_OF_ADDRESS]);
3688
3689 VOID
3690 EXPIMP
3691 EthQueryOpenFilterAddresses(
3692 OUT PNDIS_STATUS Status,
3693 IN PETH_FILTER Filter,
3694 IN NDIS_HANDLE NdisFilterHandle,
3695 IN UINT SizeOfArray,
3696 OUT PUINT NumberOfAddresses,
3697 IN OUT CHAR AddressArray[] [ETH_LENGTH_OF_ADDRESS]);
3698
3699 BOOLEAN
3700 EXPIMP
3701 EthShouldAddressLoopBack(
3702 IN PETH_FILTER Filter,
3703 IN CHAR Address[ETH_LENGTH_OF_ADDRESS]);
3704
3705
3706 /* FDDI */
3707
3708 #define FDDI_LENGTH_OF_LONG_ADDRESS 6
3709 #define FDDI_LENGTH_OF_SHORT_ADDRESS 2
3710
3711 DECLARE_UNKNOWN_STRUCT(FDDI_FILTER)
3712
3713 DECLARE_UNKNOWN_PROTOTYPE(FDDI_ADDRESS_CHANGE)
3714 DECLARE_UNKNOWN_PROTOTYPE(FDDI_FILTER_CHANGE)
3715 DECLARE_UNKNOWN_PROTOTYPE(FDDI_DEFERRED_CLOSE)
3716
3717
3718 NDIS_STATUS
3719 EXPIMP
3720 FddiChangeFilterLongAddresses(
3721 IN PFDDI_FILTER Filter,
3722 IN NDIS_HANDLE NdisFilterHandle,
3723 IN PNDIS_REQUEST NdisRequest,
3724 IN UINT AddressCount,
3725 IN CHAR Addresses[] [FDDI_LENGTH_OF_LONG_ADDRESS],
3726 IN BOOLEAN Set);
3727
3728 NDIS_STATUS
3729 EXPIMP
3730 FddiChangeFilterShortAddresses(
3731 IN PFDDI_FILTER Filter,
3732 IN NDIS_HANDLE NdisFilterHandle,
3733 IN PNDIS_REQUEST NdisRequest,
3734 IN UINT AddressCount,
3735 IN CHAR Addresses[] [FDDI_LENGTH_OF_SHORT_ADDRESS],
3736 IN BOOLEAN Set);
3737
3738 BOOLEAN
3739 EXPIMP
3740 FddiCreateFilter(
3741 IN UINT MaximumMulticastLongAddresses,
3742 IN UINT MaximumMulticastShortAddresses,
3743 IN FDDI_ADDRESS_CHANGE AddressChangeAction,
3744 IN FDDI_FILTER_CHANGE FilterChangeAction,
3745 IN FDDI_DEFERRED_CLOSE CloseAction,
3746 IN PUCHAR AdapterLongAddress,
3747 IN PUCHAR AdapterShortAddress,
3748 IN PNDIS_SPIN_LOCK Lock,
3749 OUT PFDDI_FILTER *Filter);
3750
3751 VOID
3752 EXPIMP
3753 FddiDeleteFilter(
3754 IN PFDDI_FILTER Filter);
3755
3756 NDIS_STATUS
3757 EXPIMP
3758 FddiDeleteFilterOpenAdapter(
3759 IN PFDDI_FILTER Filter,
3760 IN NDIS_HANDLE NdisFilterHandle,
3761 IN PNDIS_REQUEST NdisRequest);
3762
3763 NDIS_STATUS
3764 EXPIMP
3765 FddiFilterAdjust(
3766 IN PFDDI_FILTER Filter,
3767 IN NDIS_HANDLE NdisFilterHandle,
3768 IN PNDIS_REQUEST NdisRequest,
3769 IN UINT FilterClasses,
3770 IN BOOLEAN Set);
3771
3772 VOID
3773 EXPIMP
3774 FddiFilterIndicateReceive(
3775 IN PFDDI_FILTER Filter,
3776 IN NDIS_HANDLE MacReceiveContext,
3777 IN PCHAR Address,
3778 IN UINT AddressLength,
3779 IN PVOID HeaderBuffer,
3780 IN UINT HeaderBufferSize,
3781 IN PVOID LookaheadBuffer,
3782 IN UINT LookaheadBufferSize,
3783 IN UINT PacketSize);
3784
3785 VOID
3786 EXPIMP
3787 FddiFilterIndicateReceiveComplete(
3788 IN PFDDI_FILTER Filter);
3789
3790 BOOLEAN
3791 EXPIMP
3792 FddiNoteFilterOpenAdapter(
3793 IN PFDDI_FILTER Filter,
3794 IN NDIS_HANDLE MacBindingHandle,
3795 IN NDIS_HANDLE NdisBindingContext,
3796 OUT PNDIS_HANDLE NdisFilterHandle);
3797
3798 UINT
3799 EXPIMP
3800 FddiNumberOfOpenFilterLongAddresses(
3801 IN PFDDI_FILTER Filter,
3802 IN NDIS_HANDLE NdisFilterHandle);
3803
3804 UINT
3805 EXPIMP
3806 FddiNumberOfOpenFilterShortAddresses(
3807 IN PFDDI_FILTER Filter,
3808 IN NDIS_HANDLE NdisFilterHandle);
3809
3810 VOID
3811 EXPIMP
3812 FddiQueryGlobalFilterLongAddresses(
3813 OUT PNDIS_STATUS Status,
3814 IN PFDDI_FILTER Filter,
3815 IN UINT SizeOfArray,
3816 OUT PUINT NumberOfAddresses,
3817 IN OUT CHAR AddressArray[] [FDDI_LENGTH_OF_LONG_ADDRESS]);
3818
3819 VOID
3820 EXPIMP
3821 FddiQueryGlobalFilterShortAddresses(
3822 OUT PNDIS_STATUS Status,
3823 IN PFDDI_FILTER Filter,
3824 IN UINT SizeOfArray,
3825 OUT PUINT NumberOfAddresses,
3826 IN OUT CHAR AddressArray[] [FDDI_LENGTH_OF_SHORT_ADDRESS]);
3827
3828 VOID
3829 EXPIMP
3830 FddiQueryOpenFilterLongAddresses(
3831 OUT PNDIS_STATUS Status,
3832 IN PFDDI_FILTER Filter,
3833 IN NDIS_HANDLE NdisFilterHandle,
3834 IN UINT SizeOfArray,
3835 OUT PUINT NumberOfAddresses,
3836 IN OUT CHAR AddressArray[] [FDDI_LENGTH_OF_LONG_ADDRESS]);
3837
3838 VOID
3839 EXPIMP
3840 FddiQueryOpenFilterShortAddresses(
3841 OUT PNDIS_STATUS Status,
3842 IN PFDDI_FILTER Filter,
3843 IN NDIS_HANDLE NdisFilterHandle,
3844 IN UINT SizeOfArray,
3845 OUT PUINT NumberOfAddresses,
3846 IN OUT CHAR AddressArray[] [FDDI_LENGTH_OF_SHORT_ADDRESS]);
3847
3848 BOOLEAN
3849 EXPIMP
3850 FddiShouldAddressLoopBack(
3851 IN PFDDI_FILTER Filter,
3852 IN CHAR Address[],
3853 IN UINT LengthOfAddress);
3854
3855
3856 /* Token Ring */
3857
3858 #define TR_LENGTH_OF_FUNCTIONAL 4
3859 #define TR_LENGTH_OF_ADDRESS 6
3860
3861 DECLARE_UNKNOWN_STRUCT(TR_FILTER)
3862
3863 DECLARE_UNKNOWN_PROTOTYPE(TR_ADDRESS_CHANGE)
3864 DECLARE_UNKNOWN_PROTOTYPE(TR_GROUP_CHANGE)
3865 DECLARE_UNKNOWN_PROTOTYPE(TR_FILTER_CHANGE)
3866 DECLARE_UNKNOWN_PROTOTYPE(TR_DEFERRED_CLOSE)
3867
3868
3869 NDIS_STATUS
3870 EXPIMP
3871 TrChangeFunctionalAddress(
3872 IN PTR_FILTER Filter,
3873 IN NDIS_HANDLE NdisFilterHandle,
3874 IN PNDIS_REQUEST NdisRequest,
3875 IN CHAR FunctionalAddressArray[TR_LENGTH_OF_FUNCTIONAL],
3876 IN BOOLEAN Set);
3877
3878 NDIS_STATUS
3879 EXPIMP
3880 TrChangeGroupAddress(
3881 IN PTR_FILTER Filter,
3882 IN NDIS_HANDLE NdisFilterHandle,
3883 IN PNDIS_REQUEST NdisRequest,
3884 IN CHAR GroupAddressArray[TR_LENGTH_OF_FUNCTIONAL],
3885 IN BOOLEAN Set);
3886
3887 BOOLEAN
3888 EXPIMP
3889 TrCreateFilter(
3890 IN TR_ADDRESS_CHANGE AddressChangeAction,
3891 IN TR_GROUP_CHANGE GroupChangeAction,
3892 IN TR_FILTER_CHANGE FilterChangeAction,
3893 IN TR_DEFERRED_CLOSE CloseAction,
3894 IN PUCHAR AdapterAddress,
3895 IN PNDIS_SPIN_LOCK Lock,
3896 OUT PTR_FILTER *Filter);
3897
3898 VOID
3899 EXPIMP
3900 TrDeleteFilter(
3901 IN P