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 60B24D8094F for ; Thu, 4 Apr 2024 10:18:33 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ClgIxgc15isSMEvVEwYW6FNDeh2s0tdwEIo+hjG7X30=; 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:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20240206; t=1712225911; v=1; b=yAJBXaNlNg6PT2OGxcqqiwi/2EV6LK2ptPGrGTP2nKDXqV8SpnrRx0XWMjXBe6pp/UoOAbRU 353ew/EGhIgBtHnEcxGO8RlbTtvTH2YHVTEBrgNI59jhKy/QhjFHJ/okifmjWfgJmd45jk4ZInC O7Av9Bl2EP/cIGR999XCWl10usNBwCsQkkmvo0FSeXWDZ2ZPAHwTHmr3qjPgEsSIAfGR+bPhLXJ wFwxarebmeu76l5E7Ig2xnj2NDCrBJKJA5P8QROxvWAMrDSTpiR5fIepc2zDk00KPSgh0TELdzX Br6ImYJ1uUmhfBPgR/K1YXdvlPYY7w2ELeW7iPs4vDlYA== X-Received: by 127.0.0.2 with SMTP id 4VW0YY7687511xnq6ElcPdhv; Thu, 04 Apr 2024 03:18:31 -0700 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.62]) by mx.groups.io with SMTP id smtpd.web11.34527.1712225911333536019 for ; Thu, 04 Apr 2024 03:18:31 -0700 X-Received: from BY3PR10CA0011.namprd10.prod.outlook.com (2603:10b6:a03:255::16) by CY8PR12MB7292.namprd12.prod.outlook.com (2603:10b6:930:53::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Thu, 4 Apr 2024 10:18:28 +0000 X-Received: from CO1PEPF000066ED.namprd05.prod.outlook.com (2603:10b6:a03:255:cafe::60) by BY3PR10CA0011.outlook.office365.com (2603:10b6:a03:255::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46 via Frontend Transport; Thu, 4 Apr 2024 10:18:28 +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 CO1PEPF000066ED.mail.protection.outlook.com (10.167.249.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7452.22 via Frontend Transport; Thu, 4 Apr 2024 10:18:28 +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; Thu, 4 Apr 2024 05:18:24 -0500 From: "Chang, Abner via groups.io" To: CC: Abner Chang , Igor Kulchytskyy , Nickle Wang Subject: [edk2-devel] [PATCH V3 6/6] RedfishPkg/RedfishPlatformConfigDxe: support menu path report Date: Thu, 4 Apr 2024 18:17:58 +0800 Message-ID: <20240404101758.84-7-abner.chang@amd.com> In-Reply-To: <20240404101758.84-1-abner.chang@amd.com> References: <20240404101758.84-1-abner.chang@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066ED:EE_|CY8PR12MB7292:EE_ X-MS-Office365-Filtering-Correlation-Id: 1224accd-78f1-4656-006e-08dc5490922d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: 062D3ksPOTOTvdaqEvZPQxY13jQ8zoDTqSVK3GZEQvjoRH6hbWG72KGByn/pX8w4d99KFHXNGclZgJAxmjqje4/ZD1LLmhch4WI3JMX2/Hr2CMNnS9XyAs11lB/8JEsbp8+M4y5OrOpzqwDHLam45oGH0NzGsgU9cj2fFtp75PNamSJf1Rbmn7pgrWq1q10WI68D/MfZU9IRR2uq9OpUqGjjaXcUVSdY0psWlDlCe4/LqpBskLiEPKweQ+DulRt+CR7JCPb59AUAU9P+Bk0QK/VL3PXYk/l7FyyZ4kWEExKFPUqiUEIwHq9YWivQ0Ewmc6eLUlYgnu51hrsdGC73pgRCbXE5qMs4E9kYrehYr3H9XVIBVycLtcu/zHr6vlUDhUkODMqow7NkLLIPZD3fpffh9/AeQlu+zYLXhQaxpTAy9Hovh/CFZQ8WyE+Sdchwh/iB1D06rg4eOYKjbEjwdBGYSHT60vVrKEI6Co0E+JBZ/rIDi6ZFsnK+qlazYehnly9dL3vDqU11Jd5rfwvDfQ8lbNhBVdDRnc7te5oUQFQ+udR3UEVrT5ytvCFGi4c56grKZO9BfSiAz2cqy6dyqUJTBMXqizbGC/RRwFl7M5FJ/iKx6G4LeSyIgpHHvgvF2hTxOxOAack1+0+hcnuv9BbHrXbpYTyr4hr5sw79ghn9sLBnfNr8shfwiX/82NzKst8C6kZP2bfOd/aBjNe4/78XpjG5tY+MajgtJ96ExTmtw6+qkopCO86c0CG+pQB5 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2024 10:18:28.0776 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1224accd-78f1-4656-006e-08dc5490922d 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: CO1PEPF000066ED.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7292 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: Thu, 04 Apr 2024 03:18:31 -0700 Resent-From: abner.chang@amd.com Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 4FojoEYraNVT3qG30LvAypyux7686176AA= 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=yAJBXaNl; 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 Reviewed-by: Nickle Wang 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 86f5d3c4478..8bcee5a16ae 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 03dcc8dbcd1..5fcaf426107 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->XuefiRedfishStr= 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->XuefiRedfishS= tr 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->XuefiRedfishS= tr is NULL, x-uefi-string has something wrong.\n", __func__)); + ASSERT (FALSE); + } } } =20 @@ -1439,7 +1446,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); @@ -1476,8 +1483,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 @@ -1503,7 +1510,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 ( @@ -1530,6 +1537,8 @@ BuildXUefiRedfishStringDatabase ( FormsetPrivate->H= iiPackageListHeader ); if (EFI_ERROR (Status)) { + FreePool (FormsetPrivate->HiiPackageListHeader); + FormsetPrivate->HiiPackageListHeader =3D NULL; return; } =20 @@ -1646,8 +1655,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); @@ -1733,7 +1748,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->XuefiRedfishStr =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 (#117429): https://edk2.groups.io/g/devel/message/117429 Mute This Topic: https://groups.io/mt/105326109/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-