Skip to content

Commit

Permalink
RedfishClientPkg: introduce Redfish override protocol
Browse files Browse the repository at this point in the history
Introduce Redfish override protocol to notify platform that the Redfish
changes system settings and about to perform system reboot.

Signed-off-by: Nickle Wang <[email protected]>
Cc: Abner Chang <[email protected]>
Cc: Igor Kulchytskyy <[email protected]>
Cc: Nick Ramirez <[email protected]>
  • Loading branch information
nicklela committed Nov 2, 2023
1 parent 5a648f8 commit 71e80a4
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
60 changes: 60 additions & 0 deletions RedfishClientPkg/Include/Protocol/EdkIIRedfishOverrideProtocol.h
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 0 deletions RedfishClientPkg/RedfishClientPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 71e80a4

Please sign in to comment.