ReactOS  0.4.15-dev-4872-g8a3db97
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 
10 typedef 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 
33 typedef 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 */
56 typedef struct _PDO_DEVICE_EXTENSION
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 */
81 typedef struct _FDO_DEVICE_EXTENSION
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 */
103 typedef struct _PCI_DRIVER_EXTENSION
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 
135 NTSTATUS
138  PIRP Irp);
139 
140 NTSTATUS
143  PIRP Irp);
144 
145 /* pci.c */
146 
147 NTSTATUS
151 
152 NTSTATUS
156 
157 NTSTATUS
159  PUNICODE_STRING HardwareIDs,
161 
162 NTSTATUS
164  PUNICODE_STRING HardwareIDs,
166 
167 NTSTATUS
171 
172 NTSTATUS
176 
177 NTSTATUS
179  IN ULONG Flags,
182 
183 /* pdo.c */
184 
185 NTSTATUS
188  PIRP Irp);
189 
190 NTSTATUS
193  PIRP Irp);
194 
195 
196 CODE_SEG("INIT")
197 NTSTATUS
198 NTAPI
202 
203 #endif /* _PCI_PCH_ */
Definition: pci.h:38
#define IN
Definition: typedefs.h:39
BOOLEAN EnableMemorySpace
Definition: pci.h:23
union _PCI_TYPE1_CFG_CYCLE_BITS * PPCI_TYPE1_CFG_CYCLE_BITS
ULONG DeviceListCount
Definition: pci.h:94
NTSTATUS PciCreateDeviceDescriptionString(PUNICODE_STRING DeviceDescription, PPCI_DEVICE Device)
Definition: pci.c:430
struct _COMMON_DEVICE_EXTENSION COMMON_DEVICE_EXTENSION
NTSTATUS NTAPI DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
Definition: beep.c:367
BOOLEAN IsDebuggingDevice
Definition: pci.h:29
NTSTATUS PciCreateCompatibleIDsString(PUNICODE_STRING HardwareIDs, PPCI_DEVICE Device)
Definition: pci.c:366
LIST_ENTRY ListEntry
Definition: pci.h:86
struct _PCI_DRIVER_EXTENSION PCI_DRIVER_EXTENSION
NTSTATUS PciDuplicateUnicodeString(IN ULONG Flags, IN PCUNICODE_STRING SourceString, OUT PUNICODE_STRING DestinationString)
Definition: pci.c:713
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:213
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
PDEVICE_OBJECT Fdo
Definition: pci.h:61
PPCI_DEVICE PciDevice
Definition: pci.h:63
PDEVICE_OBJECT Pdo
Definition: pci.h:15
PDEVICE_OBJECT Ldo
Definition: pci.h:98
NTSTATUS FdoPnpControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: fdo.c:469
KSPIN_LOCK DeviceListLock
Definition: pci.h:96
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
NTSTATUS FdoPowerControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: fdo.c:594
NTSTATUS PdoPnpControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pdo.c:1500
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceDescription
Definition: wdfpdo.h:430
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
_In_ PIRP Irp
Definition: csq.h:116
long LONG
Definition: pedump.c:60
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:31
ULONG BusNumber
Definition: pci.h:17
NTSTATUS PdoPowerControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pdo.c:1623
NTSTATUS PciCreateDeviceIDString(PUNICODE_STRING DeviceID, PPCI_DEVICE Device)
Definition: pci.c:284
LIST_ENTRY ListEntry
Definition: pci.h:13
unsigned char BOOLEAN
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1868
BOOLEAN EnableBusMaster
Definition: pci.h:27
COMMON_DEVICE_EXTENSION Common
Definition: pci.h:59
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
PDEVICE_OBJECT DeviceObject
Definition: pci.h:46
PCI_TYPE1_CFG_CYCLE_BITS PciDebuggingDevice[2]
Definition: pci.c:33
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
UNICODE_STRING DeviceLocation
Definition: pci.h:75
Definition: pci.h:35
struct _FDO_DEVICE_EXTENSION FDO_DEVICE_EXTENSION
UNICODE_STRING HardwareIDs
Definition: pci.h:69
KSPIN_LOCK BusListLock
Definition: pci.h:108
struct _COMMON_DEVICE_EXTENSION * PCOMMON_DEVICE_EXTENSION
PCI_DEVICE_STATE State
Definition: pci.h:90
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING InstanceID
Definition: wdfpdo.h:306
UNICODE_STRING DeviceDescription
Definition: pci.h:73
ULONG BusNumber
Definition: pci.h:88
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1868
DEVICE_POWER_STATE DevicePowerState
Definition: pci.h:52
LIST_ENTRY BusListHead
Definition: pci.h:106
struct _PCI_DEVICE PCI_DEVICE
BOOLEAN HasDebuggingDevice
Definition: pci.c:32
Definition: typedefs.h:119
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceID
Definition: wdfpdo.h:275
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
COMMON_DEVICE_EXTENSION Common
Definition: pci.h:84
LIST_ENTRY DeviceListHead
Definition: pci.h:92
BOOLEAN EnableIoSpace
Definition: pci.h:25
struct _PCI_DRIVER_EXTENSION * PPCI_DRIVER_EXTENSION
struct _PCI_DEVICE * PPCI_DEVICE
struct _PDO_DEVICE_EXTENSION PDO_DEVICE_EXTENSION
PCI_SLOT_NUMBER SlotNumber
Definition: pci.h:19
UNICODE_STRING InstanceID
Definition: pci.h:67
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING _In_ PCUNICODE_STRING DeviceLocation
Definition: wdfpdo.h:430
PCI_DEVICE_STATE
Definition: pci.h:33
union _PCI_TYPE1_CFG_CYCLE_BITS PCI_TYPE1_CFG_CYCLE_BITS
Definition: pci.h:37
Definition: pci.h:36
#define OUT
Definition: typedefs.h:40
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS PciCreateDeviceLocationString(PUNICODE_STRING DeviceLocation, PPCI_DEVICE Device)
Definition: pci.c:698
NTSTATUS PciCreateHardwareIDsString(PUNICODE_STRING HardwareIDs, PPCI_DEVICE Device)
Definition: pci.c:314
UNICODE_STRING DeviceID
Definition: pci.h:65
UNICODE_STRING CompatibleIDs
Definition: pci.h:71
static CODE_SEG("PAGE")
Definition: isapnp.c:1482
PCI_COMMON_CONFIG PciConfig
Definition: pci.h:21
NTSTATUS PciCreateInstanceIDString(PUNICODE_STRING InstanceID, PPCI_DEVICE Device)
Definition: pci.c:302