From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 6EC3CD801D3 for ; Tue, 26 Mar 2024 15:15:48 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=z0O/xqkV31PFLOhZh174ON8FEbzv6L+HA3diR/X3hvg=; c=relaxed/simple; d=groups.io; h=Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20240206; t=1711466147; v=1; b=dm3gleC1PuFsSIKjTngkZng1sjXH9Z2jWjfRc/UYQ3+6c1Pkzj9bufx7DLtEJQpPIe/vmAEe Y4mMShN43xgvTUX7vV0ai2DPDSwxCp86KsKq+A1pqebNLcatYvq9ZtFYXbZfcQ7ILPa5LqCgmhQ cXDzZo9+/rRh01QdytkAuVkNhA5olqYCgjAWFX9wd3xxGlOvRfbUbLzSObaycsOWw6Cq9DrXZ5/ tYUVr5jwwtYbcd+rm4iYWrs08qa9I8NJYk/joZFXXHOsdyZgiiP8cR7XmWRiR84yMqDYh450qdb 0u4YTK/xKtVWlTD5Xew2CThtkMeT6sDITzpw1qt+Oy6Qw== X-Received: by 127.0.0.2 with SMTP id O4GBYY7687511x0Nw3brHCFR; Tue, 26 Mar 2024 08:15:47 -0700 X-Received: from NAM04-BN8-obe.outbound.protection.outlook.com (NAM04-BN8-obe.outbound.protection.outlook.com [40.107.100.47]) by mx.groups.io with SMTP id smtpd.web10.11968.1711466146277317714 for ; Tue, 26 Mar 2024 08:15:46 -0700 X-Received: from PH7P221CA0001.NAMP221.PROD.OUTLOOK.COM (2603:10b6:510:32a::7) by PH8PR12MB8430.namprd12.prod.outlook.com (2603:10b6:510:259::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.30; Tue, 26 Mar 2024 15:15:44 +0000 X-Received: from CY4PEPF0000E9D9.namprd05.prod.outlook.com (2603:10b6:510:32a:cafe::13) by PH7P221CA0001.outlook.office365.com (2603:10b6:510:32a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.13 via Frontend Transport; Tue, 26 Mar 2024 15:15:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by CY4PEPF0000E9D9.mail.protection.outlook.com (10.167.241.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7409.10 via Frontend Transport; Tue, 26 Mar 2024 15:15:43 +0000 X-Received: from TPE-L1-ABNCHANG.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 26 Mar 2024 10:15:39 -0500 From: "Chang, Abner via groups.io" To: CC: Abner Chang , Igor Kulchytskyy Subject: [edk2-devel] [PATCH V2 6/6] RedfishPkg/RedfishPlatformConfigDxe: support menu path report Date: Tue, 26 Mar 2024 23:15:02 +0800 Message-ID: <20240326151503.106-7-abner.chang@amd.com> In-Reply-To: <20240326151503.106-1-abner.chang@amd.com> References: <20240326151503.106-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D9:EE_|PH8PR12MB8430:EE_ X-MS-Office365-Filtering-Correlation-Id: 29cb56c9-1bf5-4c64-8801-08dc4da79b32 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 53eUDK3qohHbqnScrxFG20p/EP6ZHP8cJRYsKWWEB4OETClwFumV+D4+dmtjLgv4ddlJ88Q/asGipQ8FGP2P4rB4nG7f7/n2HINCZlCSlBTjijg5UCT1H3sAjkQl/4a3Hx/FxBtgwOi4/2ybfpho0qrBlSDsP1tV+9dkLuBAaBpaMaL0wo7L07xDdd5hLBOsHPIqEMnQvqv7Y+1r4uGqamES4LnHyhXzcVtTgJn6l7vjUb8z+oki91RQkKlzHIYxO/hf6GIZtfRwvT+cviksbDcHTT8KlJeAKtXiuiO8x/TZtYbiGuCg+z+kA4lzTl1bBl9+1bwCeyeg4pBDNXPl5PhxRwhit41Pc2N1Cetlj+jLpPlYr9OSwpRFa9Kd1U8bva44z9LkNUuHD0asCI4YLhLBfdTb5qWaiYzzNOHzK+jJWa86855NWyDPXUKdQGzS9eTW2bOg6g/GFfXexUXUkzSoytHgw8201EBK1t5im4+z4rEUhSp27m/e5XEHWt8CwkIBoYjjl+L8yn8tC2JOfsSYGAf3hzZx01Q6zvIYX7ZAOiuyoLybi6vV7wPSDESm2UPYOPACfEbOs0uW6HveMQJFXgEsbOWmWepp02gFvX12hJqTVNKvkQNfLt7N5jEOEHuAv1d2Sr0n98ojBrNLQL6H4brUzie2lEaWkzlQ1kUUVM1G5qBZk4zjWIzMwbzPGINN3WCkRuo5ojg0fdgb0DxNZAygfL3kIobG/hI+aTbh3AG4oo3HAxupUgD8A6em X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2024 15:15:43.7487 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 29cb56c9-1bf5-4c64-8801-08dc4da79b32 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9D9.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB8430 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Tue, 26 Mar 2024 08:15:46 -0700 Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: YPmnUu3bVVqfj4g73xb0Nn4dx7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=dm3gleC1; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=pass (policy=none) header.from=groups.io From: Nickle Wang "MenuPath" is the attribute in BIOS attribute registry. To support reporting this attribute, we need to include the formset without x-uefi-redfish support in database. So driver can find menu path to target attribute in BIOS menu. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy Signed-off-by: Abner Chang --- .../RedfishPlatformConfigDxe.h | 8 +-- .../RedfishPlatformConfigDxe.c | 8 +-- .../RedfishPlatformConfigImpl.c | 51 +++++++++++++++---- 3 files changed, 49 insertions(+), 18 deletions(-) diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h= b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h index 688f2067bff..8eb7b0dc2aa 100644 --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h @@ -2,7 +2,7 @@ This file defines the EDKII Redfish Platform Config Protocol interface. =20 (C) Copyright 2021 Hewlett Packard Enterprise Development LP
- Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights res= erved. + Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights res= erved. Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent @@ -49,8 +49,8 @@ // 2 RedfishPlatformConfigDxe debug enablement must be set in // PcdRedfishDebugCategory (defined in RedfishPkg.dec) // -// 3. The suborinate debug enablement for RedfishPlatformConfigDxe -// must be set in PcdRedfishPlatformConfigDebugPropert (defined +// 3. The subordinate debug enablement for RedfishPlatformConfigDxe +// must be set in PcdRedfishPlatformConfigDebugProperty (defined // in RedfishPkg.dec). // #define DEBUG_REDFISH_THIS_MODULE(DebugSubordinate, ...) \ @@ -116,7 +116,7 @@ typedef struct { =20 #define REDFISH_MENU_PATH_SIZE 8 =20 -// Definitions of Redfish platform config capbility +// Definitions of Redfish platform config capability #define REDFISH_PLATFORM_CONFIG_BUILD_MENU_PATH 0x000000001 #define REDFISH_PLATFORM_CONFIG_ALLOW_SUPPRESSED 0x000000002 =20 diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c= b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c index d165799f9a1..7821146e901 100644 --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c @@ -2016,7 +2016,7 @@ RedfishPlatformConfigProtocolGetConfigureLang ( UINTN Index; CHAR8 *FullSchema; =20 - DEBUG ((DEBUG_INFO, "%a: Harvest config language of %a_%a (Regex: %s).\n= ", __func__, Schema, Version, RegexPattern)); + DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: Harvest config language of %= a_%a (Regex: %s).\n", __func__, Schema, Version, RegexPattern)); =20 if ((This =3D=3D NULL) || IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (V= ersion) || (Count =3D=3D NULL) || (ConfigureLangList =3D=3D NULL) || IS_EMP= TY_STRING (RegexPattern)) { return EFI_INVALID_PARAMETER; @@ -2103,7 +2103,7 @@ RELEASE_RESOURCE: ReleaseStatementList (&StatementList); } =20 - DEBUG ((DEBUG_INFO, "%a: exit.\n", __func__)); + DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: exit.\n", __func__)); return Status; } =20 @@ -2318,7 +2318,7 @@ RedfishPlatformConfigProtocolGetAttribute ( CHAR8 *FullSchema; CHAR8 *Buffer; =20 - DEBUG ((DEBUG_INFO, "%a: Entry\n", __func__)); + DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: Entry\n", __func__)); if ((This =3D=3D NULL) || IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (V= ersion) || IS_EMPTY_STRING (ConfigureLang) || (AttributeValue =3D=3D NULL))= { return EFI_INVALID_PARAMETER; } @@ -2395,7 +2395,7 @@ RELEASE_RESOURCE: FreePool (FullSchema); } =20 - DEBUG ((DEBUG_INFO, "%a: Exit\n", __func__)); + DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: Exit\n", __func__)); return Status; } =20 diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.= c b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c index 537ce09a2d3..86f3aa529c5 100644 --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c @@ -2,7 +2,7 @@ The implementation of EDKII Redfish Platform Config Protocol. =20 (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
- Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights res= erved. + Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights res= erved. Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent @@ -656,8 +656,10 @@ GetStatementPrivateByConfigureLangRegex ( ++StatementList->Count; } } else { - DEBUG ((DEBUG_ERROR, "%a: HiiStatementPrivate->DescriptionStr = is NULL, x-uefi-string has something wrong.\n", __func__)); - ASSERT (FALSE); + if (!RedfishPlatformConfigFeatureProp (REDFISH_PLATFORM_CONFIG= _BUILD_MENU_PATH)) { + DEBUG ((DEBUG_ERROR, "%a: HiiStatementPrivate->DescriptionSt= r is NULL, x-uefi-string has something wrong.\n", __func__)); + ASSERT (FALSE); + } } } =20 @@ -754,6 +756,11 @@ GetStatementPrivateByConfigureLang ( if (HiiStrCmp (TmpString, ConfigureLang) =3D=3D 0) { return HiiStatementPrivate; } + } else { + if (!RedfishPlatformConfigFeatureProp (REDFISH_PLATFORM_CONFIG= _BUILD_MENU_PATH)) { + DEBUG ((DEBUG_ERROR, "%a: HiiStatementPrivate->DescriptionSt= r is NULL, x-uefi-string has something wrong.\n", __func__)); + ASSERT (FALSE); + } } } =20 @@ -1440,7 +1447,7 @@ GetXuefiStringAndLangByStringId ( StringIndex =3D StringId; while (StringIndex >=3D X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER) { if (IsNodeAtEnd (&XuefiRedfishStringDatabase->XuefiRedfishStringArra= ys, &StringArray->NextArray)) { - goto ErrorEixt; + goto ErrorExit; } =20 StringArray =3D (REDFISH_X_UEFI_STRINGS_ARRAY *)GetNextNode (&Xuefi= RedfishStringDatabase->XuefiRedfishStringArrays, &StringArray->NextArray); @@ -1477,8 +1484,8 @@ GetXuefiStringAndLangByStringId ( ); } =20 -ErrorEixt:; - DEBUG ((DEBUG_ERROR, "%a: String ID (%d) is not in any x-uef-redfish str= ing databases.\n", __func__, StringId)); +ErrorExit:; + DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: String ID (%d) is not in any= x-uef-redfish string databases.\n", __func__, StringId)); return EFI_NOT_FOUND; } =20 @@ -1504,7 +1511,7 @@ BuildXUefiRedfishStringDatabase ( UINTN TotalStringsAdded; UINTN NumberPackageStrings; =20 - DEBUG ((DEBUG_INFO, "%a: Building x-uefi-redfish string database, HII Fo= rmset GUID - %g.\n", __func__, FormsetPrivate->Guid)); + DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: Building x-uefi-redfish stri= ng database, HII Formset GUID - %g.\n", __func__, FormsetPrivate->Guid)); =20 BufferSize =3D 0; Status =3D mRedfishPlatformConfigPrivate->HiiDatabase->ExportPackage= Lists ( @@ -1531,6 +1538,8 @@ BuildXUefiRedfishStringDatabase ( FormsetPrivate->H= iiPackageListHeader ); if (EFI_ERROR (Status)) { + FreePool (FormsetPrivate->HiiPackageListHeader); + FormsetPrivate->HiiPackageListHeader =3D NULL; return; } =20 @@ -1647,8 +1656,14 @@ LoadFormset ( FormsetPrivate->DevicePathStr =3D ConvertDevicePathToText (HiiFormSet->D= evicePath, FALSE, FALSE); Status =3D GetSupportedSchema (FormsetPrivate->Hi= iHandle, &FormsetPrivate->SupportedSchema); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: No x-uefi-redfish configur= ation found on the formset - %g\n", __func__, FormsetPrivate->Guid)); - return EFI_UNSUPPORTED; // Can't build AttributeRegistry Meni path wit= h returning EFI_UNSUPPORTED. + if (!RedfishPlatformConfigFeatureProp (REDFISH_PLATFORM_CONFIG_BUILD_M= ENU_PATH)) { + DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: No x-uefi-redfish config= uration found on the formset - %g\n", __func__, FormsetPrivate->Guid)); + // + // If there is no x-uefi-redfish language in this form-set, we don't= add formset + // since we don't need to build menu path for attribute registry. + // + return EFI_UNSUPPORTED; + } } else { // Building x-uefi-redfish string database BuildXUefiRedfishStringDatabase (FormsetPrivate); @@ -1734,7 +1749,23 @@ LoadFormset ( // InsertTailList (&HiiFormPrivate->StatementList, &HiiStatementPriva= te->Link); } else { - FreePool (HiiStatementPrivate); + if (!RedfishPlatformConfigFeatureProp (REDFISH_PLATFORM_CONFIG_BUI= LD_MENU_PATH)) { + // + // If there is no x-uefi-redfish language for this statement, we= don't add this statement + // since we don't need to build menu path for attribute registry= . + // + FreePool (HiiStatementPrivate); + } else { + // + // This is not x-uefi-redfish string and we don't cache its stri= ng for searching Redfish configure language. + // When caller wants the string, we will read English string by = calling HiiGetString(). + // + HiiStatementPrivate->DescriptionStr =3D NULL; + // + // Attach to statement list. + // + InsertTailList (&HiiFormPrivate->StatementList, &HiiStatementPri= vate->Link); + } } =20 HiiStatementLink =3D GetNextNode (&HiiForm->StatementListHead, HiiSt= atementLink); --=20 2.37.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117128): https://edk2.groups.io/g/devel/message/117128 Mute This Topic: https://groups.io/mt/105159789/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-