Kaynağa Gözat

ManageabilityPkg: Add NULL ManageabilityTransportLib

The NULL instance of ManageabilityTransportLib
library.

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Abdul Lateef Attar <abdattar@amd.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
Abner Chang 1 yıl önce
ebeveyn
işleme
a4dc02b56e

+ 64 - 0
Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.c

@@ -0,0 +1,64 @@
+/** @file
+  Null instance of Manageability Transport Library
+
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <Uefi.h>
+#include <Library/ManageabilityTransportLib.h>
+
+/**
+  This function acquires to create a transport session to transmit manageability
+  packet. A transport token is returned to caller for the follow up operations.
+
+  @param [in]   ManageabilityProtocolSpec  The protocol spec the transport interface is acquired.
+  @param [out]  TransportToken             The pointer to receive the transport token created by
+                                           the target transport interface library.
+  @retval       EFI_SUCCESS                Token is created successfully.
+  @retval       EFI_OUT_OF_RESOURCES       Out of resource to create a new transport session.
+  @retval       EFI_UNSUPPORTED            Protocol is not supported on this transport interface.
+  @retval       Otherwise                  Other errors.
+
+**/
+EFI_STATUS
+AcquireTransportSession (
+  IN  EFI_GUID                       *ManageabilityProtocolSpec,
+  OUT MANAGEABILITY_TRANSPORT_TOKEN  **TransportToken
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  This function returns the transport capabilities.
+
+  @param [out]  TransportFeature        Pointer to receive transport capabilities.
+                                        See the definitions of
+                                        MANAGEABILITY_TRANSPORT_CAPABILITY.
+
+**/
+VOID
+GetTransportCapability (
+  OUT MANAGEABILITY_TRANSPORT_CAPABILITY  *TransportCapability
+  )
+{
+  *TransportCapability = 0;
+}
+
+/**
+  This function releases the manageability session.
+
+  @param [in]  TransportToken   The transport token acquired through
+                                AcquireTransportSession.
+  @retval      EFI_SUCCESS      Token is released successfully.
+               Otherwise        Other errors.
+
+**/
+EFI_STATUS
+ReleaseTransportSession (
+  IN MANAGEABILITY_TRANSPORT_TOKEN  *TransportToken
+  )
+{
+  return EFI_SUCCESS;
+}

+ 28 - 0
Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf

@@ -0,0 +1,28 @@
+## @file
+# Null instance of Manageability Transport Library
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x0001001B
+  BASE_NAME                      = BaseManageabilityTransportNull
+  MODULE_UNI_FILE                = BaseManageabilityTransportNull.uni
+  FILE_GUID                      = B63DC070-FB44-44F3-8E9A-DA6CC712EF4F
+  MODULE_TYPE                    = BASE
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = ManageabilityTransportLib
+
+#
+#  VALID_ARCHITECTURES           = IA32 X64 ARM AARCH64
+#
+
+[Sources]
+  BaseManageabilityTransportNull.c
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+

+ 13 - 0
Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.uni

@@ -0,0 +1,13 @@
+// /** @file
+// Null instance of Manageability Transport Library
+//
+// Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
+//
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+// **/
+
+#string STR_MODULE_ABSTRACT             #language en-US "Null instance of Manageability Transport Library"
+
+#string STR_MODULE_DESCRIPTION          #language en-US "Manageability Transport library implementation for build ManageabilityPkg only."
+

+ 3 - 1
Features/ManageabilityPkg/ManageabilityPkg.dsc

@@ -35,5 +35,7 @@
 !include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
 !include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
 
-!include Include/Dsc/Manageability.dsc
+[LibraryClasses]
+  ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
 
+!include Include/Dsc/Manageability.dsc