From 1ff1757719989a29d4ace09d815cf68948a57436 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Sun, 26 Dec 2010 11:35:05 +0000 Subject: [PATCH] [AUDIO-BRINGUP] - Hack-register software bus driver svn path=/branches/audio-bringup/; revision=50142 --- boot/bootdata/txtsetup.sif | 2 +- boot/freeldr/freeldr/arch/i386/hardware.c | 43 +++++++++++++++++++++- media/inf/machine.inf | Bin 47426 -> 47336 bytes ntoskrnl/io/pnpmgr/pnpmgr.c | 12 +++++- 4 files changed, 53 insertions(+), 4 deletions(-) diff --git a/boot/bootdata/txtsetup.sif b/boot/bootdata/txtsetup.sif index 15d5b7b48d5..24eb5f2116f 100644 --- a/boot/bootdata/txtsetup.sif +++ b/boot/bootdata/txtsetup.sif @@ -48,7 +48,7 @@ ext2.sys=,,,,,,x,,,,,,4 *PNP0C08 = acpi ;PCI\CC_0601 = isapnp PCI\CC_0604 = pci -ROOT\SWENUM = swenum +SWENUM = swenum [BootBusExtenders.Load] acpi = acpi.sys diff --git a/boot/freeldr/freeldr/arch/i386/hardware.c b/boot/freeldr/freeldr/arch/i386/hardware.c index 641bd8d4c94..3e280d6a76d 100644 --- a/boot/freeldr/freeldr/arch/i386/hardware.c +++ b/boot/freeldr/freeldr/arch/i386/hardware.c @@ -1978,6 +1978,46 @@ DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey) /* 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 @@ PcHwDetect(VOID) DetectPnpBios(SystemKey, &BusNumber); DetectIsaBios(SystemKey, &BusNumber); DetectAcpiBios(SystemKey, &BusNumber); - + DetectSWBus(SystemKey, &BusNumber); + DPRINTM(DPRINT_HWDETECT, "DetectHardware() Done\n"); return SystemKey; diff --git a/media/inf/machine.inf b/media/inf/machine.inf index fa24ddeba11822f7a4923dbc726381a07f7b4ae5..f21cf43944657a70427b56b245ff530ba9f929a5 100644 GIT binary patch delta 98 zcmV-o0GjFZUZC%JCidMf3s>8 zm;sZ_93GSM6nK-W6Cjf=8Wxj)9U7A~7g&>A7bcSi9-^~U7&ZvA9GxlwlVCFjvkoFO Ems@)x<^TWy delta 151 zcmaFyk?GJUrVY!uID;7cfiQ$2X7f_6-yD;*#N;L)5Ehwi!EDCq$Pmil!r;l^Klx&a z@Z=t5vB^#%d6U(|c1%7ZDzN#0NC)HOKVn^zb;S5KPZ9sXAsoyQ&fv=62h`=u5D(Pp q$`Cd=kXdwc0yCSeErSAs5>Tv^Ar}ZMfjlJDlN*anH*Zj|m;nINiz=J| diff --git a/ntoskrnl/io/pnpmgr/pnpmgr.c b/ntoskrnl/io/pnpmgr/pnpmgr.c index 69e013caefc..729cae06aa5 100644 --- a/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -2043,6 +2043,9 @@ IopEnumerateDetectedDevices( 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 @@ IopEnumerateDetectedDevices( 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 @@ IopEnumerateDetectedDevices( 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; } }