ReactOS  0.4.13-dev-242-g611e6d7
pci.h
Go to the documentation of this file.
1 #ifndef _PCI_PCH_
2 #define _PCI_PCH_
3 
4 #include <ntifs.h>
5 
6 #define TAG_PCI '0ICP'
7 
8 typedef struct _PCI_DEVICE
9 {
10  // Entry on device list
12  // Physical Device Object of device
14  // PCI bus number
16  // PCI slot number
18  // PCI configuration data
20  // Enable memory space
22  // Enable I/O space
24  // Enable bus master
27 
28 
29 typedef enum
30 {
37 
38 
40 {
41  // Pointer to device object, this device extension is associated with
43  // Wether this device extension is for an FDO or PDO
45  // Wether the device is removed
47  // Current device power state for the device
50 
51 /* Physical Device Object device extension for a child device */
52 typedef struct _PDO_DEVICE_EXTENSION
53 {
54  // Common device data
56  // Functional device object
58  // Pointer to PCI Device informations
60  // Device ID
62  // Instance ID
64  // Hardware IDs
66  // Compatible IDs
68  // Textual description of device
70  // Textual description of device location
72  // Number of interfaces references
75 
76 /* Functional Device Object device extension for the PCI driver device object */
77 typedef struct _FDO_DEVICE_EXTENSION
78 {
79  // Common device data
81  // Entry on device list
83  // PCI bus number serviced by this FDO
85  // Current state of the driver
87  // Namespace device list
89  // Number of (not removed) devices in device list
91  // Lock for namespace device list
93  // Lower device object
96 
97 
98 /* Driver extension associated with PCI driver */
99 typedef struct _PCI_DRIVER_EXTENSION
100 {
101  //
103  // Lock for namespace bus list
106 
107 
108 /* We need a global variable to get the driver extension,
109  * because at least InterfacePciDevicePresent has no
110  * other way to get it... */
112 
113 /* fdo.c */
114 
115 NTSTATUS
118  PIRP Irp);
119 
120 NTSTATUS
123  PIRP Irp);
124 
125 /* pci.c */
126 
127 NTSTATUS
131 
132 NTSTATUS
134  PUNICODE_STRING InstanceID,
136 
137 NTSTATUS
139  PUNICODE_STRING HardwareIDs,
141 
142 NTSTATUS
144  PUNICODE_STRING HardwareIDs,
146 
147 NTSTATUS
151 
152 NTSTATUS
154  PUNICODE_STRING DeviceLocation,
156 
157 NTSTATUS
159  IN ULONG Flags,
162 
163 /* pdo.c */
164 
165 NTSTATUS
168  PIRP Irp);
169 
170 NTSTATUS
173  PIRP Irp);
174 
175 NTSTATUS
176 NTAPI
180 
181 #endif /* _PCI_PCH_ */
Definition: pci.h:34
#define IN
Definition: typedefs.h:38
BOOLEAN EnableMemorySpace
Definition: pci.h:21
ULONG DeviceListCount
Definition: pci.h:90
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:2020
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:82
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:859
LONG NTSTATUS
Definition: precomp.h:26
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
PDEVICE_OBJECT Fdo
Definition: pci.h:57
PPCI_DEVICE PciDevice
Definition: pci.h:59
PDEVICE_OBJECT Pdo
Definition: pci.h:13
Definition: pci.h:8
PDEVICE_OBJECT Ldo
Definition: pci.h:94
NTSTATUS FdoPnpControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: fdo.c:462
KSPIN_LOCK DeviceListLock
Definition: pci.h:92
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:1499
_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:15
NTSTATUS PdoPowerControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pdo.c:1645
NTSTATUS PciCreateDeviceIDString(PUNICODE_STRING DeviceID, PPCI_DEVICE Device)
Definition: pci.c:241
LIST_ENTRY ListEntry
Definition: pci.h:11
unsigned char BOOLEAN
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1869
BOOLEAN EnableBusMaster
Definition: pci.h:25
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
COMMON_DEVICE_EXTENSION Common
Definition: pci.h:55
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
_Must_inspect_result_ _In_ PDEVICE_DESCRIPTION DeviceDescription
Definition: iofuncs.h:1015
PDEVICE_OBJECT DeviceObject
Definition: pci.h:42
UNICODE_STRING DeviceLocation
Definition: pci.h:71
Definition: pci.h:31
struct _FDO_DEVICE_EXTENSION FDO_DEVICE_EXTENSION
UNICODE_STRING HardwareIDs
Definition: pci.h:65
KSPIN_LOCK BusListLock
Definition: pci.h:104
struct _COMMON_DEVICE_EXTENSION * PCOMMON_DEVICE_EXTENSION
PCI_DEVICE_STATE State
Definition: pci.h:86
UNICODE_STRING DeviceDescription
Definition: pci.h:69
ULONG BusNumber
Definition: pci.h:84
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1869
DEVICE_POWER_STATE DevicePowerState
Definition: pci.h:48
LIST_ENTRY BusListHead
Definition: pci.h:102
struct _PCI_DEVICE PCI_DEVICE
Definition: typedefs.h:117
COMMON_DEVICE_EXTENSION Common
Definition: pci.h:80
LIST_ENTRY DeviceListHead
Definition: pci.h:88
BOOLEAN EnableIoSpace
Definition: pci.h:23
struct _PCI_DRIVER_EXTENSION * PPCI_DRIVER_EXTENSION
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
struct _PCI_DEVICE * PPCI_DEVICE
struct _PDO_DEVICE_EXTENSION PDO_DEVICE_EXTENSION
PCI_SLOT_NUMBER SlotNumber
Definition: pci.h:17
UNICODE_STRING InstanceID
Definition: pci.h:63
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
PCI_DEVICE_STATE
Definition: pci.h:29
Definition: pci.h:33
Definition: pci.h:32
#define OUT
Definition: typedefs.h:39
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:27
UNICODE_STRING DeviceID
Definition: pci.h:61
UNICODE_STRING CompatibleIDs
Definition: pci.h:67
PCI_COMMON_CONFIG PciConfig
Definition: pci.h:19
NTSTATUS PciCreateInstanceIDString(PUNICODE_STRING InstanceID, PPCI_DEVICE Device)
Definition: pci.c:259