9 typedef struct _PCI_DEVICE
11 // Entry on device list
13 // Physical Device Object of device
18 PCI_SLOT_NUMBER SlotNumber
;
19 // PCI configuration data
20 PCI_COMMON_CONFIG PciConfig
;
21 // Enable memory space
22 BOOLEAN EnableMemorySpace
;
24 BOOLEAN EnableIoSpace
;
26 BOOLEAN EnableBusMaster
;
27 } PCI_DEVICE
, *PPCI_DEVICE
;
40 typedef struct _COMMON_DEVICE_EXTENSION
42 // Pointer to device object, this device extension is associated with
43 PDEVICE_OBJECT DeviceObject
;
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
49 DEVICE_POWER_STATE DevicePowerState
;
50 } COMMON_DEVICE_EXTENSION
, *PCOMMON_DEVICE_EXTENSION
;
52 /* Physical Device Object device extension for a child device */
53 typedef struct _PDO_DEVICE_EXTENSION
56 COMMON_DEVICE_EXTENSION Common
;
57 // Functional device object
59 // Pointer to PCI Device informations
60 PPCI_DEVICE PciDevice
;
62 UNICODE_STRING DeviceID
;
64 UNICODE_STRING InstanceID
;
66 UNICODE_STRING HardwareIDs
;
68 UNICODE_STRING CompatibleIDs
;
69 // Textual description of device
70 UNICODE_STRING DeviceDescription
;
71 // Textual description of device location
72 UNICODE_STRING DeviceLocation
;
73 // Number of interfaces references
75 } PDO_DEVICE_EXTENSION
, *PPDO_DEVICE_EXTENSION
;
77 /* Functional Device Object device extension for the PCI driver device object */
78 typedef struct _FDO_DEVICE_EXTENSION
81 COMMON_DEVICE_EXTENSION Common
;
82 // Entry on device list
84 // PCI bus number serviced by this FDO
86 // Current state of the driver
87 PCI_DEVICE_STATE State
;
88 // Namespace device list
89 LIST_ENTRY DeviceListHead
;
90 // Number of (not removed) devices in device list
91 ULONG DeviceListCount
;
92 // Lock for namespace device list
93 KSPIN_LOCK DeviceListLock
;
94 // Lower device object
96 } FDO_DEVICE_EXTENSION
, *PFDO_DEVICE_EXTENSION
;
99 /* Driver extension associated with PCI driver */
100 typedef struct _PCI_DRIVER_EXTENSION
103 LIST_ENTRY BusListHead
;
104 // Lock for namespace bus list
105 KSPIN_LOCK BusListLock
;
106 } PCI_DRIVER_EXTENSION
, *PPCI_DRIVER_EXTENSION
;
109 /* We need a global variable to get the driver extension,
110 * because at least InterfacePciDevicePresent has no
111 * other way to get it... */
112 extern PPCI_DRIVER_EXTENSION DriverExtension
;
118 PDEVICE_OBJECT DeviceObject
,
123 PDEVICE_OBJECT DeviceObject
,
129 PciCreateDeviceIDString(
130 PUNICODE_STRING DeviceID
,
134 PciCreateInstanceIDString(
135 PUNICODE_STRING InstanceID
,
139 PciCreateHardwareIDsString(
140 PUNICODE_STRING HardwareIDs
,
144 PciCreateCompatibleIDsString(
145 PUNICODE_STRING HardwareIDs
,
149 PciCreateDeviceDescriptionString(
150 PUNICODE_STRING DeviceDescription
,
154 PciCreateDeviceLocationString(
155 PUNICODE_STRING DeviceLocation
,
159 PciDuplicateUnicodeString(
161 IN PCUNICODE_STRING SourceString
,
162 OUT PUNICODE_STRING DestinationString
);
168 PDEVICE_OBJECT DeviceObject
,
173 PDEVICE_OBJECT DeviceObject
,
179 IN PDRIVER_OBJECT DriverObject
,
180 IN PUNICODE_STRING RegistryPath
);
182 #endif /* _PCI_PCH_ */