diff mbox

acpi: acpiinfo: Print minor version where applicable

Message ID 1488413638-22891-1-git-send-email-jhugo@codeaurora.org
State Accepted
Headers show

Commit Message

Jeffrey Hugo March 2, 2017, 12:13 a.m. UTC
The acpiinfo test does not read the minor version when possible, which
causes platform supporting say ACPI v6.1 to display as only supporting
ACPI v6.0.  Modify the test to read the minor version and print it.

Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
---
 src/acpi/acpiinfo/acpiinfo.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Comments

Alex Hung March 2, 2017, 2:12 a.m. UTC | #1
On 2017-03-02 08:13 AM, Jeffrey Hugo wrote:
> The acpiinfo test does not read the minor version when possible, which
> causes platform supporting say ACPI v6.1 to display as only supporting
> ACPI v6.0.  Modify the test to read the minor version and print it.
>
> Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
> ---
>  src/acpi/acpiinfo/acpiinfo.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/src/acpi/acpiinfo/acpiinfo.c b/src/acpi/acpiinfo/acpiinfo.c
> index 6a8428f..9b7a631 100644
> --- a/src/acpi/acpiinfo/acpiinfo.c
> +++ b/src/acpi/acpiinfo/acpiinfo.c
> @@ -101,7 +101,9 @@ static int acpiinfo_test1(fwts_framework *fw)
>  static int acpiinfo_test2(fwts_framework *fw)
>  {
>  	fwts_acpi_table_info *table;
> -	fwts_acpi_table_header *header;
> +	fwts_acpi_table_fadt *fadt;
> +	uint8_t major;
> +	uint8_t minor = 0;
>
>  	if (fwts_acpi_find_table(fw, "FACP", 0, &table) != FWTS_OK)
>  		return FWTS_ERROR;
> @@ -109,10 +111,14 @@ static int acpiinfo_test2(fwts_framework *fw)
>  	if (table == NULL || table->data == NULL)
>  		return FWTS_ERROR;
>
> -	header = (fwts_acpi_table_header *)table->data;
> +	fadt = (fwts_acpi_table_fadt *)table->data;
> +
> +	major = fadt->header.revision;
> +	if (major >= 5 && fadt->header.length >= 268)
> +		minor = fadt->minor_version;
>
>  	fwts_log_info(fw,
> -		"FACP ACPI Version: %d.0\n", header->revision);
> +		"FACP ACPI Version: %d.%d\n", major, minor);
>
>  	fwts_infoonly(fw);
>
>


Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu March 2, 2017, 6:59 a.m. UTC | #2
On 03/02/2017 08:13 AM, Jeffrey Hugo wrote:
> The acpiinfo test does not read the minor version when possible, which
> causes platform supporting say ACPI v6.1 to display as only supporting
> ACPI v6.0.  Modify the test to read the minor version and print it.
>
> Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
> ---
>  src/acpi/acpiinfo/acpiinfo.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/src/acpi/acpiinfo/acpiinfo.c b/src/acpi/acpiinfo/acpiinfo.c
> index 6a8428f..9b7a631 100644
> --- a/src/acpi/acpiinfo/acpiinfo.c
> +++ b/src/acpi/acpiinfo/acpiinfo.c
> @@ -101,7 +101,9 @@ static int acpiinfo_test1(fwts_framework *fw)
>  static int acpiinfo_test2(fwts_framework *fw)
>  {
>  	fwts_acpi_table_info *table;
> -	fwts_acpi_table_header *header;
> +	fwts_acpi_table_fadt *fadt;
> +	uint8_t major;
> +	uint8_t minor = 0;
>
>  	if (fwts_acpi_find_table(fw, "FACP", 0, &table) != FWTS_OK)
>  		return FWTS_ERROR;
> @@ -109,10 +111,14 @@ static int acpiinfo_test2(fwts_framework *fw)
>  	if (table == NULL || table->data == NULL)
>  		return FWTS_ERROR;
>
> -	header = (fwts_acpi_table_header *)table->data;
> +	fadt = (fwts_acpi_table_fadt *)table->data;
> +
> +	major = fadt->header.revision;
> +	if (major >= 5 && fadt->header.length >= 268)
> +		minor = fadt->minor_version;
>
>  	fwts_log_info(fw,
> -		"FACP ACPI Version: %d.0\n", header->revision);
> +		"FACP ACPI Version: %d.%d\n", major, minor);
>
>  	fwts_infoonly(fw);
>
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox

Patch

diff --git a/src/acpi/acpiinfo/acpiinfo.c b/src/acpi/acpiinfo/acpiinfo.c
index 6a8428f..9b7a631 100644
--- a/src/acpi/acpiinfo/acpiinfo.c
+++ b/src/acpi/acpiinfo/acpiinfo.c
@@ -101,7 +101,9 @@  static int acpiinfo_test1(fwts_framework *fw)
 static int acpiinfo_test2(fwts_framework *fw)
 {
 	fwts_acpi_table_info *table;
-	fwts_acpi_table_header *header;
+	fwts_acpi_table_fadt *fadt;
+	uint8_t major;
+	uint8_t minor = 0;
 
 	if (fwts_acpi_find_table(fw, "FACP", 0, &table) != FWTS_OK)
 		return FWTS_ERROR;
@@ -109,10 +111,14 @@  static int acpiinfo_test2(fwts_framework *fw)
 	if (table == NULL || table->data == NULL)
 		return FWTS_ERROR;
 
-	header = (fwts_acpi_table_header *)table->data;
+	fadt = (fwts_acpi_table_fadt *)table->data;
+
+	major = fadt->header.revision;
+	if (major >= 5 && fadt->header.length >= 268)
+		minor = fadt->minor_version;
 
 	fwts_log_info(fw,
-		"FACP ACPI Version: %d.0\n", header->revision);
+		"FACP ACPI Version: %d.%d\n", major, minor);
 
 	fwts_infoonly(fw);