Definitinos of RedfishHostInterfaceDxe driver.\r
\r
(C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>\r
+ Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>\r
\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
/**\r
Get platform Redfish host interface device descriptor.\r
\r
- @param[in] DeviceType Pointer to retrieve device type.\r
+ @param[out] DeviceType Pointer to retrieve device type.\r
@param[out] DeviceDescriptor Pointer to retrieve REDFISH_INTERFACE_DATA, caller has to free\r
this memory using FreePool().\r
@retval EFI_SUCCESS Device descriptor is returned successfully in DeviceDescriptor.\r
**/\r
EFI_STATUS\r
RedfishPlatformHostInterfaceDeviceDescriptor (\r
- IN UINT8 *DeviceType,\r
+ OUT UINT8 *DeviceType,\r
OUT REDFISH_INTERFACE_DATA **DeviceDescriptor\r
);\r
\r
@param[in, out] ProtocolRecord Pointer to retrieve the first or the next protocol record.\r
caller has to free the new protocol record returned from\r
this function using FreePool().\r
- param[in] IndexOfProtocolData The index of protocol data.\r
+ @param[in] IndexOfProtocolData The index of protocol data.\r
\r
@retval EFI_SUCCESS Protocol records are all returned.\r
@retval EFI_NOT_FOUND No more protocol records.\r
IN UINT8 IndexOfProtocolData\r
);\r
\r
+/**\r
+ Get the EFI protocol GUID installed by platform library which\r
+ indicates the necessary information is ready for building\r
+ SMBIOS 42h record.\r
+\r
+ @param[out] InformationReadinessGuid Pointer to retrive the protocol\r
+ GUID.\r
+\r
+ @retval EFI_SUCCESS Notification is required for building up\r
+ SMBIOS type 42h record.\r
+ @retval EFI_UNSUPPORTED Notification is not required for building up\r
+ SMBIOS type 42h record.\r
+ @retval EFI_ALREADY_STARTED Platform host information is already ready.\r
+ @retval Others Other errors.\r
+**/\r
+\r
+EFI_STATUS\r
+RedfishPlatformHostInterfaceNotification (\r
+ OUT EFI_GUID **InformationReadinessGuid\r
+ );\r
+\r
#endif\r
NULL instace of RedfishPlatformHostInterfaceLib\r
\r
(C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>\r
+ Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>\r
\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
EFI_STATUS\r
RedfishPlatformHostInterfaceDeviceDescriptor (\r
- IN UINT8 *DeviceType,\r
+ OUT UINT8 *DeviceType,\r
OUT REDFISH_INTERFACE_DATA **DeviceDescriptor\r
)\r
{\r
{\r
return EFI_NOT_FOUND;\r
}\r
+\r
+/**\r
+ Get the EFI protocol GUID installed by platform library which\r
+ indicates the necessary information is ready for building\r
+ SMBIOS 42h record.\r
+\r
+ @param[out] InformationReadinessGuid Pointer to retrive the protocol\r
+ GUID.\r
+\r
+ @retval EFI_SUCCESS Notification is required for building up\r
+ SMBIOS type 42h record.\r
+ @retval EFI_UNSUPPORTED Notification is not required for building up\r
+ SMBIOS type 42h record.\r
+ @retval EFI_ALREADY_STARTED Platform host information is already ready.\r
+ @retval Others Other errors.\r
+**/\r
+EFI_STATUS\r
+RedfishPlatformHostInterfaceNotification (\r
+ OUT EFI_GUID **InformationReadinessGuid\r
+ )\r
+{\r
+ return EFI_UNSUPPORTED;\r
+}\r
\r
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>\r
(C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>\r
+ Copyright (C) 2022 Advanced Micro Devices, Inc. All rights reserved.<BR>\r
\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/UefiRuntimeServicesTableLib.h>\r
\r
+static EFI_EVENT mPlatformHostInterfaceReadylEvent = NULL;\r
+static VOID *mPlatformHostInterfaceReadyRegistration = NULL;\r
+\r
/**\r
Create SMBIOS type 42 record for Redfish host interface.\r
\r
return Status;\r
}\r
\r
+/**\r
+ Notification event of platform Redfish Host Interface readiness.\r
+\r
+ @param[in] Event Event whose notification function is being invoked.\r
+ @param[in] Context The pointer to the notification function's context,\r
+ which is implementation-dependent.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+PlatformHostInterfaceInformationReady (\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
+ )\r
+{\r
+ DEBUG ((DEBUG_INFO, "%a: Platform Redfish Host Interface informtion is ready\n", __FUNCTION__));\r
+\r
+ RedfishCreateSmbiosTable42 ();\r
+ return;\r
+}\r
+\r
/**\r
Main entry for this driver.\r
\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
{\r
+ EFI_STATUS Status;\r
+ EFI_GUID *ReadyGuid;\r
+\r
+ DEBUG ((DEBUG_INFO, "%a: Entry\n.", __FUNCTION__));\r
+\r
//\r
- // Create SMBIOS type 42 record.\r
+ // Check if the Redfish Host Interface depends on\r
+ // the specific protocol installation.\r
//\r
- return RedfishCreateSmbiosTable42 ();\r
+ Status = RedfishPlatformHostInterfaceNotification (&ReadyGuid);\r
+ if (Status == EFI_SUCCESS) {\r
+ DEBUG ((DEBUG_INFO, " Create protocol install notification to know the installation of platform Redfish host interface readiness\n"));\r
+ DEBUG ((DEBUG_INFO, " Protocol GUID: %g\n", ReadyGuid));\r
+ //\r
+ // Register event for ReadyGuid protocol installed by\r
+ // platform Redfish host interface library.\r
+ //\r
+ Status = gBS->CreateEvent (\r
+ EVT_NOTIFY_SIGNAL,\r
+ TPL_CALLBACK,\r
+ PlatformHostInterfaceInformationReady,\r
+ NULL,\r
+ &mPlatformHostInterfaceReadylEvent\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_ERROR, " Fail to create event for the installation of platform Redfish host interface readiness.\n"));\r
+ return Status;\r
+ }\r
+\r
+ Status = gBS->RegisterProtocolNotify (\r
+ ReadyGuid,\r
+ mPlatformHostInterfaceReadylEvent,\r
+ &mPlatformHostInterfaceReadyRegistration\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_ERROR, " Fail to register event for the installation of platform Redfish host interface readiness.\n"));\r
+ return Status;\r
+ }\r
+\r
+ return EFI_SUCCESS;\r
+ }\r
+\r
+ if ((Status == EFI_UNSUPPORTED) || (Status == EFI_ALREADY_STARTED)) {\r
+ Status = RedfishCreateSmbiosTable42 ();\r
+ }\r
+\r
+ // Return other erros.\r
+ return Status;\r
}\r