[edk2-staging][PATCH] edk2-staging/RedfishClientPkg: Introduce Redfish event library


Abner Chang
 

Few minor issues.

-----Original Message-----
From: Wang, Nickle (Server BIOS) <nickle.wang@...>
Sent: Tuesday, May 17, 2022 10:40 AM
To: devel@edk2.groups.io
Cc: Wang, Nickle (Server BIOS) <nickle.wang@...>; Chang, Abner (HPS
SW/FW Technologist) <abner.chang@...>
Subject: [edk2-staging][PATCH] edk2-staging/RedfishClientPkg: Introduce
Redfish event library

Add RedfishEventLib to Redfish client package. This library provides
interface for Redfish feature drivers to listen to Redfish event
such as the event before provisioning and the event after
provisioning. Feature driver can perform additional operation before
and after Redfish provisioning.

Signed-off-by: Nickle Wang <nickle.wang@...>
Cc: Abner Chang <abner.chang@...>
---
.../Include/Guid/RedfishClientEventGroup.h | 27 ++++
.../Include/Library/RedfishEventLib.h | 77 ++++++++++
.../Library/RedfishEventLib/RedfishEventLib.c | 139 ++++++++++++++++++
.../RedfishEventLib/RedfishEventLib.inf | 38 +++++
RedfishClientPkg/RedfishClientLibs.dsc.inc | 2 +-
RedfishClientPkg/RedfishClientPkg.dec | 7 +-
6 files changed, 288 insertions(+), 2 deletions(-)
create mode 100644
RedfishClientPkg/Include/Guid/RedfishClientEventGroup.h
create mode 100644 RedfishClientPkg/Include/Library/RedfishEventLib.h
create mode 100644
RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.c
create mode 100644
RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.inf

diff --git a/RedfishClientPkg/Include/Guid/RedfishClientEventGroup.h
b/RedfishClientPkg/Include/Guid/RedfishClientEventGroup.h
new file mode 100644
index 0000000000..0d88dd4726
--- /dev/null
+++ b/RedfishClientPkg/Include/Guid/RedfishClientEventGroup.h
@@ -0,0 +1,27 @@
+/** @file

+ GUID for Redfish Client Event Group GUID

+

+ (C) Copyright 2022 Hewlett Packard Enterprise Development LP<BR>

+

+ SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#ifndef REDFISH_CLIENT_EVENT_GROUP_GUID_H_

+#define REDFISH_CLIENT_EVENT_GROUP_GUID_H_

+

+#define REDFISH_CLIENT_FEATURE_READY_TO_PROVISIONING_GUID \

+ { \

+ 0x77E4FC1C, 0x2428, 0x47EE, { 0x9E, 0xEC, 0x8B, 0x77, 0xEF, 0x9D, 0x4E,
0xF0 } \

+ }

+

+extern EFI_GUID gEfiRedfishClientFeatureReadyToProvisioningGuid;

+

+#define REDFISH_CLIENT_FEATURE_AFTER_PROVISIONING_GUID \

+ { \

+ 0xE547CB6F, 0x306F, 0x4226, { 0xAB, 0x70, 0xA0, 0x6E, 0x26, 0xF1, 0x2E,
0xD0 } \

+ }

+

+extern EFI_GUID gEfiRedfishClientFeatureAfterProvisioningGuid;

+

+#endif

diff --git a/RedfishClientPkg/Include/Library/RedfishEventLib.h
b/RedfishClientPkg/Include/Library/RedfishEventLib.h
new file mode 100644
index 0000000000..1f3d0acf19
--- /dev/null
+++ b/RedfishClientPkg/Include/Library/RedfishEventLib.h
@@ -0,0 +1,77 @@
+/** @file

+ This file defines the Redfish event library interface.

+

+ (C) Copyright 2022 Hewlett Packard Enterprise Development LP<BR>

+

+ SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#ifndef REDFISH_EVENT_LIB_H_

+#define REDFISH_EVENT_LIB_H_

+

+#include <Uefi.h>

+

+/**

+ Create an EFI event before Redfish provisioning start.

+

+ @param NotifyFunction The notification function to call when the
event is signaled.

+ @param NotifyContext The content to pass to NotifyFunction when
the event is signaled.

+ @param ReadyToProvisioningEvent Returns the EFI event returned from
gBS->CreateEvent(Ex).

+

+ @retval EFI_SUCCESS Event was created.

+ @retval Other Event was not created.

+

+**/

+EFI_STATUS

+EFIAPI

+CreateReadyToProvisioningEvent (

+ IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL

+ IN VOID *NotifyContext, OPTIONAL

+ OUT EFI_EVENT *ReadyToProvisioningEvent

+ );

+

+/**

+ Create an EFI event after Redfish provisioning finished.

+

+ @param NotifyFunction The notification function to call when the
event is signaled.

+ @param NotifyContext The content to pass to NotifyFunction when
the event is signaled.

+ @param ReadyToProvisioningEvent Returns the EFI event returned from
gBS->CreateEvent(Ex).

+

+ @retval EFI_SUCCESS Event was created.

+ @retval Other Event was not created.

+

+**/

+EFI_STATUS

+EFIAPI

+CreateAfterProvisioningEvent (

+ IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL

+ IN VOID *NotifyContext, OPTIONAL

+ OUT EFI_EVENT *ReadyToProvisioningEvent

+ );

+

+/**

+ Signal ready to provisioning event.

+

+ @retval EFI_SUCCESS Event was created.

+ @retval Other Event was not created.

+

+**/

+EFI_STATUS

+SignalReadyToProvisioningEvent (

+ IN VOID
Please remove IN.

+ );

+

+/**

+ Signal after provisioning event.

+

+ @retval EFI_SUCCESS Event was created.

+ @retval Other Event was not created.

+

+**/

+EFI_STATUS

+SignalAfterProvisioningEvent (

+ IN VOID
Please remove IN.

+ );

+

+#endif

diff --git a/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.c
b/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.c
new file mode 100644
index 0000000000..1c8cfe53c7
--- /dev/null
+++ b/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.c
@@ -0,0 +1,139 @@
+/** @file

+ Redfish event library implementation.

+

+ (C) Copyright 2022 Hewlett Packard Enterprise Development LP<BR>

+

+ SPDX-License-Identifier: BSD-2-Clause-Patent

+

+**/

+

+#include <Uefi.h>

+

+#include <Guid/RedfishClientEventGroup.h>

+

+#include <Library/UefiLib.h>

+#include <Library/BaseLib.h>

+#include <Library/DebugLib.h>

+#include <Library/UefiBootServicesTableLib.h>

+#include <Library/RedfishEventLib.h>

+

+/**

+ Create an EFI event before Redfish provisioning start.

+

+ @param NotifyFunction The notification function to call when the
event is signaled.

+ @param NotifyContext The content to pass to NotifyFunction when
the event is signaled.

+ @param ReadyToProvisioningEvent Returns the EFI event returned from
gBS->CreateEvent(Ex).

+

+ @retval EFI_SUCCESS Event was created.

+ @retval Other Event was not created.

+

+**/

+EFI_STATUS

+EFIAPI

+CreateReadyToProvisioningEvent (

+ IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL

+ IN VOID *NotifyContext, OPTIONAL

+ OUT EFI_EVENT *ReadyToProvisioningEvent

+ )

+{

+ EFI_STATUS Status;

+

+ Status = gBS->CreateEventEx (

+ EVT_NOTIFY_SIGNAL,

+ TPL_CALLBACK,

+ (NotifyFunction == NULL ? EfiEventEmptyFunction :
NotifyFunction),

+ NotifyContext,

+ &gEfiRedfishClientFeatureReadyToProvisioningGuid,

+ ReadyToProvisioningEvent

+ );

+

+ return Status;

+}

+

+/**

+ Create an EFI event after Redfish provisioning finished.

+

+ @param NotifyFunction The notification function to call when the
event is signaled.

+ @param NotifyContext The content to pass to NotifyFunction when
the event is signaled.

+ @param ReadyToProvisioningEvent Returns the EFI event returned from
gBS->CreateEvent(Ex).

+

+ @retval EFI_SUCCESS Event was created.

+ @retval Other Event was not created.

+

+**/

+EFI_STATUS

+EFIAPI

+CreateAfterProvisioningEvent (

+ IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL

+ IN VOID *NotifyContext, OPTIONAL

+ OUT EFI_EVENT *ReadyToProvisioningEvent

+ )

+{

+ EFI_STATUS Status;

+

+ Status = gBS->CreateEventEx (

+ EVT_NOTIFY_SIGNAL,

+ TPL_CALLBACK,

+ (NotifyFunction == NULL ? EfiEventEmptyFunction :
NotifyFunction),

+ NotifyContext,

+ &gEfiRedfishClientFeatureAfterProvisioningGuid,

+ ReadyToProvisioningEvent

+ );

+

+ return Status;

+}

+

+/**

+ Signal ready to provisioning event.

+

+ @retval EFI_SUCCESS Event was created.

+ @retval Other Event was not created.

+

+**/

+EFI_STATUS

+SignalReadyToProvisioningEvent (

+ IN VOID
Please remove IN.
+ )

+{

+ EFI_STATUS Status;

+ EFI_EVENT Event;

+

+ Status = CreateReadyToProvisioningEvent (NULL, NULL, &Event);

+ if (EFI_ERROR (Status)) {

+ DEBUG ((DEBUG_ERROR, "%a, failed to create after provisioning event\n",
__FUNCTION__));

+ return Status;

+ }

+

+ gBS->SignalEvent (Event);

+ gBS->CloseEvent (Event);

+

+ return EFI_SUCCESS;

+}

+

+/**

+ Signal after provisioning event.

+

+ @retval EFI_SUCCESS Event was created.

+ @retval Other Event was not created.

+

+**/

+EFI_STATUS

+SignalAfterProvisioningEvent (

+ IN VOID
Please remove IN.

Abner

+ )

+{

+ EFI_STATUS Status;

+ EFI_EVENT Event;

+

+ Status = CreateAfterProvisioningEvent (NULL, NULL, &Event);

+ if (EFI_ERROR (Status)) {

+ DEBUG ((DEBUG_ERROR, "%a, failed to create after provisioning event\n",
__FUNCTION__));

+ return Status;

+ }

+

+ gBS->SignalEvent (Event);

+ gBS->CloseEvent (Event);

+

+ return EFI_SUCCESS;

+}

+

diff --git a/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.inf
b/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.inf
new file mode 100644
index 0000000000..edafca0c65
--- /dev/null
+++ b/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.inf
@@ -0,0 +1,38 @@
+## @file

+#

+# (C) Copyright 2022 Hewlett Packard Enterprise Development LP<BR>

+#

+# SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+ INF_VERSION = 0x00010006

+ BASE_NAME = RedfishEventLib

+ FILE_GUID = C4F7E27D-2338-43EA-9D1F-D10960E36521

+ MODULE_TYPE = DXE_DRIVER

+ VERSION_STRING = 1.0

+ LIBRARY_CLASS = RedfishEventLib| DXE_DRIVER UEFI_DRIVER

+

+#

+# VALID_ARCHITECTURES = IA32 X64 EBC

+#

+

+[Sources]

+ RedfishEventLib.c

+

+[Packages]

+ MdePkg/MdePkg.dec

+ MdeModulePkg/MdeModulePkg.dec

+ RedfishPkg/RedfishPkg.dec

+ RedfishClientPkg/RedfishClientPkg.dec

+

+[LibraryClasses]

+ BaseLib

+ DebugLib

+ UefiBootServicesTableLib

+ UefiLib

+

+[Guids]

+ gEfiRedfishClientFeatureReadyToProvisioningGuid

+ gEfiRedfishClientFeatureAfterProvisioningGuid

diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc
b/RedfishClientPkg/RedfishClientLibs.dsc.inc
index 5467acedd0..91e5de4296 100644
--- a/RedfishClientPkg/RedfishClientLibs.dsc.inc
+++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc
@@ -27,4 +27,4 @@

RedfishPlatformConfigLib|RedfishPkg/Library/RedfishPlatformConfigLib/Red
fishPlatformConfigLib.inf


RedfishContentCodingLib|RedfishPkg/Library/RedfishContentCodingLibNull/
RedfishContentCodingLibNull.inf


ConverterCommonLib|RedfishClientPkg/ConverterLib/edk2library/Converte
rCommonLib/ConverterCommonLib.inf

-

+
RedfishEventLib|RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.i
nf

diff --git a/RedfishClientPkg/RedfishClientPkg.dec
b/RedfishClientPkg/RedfishClientPkg.dec
index 09df062dd3..56e542f03c 100644
--- a/RedfishClientPkg/RedfishClientPkg.dec
+++ b/RedfishClientPkg/RedfishClientPkg.dec
@@ -1,7 +1,7 @@
## @file

# Redfish Client Package

#

-# (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>

+# (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP<BR>

#

# SPDX-License-Identifier: BSD-2-Clause-Patent

##

@@ -21,6 +21,7 @@


[LibraryClasses]

RedfishFeatureUtilityLib|Include/Library/RedfishFeatureUtilityLib.h

+ RedfishEventLib|Include/Library/RedfishEventLib.h



[LibraryClasses.Common.Private]

## @libraryclass Redfish Helper Library

@@ -39,6 +40,10 @@
## Include/Guid/RedfishClientPkgTokenSpace.h

gEfiRedfishClientPkgTokenSpaceGuid = { 0x8c444dae, 0x728b, 0x48ee,
{ 0x9e, 0x19, 0x8f, 0x0a, 0x3d, 0x4e, 0x9c, 0xc8 } }



+ ## Include/Guid/RedfishClientEventGroup.h

+ gEfiRedfishClientFeatureReadyToProvisioningGuid = { 0x77E4FC1C, 0x2428,
0x47EE, { 0x9E, 0xEC, 0x8B, 0x77, 0xEF, 0x9D, 0x4E, 0xF0 } }

+ gEfiRedfishClientFeatureAfterProvisioningGuid = { 0xE547CB6F, 0x306F,
0x4226, { 0xAB, 0x70, 0xA0, 0x6E, 0x26, 0xF1, 0x2E, 0xD0 } }

+

[PcdsFixedAtBuild]


gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize|32|
UINT32|0x10000001


gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaVersionSize|8|
UINT32|0x10000002

--
2.32.0.windows.2


Nickle Wang
 

Add RedfishEventLib to Redfish client package. This library provides
interface for Redfish feature drivers to listen to Redfish event
such as the event before provisioning and the event after
provisioning. Feature driver can perform additional operation before
and after Redfish provisioning.

Signed-off-by: Nickle Wang <nickle.wang@...>
Cc: Abner Chang <abner.chang@...>
---
.../Include/Guid/RedfishClientEventGroup.h | 27 ++++
.../Include/Library/RedfishEventLib.h | 77 ++++++++++
.../Library/RedfishEventLib/RedfishEventLib.c | 139 ++++++++++++++++++
.../RedfishEventLib/RedfishEventLib.inf | 38 +++++
RedfishClientPkg/RedfishClientLibs.dsc.inc | 2 +-
RedfishClientPkg/RedfishClientPkg.dec | 7 +-
6 files changed, 288 insertions(+), 2 deletions(-)
create mode 100644 RedfishClientPkg/Include/Guid/RedfishClientEventGroup.h
create mode 100644 RedfishClientPkg/Include/Library/RedfishEventLib.h
create mode 100644 RedfishClientPkg/Library/RedfishEventLib/RedfishEventLi=
b.c
create mode 100644 RedfishClientPkg/Library/RedfishEventLib/RedfishEventLi=
b.inf

diff --git a/RedfishClientPkg/Include/Guid/RedfishClientEventGroup.h b/Redf=
ishClientPkg/Include/Guid/RedfishClientEventGroup.h
new file mode 100644
index 0000000000..0d88dd4726
--- /dev/null
+++ b/RedfishClientPkg/Include/Guid/RedfishClientEventGroup.h
@@ -0,0 +1,27 @@
+/** @file=0D
+ GUID for Redfish Client Event Group GUID=0D
+=0D
+ (C) Copyright 2022 Hewlett Packard Enterprise Development LP<BR>=0D
+=0D
+ SPDX-License-Identifier: BSD-2-Clause-Patent=0D
+=0D
+**/=0D
+=0D
+#ifndef REDFISH_CLIENT_EVENT_GROUP_GUID_H_=0D
+#define REDFISH_CLIENT_EVENT_GROUP_GUID_H_=0D
+=0D
+#define REDFISH_CLIENT_FEATURE_READY_TO_PROVISIONING_GUID \=0D
+ { \=0D
+ 0x77E4FC1C, 0x2428, 0x47EE, { 0x9E, 0xEC, 0x8B, 0x77, 0xEF, 0x9D, 0x4E=
, 0xF0 } \=0D
+ }=0D
+=0D
+extern EFI_GUID gEfiRedfishClientFeatureReadyToProvisioningGuid;=0D
+=0D
+#define REDFISH_CLIENT_FEATURE_AFTER_PROVISIONING_GUID \=0D
+ { \=0D
+ 0xE547CB6F, 0x306F, 0x4226, { 0xAB, 0x70, 0xA0, 0x6E, 0x26, 0xF1, 0x2E=
, 0xD0 } \=0D
+ }=0D
+=0D
+extern EFI_GUID gEfiRedfishClientFeatureAfterProvisioningGuid;=0D
+=0D
+#endif=0D
diff --git a/RedfishClientPkg/Include/Library/RedfishEventLib.h b/RedfishCl=
ientPkg/Include/Library/RedfishEventLib.h
new file mode 100644
index 0000000000..1f3d0acf19
--- /dev/null
+++ b/RedfishClientPkg/Include/Library/RedfishEventLib.h
@@ -0,0 +1,77 @@
+/** @file=0D
+ This file defines the Redfish event library interface.=0D
+=0D
+ (C) Copyright 2022 Hewlett Packard Enterprise Development LP<BR>=0D
+=0D
+ SPDX-License-Identifier: BSD-2-Clause-Patent=0D
+=0D
+**/=0D
+=0D
+#ifndef REDFISH_EVENT_LIB_H_=0D
+#define REDFISH_EVENT_LIB_H_=0D
+=0D
+#include <Uefi.h>=0D
+=0D
+/**=0D
+ Create an EFI event before Redfish provisioning start.=0D
+=0D
+ @param NotifyFunction The notification function to call when=
the event is signaled.=0D
+ @param NotifyContext The content to pass to NotifyFunction =
when the event is signaled.=0D
+ @param ReadyToProvisioningEvent Returns the EFI event returned from gB=
S->CreateEvent(Ex).=0D
+=0D
+ @retval EFI_SUCCESS Event was created.=0D
+ @retval Other Event was not created.=0D
+=0D
+**/=0D
+EFI_STATUS=0D
+EFIAPI=0D
+CreateReadyToProvisioningEvent (=0D
+ IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL=0D
+ IN VOID *NotifyContext, OPTIONAL=0D
+ OUT EFI_EVENT *ReadyToProvisioningEvent=0D
+ );=0D
+=0D
+/**=0D
+ Create an EFI event after Redfish provisioning finished.=0D
+=0D
+ @param NotifyFunction The notification function to call when=
the event is signaled.=0D
+ @param NotifyContext The content to pass to NotifyFunction =
when the event is signaled.=0D
+ @param ReadyToProvisioningEvent Returns the EFI event returned from gB=
S->CreateEvent(Ex).=0D
+=0D
+ @retval EFI_SUCCESS Event was created.=0D
+ @retval Other Event was not created.=0D
+=0D
+**/=0D
+EFI_STATUS=0D
+EFIAPI=0D
+CreateAfterProvisioningEvent (=0D
+ IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL=0D
+ IN VOID *NotifyContext, OPTIONAL=0D
+ OUT EFI_EVENT *ReadyToProvisioningEvent=0D
+ );=0D
+=0D
+/**=0D
+ Signal ready to provisioning event.=0D
+=0D
+ @retval EFI_SUCCESS Event was created.=0D
+ @retval Other Event was not created.=0D
+=0D
+**/=0D
+EFI_STATUS=0D
+SignalReadyToProvisioningEvent (=0D
+ IN VOID=0D
+ );=0D
+=0D
+/**=0D
+ Signal after provisioning event.=0D
+=0D
+ @retval EFI_SUCCESS Event was created.=0D
+ @retval Other Event was not created.=0D
+=0D
+**/=0D
+EFI_STATUS=0D
+SignalAfterProvisioningEvent (=0D
+ IN VOID=0D
+ );=0D
+=0D
+#endif=0D
diff --git a/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.c b/R=
edfishClientPkg/Library/RedfishEventLib/RedfishEventLib.c
new file mode 100644
index 0000000000..1c8cfe53c7
--- /dev/null
+++ b/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.c
@@ -0,0 +1,139 @@
+/** @file=0D
+ Redfish event library implementation.=0D
+=0D
+ (C) Copyright 2022 Hewlett Packard Enterprise Development LP<BR>=0D
+=0D
+ SPDX-License-Identifier: BSD-2-Clause-Patent=0D
+=0D
+**/=0D
+=0D
+#include <Uefi.h>=0D
+=0D
+#include <Guid/RedfishClientEventGroup.h>=0D
+=0D
+#include <Library/UefiLib.h>=0D
+#include <Library/BaseLib.h>=0D
+#include <Library/DebugLib.h>=0D
+#include <Library/UefiBootServicesTableLib.h>=0D
+#include <Library/RedfishEventLib.h>=0D
+=0D
+/**=0D
+ Create an EFI event before Redfish provisioning start.=0D
+=0D
+ @param NotifyFunction The notification function to call when=
the event is signaled.=0D
+ @param NotifyContext The content to pass to NotifyFunction =
when the event is signaled.=0D
+ @param ReadyToProvisioningEvent Returns the EFI event returned from gB=
S->CreateEvent(Ex).=0D
+=0D
+ @retval EFI_SUCCESS Event was created.=0D
+ @retval Other Event was not created.=0D
+=0D
+**/=0D
+EFI_STATUS=0D
+EFIAPI=0D
+CreateReadyToProvisioningEvent (=0D
+ IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL=0D
+ IN VOID *NotifyContext, OPTIONAL=0D
+ OUT EFI_EVENT *ReadyToProvisioningEvent=0D
+ )=0D
+{=0D
+ EFI_STATUS Status;=0D
+=0D
+ Status =3D gBS->CreateEventEx (=0D
+ EVT_NOTIFY_SIGNAL,=0D
+ TPL_CALLBACK,=0D
+ (NotifyFunction =3D=3D NULL ? EfiEventEmptyFunction : No=
tifyFunction),=0D
+ NotifyContext,=0D
+ &gEfiRedfishClientFeatureReadyToProvisioningGuid,=0D
+ ReadyToProvisioningEvent=0D
+ );=0D
+=0D
+ return Status;=0D
+}=0D
+=0D
+/**=0D
+ Create an EFI event after Redfish provisioning finished.=0D
+=0D
+ @param NotifyFunction The notification function to call when=
the event is signaled.=0D
+ @param NotifyContext The content to pass to NotifyFunction =
when the event is signaled.=0D
+ @param ReadyToProvisioningEvent Returns the EFI event returned from gB=
S->CreateEvent(Ex).=0D
+=0D
+ @retval EFI_SUCCESS Event was created.=0D
+ @retval Other Event was not created.=0D
+=0D
+**/=0D
+EFI_STATUS=0D
+EFIAPI=0D
+CreateAfterProvisioningEvent (=0D
+ IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL=0D
+ IN VOID *NotifyContext, OPTIONAL=0D
+ OUT EFI_EVENT *ReadyToProvisioningEvent=0D
+ )=0D
+{=0D
+ EFI_STATUS Status;=0D
+=0D
+ Status =3D gBS->CreateEventEx (=0D
+ EVT_NOTIFY_SIGNAL,=0D
+ TPL_CALLBACK,=0D
+ (NotifyFunction =3D=3D NULL ? EfiEventEmptyFunction : No=
tifyFunction),=0D
+ NotifyContext,=0D
+ &gEfiRedfishClientFeatureAfterProvisioningGuid,=0D
+ ReadyToProvisioningEvent=0D
+ );=0D
+=0D
+ return Status;=0D
+}=0D
+=0D
+/**=0D
+ Signal ready to provisioning event.=0D
+=0D
+ @retval EFI_SUCCESS Event was created.=0D
+ @retval Other Event was not created.=0D
+=0D
+**/=0D
+EFI_STATUS=0D
+SignalReadyToProvisioningEvent (=0D
+ IN VOID=0D
+ )=0D
+{=0D
+ EFI_STATUS Status;=0D
+ EFI_EVENT Event;=0D
+=0D
+ Status =3D CreateReadyToProvisioningEvent (NULL, NULL, &Event);=0D
+ if (EFI_ERROR (Status)) {=0D
+ DEBUG ((DEBUG_ERROR, "%a, failed to create after provisioning event\n"=
, __FUNCTION__));=0D
+ return Status;=0D
+ }=0D
+=0D
+ gBS->SignalEvent (Event);=0D
+ gBS->CloseEvent (Event);=0D
+=0D
+ return EFI_SUCCESS;=0D
+}=0D
+=0D
+/**=0D
+ Signal after provisioning event.=0D
+=0D
+ @retval EFI_SUCCESS Event was created.=0D
+ @retval Other Event was not created.=0D
+=0D
+**/=0D
+EFI_STATUS=0D
+SignalAfterProvisioningEvent (=0D
+ IN VOID=0D
+ )=0D
+{=0D
+ EFI_STATUS Status;=0D
+ EFI_EVENT Event;=0D
+=0D
+ Status =3D CreateAfterProvisioningEvent (NULL, NULL, &Event);=0D
+ if (EFI_ERROR (Status)) {=0D
+ DEBUG ((DEBUG_ERROR, "%a, failed to create after provisioning event\n"=
, __FUNCTION__));=0D
+ return Status;=0D
+ }=0D
+=0D
+ gBS->SignalEvent (Event);=0D
+ gBS->CloseEvent (Event);=0D
+=0D
+ return EFI_SUCCESS;=0D
+}=0D
+=0D
diff --git a/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.inf b=
/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.inf
new file mode 100644
index 0000000000..edafca0c65
--- /dev/null
+++ b/RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib.inf
@@ -0,0 +1,38 @@
+## @file=0D
+#=0D
+# (C) Copyright 2022 Hewlett Packard Enterprise Development LP<BR>=0D
+#=0D
+# SPDX-License-Identifier: BSD-2-Clause-Patent=0D
+#=0D
+##=0D
+=0D
+[Defines]=0D
+ INF_VERSION =3D 0x00010006=0D
+ BASE_NAME =3D RedfishEventLib=0D
+ FILE_GUID =3D C4F7E27D-2338-43EA-9D1F-D10960E36521=
=0D
+ MODULE_TYPE =3D DXE_DRIVER=0D
+ VERSION_STRING =3D 1.0=0D
+ LIBRARY_CLASS =3D RedfishEventLib| DXE_DRIVER UEFI_DRIV=
ER=0D
+=0D
+#=0D
+# VALID_ARCHITECTURES =3D IA32 X64 EBC=0D
+#=0D
+=0D
+[Sources]=0D
+ RedfishEventLib.c=0D
+=0D
+[Packages]=0D
+ MdePkg/MdePkg.dec=0D
+ MdeModulePkg/MdeModulePkg.dec=0D
+ RedfishPkg/RedfishPkg.dec=0D
+ RedfishClientPkg/RedfishClientPkg.dec=0D
+=0D
+[LibraryClasses]=0D
+ BaseLib=0D
+ DebugLib=0D
+ UefiBootServicesTableLib=0D
+ UefiLib=0D
+=0D
+[Guids]=0D
+ gEfiRedfishClientFeatureReadyToProvisioningGuid=0D
+ gEfiRedfishClientFeatureAfterProvisioningGuid=0D
diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc b/RedfishClientPkg/=
RedfishClientLibs.dsc.inc
index 5467acedd0..91e5de4296 100644
--- a/RedfishClientPkg/RedfishClientLibs.dsc.inc
+++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc
@@ -27,4 +27,4 @@
RedfishPlatformConfigLib|RedfishPkg/Library/RedfishPlatformConfigLib/Red=
fishPlatformConfigLib.inf=0D
RedfishContentCodingLib|RedfishPkg/Library/RedfishContentCodingLibNull/R=
edfishContentCodingLibNull.inf=0D
ConverterCommonLib|RedfishClientPkg/ConverterLib/edk2library/ConverterCo=
mmonLib/ConverterCommonLib.inf=0D
-=0D
+ RedfishEventLib|RedfishClientPkg/Library/RedfishEventLib/RedfishEventLib=
.inf=0D
diff --git a/RedfishClientPkg/RedfishClientPkg.dec b/RedfishClientPkg/Redfi=
shClientPkg.dec
index 09df062dd3..56e542f03c 100644
--- a/RedfishClientPkg/RedfishClientPkg.dec
+++ b/RedfishClientPkg/RedfishClientPkg.dec
@@ -1,7 +1,7 @@
## @file=0D
# Redfish Client Package=0D
#=0D
-# (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>=0D
+# (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP<BR>=0D
#=0D
# SPDX-License-Identifier: BSD-2-Clause-Patent=0D
##=0D
@@ -21,6 +21,7 @@
=0D
[LibraryClasses]=0D
RedfishFeatureUtilityLib|Include/Library/RedfishFeatureUtilityLib.h=0D
+ RedfishEventLib|Include/Library/RedfishEventLib.h=0D
=0D
[LibraryClasses.Common.Private]=0D
## @libraryclass Redfish Helper Library=0D
@@ -39,6 +40,10 @@
## Include/Guid/RedfishClientPkgTokenSpace.h=0D
gEfiRedfishClientPkgTokenSpaceGuid =3D { 0x8c444dae, 0x728b, 0x48ee, =
{ 0x9e, 0x19, 0x8f, 0x0a, 0x3d, 0x4e, 0x9c, 0xc8 } }=0D
=0D
+ ## Include/Guid/RedfishClientEventGroup.h=0D
+ gEfiRedfishClientFeatureReadyToProvisioningGuid =3D { 0x77E4FC1C, 0x2428=
, 0x47EE, { 0x9E, 0xEC, 0x8B, 0x77, 0xEF, 0x9D, 0x4E, 0xF0 } }=0D
+ gEfiRedfishClientFeatureAfterProvisioningGuid =3D { 0xE547CB6F, 0x306F=
, 0x4226, { 0xAB, 0x70, 0xA0, 0x6E, 0x26, 0xF1, 0x2E, 0xD0 } }=0D
+=0D
[PcdsFixedAtBuild]=0D
gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize|32|UINT=
32|0x10000001=0D
gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaVersionSize|8|UINT=
32|0x10000002=0D
--=20
2.32.0.windows.2