8 typedef struct _PCI_DEVICE
10 // Entry on device list
12 // Physical Device Object of device
17 PCI_SLOT_NUMBER SlotNumber
;
18 // PCI configuration data
19 PCI_COMMON_CONFIG PciConfig
;
20 // Enable memory space
21 BOOLEAN EnableMemorySpace
;
23 BOOLEAN EnableIoSpace
;
25 BOOLEAN EnableBusMaster
;
26 } PCI_DEVICE
, *PPCI_DEVICE
;
39 typedef struct _COMMON_DEVICE_EXTENSION
41 // Pointer to device object, this device extension is associated with
42 PDEVICE_OBJECT DeviceObject
;
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
48 DEVICE_POWER_STATE DevicePowerState
;
49 } COMMON_DEVICE_EXTENSION
, *PCOMMON_DEVICE_EXTENSION
;
51 /* Physical Device Object device extension for a child device */
52 typedef struct _PDO_DEVICE_EXTENSION
55 COMMON_DEVICE_EXTENSION Common
;
56 // Functional device object
58 // Pointer to PCI Device informations
59 PPCI_DEVICE PciDevice
;
61 UNICODE_STRING DeviceID
;
63 UNICODE_STRING InstanceID
;
65 UNICODE_STRING HardwareIDs
;
67 UNICODE_STRING CompatibleIDs
;
68 // Textual description of device
69 UNICODE_STRING DeviceDescription
;
70 // Textual description of device location
71 UNICODE_STRING DeviceLocation
;
72 // Number of interfaces references
74 } PDO_DEVICE_EXTENSION
, *PPDO_DEVICE_EXTENSION
;
76 /* Functional Device Object device extension for the PCI driver device object */
77 typedef struct _FDO_DEVICE_EXTENSION
80 COMMON_DEVICE_EXTENSION Common
;
81 // Entry on device list
83 // PCI bus number serviced by this FDO
85 // Current state of the driver
86 PCI_DEVICE_STATE State
;
87 // Namespace device list
88 LIST_ENTRY DeviceListHead
;
89 // Number of (not removed) devices in device list
90 ULONG DeviceListCount
;
91 // Lock for namespace device list
92 KSPIN_LOCK DeviceListLock
;
93 // Lower device object
95 } FDO_DEVICE_EXTENSION
, *PFDO_DEVICE_EXTENSION
;
98 /* Driver extension associated with PCI driver */
99 typedef struct _PCI_DRIVER_EXTENSION
102 LIST_ENTRY BusListHead
;
103 // Lock for namespace bus list
104 KSPIN_LOCK BusListLock
;
105 } PCI_DRIVER_EXTENSION
, *PPCI_DRIVER_EXTENSION
;
108 /* We need a global variable to get the driver extension,
109 * because at least InterfacePciDevicePresent has no
110 * other way to get it... */
111 extern PPCI_DRIVER_EXTENSION DriverExtension
;
117 PDEVICE_OBJECT DeviceObject
,
122 PDEVICE_OBJECT DeviceObject
,
128 PciCreateDeviceIDString(
129 PUNICODE_STRING DeviceID
,
133 PciCreateInstanceIDString(
134 PUNICODE_STRING InstanceID
,
138 PciCreateHardwareIDsString(
139 PUNICODE_STRING HardwareIDs
,
143 PciCreateCompatibleIDsString(
144 PUNICODE_STRING HardwareIDs
,
148 PciCreateDeviceDescriptionString(
149 PUNICODE_STRING DeviceDescription
,
153 PciCreateDeviceLocationString(
154 PUNICODE_STRING DeviceLocation
,
158 PciDuplicateUnicodeString(
160 IN PCUNICODE_STRING SourceString
,
161 OUT PUNICODE_STRING DestinationString
);
167 PDEVICE_OBJECT DeviceObject
,
172 PDEVICE_OBJECT DeviceObject
,
178 IN PDRIVER_OBJECT DriverObject
,
179 IN PUNICODE_STRING RegistryPath
);
181 #endif /* _PCI_PCH_ */