[edk2-devel] [EFI Redfish Host Interface PATCH 3/5] RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib

Abner Chang posted 5 patches 1 month, 1 week ago

[edk2-devel] [EFI Redfish Host Interface PATCH 3/5] RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib

Posted by Abner Chang 1 month, 1 week ago
NULL instance of PlatformHostInterfaceLib.

Signed-off-by: Abner Chang <abner.chang@hpe.com>

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Fan Wang <fan.wang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
---
 .../PlatformHostInterfaceLibNull.c            | 53 +++++++++++++++++++
 .../PlatformHostInterfaceLibNull.inf          | 34 ++++++++++++
 2 files changed, 87 insertions(+)
 create mode 100644 RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
 create mode 100644 RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.inf

diff --git a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
new file mode 100644
index 0000000000..7653f22d25
--- /dev/null
+++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.c
@@ -0,0 +1,53 @@
+/** @file
+  NULL instace of RedfishPlatformHostInterfaceLib
+
+  (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#include <Uefi.h>
+#include <Library/BaseLib.h>
+#include <Library/RedfishHostInterfaceLib.h>
+#include <Library/UefiLib.h>
+
+/**
+  Get platform Redfish host interface device descriptor.
+
+  @param[out] DeviceType        Pointer to retrieve device type.
+  @param[out] DeviceDescriptor  Pointer to retrieve REDFISH_INTERFACE_DATA, caller has to free
+                                this memory using FreePool().
+  @retval EFI_SUCCESS     Device descriptor is returned successfully in DeviceDescriptor.
+  @retval EFI_NOT_FOUND   No Redfish host interface descriptor provided on this platform.
+  @retval Others          Fail to get device descriptor.
+**/
+EFI_STATUS
+RedfishPlatformHostInterfaceDeviceDescriptor (
+  IN UINT8 *DeviceType,
+  IN REDFISH_INTERFACE_DATA  **DeviceDescriptor
+)
+{
+  return EFI_NOT_FOUND;
+}
+/**
+  Get platform Redfish host interface protocol data.
+  Caller should pass NULL in ProtocolRecord to retrive the first protocol record.
+  Then continuously pass previous ProtocolRecord for retrieving the next ProtocolRecord.
+
+  @param[in, out] ProtocolRecord  Pointer to retrieve the first or the next protocol record.
+                                  caller has to free the new protocol record returned from
+                                  this function using FreePool().
+  param[in] IndexOfProtocolData   The index of protocol data.
+
+  @retval EFI_SUCESS      Protocol records are all returned.
+  @retval EFI_NOT_FOUND   No more protocol records.
+  @retval Others          Fail to get protocol records.
+**/
+EFI_STATUS
+RedfishPlatformHostInterfaceProtocolData (
+  IN MC_HOST_INTERFACE_PROTOCOL_RECORD **ProtocolRecord,
+  IN UINT8  IndexOfProtocolData
+)
+{
+  return EFI_NOT_FOUND;
+}
diff --git a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.inf b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.inf
new file mode 100644
index 0000000000..bb840ce3cb
--- /dev/null
+++ b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibNull.inf
@@ -0,0 +1,34 @@
+## @file
+#  NULL instance of RedfishPlatformHostInterfaceLib
+#
+#  (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x0001000b
+  BASE_NAME                      = RedfishPlatformHostInterfaceLibNull
+  FILE_GUID                      = 851229BF-4D8B-30F3-DD0D-20AFAF99A77B
+  MODULE_TYPE                    = DXE_DRIVER
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = RedfishPlatformHostInterfaceLib
+
+#
+#  VALID_ARCHITECTURES           = IA32 X64 ARM AARCH64
+#
+
+[Sources]
+  PlatformHostInterfaceLibNull.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  RedfishPkg/RedfishPkg.dec
+
+[LibraryClasses]
+  UefiLib
+  BaseLib
+  DebugLib
+
-- 
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#66157): https://edk2.groups.io/g/devel/message/66157
Mute This Topic: https://groups.io/mt/77477504/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [EFI Redfish Host Interface PATCH 3/5] RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib

Posted by Nickle Wang 3 weeks, 5 days ago
Hi Abner,

I do not see any usage of DEBUG macro in this NULL library so maybe "DebugLib" could be removed from INF file.

Thanks,
Nickle

> -----Original Message-----
> From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> Sent: Tuesday, October 13, 2020 12:08 PM
> To: devel@edk2.groups.io
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>; Siyuan Fu <siyuan.fu@intel.com>; Fan
> Wang <fan.wang@intel.com>; Jiewen Yao <jiewen.yao@intel.com>; Wang,
> Nickle (HPS SW) <nickle.wang@hpe.com>
> Subject: [EFI Redfish Host Interface PATCH 3/5]
> RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib
> 
> NULL instance of PlatformHostInterfaceLib.
> 
> Signed-off-by: Abner Chang <abner.chang@hpe.com>
> 
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
> Cc: Siyuan Fu <siyuan.fu@intel.com>
> Cc: Fan Wang <fan.wang@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Nickle Wang <nickle.wang@hpe.com>
> ---
>  .../PlatformHostInterfaceLibNull.c            | 53 +++++++++++++++++++
>  .../PlatformHostInterfaceLibNull.inf          | 34 ++++++++++++
>  2 files changed, 87 insertions(+)
>  create mode 100644
> RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibN
> ull.c
>  create mode 100644
> RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLibN
> ull.inf
> 
> diff --git
> a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLi
> bNull.c
> b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLi
> bNull.c
> new file mode 100644
> index 0000000000..7653f22d25
> --- /dev/null
> +++
> b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLi
> bNull.c
> @@ -0,0 +1,53 @@
> +/** @file
> +  NULL instace of RedfishPlatformHostInterfaceLib
> +
> +  (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +#include <Uefi.h>
> +#include <Library/BaseLib.h>
> +#include <Library/RedfishHostInterfaceLib.h>
> +#include <Library/UefiLib.h>
> +
> +/**
> +  Get platform Redfish host interface device descriptor.
> +
> +  @param[out] DeviceType        Pointer to retrieve device type.
> +  @param[out] DeviceDescriptor  Pointer to retrieve
> REDFISH_INTERFACE_DATA, caller has to free
> +                                this memory using FreePool().
> +  @retval EFI_SUCCESS     Device descriptor is returned successfully in
> DeviceDescriptor.
> +  @retval EFI_NOT_FOUND   No Redfish host interface descriptor provided
> on this platform.
> +  @retval Others          Fail to get device descriptor.
> +**/
> +EFI_STATUS
> +RedfishPlatformHostInterfaceDeviceDescriptor (
> +  IN UINT8 *DeviceType,
> +  IN REDFISH_INTERFACE_DATA  **DeviceDescriptor
> +)
> +{
> +  return EFI_NOT_FOUND;
> +}
> +/**
> +  Get platform Redfish host interface protocol data.
> +  Caller should pass NULL in ProtocolRecord to retrive the first protocol
> record.
> +  Then continuously pass previous ProtocolRecord for retrieving the next
> ProtocolRecord.
> +
> +  @param[in, out] ProtocolRecord  Pointer to retrieve the first or the next
> protocol record.
> +                                  caller has to free the new protocol record returned from
> +                                  this function using FreePool().
> +  param[in] IndexOfProtocolData   The index of protocol data.
> +
> +  @retval EFI_SUCESS      Protocol records are all returned.
> +  @retval EFI_NOT_FOUND   No more protocol records.
> +  @retval Others          Fail to get protocol records.
> +**/
> +EFI_STATUS
> +RedfishPlatformHostInterfaceProtocolData (
> +  IN MC_HOST_INTERFACE_PROTOCOL_RECORD **ProtocolRecord,
> +  IN UINT8  IndexOfProtocolData
> +)
> +{
> +  return EFI_NOT_FOUND;
> +}
> diff --git
> a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLi
> bNull.inf
> b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLi
> bNull.inf
> new file mode 100644
> index 0000000000..bb840ce3cb
> --- /dev/null
> +++
> b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceLi
> bNull.inf
> @@ -0,0 +1,34 @@
> +## @file
> +#  NULL instance of RedfishPlatformHostInterfaceLib
> +#
> +#  (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION                    = 0x0001000b
> +  BASE_NAME                      = RedfishPlatformHostInterfaceLibNull
> +  FILE_GUID                      = 851229BF-4D8B-30F3-DD0D-20AFAF99A77B
> +  MODULE_TYPE                    = DXE_DRIVER
> +  VERSION_STRING                 = 1.0
> +  LIBRARY_CLASS                  = RedfishPlatformHostInterfaceLib
> +
> +#
> +#  VALID_ARCHITECTURES           = IA32 X64 ARM AARCH64
> +#
> +
> +[Sources]
> +  PlatformHostInterfaceLibNull.c
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  RedfishPkg/RedfishPkg.dec
> +
> +[LibraryClasses]
> +  UefiLib
> +  BaseLib
> +  DebugLib
> +
> --
> 2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#66731): https://edk2.groups.io/g/devel/message/66731
Mute This Topic: https://groups.io/mt/77477504/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [EFI Redfish Host Interface PATCH 3/5] RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib

Posted by Abner Chang 3 weeks, 4 days ago
Hi Nickle,
I have addressed the feedbacks you gave to v1 on the v2 patches set.
Thanks
Abner

> -----Original Message-----
> From: Wang, Nickle (HPS SW)
> Sent: Thursday, October 29, 2020 2:27 PM
> To: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>;
> devel@edk2.groups.io
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>; Siyuan Fu <siyuan.fu@intel.com>; Fan
> Wang <fan.wang@intel.com>; Jiewen Yao <jiewen.yao@intel.com>
> Subject: RE: [EFI Redfish Host Interface PATCH 3/5]
> RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib
> 
> Hi Abner,
> 
> I do not see any usage of DEBUG macro in this NULL library so maybe
> "DebugLib" could be removed from INF file.
> 
> Thanks,
> Nickle
> 
> > -----Original Message-----
> > From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@hpe.com>
> > Sent: Tuesday, October 13, 2020 12:08 PM
> > To: devel@edk2.groups.io
> > Cc: Jiaxin Wu <jiaxin.wu@intel.com>; Siyuan Fu <siyuan.fu@intel.com>;
> > Fan Wang <fan.wang@intel.com>; Jiewen Yao <jiewen.yao@intel.com>;
> > Wang, Nickle (HPS SW) <nickle.wang@hpe.com>
> > Subject: [EFI Redfish Host Interface PATCH 3/5]
> > RedfishPkg/PlatformHostInterfaceLib: Platform NULL lib
> >
> > NULL instance of PlatformHostInterfaceLib.
> >
> > Signed-off-by: Abner Chang <abner.chang@hpe.com>
> >
> > Cc: Jiaxin Wu <jiaxin.wu@intel.com>
> > Cc: Siyuan Fu <siyuan.fu@intel.com>
> > Cc: Fan Wang <fan.wang@intel.com>
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: Nickle Wang <nickle.wang@hpe.com>
> > ---
> >  .../PlatformHostInterfaceLibNull.c            | 53 +++++++++++++++++++
> >  .../PlatformHostInterfaceLibNull.inf          | 34 ++++++++++++
> >  2 files changed, 87 insertions(+)
> >  create mode 100644
> > RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceL
> > ibN
> > ull.c
> >  create mode 100644
> > RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfaceL
> > ibN
> > ull.inf
> >
> > diff --git
> > a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfac
> > eLi
> > bNull.c
> > b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfac
> > eLi
> > bNull.c
> > new file mode 100644
> > index 0000000000..7653f22d25
> > --- /dev/null
> > +++
> > b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfac
> > eLi
> > bNull.c
> > @@ -0,0 +1,53 @@
> > +/** @file
> > +  NULL instace of RedfishPlatformHostInterfaceLib
> > +
> > +  (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
> > +
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > +
> > +**/
> > +#include <Uefi.h>
> > +#include <Library/BaseLib.h>
> > +#include <Library/RedfishHostInterfaceLib.h>
> > +#include <Library/UefiLib.h>
> > +
> > +/**
> > +  Get platform Redfish host interface device descriptor.
> > +
> > +  @param[out] DeviceType        Pointer to retrieve device type.
> > +  @param[out] DeviceDescriptor  Pointer to retrieve
> > REDFISH_INTERFACE_DATA, caller has to free
> > +                                this memory using FreePool().
> > +  @retval EFI_SUCCESS     Device descriptor is returned successfully in
> > DeviceDescriptor.
> > +  @retval EFI_NOT_FOUND   No Redfish host interface descriptor provided
> > on this platform.
> > +  @retval Others          Fail to get device descriptor.
> > +**/
> > +EFI_STATUS
> > +RedfishPlatformHostInterfaceDeviceDescriptor (
> > +  IN UINT8 *DeviceType,
> > +  IN REDFISH_INTERFACE_DATA  **DeviceDescriptor
> > +)
> > +{
> > +  return EFI_NOT_FOUND;
> > +}
> > +/**
> > +  Get platform Redfish host interface protocol data.
> > +  Caller should pass NULL in ProtocolRecord to retrive the first
> > +protocol
> > record.
> > +  Then continuously pass previous ProtocolRecord for retrieving the
> > + next
> > ProtocolRecord.
> > +
> > +  @param[in, out] ProtocolRecord  Pointer to retrieve the first or
> > + the next
> > protocol record.
> > +                                  caller has to free the new protocol record returned from
> > +                                  this function using FreePool().
> > +  param[in] IndexOfProtocolData   The index of protocol data.
> > +
> > +  @retval EFI_SUCESS      Protocol records are all returned.
> > +  @retval EFI_NOT_FOUND   No more protocol records.
> > +  @retval Others          Fail to get protocol records.
> > +**/
> > +EFI_STATUS
> > +RedfishPlatformHostInterfaceProtocolData (
> > +  IN MC_HOST_INTERFACE_PROTOCOL_RECORD **ProtocolRecord,
> > +  IN UINT8  IndexOfProtocolData
> > +)
> > +{
> > +  return EFI_NOT_FOUND;
> > +}
> > diff --git
> > a/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfac
> > eLi
> > bNull.inf
> > b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfac
> > eLi
> > bNull.inf
> > new file mode 100644
> > index 0000000000..bb840ce3cb
> > --- /dev/null
> > +++
> > b/RedfishPkg/Library/PlatformHostInterfaceLibNull/PlatformHostInterfac
> > eLi
> > bNull.inf
> > @@ -0,0 +1,34 @@
> > +## @file
> > +#  NULL instance of RedfishPlatformHostInterfaceLib # #  (C)
> > +Copyright 2020 Hewlett Packard Enterprise Development LP<BR> # #
> > +SPDX-License-Identifier: BSD-2-Clause-Patent # ##
> > +
> > +[Defines]
> > +  INF_VERSION                    = 0x0001000b
> > +  BASE_NAME                      = RedfishPlatformHostInterfaceLibNull
> > +  FILE_GUID                      = 851229BF-4D8B-30F3-DD0D-20AFAF99A77B
> > +  MODULE_TYPE                    = DXE_DRIVER
> > +  VERSION_STRING                 = 1.0
> > +  LIBRARY_CLASS                  = RedfishPlatformHostInterfaceLib
> > +
> > +#
> > +#  VALID_ARCHITECTURES           = IA32 X64 ARM AARCH64
> > +#
> > +
> > +[Sources]
> > +  PlatformHostInterfaceLibNull.c
> > +
> > +[Packages]
> > +  MdePkg/MdePkg.dec
> > +  MdeModulePkg/MdeModulePkg.dec
> > +  RedfishPkg/RedfishPkg.dec
> > +
> > +[LibraryClasses]
> > +  UefiLib
> > +  BaseLib
> > +  DebugLib
> > +
> > --
> > 2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#66819): https://edk2.groups.io/g/devel/message/66819
Mute This Topic: https://groups.io/mt/77477504/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-