-/* $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,
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
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
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
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;
/* 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