ReactOS  0.4.15-dev-509-g96a357b
pci.h
Go to the documentation of this file.
1 #ifndef _PCI_PCH_
2 #define _PCI_PCH_
3 
4 #include <ntifs.h>
5 #include <cmreslist.h>
6 
7 #define TAG_PCI '0ICP'
8 
9 typedef struct _PCI_DEVICE
10 {
11  // Entry on device list
13  // Physical Device Object of device
15  // PCI bus number
17  // PCI slot number
19  // PCI configuration data
21  // Enable memory space
23  // Enable I/O space
25  // Enable bus master
28 
29 
30 typedef enum
31 {
38 
39 
41 {
42  // Pointer to device object, this device extension is associated with
44  // Wether this device extension is for an FDO or PDO
46  // Wether the device is removed
48  // Current device power state for the device
51 
52 /* Physical Device Object device extension for a child device */
53 typedef struct _PDO_DEVICE_EXTENSION
54 {
55  // Common device data
57  // Functional device object
59  // Pointer to PCI Device informations
61  // Device ID
63  // Instance ID
65  // Hardware IDs
67  // Compatible IDs
69  // Textual description of device
71  // Textual description of device location
73  // Number of interfaces references
76 
77 /* Functional Device Object device extension for the PCI driver device object */
78 typedef struct _FDO_DEVICE_EXTENSION
79 {
80  // Common device data
82  // Entry on device list
84  // PCI bus number serviced by this FDO
86  // Current state of the driver
88  // Namespace device list
90  // Number of (not removed) devices in device list
92  // Lock for namespace device list
94  // Lower device object
97 
98 
99 /* Driver extension associated with PCI driver */
100 typedef struct _PCI_DRIVER_EXTENSION
101 {
102  //
104  // Lock for namespace bus list
107 
108 
109 /* We need a global variable to get the driver extension,
110  * because at least InterfacePciDevicePresent has no
111  * other way to get it... */
113 
114 /* fdo.c */
115 
116 NTSTATUS
119  PIRP Irp);
120 
121 NTSTATUS
124  PIRP Irp);
125 
126 /* pci.c */
127 
128 NTSTATUS
132 
133 NTSTATUS
135  PUNICODE_STRING InstanceID,
137 
138 NTSTATUS
140  PUNICODE_STRING HardwareIDs,
142 
143 NTSTATUS
145  PUNICODE_STRING HardwareIDs,
147 
148 NTSTATUS
152 
153 NTSTATUS
155  PUNICODE_STRING DeviceLocation,
157 
158 NTSTATUS
160  IN ULONG Flags,
163 
164 /* pdo.c */
165 
166 NTSTATUS
169  PIRP Irp);
170 
171 NTSTATUS
174  PIRP Irp);
175 
176 NTSTATUS
177 NTAPI
181 
182 #endif /* _PCI_PCH_ */
Definition: pci.h:35
#define IN
Definition: typedefs.h:39
BOOLEAN EnableMemorySpace
Definition: pci.h:22
ULONG DeviceListCount
Definition: pci.h:91
NTSTATUS PciCreateDeviceDescriptionString(PUNICODE_STRING DeviceDescription, PPCI_DEVICE Device)
Definition: pci.c:387
struct _COMMON_DEVICE_EXTENSION COMMON_DEVICE_EXTENSION
_In_ PIRP _In_ PDEVICE_OBJECT Device
Definition: fatprocs.h:2029
NTSTATUS NTAPI DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
Definition: beep.c:367
_In_ PIRP Irp
Definition: csq.h:116
NTSTATUS PciCreateCompatibleIDsString(PUNICODE_STRING HardwareIDs, PPCI_DEVICE Device)
Definition: pci.c:323
LIST_ENTRY ListEntry
Definition: pci.h:83
struct _PCI_DRIVER_EXTENSION PCI_DRIVER_EXTENSION
NTSTATUS PciDuplicateUnicodeString(IN ULONG Flags, IN PCUNICODE_STRING SourceString, OUT PUNICODE_STRING DestinationString)
Definition: pci.c:670
_In_ USHORT DeviceID
Definition: iotypes.h:862
LONG NTSTATUS
Definition: precomp.h:26
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
PDEVICE_OBJECT Fdo
Definition: pci.h:58
PPCI_DEVICE PciDevice
Definition: pci.h:60
PDEVICE_OBJECT Pdo
Definition: pci.h:14
Definition: pci.h:9
PDEVICE_OBJECT Ldo
Definition: pci.h:95
NTSTATUS FdoPnpControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: fdo.c:462
KSPIN_LOCK DeviceListLock
Definition: pci.h:93
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
NTSTATUS FdoPowerControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: fdo.c:580
NTSTATUS PdoPnpControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pdo.c:1500
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
long LONG
Definition: pedump.c:60
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:41
ULONG BusNumber
Definition: pci.h:16
NTSTATUS PdoPowerControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pdo.c:1623
NTSTATUS PciCreateDeviceIDString(PUNICODE_STRING DeviceID, PPCI_DEVICE Device)
Definition: pci.c:241
LIST_ENTRY ListEntry
Definition: pci.h:12
unsigned char BOOLEAN
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1868
BOOLEAN EnableBusMaster
Definition: pci.h:26
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
COMMON_DEVICE_EXTENSION Common
Definition: pci.h:56
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
_Must_inspect_result_ _In_ PDEVICE_DESCRIPTION DeviceDescription
Definition: iofuncs.h:1015
PDEVICE_OBJECT DeviceObject
Definition: pci.h:43
UNICODE_STRING DeviceLocation
Definition: pci.h:72
Definition: pci.h:32
struct _FDO_DEVICE_EXTENSION FDO_DEVICE_EXTENSION
UNICODE_STRING HardwareIDs
Definition: pci.h:66
KSPIN_LOCK BusListLock
Definition: pci.h:105
struct _COMMON_DEVICE_EXTENSION * PCOMMON_DEVICE_EXTENSION
PCI_DEVICE_STATE State
Definition: pci.h:87
UNICODE_STRING DeviceDescription
Definition: pci.h:70
ULONG BusNumber
Definition: pci.h:85
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1868
DEVICE_POWER_STATE DevicePowerState
Definition: pci.h:49
LIST_ENTRY BusListHead
Definition: pci.h:103
struct _PCI_DEVICE PCI_DEVICE
Definition: typedefs.h:118
COMMON_DEVICE_EXTENSION Common
Definition: pci.h:81
LIST_ENTRY DeviceListHead
Definition: pci.h:89
BOOLEAN EnableIoSpace
Definition: pci.h:24
struct _PCI_DRIVER_EXTENSION * PPCI_DRIVER_EXTENSION
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1569
struct _PCI_DEVICE * PPCI_DEVICE
struct _PDO_DEVICE_EXTENSION PDO_DEVICE_EXTENSION
PCI_SLOT_NUMBER SlotNumber
Definition: pci.h:18
UNICODE_STRING InstanceID
Definition: pci.h:64
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
PCI_DEVICE_STATE
Definition: pci.h:30
Definition: pci.h:34
Definition: pci.h:33
#define OUT
Definition: typedefs.h:40
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS PciCreateDeviceLocationString(PUNICODE_STRING DeviceLocation, PPCI_DEVICE Device)
Definition: pci.c:655
NTSTATUS PciCreateHardwareIDsString(PUNICODE_STRING HardwareIDs, PPCI_DEVICE Device)
Definition: pci.c:271
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:28
UNICODE_STRING DeviceID
Definition: pci.h:62
UNICODE_STRING CompatibleIDs
Definition: pci.h:68
PCI_COMMON_CONFIG PciConfig
Definition: pci.h:20
NTSTATUS PciCreateInstanceIDString(PUNICODE_STRING InstanceID, PPCI_DEVICE Device)
Definition: pci.c:259