[AUDIO-BRINGUP]

- Hack-register software bus driver

svn path=/branches/audio-bringup/; revision=50142
This commit is contained in:
Johannes Anderwald 2010-12-26 11:35:05 +00:00
parent b0d8c894e8
commit 1ff1757719
4 changed files with 53 additions and 4 deletions

View file

@ -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

View file

@ -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;

Binary file not shown.

View file

@ -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;
}
}