4 * Network Device Interface Specification definitions
6 * This file is part of the w32api package.
9 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 * DEFINES: i386 - Target platform is i386
22 * _NDIS_ - Define only for NDIS library
23 * NDIS_MINIPORT_DRIVER - Define only for NDIS miniport drivers
24 * NDIS40 - Use NDIS 4.0 structures by default
25 * NDIS50 - Use NDIS 5.0 structures by default
26 * NDIS50_MINIPORT - Building NDIS 5.0 miniport driver
27 * NDIS51_MINIPORT - Building NDIS 5.1 miniport driver
33 #pragma GCC system_header
47 #define NDISAPI DECLSPEC_EXPORT
49 #define NDISAPI DECLSPEC_IMPORT
52 #if defined(NDIS50_MINIPORT)
56 #endif /* NDIS50_MINIPORT */
58 #if defined(NDIS51_MINIPORT)
62 #endif /* NDIS51_MINIPORT */
64 /* NDIS 3.0 is default */
65 #if !defined(NDIS30) || !defined(NDIS40) || !defined(NDIS50) || !defined(NDIS51)
67 #endif /* !NDIS30 || !NDIS40 || !NDIS50 || !NDIS51 */
71 typedef PVOID QUEUED_CLOSE
;
74 typedef ULONG NDIS_OID
, *PNDIS_OID
;
76 typedef struct _X_FILTER FDDI_FILTER
, *PFDDI_FILTER
;
77 typedef struct _X_FILTER TR_FILTER
, *PTR_FILTER
;
78 typedef struct _X_FILTER NULL_FILTER
, *PNULL_FILTER
;
80 typedef struct _REFERENCE
{
82 USHORT ReferenceCount
;
84 } REFERENCE
, * PREFERENCE
;
89 typedef struct _NDIS_SPIN_LOCK
{
92 } NDIS_SPIN_LOCK
, * PNDIS_SPIN_LOCK
;
94 typedef struct _NDIS_EVENT
{
96 } NDIS_EVENT
, *PNDIS_EVENT
;
98 typedef PVOID NDIS_HANDLE
, *PNDIS_HANDLE
;
99 typedef int NDIS_STATUS
, *PNDIS_STATUS
;
101 typedef ANSI_STRING NDIS_ANSI_STRING
, *PNDIS_ANSI_STRING
;
102 typedef UNICODE_STRING NDIS_STRING
, *PNDIS_STRING
;
104 typedef MDL NDIS_BUFFER
, *PNDIS_BUFFER
;
105 typedef ULONG NDIS_ERROR_CODE
, *PNDIS_ERROR_CODE
;
108 /* NDIS_STATUS constants */
109 #define NDIS_STATUS_SUCCESS ((NDIS_STATUS)STATUS_SUCCESS)
110 #define NDIS_STATUS_PENDING ((NDIS_STATUS)STATUS_PENDING)
111 #define NDIS_STATUS_NOT_RECOGNIZED ((NDIS_STATUS)0x00010001L)
112 #define NDIS_STATUS_NOT_COPIED ((NDIS_STATUS)0x00010002L)
113 #define NDIS_STATUS_NOT_ACCEPTED ((NDIS_STATUS)0x00010003L)
114 #define NDIS_STATUS_CALL_ACTIVE ((NDIS_STATUS)0x00010007L)
115 #define NDIS_STATUS_ONLINE ((NDIS_STATUS)0x40010003L)
116 #define NDIS_STATUS_RESET_START ((NDIS_STATUS)0x40010004L)
117 #define NDIS_STATUS_RESET_END ((NDIS_STATUS)0x40010005L)
118 #define NDIS_STATUS_RING_STATUS ((NDIS_STATUS)0x40010006L)
119 #define NDIS_STATUS_CLOSED ((NDIS_STATUS)0x40010007L)
120 #define NDIS_STATUS_WAN_LINE_UP ((NDIS_STATUS)0x40010008L)
121 #define NDIS_STATUS_WAN_LINE_DOWN ((NDIS_STATUS)0x40010009L)
122 #define NDIS_STATUS_WAN_FRAGMENT ((NDIS_STATUS)0x4001000AL)
123 #define NDIS_STATUS_MEDIA_CONNECT ((NDIS_STATUS)0x4001000BL)
124 #define NDIS_STATUS_MEDIA_DISCONNECT ((NDIS_STATUS)0x4001000CL)
125 #define NDIS_STATUS_HARDWARE_LINE_UP ((NDIS_STATUS)0x4001000DL)
126 #define NDIS_STATUS_HARDWARE_LINE_DOWN ((NDIS_STATUS)0x4001000EL)
127 #define NDIS_STATUS_INTERFACE_UP ((NDIS_STATUS)0x4001000FL)
128 #define NDIS_STATUS_INTERFACE_DOWN ((NDIS_STATUS)0x40010010L)
129 #define NDIS_STATUS_MEDIA_BUSY ((NDIS_STATUS)0x40010011L)
130 #define NDIS_STATUS_MEDIA_SPECIFIC_INDICATION ((NDIS_STATUS)0x40010012L)
131 #define NDIS_STATUS_WW_INDICATION NDIS_STATUS_MEDIA_SPECIFIC_INDICATION
132 #define NDIS_STATUS_LINK_SPEED_CHANGE ((NDIS_STATUS)0x40010013L)
133 #define NDIS_STATUS_WAN_GET_STATS ((NDIS_STATUS)0x40010014L)
134 #define NDIS_STATUS_WAN_CO_FRAGMENT ((NDIS_STATUS)0x40010015L)
135 #define NDIS_STATUS_WAN_CO_LINKPARAMS ((NDIS_STATUS)0x40010016L)
137 #define NDIS_STATUS_NOT_RESETTABLE ((NDIS_STATUS)0x80010001L)
138 #define NDIS_STATUS_SOFT_ERRORS ((NDIS_STATUS)0x80010003L)
139 #define NDIS_STATUS_HARD_ERRORS ((NDIS_STATUS)0x80010004L)
140 #define NDIS_STATUS_BUFFER_OVERFLOW ((NDIS_STATUS)STATUS_BUFFER_OVERFLOW)
142 #define NDIS_STATUS_FAILURE ((NDIS_STATUS)STATUS_UNSUCCESSFUL)
143 #define NDIS_STATUS_RESOURCES ((NDIS_STATUS)STATUS_INSUFFICIENT_RESOURCES)
144 #define NDIS_STATUS_CLOSING ((NDIS_STATUS)0xC0010002L)
145 #define NDIS_STATUS_BAD_VERSION ((NDIS_STATUS)0xC0010004L)
146 #define NDIS_STATUS_BAD_CHARACTERISTICS ((NDIS_STATUS)0xC0010005L)
147 #define NDIS_STATUS_ADAPTER_NOT_FOUND ((NDIS_STATUS)0xC0010006L)
148 #define NDIS_STATUS_OPEN_FAILED ((NDIS_STATUS)0xC0010007L)
149 #define NDIS_STATUS_DEVICE_FAILED ((NDIS_STATUS)0xC0010008L)
150 #define NDIS_STATUS_MULTICAST_FULL ((NDIS_STATUS)0xC0010009L)
151 #define NDIS_STATUS_MULTICAST_EXISTS ((NDIS_STATUS)0xC001000AL)
152 #define NDIS_STATUS_MULTICAST_NOT_FOUND ((NDIS_STATUS)0xC001000BL)
153 #define NDIS_STATUS_REQUEST_ABORTED ((NDIS_STATUS)0xC001000CL)
154 #define NDIS_STATUS_RESET_IN_PROGRESS ((NDIS_STATUS)0xC001000DL)
155 #define NDIS_STATUS_CLOSING_INDICATING ((NDIS_STATUS)0xC001000EL)
156 #define NDIS_STATUS_NOT_SUPPORTED ((NDIS_STATUS)STATUS_NOT_SUPPORTED)
157 #define NDIS_STATUS_INVALID_PACKET ((NDIS_STATUS)0xC001000FL)
158 #define NDIS_STATUS_OPEN_LIST_FULL ((NDIS_STATUS)0xC0010010L)
159 #define NDIS_STATUS_ADAPTER_NOT_READY ((NDIS_STATUS)0xC0010011L)
160 #define NDIS_STATUS_ADAPTER_NOT_OPEN ((NDIS_STATUS)0xC0010012L)
161 #define NDIS_STATUS_NOT_INDICATING ((NDIS_STATUS)0xC0010013L)
162 #define NDIS_STATUS_INVALID_LENGTH ((NDIS_STATUS)0xC0010014L)
163 #define NDIS_STATUS_INVALID_DATA ((NDIS_STATUS)0xC0010015L)
164 #define NDIS_STATUS_BUFFER_TOO_SHORT ((NDIS_STATUS)0xC0010016L)
165 #define NDIS_STATUS_INVALID_OID ((NDIS_STATUS)0xC0010017L)
166 #define NDIS_STATUS_ADAPTER_REMOVED ((NDIS_STATUS)0xC0010018L)
167 #define NDIS_STATUS_UNSUPPORTED_MEDIA ((NDIS_STATUS)0xC0010019L)
168 #define NDIS_STATUS_GROUP_ADDRESS_IN_USE ((NDIS_STATUS)0xC001001AL)
169 #define NDIS_STATUS_FILE_NOT_FOUND ((NDIS_STATUS)0xC001001BL)
170 #define NDIS_STATUS_ERROR_READING_FILE ((NDIS_STATUS)0xC001001CL)
171 #define NDIS_STATUS_ALREADY_MAPPED ((NDIS_STATUS)0xC001001DL)
172 #define NDIS_STATUS_RESOURCE_CONFLICT ((NDIS_STATUS)0xC001001EL)
173 #define NDIS_STATUS_NO_CABLE ((NDIS_STATUS)0xC001001FL)
175 #define NDIS_STATUS_INVALID_SAP ((NDIS_STATUS)0xC0010020L)
176 #define NDIS_STATUS_SAP_IN_USE ((NDIS_STATUS)0xC0010021L)
177 #define NDIS_STATUS_INVALID_ADDRESS ((NDIS_STATUS)0xC0010022L)
178 #define NDIS_STATUS_VC_NOT_ACTIVATED ((NDIS_STATUS)0xC0010023L)
179 #define NDIS_STATUS_DEST_OUT_OF_ORDER ((NDIS_STATUS)0xC0010024L)
180 #define NDIS_STATUS_VC_NOT_AVAILABLE ((NDIS_STATUS)0xC0010025L)
181 #define NDIS_STATUS_CELLRATE_NOT_AVAILABLE ((NDIS_STATUS)0xC0010026L)
182 #define NDIS_STATUS_INCOMPATABLE_QOS ((NDIS_STATUS)0xC0010027L)
183 #define NDIS_STATUS_AAL_PARAMS_UNSUPPORTED ((NDIS_STATUS)0xC0010028L)
184 #define NDIS_STATUS_NO_ROUTE_TO_DESTINATION ((NDIS_STATUS)0xC0010029L)
186 #define NDIS_STATUS_TOKEN_RING_OPEN_ERROR ((NDIS_STATUS)0xC0011000L)
187 #define NDIS_STATUS_INVALID_DEVICE_REQUEST ((NDIS_STATUS)STATUS_INVALID_DEVICE_REQUEST)
188 #define NDIS_STATUS_NETWORK_UNREACHABLE ((NDIS_STATUS)STATUS_NETWORK_UNREACHABLE)
191 /* NDIS error codes for error logging */
193 #define NDIS_ERROR_CODE_RESOURCE_CONFLICT EVENT_NDIS_RESOURCE_CONFLICT
194 #define NDIS_ERROR_CODE_OUT_OF_RESOURCES EVENT_NDIS_OUT_OF_RESOURCE
195 #define NDIS_ERROR_CODE_HARDWARE_FAILURE EVENT_NDIS_HARDWARE_FAILURE
196 #define NDIS_ERROR_CODE_ADAPTER_NOT_FOUND EVENT_NDIS_ADAPTER_NOT_FOUND
197 #define NDIS_ERROR_CODE_INTERRUPT_CONNECT EVENT_NDIS_INTERRUPT_CONNECT
198 #define NDIS_ERROR_CODE_DRIVER_FAILURE EVENT_NDIS_DRIVER_FAILURE
199 #define NDIS_ERROR_CODE_BAD_VERSION EVENT_NDIS_BAD_VERSION
200 #define NDIS_ERROR_CODE_TIMEOUT EVENT_NDIS_TIMEOUT
201 #define NDIS_ERROR_CODE_NETWORK_ADDRESS EVENT_NDIS_NETWORK_ADDRESS
202 #define NDIS_ERROR_CODE_UNSUPPORTED_CONFIGURATION EVENT_NDIS_UNSUPPORTED_CONFIGURATION
203 #define NDIS_ERROR_CODE_INVALID_VALUE_FROM_ADAPTER EVENT_NDIS_INVALID_VALUE_FROM_ADAPTER
204 #define NDIS_ERROR_CODE_MISSING_CONFIGURATION_PARAMETER EVENT_NDIS_MISSING_CONFIGURATION_PARAMETER
205 #define NDIS_ERROR_CODE_BAD_IO_BASE_ADDRESS EVENT_NDIS_BAD_IO_BASE_ADDRESS
206 #define NDIS_ERROR_CODE_RECEIVE_SPACE_SMALL EVENT_NDIS_RECEIVE_SPACE_SMALL
207 #define NDIS_ERROR_CODE_ADAPTER_DISABLED EVENT_NDIS_ADAPTER_DISABLED
210 /* Memory allocation flags. Used by Ndis[Allocate|Free]Memory */
211 #define NDIS_MEMORY_CONTIGUOUS 0x00000001
212 #define NDIS_MEMORY_NONCACHED 0x00000002
214 /* NIC attribute flags. Used by NdisMSetAttributes(Ex) */
215 #define NDIS_ATTRIBUTE_IGNORE_PACKET_TIMEOUT 0x00000001
216 #define NDIS_ATTRIBUTE_IGNORE_REQUEST_TIMEOUT 0x00000002
217 #define NDIS_ATTRIBUTE_IGNORE_TOKEN_RING_ERRORS 0x00000004
218 #define NDIS_ATTRIBUTE_BUS_MASTER 0x00000008
219 #define NDIS_ATTRIBUTE_INTERMEDIATE_DRIVER 0x00000010
220 #define NDIS_ATTRIBUTE_DESERIALIZE 0x00000020
221 #define NDIS_ATTRIBUTE_NO_HALT_ON_SUSPEND 0x00000040
222 #define NDIS_ATTRIBUTE_SURPRISE_REMOVE_OK 0x00000080
223 #define NDIS_ATTRIBUTE_NOT_CO_NDIS 0x00000100
224 #define NDIS_ATTRIBUTE_USES_SAFE_BUFFER_APIS 0x00000200
229 typedef union _NDIS_RW_LOCK_REFCOUNT
{
232 } NDIS_RW_LOCK_REFCOUNT
;
234 typedef struct _NDIS_RW_LOCK
{
243 NDIS_RW_LOCK_REFCOUNT RefCount
[MAXIMUM_PROCESSORS
];
244 } NDIS_RW_LOCK
, *PNDIS_RW_LOCK
;
246 typedef struct _LOCK_STATE
{
249 } LOCK_STATE
, *PLOCK_STATE
;
256 (*PNDIS_TIMER_FUNCTION
)(
257 /*IN*/ PVOID SystemSpecific1
,
258 /*IN*/ PVOID FunctionContext
,
259 /*IN*/ PVOID SystemSpecific2
,
260 /*IN*/ PVOID SystemSpecific3
);
262 typedef struct _NDIS_TIMER
{
265 } NDIS_TIMER
, *PNDIS_TIMER
;
271 typedef CM_MCA_POS_DATA NDIS_MCA_POS_DATA
, *PNDIS_MCA_POS_DATA
;
272 typedef CM_EISA_SLOT_INFORMATION NDIS_EISA_SLOT_INFORMATION
, *PNDIS_EISA_SLOT_INFORMATION
;
273 typedef CM_EISA_FUNCTION_INFORMATION NDIS_EISA_FUNCTION_INFORMATION
, *PNDIS_EISA_FUNCTION_INFORMATION
;
274 typedef CM_PARTIAL_RESOURCE_LIST NDIS_RESOURCE_LIST
, *PNDIS_RESOURCE_LIST
;
276 /* Hardware status codes (OID_GEN_HARDWARE_STATUS) */
277 typedef enum _NDIS_HARDWARE_STATUS
{
278 NdisHardwareStatusReady
,
279 NdisHardwareStatusInitializing
,
280 NdisHardwareStatusReset
,
281 NdisHardwareStatusClosing
,
282 NdisHardwareStatusNotReady
283 } NDIS_HARDWARE_STATUS
, *PNDIS_HARDWARE_STATUS
;
285 /* OID_GEN_GET_TIME_CAPS */
286 typedef struct _GEN_GET_TIME_CAPS
{
288 ULONG ClockPrecision
;
289 } GEN_GET_TIME_CAPS
, *PGEN_GET_TIME_CAPS
;
292 #define READABLE_LOCAL_CLOCK 0x00000001
293 #define CLOCK_NETWORK_DERIVED 0x00000002
294 #define CLOCK_PRECISION 0x00000004
295 #define RECEIVE_TIME_INDICATION_CAPABLE 0x00000008
296 #define TIMED_SEND_CAPABLE 0x00000010
297 #define TIME_STAMP_CAPABLE 0x00000020
299 /* OID_GEN_GET_NETCARD_TIME */
300 typedef struct _GEN_GET_NETCARD_TIME
{
302 } GEN_GET_NETCARD_TIME
, *PGEN_GET_NETCARD_TIME
;
304 /* NDIS driver medium (OID_GEN_MEDIA_SUPPORTED / OID_GEN_MEDIA_IN_USE) */
305 typedef enum _NDIS_MEDIUM
{
313 NdisMediumArcnet878_2
,
315 NdisMediumWirelessWan
,
321 } NDIS_MEDIUM
, *PNDIS_MEDIUM
;
323 /* NDIS packet filter bits (OID_GEN_CURRENT_PACKET_FILTER) */
324 #define NDIS_PACKET_TYPE_DIRECTED 0x00000001
325 #define NDIS_PACKET_TYPE_MULTICAST 0x00000002
326 #define NDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004
327 #define NDIS_PACKET_TYPE_BROADCAST 0x00000008
328 #define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010
329 #define NDIS_PACKET_TYPE_PROMISCUOUS 0x00000020
330 #define NDIS_PACKET_TYPE_SMT 0x00000040
331 #define NDIS_PACKET_TYPE_ALL_LOCAL 0x00000080
332 #define NDIS_PACKET_TYPE_GROUP 0x00001000
333 #define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00002000
334 #define NDIS_PACKET_TYPE_FUNCTIONAL 0x00004000
335 #define NDIS_PACKET_TYPE_MAC_FRAME 0x00008000
337 /* NDIS protocol option bits (OID_GEN_PROTOCOL_OPTIONS) */
338 #define NDIS_PROT_OPTION_ESTIMATED_LENGTH 0x00000001
339 #define NDIS_PROT_OPTION_NO_LOOPBACK 0x00000002
340 #define NDIS_PROT_OPTION_NO_RSVD_ON_RCVPKT 0x00000004
342 /* NDIS MAC option bits (OID_GEN_MAC_OPTIONS) */
343 #define NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA 0x00000001
344 #define NDIS_MAC_OPTION_RECEIVE_SERIALIZED 0x00000002
345 #define NDIS_MAC_OPTION_TRANSFERS_NOT_PEND 0x00000004
346 #define NDIS_MAC_OPTION_NO_LOOPBACK 0x00000008
347 #define NDIS_MAC_OPTION_FULL_DUPLEX 0x00000010
348 #define NDIS_MAC_OPTION_EOTX_INDICATION 0x00000020
349 #define NDIS_MAC_OPTION_8021P_PRIORITY 0x00000040
350 #define NDIS_MAC_OPTION_RESERVED 0x80000000
352 /* State of the LAN media (OID_GEN_MEDIA_CONNECT_STATUS) */
353 typedef enum _NDIS_MEDIA_STATE
{
354 NdisMediaStateConnected
,
355 NdisMediaStateDisconnected
356 } NDIS_MEDIA_STATE
, *PNDIS_MEDIA_STATE
;
358 /* OID_GEN_SUPPORTED_GUIDS */
359 typedef struct _NDIS_GUID
{
367 } NDIS_GUID
, *PNDIS_GUID
;
369 #define NDIS_GUID_TO_OID 0x00000001
370 #define NDIS_GUID_TO_STATUS 0x00000002
371 #define NDIS_GUID_ANSI_STRING 0x00000004
372 #define NDIS_GUID_UNICODE_STRING 0x00000008
373 #define NDIS_GUID_ARRAY 0x00000010
376 typedef struct _NDIS_PACKET_POOL
{
377 NDIS_SPIN_LOCK SpinLock
;
378 struct _NDIS_PACKET
*FreeList
;
381 } NDIS_PACKET_POOL
, * PNDIS_PACKET_POOL
;
383 /* NDIS_PACKET_PRIVATE.Flags constants */
384 #define fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO 0x40
385 #define fPACKET_ALLOCATED_BY_NDIS 0x80
387 typedef struct _NDIS_PACKET_PRIVATE
{
392 PNDIS_PACKET_POOL Pool
;
396 UCHAR NdisPacketFlags
;
397 USHORT NdisPacketOobOffset
;
398 } NDIS_PACKET_PRIVATE
, * PNDIS_PACKET_PRIVATE
;
400 typedef struct _NDIS_PACKET
{
401 NDIS_PACKET_PRIVATE Private
;
404 UCHAR MiniportReserved
[2 * sizeof(PVOID
)];
405 UCHAR WrapperReserved
[2 * sizeof(PVOID
)];
408 UCHAR MiniportReservedEx
[3 * sizeof(PVOID
)];
409 UCHAR WrapperReservedEx
[sizeof(PVOID
)];
412 UCHAR MacReserved
[4 * sizeof(PVOID
)];
415 ULONG_PTR Reserved
[2];
416 UCHAR ProtocolReserved
[1];
417 } NDIS_PACKET
, *PNDIS_PACKET
, **PPNDIS_PACKET
;
419 typedef enum _NDIS_CLASS_ID
{
420 NdisClass802_3Priority
,
421 NdisClassWirelessWanMbxMailbox
,
422 NdisClassIrdaPacketInfo
,
426 typedef struct MediaSpecificInformation
{
427 UINT NextEntryOffset
;
428 NDIS_CLASS_ID ClassId
;
430 UCHAR ClassInformation
[1];
431 } MEDIA_SPECIFIC_INFORMATION
;
433 typedef struct _NDIS_PACKET_OOB_DATA
{
434 _ANONYMOUS_UNION
union {
435 ULONGLONG TimeToSend
;
438 ULONGLONG TimeReceived
;
440 UINT SizeMediaSpecificInfo
;
441 PVOID MediaSpecificInformation
;
443 } NDIS_PACKET_OOB_DATA
, *PNDIS_PACKET_OOB_DATA
;
445 typedef struct _NDIS_PM_PACKET_PATTERN
{
452 } NDIS_PM_PACKET_PATTERN
, *PNDIS_PM_PACKET_PATTERN
;
455 /* Request types used by NdisRequest */
456 typedef enum _NDIS_REQUEST_TYPE
{
457 NdisRequestQueryInformation
,
458 NdisRequestSetInformation
,
459 NdisRequestQueryStatistics
,
463 NdisRequestTransferData
,
469 } NDIS_REQUEST_TYPE
, *PNDIS_REQUEST_TYPE
;
471 typedef struct _NDIS_REQUEST
{
472 UCHAR MacReserved
[4 * sizeof(PVOID
)];
473 NDIS_REQUEST_TYPE RequestType
;
475 struct QUERY_INFORMATION
{
477 PVOID InformationBuffer
;
478 UINT InformationBufferLength
;
482 struct SET_INFORMATION
{
484 PVOID InformationBuffer
;
485 UINT InformationBufferLength
;
490 #if (defined(NDIS50) || defined(NDIS51))
491 UCHAR NdisReserved
[9 * sizeof(PVOID
)];
493 UCHAR CallMgrReserved
[2 * sizeof(PVOID
)];
494 UCHAR ProtocolReserved
[2 * sizeof(PVOID
)];
496 UCHAR MiniportReserved
[2 * sizeof(PVOID
)];
498 } NDIS_REQUEST
, *PNDIS_REQUEST
;
502 /* Wide Area Networks definitions */
504 typedef struct _NDIS_WAN_PACKET
{
505 LIST_ENTRY WanPacketQueue
;
506 PUCHAR CurrentBuffer
;
510 PVOID ProtocolReserved1
;
511 PVOID ProtocolReserved2
;
512 PVOID ProtocolReserved3
;
513 PVOID ProtocolReserved4
;
518 } NDIS_WAN_PACKET
, *PNDIS_WAN_PACKET
;
522 /* DMA channel information */
524 typedef struct _NDIS_DMA_DESCRIPTION
{
526 BOOLEAN AutoInitialize
;
527 BOOLEAN DmaChannelSpecified
;
532 } NDIS_DMA_DESCRIPTION
, *PNDIS_DMA_DESCRIPTION
;
534 typedef struct _NDIS_DMA_BLOCK
{
535 PVOID MapRegisterBase
;
536 KEVENT AllocationEvent
;
537 PADAPTER_OBJECT SystemAdapterObject
;
540 } NDIS_DMA_BLOCK
, *PNDIS_DMA_BLOCK
;
543 /* Possible hardware architecture */
544 typedef enum _NDIS_INTERFACE_TYPE
{
545 NdisInterfaceInternal
= Internal
,
546 NdisInterfaceIsa
= Isa
,
547 NdisInterfaceEisa
= Eisa
,
548 NdisInterfaceMca
= MicroChannel
,
549 NdisInterfaceTurboChannel
= TurboChannel
,
550 NdisInterfacePci
= PCIBus
,
551 NdisInterfacePcMcia
= PCMCIABus
,
552 NdisInterfaceCBus
= CBus
,
553 NdisInterfaceMPIBus
= MPIBus
,
554 NdisInterfaceMPSABus
= MPSABus
,
555 NdisInterfaceProcessorInternal
= ProcessorInternal
,
556 NdisInterfaceInternalPowerBus
= InternalPowerBus
,
557 NdisInterfacePNPISABus
= PNPISABus
,
558 NdisInterfacePNPBus
= PNPBus
,
559 NdisMaximumInterfaceType
560 } NDIS_INTERFACE_TYPE
, *PNDIS_INTERFACE_TYPE
;
562 #define NdisInterruptLevelSensitive LevelSensitive
563 #define NdisInterruptLatched Latched
564 typedef KINTERRUPT_MODE NDIS_INTERRUPT_MODE
, *PNDIS_INTERRUPT_MODE
;
567 typedef enum _NDIS_PARAMETER_TYPE
{
568 NdisParameterInteger
,
569 NdisParameterHexInteger
,
571 NdisParameterMultiString
,
573 } NDIS_PARAMETER_TYPE
, *PNDIS_PARAMETER_TYPE
;
580 typedef struct _NDIS_CONFIGURATION_PARAMETER
{
581 NDIS_PARAMETER_TYPE ParameterType
;
584 NDIS_STRING StringData
;
585 BINARY_DATA BinaryData
;
587 } NDIS_CONFIGURATION_PARAMETER
, *PNDIS_CONFIGURATION_PARAMETER
;
590 typedef PHYSICAL_ADDRESS NDIS_PHYSICAL_ADDRESS
, *PNDIS_PHYSICAL_ADDRESS
;
592 typedef struct _NDIS_PHYSICAL_ADDRESS_UNIT
{
593 NDIS_PHYSICAL_ADDRESS PhysicalAddress
;
595 } NDIS_PHYSICAL_ADDRESS_UNIT
, *PNDIS_PHYSICAL_ADDRESS_UNIT
;
597 typedef struct _NDIS_WAN_LINE_DOWN
{
598 UCHAR RemoteAddress
[6];
599 UCHAR LocalAddress
[6];
600 } NDIS_WAN_LINE_DOWN
, *PNDIS_WAN_LINE_DOWN
;
602 typedef struct _NDIS_WAN_LINE_UP
{
604 ULONG MaximumTotalSize
;
605 NDIS_WAN_QUALITY Quality
;
607 UCHAR RemoteAddress
[6];
608 /*OUT*/ UCHAR LocalAddress
[6];
609 ULONG ProtocolBufferLength
;
610 PUCHAR ProtocolBuffer
;
612 NDIS_STRING DeviceName
;
613 } NDIS_WAN_LINE_UP
, *PNDIS_WAN_LINE_UP
;
617 (*ADAPTER_SHUTDOWN_HANDLER
)(
618 /*IN*/ PVOID ShutdownContext
);
621 typedef struct _OID_LIST OID_LIST
, *POID_LIST
;
625 typedef enum _NDIS_PNP_DEVICE_STATE
{
627 NdisPnPDeviceStarted
,
628 NdisPnPDeviceQueryStopped
,
629 NdisPnPDeviceStopped
,
630 NdisPnPDeviceQueryRemoved
,
631 NdisPnPDeviceRemoved
,
632 NdisPnPDeviceSurpriseRemoved
633 } NDIS_PNP_DEVICE_STATE
;
635 #define NDIS_DEVICE_NOT_STOPPABLE 0x00000001
636 #define NDIS_DEVICE_NOT_REMOVEABLE 0x00000002
637 #define NDIS_DEVICE_NOT_SUSPENDABLE 0x00000004
638 #define NDIS_DEVICE_DISABLE_PM 0x00000008
639 #define NDIS_DEVICE_DISABLE_WAKE_UP 0x00000010
640 #define NDIS_DEVICE_DISABLE_WAKE_ON_RECONNECT 0x00000020
641 #define NDIS_DEVICE_RESERVED 0x00000040
642 #define NDIS_DEVICE_DISABLE_WAKE_ON_MAGIC_PACKET 0x00000080
643 #define NDIS_DEVICE_DISABLE_WAKE_ON_PATTERN_MATCH 0x00000100
646 /* OID_GEN_NETWORK_LAYER_ADDRESSES */
647 typedef struct _NETWORK_ADDRESS
{
648 USHORT AddressLength
;
651 } NETWORK_ADDRESS
, *PNETWORK_ADDRESS
;
653 typedef struct _NETWORK_ADDRESS_LIST
{
656 NETWORK_ADDRESS Address
[1];
657 } NETWORK_ADDRESS_LIST
, *PNETWORK_ADDRESS_LIST
;
659 /* Protocol types supported by NDIS */
660 #define NDIS_PROTOCOL_ID_DEFAULT 0x00
661 #define NDIS_PROTOCOL_ID_TCP_IP 0x02
662 #define NDIS_PROTOCOL_ID_IPX 0x06
663 #define NDIS_PROTOCOL_ID_NBF 0x07
664 #define NDIS_PROTOCOL_ID_MAX 0x0F
665 #define NDIS_PROTOCOL_ID_MASK 0x0F
668 /* OID_GEN_TRANSPORT_HEADER_OFFSET */
669 typedef struct _TRANSPORT_HEADER_OFFSET
{
672 } TRANSPORT_HEADER_OFFSET
, *PTRANSPORT_HEADER_OFFSET
;
675 /* OID_GEN_CO_LINK_SPEED / OID_GEN_CO_MINIMUM_LINK_SPEED */
676 typedef struct _NDIS_CO_LINK_SPEED
{
679 } NDIS_CO_LINK_SPEED
, *PNDIS_CO_LINK_SPEED
;
681 typedef ULONG NDIS_AF
, *PNDIS_AF
;
682 #define CO_ADDRESS_FAMILY_Q2931 ((NDIS_AF)0x1)
683 #define CO_ADDRESS_FAMILY_PSCHED ((NDIS_AF)0x2)
684 #define CO_ADDRESS_FAMILY_L2TP ((NDIS_AF)0x3)
685 #define CO_ADDRESS_FAMILY_IRDA ((NDIS_AF)0x4)
686 #define CO_ADDRESS_FAMILY_1394 ((NDIS_AF)0x5)
687 #define CO_ADDRESS_FAMILY_PPP ((NDIS_AF)0x6)
688 #define CO_ADDRESS_FAMILY_TAPI ((NDIS_AF)0x800)
689 #define CO_ADDRESS_FAMILY_TAPI_PROXY ((NDIS_AF)0x801)
691 #define CO_ADDRESS_FAMILY_PROXY 0x80000000
694 NDIS_AF AddressFamily
;
697 } CO_ADDRESS_FAMILY
, *PCO_ADDRESS_FAMILY
;
699 typedef struct _CO_FLOW_PARAMETERS
{
701 ULONG TokenBucketSize
;
704 ULONG DelayVariation
;
705 SERVICETYPE ServiceType
;
707 ULONG MinimumPolicedSize
;
708 } CO_FLOW_PARAMETERS
, *PCO_FLOW_PARAMETERS
;
710 typedef struct _CO_SPECIFIC_PARAMETERS
{
714 } CO_SPECIFIC_PARAMETERS
, *PCO_SPECIFIC_PARAMETERS
;
716 typedef struct _CO_CALL_MANAGER_PARAMETERS
{
717 CO_FLOW_PARAMETERS Transmit
;
718 CO_FLOW_PARAMETERS Receive
;
719 CO_SPECIFIC_PARAMETERS CallMgrSpecific
;
720 } CO_CALL_MANAGER_PARAMETERS
, *PCO_CALL_MANAGER_PARAMETERS
;
722 /* CO_MEDIA_PARAMETERS.Flags constants */
723 #define RECEIVE_TIME_INDICATION 0x00000001
724 #define USE_TIME_STAMPS 0x00000002
725 #define TRANSMIT_VC 0x00000004
726 #define RECEIVE_VC 0x00000008
727 #define INDICATE_ERRED_PACKETS 0x00000010
728 #define INDICATE_END_OF_TX 0x00000020
729 #define RESERVE_RESOURCES_VC 0x00000040
730 #define ROUND_DOWN_FLOW 0x00000080
731 #define ROUND_UP_FLOW 0x00000100
733 typedef struct _CO_MEDIA_PARAMETERS
{
735 ULONG ReceivePriority
;
736 ULONG ReceiveSizeHint
;
737 CO_SPECIFIC_PARAMETERS MediaSpecific
;
738 } CO_MEDIA_PARAMETERS
, *PCO_MEDIA_PARAMETERS
;
740 /* CO_CALL_PARAMETERS.Flags constants */
741 #define PERMANENT_VC 0x00000001
742 #define CALL_PARAMETERS_CHANGED 0x00000002
743 #define QUERY_CALL_PARAMETERS 0x00000004
744 #define BROADCAST_VC 0x00000008
745 #define MULTIPOINT_VC 0x00000010
747 typedef struct _CO_CALL_PARAMETERS
{
749 PCO_CALL_MANAGER_PARAMETERS CallMgrParameters
;
750 PCO_MEDIA_PARAMETERS MediaParameters
;
751 } CO_CALL_PARAMETERS
, *PCO_CALL_PARAMETERS
;
753 typedef struct _CO_SAP
{
759 typedef struct _NDIS_IPSEC_PACKET_INFO
{
760 _ANONYMOUS_UNION
union {
762 NDIS_HANDLE OffloadHandle
;
763 NDIS_HANDLE NextOffloadHandle
;
766 ULONG SA_DELETE_REQ
: 1;
767 ULONG CRYPTO_DONE
: 1;
768 ULONG NEXT_CRYPTO_DONE
: 1;
772 } NDIS_IPSEC_PACKET_INFO
, *PNDIS_IPSEC_PACKET_INFO
;
774 /* NDIS_MAC_FRAGMENT.Errors constants */
775 #define WAN_ERROR_CRC 0x00000001
776 #define WAN_ERROR_FRAMING 0x00000002
777 #define WAN_ERROR_HARDWAREOVERRUN 0x00000004
778 #define WAN_ERROR_BUFFEROVERRUN 0x00000008
779 #define WAN_ERROR_TIMEOUT 0x00000010
780 #define WAN_ERROR_ALIGNMENT 0x00000020
782 typedef struct _NDIS_MAC_FRAGMENT
{
783 NDIS_HANDLE NdisLinkContext
;
785 } NDIS_MAC_FRAGMENT
, *PNDIS_MAC_FRAGMENT
;
787 typedef struct _NDIS_MAC_LINE_DOWN
{
788 NDIS_HANDLE NdisLinkContext
;
789 } NDIS_MAC_LINE_DOWN
, *PNDIS_MAC_LINE_DOWN
;
791 typedef struct _NDIS_MAC_LINE_UP
{
793 NDIS_WAN_QUALITY Quality
;
795 NDIS_HANDLE ConnectionWrapperID
;
796 NDIS_HANDLE NdisLinkHandle
;
797 NDIS_HANDLE NdisLinkContext
;
798 } NDIS_MAC_LINE_UP
, *PNDIS_MAC_LINE_UP
;
800 typedef struct _NDIS_PACKET_8021Q_INFO
{
801 _ANONYMOUS_UNION
union {
803 UINT32 UserPriority
: 3;
804 UINT32 CanonicalFormatId
: 1;
806 UINT32 Reserved
: 16;
810 } NDIS_PACKET_8021Q_INFO
, *PNDIS_PACKET_8021Q_INFO
;
812 typedef enum _NDIS_PER_PACKET_INFO
{
813 TcpIpChecksumPacketInfo
,
815 TcpLargeSendPacketInfo
,
816 ClassificationHandlePacketInfo
,
818 ScatterGatherListPacketInfo
,
823 } NDIS_PER_PACKET_INFO
, *PNDIS_PER_PACKET_INFO
;
825 typedef struct _NDIS_PACKET_EXTENSION
{
826 PVOID NdisPacketInfo
[MaxPerPacketInfo
];
827 } NDIS_PACKET_EXTENSION
, *PNDIS_PACKET_EXTENSION
;
831 * NDIS_GET_ORIGINAL_PACKET(
832 * IN PNDIS_PACKET Packet);
834 #define NDIS_GET_ORIGINAL_PACKET(Packet) \
835 NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, OriginalPacketInfo)
839 * NDIS_GET_PACKET_CANCEL_ID(
840 * IN PNDIS_PACKET Packet);
842 #define NDIS_GET_PACKET_CANCEL_ID(Packet) \
843 NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, PacketCancelId)
846 * PNDIS_PACKET_EXTENSION
847 * NDIS_PACKET_EXTENSION_FROM_PACKET(
848 * IN PNDIS_PACKET Packet);
850 #define NDIS_PACKET_EXTENSION_FROM_PACKET(Packet) \
851 ((PNDIS_PACKET_EXTENSION)((PUCHAR)(Packet) \
852 + (Packet)->Private.NdisPacketOobOffset + sizeof(NDIS_PACKET_OOB_DATA)))
856 * NDIS_PER_PACKET_INFO_FROM_PACKET(
857 * IN OUT PNDIS_PACKET Packet,
858 * IN NDIS_PER_PACKET_INFO InfoType);
860 #define NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, InfoType) \
861 ((PNDIS_PACKET_EXTENSION)((PUCHAR)(Packet) + (Packet)->Private.NdisPacketOobOffset \
862 + sizeof(NDIS_PACKET_OOB_DATA)))->NdisPacketInfo[(InfoType)]
866 * NDIS_SET_ORIGINAL_PACKET(
867 * IN OUT PNDIS_PACKET Packet,
868 * IN PNDIS_PACKET OriginalPacket);
870 #define NDIS_SET_ORIGINAL_PACKET(Packet, OriginalPacket) \
871 NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, OriginalPacketInfo) = (OriginalPacket)
875 * NDIS_SET_PACKET_CANCEL_ID(
876 * IN PNDIS_PACKET Packet
877 * IN ULONG_PTR CancelId);
879 #define NDIS_SET_PACKET_CANCEL_ID(Packet, CancelId) \
880 NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, PacketCancelId) = (CancelId)
882 typedef enum _NDIS_TASK
{
883 TcpIpChecksumNdisTask
,
885 TcpLargeSendNdisTask
,
887 } NDIS_TASK
, *PNDIS_TASK
;
889 typedef struct _NDIS_TASK_IPSEC
{
891 ULONG AH_ESP_COMBINED
;
892 ULONG TRANSPORT_TUNNEL_COMBINED
;
909 ULONG TRIPLE_DES
: 1;
916 } NDIS_TASK_IPSEC
, *PNDIS_TASK_IPSEC
;
918 typedef struct _NDIS_TASK_OFFLOAD
{
922 ULONG OffsetNextTask
;
923 ULONG TaskBufferLength
;
925 } NDIS_TASK_OFFLOAD
, *PNDIS_TASK_OFFLOAD
;
927 /* NDIS_TASK_OFFLOAD_HEADER.Version constants */
928 #define NDIS_TASK_OFFLOAD_VERSION 1
930 typedef enum _NDIS_ENCAPSULATION
{
931 UNSPECIFIED_Encapsulation
,
933 IEEE_802_3_Encapsulation
,
934 IEEE_802_5_Encapsulation
,
935 LLC_SNAP_ROUTED_Encapsulation
,
936 LLC_SNAP_BRIDGED_Encapsulation
937 } NDIS_ENCAPSULATION
;
939 typedef struct _NDIS_ENCAPSULATION_FORMAT
{
940 NDIS_ENCAPSULATION Encapsulation
;
942 ULONG FixedHeaderSize
: 1;
945 ULONG EncapsulationHeaderSize
;
946 } NDIS_ENCAPSULATION_FORMAT
, *PNDIS_ENCAPSULATION_FORMAT
;
948 typedef struct _NDIS_TASK_TCP_IP_CHECKSUM
{
950 ULONG IpOptionsSupported
:1;
951 ULONG TcpOptionsSupported
:1;
958 ULONG IpOptionsSupported
: 1;
959 ULONG TcpOptionsSupported
: 1;
960 ULONG TcpChecksum
: 1;
961 ULONG UdpChecksum
: 1;
962 ULONG IpChecksum
: 1;
966 ULONG IpOptionsSupported
: 1;
967 ULONG TcpOptionsSupported
: 1;
968 ULONG TcpChecksum
: 1;
969 ULONG UdpChecksum
: 1;
973 ULONG IpOptionsSupported
: 1;
974 ULONG TcpOptionsSupported
: 1;
975 ULONG TcpChecksum
: 1;
976 ULONG UdpChecksum
: 1;
978 } NDIS_TASK_TCP_IP_CHECKSUM
, *PNDIS_TASK_TCP_IP_CHECKSUM
;
980 typedef struct _NDIS_TASK_TCP_LARGE_SEND
{
982 ULONG MaxOffLoadSize
;
983 ULONG MinSegmentCount
;
986 } NDIS_TASK_TCP_LARGE_SEND
, *PNDIS_TASK_TCP_LARGE_SEND
;
988 typedef struct _NDIS_TCP_IP_CHECKSUM_PACKET_INFO
{
989 _ANONYMOUS_UNION
union {
991 ULONG NdisPacketChecksumV4
: 1;
992 ULONG NdisPacketChecksumV6
: 1;
993 ULONG NdisPacketTcpChecksum
: 1;
994 ULONG NdisPacketUdpChecksum
: 1;
995 ULONG NdisPacketIpChecksum
: 1;
999 ULONG NdisPacketTcpChecksumFailed
: 1;
1000 ULONG NdisPacketUdpChecksumFailed
: 1;
1001 ULONG NdisPacketIpChecksumFailed
: 1;
1002 ULONG NdisPacketTcpChecksumSucceeded
: 1;
1003 ULONG NdisPacketUdpChecksumSucceeded
: 1;
1004 ULONG NdisPacketIpChecksumSucceeded
: 1;
1005 ULONG NdisPacketLoopback
: 1;
1009 } NDIS_TCP_IP_CHECKSUM_PACKET_INFO
, *PNDIS_TCP_IP_CHECKSUM_PACKET_INFO
;
1011 typedef struct _NDIS_WAN_CO_FRAGMENT
{
1013 } NDIS_WAN_CO_FRAGMENT
, *PNDIS_WAN_CO_FRAGMENT
;
1015 typedef struct _NDIS_WAN_FRAGMENT
{
1016 UCHAR RemoteAddress
[6];
1017 UCHAR LocalAddress
[6];
1018 } NDIS_WAN_FRAGMENT
, *PNDIS_WAN_FRAGMENT
;
1020 typedef struct _WAN_CO_LINKPARAMS
{
1021 ULONG TransmitSpeed
;
1024 } WAN_CO_LINKPARAMS
, *PWAN_CO_LINKPARAMS
;
1030 (*CM_ACTIVATE_VC_COMPLETE_HANDLER
)(
1031 /*IN*/ NDIS_STATUS Status
,
1032 /*IN*/ NDIS_HANDLE CallMgrVcContext
,
1033 /*IN*/ PCO_CALL_PARAMETERS CallParameters
);
1035 typedef NDIS_STATUS DDKAPI
1036 (*CM_ADD_PARTY_HANDLER
)(
1037 /*IN*/ NDIS_HANDLE CallMgrVcContext
,
1038 /*IN OUT*/ PCO_CALL_PARAMETERS CallParameters
,
1039 /*IN*/ NDIS_HANDLE NdisPartyHandle
,
1040 /*OUT*/ PNDIS_HANDLE CallMgrPartyContext
);
1042 typedef NDIS_STATUS DDKAPI
1043 (*CM_CLOSE_AF_HANDLER
)(
1044 /*IN*/ NDIS_HANDLE CallMgrAfContext
);
1046 typedef NDIS_STATUS DDKAPI
1047 (*CM_CLOSE_CALL_HANDLER
)(
1048 /*IN*/ NDIS_HANDLE CallMgrVcContext
,
1049 /*IN*/ NDIS_HANDLE CallMgrPartyContext
/*OPTIONAL*/,
1050 /*IN*/ PVOID CloseData
/*OPTIONAL*/,
1051 /*IN*/ UINT Size
/*OPTIONAL*/);
1053 typedef NDIS_STATUS DDKAPI
1054 (*CM_DEREG_SAP_HANDLER
)(
1055 /*IN*/ NDIS_HANDLE CallMgrSapContext
);
1058 (*CM_DEACTIVATE_VC_COMPLETE_HANDLER
)(
1059 /*IN*/ NDIS_STATUS Status
,
1060 /*IN*/ NDIS_HANDLE CallMgrVcContext
);
1062 typedef NDIS_STATUS DDKAPI
1063 (*CM_DROP_PARTY_HANDLER
)(
1064 /*IN*/ NDIS_HANDLE CallMgrPartyContext
,
1065 /*IN*/ PVOID CloseData
/*OPTIONAL*/,
1066 /*IN*/ UINT Size
/*OPTIONAL*/);
1069 (*CM_INCOMING_CALL_COMPLETE_HANDLER
)(
1070 /*IN*/ NDIS_STATUS Status
,
1071 /*IN*/ NDIS_HANDLE CallMgrVcContext
,
1072 /*IN*/ PCO_CALL_PARAMETERS CallParameters
);
1074 typedef NDIS_STATUS DDKAPI
1075 (*CM_MAKE_CALL_HANDLER
)(
1076 /*IN*/ NDIS_HANDLE CallMgrVcContext
,
1077 /*IN OUT*/ PCO_CALL_PARAMETERS CallParameters
,
1078 /*IN*/ NDIS_HANDLE NdisPartyHandle
/*OPTIONAL*/,
1079 /*OUT*/ PNDIS_HANDLE CallMgrPartyContext
/*OPTIONAL*/);
1081 typedef NDIS_STATUS DDKAPI
1082 (*CM_MODIFY_CALL_QOS_HANDLER
)(
1083 /*IN*/ NDIS_HANDLE CallMgrVcContext
,
1084 /*IN*/ PCO_CALL_PARAMETERS CallParameters
);
1086 typedef NDIS_STATUS DDKAPI
1087 (*CM_OPEN_AF_HANDLER
)(
1088 /*IN*/ NDIS_HANDLE CallMgrBindingContext
,
1089 /*IN*/ PCO_ADDRESS_FAMILY AddressFamily
,
1090 /*IN*/ NDIS_HANDLE NdisAfHandle
,
1091 /*OUT*/ PNDIS_HANDLE CallMgrAfContext
);
1093 typedef NDIS_STATUS DDKAPI
1094 (*CM_REG_SAP_HANDLER
)(
1095 /*IN*/ NDIS_HANDLE CallMgrAfContext
,
1097 /*IN*/ NDIS_HANDLE NdisSapHandle
,
1098 /*OUT*/ PNDIS_HANDLE CallMgrSapContext
);
1100 typedef NDIS_STATUS DDKAPI
1101 (*CO_CREATE_VC_HANDLER
)(
1102 /*IN*/ NDIS_HANDLE ProtocolAfContext
,
1103 /*IN*/ NDIS_HANDLE NdisVcHandle
,
1104 /*OUT*/ PNDIS_HANDLE ProtocolVcContext
);
1106 typedef NDIS_STATUS DDKAPI
1107 (*CO_DELETE_VC_HANDLER
)(
1108 /*IN*/ NDIS_HANDLE ProtocolVcContext
);
1111 (*CO_REQUEST_COMPLETE_HANDLER
)(
1112 /*IN*/ NDIS_STATUS Status
,
1113 /*IN*/ NDIS_HANDLE ProtocolAfContext
/*OPTIONAL*/,
1114 /*IN*/ NDIS_HANDLE ProtocolVcContext
/*OPTIONAL*/,
1115 /*IN*/ NDIS_HANDLE ProtocolPartyContext
/*OPTIONAL*/,
1116 /*IN*/ PNDIS_REQUEST NdisRequest
);
1118 typedef NDIS_STATUS DDKAPI
1119 (*CO_REQUEST_HANDLER
)(
1120 /*IN*/ NDIS_HANDLE ProtocolAfContext
,
1121 /*IN*/ NDIS_HANDLE ProtocolVcContext
/*OPTIONAL*/,
1122 /*IN*/ NDIS_HANDLE ProtocolPartyContext
/*OPTIONAL*/,
1123 /*IN OUT*/ PNDIS_REQUEST NdisRequest
);
1125 typedef struct _NDIS_CALL_MANAGER_CHARACTERISTICS
{
1130 CO_CREATE_VC_HANDLER CmCreateVcHandler
;
1131 CO_DELETE_VC_HANDLER CmDeleteVcHandler
;
1132 CM_OPEN_AF_HANDLER CmOpenAfHandler
;
1133 CM_CLOSE_AF_HANDLER CmCloseAfHandler
;
1134 CM_REG_SAP_HANDLER CmRegisterSapHandler
;
1135 CM_DEREG_SAP_HANDLER CmDeregisterSapHandler
;
1136 CM_MAKE_CALL_HANDLER CmMakeCallHandler
;
1137 CM_CLOSE_CALL_HANDLER CmCloseCallHandler
;
1138 CM_INCOMING_CALL_COMPLETE_HANDLER CmIncomingCallCompleteHandler
;
1139 CM_ADD_PARTY_HANDLER CmAddPartyHandler
;
1140 CM_DROP_PARTY_HANDLER CmDropPartyHandler
;
1141 CM_ACTIVATE_VC_COMPLETE_HANDLER CmActivateVcCompleteHandler
;
1142 CM_DEACTIVATE_VC_COMPLETE_HANDLER CmDeactivateVcCompleteHandler
;
1143 CM_MODIFY_CALL_QOS_HANDLER CmModifyCallQoSHandler
;
1144 CO_REQUEST_HANDLER CmRequestHandler
;
1145 CO_REQUEST_COMPLETE_HANDLER CmRequestCompleteHandler
;
1146 } NDIS_CALL_MANAGER_CHARACTERISTICS
, *PNDIS_CALL_MANAGER_CHARACTERISTICS
;
1150 /* Call Manager clients */
1152 typedef VOID (*CL_OPEN_AF_COMPLETE_HANDLER
)(
1153 /*IN*/ NDIS_STATUS Status
,
1154 /*IN*/ NDIS_HANDLE ProtocolAfContext
,
1155 /*IN*/ NDIS_HANDLE NdisAfHandle
);
1158 (*CL_CLOSE_AF_COMPLETE_HANDLER
)(
1159 /*IN*/ NDIS_STATUS Status
,
1160 /*IN*/ NDIS_HANDLE ProtocolAfContext
);
1163 (*CL_REG_SAP_COMPLETE_HANDLER
)(
1164 /*IN*/ NDIS_STATUS Status
,
1165 /*IN*/ NDIS_HANDLE ProtocolSapContext
,
1167 /*IN*/ NDIS_HANDLE NdisSapHandle
);
1170 (*CL_DEREG_SAP_COMPLETE_HANDLER
)(
1171 /*IN*/ NDIS_STATUS Status
,
1172 /*IN*/ NDIS_HANDLE ProtocolSapContext
);
1175 (*CL_MAKE_CALL_COMPLETE_HANDLER
)(
1176 /*IN*/ NDIS_STATUS Status
,
1177 /*IN*/ NDIS_HANDLE ProtocolVcContext
,
1178 /*IN*/ NDIS_HANDLE NdisPartyHandle
/*OPTIONAL*/,
1179 /*IN*/ PCO_CALL_PARAMETERS CallParameters
);
1182 (*CL_MODIFY_CALL_QOS_COMPLETE_HANDLER
)(
1183 /*IN*/ NDIS_STATUS Status
,
1184 /*IN*/ NDIS_HANDLE ProtocolVcContext
,
1185 /*IN*/ PCO_CALL_PARAMETERS CallParameters
);
1188 (*CL_CLOSE_CALL_COMPLETE_HANDLER
)(
1189 /*IN*/ NDIS_STATUS Status
,
1190 /*IN*/ NDIS_HANDLE ProtocolVcContext
,
1191 /*IN*/ NDIS_HANDLE ProtocolPartyContext
/*OPTIONAL*/);
1194 (*CL_ADD_PARTY_COMPLETE_HANDLER
)(
1195 /*IN*/ NDIS_STATUS Status
,
1196 /*IN*/ NDIS_HANDLE ProtocolPartyContext
,
1197 /*IN*/ NDIS_HANDLE NdisPartyHandle
,
1198 /*IN*/ PCO_CALL_PARAMETERS CallParameters
);
1201 (*CL_DROP_PARTY_COMPLETE_HANDLER
)(
1202 /*IN*/ NDIS_STATUS Status
,
1203 /*IN*/ NDIS_HANDLE ProtocolPartyContext
);
1205 typedef NDIS_STATUS DDKAPI
1206 (*CL_INCOMING_CALL_HANDLER
)(
1207 /*IN*/ NDIS_HANDLE ProtocolSapContext
,
1208 /*IN*/ NDIS_HANDLE ProtocolVcContext
,
1209 /*IN OUT*/ PCO_CALL_PARAMETERS CallParameters
);
1212 (*CL_INCOMING_CALL_QOS_CHANGE_HANDLER
)(
1213 /*IN*/ NDIS_HANDLE ProtocolVcContext
,
1214 /*IN*/ PCO_CALL_PARAMETERS CallParameters
);
1217 (*CL_INCOMING_CLOSE_CALL_HANDLER
)(
1218 /*IN*/ NDIS_STATUS CloseStatus
,
1219 /*IN*/ NDIS_HANDLE ProtocolVcContext
,
1220 /*IN*/ PVOID CloseData
/*OPTIONAL*/,
1221 /*IN*/ UINT Size
/*OPTIONAL*/);
1224 (*CL_INCOMING_DROP_PARTY_HANDLER
)(
1225 /*IN*/ NDIS_STATUS DropStatus
,
1226 /*IN*/ NDIS_HANDLE ProtocolPartyContext
,
1227 /*IN*/ PVOID CloseData
/*OPTIONAL*/,
1228 /*IN*/ UINT Size
/*OPTIONAL*/);
1231 (*CL_CALL_CONNECTED_HANDLER
)(
1232 /*IN*/ NDIS_HANDLE ProtocolVcContext
);
1235 typedef struct _NDIS_CLIENT_CHARACTERISTICS
{
1240 CO_CREATE_VC_HANDLER ClCreateVcHandler
;
1241 CO_DELETE_VC_HANDLER ClDeleteVcHandler
;
1242 CO_REQUEST_HANDLER ClRequestHandler
;
1243 CO_REQUEST_COMPLETE_HANDLER ClRequestCompleteHandler
;
1244 CL_OPEN_AF_COMPLETE_HANDLER ClOpenAfCompleteHandler
;
1245 CL_CLOSE_AF_COMPLETE_HANDLER ClCloseAfCompleteHandler
;
1246 CL_REG_SAP_COMPLETE_HANDLER ClRegisterSapCompleteHandler
;
1247 CL_DEREG_SAP_COMPLETE_HANDLER ClDeregisterSapCompleteHandler
;
1248 CL_MAKE_CALL_COMPLETE_HANDLER ClMakeCallCompleteHandler
;
1249 CL_MODIFY_CALL_QOS_COMPLETE_HANDLER ClModifyCallQoSCompleteHandler
;
1250 CL_CLOSE_CALL_COMPLETE_HANDLER ClCloseCallCompleteHandler
;
1251 CL_ADD_PARTY_COMPLETE_HANDLER ClAddPartyCompleteHandler
;
1252 CL_DROP_PARTY_COMPLETE_HANDLER ClDropPartyCompleteHandler
;
1253 CL_INCOMING_CALL_HANDLER ClIncomingCallHandler
;
1254 CL_INCOMING_CALL_QOS_CHANGE_HANDLER ClIncomingCallQoSChangeHandler
;
1255 CL_INCOMING_CLOSE_CALL_HANDLER ClIncomingCloseCallHandler
;
1256 CL_INCOMING_DROP_PARTY_HANDLER ClIncomingDropPartyHandler
;
1257 CL_CALL_CONNECTED_HANDLER ClCallConnectedHandler
;
1258 } NDIS_CLIENT_CHARACTERISTICS
, *PNDIS_CLIENT_CHARACTERISTICS
;
1261 /* NDIS protocol structures */
1263 /* Prototypes for NDIS 3.0 protocol characteristics */
1266 (*OPEN_ADAPTER_COMPLETE_HANDLER
)(
1267 /*IN*/ NDIS_HANDLE ProtocolBindingContext
,
1268 /*IN*/ NDIS_STATUS Status
,
1269 /*IN*/ NDIS_STATUS OpenErrorStatus
);
1272 (*CLOSE_ADAPTER_COMPLETE_HANDLER
)(
1273 /*IN*/ NDIS_HANDLE ProtocolBindingContext
,
1274 /*IN*/ NDIS_STATUS Status
);
1277 (*RESET_COMPLETE_HANDLER
)(
1278 /*IN*/ NDIS_HANDLE ProtocolBindingContext
,
1279 /*IN*/ NDIS_STATUS Status
);
1282 (*REQUEST_COMPLETE_HANDLER
)(
1283 /*IN*/ NDIS_HANDLE ProtocolBindingContext
,
1284 /*IN*/ PNDIS_REQUEST NdisRequest
,
1285 /*IN*/ NDIS_STATUS Status
);
1289 /*IN*/ NDIS_HANDLE ProtocolBindingContext
,
1290 /*IN*/ NDIS_STATUS GeneralStatus
,
1291 /*IN*/ PVOID StatusBuffer
,
1292 /*IN*/ UINT StatusBufferSize
);
1295 (*STATUS_COMPLETE_HANDLER
)(
1296 /*IN*/ NDIS_HANDLE ProtocolBindingContext
);
1299 (*SEND_COMPLETE_HANDLER
)(
1300 /*IN*/ NDIS_HANDLE ProtocolBindingContext
,
1301 /*IN*/ PNDIS_PACKET Packet
,
1302 /*IN*/ NDIS_STATUS Status
);
1305 (*WAN_SEND_COMPLETE_HANDLER
)(
1306 /*IN*/ NDIS_HANDLE ProtocolBindingContext
,
1307 /*IN*/ PNDIS_WAN_PACKET Packet
,
1308 /*IN*/ NDIS_STATUS Status
);
1311 (*TRANSFER_DATA_COMPLETE_HANDLER
)(
1312 /*IN*/ NDIS_HANDLE ProtocolBindingContext
,
1313 /*IN*/ PNDIS_PACKET Packet
,
1314 /*IN*/ NDIS_STATUS Status
,
1315 /*IN*/ UINT BytesTransferred
);
1318 (*WAN_TRANSFER_DATA_COMPLETE_HANDLER
)(
1322 typedef NDIS_STATUS DDKAPI
1324 /*IN*/ NDIS_HANDLE ProtocolBindingContext
,
1325 /*IN*/ NDIS_HANDLE MacReceiveContext
,
1326 /*IN*/ PVOID HeaderBuffer
,
1327 /*IN*/ UINT HeaderBufferSize
,
1328 /*IN*/ PVOID LookAheadBuffer
,
1329 /*IN*/ UINT LookaheadBufferSize
,
1330 /*IN*/ UINT PacketSize
);
1332 typedef NDIS_STATUS DDKAPI
1333 (*WAN_RECEIVE_HANDLER
)(
1334 /*IN*/ NDIS_HANDLE NdisLinkHandle
,
1335 /*IN*/ PUCHAR Packet
,
1336 /*IN*/ ULONG PacketSize
);
1339 (*RECEIVE_COMPLETE_HANDLER
)(
1340 /*IN*/ NDIS_HANDLE ProtocolBindingContext
);
1343 /* Protocol characteristics for NDIS 3.0 protocols */
1345 #define NDIS30_PROTOCOL_CHARACTERISTICS_S \
1346 UCHAR MajorNdisVersion; \
1347 UCHAR MinorNdisVersion; \
1348 _ANONYMOUS_UNION union { \
1352 OPEN_ADAPTER_COMPLETE_HANDLER OpenAdapterCompleteHandler; \
1353 CLOSE_ADAPTER_COMPLETE_HANDLER CloseAdapterCompleteHandler; \
1354 _ANONYMOUS_UNION union { \
1355 SEND_COMPLETE_HANDLER SendCompleteHandler; \
1356 WAN_SEND_COMPLETE_HANDLER WanSendCompleteHandler; \
1357 } DUMMYUNIONNAME2; \
1358 _ANONYMOUS_UNION union { \
1359 TRANSFER_DATA_COMPLETE_HANDLER TransferDataCompleteHandler; \
1360 WAN_TRANSFER_DATA_COMPLETE_HANDLER WanTransferDataCompleteHandler; \
1361 } DUMMYUNIONNAME3; \
1362 RESET_COMPLETE_HANDLER ResetCompleteHandler; \
1363 REQUEST_COMPLETE_HANDLER RequestCompleteHandler; \
1364 _ANONYMOUS_UNION union { \
1365 RECEIVE_HANDLER ReceiveHandler; \
1366 WAN_RECEIVE_HANDLER WanReceiveHandler; \
1367 } DUMMYUNIONNAME4; \
1368 RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler; \
1369 STATUS_HANDLER StatusHandler; \
1370 STATUS_COMPLETE_HANDLER StatusCompleteHandler; \
1373 typedef struct _NDIS30_PROTOCOL_CHARACTERISTICS
{
1374 NDIS30_PROTOCOL_CHARACTERISTICS_S
1375 } NDIS30_PROTOCOL_CHARACTERISTICS
, *PNDIS30_PROTOCOL_CHARACTERISTICS
;
1378 /* Prototypes for NDIS 4.0 protocol characteristics */
1381 (*RECEIVE_PACKET_HANDLER
)(
1382 /*IN*/ NDIS_HANDLE ProtocolBindingContext
,
1383 /*IN*/ PNDIS_PACKET Packet
);
1387 /*OUT*/ PNDIS_STATUS Status
,
1388 /*IN*/ NDIS_HANDLE BindContext
,
1389 /*IN*/ PNDIS_STRING DeviceName
,
1390 /*IN*/ PVOID SystemSpecific1
,
1391 /*IN*/ PVOID SystemSpecific2
);
1395 /*OUT*/ PNDIS_STATUS Status
,
1396 /*IN*/ NDIS_HANDLE ProtocolBindingContext
,
1397 /*IN*/ NDIS_HANDLE UnbindContext
);
1399 typedef NDIS_STATUS DDKAPI
1400 (*PNP_EVENT_HANDLER
)(
1401 /*IN*/ NDIS_HANDLE ProtocolBindingContext
,
1402 /*IN*/ PNET_PNP_EVENT NetPnPEvent
);
1405 (*UNLOAD_PROTOCOL_HANDLER
)(
1409 /* Protocol characteristics for NDIS 4.0 protocols */
1413 #define NDIS40_PROTOCOL_CHARACTERISTICS_S \
1414 NDIS30_PROTOCOL_CHARACTERISTICS Ndis30Chars; \
1415 RECEIVE_PACKET_HANDLER ReceivePacketHandler; \
1416 BIND_HANDLER BindAdapterHandler; \
1417 UNBIND_HANDLER UnbindAdapterHandler; \
1418 PNP_EVENT_HANDLER PnPEventHandler; \
1419 UNLOAD_PROTOCOL_HANDLER UnloadHandler;
1421 #else /* !__cplusplus */
1423 #define NDIS40_PROTOCOL_CHARACTERISTICS_S \
1424 NDIS30_PROTOCOL_CHARACTERISTICS_S \
1425 RECEIVE_PACKET_HANDLER ReceivePacketHandler; \
1426 BIND_HANDLER BindAdapterHandler; \
1427 UNBIND_HANDLER UnbindAdapterHandler; \
1428 PNP_EVENT_HANDLER PnPEventHandler; \
1429 UNLOAD_PROTOCOL_HANDLER UnloadHandler;
1431 #endif /* __cplusplus */
1433 typedef struct _NDIS40_PROTOCOL_CHARACTERISTICS
{
1434 NDIS40_PROTOCOL_CHARACTERISTICS_S
1435 } NDIS40_PROTOCOL_CHARACTERISTICS
, *PNDIS40_PROTOCOL_CHARACTERISTICS
;
1437 /* Prototypes for NDIS 5.0 protocol characteristics */
1440 (*CO_SEND_COMPLETE_HANDLER
)(
1441 /*IN*/ NDIS_STATUS Status
,
1442 /*IN*/ NDIS_HANDLE ProtocolVcContext
,
1443 /*IN*/ PNDIS_PACKET Packet
);
1446 (*CO_STATUS_HANDLER
)(
1447 /*IN*/ NDIS_HANDLE ProtocolBindingContext
,
1448 /*IN*/ NDIS_HANDLE ProtocolVcContext
/*OPTIONAL*/,
1449 /*IN*/ NDIS_STATUS GeneralStatus
,
1450 /*IN*/ PVOID StatusBuffer
,
1451 /*IN*/ UINT StatusBufferSize
);
1454 (*CO_RECEIVE_PACKET_HANDLER
)(
1455 /*IN*/ NDIS_HANDLE ProtocolBindingContext
,
1456 /*IN*/ NDIS_HANDLE ProtocolVcContext
,
1457 /*IN*/ PNDIS_PACKET Packet
);
1460 (*CO_AF_REGISTER_NOTIFY_HANDLER
)(
1461 /*IN*/ NDIS_HANDLE ProtocolBindingContext
,
1462 /*IN*/ PCO_ADDRESS_FAMILY AddressFamily
);
1464 #ifdef __cplusplus \
1466 #define NDIS50_PROTOCOL_CHARACTERISTICS_S \
1467 NDIS40_PROTOCOL_CHARACTERISTICS Ndis40Chars; \
1468 PVOID ReservedHandlers[4]; \
1469 CO_SEND_COMPLETE_HANDLER CoSendCompleteHandler; \
1470 CO_STATUS_HANDLER CoStatusHandler; \
1471 CO_RECEIVE_PACKET_HANDLER CoReceivePacketHandler; \
1472 CO_AF_REGISTER_NOTIFY_HANDLER CoAfRegisterNotifyHandler;
1474 #else /* !__cplusplus */
1476 #define NDIS50_PROTOCOL_CHARACTERISTICS_S \
1477 NDIS40_PROTOCOL_CHARACTERISTICS_S \
1478 PVOID ReservedHandlers[4]; \
1479 CO_SEND_COMPLETE_HANDLER CoSendCompleteHandler; \
1480 CO_STATUS_HANDLER CoStatusHandler; \
1481 CO_RECEIVE_PACKET_HANDLER CoReceivePacketHandler; \
1482 CO_AF_REGISTER_NOTIFY_HANDLER CoAfRegisterNotifyHandler;
1484 #endif /* !__cplusplus */
1486 typedef struct _NDIS50_PROTOCOL_CHARACTERISTICS
{
1487 NDIS50_PROTOCOL_CHARACTERISTICS_S
1488 } NDIS50_PROTOCOL_CHARACTERISTICS
, *PNDIS50_PROTOCOL_CHARACTERISTICS
;
1490 #if defined(NDIS50) || defined(NDIS51)
1491 typedef struct _NDIS_PROTOCOL_CHARACTERISTICS
{
1492 NDIS50_PROTOCOL_CHARACTERISTICS_S
;
1493 } NDIS_PROTOCOL_CHARACTERISTICS
, *PNDIS_PROTOCOL_CHARACTERISTICS
;
1494 #elif defined(NDIS40)
1495 typedef struct _NDIS_PROTOCOL_CHARACTERISTICS
{
1496 NDIS40_PROTOCOL_CHARACTERISTICS_S
;
1497 } NDIS_PROTOCOL_CHARACTERISTICS
, *PNDIS_PROTOCOL_CHARACTERISTICS
;
1498 #elif defined(NDIS30)
1499 typedef struct _NDIS_PROTOCOL_CHARACTERISTICS
{
1500 NDIS30_PROTOCOL_CHARACTERISTICS_S
1501 } NDIS_PROTOCOL_CHARACTERISTICS
, *PNDIS_PROTOCOL_CHARACTERISTICS
;
1503 #error Define an NDIS version
1508 /* Buffer management routines */
1514 /*OUT*/ PNDIS_STATUS Status
,
1515 /*OUT*/ PNDIS_BUFFER
*Buffer
,
1516 /*IN*/ NDIS_HANDLE PoolHandle
,
1517 /*IN*/ PVOID VirtualAddress
,
1518 /*IN*/ UINT Length
);
1524 NdisAllocateBufferPool(
1525 /*OUT*/ PNDIS_STATUS Status
,
1526 /*OUT*/ PNDIS_HANDLE PoolHandle
,
1527 /*IN*/ UINT NumberOfDescriptors
);
1533 /*OUT*/ PNDIS_STATUS Status
,
1534 /*OUT*/ PNDIS_PACKET
*Packet
,
1535 /*IN*/ NDIS_HANDLE PoolHandle
);
1540 NdisAllocatePacketPool(
1541 /*OUT*/ PNDIS_STATUS Status
,
1542 /*OUT*/ PNDIS_HANDLE PoolHandle
,
1543 /*IN*/ UINT NumberOfDescriptors
,
1544 /*IN*/ UINT ProtocolReservedLength
);
1550 /*OUT*/ PNDIS_STATUS Status
,
1551 /*OUT*/ PNDIS_BUFFER
*Buffer
,
1552 /*IN*/ NDIS_HANDLE PoolHandle
,
1553 /*IN*/ PVOID MemoryDescriptor
,
1555 /*IN*/ UINT Length
);
1560 NdisCopyFromPacketToPacket(
1561 /*IN*/ PNDIS_PACKET Destination
,
1562 /*IN*/ UINT DestinationOffset
,
1563 /*IN*/ UINT BytesToCopy
,
1564 /*IN*/ PNDIS_PACKET Source
,
1565 /*IN*/ UINT SourceOffset
,
1566 /*OUT*/ PUINT BytesCopied
);
1571 NdisDprAllocatePacket(
1572 /*OUT*/ PNDIS_STATUS Status
,
1573 /*OUT*/ PNDIS_PACKET
*Packet
,
1574 /*IN*/ NDIS_HANDLE PoolHandle
);
1579 NdisDprAllocatePacketNonInterlocked(
1580 /*OUT*/ PNDIS_STATUS Status
,
1581 /*OUT*/ PNDIS_PACKET
*Packet
,
1582 /*IN*/ NDIS_HANDLE PoolHandle
);
1588 /*IN*/ PNDIS_PACKET Packet
);
1593 NdisDprFreePacketNonInterlocked(
1594 /*IN*/ PNDIS_PACKET Packet
);
1600 /*IN*/ NDIS_HANDLE PoolHandle
);
1606 /*IN*/ PNDIS_PACKET Packet
);
1612 /*IN*/ NDIS_HANDLE PoolHandle
);
1618 /*IN*/ PNDIS_PACKET
*PacketsToReturn
,
1619 /*IN*/ UINT NumberOfPackets
);
1624 NdisUnchainBufferAtBack(
1625 /*IN OUT*/ PNDIS_PACKET Packet
,
1626 /*OUT*/ PNDIS_BUFFER
*Buffer
);
1631 NdisUnchainBufferAtFront(
1632 /*IN OUT*/ PNDIS_PACKET Packet
,
1633 /*OUT*/ PNDIS_BUFFER
*Buffer
);
1638 NdisAdjustBufferLength(
1639 /*IN*/ PNDIS_BUFFER Buffer
,
1640 /*IN*/ UINT Length
);
1646 /*IN*/ PNDIS_BUFFER Buffer
);
1651 NdisBufferVirtualAddress(
1652 /*IN*/ PNDIS_BUFFER Buffer
);
1657 NDIS_BUFFER_TO_SPAN_PAGES(
1658 /*IN*/ PNDIS_BUFFER Buffer
);
1664 /*IN*/ PNDIS_BUFFER Buffer
);
1669 NdisGetBufferPhysicalArraySize(
1670 /*IN*/ PNDIS_BUFFER Buffer
,
1671 /*OUT*/ PUINT ArraySize
);
1676 NdisGetFirstBufferFromPacket(
1677 /*IN*/ PNDIS_PACKET _Packet
,
1678 /*OUT*/ PNDIS_BUFFER
*_FirstBuffer
,
1679 /*OUT*/ PVOID
*_FirstBufferVA
,
1680 /*OUT*/ PUINT _FirstBufferLength
,
1681 /*OUT*/ PUINT _TotalBufferLength
);
1687 /*IN*/ PNDIS_BUFFER Buffer
,
1688 /*OUT*/ PVOID
*VirtualAddress
/*OPTIONAL*/,
1689 /*OUT*/ PUINT Length
);
1694 NdisQueryBufferOffset(
1695 /*IN*/ PNDIS_BUFFER Buffer
,
1696 /*OUT*/ PUINT Offset
,
1697 /*OUT*/ PUINT Length
);
1703 /*IN*/ PNDIS_BUFFER Buffer
);
1708 * NdisGetBufferPhysicalArraySize(
1709 * IN PNDIS_BUFFER Buffer,
1710 * OUT PUINT ArraySize);
1712 #define NdisGetBufferPhysicalArraySize(Buffer, \
1715 (*(ArraySize) = NDIS_BUFFER_TO_SPAN_PAGES(Buffer)) \
1721 * NdisGetFirstBufferFromPacket(
1722 * IN PNDIS_PACKET _Packet,
1723 * OUT PNDIS_BUFFER * _FirstBuffer,
1724 * OUT PVOID * _FirstBufferVA,
1725 * OUT PUINT _FirstBufferLength,
1726 * OUT PUINT _TotalBufferLength)
1728 #define NdisGetFirstBufferFromPacket(_Packet, \
1731 _FirstBufferLength, \
1732 _TotalBufferLength) \
1734 PNDIS_BUFFER _Buffer; \
1736 _Buffer = (_Packet)->Private.Head; \
1737 *(_FirstBuffer) = _Buffer; \
1738 if (_Buffer != NULL) \
1740 *(_FirstBufferVA) = MmGetSystemAddressForMdl(_Buffer); \
1741 *(_FirstBufferLength) = MmGetMdlByteCount(_Buffer); \
1742 _Buffer = _Buffer->Next; \
1743 *(_TotalBufferLength) = *(_FirstBufferLength); \
1744 while (_Buffer != NULL) { \
1745 *(_TotalBufferLength) += MmGetMdlByteCount(_Buffer); \
1746 _Buffer = _Buffer->Next; \
1751 *(_FirstBufferVA) = 0; \
1752 *(_FirstBufferLength) = 0; \
1753 *(_TotalBufferLength) = 0; \
1760 * IN PNDIS_BUFFER Buffer,
1761 * OUT PVOID *VirtualAddress OPTIONAL,
1764 #define NdisQueryBuffer(Buffer, \
1768 if (VirtualAddress) \
1769 *((PVOID*)VirtualAddress) = MmGetSystemAddressForMdl(Buffer); \
1771 *((PUINT)Length) = MmGetMdlByteCount(Buffer); \
1777 * NdisQueryBufferOffset(
1778 * IN PNDIS_BUFFER Buffer,
1780 * OUT PUINT Length);
1782 #define NdisQueryBufferOffset(Buffer, \
1786 *((PUINT)Offset) = MmGetMdlByteOffset(Buffer); \
1787 *((PUINT)Length) = MmGetMdlByteCount(Buffer); \
1793 * NDIS_BUFFER_LINKAGE(
1794 * IN PNDIS_BUFFER Buffer);
1796 #define NDIS_BUFFER_LINKAGE(Buffer)(Buffer)->Next;
1801 * NdisChainBufferAtBack(
1802 * IN OUT PNDIS_PACKET Packet,
1803 * IN OUT PNDIS_BUFFER Buffer)
1805 #define NdisChainBufferAtBack(Packet, \
1808 PNDIS_BUFFER NdisBuffer = (Buffer); \
1810 while (NdisBuffer->Next != NULL) \
1811 NdisBuffer = NdisBuffer->Next; \
1813 NdisBuffer->Next = NULL; \
1815 if ((Packet)->Private.Head != NULL) \
1816 (Packet)->Private.Tail->Next = (Buffer); \
1818 (Packet)->Private.Head = (Buffer); \
1820 (Packet)->Private.Tail = NdisBuffer; \
1821 (Packet)->Private.ValidCounts = FALSE; \
1827 * NdisChainBufferAtFront(
1828 * IN OUT PNDIS_PACKET Packet,
1829 * IN OUT PNDIS_BUFFER Buffer)
1831 #define NdisChainBufferAtFront(Packet, \
1834 PNDIS_BUFFER _NdisBuffer = (Buffer); \
1836 while (_NdisBuffer->Next != NULL) \
1837 _NdisBuffer = _NdisBuffer->Next; \
1839 if ((Packet)->Private.Head == NULL) \
1840 (Packet)->Private.Tail = _NdisBuffer; \
1842 _NdisBuffer->Next = (Packet)->Private.Head; \
1843 (Packet)->Private.Head = (Buffer); \
1844 (Packet)->Private.ValidCounts = FALSE; \
1850 * NdisGetNextBuffer(
1851 * IN PNDIS_BUFFER CurrentBuffer,
1852 * OUT PNDIS_BUFFER * NextBuffer)
1854 #define NdisGetNextBuffer(CurrentBuffer, \
1857 *(NextBuffer) = (CurrentBuffer)->Next; \
1863 * NdisGetPacketFlags(
1864 * IN PNDIS_PACKET Packet);
1866 #define NdisGetPacketFlags(Packet)(Packet)->Private.Flags;
1871 * NdisClearPacketFlags(
1872 * IN PNDIS_PACKET Packet,
1875 #define NdisClearPacketFlags(Packet, Flags) \
1876 (Packet)->Private.Flags &= ~(Flags)
1881 * NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO(
1882 * IN PNDIS_PACKET Packet,
1883 * IN PPVOID pMediaSpecificInfo,
1884 * IN PUINT pSizeMediaSpecificInfo);
1886 #define NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO(_Packet, \
1887 _pMediaSpecificInfo, \
1888 _pSizeMediaSpecificInfo) \
1890 if (!((_Packet)->Private.NdisPacketFlags & fPACKET_ALLOCATED_BY_NDIS) || \
1891 !((_Packet)->Private.NdisPacketFlags & fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO)) \
1893 *(_pMediaSpecificInfo) = NULL; \
1894 *(_pSizeMediaSpecificInfo) = 0; \
1898 *(_pMediaSpecificInfo) = ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
1899 (_Packet)->Private.NdisPacketOobOffset))->MediaSpecificInformation; \
1900 *(_pSizeMediaSpecificInfo) = ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
1901 (_Packet)->Private.NdisPacketOobOffset))->SizeMediaSpecificInfo; \
1908 * NDIS_GET_PACKET_PROTOCOL_TYPE(
1909 * IN PNDIS_PACKET Packet);
1911 #define NDIS_GET_PACKET_PROTOCOL_TYPE(_Packet) \
1912 ((_Packet)->Private.Flags & NDIS_PROTOCOL_ID_MASK)
1916 * NDIS_GET_PACKET_HEADER_SIZE(
1917 * IN PNDIS_PACKET Packet);
1919 #define NDIS_GET_PACKET_HEADER_SIZE(_Packet) \
1920 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
1921 (_Packet)->Private.NdisPacketOobOffset))->HeaderSize
1926 * NDIS_GET_PACKET_STATUS(
1927 * IN PNDIS_PACKET Packet);
1929 #define NDIS_GET_PACKET_STATUS(_Packet) \
1930 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
1931 (_Packet)->Private.NdisPacketOobOffset))->Status
1936 * NDIS_GET_PACKET_TIME_RECEIVED(
1937 * IN PNDIS_PACKET Packet);
1939 #define NDIS_GET_PACKET_TIME_RECEIVED(_Packet) \
1940 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
1941 (_Packet)->Private.NdisPacketOobOffset))->TimeReceived
1946 * NDIS_GET_PACKET_TIME_SENT(
1947 * IN PNDIS_PACKET Packet);
1949 #define NDIS_GET_PACKET_TIME_SENT(_Packet) \
1950 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
1951 (_Packet)->Private.NdisPacketOobOffset))->TimeSent
1956 * NDIS_GET_PACKET_TIME_TO_SEND(
1957 * IN PNDIS_PACKET Packet);
1959 #define NDIS_GET_PACKET_TIME_TO_SEND(_Packet) \
1960 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
1961 (_Packet)->Private.NdisPacketOobOffset))->TimeToSend
1965 * PNDIS_PACKET_OOB_DATA
1966 * NDIS_OOB_DATA_FROM_PACKET(
1967 * IN PNDIS_PACKET Packet);
1969 #define NDIS_OOB_DATA_FROM_PACKET(_Packet) \
1970 (PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
1971 (_Packet)->Private.NdisPacketOobOffset)
1977 * IN PNDIS_PACKET Packet,
1978 * OUT PUINT PhysicalBufferCount OPTIONAL,
1979 * OUT PUINT BufferCount OPTIONAL,
1980 * OUT PNDIS_BUFFER *FirstBuffer OPTIONAL,
1981 * OUT PUINT TotalPacketLength OPTIONAL);
1983 #define NdisQueryPacket(Packet, \
1984 PhysicalBufferCount, \
1987 TotalPacketLength) \
1990 *((PNDIS_BUFFER*)FirstBuffer) = (Packet)->Private.Head; \
1991 if ((TotalPacketLength) || (BufferCount) || (PhysicalBufferCount)) \
1993 if (!(Packet)->Private.ValidCounts) { \
1995 UINT _PacketLength; \
1996 PNDIS_BUFFER _NdisBuffer; \
1997 UINT _PhysicalBufferCount = 0; \
1998 UINT _TotalPacketLength = 0; \
2001 for (_NdisBuffer = (Packet)->Private.Head; \
2002 _NdisBuffer != (PNDIS_BUFFER)NULL; \
2003 _NdisBuffer = _NdisBuffer->Next) \
2005 _PhysicalBufferCount += NDIS_BUFFER_TO_SPAN_PAGES(_NdisBuffer); \
2006 NdisQueryBufferOffset(_NdisBuffer, &_Offset, &_PacketLength); \
2007 _TotalPacketLength += _PacketLength; \
2010 (Packet)->Private.PhysicalCount = _PhysicalBufferCount; \
2011 (Packet)->Private.TotalLength = _TotalPacketLength; \
2012 (Packet)->Private.Count = _Count; \
2013 (Packet)->Private.ValidCounts = TRUE; \
2016 if (PhysicalBufferCount) \
2017 *((PUINT)PhysicalBufferCount) = (Packet)->Private.PhysicalCount; \
2020 *((PUINT)BufferCount) = (Packet)->Private.Count; \
2022 if (TotalPacketLength) \
2023 *((PUINT)TotalPacketLength) = (Packet)->Private.TotalLength; \
2029 * NdisQueryPacketLength(
2030 * IN PNDIS_PACKET Packet,
2031 * OUT PUINT PhysicalBufferCount OPTIONAL,
2032 * OUT PUINT BufferCount OPTIONAL,
2033 * OUT PNDIS_BUFFER *FirstBuffer OPTIONAL,
2034 * OUT PUINT TotalPacketLength OPTIONAL);
2036 #define NdisQueryPacketLength(Packet, \
2037 TotalPacketLength) \
2039 if ((TotalPacketLength)) \
2041 if (!(Packet)->Private.ValidCounts) { \
2043 UINT _PacketLength; \
2044 PNDIS_BUFFER _NdisBuffer; \
2045 UINT _PhysicalBufferCount = 0; \
2046 UINT _TotalPacketLength = 0; \
2049 for (_NdisBuffer = (Packet)->Private.Head; \
2050 _NdisBuffer != (PNDIS_BUFFER)NULL; \
2051 _NdisBuffer = _NdisBuffer->Next) \
2053 _PhysicalBufferCount += NDIS_BUFFER_TO_SPAN_PAGES(_NdisBuffer); \
2054 NdisQueryBufferOffset(_NdisBuffer, &_Offset, &_PacketLength); \
2055 _TotalPacketLength += _PacketLength; \
2058 (Packet)->Private.PhysicalCount = _PhysicalBufferCount; \
2059 (Packet)->Private.TotalLength = _TotalPacketLength; \
2060 (Packet)->Private.Count = _Count; \
2061 (Packet)->Private.ValidCounts = TRUE; \
2064 if (TotalPacketLength) \
2065 *((PUINT)TotalPacketLength) = (Packet)->Private.TotalLength; \
2072 * NdisRecalculatePacketCounts(
2073 * IN OUT PNDIS_PACKET Packet);
2075 #define NdisRecalculatePacketCounts(Packet) \
2077 PNDIS_BUFFER _Buffer = (Packet)->Private.Head; \
2078 if (_Buffer != NULL) \
2080 while (_Buffer->Next != NULL) \
2082 ´_Buffer = _Buffer->Next; \
2084 (Packet)->Private.Tail = _Buffer; \
2086 (Packet)->Private.ValidCounts = FALSE; \
2092 * NdisReinitializePacket(
2093 * IN OUT PNDIS_PACKET Packet);
2095 #define NdisReinitializePacketCounts(Packet) \
2097 (Packet)->Private.Head = (PNDIS_BUFFER)NULL; \
2098 (Packet)->Private.ValidCounts = FALSE; \
2104 * NdisSetPacketFlags(
2105 * IN PNDIS_PACKET Packet,
2108 #define NdisSetPacketFlags(Packet, Flags) \
2109 (Packet)->Private.Flags |= (Flags);
2114 * NDIS_SET_PACKET_HEADER_SIZE(
2115 * IN PNDIS_PACKET Packet,
2118 #define NDIS_SET_PACKET_HEADER_SIZE(_Packet, _HdrSize) \
2119 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
2120 (_Packet)->Private.NdisPacketOobOffset))->HeaderSize = (_HdrSize)
2125 * NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO(
2126 * IN PNDIS_PACKET Packet,
2127 * IN PVOID MediaSpecificInfo,
2128 * IN UINT SizeMediaSpecificInfo);
2130 #define NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO(_Packet, \
2131 _MediaSpecificInfo, \
2132 _SizeMediaSpecificInfo) \
2134 if ((_Packet)->Private.NdisPacketFlags & fPACKET_ALLOCATED_BY_NDIS) \
2136 (_Packet)->Private.NdisPacketFlags |= fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO; \
2137 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
2138 (_Packet)->Private.NdisPacketOobOffset))->MediaSpecificInformation = \
2139 (_MediaSpecificInfo); \
2140 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
2141 (_Packet)->Private.NdisPacketOobOffset))->SizeMediaSpecificInfo = \
2142 (_SizeMediaSpecificInfo); \
2149 * NDIS_SET_PACKET_STATUS(
2150 * IN PNDIS_PACKET Packet,
2151 * IN NDIS_STATUS Status);
2153 #define NDIS_SET_PACKET_STATUS(_Packet, _Status) \
2154 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
2155 (_Packet)->Private.NdisPacketOobOffset))->Status = (_Status)
2160 * NDIS_SET_PACKET_TIME_RECEIVED(
2161 * IN PNDIS_PACKET Packet,
2162 * IN ULONGLONG TimeReceived);
2164 #define NDIS_SET_PACKET_TIME_RECEIVED(_Packet, _TimeReceived) \
2165 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
2166 (_Packet)->Private.NdisPacketOobOffset))->TimeReceived = (_TimeReceived)
2171 * NDIS_SET_PACKET_TIME_SENT(
2172 * IN PNDIS_PACKET Packet,
2173 * IN ULONGLONG TimeSent);
2175 #define NDIS_SET_PACKET_TIME_SENT(_Packet, _TimeSent) \
2176 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
2177 (_Packet)->Private.NdisPacketOobOffset))->TimeSent = (_TimeSent)
2182 * NDIS_SET_PACKET_TIME_TO_SEND(
2183 * IN PNDIS_PACKET Packet,
2184 * IN ULONGLONG TimeToSend);
2186 #define NDIS_SET_PACKET_TIME_TO_SEND(_Packet, _TimeToSend) \
2187 ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \
2188 (_Packet)->Private.NdisPacketOobOffset))->TimeToSend = (_TimeToSend)
2194 * IN PNDIS_PACKET Packet,
2197 #define NdisSetSendFlags(_Packet,_Flags)(_Packet)->Private.Flags = (_Flags)
2201 /* Memory management routines */
2205 * NdisCreateLookaheadBufferFromSharedMemory(
2206 * IN PVOID pSharedMemory,
2207 * IN UINT LookaheadLength,
2208 * OUT PVOID *pLookaheadBuffer)
2210 #define NdisCreateLookaheadBufferFromSharedMemory(_pSharedMemory, \
2212 _pLookaheadBuffer) \
2213 ((*(_pLookaheadBuffer)) = (_pSharedMemory))
2217 * NdisDestroyLookaheadBufferFromSharedMemory(
2218 * IN PVOID pLookaheadBuffer)
2220 #define NdisDestroyLookaheadBufferFromSharedMemory(_pLookaheadBuffer)
2226 * NdisMoveFromMappedMemory(
2227 * OUT PVOID Destination,
2231 #define NdisMoveFromMappedMemory(Destination, Source, Length) \
2232 NdisMoveMappedMemory(Destination, Source, Length)
2236 * NdisMoveMappedMemory(
2237 * OUT PVOID Destination,
2241 #define NdisMoveMappedMemory(Destination, Source, Length) \
2242 RtlCopyMemory(Destination, Source, Length)
2246 * NdisMoveToMappedMemory(
2247 * OUT PVOID Destination,
2251 #define NdisMoveToMappedMemory(Destination, Source, Length) \
2252 NdisMoveMappedMemory(Destination, Source, Length)
2258 * NdisMUpdateSharedMemory(
2259 * IN NDIS_HANDLE MiniportAdapterHandle,
2261 * IN PVOID VirtualAddress,
2262 * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
2264 #define NdisMUpdateSharedMemory(_H, _L, _V, _P) \
2265 NdisUpdateSharedMemory(_H, _L, _V, _P)
2271 /*OUT*/ PVOID
*VirtualAddress
,
2273 /*IN*/ UINT MemoryFlags
,
2274 /*IN*/ NDIS_PHYSICAL_ADDRESS HighestAcceptableAddress
);
2280 /*IN*/ PVOID VirtualAddress
,
2282 /*IN*/ UINT MemoryFlags
);
2287 NdisImmediateReadSharedMemory(
2288 /*IN*/ NDIS_HANDLE WrapperConfigurationContext
,
2289 /*IN*/ ULONG SharedMemoryAddress
,
2290 /*OUT*/ PUCHAR Buffer
,
2291 /*IN*/ ULONG Length
);
2296 NdisImmediateWriteSharedMemory(
2297 /*IN*/ NDIS_HANDLE WrapperConfigurationContext
,
2298 /*IN*/ ULONG SharedMemoryAddress
,
2299 /*IN*/ PUCHAR Buffer
,
2300 /*IN*/ ULONG Length
);
2305 NdisMAllocateSharedMemory(
2306 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
2307 /*IN*/ ULONG Length
,
2308 /*IN*/ BOOLEAN Cached
,
2309 /*OUT*/ PVOID
*VirtualAddress
,
2310 /*OUT*/ PNDIS_PHYSICAL_ADDRESS PhysicalAddress
);
2315 NdisMAllocateSharedMemoryAsync(
2316 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
2317 /*IN*/ ULONG Length
,
2318 /*IN*/ BOOLEAN Cached
,
2319 /*IN*/ PVOID Context
);
2323 #define NdisUpdateSharedMemory(NdisAdapterHandle, \
2333 NdisUpdateSharedMemory(
2334 /*IN*/ NDIS_HANDLE NdisAdapterHandle
,
2335 /*IN*/ ULONG Length
,
2336 /*IN*/ PVOID VirtualAddress
,
2337 /*IN*/ NDIS_PHYSICAL_ADDRESS PhysicalAddress
);
2339 #endif /* defined(NDIS50) */
2343 * NdisGetPhysicalAddressHigh(
2344 * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
2346 #define NdisGetPhysicalAddressHigh(PhysicalAddress) \
2347 ((PhysicalAddress).HighPart)
2351 * NdisSetPhysicalAddressHigh(
2352 * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
2355 #define NdisSetPhysicalAddressHigh(PhysicalAddress, Value) \
2356 ((PhysicalAddress).HighPart) = (Value)
2360 * NdisGetPhysicalAddressLow(
2361 * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
2363 #define NdisGetPhysicalAddressLow(PhysicalAddress) \
2364 ((PhysicalAddress).LowPart)
2369 * NdisSetPhysicalAddressLow(
2370 * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
2373 #define NdisSetPhysicalAddressLow(PhysicalAddress, Value) \
2374 ((PhysicalAddress).LowPart) = (Value)
2378 * NDIS_PHYSICAL_ADDRESS_CONST(
2382 #define NDIS_PHYSICAL_ADDRESS_CONST(Low, High) \
2383 { {(ULONG)(Low), (LONG)(High)} }
2388 * IN CONST VOID *Source1,
2389 * IN CONST VOID *Source2,
2392 #define NdisEqualMemory(Source1, Source2, Length) \
2393 RtlEqualMemory(Source1, Source2, Length)
2398 * IN PVOID Destination,
2402 #define NdisFillMemory(Destination, Length, Fill) \
2403 RtlFillMemory(Destination, Length, Fill)
2407 * NdisZeroMappedMemory(
2408 * IN PVOID Destination,
2411 #define NdisZeroMappedMemory(Destination, Length) \
2412 RtlZeroMemory(Destination, Length)
2417 * OUT PVOID Destination,
2421 #define NdisMoveMemory(Destination, Source, Length) \
2422 RtlCopyMemory(Destination, Source, Length)
2427 * NdisRetrieveUlong(
2428 * IN PULONG DestinationAddress,
2429 * IN PULONG SourceAddress);
2431 #define NdisRetrieveUlong(DestinationAddress, SourceAddress) \
2432 RtlRetrieveUlong(DestinationAddress, SourceAddress)
2438 * IN PULONG DestinationAddress,
2441 #define NdisStoreUlong(DestinationAddress, Value) \
2442 RtlStoreUlong(DestinationAddress, Value)
2448 * IN PVOID Destination,
2451 #define NdisZeroMemory(Destination, Length) \
2452 RtlZeroMemory(Destination, Length)
2456 /* Configuration routines */
2461 NdisOpenConfiguration(
2462 /*OUT*/ PNDIS_STATUS Status
,
2463 /*OUT*/ PNDIS_HANDLE ConfigurationHandle
,
2464 /*IN*/ NDIS_HANDLE WrapperConfigurationContext
);
2469 NdisReadNetworkAddress(
2470 /*OUT*/ PNDIS_STATUS Status
,
2471 /*OUT*/ PVOID
*NetworkAddress
,
2472 /*OUT*/ PUINT NetworkAddressLength
,
2473 /*IN*/ NDIS_HANDLE ConfigurationHandle
);
2478 NdisReadEisaSlotInformation(
2479 /*OUT*/ PNDIS_STATUS Status
,
2480 /*IN*/ NDIS_HANDLE WrapperConfigurationContext
,
2481 /*OUT*/ PUINT SlotNumber
,
2482 /*OUT*/ PNDIS_EISA_FUNCTION_INFORMATION EisaData
);
2487 NdisReadEisaSlotInformationEx(
2488 /*OUT*/ PNDIS_STATUS Status
,
2489 /*IN*/ NDIS_HANDLE WrapperConfigurationContext
,
2490 /*OUT*/ PUINT SlotNumber
,
2491 /*OUT*/ PNDIS_EISA_FUNCTION_INFORMATION
*EisaData
,
2492 /*OUT*/ PUINT NumberOfFunctions
);
2497 NdisReadPciSlotInformation(
2498 /*IN*/ NDIS_HANDLE NdisAdapterHandle
,
2499 /*IN*/ ULONG SlotNumber
,
2500 /*IN*/ ULONG Offset
,
2501 /*IN*/ PVOID Buffer
,
2502 /*IN*/ ULONG Length
);
2507 NdisWritePciSlotInformation(
2508 /*IN*/ NDIS_HANDLE NdisAdapterHandle
,
2509 /*IN*/ ULONG SlotNumber
,
2510 /*IN*/ ULONG Offset
,
2511 /*IN*/ PVOID Buffer
,
2512 /*IN*/ ULONG Length
);
2516 /* String management routines */
2521 NdisAnsiStringToUnicodeString(
2522 /*IN OUT*/ PNDIS_STRING DestinationString
,
2523 /*IN*/ PNDIS_ANSI_STRING SourceString
);
2528 * IN PNDIS_STRING String1,
2529 * IN PNDIS_STRING String2,
2530 * IN BOOLEAN CaseInsensitive);
2532 #define NdisEqualString(_String1, _String2, _CaseInsensitive) \
2533 RtlEqualUnicodeString(_String1, _String2, _CaseInsensitive)
2539 /*IN OUT*/ PNDIS_ANSI_STRING DestinationString
,
2540 /*IN*/ PCSTR SourceString
);
2545 NdisInitUnicodeString(
2546 /*IN OUT*/ PNDIS_STRING DestinationString
,
2547 /*IN*/ PCWSTR SourceString
);
2552 NdisUnicodeStringToAnsiString(
2553 /*IN OUT*/ PNDIS_ANSI_STRING DestinationString
,
2554 /*IN*/ PNDIS_STRING SourceString
);
2556 #define NdisFreeString(_s) NdisFreeMemory((_s).Buffer, (_s).MaximumLength, 0)
2557 #define NdisPrintString(_s) DbgPrint("%ls", (_s).Buffer)
2560 /* Spin lock reoutines */
2564 * NdisAllocateSpinLock(
2565 * IN PNDIS_SPIN_LOCK SpinLock);
2567 #define NdisAllocateSpinLock(_SpinLock) \
2568 KeInitializeSpinLock(&(_SpinLock)->SpinLock)
2573 * IN PNDIS_SPIN_LOCK SpinLock);
2575 #define NdisFreeSpinLock(_SpinLock)
2579 * NdisAcquireSpinLock(
2580 * IN PNDIS_SPIN_LOCK SpinLock);
2582 #define NdisAcquireSpinLock(_SpinLock) \
2583 KeAcquireSpinLock(&(_SpinLock)->SpinLock, &(_SpinLock)->OldIrql)
2587 * NdisReleaseSpinLock(
2588 * IN PNDIS_SPIN_LOCK SpinLock);
2590 #define NdisReleaseSpinLock(_SpinLock) \
2591 KeReleaseSpinLock(&(_SpinLock)->SpinLock, (_SpinLock)->OldIrql)
2595 * NdisDprAcquireSpinLock(
2596 * IN PNDIS_SPIN_LOCK SpinLock);
2598 #define NdisDprAcquireSpinLock(_SpinLock) \
2600 KeAcquireSpinLockAtDpcLevel(&(_SpinLock)->SpinLock); \
2601 (_SpinLock)->OldIrql = DISPATCH_LEVEL; \
2606 * NdisDprReleaseSpinLock(
2607 * IN PNDIS_SPIN_LOCK SpinLock);
2609 #define NdisDprReleaseSpinLock(_SpinLock) \
2610 KeReleaseSpinLockFromDpcLevel(&(_SpinLock)->SpinLock)
2618 * NdisRawReadPortBufferUchar(
2620 * OUT PUCHAR Buffer,
2623 #define NdisRawReadPortBufferUchar(Port, Buffer, Length) \
2624 READ_PORT_BUFFER_UCHAR((PUCHAR)(Port), (PUCHAR)(Buffer), (Length))
2628 * NdisRawReadPortBufferUlong(
2630 * OUT PULONG Buffer,
2633 #define NdisRawReadPortBufferUlong(Port, Buffer, Length) \
2634 READ_PORT_BUFFER_ULONG((PULONG)(Port), (PULONG)(Buffer), (Length))
2638 * NdisRawReadPortBufferUshort(
2640 * OUT PUSHORT Buffer,
2643 #define NdisRawReadPortBufferUshort(Port, Buffer, Length) \
2644 READ_PORT_BUFFER_USHORT((PUSHORT)(Port), (PUSHORT)(Buffer), (Length))
2649 * NdisRawReadPortUchar(
2653 #define NdisRawReadPortUchar(Port, Data) \
2654 *(Data) = READ_PORT_UCHAR((PUCHAR)(Port))
2658 * NdisRawReadPortUlong(
2662 #define NdisRawReadPortUlong(Port, Data) \
2663 *(Data) = READ_PORT_ULONG((PULONG)(Port))
2667 * NdisRawReadPortUshort(
2669 * OUT PUSHORT Data);
2671 #define NdisRawReadPortUshort(Port, Data) \
2672 *(Data) = READ_PORT_USHORT((PUSHORT)(Port))
2677 * NdisRawWritePortBufferUchar(
2682 #define NdisRawWritePortBufferUchar(Port, Buffer, Length) \
2683 WRITE_PORT_BUFFER_UCHAR((PUCHAR)(Port), (PUCHAR)(Buffer), (Length))
2687 * NdisRawWritePortBufferUlong(
2692 #define NdisRawWritePortBufferUlong(Port, Buffer, Length) \
2693 WRITE_PORT_BUFFER_ULONG((PULONG)(Port), (PULONG)(Buffer), (Length))
2697 * NdisRawWritePortBufferUshort(
2699 * IN PUSHORT Buffer,
2702 #define NdisRawWritePortBufferUshort(Port, Buffer, Length) \
2703 WRITE_PORT_BUFFER_USHORT((PUSHORT)(Port), (PUSHORT)(Buffer), (Length))
2708 * NdisRawWritePortUchar(
2712 #define NdisRawWritePortUchar(Port, Data) \
2713 WRITE_PORT_UCHAR((PUCHAR)(Port), (UCHAR)(Data))
2717 * NdisRawWritePortUlong(
2721 #define NdisRawWritePortUlong(Port, Data) \
2722 WRITE_PORT_ULONG((PULONG)(Port), (ULONG)(Data))
2726 * NdisRawWritePortUshort(
2730 #define NdisRawWritePortUshort(Port, Data) \
2731 WRITE_PORT_USHORT((PUSHORT)(Port), (USHORT)(Data))
2736 * NdisReadRegisterUchar(
2737 * IN PUCHAR Register,
2740 #define NdisReadRegisterUchar(Register, Data) \
2741 *(Data) = *(Register)
2745 * NdisReadRegisterUlong(
2746 * IN PULONG Register,
2749 #define NdisReadRegisterUlong(Register, Data) \
2750 *(Data) = *(Register)
2754 * NdisReadRegisterUshort(
2755 * IN PUSHORT Register,
2756 * OUT PUSHORT Data);
2758 #define NdisReadRegisterUshort(Register, Data) \
2759 *(Data) = *(Register)
2763 * NdisReadRegisterUchar(
2764 * IN PUCHAR Register,
2767 #define NdisWriteRegisterUchar(Register, Data) \
2768 WRITE_REGISTER_UCHAR((Register), (Data))
2772 * NdisReadRegisterUlong(
2773 * IN PULONG Register,
2776 #define NdisWriteRegisterUlong(Register, Data) \
2777 WRITE_REGISTER_ULONG((Register), (Data))
2781 * NdisReadRegisterUshort(
2782 * IN PUSHORT Register,
2785 #define NdisWriteRegisterUshort(Register, Data) \
2786 WRITE_REGISTER_USHORT((Register), (Data))
2793 * NdisInitializeListHead(
2794 * IN PLIST_ENTRY ListHead);
2796 #define NdisInitializeListHead(_ListHead) \
2797 InitializeListHead(_ListHead)
2801 * NdisInterlockedInsertHeadList(
2802 * IN PLIST_ENTRY ListHead,
2803 * IN PLIST_ENTRY ListEntry,
2804 * IN PNDIS_SPIN_LOCK SpinLock);
2806 #define NdisInterlockedInsertHeadList(_ListHead, _ListEntry, _SpinLock) \
2807 ExInterlockedInsertHeadList(_ListHead, _ListEntry, &(_SpinLock)->SpinLock)
2811 * NdisInterlockedInsertTailList(
2812 * IN PLIST_ENTRY ListHead,
2813 * IN PLIST_ENTRY ListEntry,
2814 * IN PNDIS_SPIN_LOCK SpinLock);
2816 #define NdisInterlockedInsertTailList(_ListHead, _ListEntry, _SpinLock) \
2817 ExInterlockedInsertTailList(_ListHead, _ListEntry, &(_SpinLock)->SpinLock)
2821 * NdisInterlockedRemoveHeadList(
2822 * IN PLIST_ENTRY ListHead,
2823 * IN PNDIS_SPIN_LOCK SpinLock);
2825 #define NdisInterlockedRemoveHeadList(_ListHead, _SpinLock) \
2826 ExInterlockedRemoveHeadList(_ListHead, &(_SpinLock)->SpinLock)
2830 * NdisInitializeSListHead(
2831 * IN PSLIST_HEADER SListHead);
2833 #define NdisInitializeSListHead(SListHead) ExInitializeSListHead(SListHead)
2836 * USHORT NdisQueryDepthSList(
2837 * IN PSLIST_HEADER SListHead);
2839 #define NdisQueryDepthSList(SListHead) ExQueryDepthSList(SListHead)
2843 /* Interlocked routines */
2847 * NdisInterlockedDecrement(
2850 #define NdisInterlockedDecrement(Addend) InterlockedDecrement(Addend)
2854 * NdisInterlockedIncrement(
2857 #define NdisInterlockedIncrement(Addend) InterlockedIncrement(Addend)
2861 * NdisInterlockedAddUlong(
2863 * IN ULONG Increment,
2864 * IN PNDIS_SPIN_LOCK SpinLock);
2866 #define NdisInterlockedAddUlong(_Addend, _Increment, _SpinLock) \
2867 ExInterlockedAddUlong(_Addend, _Increment, &(_SpinLock)->SpinLock)
2871 /* Miscellaneous routines */
2876 NdisCloseConfiguration(
2877 /*IN*/ NDIS_HANDLE ConfigurationHandle
);
2882 NdisReadConfiguration(
2883 /*OUT*/ PNDIS_STATUS Status
,
2884 /*OUT*/ PNDIS_CONFIGURATION_PARAMETER
*ParameterValue
,
2885 /*IN*/ NDIS_HANDLE ConfigurationHandle
,
2886 /*IN*/ PNDIS_STRING Keyword
,
2887 /*IN*/ NDIS_PARAMETER_TYPE ParameterType
);
2892 NdisWriteConfiguration(
2893 /*OUT*/ PNDIS_STATUS Status
,
2894 /*IN*/ NDIS_HANDLE WrapperConfigurationContext
,
2895 /*IN*/ PNDIS_STRING Keyword
,
2896 /*IN*/ PNDIS_CONFIGURATION_PARAMETER
*ParameterValue
);
2901 NdisWriteErrorLogEntry(
2902 /*IN*/ NDIS_HANDLE NdisAdapterHandle
,
2903 /*IN*/ NDIS_ERROR_CODE ErrorCode
,
2904 /*IN*/ ULONG NumberOfErrorValues
,
2909 * NdisStallExecution(
2910 * IN UINT MicrosecondsToStall)
2912 #define NdisStallExecution KeStallExecutionProcessor
2916 * NdisGetCurrentSystemTime(
2917 * IN PLARGE_INTEGER pSystemTime);
2919 #define NdisGetCurrentSystemTime KeQuerySystemTime
2924 NdisGetCurrentProcessorCpuUsage(
2925 /*OUT*/ PULONG pCpuUsage
);
2929 /* NDIS helper macros */
2933 * NDIS_INIT_FUNCTION(FunctionName)
2935 #define NDIS_INIT_FUNCTION(FunctionName) \
2936 alloc_text(init, FunctionName)
2940 * NDIS_PAGABLE_FUNCTION(FunctionName)
2942 #define NDIS_PAGEABLE_FUNCTION(FunctionName) \
2943 alloc_text(page, FunctionName)
2945 #define NDIS_PAGABLE_FUNCTION NDIS_PAGEABLE_FUNCTION
2948 /* NDIS 4.0 extensions */
2953 NdisMFreeSharedMemory(
2954 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
2955 /*IN*/ ULONG Length
,
2956 /*IN*/ BOOLEAN Cached
,
2957 /*IN*/ PVOID VirtualAddress
,
2958 /*IN*/ NDIS_PHYSICAL_ADDRESS PhysicalAddress
);
2963 NdisMWanIndicateReceive(
2964 /*OUT*/ PNDIS_STATUS Status
,
2965 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
2966 /*IN*/ NDIS_HANDLE NdisLinkContext
,
2967 /*IN*/ PUCHAR PacketBuffer
,
2968 /*IN*/ UINT PacketSize
);
2973 NdisMWanIndicateReceiveComplete(
2974 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
);
2979 NdisMWanSendComplete(
2980 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
2981 /*IN*/ PNDIS_WAN_PACKET Packet
,
2982 /*IN*/ NDIS_STATUS Status
);
2987 NdisPciAssignResources(
2988 /*IN*/ NDIS_HANDLE NdisMacHandle
,
2989 /*IN*/ NDIS_HANDLE NdisWrapperHandle
,
2990 /*IN*/ NDIS_HANDLE WrapperConfigurationContext
,
2991 /*IN*/ ULONG SlotNumber
,
2992 /*OUT*/ PNDIS_RESOURCE_LIST
*AssignedResources
);
2995 /* NDIS 5.0 extensions */
3000 NdisAcquireReadWriteLock(
3001 /*IN*/ PNDIS_RW_LOCK Lock
,
3002 /*IN*/ BOOLEAN fWrite
,
3003 /*IN*/ PLOCK_STATE LockState
);
3008 NdisAllocateMemoryWithTag(
3009 /*OUT*/ PVOID
*VirtualAddress
,
3016 NdisAllocatePacketPoolEx(
3017 /*OUT*/ PNDIS_STATUS Status
,
3018 /*OUT*/ PNDIS_HANDLE PoolHandle
,
3019 /*IN*/ UINT NumberOfDescriptors
,
3020 /*IN*/ UINT NumberOfOverflowDescriptors
,
3021 /*IN*/ UINT ProtocolReservedLength
);
3026 NdisCompletePnPEvent(
3027 /*IN*/ NDIS_STATUS Status
,
3028 /*IN*/ NDIS_HANDLE NdisBindingHandle
,
3029 /*IN*/ PNET_PNP_EVENT NetPnPEvent
);
3034 NdisGetCurrentProcessorCounts(
3035 /*OUT*/ PULONG pIdleCount
,
3036 /*OUT*/ PULONG pKernelAndUser
,
3037 /*OUT*/ PULONG pIndex
);
3042 NdisGetDriverHandle(
3043 /*IN*/ PNDIS_HANDLE NdisBindingHandle
,
3044 /*OUT*/ PNDIS_HANDLE NdisDriverHandle
);
3049 NdisGetReceivedPacket(
3050 /*IN*/ PNDIS_HANDLE NdisBindingHandle
,
3051 /*IN*/ PNDIS_HANDLE MacContext
);
3056 NdisGetSystemUptime(
3057 /*OUT*/ PULONG pSystemUpTime
);
3062 NdisInitializeReadWriteLock(
3063 /*IN*/ PNDIS_RW_LOCK Lock
);
3068 NdisMDeregisterDevice(
3069 /*IN*/ NDIS_HANDLE NdisDeviceHandle
);
3074 NdisMGetDeviceProperty(
3075 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
3076 /*IN OUT*/ PDEVICE_OBJECT
*PhysicalDeviceObject
/*OPTIONAL*/,
3077 /*IN OUT*/ PDEVICE_OBJECT
*FunctionalDeviceObject
/*OPTIONAL*/,
3078 /*IN OUT*/ PDEVICE_OBJECT
*NextDeviceObject
/*OPTIONAL*/,
3079 /*IN OUT*/ PCM_RESOURCE_LIST
*AllocatedResources
/*OPTIONAL*/,
3080 /*IN OUT*/ PCM_RESOURCE_LIST
*AllocatedResourcesTranslated
/*OPTIONAL*/);
3085 NdisMInitializeScatterGatherDma(
3086 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
3087 /*IN*/ BOOLEAN Dma64BitAddresses
,
3088 /*IN*/ ULONG MaximumPhysicalMapping
);
3093 NdisMPromoteMiniport(
3094 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
);
3099 NdisMQueryAdapterInstanceName(
3100 /*OUT*/ PNDIS_STRING AdapterInstanceName
,
3101 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
);
3106 NdisMRegisterDevice(
3107 /*IN*/ NDIS_HANDLE NdisWrapperHandle
,
3108 /*IN*/ PNDIS_STRING DeviceName
,
3109 /*IN*/ PNDIS_STRING SymbolicName
,
3110 /*IN*/ PDRIVER_DISPATCH MajorFunctions
[],
3111 /*OUT*/ PDEVICE_OBJECT
*pDeviceObject
,
3112 /*OUT*/ NDIS_HANDLE
*NdisDeviceHandle
);
3117 NdisMRegisterUnloadHandler(
3118 /*IN*/ NDIS_HANDLE NdisWrapperHandle
,
3119 /*IN*/ PDRIVER_UNLOAD UnloadHandler
);
3124 NdisMRemoveMiniport(
3125 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
);
3130 NdisMSetMiniportSecondary(
3131 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
3132 /*IN*/ NDIS_HANDLE PrimaryMiniportAdapterHandle
);
3137 NdisOpenConfigurationKeyByIndex(
3138 /*OUT*/ PNDIS_STATUS Status
,
3139 /*IN*/ NDIS_HANDLE ConfigurationHandle
,
3141 /*OUT*/ PNDIS_STRING KeyName
,
3142 /*OUT*/ PNDIS_HANDLE KeyHandle
);
3147 NdisOpenConfigurationKeyByName(
3148 /*OUT*/ PNDIS_STATUS Status
,
3149 /*IN*/ NDIS_HANDLE ConfigurationHandle
,
3150 /*IN*/ PNDIS_STRING SubKeyName
,
3151 /*OUT*/ PNDIS_HANDLE SubKeyHandle
);
3156 NdisPacketPoolUsage(
3157 /*IN*/ NDIS_HANDLE PoolHandle
);
3162 NdisQueryAdapterInstanceName(
3163 /*OUT*/ PNDIS_STRING AdapterInstanceName
,
3164 /*IN*/ NDIS_HANDLE NdisBindingHandle
);
3169 NdisReadPcmciaAttributeMemory(
3170 /*IN*/ NDIS_HANDLE NdisAdapterHandle
,
3171 /*IN*/ ULONG Offset
,
3172 /*IN*/ PVOID Buffer
,
3173 /*IN*/ ULONG Length
);
3178 NdisReleaseReadWriteLock(
3179 /*IN*/ PNDIS_RW_LOCK Lock
,
3180 /*IN*/ PLOCK_STATE LockState
);
3185 NdisWriteEventLogEntry(
3186 /*IN*/ PVOID LogHandle
,
3187 /*IN*/ NDIS_STATUS EventCode
,
3188 /*IN*/ ULONG UniqueEventValue
,
3189 /*IN*/ USHORT NumStrings
,
3190 /*IN*/ PVOID StringsList
/*OPTIONAL*/,
3191 /*IN*/ ULONG DataSize
,
3192 /*IN*/ PVOID Data
/*OPTIONAL*/);
3197 NdisWritePcmciaAttributeMemory(
3198 /*IN*/ NDIS_HANDLE NdisAdapterHandle
,
3199 /*IN*/ ULONG Offset
,
3200 /*IN*/ PVOID Buffer
,
3201 /*IN*/ ULONG Length
);
3204 /* Connectionless services */
3210 /*IN*/ NDIS_HANDLE NdisVcHandle
,
3211 /*IN*/ NDIS_HANDLE ProtocolPartyContext
,
3212 /*IN OUT*/ PCO_CALL_PARAMETERS CallParameters
,
3213 /*OUT*/ PNDIS_HANDLE NdisPartyHandle
);
3218 NdisClCloseAddressFamily(
3219 /*IN*/ NDIS_HANDLE NdisAfHandle
);
3225 /*IN*/ NDIS_HANDLE NdisVcHandle
,
3226 /*IN*/ NDIS_HANDLE NdisPartyHandle
/*OPTIONAL*/,
3227 /*IN*/ PVOID Buffer
/*OPTIONAL*/,
3233 NdisClDeregisterSap(
3234 /*IN*/ NDIS_HANDLE NdisSapHandle
);
3240 /*IN*/ NDIS_HANDLE NdisPartyHandle
,
3241 /*IN*/ PVOID Buffer
/*OPTIONAL*/,
3247 NdisClIncomingCallComplete(
3248 /*IN*/ NDIS_STATUS Status
,
3249 /*IN*/ NDIS_HANDLE NdisVcHandle
,
3250 /*IN*/ PCO_CALL_PARAMETERS CallParameters
);
3256 /*IN*/ NDIS_HANDLE NdisVcHandle
,
3257 /*IN OUT*/ PCO_CALL_PARAMETERS CallParameters
,
3258 /*IN*/ NDIS_HANDLE ProtocolPartyContext
/*OPTIONAL*/,
3259 /*OUT*/ PNDIS_HANDLE NdisPartyHandle
/*OPTIONAL*/);
3264 NdisClModifyCallQoS(
3265 /*IN*/ NDIS_HANDLE NdisVcHandle
,
3266 /*IN*/ PCO_CALL_PARAMETERS CallParameters
);
3272 NdisClOpenAddressFamily(
3273 /*IN*/ NDIS_HANDLE NdisBindingHandle
,
3274 /*IN*/ PCO_ADDRESS_FAMILY AddressFamily
,
3275 /*IN*/ NDIS_HANDLE ProtocolAfContext
,
3276 /*IN*/ PNDIS_CLIENT_CHARACTERISTICS ClCharacteristics
,
3277 /*IN*/ UINT SizeOfClCharacteristics
,
3278 /*OUT*/ PNDIS_HANDLE NdisAfHandle
);
3284 /*IN*/ NDIS_HANDLE NdisAfHandle
,
3285 /*IN*/ NDIS_HANDLE ProtocolSapContext
,
3287 /*OUT*/ PNDIS_HANDLE NdisSapHandle
);
3290 /* Call Manager services */
3296 /*IN*/ NDIS_HANDLE NdisVcHandle
,
3297 /*IN OUT*/ PCO_CALL_PARAMETERS CallParameters
);
3302 NdisCmAddPartyComplete(
3303 /*IN*/ NDIS_STATUS Status
,
3304 /*IN*/ NDIS_HANDLE NdisPartyHandle
,
3305 /*IN*/ NDIS_HANDLE CallMgrPartyContext
/*OPTIONAL*/,
3306 /*IN*/ PCO_CALL_PARAMETERS CallParameters
);
3311 NdisCmCloseAddressFamilyComplete(
3312 /*IN*/ NDIS_STATUS Status
,
3313 /*IN*/ NDIS_HANDLE NdisAfHandle
);
3318 NdisCmCloseCallComplete(
3319 /*IN*/ NDIS_STATUS Status
,
3320 /*IN*/ NDIS_HANDLE NdisVcHandle
,
3321 /*IN*/ NDIS_HANDLE NdisPartyHandle
/*OPTIONAL*/);
3327 /*IN*/ NDIS_HANDLE NdisVcHandle
);
3332 NdisCmDeregisterSapComplete(
3333 /*IN*/ NDIS_STATUS Status
,
3334 /*IN*/ NDIS_HANDLE NdisSapHandle
);
3339 NdisCmDispatchCallConnected(
3340 /*IN*/ NDIS_HANDLE NdisVcHandle
);
3345 NdisCmDispatchIncomingCall(
3346 /*IN*/ NDIS_HANDLE NdisSapHandle
,
3347 /*IN*/ NDIS_HANDLE NdisVcHandle
,
3348 /*IN*/ PCO_CALL_PARAMETERS CallParameters
);
3353 NdisCmDispatchIncomingCallQoSChange(
3354 /*IN*/ NDIS_HANDLE NdisVcHandle
,
3355 /*IN*/ PCO_CALL_PARAMETERS CallParameters
);
3360 NdisCmDispatchIncomingCloseCall(
3361 /*IN*/ NDIS_STATUS CloseStatus
,
3362 /*IN*/ NDIS_HANDLE NdisVcHandle
,
3363 /*IN*/ PVOID Buffer
/*OPTIONAL*/,
3369 NdisCmDispatchIncomingDropParty(
3370 /*IN*/ NDIS_STATUS DropStatus
,
3371 /*IN*/ NDIS_HANDLE NdisPartyHandle
,
3372 /*IN*/ PVOID Buffer
/*OPTIONAL*/,
3378 NdisCmDropPartyComplete(
3379 /*IN*/ NDIS_STATUS Status
,
3380 /*IN*/ NDIS_HANDLE NdisPartyHandle
);
3385 NdisCmMakeCallComplete(
3386 /*IN*/ NDIS_STATUS Status
,
3387 /*IN*/ NDIS_HANDLE NdisVcHandle
,
3388 /*IN*/ NDIS_HANDLE NdisPartyHandle
/*OPTIONAL*/,
3389 /*IN*/ NDIS_HANDLE CallMgrPartyContext
/*OPTIONAL*/,
3390 /*IN*/ PCO_CALL_PARAMETERS CallParameters
);
3395 NdisCmModifyCallQoSComplete(
3396 /*IN*/ NDIS_STATUS Status
,
3397 /*IN*/ NDIS_HANDLE NdisVcHandle
,
3398 /*IN*/ PCO_CALL_PARAMETERS CallParameters
);
3403 NdisCmOpenAddressFamilyComplete(
3404 /*IN*/ NDIS_STATUS Status
,
3405 /*IN*/ NDIS_HANDLE NdisAfHandle
,
3406 /*IN*/ NDIS_HANDLE CallMgrAfContext
);
3411 NdisCmRegisterAddressFamily(
3412 /*IN*/ NDIS_HANDLE NdisBindingHandle
,
3413 /*IN*/ PCO_ADDRESS_FAMILY AddressFamily
,
3414 /*IN*/ PNDIS_CALL_MANAGER_CHARACTERISTICS CmCharacteristics
,
3415 /*IN*/ UINT SizeOfCmCharacteristics
);
3420 NdisCmRegisterSapComplete(
3421 /*IN*/ NDIS_STATUS Status
,
3422 /*IN*/ NDIS_HANDLE NdisSapHandle
,
3423 /*IN*/ NDIS_HANDLE CallMgrSapContext
);
3430 /*IN*/ NDIS_HANDLE NdisVcHandle
,
3431 /*IN*/ PCO_CALL_PARAMETERS CallParameters
);
3437 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
3438 /*IN*/ NDIS_HANDLE NdisAfHandle
,
3439 /*IN*/ NDIS_HANDLE MiniportVcContext
,
3440 /*OUT*/ PNDIS_HANDLE NdisVcHandle
);
3445 NdisMCmDeactivateVc(
3446 /*IN*/ NDIS_HANDLE NdisVcHandle
);
3452 /*IN*/ NDIS_HANDLE NdisVcHandle
);
3457 NdisMCmRegisterAddressFamily(
3458 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
3459 /*IN*/ PCO_ADDRESS_FAMILY AddressFamily
,
3460 /*IN*/ PNDIS_CALL_MANAGER_CHARACTERISTICS CmCharacteristics
,
3461 /*IN*/ UINT SizeOfCmCharacteristics
);
3467 /*IN*/ NDIS_HANDLE NdisAfHandle
,
3468 /*IN*/ NDIS_HANDLE NdisVcHandle
/*OPTIONAL*/,
3469 /*IN*/ NDIS_HANDLE NdisPartyHandle
/*OPTIONAL*/,
3470 /*IN OUT*/ PNDIS_REQUEST NdisRequest
);
3473 /* Connection-oriented services */
3479 /*IN*/ NDIS_HANDLE NdisBindingHandle
,
3480 /*IN*/ NDIS_HANDLE NdisAfHandle
/*OPTIONAL*/,
3481 /*IN*/ NDIS_HANDLE ProtocolVcContext
,
3482 /*IN OUT*/ PNDIS_HANDLE NdisVcHandle
);
3488 /*IN*/ NDIS_HANDLE NdisVcHandle
);
3494 /*IN*/ NDIS_HANDLE NdisBindingHandle
,
3495 /*IN*/ NDIS_HANDLE NdisAfHandle
/*OPTIONAL*/,
3496 /*IN*/ NDIS_HANDLE NdisVcHandle
/*OPTIONAL*/,
3497 /*IN*/ NDIS_HANDLE NdisPartyHandle
/*OPTIONAL*/,
3498 /*IN OUT*/ PNDIS_REQUEST NdisRequest
);
3503 NdisCoRequestComplete(
3504 /*IN*/ NDIS_STATUS Status
,
3505 /*IN*/ NDIS_HANDLE NdisAfHandle
,
3506 /*IN*/ NDIS_HANDLE NdisVcHandle
/*OPTIONAL*/,
3507 /*IN*/ NDIS_HANDLE NdisPartyHandle
/*OPTIONAL*/,
3508 /*IN*/ PNDIS_REQUEST NdisRequest
);
3514 /*IN*/ NDIS_HANDLE NdisVcHandle
,
3515 /*IN*/ PPNDIS_PACKET PacketArray
,
3516 /*IN*/ UINT NumberOfPackets
);
3521 NdisMCoActivateVcComplete(
3522 /*IN*/ NDIS_STATUS Status
,
3523 /*IN*/ NDIS_HANDLE NdisVcHandle
,
3524 /*IN*/ PCO_CALL_PARAMETERS CallParameters
);
3529 NdisMCoDeactivateVcComplete(
3530 /*IN*/ NDIS_STATUS Status
,
3531 /*IN*/ NDIS_HANDLE NdisVcHandle
);
3536 NdisMCoIndicateReceivePacket(
3537 /*IN*/ NDIS_HANDLE NdisVcHandle
,
3538 /*IN*/ PPNDIS_PACKET PacketArray
,
3539 /*IN*/ UINT NumberOfPackets
);
3544 NdisMCoIndicateStatus(
3545 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
3546 /*IN*/ NDIS_HANDLE NdisVcHandle
/*OPTIONAL*/,
3547 /*IN*/ NDIS_STATUS GeneralStatus
,
3548 /*IN*/ PVOID StatusBuffer
/*OPTIONAL*/,
3549 /*IN*/ ULONG StatusBufferSize
);
3554 NdisMCoReceiveComplete(
3555 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
);
3560 NdisMCoRequestComplete(
3561 /*IN*/ NDIS_STATUS Status
,
3562 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
3563 /*IN*/ PNDIS_REQUEST Request
);
3568 NdisMCoSendComplete(
3569 /*IN*/ NDIS_STATUS Status
,
3570 /*IN*/ NDIS_HANDLE NdisVcHandle
,
3571 /*IN*/ PNDIS_PACKET Packet
);
3574 /* NDIS 5.0 extensions for intermediate drivers */
3579 NdisIMAssociateMiniport(
3580 /*IN*/ NDIS_HANDLE DriverHandle
,
3581 /*IN*/ NDIS_HANDLE ProtocolHandle
);
3586 NdisIMCancelInitializeDeviceInstance(
3587 /*IN*/ NDIS_HANDLE DriverHandle
,
3588 /*IN*/ PNDIS_STRING DeviceInstance
);
3593 NdisIMCopySendCompletePerPacketInfo(
3594 /*IN*/ PNDIS_PACKET DstPacket
,
3595 /*IN*/ PNDIS_PACKET SrcPacket
);
3600 NdisIMCopySendPerPacketInfo(
3601 /*IN*/ PNDIS_PACKET DstPacket
,
3602 /*IN*/ PNDIS_PACKET SrcPacket
);
3607 NdisIMDeregisterLayeredMiniport(
3608 /*IN*/ NDIS_HANDLE DriverHandle
);
3613 NdisIMGetBindingContext(
3614 /*IN*/ NDIS_HANDLE NdisBindingHandle
);
3619 NdisIMGetDeviceContext(
3620 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
);
3625 NdisIMInitializeDeviceInstanceEx(
3626 /*IN*/ NDIS_HANDLE DriverHandle
,
3627 /*IN*/ PNDIS_STRING DriverInstance
,
3628 /*IN*/ NDIS_HANDLE DeviceContext
/*OPTIONAL*/);
3633 NdisInterlockedPopEntrySList(
3634 /*IN*/ PSLIST_HEADER ListHead
,
3635 /*IN*/ PKSPIN_LOCK Lock
);
3640 NdisInterlockedPushEntrySList(
3641 /*IN*/ PSLIST_HEADER ListHead
,
3642 /*IN*/ PSINGLE_LIST_ENTRY ListEntry
,
3643 /*IN*/ PKSPIN_LOCK Lock
);
3648 NdisQueryBufferSafe(
3649 /*IN*/ PNDIS_BUFFER Buffer
,
3650 /*OUT*/ PVOID
*VirtualAddress
/*OPTIONAL*/,
3651 /*OUT*/ PUINT Length
,
3652 /*IN*/ UINT Priority
);
3655 /* Prototypes for NDIS_MINIPORT_CHARACTERISTICS */
3657 typedef BOOLEAN DDKAPI
3658 (*W_CHECK_FOR_HANG_HANDLER
)(
3659 /*IN*/ NDIS_HANDLE MiniportAdapterContext
);
3662 (*W_DISABLE_INTERRUPT_HANDLER
)(
3663 /*IN*/ NDIS_HANDLE MiniportAdapterContext
);
3666 (*W_ENABLE_INTERRUPT_HANDLER
)(
3667 /*IN*/ NDIS_HANDLE MiniportAdapterContext
);
3671 /*IN*/ NDIS_HANDLE MiniportAdapterContext
);
3674 (*W_HANDLE_INTERRUPT_HANDLER
)(
3675 /*IN*/ NDIS_HANDLE MiniportAdapterContext
);
3677 typedef NDIS_STATUS DDKAPI
3678 (*W_INITIALIZE_HANDLER
)(
3679 /*OUT*/ PNDIS_STATUS OpenErrorStatus
,
3680 /*OUT*/ PUINT SelectedMediumIndex
,
3681 /*IN*/ PNDIS_MEDIUM MediumArray
,
3682 /*IN*/ UINT MediumArraySize
,
3683 /*IN*/ NDIS_HANDLE MiniportAdapterContext
,
3684 /*IN*/ NDIS_HANDLE WrapperConfigurationContext
);
3688 /*OUT*/ PBOOLEAN InterruptRecognized
,
3689 /*OUT*/ PBOOLEAN QueueMiniportHandleInterrupt
,
3690 /*IN*/ NDIS_HANDLE MiniportAdapterContext
);
3692 typedef NDIS_STATUS DDKAPI
3693 (*W_QUERY_INFORMATION_HANDLER
)(
3694 /*IN*/ NDIS_HANDLE MiniportAdapterContext
,
3695 /*IN*/ NDIS_OID Oid
,
3696 /*IN*/ PVOID InformationBuffer
,
3697 /*IN*/ ULONG InformationBufferLength
,
3698 /*OUT*/ PULONG BytesWritten
,
3699 /*OUT*/ PULONG BytesNeeded
);
3701 typedef NDIS_STATUS DDKAPI
3702 (*W_RECONFIGURE_HANDLER
)(
3703 /*OUT*/ PNDIS_STATUS OpenErrorStatus
,
3704 /*IN*/ NDIS_HANDLE MiniportAdapterContext
,
3705 /*IN*/ NDIS_HANDLE WrapperConfigurationContext
);
3707 typedef NDIS_STATUS DDKAPI
3709 /*OUT*/ PBOOLEAN AddressingReset
,
3710 /*IN*/ NDIS_HANDLE MiniportAdapterContext
);
3712 typedef NDIS_STATUS DDKAPI
3714 /*IN*/ NDIS_HANDLE MiniportAdapterContext
,
3715 /*IN*/ PNDIS_PACKET Packet
,
3718 typedef NDIS_STATUS DDKAPI
3720 /*IN*/ NDIS_HANDLE MiniportAdapterContext
,
3721 /*IN*/ NDIS_HANDLE NdisLinkHandle
,
3722 /*IN*/ PNDIS_WAN_PACKET Packet
);
3724 typedef NDIS_STATUS DDKAPI
3725 (*W_SET_INFORMATION_HANDLER
)(
3726 /*IN*/ NDIS_HANDLE MiniportAdapterContext
,
3727 /*IN*/ NDIS_OID Oid
,
3728 /*IN*/ PVOID InformationBuffer
,
3729 /*IN*/ ULONG InformationBufferLength
,
3730 /*OUT*/ PULONG BytesRead
,
3731 /*OUT*/ PULONG BytesNeeded
);
3733 typedef NDIS_STATUS DDKAPI
3734 (*W_TRANSFER_DATA_HANDLER
)(
3735 /*OUT*/ PNDIS_PACKET Packet
,
3736 /*OUT*/ PUINT BytesTransferred
,
3737 /*IN*/ NDIS_HANDLE MiniportAdapterContext
,
3738 /*IN*/ NDIS_HANDLE MiniportReceiveContext
,
3739 /*IN*/ UINT ByteOffset
,
3740 /*IN*/ UINT BytesToTransfer
);
3742 typedef NDIS_STATUS DDKAPI
3743 (*WM_TRANSFER_DATA_HANDLER
)(
3747 /* NDIS structures available only to miniport drivers */
3749 #define NDIS30_MINIPORT_CHARACTERISTICS_S \
3750 UCHAR MajorNdisVersion; \
3751 UCHAR MinorNdisVersion; \
3753 W_CHECK_FOR_HANG_HANDLER CheckForHangHandler; \
3754 W_DISABLE_INTERRUPT_HANDLER DisableInterruptHandler; \
3755 W_ENABLE_INTERRUPT_HANDLER EnableInterruptHandler; \
3756 W_HALT_HANDLER HaltHandler; \
3757 W_HANDLE_INTERRUPT_HANDLER HandleInterruptHandler; \
3758 W_INITIALIZE_HANDLER InitializeHandler; \
3759 W_ISR_HANDLER ISRHandler; \
3760 W_QUERY_INFORMATION_HANDLER QueryInformationHandler; \
3761 W_RECONFIGURE_HANDLER ReconfigureHandler; \
3762 W_RESET_HANDLER ResetHandler; \
3763 _ANONYMOUS_UNION union { \
3764 W_SEND_HANDLER SendHandler; \
3765 WM_SEND_HANDLER WanSendHandler; \
3766 } _UNION_NAME(u1); \
3767 W_SET_INFORMATION_HANDLER SetInformationHandler; \
3768 _ANONYMOUS_UNION union { \
3769 W_TRANSFER_DATA_HANDLER TransferDataHandler; \
3770 WM_TRANSFER_DATA_HANDLER WanTransferDataHandler; \
3773 typedef struct _NDIS30_MINIPORT_CHARACTERISTICS
{
3774 NDIS30_MINIPORT_CHARACTERISTICS_S
3775 } NDIS30_MINIPORT_CHARACTERISTICS
, *PSNDIS30_MINIPORT_CHARACTERISTICS
;
3778 /* Extensions for NDIS 4.0 miniports */
3781 (*W_SEND_PACKETS_HANDLER
)(
3782 /*IN*/ NDIS_HANDLE MiniportAdapterContext
,
3783 /*IN*/ PPNDIS_PACKET PacketArray
,
3784 /*IN*/ UINT NumberOfPackets
);
3787 (*W_RETURN_PACKET_HANDLER
)(
3788 /*IN*/ NDIS_HANDLE MiniportAdapterContext
,
3789 /*IN*/ PNDIS_PACKET Packet
);
3792 (*W_ALLOCATE_COMPLETE_HANDLER
)(
3793 /*IN*/ NDIS_HANDLE MiniportAdapterContext
,
3794 /*IN*/ PVOID VirtualAddress
,
3795 /*IN*/ PNDIS_PHYSICAL_ADDRESS PhysicalAddress
,
3796 /*IN*/ ULONG Length
,
3797 /*IN*/ PVOID Context
);
3801 #define NDIS40_MINIPORT_CHARACTERISTICS_S \
3802 NDIS30_MINIPORT_CHARACTERISTICS Ndis30Chars; \
3803 W_RETURN_PACKET_HANDLER ReturnPacketHandler; \
3804 W_SEND_PACKETS_HANDLER SendPacketsHandler; \
3805 W_ALLOCATE_COMPLETE_HANDLER AllocateCompleteHandler;
3807 #else /* !__cplusplus */
3809 #define NDIS40_MINIPORT_CHARACTERISTICS_S \
3810 NDIS30_MINIPORT_CHARACTERISTICS_S \
3811 W_RETURN_PACKET_HANDLER ReturnPacketHandler; \
3812 W_SEND_PACKETS_HANDLER SendPacketsHandler; \
3813 W_ALLOCATE_COMPLETE_HANDLER AllocateCompleteHandler;
3815 #endif /* !__cplusplus */
3817 typedef struct _NDIS40_MINIPORT_CHARACTERISTICS
{
3818 NDIS40_MINIPORT_CHARACTERISTICS_S
3819 } NDIS40_MINIPORT_CHARACTERISTICS
, *PNDIS40_MINIPORT_CHARACTERISTICS
;
3822 /* Extensions for NDIS 5.0 miniports */
3824 typedef NDIS_STATUS DDKAPI
3825 (*W_CO_CREATE_VC_HANDLER
)(
3826 /*IN*/ NDIS_HANDLE MiniportAdapterContext
,
3827 /*IN*/ NDIS_HANDLE NdisVcHandle
,
3828 /*OUT*/ PNDIS_HANDLE MiniportVcContext
);
3830 typedef NDIS_STATUS DDKAPI
3831 (*W_CO_DELETE_VC_HANDLER
)(
3832 /*IN*/ NDIS_HANDLE MiniportVcContext
);
3834 typedef NDIS_STATUS DDKAPI
3835 (*W_CO_ACTIVATE_VC_HANDLER
)(
3836 /*IN*/ NDIS_HANDLE MiniportVcContext
,
3837 /*IN OUT*/ PCO_CALL_PARAMETERS CallParameters
);
3839 typedef NDIS_STATUS DDKAPI
3840 (*W_CO_DEACTIVATE_VC_HANDLER
)(
3841 /*IN*/ NDIS_HANDLE MiniportVcContext
);
3844 (*W_CO_SEND_PACKETS_HANDLER
)(
3845 /*IN*/ NDIS_HANDLE MiniportVcContext
,
3846 /*IN*/ PPNDIS_PACKET PacketArray
,
3847 /*IN*/ UINT NumberOfPackets
);
3849 typedef NDIS_STATUS DDKAPI
3850 (*W_CO_REQUEST_HANDLER
)(
3851 /*IN*/ NDIS_HANDLE MiniportAdapterContext
,
3852 /*IN*/ NDIS_HANDLE MiniportVcContext
/*OPTIONAL*/,
3853 /*IN OUT*/ PNDIS_REQUEST NdisRequest
);
3857 #define NDIS50_MINIPORT_CHARACTERISTICS_S \
3858 NDIS40_MINIPORT_CHARACTERISTICS Ndis40Chars; \
3859 W_CO_CREATE_VC_HANDLER CoCreateVcHandler; \
3860 W_CO_DELETE_VC_HANDLER CoDeleteVcHandler; \
3861 W_CO_ACTIVATE_VC_HANDLER CoActivateVcHandler; \
3862 W_CO_DEACTIVATE_VC_HANDLER CoDeactivateVcHandler; \
3863 W_CO_SEND_PACKETS_HANDLER CoSendPacketsHandler; \
3864 W_CO_REQUEST_HANDLER CoRequestHandler;
3866 #else /* !__cplusplus */
3868 #define NDIS50_MINIPORT_CHARACTERISTICS_S \
3869 NDIS40_MINIPORT_CHARACTERISTICS_S \
3870 W_CO_CREATE_VC_HANDLER CoCreateVcHandler; \
3871 W_CO_DELETE_VC_HANDLER CoDeleteVcHandler; \
3872 W_CO_ACTIVATE_VC_HANDLER CoActivateVcHandler; \
3873 W_CO_DEACTIVATE_VC_HANDLER CoDeactivateVcHandler; \
3874 W_CO_SEND_PACKETS_HANDLER CoSendPacketsHandler; \
3875 W_CO_REQUEST_HANDLER CoRequestHandler;
3877 #endif /* !__cplusplus */
3879 typedef struct _NDIS50_MINIPORT_CHARACTERISTICS
{
3880 NDIS50_MINIPORT_CHARACTERISTICS_S
3881 } NDIS50_MINIPORT_CHARACTERISTICS
, *PSNDIS50_MINIPORT_CHARACTERISTICS
;
3884 /* Extensions for NDIS 5.1 miniports */
3887 (*W_CANCEL_SEND_PACKETS_HANDLER
)(
3888 /*IN*/ NDIS_HANDLE MiniportAdapterContext
,
3889 /*IN*/ PVOID CancelId
);
3893 typedef struct _NDIS_MINIPORT_CHARACTERISTICS
{
3894 NDIS50_MINIPORT_CHARACTERISTICS_S
3895 } NDIS_MINIPORT_CHARACTERISTICS
, *PNDIS_MINIPORT_CHARACTERISTICS
;
3896 #elif defined(NDIS50)
3897 typedef struct _NDIS_MINIPORT_CHARACTERISTICS
{
3898 NDIS50_MINIPORT_CHARACTERISTICS_S
3899 } NDIS_MINIPORT_CHARACTERISTICS
, *PNDIS_MINIPORT_CHARACTERISTICS
;
3900 #elif defined(NDIS40)
3901 typedef struct _NDIS_MINIPORT_CHARACTERISTICS
{
3902 NDIS40_MINIPORT_CHARACTERISTICS_S
3903 } NDIS_MINIPORT_CHARACTERISTICS
, *PNDIS_MINIPORT_CHARACTERISTICS
;
3904 #elif defined(NDIS30)
3905 typedef struct _NDIS_MINIPORT_CHARACTERISTICS
{
3906 NDIS30_MINIPORT_CHARACTERISTICS_S
3907 } NDIS_MINIPORT_CHARACTERISTICS
, *PNDIS_MINIPORT_CHARACTERISTICS
;
3911 typedef NDIS_STATUS DDKAPI
3913 /*IN*/ NDIS_HANDLE MacBindingHandle
,
3914 /*IN*/ PNDIS_PACKET Packet
);
3916 typedef NDIS_STATUS DDKAPI
3917 (*TRANSFER_DATA_HANDLER
)(
3918 /*IN*/ NDIS_HANDLE MacBindingHandle
,
3919 /*IN*/ NDIS_HANDLE MacReceiveContext
,
3920 /*IN*/ UINT ByteOffset
,
3921 /*IN*/ UINT BytesToTransfer
,
3922 /*OUT*/ PNDIS_PACKET Packet
,
3923 /*OUT*/ PUINT BytesTransferred
);
3925 typedef NDIS_STATUS DDKAPI
3927 /*IN*/ NDIS_HANDLE MacBindingHandle
);
3929 typedef NDIS_STATUS DDKAPI
3931 /*IN*/ NDIS_HANDLE MacBindingHandle
,
3932 /*IN*/ PNDIS_REQUEST NdisRequest
);
3936 /* Structures available only to full MAC drivers */
3938 typedef BOOLEAN DDKAPI
3939 (*PNDIS_INTERRUPT_SERVICE
)(
3940 /*IN*/ PVOID InterruptContext
);
3943 (*PNDIS_DEFERRED_PROCESSING
)(
3944 /*IN*/ PVOID SystemSpecific1
,
3945 /*IN*/ PVOID InterruptContext
,
3946 /*IN*/ PVOID SystemSpecific2
,
3947 /*IN*/ PVOID SystemSpecific3
);
3951 typedef struct _NDIS_MINIPORT_BLOCK NDIS_MINIPORT_BLOCK
, *PNDIS_MINIPORT_BLOCK
;
3952 typedef struct _NDIS_PROTOCOL_BLOCK NDIS_PROTOCOL_BLOCK
, *PNDIS_PROTOCOL_BLOCK
;
3953 typedef struct _NDIS_OPEN_BLOCK NDIS_OPEN_BLOCK
, *PNDIS_OPEN_BLOCK
;
3954 typedef struct _NDIS_M_DRIVER_BLOCK NDIS_M_DRIVER_BLOCK
, *PNDIS_M_DRIVER_BLOCK
;
3955 typedef struct _NDIS_AF_LIST NDIS_AF_LIST
, *PNDIS_AF_LIST
;
3958 typedef struct _NDIS_MINIPORT_INTERRUPT
{
3959 PKINTERRUPT InterruptObject
;
3960 KSPIN_LOCK DpcCountLock
;
3961 PVOID MiniportIdField
;
3962 W_ISR_HANDLER MiniportIsr
;
3963 W_HANDLE_INTERRUPT_HANDLER MiniportDpc
;
3965 PNDIS_MINIPORT_BLOCK Miniport
;
3968 KEVENT DpcsCompletedEvent
;
3969 BOOLEAN SharedInterrupt
;
3970 BOOLEAN IsrRequested
;
3971 } NDIS_MINIPORT_INTERRUPT
, *PNDIS_MINIPORT_INTERRUPT
;
3973 typedef struct _NDIS_MINIPORT_TIMER
{
3976 PNDIS_TIMER_FUNCTION MiniportTimerFunction
;
3977 PVOID MiniportTimerContext
;
3978 PNDIS_MINIPORT_BLOCK Miniport
;
3979 struct _NDIS_MINIPORT_TIMER
*NextDeferredTimer
;
3980 } NDIS_MINIPORT_TIMER
, *PNDIS_MINIPORT_TIMER
;
3982 typedef struct _NDIS_INTERRUPT
{
3983 PKINTERRUPT InterruptObject
;
3984 KSPIN_LOCK DpcCountLock
;
3985 PNDIS_INTERRUPT_SERVICE MacIsr
;
3986 PNDIS_DEFERRED_PROCESSING MacDpc
;
3988 PVOID InterruptContext
;
3991 KEVENT DpcsCompletedEvent
;
3992 } NDIS_INTERRUPT
, *PNDIS_INTERRUPT
;
3995 typedef struct _MAP_REGISTER_ENTRY
{
3997 BOOLEAN WriteToDevice
;
3998 } MAP_REGISTER_ENTRY
, *PMAP_REGISTER_ENTRY
;
4001 typedef enum _NDIS_WORK_ITEM_TYPE
{
4002 NdisWorkItemRequest
,
4004 NdisWorkItemReturnPackets
,
4005 NdisWorkItemResetRequested
,
4006 NdisWorkItemResetInProgress
,
4008 NdisWorkItemSendLoopback
,
4009 NdisWorkItemMiniportCallback
,
4011 } NDIS_WORK_ITEM_TYPE
, *PNDIS_WORK_ITEM_TYPE
;
4013 #define NUMBER_OF_WORK_ITEM_TYPES NdisMaxWorkItems
4014 #define NUMBER_OF_SINGLE_WORK_ITEMS 6
4016 typedef struct _NDIS_MINIPORT_WORK_ITEM
{
4017 SINGLE_LIST_ENTRY Link
;
4018 NDIS_WORK_ITEM_TYPE WorkItemType
;
4019 PVOID WorkItemContext
;
4020 } NDIS_MINIPORT_WORK_ITEM
, *PNDIS_MINIPORT_WORK_ITEM
;
4023 typedef struct _NDIS_BIND_PATHS
{
4025 NDIS_STRING Paths
[1];
4026 } NDIS_BIND_PATHS
, *PNDIS_BIND_PATHS
;
4028 #define DECLARE_UNKNOWN_STRUCT(BaseName) \
4029 typedef struct _##BaseName BaseName, *P##BaseName;
4031 #define DECLARE_UNKNOWN_PROTOTYPE(Name) \
4032 typedef VOID (*(Name))(VOID);
4034 #define ETH_LENGTH_OF_ADDRESS 6
4036 DECLARE_UNKNOWN_STRUCT(ETH_BINDING_INFO
)
4038 DECLARE_UNKNOWN_PROTOTYPE(ETH_ADDRESS_CHANGE
)
4039 DECLARE_UNKNOWN_PROTOTYPE(ETH_FILTER_CHANGE
)
4040 DECLARE_UNKNOWN_PROTOTYPE(ETH_DEFERRED_CLOSE
)
4042 typedef struct _ETH_FILTER
{
4043 PNDIS_SPIN_LOCK Lock
;
4044 CHAR (*MCastAddressBuf
)[ETH_LENGTH_OF_ADDRESS
];
4045 struct _NDIS_MINIPORT_BLOCK
*Miniport
;
4046 UINT CombinedPacketFilter
;
4047 PETH_BINDING_INFO OpenList
;
4048 ETH_ADDRESS_CHANGE AddressChangeAction
;
4049 ETH_FILTER_CHANGE FilterChangeAction
;
4050 ETH_DEFERRED_CLOSE CloseAction
;
4051 UINT MaxMulticastAddresses
;
4053 UCHAR AdapterAddress
[ETH_LENGTH_OF_ADDRESS
];
4054 UINT OldCombinedPacketFilter
;
4055 CHAR (*OldMCastAddressBuf
)[ETH_LENGTH_OF_ADDRESS
];
4056 UINT OldNumAddresses
;
4057 PETH_BINDING_INFO DirectedList
;
4058 PETH_BINDING_INFO BMList
;
4059 PETH_BINDING_INFO MCastSet
;
4064 } ETH_FILTER
, *PETH_FILTER
;
4067 (*ETH_RCV_COMPLETE_HANDLER
)(
4068 /*IN*/ PETH_FILTER Filter
);
4071 (*ETH_RCV_INDICATE_HANDLER
)(
4072 /*IN*/ PETH_FILTER Filter
,
4073 /*IN*/ NDIS_HANDLE MacReceiveContext
,
4074 /*IN*/ PCHAR Address
,
4075 /*IN*/ PVOID HeaderBuffer
,
4076 /*IN*/ UINT HeaderBufferSize
,
4077 /*IN*/ PVOID LookaheadBuffer
,
4078 /*IN*/ UINT LookaheadBufferSize
,
4079 /*IN*/ UINT PacketSize
);
4082 (*FDDI_RCV_COMPLETE_HANDLER
)(
4083 /*IN*/ PFDDI_FILTER Filter
);
4086 (*FDDI_RCV_INDICATE_HANDLER
)(
4087 /*IN*/ PFDDI_FILTER Filter
,
4088 /*IN*/ NDIS_HANDLE MacReceiveContext
,
4089 /*IN*/ PCHAR Address
,
4090 /*IN*/ UINT AddressLength
,
4091 /*IN*/ PVOID HeaderBuffer
,
4092 /*IN*/ UINT HeaderBufferSize
,
4093 /*IN*/ PVOID LookaheadBuffer
,
4094 /*IN*/ UINT LookaheadBufferSize
,
4095 /*IN*/ UINT PacketSize
);
4098 (*FILTER_PACKET_INDICATION_HANDLER
)(
4099 /*IN*/ NDIS_HANDLE Miniport
,
4100 /*IN*/ PPNDIS_PACKET PacketArray
,
4101 /*IN*/ UINT NumberOfPackets
);
4104 (*TR_RCV_COMPLETE_HANDLER
)(
4105 /*IN*/ PTR_FILTER Filter
);
4108 (*TR_RCV_INDICATE_HANDLER
)(
4109 /*IN*/ PTR_FILTER Filter
,
4110 /*IN*/ NDIS_HANDLE MacReceiveContext
,
4111 /*IN*/ PVOID HeaderBuffer
,
4112 /*IN*/ UINT HeaderBufferSize
,
4113 /*IN*/ PVOID LookaheadBuffer
,
4114 /*IN*/ UINT LookaheadBufferSize
,
4115 /*IN*/ UINT PacketSize
);
4118 (*WAN_RCV_COMPLETE_HANDLER
)(
4119 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
4120 /*IN*/ NDIS_HANDLE NdisLinkContext
);
4124 /*OUT*/ PNDIS_STATUS Status
,
4125 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
4126 /*IN*/ NDIS_HANDLE NdisLinkContext
,
4127 /*IN*/ PUCHAR Packet
,
4128 /*IN*/ ULONG PacketSize
);
4130 typedef VOID DDKFASTAPI
4131 (*NDIS_M_DEQUEUE_WORK_ITEM
)(
4132 /*IN*/ PNDIS_MINIPORT_BLOCK Miniport
,
4133 /*IN*/ NDIS_WORK_ITEM_TYPE WorkItemType
,
4134 /*OUT*/ PVOID
*WorkItemContext
);
4136 typedef NDIS_STATUS DDKFASTAPI
4137 (*NDIS_M_QUEUE_NEW_WORK_ITEM
)(
4138 /*IN*/ PNDIS_MINIPORT_BLOCK Miniport
,
4139 /*IN*/ NDIS_WORK_ITEM_TYPE WorkItemType
,
4140 /*IN*/ PVOID WorkItemContext
);
4142 typedef NDIS_STATUS DDKFASTAPI
4143 (*NDIS_M_QUEUE_WORK_ITEM
)(
4144 /*IN*/ PNDIS_MINIPORT_BLOCK Miniport
,
4145 /*IN*/ NDIS_WORK_ITEM_TYPE WorkItemType
,
4146 /*IN*/ PVOID WorkItemContext
);
4149 (*NDIS_M_REQ_COMPLETE_HANDLER
)(
4150 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
4151 /*IN*/ NDIS_STATUS Status
);
4154 (*NDIS_M_RESET_COMPLETE_HANDLER
)(
4155 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
4156 /*IN*/ NDIS_STATUS Status
,
4157 /*IN*/ BOOLEAN AddressingReset
);
4160 (*NDIS_M_SEND_COMPLETE_HANDLER
)(
4161 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
4162 /*IN*/ PNDIS_PACKET Packet
,
4163 /*IN*/ NDIS_STATUS Status
);
4166 (*NDIS_M_SEND_RESOURCES_HANDLER
)(
4167 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
);
4169 typedef BOOLEAN DDKFASTAPI
4170 (*NDIS_M_START_SENDS
)(
4171 /*IN*/ PNDIS_MINIPORT_BLOCK Miniport
);
4174 (*NDIS_M_STATUS_HANDLER
)(
4175 /*IN*/ NDIS_HANDLE MiniportHandle
,
4176 /*IN*/ NDIS_STATUS GeneralStatus
,
4177 /*IN*/ PVOID StatusBuffer
,
4178 /*IN*/ UINT StatusBufferSize
);
4181 (*NDIS_M_STS_COMPLETE_HANDLER
)(
4182 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
);
4185 (*NDIS_M_TD_COMPLETE_HANDLER
)(
4186 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
4187 /*IN*/ PNDIS_PACKET Packet
,
4188 /*IN*/ NDIS_STATUS Status
,
4189 /*IN*/ UINT BytesTransferred
);
4191 typedef VOID (DDKAPI
*NDIS_WM_SEND_COMPLETE_HANDLER
)(
4192 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
4193 /*IN*/ PVOID Packet
,
4194 /*IN*/ NDIS_STATUS Status
);
4199 #define ARC_SEND_BUFFERS 8
4200 #define ARC_HEADER_SIZE 4
4202 typedef struct _NDIS_ARC_BUF
{
4203 NDIS_HANDLE ArcnetBufferPool
;
4204 PUCHAR ArcnetLookaheadBuffer
;
4206 ARC_BUFFER_LIST ArcnetBuffers
[ARC_SEND_BUFFERS
];
4207 } NDIS_ARC_BUF
, *PNDIS_ARC_BUF
;
4211 #define NDIS_MINIPORT_WORK_QUEUE_SIZE 10
4213 typedef struct _NDIS_LOG
{
4214 PNDIS_MINIPORT_BLOCK Miniport
;
4222 } NDIS_LOG
, *PNDIS_LOG
;
4224 typedef struct _FILTERDBS
{
4225 _ANONYMOUS_UNION
union {
4227 PNULL_FILTER NullDB
;
4230 PFDDI_FILTER FddiDB
;
4235 #endif /* !ARCNET */
4236 } FILTERDBS
, *PFILTERDBS
;
4239 struct _NDIS_MINIPORT_BLOCK
{
4241 PNDIS_MINIPORT_BLOCK NextMiniport
;
4242 PNDIS_M_DRIVER_BLOCK DriverHandle
;
4243 NDIS_HANDLE MiniportAdapterContext
;
4244 UNICODE_STRING MiniportName
;
4245 PNDIS_BIND_PATHS BindPaths
;
4246 NDIS_HANDLE OpenQueue
;
4248 NDIS_HANDLE DeviceContext
;
4252 UCHAR AssignedProcessor
;
4254 PNDIS_REQUEST MediaRequest
;
4255 PNDIS_MINIPORT_INTERRUPT Interrupt
;
4258 LIST_ENTRY PacketList
;
4259 PNDIS_PACKET FirstPendingPacket
;
4260 PNDIS_PACKET ReturnPacketsQueue
;
4261 ULONG RequestBuffer
;
4262 PVOID SetMCastBuffer
;
4263 PNDIS_MINIPORT_BLOCK PrimaryMiniport
;
4264 PVOID WrapperContext
;
4265 PVOID BusDataContext
;
4266 ULONG PnPCapabilities
;
4267 PCM_RESOURCE_LIST Resources
;
4268 NDIS_TIMER WakeUpDpcTimer
;
4269 UNICODE_STRING BaseName
;
4270 UNICODE_STRING SymbolicLinkName
;
4271 ULONG CheckForHangSeconds
;
4273 USHORT CFHangCurrentTick
;
4274 NDIS_STATUS ResetStatus
;
4275 NDIS_HANDLE ResetOpen
;
4276 FILTERDBS FilterDbs
;
4277 FILTER_PACKET_INDICATION_HANDLER PacketIndicateHandler
;
4278 NDIS_M_SEND_COMPLETE_HANDLER SendCompleteHandler
;
4279 NDIS_M_SEND_RESOURCES_HANDLER SendResourcesHandler
;
4280 NDIS_M_RESET_COMPLETE_HANDLER ResetCompleteHandler
;
4281 NDIS_MEDIUM MediaType
;
4283 NDIS_INTERFACE_TYPE BusType
;
4284 NDIS_INTERFACE_TYPE AdapterType
;
4285 PDEVICE_OBJECT DeviceObject
;
4286 PDEVICE_OBJECT PhysicalDeviceObject
;
4287 PDEVICE_OBJECT NextDeviceObject
;
4288 PMAP_REGISTER_ENTRY MapRegisters
;
4289 PNDIS_AF_LIST CallMgrAfList
;
4290 PVOID MiniportThread
;
4292 USHORT SetInfoBufLen
;
4293 USHORT MaxSendPackets
;
4294 NDIS_STATUS FakeStatus
;
4296 PUNICODE_STRING pAdapterInstanceName
;
4297 PNDIS_MINIPORT_TIMER TimerQueue
;
4299 PNDIS_REQUEST PendingRequest
;
4300 UINT MaximumLongAddresses
;
4301 UINT MaximumShortAddresses
;
4302 UINT CurrentLookahead
;
4303 UINT MaximumLookahead
;
4304 W_HANDLE_INTERRUPT_HANDLER HandleInterruptHandler
;
4305 W_DISABLE_INTERRUPT_HANDLER DisableInterruptHandler
;
4306 W_ENABLE_INTERRUPT_HANDLER EnableInterruptHandler
;
4307 W_SEND_PACKETS_HANDLER SendPacketsHandler
;
4308 NDIS_M_START_SENDS DeferredSendHandler
;
4309 ETH_RCV_INDICATE_HANDLER EthRxIndicateHandler
;
4310 TR_RCV_INDICATE_HANDLER TrRxIndicateHandler
;
4311 FDDI_RCV_INDICATE_HANDLER FddiRxIndicateHandler
;
4312 ETH_RCV_COMPLETE_HANDLER EthRxCompleteHandler
;
4313 TR_RCV_COMPLETE_HANDLER TrRxCompleteHandler
;
4314 FDDI_RCV_COMPLETE_HANDLER FddiRxCompleteHandler
;
4315 NDIS_M_STATUS_HANDLER StatusHandler
;
4316 NDIS_M_STS_COMPLETE_HANDLER StatusCompleteHandler
;
4317 NDIS_M_TD_COMPLETE_HANDLER TDCompleteHandler
;
4318 NDIS_M_REQ_COMPLETE_HANDLER QueryCompleteHandler
;
4319 NDIS_M_REQ_COMPLETE_HANDLER SetCompleteHandler
;
4320 NDIS_WM_SEND_COMPLETE_HANDLER WanSendCompleteHandler
;
4321 WAN_RCV_HANDLER WanRcvHandler
;
4322 WAN_RCV_COMPLETE_HANDLER WanRcvCompleteHandler
;
4324 PNDIS_MINIPORT_BLOCK NextGlobalMiniport
;
4325 SINGLE_LIST_ENTRY WorkQueue
[NUMBER_OF_WORK_ITEM_TYPES
];
4326 SINGLE_LIST_ENTRY SingleWorkItems
[NUMBER_OF_SINGLE_WORK_ITEMS
];
4329 UCHAR ArcnetAddress
;
4331 _ANONYMOUS_UNION
union {
4333 PNDIS_ARC_BUF ArcBuf
;
4339 PCM_RESOURCE_LIST AllocatedResources
;
4340 PCM_RESOURCE_LIST AllocatedResourcesTranslated
;
4341 SINGLE_LIST_ENTRY PatternList
;
4342 NDIS_PNP_CAPABILITIES PMCapabilities
;
4343 DEVICE_CAPABILITIES DeviceCaps
;
4345 DEVICE_POWER_STATE CurrentDevicePowerState
;
4347 SYSTEM_POWER_STATE WaitWakeSystemState
;
4348 LARGE_INTEGER VcIndex
;
4349 KSPIN_LOCK VcCountLock
;
4350 LIST_ENTRY WmiEnabledVcs
;
4351 PNDIS_GUID pNdisGuidMap
;
4352 PNDIS_GUID pCustomGuidMap
;
4354 USHORT cNdisGuidMap
;
4355 USHORT cCustomGuidMap
;
4356 USHORT CurrentMapRegister
;
4357 PKEVENT AllocationEvent
;
4358 USHORT BaseMapRegistersNeeded
;
4359 USHORT SGMapRegistersNeeded
;
4360 ULONG MaximumPhysicalMapping
;
4361 NDIS_TIMER MediaDisconnectTimer
;
4362 USHORT MediaDisconnectTimeOut
;
4363 USHORT InstanceNumber
;
4364 NDIS_EVENT OpenReadyEvent
;
4365 NDIS_PNP_DEVICE_STATE PnPDeviceState
;
4366 NDIS_PNP_DEVICE_STATE OldPnPDeviceState
;
4367 PGET_SET_DEVICE_DATA SetBusData
;
4368 PGET_SET_DEVICE_DATA GetBusData
;
4372 NDIS_STATS NdisStats
;
4376 PNDIS_PACKET IndicatedPacket
[MAXIMUM_PROCESSORS
];
4377 PKEVENT RemoveReadyEvent
;
4378 PKEVENT AllOpensClosedEvent
;
4379 PKEVENT AllRequestsCompletedEvent
;
4381 NDIS_MINIPORT_WORK_ITEM WorkItemBuffer
[NUMBER_OF_SINGLE_WORK_ITEMS
];
4382 PDMA_ADAPTER SystemAdapterObject
;
4383 ULONG DriverVerifyFlags
;
4385 USHORT InternalResetCount
;
4386 USHORT MiniportResetCount
;
4387 USHORT MediaSenseConnectCount
;
4388 USHORT MediaSenseDisconnectCount
;
4389 PNDIS_PACKET
*xPackets
;
4390 ULONG UserModeOpenReferences
;
4391 _ANONYMOUS_UNION
union {
4392 PVOID SavedSendHandler
;
4393 PVOID SavedWanSendHandler
;
4395 PVOID SavedSendPacketsHandler
;
4396 PVOID SavedCancelSendPacketsHandler
;
4397 W_SEND_PACKETS_HANDLER WSendPacketsHandler
;
4398 ULONG MiniportAttributes
;
4399 PDMA_ADAPTER SavedSystemAdapterObject
;
4401 USHORT CFHangXTicks
;
4403 ULONG IndicatedPacketsCount
;
4404 ULONG PhysicalMediumType
;
4405 PNDIS_REQUEST LastRequest
;
4406 LONG DmaAdapterRefCount
;
4412 KSPIN_LOCK TimerQueueLock
;
4413 PKEVENT ResetCompletedEvent
;
4414 PKEVENT QueuedBindingCompletedEvent
;
4415 PKEVENT DmaResourcesReleasedEvent
;
4416 FILTER_PACKET_INDICATION_HANDLER SavedPacketIndicateHandler
;
4417 ULONG RegisteredInterrupts
;
4418 PNPAGED_LOOKASIDE_LIST SGListLookasideList
;
4419 ULONG ScatterGatherListSize
;
4424 /* Handler prototypes for NDIS_OPEN_BLOCK */
4426 typedef NDIS_STATUS (DDKAPI
*WAN_SEND_HANDLER
)(
4427 /*IN*/ NDIS_HANDLE MacBindingHandle
,
4428 /*IN*/ NDIS_HANDLE LinkHandle
,
4429 /*IN*/ PVOID Packet
);
4431 /* NDIS 4.0 extension */
4433 typedef VOID (DDKAPI
*SEND_PACKETS_HANDLER
)(
4434 /*IN*/ NDIS_HANDLE MiniportAdapterContext
,
4435 /*IN*/ PPNDIS_PACKET PacketArray
,
4436 /*IN*/ UINT NumberOfPackets
);
4439 typedef struct _NDIS_COMMON_OPEN_BLOCK
{
4441 NDIS_HANDLE BindingHandle
;
4442 PNDIS_MINIPORT_BLOCK MiniportHandle
;
4443 PNDIS_PROTOCOL_BLOCK ProtocolHandle
;
4444 NDIS_HANDLE ProtocolBindingContext
;
4445 PNDIS_OPEN_BLOCK MiniportNextOpen
;
4446 PNDIS_OPEN_BLOCK ProtocolNextOpen
;
4447 NDIS_HANDLE MiniportAdapterContext
;
4452 PNDIS_STRING BindDeviceName
;
4453 KSPIN_LOCK Reserved5
;
4454 PNDIS_STRING RootDeviceName
;
4455 _ANONYMOUS_UNION
union {
4456 SEND_HANDLER SendHandler
;
4457 WAN_SEND_HANDLER WanSendHandler
;
4459 TRANSFER_DATA_HANDLER TransferDataHandler
;
4460 SEND_COMPLETE_HANDLER SendCompleteHandler
;
4461 TRANSFER_DATA_COMPLETE_HANDLER TransferDataCompleteHandler
;
4462 RECEIVE_HANDLER ReceiveHandler
;
4463 RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler
;
4464 WAN_RECEIVE_HANDLER WanReceiveHandler
;
4465 REQUEST_COMPLETE_HANDLER RequestCompleteHandler
;
4466 RECEIVE_PACKET_HANDLER ReceivePacketHandler
;
4467 SEND_PACKETS_HANDLER SendPacketsHandler
;
4468 RESET_HANDLER ResetHandler
;
4469 REQUEST_HANDLER RequestHandler
;
4470 RESET_COMPLETE_HANDLER ResetCompleteHandler
;
4471 STATUS_HANDLER StatusHandler
;
4472 STATUS_COMPLETE_HANDLER StatusCompleteHandler
;
4476 KSPIN_LOCK SpinLock
;
4477 NDIS_HANDLE FilterHandle
;
4478 ULONG ProtocolOptions
;
4479 USHORT CurrentLookahead
;
4480 USHORT ConnectDampTicks
;
4481 USHORT DisconnectDampTicks
;
4482 W_SEND_HANDLER WSendHandler
;
4483 W_TRANSFER_DATA_HANDLER WTransferDataHandler
;
4484 W_SEND_PACKETS_HANDLER WSendPacketsHandler
;
4485 W_CANCEL_SEND_PACKETS_HANDLER CancelSendPacketsHandler
;
4487 PKEVENT CloseCompleteEvent
;
4490 PNDIS_OPEN_BLOCK NextGlobalOpen
;
4492 } NDIS_COMMON_OPEN_BLOCK
;
4494 struct _NDIS_OPEN_BLOCK
4496 NDIS_COMMON_OPEN_BLOCK NdisCommonOpenBlock
;
4498 struct _NDIS_OPEN_CO
4500 struct _NDIS_CO_AF_BLOCK
* NextAf
;
4501 W_CO_CREATE_VC_HANDLER MiniportCoCreateVcHandler
;
4502 W_CO_REQUEST_HANDLER MiniportCoRequestHandler
;
4503 CO_CREATE_VC_HANDLER CoCreateVcHandler
;
4504 CO_DELETE_VC_HANDLER CoDeleteVcHandler
;
4505 PVOID CmActivateVcCompleteHandler
;
4506 PVOID CmDeactivateVcCompleteHandler
;
4507 PVOID CoRequestCompleteHandler
;
4508 LIST_ENTRY ActiveVcHead
;
4509 LIST_ENTRY InactiveVcHead
;
4510 LONG PendingAfNotifications
;
4511 PKEVENT AfNotifyCompleteEvent
;
4518 /* Routines for NDIS miniport drivers */
4523 NdisInitializeWrapper(
4524 /*OUT*/ PNDIS_HANDLE NdisWrapperHandle
,
4525 /*IN*/ PVOID SystemSpecific1
,
4526 /*IN*/ PVOID SystemSpecific2
,
4527 /*IN*/ PVOID SystemSpecific3
);
4532 NdisMAllocateMapRegisters(
4533 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
4534 /*IN*/ UINT DmaChannel
,
4535 /*IN*/ BOOLEAN Dma32BitAddresses
,
4536 /*IN*/ ULONG PhysicalMapRegistersNeeded
,
4537 /*IN*/ ULONG MaximumPhysicalMapping
);
4541 * NdisMArcIndicateReceive(
4542 * IN NDIS_HANDLE MiniportAdapterHandle,
4543 * IN PUCHAR HeaderBuffer,
4544 * IN PUCHAR DataBuffer,
4547 #define NdisMArcIndicateReceive(MiniportAdapterHandle, \
4552 ArcFilterDprIndicateReceive( \
4553 (((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FilterDbs.ArcDB), \
4561 * NdisMArcIndicateReceiveComplete(
4562 * IN NDIS_HANDLE MiniportAdapterHandle);
4564 #define NdisMArcIndicateReceiveComplete(MiniportAdapterHandle) \
4566 if (((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->EthDB) \
4568 NdisMEthIndicateReceiveComplete(_H); \
4571 ArcFilterDprIndicateReceiveComplete( \
4572 ((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->ArcDB); \
4579 /*IN*/ NDIS_HANDLE LogHandle
);
4585 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
4587 /*OUT*/ PNDIS_HANDLE LogHandle
);
4592 NdisMDeregisterAdapterShutdownHandler(
4593 /*IN*/ NDIS_HANDLE MiniportHandle
);
4598 NdisMDeregisterInterrupt(
4599 /*IN*/ PNDIS_MINIPORT_INTERRUPT Interrupt
);
4604 NdisMDeregisterIoPortRange(
4605 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
4606 /*IN*/ UINT InitialPort
,
4607 /*IN*/ UINT NumberOfPorts
,
4608 /*IN*/ PVOID PortOffset
);
4612 * NdisMEthIndicateReceive(
4613 * IN NDIS_HANDLE MiniportAdapterHandle,
4614 * IN NDIS_HANDLE MiniportReceiveContext,
4615 * IN PVOID HeaderBuffer,
4616 * IN UINT HeaderBufferSize,
4617 * IN PVOID LookaheadBuffer,
4618 * IN UINT LookaheadBufferSize,
4619 * IN UINT PacketSize);
4621 #define NdisMEthIndicateReceive(MiniportAdapterHandle, \
4622 MiniportReceiveContext, \
4626 LookaheadBufferSize, \
4629 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->EthRxIndicateHandler)( \
4630 (((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FilterDbs.EthDB), \
4631 (MiniportReceiveContext), \
4634 (HeaderBufferSize), \
4635 (LookaheadBuffer), \
4636 (LookaheadBufferSize), \
4642 * NdisMEthIndicateReceiveComplete(
4643 * IN NDIS_HANDLE MiniportAdapterHandle);
4645 #define NdisMEthIndicateReceiveComplete(MiniportAdapterHandle) \
4647 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->EthRxCompleteHandler)( \
4648 ((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->FilterDbs.EthDB); \
4653 * NdisMFddiIndicateReceive(
4654 * IN NDIS_HANDLE MiniportAdapterHandle,
4655 * IN NDIS_HANDLE MiniportReceiveContext,
4656 * IN PVOID HeaderBuffer,
4657 * IN UINT HeaderBufferSize,
4658 * IN PVOID LookaheadBuffer,
4659 * IN UINT LookaheadBufferSize,
4660 * IN UINT PacketSize);
4662 #define NdisMFddiIndicateReceive(MiniportAdapterHandle, \
4663 MiniportReceiveContext, \
4667 LookaheadBufferSize, \
4670 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FddiRxIndicateHandler)( \
4671 (((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FilterDbs.FddiDB), \
4672 (MiniportReceiveContext), \
4673 (PUCHAR)(HeaderBuffer) + 1, \
4674 (((*(PUCHAR*)(HeaderBuffer)) & 0x40) ? \
4675 FDDI_LENGTH_OF_LONG_ADDRESS : \
4676 FDDI_LENGTH_OF_SHORT_ADDRESS), \
4678 (HeaderBufferSize), \
4679 (LookaheadBuffer), \
4680 (LookaheadBufferSize), \
4688 * NdisMFddiIndicateReceiveComplete(
4689 * IN NDIS_HANDLE MiniportAdapterHandle);
4691 #define NdisMFddiIndicateReceiveComplete(MiniportAdapterHandle) \
4693 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FddiRxCompleteHandler)( \
4694 ((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->FilterDbs.FddiDB); \
4701 /*IN*/ NDIS_HANDLE LogHandle
);
4706 NdisMFreeMapRegisters(
4707 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
);
4711 * NdisMIndicateStatus(
4712 * IN NDIS_HANDLE MiniportAdapterHandle,
4713 * IN NDIS_STATUS GeneralStatus,
4714 * IN PVOID StatusBuffer,
4715 * IN UINT StatusBufferSize);
4718 #define NdisMIndicateStatus(MiniportAdapterHandle, \
4719 GeneralStatus, StatusBuffer, StatusBufferSize) \
4720 (*((PNDIS_MINIPORT_BLOCK)(_M))->StatusHandler)( \
4721 MiniportAdapterHandle, GeneralStatus, StatusBuffer, StatusBufferSize)
4725 * NdisMIndicateStatusComplete(
4726 * IN NDIS_HANDLE MiniportAdapterHandle);
4728 #define NdisMIndicateStatusComplete(MiniportAdapterHandle) \
4729 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->StatusCompleteHandler)( \
4730 MiniportAdapterHandle)
4734 * NdisMInitializeWrapper(
4735 * OUT PNDIS_HANDLE NdisWrapperHandle,
4736 * IN PVOID SystemSpecific1,
4737 * IN PVOID SystemSpecific2,
4738 * IN PVOID SystemSpecific3);
4740 #define NdisMInitializeWrapper(NdisWrapperHandle, \
4744 NdisInitializeWrapper((NdisWrapperHandle), \
4745 (SystemSpecific1), \
4746 (SystemSpecific2), \
4753 /*OUT*/ PVOID
*VirtualAddress
,
4754 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
4755 /*IN*/ NDIS_PHYSICAL_ADDRESS PhysicalAddress
,
4756 /*IN*/ UINT Length
);
4760 * NdisMQueryInformationComplete(
4761 * IN NDIS_HANDLE MiniportAdapterHandle,
4762 * IN NDIS_STATUS Status);
4764 #define NdisMQueryInformationComplete(MiniportAdapterHandle, Status) \
4765 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->QueryCompleteHandler)(MiniportAdapterHandle, Status)
4770 NdisMRegisterAdapterShutdownHandler(
4771 /*IN*/ NDIS_HANDLE MiniportHandle
,
4772 /*IN*/ PVOID ShutdownContext
,
4773 /*IN*/ ADAPTER_SHUTDOWN_HANDLER ShutdownHandler
);
4778 NdisMRegisterInterrupt(
4779 /*OUT*/ PNDIS_MINIPORT_INTERRUPT Interrupt
,
4780 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
4781 /*IN*/ UINT InterruptVector
,
4782 /*IN*/ UINT InterruptLevel
,
4783 /*IN*/ BOOLEAN RequestIsr
,
4784 /*IN*/ BOOLEAN SharedInterrupt
,
4785 /*IN*/ NDIS_INTERRUPT_MODE InterruptMode
);
4790 NdisMRegisterIoPortRange(
4791 /*OUT*/ PVOID
*PortOffset
,
4792 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
4793 /*IN*/ UINT InitialPort
,
4794 /*IN*/ UINT NumberOfPorts
);
4799 NdisMRegisterMiniport(
4800 /*IN*/ NDIS_HANDLE NdisWrapperHandle
,
4801 /*IN*/ PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics
,
4802 /*IN*/ UINT CharacteristicsLength
);
4805 #if !defined(_NDIS_)
4809 * NdisMResetComplete(
4810 * IN NDIS_HANDLE MiniportAdapterHandle,
4811 * IN NDIS_STATUS Status,
4812 * IN BOOLEAN AddressingReset);
4814 #define NdisMResetComplete(MiniportAdapterHandle, \
4818 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->ResetCompleteHandler)( \
4819 MiniportAdapterHandle, Status, AddressingReset); \
4824 * NdisMSendComplete(
4825 * IN NDIS_HANDLE MiniportAdapterHandle,
4826 * IN PNDIS_PACKET Packet,
4827 * IN NDIS_STATUS Status);
4829 #define NdisMSendComplete(MiniportAdapterHandle, \
4833 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->SendCompleteHandler)( \
4834 MiniportAdapterHandle, Packet, Status); \
4839 * NdisMSendResourcesAvailable(
4840 * IN NDIS_HANDLE MiniportAdapterHandle);
4842 #define NdisMSendResourcesAvailable(MiniportAdapterHandle) \
4844 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->SendResourcesHandler)( \
4845 MiniportAdapterHandle); \
4850 * NdisMTransferDataComplete(
4851 * IN NDIS_HANDLE MiniportAdapterHandle,
4852 * IN PNDIS_PACKET Packet,
4853 * IN NDIS_STATUS Status,
4854 * IN UINT BytesTransferred);
4856 #define NdisMTransferDataComplete(MiniportAdapterHandle, \
4861 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->TDCompleteHandler)( \
4862 MiniportAdapterHandle, Packet, Status, BytesTransferred) \
4865 #endif /* !_NDIS_ */
4870 * NdisMSetAttributes(
4871 * IN NDIS_HANDLE MiniportAdapterHandle,
4872 * IN NDIS_HANDLE MiniportAdapterContext,
4873 * IN BOOLEAN BusMaster,
4874 * IN NDIS_INTERFACE_TYPE AdapterType);
4876 #define NdisMSetAttributes(MiniportAdapterHandle, \
4877 MiniportAdapterContext, \
4880 NdisMSetAttributesEx(MiniportAdapterHandle, \
4881 MiniportAdapterContext, \
4883 (BusMaster) ? NDIS_ATTRIBUTE_BUS_MASTER : 0, \
4889 NdisMSetAttributesEx(
4890 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
4891 /*IN*/ NDIS_HANDLE MiniportAdapterContext
,
4892 /*IN*/ UINT CheckForHangTimeInSeconds
/*OPTIONAL*/,
4893 /*IN*/ ULONG AttributeFlags
,
4894 /*IN*/ NDIS_INTERFACE_TYPE AdapterType
);
4898 * NdisMSetInformationComplete(
4899 * IN NDIS_HANDLE MiniportAdapterHandle,
4900 * IN NDIS_STATUS Status);
4902 #define NdisMSetInformationComplete(MiniportAdapterHandle, \
4904 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->SetCompleteHandler)( \
4905 MiniportAdapterHandle, Status)
4911 /*IN*/ ULONG MicrosecondsToSleep
);
4916 NdisMSynchronizeWithInterrupt(
4917 /*IN*/ PNDIS_MINIPORT_INTERRUPT Interrupt
,
4918 /*IN*/ PVOID SynchronizeFunction
,
4919 /*IN*/ PVOID SynchronizeContext
);
4923 * NdisMTrIndicateReceive(
4924 * IN NDIS_HANDLE MiniportAdapterHandle,
4925 * IN NDIS_HANDLE MiniportReceiveContext,
4926 * IN PVOID HeaderBuffer,
4927 * IN UINT HeaderBufferSize,
4928 * IN PVOID LookaheadBuffer,
4929 * IN UINT LookaheadBufferSize,
4930 * IN UINT PacketSize);
4932 #define NdisMTrIndicateReceive(MiniportAdapterHandle, \
4933 MiniportReceiveContext, \
4937 LookaheadBufferSize, \
4940 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->TrRxIndicateHandler)( \
4941 (((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->FilterDbs.TrDB), \
4942 (MiniportReceiveContext), \
4945 (HeaderBufferSize), \
4946 (LookaheadBuffer), \
4947 (LookaheadBufferSize), \
4953 * NdisMTrIndicateReceiveComplete(
4954 * IN NDIS_HANDLE MiniportAdapterHandle);
4956 #define NdisMTrIndicateReceiveComplete(MiniportAdapterHandle) \
4958 (*((PNDIS_MINIPORT_BLOCK)(MiniportAdapterHandle))->TrRxCompleteHandler)( \
4959 ((PNDIS_MINIPORT_BLOCK)MiniportAdapterHandle)->FilterDbs.TrDB); \
4966 /*IN*/ NDIS_HANDLE LogHandle
,
4967 /*IN*/ PVOID LogBuffer
,
4968 /*IN*/ UINT LogBufferSize
);
4973 NdisMQueryAdapterResources(
4974 /*OUT*/ PNDIS_STATUS Status
,
4975 /*IN*/ NDIS_HANDLE WrapperConfigurationContext
,
4976 /*OUT*/ PNDIS_RESOURCE_LIST ResourceList
,
4977 /*IN OUT*/ PUINT BufferSize
);
4982 NdisTerminateWrapper(
4983 /*IN*/ NDIS_HANDLE NdisWrapperHandle
,
4984 /*IN*/ PVOID SystemSpecific
);
4990 /*IN*/ NDIS_HANDLE MiniportAdapterHandle
,
4991 /*IN*/ PVOID VirtualAddress
,
4992 /*IN*/ UINT Length
);
4996 /* NDIS intermediate miniport structures */
4998 typedef VOID (DDKAPI
*W_MINIPORT_CALLBACK
)(
4999 /*IN*/ NDIS_HANDLE MiniportAdapterContext
,
5000 /*IN*/ PVOID CallbackContext
);
5004 /* Routines for intermediate miniport drivers */
5009 NdisIMDeInitializeDeviceInstance(
5010 /*IN*/ NDIS_HANDLE NdisMiniportHandle
);
5014 * NdisIMInitializeDeviceInstance(
5015 * IN NDIS_HANDLE DriverHandle,
5016 * IN PNDIS_STRING DeviceInstance);
5018 #define NdisIMInitializeDeviceInstance(DriverHandle, DeviceInstance) \
5019 NdisIMInitializeDeviceInstanceEx(DriverHandle, DeviceInstance, NULL)
5024 NdisIMRegisterLayeredMiniport(
5025 /*IN*/ NDIS_HANDLE NdisWrapperHandle
,
5026 /*IN*/ PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics
,
5027 /*IN*/ UINT CharacteristicsLength
,
5028 /*OUT*/ PNDIS_HANDLE DriverHandle
);
5031 /* Functions obsoleted by NDIS 5.0 */
5037 /*IN*/ PNDIS_HANDLE NdisDmaHandle
);
5042 NdisSetupDmaTransfer(
5043 /*OUT*/ PNDIS_STATUS Status
,
5044 /*IN*/ PNDIS_HANDLE NdisDmaHandle
,
5045 /*IN*/ PNDIS_BUFFER Buffer
,
5046 /*IN*/ ULONG Offset
,
5047 /*IN*/ ULONG Length
,
5048 /*IN*/ BOOLEAN WriteToDevice
);
5053 NdisUpcaseUnicodeString(
5054 /*OUT*/ PUNICODE_STRING DestinationString
,
5055 /*IN*/ PUNICODE_STRING SourceString
);
5058 /* Routines for NDIS protocol drivers */
5064 /*OUT*/ PNDIS_STATUS Status
,
5065 /*IN*/ NDIS_HANDLE NdisBindingHandle
,
5066 /*IN*/ PNDIS_REQUEST NdisRequest
);
5072 /*OUT*/ PNDIS_STATUS Status
,
5073 /*IN*/ NDIS_HANDLE NdisBindingHandle
);
5079 /*OUT*/ PNDIS_STATUS Status
,
5080 /*IN*/ NDIS_HANDLE NdisBindingHandle
,
5081 /*IN*/ PNDIS_PACKET Packet
);
5087 /*IN*/ NDIS_HANDLE NdisBindingHandle
,
5088 /*IN*/ PPNDIS_PACKET PacketArray
,
5089 /*IN*/ UINT NumberOfPackets
);
5095 /*OUT*/ PNDIS_STATUS Status
,
5096 /*IN*/ NDIS_HANDLE NdisBindingHandle
,
5097 /*IN*/ NDIS_HANDLE MacReceiveContext
,
5098 /*IN*/ UINT ByteOffset
,
5099 /*IN*/ UINT BytesToTransfer
,
5100 /*IN OUT*/ PNDIS_PACKET Packet
,
5101 /*OUT*/ PUINT BytesTransferred
);
5107 /*OUT*/ PNDIS_STATUS Status
,
5108 /*IN*/ NDIS_HANDLE NdisBindingHandle
);
5113 NdisCompleteBindAdapter(
5114 /*IN*/ NDIS_HANDLE BindAdapterContext
,
5115 /*IN*/ NDIS_STATUS Status
,
5116 /*IN*/ NDIS_STATUS OpenStatus
);
5121 NdisCompleteUnbindAdapter(
5122 /*IN*/ NDIS_HANDLE UnbindAdapterContext
,
5123 /*IN*/ NDIS_STATUS Status
);
5128 NdisDeregisterProtocol(
5129 /*OUT*/ PNDIS_STATUS Status
,
5130 /*IN*/ NDIS_HANDLE NdisProtocolHandle
);
5136 /*OUT*/ PNDIS_STATUS Status
,
5137 /*OUT*/ PNDIS_STATUS OpenErrorStatus
,
5138 /*OUT*/ PNDIS_HANDLE NdisBindingHandle
,
5139 /*OUT*/ PUINT SelectedMediumIndex
,
5140 /*IN*/ PNDIS_MEDIUM MediumArray
,
5141 /*IN*/ UINT MediumArraySize
,
5142 /*IN*/ NDIS_HANDLE NdisProtocolHandle
,
5143 /*IN*/ NDIS_HANDLE ProtocolBindingContext
,
5144 /*IN*/ PNDIS_STRING AdapterName
,
5145 /*IN*/ UINT OpenOptions
,
5146 /*IN*/ PSTRING AddressingInformation
);
5151 NdisOpenProtocolConfiguration(
5152 /*OUT*/ PNDIS_STATUS Status
,
5153 /*OUT*/ PNDIS_HANDLE ConfigurationHandle
,
5154 /*IN*/ PNDIS_STRING ProtocolSection
);
5159 NdisRegisterProtocol(
5160 /*OUT*/ PNDIS_STATUS Status
,
5161 /*OUT*/ PNDIS_HANDLE NdisProtocolHandle
,
5162 /*IN*/ PNDIS_PROTOCOL_CHARACTERISTICS ProtocolCharacteristics
,
5163 /*IN*/ UINT CharacteristicsLength
);
5165 /* Obsoleted in Windows XP */
5167 /* Prototypes for NDIS_MAC_CHARACTERISTICS */
5169 typedef NDIS_STATUS (*OPEN_ADAPTER_HANDLER
)(
5170 /*OUT*/ PNDIS_STATUS OpenErrorStatus
,
5171 /*OUT*/ NDIS_HANDLE
*MacBindingHandle
,
5172 /*OUT*/ PUINT SelectedMediumIndex
,
5173 /*IN*/ PNDIS_MEDIUM MediumArray
,
5174 /*IN*/ UINT MediumArraySize
,
5175 /*IN*/ NDIS_HANDLE NdisBindingContext
,
5176 /*IN*/ NDIS_HANDLE MacAdapterContext
,
5177 /*IN*/ UINT OpenOptions
,
5178 /*IN*/ PSTRING AddressingInformation
/*OPTIONAL*/);
5180 typedef NDIS_STATUS (DDKAPI
*CLOSE_ADAPTER_HANDLER
)(
5181 /*IN*/ NDIS_HANDLE MacBindingHandle
);
5183 typedef NDIS_STATUS (DDKAPI
*WAN_TRANSFER_DATA_HANDLER
)(
5186 typedef NDIS_STATUS (DDKAPI
*QUERY_GLOBAL_STATISTICS_HANDLER
)(
5187 /*IN*/ NDIS_HANDLE MacAdapterContext
,
5188 /*IN*/ PNDIS_REQUEST NdisRequest
);
5190 typedef VOID (DDKAPI
*UNLOAD_MAC_HANDLER
)(
5191 /*IN*/ NDIS_HANDLE MacMacContext
);
5193 typedef NDIS_STATUS (DDKAPI
*ADD_ADAPTER_HANDLER
)(
5194 /*IN*/ NDIS_HANDLE MacMacContext
,
5195 /*IN*/ NDIS_HANDLE WrapperConfigurationContext
,
5196 /*IN*/ PNDIS_STRING AdapterName
);
5198 typedef VOID (*REMOVE_ADAPTER_HANDLER
)(
5199 /*IN*/ NDIS_HANDLE MacAdapterContext
);
5201 typedef struct _NDIS_MAC_CHARACTERISTICS
{
5202 UCHAR MajorNdisVersion
;
5203 UCHAR MinorNdisVersion
;
5205 OPEN_ADAPTER_HANDLER OpenAdapterHandler
;
5206 CLOSE_ADAPTER_HANDLER CloseAdapterHandler
;
5207 SEND_HANDLER SendHandler
;
5208 TRANSFER_DATA_HANDLER TransferDataHandler
;
5209 RESET_HANDLER ResetHandler
;
5210 REQUEST_HANDLER RequestHandler
;
5211 QUERY_GLOBAL_STATISTICS_HANDLER QueryGlobalStatisticsHandler
;
5212 UNLOAD_MAC_HANDLER UnloadMacHandler
;
5213 ADD_ADAPTER_HANDLER AddAdapterHandler
;
5214 REMOVE_ADAPTER_HANDLER RemoveAdapterHandler
;
5216 } NDIS_MAC_CHARACTERISTICS
, *PNDIS_MAC_CHARACTERISTICS
;
5218 typedef NDIS_MAC_CHARACTERISTICS NDIS_WAN_MAC_CHARACTERISTICS
;
5219 typedef NDIS_WAN_MAC_CHARACTERISTICS
*PNDIS_WAN_MAC_CHARACTERISTICS
;
5225 #endif /* __NDIS_H */