ReactOS 0.4.16-dev-226-g79f2289
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#include <ntstrsafe.h>
7
8#define TAG_PCI '0ICP'
9
10typedef struct _PCI_DEVICE
11{
12 // Entry on device list
14 // Physical Device Object of device
16 // PCI bus number
18 // PCI slot number
20 // PCI configuration data
22 // Enable memory space
24 // Enable I/O space
26 // Enable bus master
28 // Whether the device is owned by the KD
31
32
33typedef enum
34{
41
42
44{
45 // Pointer to device object, this device extension is associated with
47 // Wether this device extension is for an FDO or PDO
49 // Wether the device is removed
51 // Current device power state for the device
54
55/* Physical Device Object device extension for a child device */
57{
58 // Common device data
60 // Functional device object
62 // Pointer to PCI Device informations
64 // Device ID
66 // Instance ID
68 // Hardware IDs
70 // Compatible IDs
72 // Textual description of device
74 // Textual description of device location
76 // Number of interfaces references
79
80/* Functional Device Object device extension for the PCI driver device object */
82{
83 // Common device data
85 // Entry on device list
87 // PCI bus number serviced by this FDO
89 // Current state of the driver
91 // Namespace device list
93 // Number of (not removed) devices in device list
95 // Lock for namespace device list
97 // Lower device object
100
101
102/* Driver extension associated with PCI driver */
104{
105 //
107 // Lock for namespace bus list
110
112{
113 struct
114 {
121 };
124
125/* We need a global variable to get the driver extension,
126 * because at least InterfacePciDevicePresent has no
127 * other way to get it... */
129
132
133/* fdo.c */
134
138 PIRP Irp);
139
143 PIRP Irp);
144
145/* pci.c */
146
151
156
159 PUNICODE_STRING HardwareIDs,
161
164 PUNICODE_STRING HardwareIDs,
166
171
176
179 IN ULONG Flags,
182
183/* pdo.c */
184
188 PIRP Irp);
189
193 PIRP Irp);
194
195
196CODE_SEG("INIT")
198NTAPI
202
203#endif /* _PCI_PCH_ */
#define CODE_SEG(...)
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
_In_ PIRP Irp
Definition: csq.h:116
DRIVER_INITIALIZE DriverEntry
Definition: condrv.c:21
struct _PCI_DRIVER_EXTENSION * PPCI_DRIVER_EXTENSION
struct _FDO_DEVICE_EXTENSION FDO_DEVICE_EXTENSION
struct _PCI_DEVICE * PPCI_DEVICE
PCI_TYPE1_CFG_CYCLE_BITS PciDebuggingDevice[2]
Definition: pci.c:33
NTSTATUS PdoPnpControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pdo.c:1502
NTSTATUS PciCreateInstanceIDString(PUNICODE_STRING InstanceID, PPCI_DEVICE Device)
Definition: pci.c:302
NTSTATUS PciCreateDeviceDescriptionString(PUNICODE_STRING DeviceDescription, PPCI_DEVICE Device)
Definition: pci.c:430
NTSTATUS PciCreateDeviceIDString(PUNICODE_STRING DeviceID, PPCI_DEVICE Device)
Definition: pci.c:284
NTSTATUS FdoPowerControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: fdo.c:594
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
NTSTATUS PciCreateHardwareIDsString(PUNICODE_STRING HardwareIDs, PPCI_DEVICE Device)
Definition: pci.c:314
NTSTATUS PdoPowerControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pdo.c:1625
struct _PCI_DEVICE PCI_DEVICE
NTSTATUS PciCreateDeviceLocationString(PUNICODE_STRING DeviceLocation, PPCI_DEVICE Device)
Definition: pci.c:698
struct _PDO_DEVICE_EXTENSION PDO_DEVICE_EXTENSION
union _PCI_TYPE1_CFG_CYCLE_BITS PCI_TYPE1_CFG_CYCLE_BITS
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
union _PCI_TYPE1_CFG_CYCLE_BITS * PPCI_TYPE1_CFG_CYCLE_BITS
NTSTATUS FdoPnpControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: fdo.c:469
NTSTATUS PciCreateCompatibleIDsString(PUNICODE_STRING HardwareIDs, PPCI_DEVICE Device)
Definition: pci.c:366
struct _COMMON_DEVICE_EXTENSION COMMON_DEVICE_EXTENSION
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:31
BOOLEAN HasDebuggingDevice
Definition: pci.c:32
NTSTATUS PciDuplicateUnicodeString(IN ULONG Flags, IN PCUNICODE_STRING SourceString, OUT PUNICODE_STRING DestinationString)
Definition: pci.c:713
struct _PCI_DRIVER_EXTENSION PCI_DRIVER_EXTENSION
struct _COMMON_DEVICE_EXTENSION * PCOMMON_DEVICE_EXTENSION
PCI_DEVICE_STATE
Definition: pci.h:34
@ dsSurpriseRemoved
Definition: pci.h:39
@ dsStopped
Definition: pci.h:35
@ dsPaused
Definition: pci.h:37
@ dsStarted
Definition: pci.h:36
@ dsRemoved
Definition: pci.h:38
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1922
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1921
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
long LONG
Definition: pedump.c:60
DEVICE_POWER_STATE DevicePowerState
Definition: pci.h:52
PDEVICE_OBJECT DeviceObject
Definition: pci.h:46
ULONG BusNumber
Definition: pci.h:88
PDEVICE_OBJECT Ldo
Definition: pci.h:98
LIST_ENTRY ListEntry
Definition: pci.h:86
COMMON_DEVICE_EXTENSION Common
Definition: pci.h:84
ULONG DeviceListCount
Definition: pci.h:94
PCI_DEVICE_STATE State
Definition: pci.h:90
LIST_ENTRY DeviceListHead
Definition: pci.h:92
KSPIN_LOCK DeviceListLock
Definition: pci.h:96
Definition: typedefs.h:120
PCI_SLOT_NUMBER SlotNumber
Definition: pci.h:19
LIST_ENTRY ListEntry
Definition: pci.h:13
BOOLEAN EnableIoSpace
Definition: pci.h:25
BOOLEAN EnableMemorySpace
Definition: pci.h:23
PCI_COMMON_CONFIG PciConfig
Definition: pci.h:21
PDEVICE_OBJECT Pdo
Definition: pci.h:15
BOOLEAN IsDebuggingDevice
Definition: pci.h:29
BOOLEAN EnableBusMaster
Definition: pci.h:27
ULONG BusNumber
Definition: pci.h:17
KSPIN_LOCK BusListLock
Definition: pci.h:108
LIST_ENTRY BusListHead
Definition: pci.h:106
PDEVICE_OBJECT Fdo
Definition: pci.h:61
UNICODE_STRING DeviceDescription
Definition: pci.h:73
UNICODE_STRING CompatibleIDs
Definition: pci.h:71
PPCI_DEVICE PciDevice
Definition: pci.h:63
UNICODE_STRING InstanceID
Definition: pci.h:67
UNICODE_STRING HardwareIDs
Definition: pci.h:69
UNICODE_STRING DeviceLocation
Definition: pci.h:75
UNICODE_STRING DeviceID
Definition: pci.h:65
COMMON_DEVICE_EXTENSION Common
Definition: pci.h:59
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING InstanceID
Definition: wdfpdo.h:309
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING _In_ PCUNICODE_STRING DeviceLocation
Definition: wdfpdo.h:434
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceDescription
Definition: wdfpdo.h:432
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceID
Definition: wdfpdo.h:278
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170