Author: cgutman Date: Mon Jan 30 21:36:51 2012 New Revision: 55336
URL: http://svn.reactos.org/svn/reactos?rev=55336&view=rev Log: [HIVESYS] - Fix the service entries [HAL] - Synchronously invalidate device relations [NTOSKRNL] - Remove hacks
Modified: branches/usb-bringup-trunk/boot/bootdata/hivesys_i386.inf branches/usb-bringup-trunk/hal/halx86/acpi/halpnpdd.c branches/usb-bringup-trunk/hal/halx86/legacy/halpnpdd.c branches/usb-bringup-trunk/ntoskrnl/io/pnpmgr/pnpmgr.c
Modified: branches/usb-bringup-trunk/boot/bootdata/hivesys_i386.inf URL: http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/boot/bootdata/... ============================================================================== --- branches/usb-bringup-trunk/boot/bootdata/hivesys_i386.inf [iso-8859-1] (original) +++ branches/usb-bringup-trunk/boot/bootdata/hivesys_i386.inf [iso-8859-1] Mon Jan 30 21:36:51 2012 @@ -1453,31 +1453,35 @@
; USB hub driver HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","ErrorControl",0x00010001,0x00000001 -HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","Group",0x00000000,"Boot Bus" +HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","Group",0x00000000,"Boot Bus Extender" HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","Tag",0x00010001,0x00000002 HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","ImagePath",0x00020000,"system32\drivers\usbhub.sys" HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","Start",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","Type",0x00010001,0x00000002
; EHCI controller driver HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","ErrorControl",0x00010001,0x00000001 -HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","Group",0x00000000,"Boot Bus" +HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","Group",0x00000000,"Boot Bus Extender" HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","Tag",0x00010001,0x00000002 HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","ImagePath",0x00020000,"system32\drivers\usbehci.sys" HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","Start",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","Type",0x00010001,0x00000002
; OHCI controller driver HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","ErrorControl",0x00010001,0x00000001 -HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","Group",0x00000000,"Boot Bus" +HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","Group",0x00000000,"Boot Bus Extender" HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","Tag",0x00010001,0x00000002 HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","ImagePath",0x00020000,"system32\drivers\usbohci.sys" HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","Start",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","Type",0x00010001,0x00000001
; UHCI controller driver -HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","ErrorControl",0x00010001,0x00000001 -HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","Group",0x00000000,"Boot Bus" -HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","Tag",0x00010001,0x00000002 -HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","ImagePath",0x00020000,"system32\drivers\usbuhci.sys" -HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","Start",0x00010001,0x00000000 +;HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","ErrorControl",0x00010001,0x00000001 +;HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","Group",0x00000000,"Boot Bus Extender" +;HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","Tag",0x00010001,0x00000002 +;HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","ImagePath",0x00020000,"system32\drivers\usbuhci.sys" +;HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","Start",0x00010001,0x00000000 +;HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","Type",0x00010001,0x00000001
; USB storage driver HKLM,"SYSTEM\CurrentControlSet\Services\usbstor","ErrorControl",0x00010001,0x00000001 @@ -1485,27 +1489,31 @@ HKLM,"SYSTEM\CurrentControlSet\Services\usbstor","Tag",0x00010001,0x00000002 HKLM,"SYSTEM\CurrentControlSet\Services\usbstor","ImagePath",0x00020000,"system32\drivers\usbstor.sys" HKLM,"SYSTEM\CurrentControlSet\Services\usbstor","Start",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\usbstor","Type",0x00010001,0x00000001
; USB composite generic parent HKLM,"SYSTEM\CurrentControlSet\Services\usbccgp","ErrorControl",0x00010001,0x00000001 -HKLM,"SYSTEM\CurrentControlSet\Services\usbccgp","Group",0x00000000,"Boot Bus" +HKLM,"SYSTEM\CurrentControlSet\Services\usbccgp","Group",0x00000000,"Boot Bus Extender" HKLM,"SYSTEM\CurrentControlSet\Services\usbccgp","Tag",0x00010001,0x00000002 HKLM,"SYSTEM\CurrentControlSet\Services\usbccgp","ImagePath",0x00020000,"system32\drivers\usbccgp.sys" HKLM,"SYSTEM\CurrentControlSet\Services\usbccgp","Start",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\usbccgp","Type",0x00010001,0x00000001
; ACPI driver HKLM,"SYSTEM\CurrentControlSet\Services\acpi","ErrorControl",0x00010001,0x00000001 -HKLM,"SYSTEM\CurrentControlSet\Services\acpi","Group",0x00000000,"Boot Bus" +HKLM,"SYSTEM\CurrentControlSet\Services\acpi","Group",0x00000000,"Boot Bus Extender" HKLM,"SYSTEM\CurrentControlSet\Services\acpi","Tag",0x00010001,0x00000002 HKLM,"SYSTEM\CurrentControlSet\Services\acpi","ImagePath",0x00020000,"system32\drivers\acpi.sys" HKLM,"SYSTEM\CurrentControlSet\Services\acpi","Start",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\acpi","Type",0x00010001,0x00000001
; PCI Bus driver HKLM,"SYSTEM\CurrentControlSet\Services\Pci","ErrorControl",0x00010001,0x00000001 -HKLM,"SYSTEM\CurrentControlSet\Services\Pci","Group",0x00000000,"Boot Bus" +HKLM,"SYSTEM\CurrentControlSet\Services\Pci","Group",0x00000000,"Boot Bus Extender" HKLM,"SYSTEM\CurrentControlSet\Services\Pci","Tag",0x00010001,0x00000002 HKLM,"SYSTEM\CurrentControlSet\Services\Pci","ImagePath",0x00020000,"system32\drivers\pci.sys" HKLM,"SYSTEM\CurrentControlSet\Services\Pci","Start",0x00010001,0x00000000 +HKLM,"SYSTEM\CurrentControlSet\Services\Pci","Type",0x00010001,0x00000001 HKLM,"SYSTEM\CurrentControlSet\Services\Pci\Parameters","1045C621",0x00030003,04,00,00,00,00,00,00,00 HKLM,"SYSTEM\CurrentControlSet\Services\Pci\Parameters","10950640",0x00030003,04,00,00,00,00,00,00,00 HKLM,"SYSTEM\CurrentControlSet\Services\Pci\Parameters","80861230",0x00030003,04,00,00,00,00,00,00,00
Modified: branches/usb-bringup-trunk/hal/halx86/acpi/halpnpdd.c URL: http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/hal/halx86/acp... ============================================================================== --- branches/usb-bringup-trunk/hal/halx86/acpi/halpnpdd.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/hal/halx86/acpi/halpnpdd.c [iso-8859-1] Mon Jan 30 21:36:51 2012 @@ -57,9 +57,50 @@ IN ULONG Count) { PFDO_EXTENSION FdoExtension = Context; - - /* Invalidate device relations since we added a new device */ - IoInvalidateDeviceRelations(FdoExtension->PhysicalDeviceObject, BusRelations); + PPDO_EXTENSION PdoExtension; + PDEVICE_OBJECT PdoDeviceObject; + PDESCRIPTION_HEADER Wdrt; + NTSTATUS Status; + + /* Create the PDO */ + Status = IoCreateDevice(DriverObject, + sizeof(PDO_EXTENSION), + NULL, + FILE_DEVICE_BUS_EXTENDER, + FILE_AUTOGENERATED_DEVICE_NAME, + FALSE, + &PdoDeviceObject); + if (!NT_SUCCESS(Status)) + { + /* Fail */ + DPRINT1("HAL: Could not create ACPI device object status=0x%08x\n", Status); + return; + } + + /* Setup the PDO device extension */ + PdoExtension = PdoDeviceObject->DeviceExtension; + PdoExtension->ExtensionType = PdoExtensionType; + PdoExtension->PhysicalDeviceObject = PdoDeviceObject; + PdoExtension->ParentFdoExtension = FdoExtension; + PdoExtension->PdoType = AcpiPdo; + + /* Add the PDO to the head of the list */ + PdoExtension->Next = FdoExtension->ChildPdoList; + FdoExtension->ChildPdoList = PdoExtension; + + /* Initialization is finished */ + PdoDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING; + + /* Find the ACPI watchdog table */ + Wdrt = HalAcpiGetTable(0, 'TRDW'); + if (Wdrt) + { + /* FIXME: TODO */ + DPRINT1("You have an ACPI Watchdog. That's great! You should be proud ;-)\n"); + } + + /* This will synchronously load the ACPI driver (needed because we're critical for boot) */ + IoSynchronousInvalidateDeviceRelations(FdoExtension->PhysicalDeviceObject, BusRelations); }
NTSTATUS @@ -69,10 +110,7 @@ { NTSTATUS Status; PFDO_EXTENSION FdoExtension; - PPDO_EXTENSION PdoExtension; PDEVICE_OBJECT DeviceObject, AttachedDevice; - PDEVICE_OBJECT PdoDeviceObject; - PDESCRIPTION_HEADER Wdrt;
DPRINT("HAL: PnP Driver ADD!\n");
@@ -112,43 +150,6 @@
/* Save the attachment */ FdoExtension->AttachedDeviceObject = AttachedDevice; - - /* Create the PDO */ - Status = IoCreateDevice(DriverObject, - sizeof(PDO_EXTENSION), - NULL, - FILE_DEVICE_BUS_EXTENDER, - FILE_AUTOGENERATED_DEVICE_NAME, - FALSE, - &PdoDeviceObject); - if (!NT_SUCCESS(Status)) - { - /* Fail */ - DPRINT1("HAL: Could not create ACPI device object status=0x%08x\n", Status); - return Status; - } - - /* Setup the PDO device extension */ - PdoExtension = PdoDeviceObject->DeviceExtension; - PdoExtension->ExtensionType = PdoExtensionType; - PdoExtension->PhysicalDeviceObject = PdoDeviceObject; - PdoExtension->ParentFdoExtension = FdoExtension; - PdoExtension->PdoType = AcpiPdo; - - /* Add the PDO to the head of the list */ - PdoExtension->Next = FdoExtension->ChildPdoList; - FdoExtension->ChildPdoList = PdoExtension; - - /* Initialization is finished */ - PdoDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING; - - /* Find the ACPI watchdog table */ - Wdrt = HalAcpiGetTable(0, 'TRDW'); - if (Wdrt) - { - /* FIXME: TODO */ - DPRINT1("You have an ACPI Watchdog. That's great! You should be proud ;-)\n"); - }
/* Register for reinitialization to report devices later */ IoRegisterBootDriverReinitialization(DriverObject,
Modified: branches/usb-bringup-trunk/hal/halx86/legacy/halpnpdd.c URL: http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/hal/halx86/leg... ============================================================================== --- branches/usb-bringup-trunk/hal/halx86/legacy/halpnpdd.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/hal/halx86/legacy/halpnpdd.c [iso-8859-1] Mon Jan 30 21:36:51 2012 @@ -139,7 +139,7 @@ #endif
/* Invalidate device relations since we added a new device */ - IoInvalidateDeviceRelations(TargetDevice, BusRelations); + IoSynchronousInvalidateDeviceRelations(TargetDevice, BusRelations);
/* Return status */ DPRINT("Device added %lx\n", Status);
Modified: branches/usb-bringup-trunk/ntoskrnl/io/pnpmgr/pnpmgr.c URL: http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/ntoskrnl/io/pn... ============================================================================== --- branches/usb-bringup-trunk/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original) +++ branches/usb-bringup-trunk/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Mon Jan 30 21:36:51 2012 @@ -389,9 +389,6 @@ DPRINT1("Installed NULL service for critical device '%wZ'\n", &ChildIdNameU); }
- /* We need to enumerate children */ - DeviceNode->Flags |= DNF_NEED_TO_ENUM; - ExFreePool(OriginalIdBuffer); ExFreePool(PartialInfo); ExFreePool(BasicInfo); @@ -2174,6 +2171,9 @@ ULONG i; BOOLEAN Found;
+ if (DeviceNode == IopRootDeviceNode) + return; + while (Child != NULL) { NextChild = Child->Sibling; @@ -2420,7 +2420,7 @@ UNICODE_STRING RegKey;
/* Install the service for this if it's in the CDDB */ - //IopInstallCriticalDevice(DeviceNode); + IopInstallCriticalDevice(DeviceNode);
RegKey.Length = 0; RegKey.MaximumLength = sizeof(RegKeyBuffer); @@ -2553,25 +2553,7 @@ if (IopDeviceNodeHasFlag(DeviceNode, DNF_STARTED) || IopDeviceNodeHasFlag(DeviceNode, DNF_ADDED) || IopDeviceNodeHasFlag(DeviceNode, DNF_DISABLED)) - { - if (DeviceNode->Flags & DNF_NEED_TO_ENUM) - { - Status = IopInitializeDevice(DeviceNode, NULL); - if (NT_SUCCESS(Status)) - { - /* HACK */ - DeviceNode->Flags &= ~DNF_STARTED; - Status = IopStartDevice(DeviceNode); - if (!NT_SUCCESS(Status)) - { - DPRINT1("IopStartDevice(%wZ) failed with status 0x%08x\n", - &DeviceNode->InstancePath, Status); - } - } - DeviceNode->Flags &= ~DNF_NEED_TO_ENUM; - } return STATUS_SUCCESS; - }
if (DeviceNode->ServiceName.Buffer == NULL) {