From 54c1460dd0823e548c4bb48caafb8a896c42557b Mon Sep 17 00:00:00 2001 From: Nickle Wang Date: Fri, 17 Jan 2025 13:02:10 +0800 Subject: RedfishPkg/RedfishHttpDxe: report failure via status code Manageability status code is introduced to edk2. Enable the ability to report Redfish communication failure via status code. This gives the chance for BMC to capture Redfish error. Signed-off-by: Nickle Wang --- RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c b/RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c index 2de5443bcd..0a308a772b 100644 --- a/RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c +++ b/RedfishPkg/RedfishHttpDxe/RedfishHttpDxe.c @@ -2,7 +2,7 @@ RedfishHttpDxe produces EdkIIRedfishHttpProtocol for EDK2 Redfish Feature driver to do HTTP operations. - Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -255,18 +255,16 @@ ReportHttpError ( // AsciiSPrint (ErrorMsg, sizeof (ErrorMsg), REDFISH_HTTP_ERROR_REPORT, HttpMethodToString (Method), (HttpStatusCode == NULL ? HTTP_STATUS_UNSUPPORTED_STATUS : *HttpStatusCode), Uri); DEBUG ((DEBUG_ERROR, "%a\n", ErrorMsg)); + // - // TODO: - // Below PI status code is approved by PIWG and wait for specification published. - // We will uncomment below report status code after PI status code get published. - // REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4483 + // Report this failure via status code and BMC has chance to capture the error. // - // REPORT_STATUS_CODE_WITH_EXTENDED_DATA ( - // EFI_ERROR_CODE | EFI_ERROR_MAJOR, - // EFI_COMPUTING_UNIT_MANAGEABILITY | EFI_MANAGEABILITY_EC_REDFISH_COMMUNICATION_ERROR, - // ErrorMsg, - // AsciiStrSize (ErrorMsg) - // ); + REPORT_STATUS_CODE_WITH_EXTENDED_DATA ( + EFI_ERROR_CODE | EFI_ERROR_MAJOR, + EFI_COMPUTING_UNIT_MANAGEABILITY | EFI_MANAGEABILITY_EC_REDFISH_COMMUNICATION_ERROR, + ErrorMsg, + AsciiStrSize (ErrorMsg) + ); } /** -- cgit