diff options
author | Robert Moore <Robert.Moore@intel.com> | 2022-01-27 13:36:40 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-27 13:36:40 -0800 |
commit | 3d944bdff041ce338da25573b27630fd79fad0fb (patch) | |
tree | dfdf05c1320aec46d1b8c41471b37aef4ff4bfaa /source/compiler | |
parent | 8dc9493cad9993440a7b0897a44489896693587a (diff) | |
parent | 339f99538713c4e7c9676fa9f59e9235b973e037 (diff) | |
download | acpica-3d944bdff041ce338da25573b27630fd79fad0fb.tar.gz |
Merge pull request #743 from pmaziarz/master
Improvements for NHLT
Diffstat (limited to 'source/compiler')
-rw-r--r-- | source/compiler/dttable2.c | 60 |
1 files changed, 32 insertions, 28 deletions
diff --git a/source/compiler/dttable2.c b/source/compiler/dttable2.c index 854063611..33a246dfb 100644 --- a/source/compiler/dttable2.c +++ b/source/compiler/dttable2.c @@ -807,7 +807,7 @@ DtCompileNhlt ( UINT32 CapabilitiesSize; UINT8 ArrayType; UINT8 ConfigType; - UINT8 LinuxSpecificCount; + UINT8 DeviceInfoCount; UINT32 i; UINT32 j; ACPI_TABLE_NHLT_ENDPOINT_COUNT *MainTable; @@ -815,7 +815,7 @@ DtCompileNhlt ( ACPI_NHLT_VENDOR_MIC_COUNT *MicCount; ACPI_NHLT_FORMATS_CONFIG *FormatsConfig; ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_D *ConfigSpecific; - ACPI_NHLT_LINUX_SPECIFIC_COUNT *LinuxSpecific; + ACPI_NHLT_DEVICE_INFO_COUNT *DeviceInfo; /* Main table */ @@ -1076,12 +1076,12 @@ DtCompileNhlt ( /* * If we are not done with the current Endpoint yet, then there must be - * some Linux-specific structure(s) yet to be processed. First, get + * some non documeneted structure(s) yet to be processed. First, get * the count of such structure(s). */ if (*PFieldList && (strcmp ((const char *) (*PFieldList)->Name, "Descriptor Length"))) { - /* Get the count of Linux-specific structures */ + /* Get the count of non documented structures */ Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt7, &Subtable); @@ -1093,13 +1093,13 @@ DtCompileNhlt ( ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); - LinuxSpecific = ACPI_CAST_PTR (ACPI_NHLT_LINUX_SPECIFIC_COUNT, Subtable->Buffer); - LinuxSpecificCount = LinuxSpecific->StructureCount; + DeviceInfo = ACPI_CAST_PTR (ACPI_NHLT_DEVICE_INFO_COUNT, Subtable->Buffer); + DeviceInfoCount = DeviceInfo->StructureCount; - for (j = 0; j < LinuxSpecificCount; j++) + for (j = 0; j < DeviceInfoCount; j++) { /* - * Compile the following Linux-specific fields: + * Compile the following Device Info fields: * 1) Device ID * 2) Device Instance ID * 3) Device Port ID @@ -1113,28 +1113,22 @@ DtCompileNhlt ( ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); + } /* for (j = 0; j < LinuxSpecificCount; j++) */ - /* - * To have a valid Linux-specific "Specific Data" at this - * point, we need: - * 1) The next field must be named "Specific Data" - */ - if (!strcmp ((const char *) (*PFieldList)->Name, "Specific Data")) - { - /* Compile the "Specific Data" field */ - - Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt7b, - &Subtable); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - ParentTable = DtPeekSubtable (); - DtInsertSubtable (ParentTable, Subtable); + /* Undocumented data at the end of endpoint */ + if (*PFieldList && (strcmp ((const char *) (*PFieldList)->Name, "Descriptor Length"))) + { + Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt7b, + &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); } - } /* for (j = 0; j < LinuxSpecificCount; j++) */ + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + } } DtPopSubtable (); @@ -1143,11 +1137,21 @@ DtCompileNhlt ( /* * All Endpoint Descriptors are completed. - * Do the table terminator structure (not in NHLT spec, optional) + * Do the table terminator specific config (not in NHLT spec, optional) */ if (*PFieldList && (strcmp ((const char *) (*PFieldList)->Name, "Descriptor Length"))) { - Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt8, + Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt5b, + &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + + Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt3a, &Subtable); if (ACPI_FAILURE (Status)) { |