[PATCH 2/3] acpi: method: add _WPC method test (introduced in ACPI 6.1)

Colin Ian King colin.king at canonical.com
Tue Jun 7 10:28:01 UTC 2016


On 07/06/16 04:54, Alex Hung wrote:
> Signed-off-by: Alex Hung <alex.hung at canonical.com>
> ---
>  src/acpi/method/method.c | 29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
> 
> diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c
> index dcf3eb7..f6ab520 100644
> --- a/src/acpi/method/method.c
> +++ b/src/acpi/method/method.c
> @@ -246,6 +246,7 @@
>   * _UPP 	 Y
>   * _VPO 	 Y
>   * _WAK 	 Y
> + * _WPC 	 Y
>   * _WPP 	 Y
>   * _Wxx 	 n/a
>   * _WDG 	 N
> @@ -5624,6 +5625,33 @@ static int method_test_PMM(fwts_framework *fw)
>  /*
>   * Section 10.5 Wireless Power Controllers
>   */
> +static void method_test_WPC_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_INTEGER) != FWTS_OK)
> +		return;
> +
> +	if (obj->Integer.Value <= 0x02)
> +		method_passed_sane(fw, name, "integer");
> +	else
> +		fwts_failed(fw, LOG_LEVEL_HIGH,
> +			"Method_WPCInvalidInteger",
> +			"%s returned an invalid integer 0x%8.8" PRIx64,
> +			name, (uint64_t)obj->Integer.Value);

According to the spec (10.5.2), 0x00, 0x01, 0x02 and 0xff (Reserved) are
allowed and values 0x03..0xfe are not defined.  So should the above code
check for 0x03..0xfe being invalid rather than 0x03..0xff?

> +}
> +
> +static int method_test_WPC(fwts_framework *fw)
> +{
> +	return method_evaluate_method(fw, METHOD_OPTIONAL,
> +		"_WPC", NULL, 0, method_test_WPC_return, "_WPC");
> +}
> +
>  static int method_test_WPP(fwts_framework *fw)
>  {
>  	return method_evaluate_method(fw, METHOD_OPTIONAL,
> @@ -7088,6 +7116,7 @@ static fwts_framework_minor_test method_tests[] = {
>  	/* { method_test_SHL, "Test _SHL (Set Hardware Limit)." }, */
>  
>  	/* Section 10.5 Wireless Power Controllers */
> +	{ method_test_WPC, "Test _WPC (Wireless Power Calibration)." },
>  	{ method_test_WPP, "Test _WPP (Wireless Power Polling)." },
>  
>  	/* Section 11.3 Fan Devices */
> 




More information about the fwts-devel mailing list