[PATCH v4 4/9] ManageabilityPkg: Add NULL ManageabilityTransportLib


Chang, Abner
 

From: Abner Chang <abner.chang@...>

The NULL instance of ManageabilityTransportLib
library.

Signed-off-by: Abner Chang <abner.chang@...>
Cc: Liming Gao <gaoliming@...>
Cc: Isaac Oram <isaac.w.oram@...>
Cc: Nate DeSimone <nathaniel.l.desimone@...>
Cc: Nickle Wang <nicklew@...>
Cc: Igor Kulchytskyy <igork@...>
Cc: Abdul Lateef Attar <abdattar@...>
---
.../ManageabilityPkg/ManageabilityPkg.dsc | 4 +-
.../BaseManageabilityTransportNull.inf | 28 ++++++++
.../BaseManageabilityTransportNull.c | 64 +++++++++++++++++++
.../BaseManageabilityTransportNull.uni | 13 ++++
4 files changed, 108 insertions(+), 1 deletion(-)
create mode 100644 Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
create mode 100644 Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.c
create mode 100644 Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.uni

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc b/Features/ManageabilityPkg/ManageabilityPkg.dsc
index b3586afa07..f5b8c550e8 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
+++ b/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
diff --git a/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf b/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
new file mode 100644
index 0000000000..3cb97afb8b
--- /dev/null
+++ b/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
+
diff --git a/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.c b/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.c
new file mode 100644
index 0000000000..49fc8c0f71
--- /dev/null
+++ b/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;
+}
diff --git a/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.uni b/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.uni
new file mode 100644
index 0000000000..2211037072
--- /dev/null
+++ b/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."
+
--
2.37.1.windows.1


Nickle Wang
 

Reviewed-by: Nickle Wang <nicklew@...>

Regards,
Nickle

-----Original Message-----
From: abner.chang@... <abner.chang@...>
Sent: Wednesday, March 22, 2023 10:49 AM
To: devel@edk2.groups.io
Cc: Liming Gao <gaoliming@...>; Isaac Oram
<isaac.w.oram@...>; Nate DeSimone <nathaniel.l.desimone@...>;
Nickle Wang <nicklew@...>; Igor Kulchytskyy <igork@...>; Abdul
Lateef Attar <abdattar@...>
Subject: [PATCH v4 4/9] ManageabilityPkg: Add NULL ManageabilityTransportLib

External email: Use caution opening links or attachments


From: Abner Chang <abner.chang@...>

The NULL instance of ManageabilityTransportLib
library.

Signed-off-by: Abner Chang <abner.chang@...>
Cc: Liming Gao <gaoliming@...>
Cc: Isaac Oram <isaac.w.oram@...>
Cc: Nate DeSimone <nathaniel.l.desimone@...>
Cc: Nickle Wang <nicklew@...>
Cc: Igor Kulchytskyy <igork@...>
Cc: Abdul Lateef Attar <abdattar@...>
---
.../ManageabilityPkg/ManageabilityPkg.dsc | 4 +-
.../BaseManageabilityTransportNull.inf | 28 ++++++++
.../BaseManageabilityTransportNull.c | 64 +++++++++++++++++++
.../BaseManageabilityTransportNull.uni | 13 ++++
4 files changed, 108 insertions(+), 1 deletion(-)
create mode 100644
Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseM
anageabilityTransportNull.inf
create mode 100644
Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseM
anageabilityTransportNull.c
create mode 100644
Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseM
anageabilityTransportNull.uni

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
index b3586afa07..f5b8c550e8 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
+++ b/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/BaseManageabilityTransp
ortNullLib/BaseManageabilityTransportNull.inf

+!include Include/Dsc/Manageability.dsc
diff --git
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/Base
ManageabilityTransportNull.inf
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/Base
ManageabilityTransportNull.inf
new file mode 100644
index 0000000000..3cb97afb8b
--- /dev/null
+++
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/Base
ManageabilityTransportNull.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
+
diff --git
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/Base
ManageabilityTransportNull.c
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/Base
ManageabilityTransportNull.c
new file mode 100644
index 0000000000..49fc8c0f71
--- /dev/null
+++
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/Base
ManageabilityTransportNull.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;
+}
diff --git
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/Base
ManageabilityTransportNull.uni
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/Base
ManageabilityTransportNull.uni
new file mode 100644
index 0000000000..2211037072
--- /dev/null
+++
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/Base
ManageabilityTransportNull.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."
+
--
2.37.1.windows.1