Author: janderwald Date: Sun Dec 26 11:35:05 2010 New Revision: 50142
URL: http://svn.reactos.org/svn/reactos?rev=50142&view=rev Log: [AUDIO-BRINGUP] - Hack-register software bus driver
Modified: branches/audio-bringup/boot/bootdata/txtsetup.sif branches/audio-bringup/boot/freeldr/freeldr/arch/i386/hardware.c branches/audio-bringup/media/inf/machine.inf branches/audio-bringup/ntoskrnl/io/pnpmgr/pnpmgr.c
Modified: branches/audio-bringup/boot/bootdata/txtsetup.sif URL: http://svn.reactos.org/svn/reactos/branches/audio-bringup/boot/bootdata/txts... ============================================================================== --- branches/audio-bringup/boot/bootdata/txtsetup.sif [iso-8859-1] (original) +++ branches/audio-bringup/boot/bootdata/txtsetup.sif [iso-8859-1] Sun Dec 26 11:35:05 2010 @@ -48,7 +48,7 @@ *PNP0C08 = acpi ;PCI\CC_0601 = isapnp PCI\CC_0604 = pci -ROOT\SWENUM = swenum +SWENUM = swenum
[BootBusExtenders.Load] acpi = acpi.sys
Modified: branches/audio-bringup/boot/freeldr/freeldr/arch/i386/hardware.c URL: http://svn.reactos.org/svn/reactos/branches/audio-bringup/boot/freeldr/freel... ============================================================================== --- branches/audio-bringup/boot/freeldr/freeldr/arch/i386/hardware.c [iso-8859-1] (original) +++ branches/audio-bringup/boot/freeldr/freeldr/arch/i386/hardware.c [iso-8859-1] Sun Dec 26 11:35:05 2010 @@ -1978,6 +1978,46 @@ /* FIXME: Add display peripheral (monitor) data */ }
+static VOID +DetectSWBus(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) +{ + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; + PCONFIGURATION_COMPONENT_DATA BusKey; + ULONG Size; + + /* Increment bus number */ + (*BusNumber)++; + + /* Set 'Configuration Data' value */ + Size = sizeof(CM_PARTIAL_RESOURCE_LIST) - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); + + PartialResourceList = MmHeapAlloc(Size); + if (PartialResourceList == NULL) + { + DPRINTM(DPRINT_HWDETECT, "Failed to allocate resource descriptor\n"); + return; + } + + /* Initialize resource descriptor */ + memset(PartialResourceList, 0, Size); + PartialResourceList->Version = 1; + PartialResourceList->Revision = 1; + PartialResourceList->Count = 0; + + /* Create new bus key */ + FldrCreateComponentKey(SystemKey, + AdapterClass, + MultiFunctionAdapter, + 0x0, + 0x0, + 0xFFFFFFFF, + "SWENUM", + PartialResourceList, + Size, + &BusKey); + + MmHeapFree(PartialResourceList); +}
static VOID DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) @@ -2056,7 +2096,8 @@ DetectPnpBios(SystemKey, &BusNumber); DetectIsaBios(SystemKey, &BusNumber); DetectAcpiBios(SystemKey, &BusNumber); - + DetectSWBus(SystemKey, &BusNumber); + DPRINTM(DPRINT_HWDETECT, "DetectHardware() Done\n");
return SystemKey;
Modified: branches/audio-bringup/media/inf/machine.inf URL: http://svn.reactos.org/svn/reactos/branches/audio-bringup/media/inf/machine.... ============================================================================== Binary files - no diff available.
Modified: branches/audio-bringup/ntoskrnl/io/pnpmgr/pnpmgr.c URL: http://svn.reactos.org/svn/reactos/branches/audio-bringup/ntoskrnl/io/pnpmgr... ============================================================================== --- branches/audio-bringup/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original) +++ branches/audio-bringup/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Sun Dec 26 11:35:05 2010 @@ -2043,6 +2043,9 @@ const UNICODE_STRING IdentifierPci = RTL_CONSTANT_STRING(L"PCI"); UNICODE_STRING HardwareIdPci = RTL_CONSTANT_STRING(L"*PNP0A03\0"); static ULONG DeviceIndexPci = 0; + const UNICODE_STRING IdentifierSW = RTL_CONSTANT_STRING(L"SWENUM"); + UNICODE_STRING HardwareIdSW= RTL_CONSTANT_STRING(L"SWENUM\0"); + static ULONG DeviceIndexSW = 0; const UNICODE_STRING IdentifierSerial = RTL_CONSTANT_STRING(L"SerialController"); UNICODE_STRING HardwareIdSerial = RTL_CONSTANT_STRING(L"*PNP0501\0"); static ULONG DeviceIndexSerial = 0; @@ -2287,7 +2290,7 @@ if (ValueName.Length >= sizeof(WCHAR) && ValueName.Buffer[ValueName.Length / sizeof(WCHAR) - 1] == UNICODE_NULL) ValueName.Length -= sizeof(WCHAR); } - +DPRINT1("RelativePath %wZ\n", RelativePath); if (RelativePath && RtlCompareUnicodeString(RelativePath, &IdentifierSerial, FALSE) == 0) { pHardwareId = &HardwareIdSerial; @@ -2326,9 +2329,14 @@ pHardwareId = &HardwareIdIsa; DeviceIndex = DeviceIndexIsa++; } + else if (RtlCompareUnicodeString(&ValueName, &IdentifierSW, FALSE) == 0) + { + pHardwareId = &HardwareIdSW; + DeviceIndex = DeviceIndexSW++; + } else { - DPRINT("Unknown device '%wZ'\n", &ValueName); + DPRINT1("Unknown device '%wZ'\n", &ValueName); goto nextdevice; } }