Initial revision
[reactos.git] / reactos / drivers / net / ndis / include / miniport.h
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 #ifndef __MINIPORT_H
9 #define __MINIPORT_H
10
11 #include <ndissys.h>
12
13
14 /* Information about a miniport */
15 typedef struct _MINIPORT_DRIVER {
16 LIST_ENTRY ListEntry; /* Entry on global list */
17 KSPIN_LOCK Lock; /* Protecting spin lock */
18 ULONG RefCount; /* Reference count */
19 NDIS_MINIPORT_CHARACTERISTICS Chars; /* Miniport characteristics */
20 WORK_QUEUE_ITEM WorkItem; /* Work item */
21 PDRIVER_OBJECT DriverObject; /* Driver object of miniport */
22 NDIS_STRING RegistryPath; /* Registry path of miniport */
23 LIST_ENTRY AdapterListHead; /* Adapters created by miniport */
24 } MINIPORT_DRIVER, *PMINIPORT_DRIVER;
25
26 #define GET_MINIPORT_DRIVER(Handle)((PMINIPORT_DRIVER)Handle)
27
28 /* Information about a logical adapter */
29 typedef struct _LOGICAL_ADAPTER {
30 LIST_ENTRY ListEntry; /* Entry on global list */
31 LIST_ENTRY MiniportListEntry; /* Entry on miniport driver list */
32 KSPIN_LOCK Lock; /* Protecting spin lock */
33 ULONG RefCount; /* Reference count */
34 PMINIPORT_DRIVER Miniport; /* Miniport owning this adapter */
35 UNICODE_STRING DeviceName; /* Device name of this adapter */
36 PDEVICE_OBJECT DeviceObject; /* Device object of adapter */
37 PVOID MiniportAdapterContext; /* Adapter context for miniport */
38 ULONG Attributes; /* Attributes of adapter */
39 NDIS_INTERFACE_TYPE AdapterType; /* Type of adapter interface */
40 /* TRUE if the miniport has called NdisSetAttributes(Ex) for this adapter */
41 BOOLEAN AttributesSet;
42 PNDIS_MINIPORT_INTERRUPT InterruptObject; /* Interrupt object for adapter */
43 PVOID QueryBuffer; /* Buffer to use for queries */
44 ULONG QueryBufferLength; /* Length of QueryBuffer */
45 } LOGICAL_ADAPTER, *PLOGICAL_ADAPTER;
46
47 #define GET_LOGICAL_ADAPTER(Handle)((PLOGICAL_ADAPTER)Handle)
48
49
50 extern LIST_ENTRY MiniportListHead;
51 extern KSPIN_LOCK MiniportListLock;
52 extern LIST_ENTRY AdapterListHead;
53 extern KSPIN_LOCK AdapterListLock;
54
55 PLOGICAL_ADAPTER MiniLocateDevice(
56 PNDIS_STRING AdapterName);
57
58 NDIS_STATUS MiniQueryInformation(
59 PLOGICAL_ADAPTER Adapter,
60 NDIS_OID Oid,
61 ULONG Size,
62 PULONG BytesWritten);
63
64 #endif /* __MINIPORT_H */
65
66 /* EOF */