From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=217.140.101.70; helo=foss.arm.com; envelope-from=supreeth.venkatesh@arm.com; receiver=edk2-devel@lists.01.org Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by ml01.01.org (Postfix) with ESMTP id C302F21BADAB9 for ; Tue, 16 Oct 2018 02:48:38 -0700 (PDT) Received: by usa-sjc-mx-foss1.foss.arm.com (Postfix, from userid 105) id 03ACB302D; Tue, 16 Oct 2018 03:18:30 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6FABD34FF; Sun, 14 Oct 2018 19:36:43 -0700 (PDT) Received: from [10.6.43.238] (bc-c3-3-14.eu.iaas.arm.com [10.6.43.238]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 789913F5B1; Sun, 14 Oct 2018 19:36:26 -0700 (PDT) To: Eric Jin , edk2-devel@lists.01.org Cc: Jiaxin Wu References: <20181014035457.6104-1-eric.jin@intel.com> From: Supreeth Venkatesh Message-ID: Date: Mon, 15 Oct 2018 03:36:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181014035457.6104-1-eric.jin@intel.com> Subject: Re: [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: Tue, 16 Oct 2018 09:48:39 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US On 10/14/2018 04:54 AM, Eric Jin wrote: > 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]; Why 10 and magic number. > + 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; Magic Number 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 }} >