Build Hardware IDs and Compatible IDs for PCI devices.
[reactos.git] / reactos / drivers / bus / pci / pci.h
index a27c4ad..37f187a 100644 (file)
@@ -1,11 +1,8 @@
-/* $Id: pci.h,v 1.1 2001/09/16 13:18:24 chorns Exp $ */
+/* $Id: pci.h,v 1.7 2004/06/09 14:22:53 ekohl Exp $ */
 
 #ifndef __PCI_H
 #define __PCI_H
 
-#include <ddk/ntddk.h>
-#include <pcidef.h>
-
 
 typedef enum {
   pbtUnknown = 0,
@@ -20,6 +17,10 @@ typedef struct _PCI_DEVICE
   LIST_ENTRY ListEntry;
   // Physical Device Object of device
   PDEVICE_OBJECT Pdo;
+  // PCI bus number
+  ULONG BusNumber;
+  // PCI slot number
+  PCI_SLOT_NUMBER SlotNumber;
   // PCI configuration data
   PCI_COMMON_CONFIG PciConfig;
   // Flag used during enumeration to locate removed devices
@@ -52,7 +53,13 @@ typedef struct _COMMON_DEVICE_EXTENSION
 typedef struct _PDO_DEVICE_EXTENSION
 {
   // Common device data
-  COMMON_DEVICE_EXTENSION;
+  COMMON_DEVICE_EXTENSION Common;
+  // Functional device object
+  PDEVICE_OBJECT Fdo;
+  // PCI bus number
+  ULONG BusNumber;
+  // PCI slot number
+  PCI_SLOT_NUMBER SlotNumber;
   // Device ID
   UNICODE_STRING DeviceID;
   // Instance ID
@@ -71,9 +78,7 @@ typedef struct _PDO_DEVICE_EXTENSION
 typedef struct _FDO_DEVICE_EXTENSION
 {
   // Common device data
-  COMMON_DEVICE_EXTENSION;
-  // Physical Device Object
-  PDEVICE_OBJECT Pdo;
+  COMMON_DEVICE_EXTENSION Common;
   // Current state of the driver
   PCI_DEVICE_STATE State;
   // Namespace device list
@@ -82,8 +87,6 @@ typedef struct _FDO_DEVICE_EXTENSION
   ULONG DeviceListCount;
   // Lock for namespace device list
   KSPIN_LOCK DeviceListLock;
-  // PCI bus number
-  ULONG BusNumber;
   // Lower device object
   PDEVICE_OBJECT Ldo;
 } __attribute((packed)) FDO_DEVICE_EXTENSION, *PFDO_DEVICE_EXTENSION;
@@ -103,17 +106,38 @@ FdoPowerControl(
 
 /* pci.c */
 
-extern PCI_BUS_TYPE PciBusConfigType;
-
-PCI_BUS_TYPE
-PciGetBusConfigType(VOID);
-
 BOOLEAN
 PciCreateUnicodeString(
-  PUNICODE_STRING      Destination,
+  PUNICODE_STRING Destination,
   PWSTR Source,
   POOL_TYPE PoolType);
 
+NTSTATUS
+PciDuplicateUnicodeString(
+  PUNICODE_STRING Destination,
+  PUNICODE_STRING Source,
+  POOL_TYPE PoolType);
+
+BOOLEAN
+PciCreateDeviceIDString(
+  PUNICODE_STRING DeviceID,
+  PPCI_DEVICE Device);
+
+BOOLEAN
+PciCreateInstanceIDString(
+  PUNICODE_STRING InstanceID,
+  PPCI_DEVICE Device);
+
+BOOLEAN
+PciCreateHardwareIDsString(
+  PUNICODE_STRING HardwareIDs,
+  PPCI_DEVICE Device);
+
+BOOLEAN
+PciCreateCompatibleIDsString(
+  PUNICODE_STRING HardwareIDs,
+  PPCI_DEVICE Device);
+
 /* pdo.c */
 
 NTSTATUS