diff options
author | Robert Moore <Robert.Moore@intel.com> | 2022-08-18 08:10:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-18 08:10:36 -0700 |
commit | ce8cf5750c06285b5a55a6f61fc3eaffe94c8006 (patch) | |
tree | 3ab2bc73baec1041ec10cbf30a7806d4e1d9e740 | |
parent | 3103c689316a41e3b16d40cc8bcbbb804b8d961a (diff) | |
parent | 6195b95a7924babe302bef4e01f533097dcbc528 (diff) | |
download | acpica-ce8cf5750c06285b5a55a6f61fc3eaffe94c8006.tar.gz |
Merge pull request #779 from pmaziarz/master
iASL: NHLT: Fix compilation of optional undocumented fields
-rw-r--r-- | source/compiler/dttable2.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/source/compiler/dttable2.c b/source/compiler/dttable2.c index 75d272d3a..59d578f91 100644 --- a/source/compiler/dttable2.c +++ b/source/compiler/dttable2.c @@ -825,6 +825,7 @@ DtCompileNhlt ( ACPI_NHLT_FORMATS_CONFIG *FormatsConfig; ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_D *ConfigSpecific; ACPI_NHLT_DEVICE_INFO_COUNT *DeviceInfo; + ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B *Terminator; /* Main table */ @@ -1088,7 +1089,7 @@ DtCompileNhlt ( * 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"))) + if (*PFieldList && !(strcmp ((const char *) (*PFieldList)->Name, "Device Info struct count"))) { /* Get the count of non documented structures */ @@ -1124,9 +1125,8 @@ DtCompileNhlt ( DtInsertSubtable (ParentTable, Subtable); } /* for (j = 0; j < LinuxSpecificCount; j++) */ - /* Undocumented data at the end of endpoint */ - if (*PFieldList && (strcmp ((const char *) (*PFieldList)->Name, "Descriptor Length"))) + if (*PFieldList && !(strcmp ((const char *) (*PFieldList)->Name, "Bytes"))) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt7b, &Subtable); @@ -1148,7 +1148,7 @@ DtCompileNhlt ( * All Endpoint Descriptors are completed. * Do the table terminator specific config (not in NHLT spec, optional) */ - if (*PFieldList && (strcmp ((const char *) (*PFieldList)->Name, "Descriptor Length"))) + if (*PFieldList && !(strcmp ((const char *) (*PFieldList)->Name, "Capabilities Size"))) { Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt5b, &Subtable); @@ -1160,15 +1160,20 @@ DtCompileNhlt ( ParentTable = DtPeekSubtable (); DtInsertSubtable (ParentTable, Subtable); - Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt3a, - &Subtable); - if (ACPI_FAILURE (Status)) + Terminator = ACPI_CAST_PTR (ACPI_NHLT_DEVICE_SPECIFIC_CONFIG_B, Subtable->Buffer); + + if (Terminator->CapabilitiesSize) { - return (Status); - } + Status = DtCompileTable (PFieldList, AcpiDmTableInfoNhlt3a, + &Subtable); + if (ACPI_FAILURE (Status)) + { + return (Status); + } - ParentTable = DtPeekSubtable (); - DtInsertSubtable (ParentTable, Subtable); + ParentTable = DtPeekSubtable (); + DtInsertSubtable (ParentTable, Subtable); + } } return (AE_OK); |