From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=eric.jin@intel.com; receiver=edk2-devel@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 42BA921168208 for ; Sat, 13 Oct 2018 20:55:02 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Oct 2018 20:55:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,379,1534834800"; d="scan'208";a="271147098" Received: from jjin9-mobl.ccr.corp.intel.com ([10.249.168.56]) by fmsmga005.fm.intel.com with ESMTP; 13 Oct 2018 20:55:00 -0700 From: Eric Jin To: edk2-devel@lists.01.org Cc: Supreeth Venkatesh , Jiaxin Wu Date: Sun, 14 Oct 2018 11:54:57 +0800 Message-Id: <20181014035457.6104-1-eric.jin@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 Subject: [PATCH] uefi-sct/SctPkg: Fix the BlueTooth Guid and Enable BLE test X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2018 03:55:02 -0000 Correct the guid of EFI_GUID gEfiBlueToothIoProtocolGuid and gEfiBlueToothConfigProtocolGuid Add BlueToothLE support test in the EfiCompliant part Cc: Supreeth Venkatesh Cc: Jiaxin Wu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Jin --- .../Dependency/Config/EfiCompliant.ini | 9 +- .../EfiCompliantBBTestPlatform_uefi.c | 127 ++++++++++++++++-- .../EfiCompliant/BlackBoxTest/Guid_uefi.c | 4 +- .../EfiCompliant/BlackBoxTest/Guid_uefi.h | 7 +- 4 files changed, 132 insertions(+), 15 deletions(-) diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Dependency/Config/EfiCompliant.ini b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Dependency/Config/EfiCompliant.ini index 78b5f7b5..7c0bdcd6 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Dependency/Config/EfiCompliant.ini +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Dependency/Config/EfiCompliant.ini @@ -1,7 +1,7 @@ ## @file # # Copyright 2006 - 2016 Unified EFI, Inc.
-# Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -84,7 +84,9 @@ # # EAPSupport = # -# BlueToothSupport = +# BlueToothClassicSupport = +# +# BlueToothLESupport = # # IPSecSupport = # @@ -120,6 +122,7 @@ DNS6Support = yes TLSSupport = yes HTTPSupport = yes EAPSupport = yes -BlueToothSupport = yes +BlueToothClassicSupport = yes +BlueToothLESupport = yes IPSecSupport = yes diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestPlatform_uefi.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestPlatform_uefi.c index 17df564b..2d45a7c0 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestPlatform_uefi.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestPlatform_uefi.c @@ -1,7 +1,7 @@ /** @file Copyright 2006 - 2016 Unified EFI, Inc.
- Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -152,9 +152,9 @@ EFI_GUID gEfiBlueToothHcProtocolGuid = { 0xb3930571, 0xbeba, 0x4fc5, {0x92, 0x3, EFI_GUID gEfiBlueToothServiceBindingProtocolGuid = { 0x388278d3, 0x7b85, 0x42f0, {0xab, 0xa9, 0xfb, 0x4b, 0xfd, 0x69, 0xf5, 0xab }}; -EFI_GUID gEfiBlueToothIoProtocolGuid = { 0x388278d3, 0x7b85, 0x42f0, {0xab, 0xa9, 0xfb, 0x4b, 0xfd, 0x69, 0xf5, 0xab }}; +EFI_GUID gEfiBlueToothIoProtocolGuid = { 0x467313de, 0x4e30, 0x43f1,{ 0x94, 0x3e, 0x32, 0x3f, 0x89, 0x84, 0x5d, 0xb5 }}; -EFI_GUID gEfiBlueToothConfigProtocolGuid = { 0xb3930571, 0xbeba, 0x4fc5, {0x92, 0x3, 0x94, 0x27, 0x24, 0x2e, 0x6a, 0x43 }}; +EFI_GUID gEfiBlueToothConfigProtocolGuid = { 0x62960cf3, 0x40ff, 0x4263,{0xa7, 0x7c, 0xdf, 0xde, 0xbd, 0x19, 0x1b, 0x4b }}; EFI_GUID gEfiEapProtocolGuid = { 0x5d9f96db, 0xe731, 0x4caa, {0xa0, 0x0d, 0x72, 0xe1, 0x87, 0xcd, 0x77, 0x62 }}; @@ -166,6 +166,10 @@ EFI_GUID gEfiIPSecConfigProtocolGuid = { 0xce5e5929, 0xc7a3, 0x4602, {0xad, 0x9e EFI_GUID gEfiIPSec2ProtocolGuid = { 0xa3979e64, 0xace8, 0x4ddc, {0xbc, 0x07, 0x4d, 0x66, 0xb8, 0xfd, 0x09, 0x77 }}; +EFI_GUID gEfiBlueToothAttributeProtocolGuid = { 0x898890e9, 0x84b2, 0x4f3a, { 0x8c, 0x58, 0xd8, 0x57, 0x78, 0x13, 0xe0, 0xac }}; + +EFI_GUID gEfiBlueToothLEConfigProtocolGuid = { 0x8f76da58, 0x1f99, 0x4275, { 0xa4, 0xec, 0x47, 0x56, 0x51, 0x5b, 0x1c, 0xe8 }}; + // // Internal functions declarations // @@ -353,7 +357,13 @@ CheckEAPProtocols ( ); EFI_STATUS -CheckBlueToothProtocols ( +CheckBlueToothClassicProtocols ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_INI_FILE_HANDLE IniFile + ); + +EFI_STATUS +CheckBlueToothLEProtocols ( IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, IN EFI_INI_FILE_HANDLE IniFile ); @@ -564,7 +574,8 @@ Routine Description: // // Check the BlueTooth protocols // - CheckBlueToothProtocols (StandardLib, IniFile); + CheckBlueToothClassicProtocols (StandardLib, IniFile); + CheckBlueToothLEProtocols (StandardLib, IniFile); // // Check the IPSec protocols @@ -3534,7 +3545,7 @@ CheckEAPProtocols ( } EFI_STATUS -CheckBlueToothProtocols ( +CheckBlueToothClassicProtocols ( IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, IN EFI_INI_FILE_HANDLE IniFile ) @@ -3601,7 +3612,7 @@ CheckBlueToothProtocols ( Status = IniFile->GetString ( IniFile, SECTION_NAME_PLATFORM_SPECIFIC, - L"BlueToothSupport", + L"BlueToothClassicSupport", String, &MaxLength ); @@ -3616,7 +3627,7 @@ CheckBlueToothProtocols ( StandardLib, AssertionType, gEfiCompliantBbTestPlatformAssertionGuid026, - L"UEFI Compliant - BlueTooth Support protocols must be implemented", + L"UEFI Compliant - BlueTooth Classic Support protocols must be implemented", L"%a:%d:BLUETOOTH HC - %s, BLUETOOTH Service Binding - %s, BLUETOOTH Config - %s", __FILE__, (UINTN)__LINE__, @@ -3666,7 +3677,7 @@ CheckBlueToothProtocols ( Status = IniFile->GetString ( IniFile, SECTION_NAME_PLATFORM_SPECIFIC, - L"BlueToothSupport", + L"BlueToothClassicSupport", String, &MaxLength ); @@ -3679,7 +3690,7 @@ CheckBlueToothProtocols ( StandardLib, AssertionType, gEfiCompliantBbTestPlatformAssertionGuid026, - L"UEFI Compliant - BlueTooth Support protocols must be implemented", + L"UEFI Compliant - BlueTooth Classic Support protocols must be implemented", L"%a:%d:BLUETOOTH HC - %s, BLUETOOTH Service Binding - %s, BLUETOOTH Config - %s, BLUETOOTH IO - %s", __FILE__, (UINTN)__LINE__, @@ -3694,6 +3705,102 @@ CheckBlueToothProtocols ( return EFI_SUCCESS; } +EFI_STATUS +CheckBlueToothLEProtocols ( + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, + IN EFI_INI_FILE_HANDLE IniFile + ) +{ + EFI_STATUS Status; + UINT32 MaxLength; + CHAR16 String[10]; + BOOLEAN ValueA; + BOOLEAN ValueB; + BOOLEAN ValueC; + VOID *Interface; + EFI_TEST_ASSERTION AssertionType; + + + Status = gtBS->LocateProtocol ( + &gEfiBlueToothHcProtocolGuid, + NULL, + (VOID **) &Interface + ); + if (!EFI_ERROR (Status)) { + ValueA = TRUE; + } else { + ValueA = FALSE; + } + + Status = gtBS->LocateProtocol ( + &gEfiBlueToothAttributeProtocolGuid, + NULL, + (VOID **) &Interface + ); + if (!EFI_ERROR (Status)) { + ValueB = TRUE; + } else { + ValueB = FALSE; + } + + Status = gtBS->LocateProtocol ( + &gEfiBlueToothLEConfigProtocolGuid, + NULL, + (VOID **) &Interface + ); + if (!EFI_ERROR (Status)) { + ValueC = TRUE; + } else { + ValueC = FALSE; + } + + AssertionType = NeedThreeOrWarning (ValueA, ValueB, ValueC); + + if (AssertionType == EFI_TEST_ASSERTION_FAILED) { + AssertionType = EFI_TEST_ASSERTION_WARNING; + } + + // + // If warning, check with INI file to decide they must exist or not + // + if ((AssertionType == EFI_TEST_ASSERTION_WARNING) && + (IniFile != NULL )) { + MaxLength = 10; + + Status = IniFile->GetString ( + IniFile, + SECTION_NAME_PLATFORM_SPECIFIC, + L"BlueToothLESupport", + String, + &MaxLength + ); + if (!EFI_ERROR (Status) && (SctStriCmp (String, L"yes") == 0)) { + AssertionType = EFI_TEST_ASSERTION_FAILED; + } + } + + // + // Record test result + // + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gEfiCompliantBbTestPlatformAssertionGuid028, + L"UEFI Compliant - BlueTooth LE Support protocols must be implemented", + L"%a:%d:BLUETOOTH HC - %s, BLUETOOTH Attribute - %s, BLUETOOTH LE Config - %s", + __FILE__, + (UINTN)__LINE__, + ValueA ? L"Yes" : L"No", + ValueB ? L"Yes" : L"No", + ValueC ? L"Yes" : L"No" + ); + + + return EFI_SUCCESS; +} + + + EFI_STATUS CheckIPSecProtocols ( IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Guid_uefi.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Guid_uefi.c index d17fb551..f55357d4 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Guid_uefi.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Guid_uefi.c @@ -1,7 +1,7 @@ /** @file Copyright 2006 - 2016 Unified EFI, Inc.
- Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -82,6 +82,8 @@ EFI_GUID gEfiCompliantBbTestPlatformAssertionGuid026 = EFI_TEST_EFICOMPLIANTBBTE EFI_GUID gEfiCompliantBbTestPlatformAssertionGuid027 = EFI_TEST_EFICOMPLIANTBBTESTPLATFORM_ASSERTION_027_GUID; +EFI_GUID gEfiCompliantBbTestPlatformAssertionGuid028 = EFI_TEST_EFICOMPLIANTBBTESTPLATFORM_ASSERTION_028_GUID; + EFI_GUID gEfiCompliantBbTestRequiredAssertionGuid001 = EFI_TEST_EFICOMPLIANTBBTESTREQUIRED_ASSERTION_001_GUID; EFI_GUID gEfiCompliantBbTestRequiredAssertionGuid002 = EFI_TEST_EFICOMPLIANTBBTESTREQUIRED_ASSERTION_002_GUID; diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Guid_uefi.h b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Guid_uefi.h index b6e1f379..e1182291 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Guid_uefi.h +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Guid_uefi.h @@ -1,7 +1,7 @@ /** @file Copyright 2006 - 2016 Unified EFI, Inc.
- Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -160,6 +160,11 @@ extern EFI_GUID gEfiCompliantBbTestPlatformAssertionGuid026; extern EFI_GUID gEfiCompliantBbTestPlatformAssertionGuid027; +#define EFI_TEST_EFICOMPLIANTBBTESTPLATFORM_ASSERTION_028_GUID \ +{ 0xeff461eb, 0x4f56, 0x44a5, { 0x89, 0x5e, 0xee, 0x5e, 0xe4, 0x2a, 0xd3, 0x9 }} + +extern EFI_GUID gEfiCompliantBbTestPlatformAssertionGuid028; + #define EFI_TEST_EFICOMPLIANTBBTESTREQUIRED_ASSERTION_001_GUID \ { 0xf6a871e3, 0xef8a, 0x420f, {0x82, 0x01, 0x35, 0xb6, 0x1c, 0xe2, 0xe8, 0xdb }} -- 2.18.0.windows.1