ReactOS 0.4.15-dev-8100-g1887773
miniport.h
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS NDIS library
4 * FILE: ndis/miniport.h
5 * PURPOSE: Definitions for routines used by NDIS miniport drivers
6 */
7
8#pragma once
9
10struct _ADAPTER_BINDING;
11
12typedef struct _HARDWARE_ADDRESS {
13 union {
17
18/* Information about a miniport */
19typedef struct _NDIS_M_DRIVER_BLOCK {
20 LIST_ENTRY ListEntry; /* Entry on global list */
21 KSPIN_LOCK Lock; /* Protecting spin lock */
23 WORK_QUEUE_ITEM WorkItem; /* Work item */
24 PDRIVER_OBJECT DriverObject; /* Driver object of miniport */
25 LIST_ENTRY DeviceList; /* Adapters created by miniport */
26 PUNICODE_STRING RegistryPath; /* SCM Registry key */
27#if !defined(_MSC_VER) && defined(_NDIS_)
28} NDIS_M_DRIVER_BLOCK_COMPATIBILITY_HACK_DONT_USE;
29#else
31#endif
32
33/* There must be some defined struct to do this... */
34typedef struct _NDIS_M_DEVICE_BLOCK {
39
40/* resources allocated on behalf on the miniport */
41#define MINIPORT_RESOURCE_TYPE_REGISTRY_DATA 0
42#define MINIPORT_RESOURCE_TYPE_MEMORY 1
43typedef struct _MINIPORT_RESOURCE {
48
49/* Configuration context */
55
56/* Bugcheck callback context */
62
63/* a miniport's shared memory */
74
75/* A structure of WrapperConfigurationContext (not compatible with the
76 Windows one). */
77typedef struct _NDIS_WRAPPER_CONTEXT {
83
84#define GET_MINIPORT_DRIVER(Handle)((PNDIS_M_DRIVER_BLOCK)Handle)
85
86/* Information about a logical adapter */
87typedef struct _LOGICAL_ADAPTER
88{
89 NDIS_MINIPORT_BLOCK NdisMiniportBlock; /* NDIS defined fields */
90 PNDIS_MINIPORT_WORK_ITEM WorkQueueHead; /* Head of work queue */
91 PNDIS_MINIPORT_WORK_ITEM WorkQueueTail; /* Tail of work queue */
92 LIST_ENTRY ListEntry; /* Entry on global list */
93 LIST_ENTRY MiniportListEntry; /* Entry on miniport driver list */
94 LIST_ENTRY ProtocolListHead; /* List of bound protocols */
95 ULONG MediumHeaderSize; /* Size of medium header */
96 HARDWARE_ADDRESS Address; /* Hardware address of adapter */
97 ULONG AddressLength; /* Length of hardware address */
98 PMINIPORT_BUGCHECK_CONTEXT BugcheckContext; /* Adapter's shutdown handler */
100
101#define GET_LOGICAL_ADAPTER(Handle)((PLOGICAL_ADAPTER)Handle)
102
107
108
109#if DBG
110VOID
111MiniDisplayPacket(
113 PCSTR Reason);
114#endif /* DBG */
115
116VOID
118 PLOGICAL_ADAPTER Adapter,
119 NDIS_HANDLE MacReceiveContext,
120 PVOID HeaderBuffer,
121 UINT HeaderBufferSize,
122 PVOID LookaheadBuffer,
123 UINT LookaheadBufferSize,
125
128 PLOGICAL_ADAPTER Adapter,
130
134
137 PLOGICAL_ADAPTER Adapter,
138 NDIS_OID Oid,
139 ULONG Size,
142
143VOID
146 PLOGICAL_ADAPTER Adapter,
147 NDIS_WORK_ITEM_TYPE WorkItemType,
148 PVOID WorkItemContext,
149 BOOLEAN Top);
150
154 PLOGICAL_ADAPTER Adapter,
155 NDIS_WORK_ITEM_TYPE *WorkItemType,
156 PVOID *WorkItemContext);
157
160 PLOGICAL_ADAPTER Adapter,
162
165 UINT VendorID,
169
170VOID
172
173VOID
174NTAPI
178
184
187 PLOGICAL_ADAPTER Adapter,
189
192 PLOGICAL_ADAPTER Adapter);
193
194VOID
196 PLOGICAL_ADAPTER Adapter);
197
198VOID
200 PLOGICAL_ADAPTER Adapter,
201 NDIS_WORK_ITEM_TYPE WorkItemType);
202
203/* EOF */
unsigned char BOOLEAN
Type
Definition: Type.h:7
static LPHIST_ENTRY Top
Definition: history.c:53
Definition: bufpool.h:45
BOOLEAN NdisFindDevice(UINT VendorID, UINT DeviceID, PUINT BusNumber, PUINT SlotNumber)
NDIS_STATUS MiniQueryInformation(PLOGICAL_ADAPTER Adapter, NDIS_OID Oid, ULONG Size, PVOID Buffer, PULONG BytesWritten)
Definition: miniport.c:805
LIST_ENTRY AdapterListHead
Definition: miniport.c:57
VOID MiniWorkItemComplete(PLOGICAL_ADAPTER Adapter, NDIS_WORK_ITEM_TYPE WorkItemType)
Definition: miniport.c:964
VOID NTAPI MiniSendComplete(IN NDIS_HANDLE MiniportAdapterHandle, IN PNDIS_PACKET Packet, IN NDIS_STATUS Status)
Definition: miniport.c:530
struct _NDIS_M_DEVICE_BLOCK NDIS_M_DEVICE_BLOCK
struct _NDIS_M_DEVICE_BLOCK * PNDIS_M_DEVICE_BLOCK
NDIS_STATUS FASTCALL MiniDequeueWorkItem(PLOGICAL_ADAPTER Adapter, NDIS_WORK_ITEM_TYPE *WorkItemType, PVOID *WorkItemContext)
Definition: miniport.c:1050
NDIS_STATUS MiniDoRequest(PLOGICAL_ADAPTER Adapter, PNDIS_REQUEST NdisRequest)
Definition: miniport.c:1107
struct _NDIS_M_DRIVER_BLOCK NDIS_M_DRIVER_BLOCK
struct _MINIPORT_SHARED_MEMORY MINIPORT_SHARED_MEMORY
struct _LOGICAL_ADAPTER * PLOGICAL_ADAPTER
struct _NDIS_M_DRIVER_BLOCK * PNDIS_M_DRIVER_BLOCK
struct _HARDWARE_ADDRESS HARDWARE_ADDRESS
VOID NTAPI MiniportWorker(IN PDEVICE_OBJECT DeviceObject, IN PVOID WorkItem)
Definition: miniport.c:1223
struct _MINIPORT_CONFIGURATION_CONTEXT MINIPORT_CONFIGURATION_CONTEXT
NDIS_STATUS MiniReset(PLOGICAL_ADAPTER Adapter)
Definition: miniport.c:902
struct _NDIS_WRAPPER_CONTEXT NDIS_WRAPPER_CONTEXT
struct _MINIPORT_BUGCHECK_CONTEXT * PMINIPORT_BUGCHECK_CONTEXT
struct _MINIPORT_BUGCHECK_CONTEXT MINIPORT_BUGCHECK_CONTEXT
struct _MINIPORT_SHARED_MEMORY * PMINIPORT_SHARED_MEMORY
LIST_ENTRY MiniportListHead
Definition: miniport.c:53
KSPIN_LOCK AdapterListLock
Definition: miniport.c:58
struct _MINIPORT_RESOURCE MINIPORT_RESOURCE
BOOLEAN MiniAdapterHasAddress(PLOGICAL_ADAPTER Adapter, PNDIS_PACKET Packet)
Definition: miniport.c:616
VOID FASTCALL MiniQueueWorkItem(PLOGICAL_ADAPTER Adapter, NDIS_WORK_ITEM_TYPE WorkItemType, PVOID WorkItemContext, BOOLEAN Top)
Definition: miniport.c:982
PLOGICAL_ADAPTER MiniLocateDevice(PNDIS_STRING AdapterName)
Definition: miniport.c:690
struct _MINIPORT_RESOURCE * PMINIPORT_RESOURCE
KSPIN_LOCK MiniportListLock
Definition: miniport.c:54
struct _NDIS_WRAPPER_CONTEXT * PNDIS_WRAPPER_CONTEXT
struct _HARDWARE_ADDRESS * PHARDWARE_ADDRESS
BOOLEAN MiniIsBusy(PLOGICAL_ADAPTER Adapter, NDIS_WORK_ITEM_TYPE Type)
Definition: miniport.c:142
VOID MiniIndicateData(PLOGICAL_ADAPTER Adapter, NDIS_HANDLE MacReceiveContext, PVOID HeaderBuffer, UINT HeaderBufferSize, PVOID LookaheadBuffer, UINT LookaheadBufferSize, UINT PacketSize)
Definition: miniport.c:175
struct _LOGICAL_ADAPTER LOGICAL_ADAPTER
VOID NdisStartDevices(VOID)
VOID MiniDoAddressingReset(PLOGICAL_ADAPTER Adapter)
Definition: miniport.c:888
struct _MINIPORT_CONFIGURATION_CONTEXT * PMINIPORT_CONFIGURATION_CONTEXT
#define ETH_LENGTH_OF_ADDRESS
Definition: efilter.h:16
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
Status
Definition: gdiplustypes.h:25
PVOID PVOID PWCHAR PVOID USHORT PULONG Reason
Definition: env.c:47
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
Definition: ndis.h:1549
unsigned int * PUINT
Definition: ndis.h:50
unsigned int UINT
Definition: ndis.h:50
VOID(NTAPI * ADAPTER_SHUTDOWN_HANDLER)(_In_ PVOID ShutdownContext)
Definition: ndis.h:2025
_In_ NDIS_HANDLE MiniportAdapterHandle
Definition: ndis.h:4668
enum _NDIS_WORK_ITEM_TYPE NDIS_WORK_ITEM_TYPE
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE _Out_ PUINT _In_ UINT _In_ NDIS_HANDLE _In_ NDIS_HANDLE _In_ PNDIS_STRING AdapterName
Definition: ndis.h:6016
_In_opt_ NDIS_HANDLE _In_opt_ NDIS_HANDLE _Inout_ PNDIS_REQUEST NdisRequest
Definition: ndis.h:1573
#define FASTCALL
Definition: nt_native.h:50
int NDIS_STATUS
Definition: ntddndis.h:475
ULONG NDIS_OID
Definition: ntddndis.h:230
UCHAR Medium802_3[ETH_LENGTH_OF_ADDRESS]
Definition: miniport.h:14
union _HARDWARE_ADDRESS::@1007 Type
Definition: typedefs.h:120
PNDIS_MINIPORT_WORK_ITEM WorkQueueTail
Definition: miniport.h:91
HARDWARE_ADDRESS Address
Definition: miniport.h:96
LIST_ENTRY ListEntry
Definition: miniport.h:92
ULONG AddressLength
Definition: miniport.h:97
PMINIPORT_BUGCHECK_CONTEXT BugcheckContext
Definition: miniport.h:98
LIST_ENTRY ProtocolListHead
Definition: miniport.h:94
PNDIS_MINIPORT_WORK_ITEM WorkQueueHead
Definition: miniport.h:90
NDIS_MINIPORT_BLOCK NdisMiniportBlock
Definition: miniport.h:89
ULONG MediumHeaderSize
Definition: miniport.h:95
LIST_ENTRY MiniportListEntry
Definition: miniport.h:93
PKBUGCHECK_CALLBACK_RECORD CallbackRecord
Definition: miniport.h:60
ADAPTER_SHUTDOWN_HANDLER ShutdownHandler
Definition: miniport.h:59
LIST_ENTRY ListEntry
Definition: miniport.h:44
ULONG ResourceType
Definition: miniport.h:45
PIO_WORKITEM WorkItem
Definition: miniport.h:72
PNDIS_MINIPORT_BLOCK Adapter
Definition: miniport.h:70
PHYSICAL_ADDRESS PhysicalAddress
Definition: miniport.h:67
PDMA_ADAPTER AdapterObject
Definition: miniport.h:65
PDEVICE_OBJECT DeviceObject
Definition: miniport.h:35
PNDIS_STRING SymbolicName
Definition: miniport.h:36
NDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics
Definition: miniport.h:22
LIST_ENTRY DeviceList
Definition: miniport.h:25
WORK_QUEUE_ITEM WorkItem
Definition: miniport.h:23
LIST_ENTRY ListEntry
Definition: miniport.h:20
PUNICODE_STRING RegistryPath
Definition: miniport.h:26
PDRIVER_OBJECT DriverObject
Definition: miniport.h:24
KSPIN_LOCK Lock
Definition: miniport.h:21
PDEVICE_OBJECT DeviceObject
Definition: miniport.h:79
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
const char * PCSTR
Definition: typedefs.h:52
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_In_ UCHAR MajorFunction
Definition: wdfdevice.h:1697
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
Definition: wdfiotarget.h:960
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceID
Definition: wdfpdo.h:278
_In_ WDFIORESREQLIST _In_ ULONG SlotNumber
Definition: wdfresource.h:68
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWORKITEM * WorkItem
Definition: wdfworkitem.h:115
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:160
_In_ USHORT PacketSize
Definition: iofuncs.h:1058
DRIVER_DISPATCH * PDRIVER_DISPATCH
Definition: iotypes.h:2262
#define IRP_MJ_MAXIMUM_FUNCTION
unsigned char UCHAR
Definition: xmlstorage.h:181