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