public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [edk2-redfish-client][PATCH 1/2] RedfishClientPkg: introduce Redfish override protocol
@ 2023-11-02 10:17 Nickle Wang via groups.io
  2023-11-06  0:47 ` Chang, Abner via groups.io
  0 siblings, 1 reply; 2+ messages in thread
From: Nickle Wang via groups.io @ 2023-11-02 10:17 UTC (permalink / raw)
  To: devel; +Cc: Abner Chang, Igor Kulchytskyy, Nick Ramirez

Introduce Redfish override protocol to notify platform that the Redfish
changes system settings and about to perform system reboot.

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Nick Ramirez <nramirez@nvidia.com>
---
 RedfishClientPkg/RedfishClientPkg.dec         |  2 +
 .../Protocol/EdkIIRedfishOverrideProtocol.h   | 60 +++++++++++++++++++
 2 files changed, 62 insertions(+)
 create mode 100644 RedfishClientPkg/Include/Protocol/EdkIIRedfishOverrideProtocol.h

diff --git a/RedfishClientPkg/RedfishClientPkg.dec b/RedfishClientPkg/RedfishClientPkg.dec
index eccbc22e..5f8a0350 100644
--- a/RedfishClientPkg/RedfishClientPkg.dec
+++ b/RedfishClientPkg/RedfishClientPkg.dec
@@ -45,6 +45,8 @@
   gEdkIIRedfishFeatureInterchangeDataProtocolGuid = { 0x4B8FF71C, 0x4A7B, 0x9478, { 0xB7, 0x81, 0x35, 0x9B, 0x0A, 0xF2, 0x00, 0x91 } }
   ## Include/Protocol/EdkIIRedfishResourceAddendumProtocol.h
   gEdkIIRedfishResourceAddendumProtocolGuid = { 0xda36b12b, 0xaad4, 0x4e90, { 0xba, 0xcb, 0xe3, 0xb5, 0x3b, 0x08, 0xbc, 0x54 } }
+  ## Include/Protocol/EdkIIRedfishOverrideProtocol.h
+  gEdkiiRedfishOverrideProtocolGuid         = { 0xb55bef20, 0xf7c8, 0x4ae9, { 0xa7, 0xca, 0x8b, 0xba, 0x9f, 0x7b, 0xbf, 0x9c } }
 
 [Guids]
   ## Include/Guid/RedfishClientPkgTokenSpace.h
diff --git a/RedfishClientPkg/Include/Protocol/EdkIIRedfishOverrideProtocol.h b/RedfishClientPkg/Include/Protocol/EdkIIRedfishOverrideProtocol.h
new file mode 100644
index 00000000..3c3e8bf2
--- /dev/null
+++ b/RedfishClientPkg/Include/Protocol/EdkIIRedfishOverrideProtocol.h
@@ -0,0 +1,60 @@
+/** @file
+  This file defines the EDKII_REDFISH_OVERRIDE_PROTOCOL interface.
+
+  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef EDKII_REDFISH_OVERRIDE_PROTOCOL_H_
+#define EDKII_REDFISH_OVERRIDE_PROTOCOL_H_
+
+#include <Uefi.h>
+
+typedef struct _EDKII_REDFISH_OVERRIDE_PROTOCOL EDKII_REDFISH_OVERRIDE_PROTOCOL;
+
+///
+/// Definition of EDKII_REDFISH_PHASE_TYPE.
+///
+typedef enum {
+  EdkiiRedfishPhaseBeforeReboot,
+  EdkiiRedfishPhaseMax
+} EDKII_REDFISH_PHASE_TYPE;
+
+/**
+  The callback function to notify platform and provide Redfish phase.
+
+  @param[in] This           Pointer to EDKII_REDFISH_OVERRIDE_PROTOCOL instance.
+  @param[in] PhaseType      The type of phase in Redfish operation.
+
+  @retval EFI_SUCCESS       The notify function completed successfully.
+  @retval Others            Some errors happened.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EDKII_REDFISH_NOTIFY_PHASE)(
+  IN EDKII_REDFISH_OVERRIDE_PROTOCOL  *This,
+  IN EDKII_REDFISH_PHASE_TYPE         PhaseType
+  );
+
+//
+// The definition of _EDKII_REDFISH_OVERRIDE_PROTOCOL
+//
+struct _EDKII_REDFISH_OVERRIDE_PROTOCOL {
+  //
+  // Protocol version of this implementation
+  //
+  UINT32                        Version;
+  //
+  // Callback to notify Redfish phase
+  //
+  EDKII_REDFISH_NOTIFY_PHASE    NotifyPhase;
+};
+
+#define EDKII_REDFISH_OVERRIDE_PROTOCOL_REVISION  0x00001000
+
+extern EFI_GUID  gEdkiiRedfishOverrideProtocolGuid;
+
+#endif
-- 
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110510): https://edk2.groups.io/g/devel/message/110510
Mute This Topic: https://groups.io/mt/102338703/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

* Re: [edk2-devel] [edk2-redfish-client][PATCH 1/2] RedfishClientPkg: introduce Redfish override protocol
  2023-11-02 10:17 [edk2-devel] [edk2-redfish-client][PATCH 1/2] RedfishClientPkg: introduce Redfish override protocol Nickle Wang via groups.io
@ 2023-11-06  0:47 ` Chang, Abner via groups.io
  0 siblings, 0 replies; 2+ messages in thread
From: Chang, Abner via groups.io @ 2023-11-06  0:47 UTC (permalink / raw)
  To: Nickle Wang, devel@edk2.groups.io; +Cc: Igor Kulchytskyy, Nick Ramirez

[AMD Official Use Only - General]

Reviewed-by: Abner Chang <abner.chang@amd.com>

> -----Original Message-----
> From: Nickle Wang <nicklew@nvidia.com>
> Sent: Thursday, November 2, 2023 6:18 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner <Abner.Chang@amd.com>; Igor Kulchytskyy
> <igork@ami.com>; Nick Ramirez <nramirez@nvidia.com>
> Subject: [edk2-redfish-client][PATCH 1/2] RedfishClientPkg: introduce Redfish
> override protocol
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Introduce Redfish override protocol to notify platform that the Redfish
> changes system settings and about to perform system reboot.
>
> Signed-off-by: Nickle Wang <nicklew@nvidia.com>
> Cc: Abner Chang <abner.chang@amd.com>
> Cc: Igor Kulchytskyy <igork@ami.com>
> Cc: Nick Ramirez <nramirez@nvidia.com>
> ---
>  RedfishClientPkg/RedfishClientPkg.dec         |  2 +
>  .../Protocol/EdkIIRedfishOverrideProtocol.h   | 60 +++++++++++++++++++
>  2 files changed, 62 insertions(+)
>  create mode 100644
> RedfishClientPkg/Include/Protocol/EdkIIRedfishOverrideProtocol.h
>
> diff --git a/RedfishClientPkg/RedfishClientPkg.dec
> b/RedfishClientPkg/RedfishClientPkg.dec
> index eccbc22e..5f8a0350 100644
> --- a/RedfishClientPkg/RedfishClientPkg.dec
> +++ b/RedfishClientPkg/RedfishClientPkg.dec
> @@ -45,6 +45,8 @@
>    gEdkIIRedfishFeatureInterchangeDataProtocolGuid = { 0x4B8FF71C,
> 0x4A7B, 0x9478, { 0xB7, 0x81, 0x35, 0x9B, 0x0A, 0xF2, 0x00, 0x91 } }
>    ## Include/Protocol/EdkIIRedfishResourceAddendumProtocol.h
>    gEdkIIRedfishResourceAddendumProtocolGuid = { 0xda36b12b, 0xaad4,
> 0x4e90, { 0xba, 0xcb, 0xe3, 0xb5, 0x3b, 0x08, 0xbc, 0x54 } }
> +  ## Include/Protocol/EdkIIRedfishOverrideProtocol.h
> +  gEdkiiRedfishOverrideProtocolGuid         = { 0xb55bef20, 0xf7c8, 0x4ae9,
> { 0xa7, 0xca, 0x8b, 0xba, 0x9f, 0x7b, 0xbf, 0x9c } }
>
>  [Guids]
>    ## Include/Guid/RedfishClientPkgTokenSpace.h
> diff --git a/RedfishClientPkg/Include/Protocol/EdkIIRedfishOverrideProtocol.h
> b/RedfishClientPkg/Include/Protocol/EdkIIRedfishOverrideProtocol.h
> new file mode 100644
> index 00000000..3c3e8bf2
> --- /dev/null
> +++ b/RedfishClientPkg/Include/Protocol/EdkIIRedfishOverrideProtocol.h
> @@ -0,0 +1,60 @@
> +/** @file
> +  This file defines the EDKII_REDFISH_OVERRIDE_PROTOCOL interface.
> +
> +  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef EDKII_REDFISH_OVERRIDE_PROTOCOL_H_
> +#define EDKII_REDFISH_OVERRIDE_PROTOCOL_H_
> +
> +#include <Uefi.h>
> +
> +typedef struct _EDKII_REDFISH_OVERRIDE_PROTOCOL
> EDKII_REDFISH_OVERRIDE_PROTOCOL;
> +
> +///
> +/// Definition of EDKII_REDFISH_PHASE_TYPE.
> +///
> +typedef enum {
> +  EdkiiRedfishPhaseBeforeReboot,
> +  EdkiiRedfishPhaseMax
> +} EDKII_REDFISH_PHASE_TYPE;
> +
> +/**
> +  The callback function to notify platform and provide Redfish phase.
> +
> +  @param[in] This           Pointer to EDKII_REDFISH_OVERRIDE_PROTOCOL
> instance.
> +  @param[in] PhaseType      The type of phase in Redfish operation.
> +
> +  @retval EFI_SUCCESS       The notify function completed successfully.
> +  @retval Others            Some errors happened.
> +
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *EDKII_REDFISH_NOTIFY_PHASE)(
> +  IN EDKII_REDFISH_OVERRIDE_PROTOCOL  *This,
> +  IN EDKII_REDFISH_PHASE_TYPE         PhaseType
> +  );
> +
> +//
> +// The definition of _EDKII_REDFISH_OVERRIDE_PROTOCOL
> +//
> +struct _EDKII_REDFISH_OVERRIDE_PROTOCOL {
> +  //
> +  // Protocol version of this implementation
> +  //
> +  UINT32                        Version;
> +  //
> +  // Callback to notify Redfish phase
> +  //
> +  EDKII_REDFISH_NOTIFY_PHASE    NotifyPhase;
> +};
> +
> +#define EDKII_REDFISH_OVERRIDE_PROTOCOL_REVISION  0x00001000
> +
> +extern EFI_GUID  gEdkiiRedfishOverrideProtocolGuid;
> +
> +#endif
> --
> 2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110686): https://edk2.groups.io/g/devel/message/110686
Mute This Topic: https://groups.io/mt/102338703/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



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

end of thread, other threads:[~2023-11-06  0:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-02 10:17 [edk2-devel] [edk2-redfish-client][PATCH 1/2] RedfishClientPkg: introduce Redfish override protocol Nickle Wang via groups.io
2023-11-06  0:47 ` Chang, Abner via groups.io

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox