public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Supreeth Venkatesh <Supreeth.Venkatesh@arm.com>
To: Eric Jin <eric.jin@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>,
	Supreeth Venkatesh <Supreeth.Venkatesh@arm.com>
Subject: Re: [PATCH] uefi-sct/SctPkg: Fix the BlueTooth Guid and Enable BLE test
Date: Mon, 15 Oct 2018 13:09:39 +0000	[thread overview]
Message-ID: <AM4PR08MB27886D29F8F0991E798C8F8880FD0@AM4PR08MB2788.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <af4c677d-6245-c520-28e4-5fd38eade1d7@arm.com>

FYI

On 10/15/2018 03:36 AM, Supreeth Venkatesh wrote:


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 <supreeth.venkatesh@arm.com><mailto:supreeth.venkatesh@arm.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com><mailto:jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin <eric.jin@intel.com><mailto:eric.jin@intel.com>
---
  .../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.<BR>
-#  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
  #
  #  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                = <yes: if this platform supports EAP network>
  #
-#   BlueToothSupport          = <yes: if this platform supports BlueTooth>
+#   BlueToothClassicSupport   = <yes: if this platform supports BlueTooth Classic>
+#
+#   BlueToothLESupport        = <yes: if this platform supports BlueTooth LE>
  #
  #   IPSecSupport              = <yes: if this platform supports IPSec network>
  #
@@ -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.<BR>
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
      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.<BR>
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
      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.<BR>
-  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
      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 }}



IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

      reply	other threads:[~2018-10-15 13:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-14  3:54 [PATCH] uefi-sct/SctPkg: Fix the BlueTooth Guid and Enable BLE test Eric Jin
2018-10-15  2:36 ` Supreeth Venkatesh
2018-10-15 13:09   ` Supreeth Venkatesh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM4PR08MB27886D29F8F0991E798C8F8880FD0@AM4PR08MB2788.eurprd08.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox