diff mbox

[1/2] acpi: method: add _LSI test according to ACPI 6.2 (mantis 1721)

Message ID 1503341113-9222-1-git-send-email-alex.hung@canonical.com
State Superseded
Headers show

Commit Message

Alex Hung Aug. 21, 2017, 6:45 p.m. UTC
Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 src/acpi/method/method.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

Comments

Colin Ian King Aug. 22, 2017, 3:31 p.m. UTC | #1
On 21/08/17 19:45, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/method/method.c | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
> 
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index 75aac0a..d58dd82 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -129,6 +129,9 @@
>   * _LCK 	 Y
>   * _LID 	 Y
>   * _LPI 	 Y
> + * _LSI 	 Y
> + * _LSR 	 N
> + * _LSW 	 N
>   * _MAT 	 N
>   * _MBM 	 Y
>   * _MLS 	 Y
> @@ -2648,6 +2651,30 @@ static int method_test_FIT(fwts_framework *fw)
>  		"_FIT", NULL, 0, method_test_buffer_return, NULL);
>  }
>  
> +static void method_test_LSI_return(
> +	fwts_framework *fw,
> +	char *name,
> +	ACPI_BUFFER *buf,
> +	ACPI_OBJECT *obj,
> +	void *private)
> +{
> +	FWTS_UNUSED(private);
> +
> +	if (method_check_type(fw, name, buf, ACPI_TYPE_PACKAGE) != FWTS_OK)
> +		return;
> +
> +	if (method_package_elements_all_type(fw, name, "_DEP", obj, ACPI_TYPE_INTEGER) != FWTS_OK)
> +		return;
> +
> +	method_passed_sane(fw, name, "package");
> +}
> +
> +static int method_test_LSI(fwts_framework *fw)
> +{
> +	return method_evaluate_method(fw, METHOD_OPTIONAL,
> +		"_LSI", NULL, 0, method_test_LSI_return, NULL);
> +}
> +
>  static int method_test_DCK(fwts_framework *fw)
>  {
>  	int i;
> @@ -6984,6 +7011,9 @@ static fwts_framework_minor_test method_tests[] = {
>  	/* { method_test_REG, "Test _REG (Region)." }, */
>  	{ method_test_SEG, "Test _SEG (Segment)." },
>  
> +	/* Section 6.5.10 NVDIMM Label Methods */
> +	{ method_test_LSI, "Test _LSI (Label Storage Informatio)." },
> +
>  	/* Section 7.1 Declaring a Power Resource Object */
>  
>  	{ method_test_OFF, "Test _OFF (Set resource off)." },
> 
Acked-by: Colin Ian King <colin.king@canonical.com>
Ivan Hu Aug. 23, 2017, 7:12 a.m. UTC | #2
On 08/22/2017 02:45 AM, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>   src/acpi/method/method.c | 30 ++++++++++++++++++++++++++++++
>   1 file changed, 30 insertions(+)
> 
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index 75aac0a..d58dd82 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -129,6 +129,9 @@
>    * _LCK 	 Y
>    * _LID 	 Y
>    * _LPI 	 Y
> + * _LSI 	 Y
> + * _LSR 	 N
> + * _LSW 	 N
>    * _MAT 	 N
>    * _MBM 	 Y
>    * _MLS 	 Y
> @@ -2648,6 +2651,30 @@ static int method_test_FIT(fwts_framework *fw)
>   		"_FIT", NULL, 0, method_test_buffer_return, NULL);
>   }
>   
> +static void method_test_LSI_return(
> +	fwts_framework *fw,
> +	char *name,
> +	ACPI_BUFFER *buf,
> +	ACPI_OBJECT *obj,
> +	void *private)
> +{
> +	FWTS_UNUSED(private);
> +
> +	if (method_check_type(fw, name, buf, ACPI_TYPE_PACKAGE) != FWTS_OK)
> +		return;
> +
> +	if (method_package_elements_all_type(fw, name, "_DEP", obj, ACPI_TYPE_INTEGER) != FWTS_OK)

Should be _LSI?

Ivan

> +		return;
> +
> +	method_passed_sane(fw, name, "package");
> +}
> +
> +static int method_test_LSI(fwts_framework *fw)
> +{
> +	return method_evaluate_method(fw, METHOD_OPTIONAL,
> +		"_LSI", NULL, 0, method_test_LSI_return, NULL);
> +}
> +
>   static int method_test_DCK(fwts_framework *fw)
>   {
>   	int i;
> @@ -6984,6 +7011,9 @@ static fwts_framework_minor_test method_tests[] = {
>   	/* { method_test_REG, "Test _REG (Region)." }, */
>   	{ method_test_SEG, "Test _SEG (Segment)." },
>   
> +	/* Section 6.5.10 NVDIMM Label Methods */
> +	{ method_test_LSI, "Test _LSI (Label Storage Informatio)." },
> +
>   	/* Section 7.1 Declaring a Power Resource Object */
>   
>   	{ method_test_OFF, "Test _OFF (Set resource off)." },
>
diff mbox

Patch

diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
index 75aac0a..d58dd82 100644
--- a/src/acpi/method/method.c
+++ b/src/acpi/method/method.c
@@ -129,6 +129,9 @@ 
  * _LCK 	 Y
  * _LID 	 Y
  * _LPI 	 Y
+ * _LSI 	 Y
+ * _LSR 	 N
+ * _LSW 	 N
  * _MAT 	 N
  * _MBM 	 Y
  * _MLS 	 Y
@@ -2648,6 +2651,30 @@  static int method_test_FIT(fwts_framework *fw)
 		"_FIT", NULL, 0, method_test_buffer_return, NULL);
 }
 
+static void method_test_LSI_return(
+	fwts_framework *fw,
+	char *name,
+	ACPI_BUFFER *buf,
+	ACPI_OBJECT *obj,
+	void *private)
+{
+	FWTS_UNUSED(private);
+
+	if (method_check_type(fw, name, buf, ACPI_TYPE_PACKAGE) != FWTS_OK)
+		return;
+
+	if (method_package_elements_all_type(fw, name, "_DEP", obj, ACPI_TYPE_INTEGER) != FWTS_OK)
+		return;
+
+	method_passed_sane(fw, name, "package");
+}
+
+static int method_test_LSI(fwts_framework *fw)
+{
+	return method_evaluate_method(fw, METHOD_OPTIONAL,
+		"_LSI", NULL, 0, method_test_LSI_return, NULL);
+}
+
 static int method_test_DCK(fwts_framework *fw)
 {
 	int i;
@@ -6984,6 +7011,9 @@  static fwts_framework_minor_test method_tests[] = {
 	/* { method_test_REG, "Test _REG (Region)." }, */
 	{ method_test_SEG, "Test _SEG (Segment)." },
 
+	/* Section 6.5.10 NVDIMM Label Methods */
+	{ method_test_LSI, "Test _LSI (Label Storage Informatio)." },
+
 	/* Section 7.1 Declaring a Power Resource Object */
 
 	{ method_test_OFF, "Test _OFF (Set resource off)." },