From c6ddd201c7377d85ca1ca834a78df1f9fa1b4fe4 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Wed, 12 May 2010 09:45:43 +0000 Subject: [PATCH] [HALX86] - Revert changes to HalpGetPCIData made in r47162. There is no need to introduce ReactOS-specific behavior of this function. It's much better to aim real NT compatibility, and develop your drivers against NT first and only then hack ReactOS. - Changes to buses scanning are left as they are. svn path=/trunk/; revision=47169 --- reactos/hal/halx86/generic/bus/pcibus.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/reactos/hal/halx86/generic/bus/pcibus.c b/reactos/hal/halx86/generic/bus/pcibus.c index e146fcb386a..3c46e805122 100644 --- a/reactos/hal/halx86/generic/bus/pcibus.c +++ b/reactos/hal/halx86/generic/bus/pcibus.c @@ -369,10 +369,6 @@ HalpGetPCIData(IN PBUS_HANDLER BusHandler, } #endif - /* Make sure the bus number is in our range of good bus numbers */ - if (BusHandler->BusNumber > HalpMaxPciBus || BusHandler->BusNumber < HalpMinPciBus) - return 0; - /* Normalize the length */ if (Length > sizeof(PCI_COMMON_CONFIG)) Length = sizeof(PCI_COMMON_CONFIG); @@ -394,15 +390,9 @@ HalpGetPCIData(IN PBUS_HANDLER BusHandler, /* Validate the vendor ID */ if (PciConfig->VendorID == PCI_INVALID_VENDORID) { - /* It's invalid, but we can copy PCI_INVALID_VENDORID */ - if (Offset == 0 && Length >= sizeof(USHORT)) - { - *(PUSHORT)Buffer = PCI_INVALID_VENDORID; - return sizeof(USHORT); - } - - /* We can't copy PCI_INVALID_VENDORID so just return 0 */ - return 0; + /* It's invalid, but we want to return this much */ + PciConfig->VendorID = PCI_INVALID_VENDORID; + Len = sizeof(USHORT); } /* Now check if there's space left */ @@ -465,10 +455,6 @@ HalpSetPCIData(IN PBUS_HANDLER BusHandler, } #endif - /* Make sure this bus number is in our range of good bus numbers */ - if (BusHandler->BusNumber > HalpMaxPciBus || BusHandler->BusNumber < HalpMinPciBus) - return 0; - /* Normalize the length */ if (Length > sizeof(PCI_COMMON_CONFIG)) Length = sizeof(PCI_COMMON_CONFIG);