From b57ef2979677bb8529494eef797bce5a93bcc00a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Herv=C3=A9=20Poussineau?= Date: Wed, 23 Nov 2005 20:47:38 +0000 Subject: [PATCH] Use a common header file Small fix in CheckPciDevice svn path=/trunk/; revision=19500 --- reactos/drivers/bus/pci/fdo.c | 3 --- reactos/drivers/bus/pci/pci.c | 6 +----- reactos/drivers/bus/pci/pci.h | 3 +++ reactos/drivers/bus/pci/pdo.c | 24 ++++++++---------------- 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/reactos/drivers/bus/pci/fdo.c b/reactos/drivers/bus/pci/fdo.c index d4c9fecda0e..7daa2e7661b 100644 --- a/reactos/drivers/bus/pci/fdo.c +++ b/reactos/drivers/bus/pci/fdo.c @@ -7,9 +7,6 @@ * 10-09-2001 CSH Created */ -#include - -#include "pcidef.h" #include "pci.h" #define NDEBUG diff --git a/reactos/drivers/bus/pci/pci.c b/reactos/drivers/bus/pci/pci.c index 34d0cbd1d6c..9cd4b47fc76 100644 --- a/reactos/drivers/bus/pci/pci.c +++ b/reactos/drivers/bus/pci/pci.c @@ -7,11 +7,7 @@ * 10-09-2001 CSH Created */ -#include -#include -#include - -#include "pcidef.h" +#define INITGUID #include "pci.h" #define NDEBUG diff --git a/reactos/drivers/bus/pci/pci.h b/reactos/drivers/bus/pci/pci.h index 43230d0d1b3..f4397cbf73e 100644 --- a/reactos/drivers/bus/pci/pci.h +++ b/reactos/drivers/bus/pci/pci.h @@ -1,6 +1,9 @@ #ifndef __PCI_H #define __PCI_H +#include +#include +#include typedef struct _PCI_DEVICE { diff --git a/reactos/drivers/bus/pci/pdo.c b/reactos/drivers/bus/pci/pdo.c index 2477a00ce16..4175ccc1f49 100644 --- a/reactos/drivers/bus/pci/pdo.c +++ b/reactos/drivers/bus/pci/pdo.c @@ -7,11 +7,6 @@ * 10-09-2001 CSH Created */ -#include -#include -#include -#include -#include "pcidef.h" #include "pci.h" #define NDEBUG @@ -1020,9 +1015,9 @@ CheckPciDevice( { return FALSE; } - if ((Parameters->Flags && PCI_USE_CLASS_SUBCLASS) && ( - PciConfig->u.type0.SubVendorID != Parameters->SubVendorID || - PciConfig->u.type0.SubSystemID != Parameters->SubSystemID)) + if ((Parameters->Flags & PCI_USE_CLASS_SUBCLASS) && ( + PciConfig->BaseClass != Parameters->BaseClass || + PciConfig->SubClass != Parameters->SubClass)) { return FALSE; } @@ -1032,8 +1027,8 @@ CheckPciDevice( return FALSE; } if ((Parameters->Flags & PCI_USE_SUBSYSTEM_IDS) && ( - PciConfig->Command != Parameters->SubVendorID || - PciConfig->Status != Parameters->SubSystemID)) + PciConfig->u.type0.SubVendorID != Parameters->SubVendorID || + PciConfig->u.type0.SubSystemID != Parameters->SubSystemID)) { return FALSE; } @@ -1127,9 +1122,6 @@ PdoQueryInterface( BusInterface = (PBUS_INTERFACE_STANDARD)IrpSp->Parameters.QueryInterface.Interface; BusInterface->Size = sizeof(BUS_INTERFACE_STANDARD); BusInterface->Version = 1; - BusInterface->Context = DeviceObject; - BusInterface->InterfaceReference = InterfaceReference; - BusInterface->InterfaceDereference = InterfaceDereference; BusInterface->TranslateBusAddress = InterfaceBusTranslateBusAddress; BusInterface->GetDmaAdapter = InterfaceBusGetDmaAdapter; BusInterface->SetBusData = InterfaceBusSetBusData; @@ -1151,9 +1143,6 @@ PdoQueryInterface( PciDevicePresentInterface = (PPCI_DEVICE_PRESENT_INTERFACE)IrpSp->Parameters.QueryInterface.Interface; PciDevicePresentInterface->Size = sizeof(PCI_DEVICE_PRESENT_INTERFACE); PciDevicePresentInterface->Version = 1; - PciDevicePresentInterface->Context = DeviceObject; - PciDevicePresentInterface->InterfaceReference = InterfaceReference; - PciDevicePresentInterface->InterfaceDereference = InterfaceDereference; PciDevicePresentInterface->IsDevicePresent = InterfacePciDevicePresent; PciDevicePresentInterface->IsDevicePresentEx = InterfacePciDevicePresentEx; Status = STATUS_SUCCESS; @@ -1170,6 +1159,9 @@ PdoQueryInterface( /* Add a reference for the returned interface */ PINTERFACE Interface; Interface = (PINTERFACE)IrpSp->Parameters.QueryInterface.Interface; + Interface->Context = DeviceObject; + Interface->InterfaceReference = InterfaceReference; + Interface->InterfaceDereference = InterfaceDereference; Interface->InterfaceReference(Interface->Context); } -- 2.17.1