From nobody Mon Feb 9 14:38:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+112442+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+112442+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1702392873; cv=none; d=zohomail.com; s=zohoarc; b=fvqlx4YLtNfpCYs/Mo9R0AYLL0aTIpoXt1DjeFrSJw/gwgwUX6xrw3rf/MXH7p47TdWIC2mqirsKXVI15mn2ysGem5fwOxd4tpTebwT1we9ZlfI5NtilqxBqw/K+lFvqO5kgTDtB3lGoqSzklV2Ry24c1VIV0r0pU6S36/umJuQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1702392873; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=iUlsLPTo3K7NoEreRtX00nbb6d92YQLLE+GPevYpj+g=; b=YZh3Bll65ryRyNqs9EX0M/onaO9LP61xf0nbhC5Jt+7FPB+RGWSWQHOIAjZp2gwtCvDANUORLD62H9lcuFfKxNRZaY4yJLJOFPfz/NzUAlp28ebtM7o0uYq0lYxIoh11xFZGExG5MpXyMkMJ0cmxXWn2dRwctIRC5yu6NcIH0VY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+112442+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 170239287325848.41054026107747; Tue, 12 Dec 2023 06:54:33 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=dykUYrSh+E+MUKJJmHBswCXaN2/1OuOr9ryEp3F9oRg=; c=relaxed/simple; d=groups.io; h=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:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1702392872; v=1; b=BxOQOqvawkg0E4NB7gFMDMfEbbRXJ7EDtZtBEp+0monrTvtlO4eJGi5d9lqd8F2gkpE8Dfjl ts1X0OjgW0i9aoRaewLsvkZ3+hU/b8ff4ms5v6j33BW6Zr4D6vyPjLPqKyuXIzHBkZJBJwZ0mMn 5lrNB33krtULc/yP+mrNoWm8= X-Received: by 127.0.0.2 with SMTP id NQULYY1788612x2zwArdifxT; Tue, 12 Dec 2023 06:54:32 -0800 X-Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) by mx.groups.io with SMTP id smtpd.web11.3458.1702392871990856660 for ; Tue, 12 Dec 2023 06:54:32 -0800 X-Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-50c05ea5805so6834201e87.0 for ; Tue, 12 Dec 2023 06:54:31 -0800 (PST) X-Gm-Message-State: y7A0iBqGv1Cvun6A2q7Kvrjfx1787277AA= X-Google-Smtp-Source: AGHT+IGsw0rmsk9JNsNTj43KQwfUcq9UteT+ZVw+hAciTW2rCoW5XHukf9xFNK0Y6PCUCMyjWs61Iw== X-Received: by 2002:ac2:46f7:0:b0:50b:fd8c:ac4f with SMTP id q23-20020ac246f7000000b0050bfd8cac4fmr2650379lfo.32.1702392870127; Tue, 12 Dec 2023 06:54:30 -0800 (PST) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id m21-20020a0565120a9500b0050d1d8674d2sm952008lfu.292.2023.12.12.06.54.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 12 Dec 2023 06:54:29 -0800 (PST) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com, Mike Maslenkin Subject: [edk2-devel] [PATCH 6/9] RedfishPkg: add Component Name protocols to RedfishConfigHandler driver Date: Tue, 12 Dec 2023 17:54:09 +0300 Message-Id: <20231212145412.50434-7-mike.maslenkin@gmail.com> In-Reply-To: <20231212145412.50434-1-mike.maslenkin@gmail.com> References: <20231212145412.50434-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 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 Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1702392874103100022 Content-Type: text/plain; charset="utf-8" Currently there is no description for RedfishConfigHandler driver. This leads to in the "DRIVER NAME" column of a `drivers` command for example. Cc: Abner Chang Cc: Nickle Wang Cc: Igor Kulchytskyy Signed-off-by: Mike Maslenkin --- .../RedfishConfigHandler/ComponentName.c | 216 ++++++++++++++++++ .../RedfishConfigHandlerDriver.c | 10 +- .../RedfishConfigHandlerDriver.h | 4 +- .../RedfishConfigHandlerDriver.inf | 1 + 4 files changed, 228 insertions(+), 3 deletions(-) create mode 100644 RedfishPkg/RedfishConfigHandler/ComponentName.c diff --git a/RedfishPkg/RedfishConfigHandler/ComponentName.c b/RedfishPkg/R= edfishConfigHandler/ComponentName.c new file mode 100644 index 000000000000..e85d42ebdccd --- /dev/null +++ b/RedfishPkg/RedfishConfigHandler/ComponentName.c @@ -0,0 +1,216 @@ +/** @file + Implementation of EFI_COMPONENT_NAME_PROTOCOL and EFI_COMPONENT_NAME2_PR= OTOCOL protocol + for EFI Refish Config Handler Protocol + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "RedfishConfigHandlerCommon.h" + +// +// EFI Component Name Functions +// + +/** + Retrieves a Unicode string that is the user-readable name of the EFI Dri= ver. + + @param[in] This A pointer to the EFI_COMPONENT_NAME_PROTOCOL inst= ance. + @param[in] Language A pointer to a three-character ISO 639-2 language= identifier. + This is the language of the driver name that that= the caller + is requesting, and it must match one of the langu= ages specified + in SupportedLanguages. The number of languages s= upported by a + driver is up to the driver writer. + @param[out] DriverName A pointer to the Unicode string to return. This = Unicode string + is the name of the driver specified by This in th= e language + specified by Language. + + @retval EFI_SUCCESS The Unicode string for the Driver specifie= d by This + and the language specified by Language was= returned + in DriverName. + @retval EFI_INVALID_PARAMETER Language is NULL. + @retval EFI_INVALID_PARAMETER DriverName is NULL. + @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort the + language specified by Language. + +**/ +EFI_STATUS +EFIAPI +RedfishConfigHandlerComponentNameGetDriverName ( + IN EFI_COMPONENT_NAME_PROTOCOL *This, + IN CHAR8 *Language, + OUT CHAR16 **DriverName + ); + +/** + Retrieves a Unicode string that is the user readable name of the control= ler + that is being managed by an EFI Driver. + + @param[in] This A pointer to the EFI_COMPONENT_NAME_PROTOCO= L instance. + @param[in] ControllerHandle The handle of a controller that the driver = specified by + This is managing. This handle specifies th= e controller + whose name is to be returned. + @param[in] ChildHandle The handle of the child controller to retri= eve the name + of. This is an optional parameter that may= be NULL. It + will be NULL for device drivers. It will a= lso be NULL + for a bus drivers that wish to retrieve the= name of the + bus controller. It will not be NULL for a = bus driver + that wishes to retrieve the name of a child= controller. + @param[in] Language A pointer to a three character ISO 639-2 la= nguage + identifier. This is the language of the co= ntroller name + that the caller is requesting, and it must = match one + of the languages specified in SupportedLang= uages. The + number of languages supported by a driver i= s up to the + driver writer. + @param[out] ControllerName A pointer to the Unicode string to return. = This Unicode + string is the name of the controller specif= ied by + ControllerHandle and ChildHandle in the lan= guage specified + by Language, from the point of view of the = driver specified + by This. + + @retval EFI_SUCCESS The Unicode string for the user-readable n= ame in the + language specified by Language for the dri= ver + specified by This was returned in DriverNa= me. + @retval EFI_INVALID_PARAMETER ControllerHandle is NULL. + @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a va= lid EFI_HANDLE. + @retval EFI_INVALID_PARAMETER Language is NULL. + @retval EFI_INVALID_PARAMETER ControllerName is NULL. + @retval EFI_UNSUPPORTED The driver specified by This is not curren= tly managing + the controller specified by ControllerHand= le and + ChildHandle. + @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort the + language specified by Language. + +**/ +EFI_STATUS +EFIAPI +RedfishConfigHandlerComponentNameGetControllerName ( + IN EFI_COMPONENT_NAME_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_HANDLE ChildHandle OPTIONAL, + IN CHAR8 *Language, + OUT CHAR16 **ControllerName + ); + +/// +/// Component Name Protocol instance +/// +GLOBAL_REMOVE_IF_UNREFERENCED +EFI_COMPONENT_NAME_PROTOCOL gRedfishConfigHandlerComponentName =3D { + RedfishConfigHandlerComponentNameGetDriverName, + RedfishConfigHandlerComponentNameGetControllerName, + "eng" +}; + +/// +/// Component Name 2 Protocol instance +/// +GLOBAL_REMOVE_IF_UNREFERENCED +EFI_COMPONENT_NAME2_PROTOCOL gRedfishConfigHandlerComponentName2 =3D { + (EFI_COMPONENT_NAME2_GET_DRIVER_NAME)RedfishConfigHandlerComponentNameGe= tDriverName, + (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)RedfishConfigHandlerComponentNa= meGetControllerName, + "en" +}; + +/// +/// Table of driver names +/// +GLOBAL_REMOVE_IF_UNREFERENCED +EFI_UNICODE_STRING_TABLE mRedfishConfigHandlerDriverNameTable[] =3D { + { "eng;en", (CHAR16 *)L"Redfish Configuration UEFI Driver" }, + { NULL, NULL } +}; + +GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE *gRedfishConfigHan= dlerControllerNameTable =3D NULL; + +/** + Retrieves a Unicode string that is the user-readable name of the EFI Dri= ver. + + @param[in] This A pointer to the EFI_COMPONENT_NAME_PROTOCOL ins= tance. + @param[in] Language A pointer to a three-character ISO 639-2 languag= e identifier. + This is the language of the driver name that tha= t the caller + is requesting, and it must match one of the lang= uages specified + in SupportedLanguages. The number of languages = supported by a + driver is up to the driver writer. + @param[out] DriverName A pointer to the Unicode string to return. This= Unicode string + is the name of the driver specified by This in t= he language + specified by Language. + + @retval EFI_SUCCESS The Unicode string for the Driver specifie= d by This + and the language specified by Language was= returned + in DriverName. + @retval EFI_INVALID_PARAMETER Language is NULL. + @retval EFI_INVALID_PARAMETER DriverName is NULL. + @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort the + language specified by Language. + +**/ +EFI_STATUS +EFIAPI +RedfishConfigHandlerComponentNameGetDriverName ( + IN EFI_COMPONENT_NAME_PROTOCOL *This, + IN CHAR8 *Language, + OUT CHAR16 **DriverName + ) +{ + return LookupUnicodeString2 ( + Language, + This->SupportedLanguages, + mRedfishConfigHandlerDriverNameTable, + DriverName, + (BOOLEAN)(This =3D=3D &gRedfishConfigHandlerComponentName) + ); +} + +/** + Retrieves a Unicode string that is the user readable name of the control= ler + that is being managed by an EFI Driver. + + @param[in] This A pointer to the EFI_COMPONENT_NAME_PROTOCO= L instance. + @param[in] ControllerHandle The handle of a controller that the driver = specified by + This is managing. This handle specifies th= e controller + whose name is to be returned. + @param[in] ChildHandle The handle of the child controller to retri= eve the name + of. This is an optional parameter that may= be NULL. It + will be NULL for device drivers. It will a= lso be NULL + for a bus drivers that wish to retrieve the= name of the + bus controller. It will not be NULL for a = bus driver + that wishes to retrieve the name of a child= controller. + @param[in] Language A pointer to a three character ISO 639-2 la= nguage + identifier. This is the language of the co= ntroller name + that the caller is requesting, and it must = match one + of the languages specified in SupportedLang= uages. The + number of languages supported by a driver i= s up to the + driver writer. + @param[out] ControllerName A pointer to the Unicode string to return. = This Unicode + string is the name of the controller specif= ied by + ControllerHandle and ChildHandle in the lan= guage specified + by Language, from the point of view of the = driver specified + by This. + + @retval EFI_SUCCESS The Unicode string for the user-readable n= ame in the + language specified by Language for the dri= ver + specified by This was returned in DriverNa= me. + @retval EFI_INVALID_PARAMETER ControllerHandle is NULL. + @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a va= lid EFI_HANDLE. + @retval EFI_INVALID_PARAMETER Language is NULL. + @retval EFI_INVALID_PARAMETER ControllerName is NULL. + @retval EFI_UNSUPPORTED The driver specified by This is not curren= tly managing + the controller specified by ControllerHand= le and + ChildHandle. + @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort the + language specified by Language. + +**/ +EFI_STATUS +EFIAPI +RedfishConfigHandlerComponentNameGetControllerName ( + IN EFI_COMPONENT_NAME_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_HANDLE ChildHandle OPTIONAL, + IN CHAR8 *Language, + OUT CHAR16 **ControllerName + ) +{ + return EFI_UNSUPPORTED; +} diff --git a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c b= /RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c index 2d0170d88614..5e03132695d6 100644 --- a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c +++ b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.c @@ -601,11 +601,17 @@ RedfishConfigHandlerDriverEntryPoint ( // // Install UEFI Driver Model protocol(s). // - Status =3D EfiLibInstallDriverBinding ( + Status =3D EfiLibInstallAllDriverProtocols2 ( ImageHandle, SystemTable, &gRedfishConfigDriverBinding, - ImageHandle + ImageHandle, + &gRedfishConfigHandlerComponentName, + &gRedfishConfigHandlerComponentName2, + NULL, + NULL, + NULL, + NULL ); if (EFI_ERROR (Status)) { gBS->CloseEvent (gEndOfDxeEvent); diff --git a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.h b= /RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.h index 07214875bd5a..51701c05c697 100644 --- a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.h +++ b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.h @@ -24,7 +24,9 @@ // // Protocol instances // -extern EFI_DRIVER_BINDING_PROTOCOL gRedfishConfigDriverBinding; +extern EFI_DRIVER_BINDING_PROTOCOL gRedfishConfigDriverBinding; +extern EFI_COMPONENT_NAME_PROTOCOL gRedfishConfigHandlerComponentName; +extern EFI_COMPONENT_NAME2_PROTOCOL gRedfishConfigHandlerComponentName2; =20 extern REDFISH_CONFIG_DRIVER_DATA gRedfishConfigData; extern EDKII_REDFISH_CREDENTIAL_PROTOCOL *gCredential; diff --git a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.inf= b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.inf index aed93f570cf9..40ce0561379f 100644 --- a/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.inf +++ b/RedfishPkg/RedfishConfigHandler/RedfishConfigHandlerDriver.inf @@ -30,6 +30,7 @@ RedfishPkg/RedfishPkg.dec =20 [Sources] + ComponentName.c RedfishConfigHandlerDriver.h RedfishConfigHandlerDriver.c RedfishConfigHandlerCommon.h --=20 2.32.0 (Apple Git-132) -=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 (#112442): https://edk2.groups.io/g/devel/message/112442 Mute This Topic: https://groups.io/mt/103130784/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-