From patchwork Thu Sep 11 08:59:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Hung X-Patchwork-Id: 388164 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 611EE1400E9; Thu, 11 Sep 2014 19:00:15 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1XS0Eg-0006Kr-9s; Thu, 11 Sep 2014 09:00:14 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1XS0Ea-0006Ix-Fq for fwts-devel@lists.ubuntu.com; Thu, 11 Sep 2014 09:00:08 +0000 Received: from [175.41.48.77] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XS0EZ-0007NY-T5; Thu, 11 Sep 2014 09:00:08 +0000 From: Alex Hung To: fwts-devel@lists.ubuntu.com Subject: [PATCH][v4] acpi: method: add check for _GTF and _GTM Date: Thu, 11 Sep 2014 16:59:53 +0800 Message-Id: <1410425993-28909-1-git-send-email-alex.hung@canonical.com> X-Mailer: git-send-email 1.9.1 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: fwts-devel-bounces@lists.ubuntu.com Signed-off-by: Alex Hung Acked-by: Colin Ian King --- src/acpi/method/method.c | 65 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c index b2f83c8..b32fad5 100644 --- a/src/acpi/method/method.c +++ b/src/acpi/method/method.c @@ -109,8 +109,8 @@ * _GPE 5.3.1, 12.11 N * _GRT 9.18.3 Y * _GSB 6.2.6 Y - * _GTF 9.8.1.1 N - * _GTM 9.8.2.1.1 N + * _GTF 9.8.1.1 Y + * _GTM 9.8.2.1.1 Y * _GTS 7.3.3 deprecated * _GWS 9.18.5 Y * _HID 6.1.5 Y @@ -3398,6 +3398,63 @@ static int method_test_LID(fwts_framework *fw) "_LID", NULL, 0, method_test_LID_return, NULL); } + +/* + * Section 9.8 ATA Controllers + */ + +static void method_test_GTF_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_BUFFER) != FWTS_OK) + return; + + if (obj->Buffer.Length % 7) + fwts_failed(fw, LOG_LEVEL_MEDIUM, "Method_GTFBadBufferSize", + "%s should return a buffer with size of multiple of 7.", + name); + else + method_passed_sane(fw, name, "buffer"); +} + +static int method_test_GTF(fwts_framework *fw) +{ + return method_evaluate_method(fw, METHOD_OPTIONAL, + "_GTF", NULL, 0, method_test_GTF_return, NULL); +} + +static void method_test_GTM_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_BUFFER) != FWTS_OK) + return; + + if (obj->Buffer.Length % (5 * sizeof(uint32_t))) + fwts_failed(fw, LOG_LEVEL_MEDIUM, "Method_GTMBadBufferSize", + "%s should return a buffer with size of multiple of 20.", + name); + else + method_passed_sane(fw, name, "buffer"); +} + +static int method_test_GTM(fwts_framework *fw) +{ + return method_evaluate_method(fw, METHOD_OPTIONAL, + "_GTM", NULL, 0, method_test_GTM_return, NULL); +} + /* * Section 9.16 User Presence Detection Device */ @@ -5180,8 +5237,8 @@ static fwts_framework_minor_test method_tests[] = { { method_test_LID, "Test _LID (Lid Status)." }, /* Section 9.8 ATA Controllers */ - /* { method_test_GTF, "Test _GTF (Get Task File)." }, */ - /* { method_test_GTM, "Test _GTM (Get Timing Mode)." }, */ + { method_test_GTF, "Test _GTF (Get Task File)." }, + { method_test_GTM, "Test _GTM (Get Timing Mode)." }, /* { method_test_SDD, "Test _SDD (Set Device Data)." }, */ /* { method_test_STM, "Test _STM (Set Timing Mode)." }, */