public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] uefi-sct/SctPkg: Fix the BlueTooth Guid and Enable BLE test
@ 2018-10-14  3:54 Eric Jin
  2018-10-15  2:36 ` Supreeth Venkatesh
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Jin @ 2018-10-14  3:54 UTC (permalink / raw)
  To: edk2-devel; +Cc: Supreeth Venkatesh, Jiaxin Wu

Correct the guid of EFI_GUID gEfiBlueToothIoProtocolGuid and gEfiBlueToothConfigProtocolGuid
Add BlueToothLE support test in the EfiCompliant part

Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin <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];
+  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.<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 }}
 
-- 
2.18.0.windows.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-16  9:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox