From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by mx.groups.io with SMTP id smtpd.web10.3801.1585049380353090086 for ; Tue, 24 Mar 2020 04:29:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KXqfqVK2; spf=pass (domain: redhat.com, ip: 216.205.24.74, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585049379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PioI7VbYgtmAMZjK0YcYCzJdVwm3hk7nOUs5bLaj+gw=; b=KXqfqVK2nia2+Dj9ElQGGiq/RKZesDwpT/kDU8FbphRu0igEiTS1h0r32GagN+qowDGfcD EVFvDoxBPMj8EBXfBZ+ghyfOf80tuN39s6PYyrDY341z1zqlfTEStnW40rZeuTlIwqBVkC Rdd3ReKIfnZfUk8sHXniWQZmhzdOXgw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-347-sIDtaY3HNPWrpgm601BFEg-1; Tue, 24 Mar 2020 07:29:37 -0400 X-MC-Unique: sIDtaY3HNPWrpgm601BFEg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 947F68018D8; Tue, 24 Mar 2020 11:29:36 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-115-139.ams2.redhat.com [10.36.115.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id E0EF594B49; Tue, 24 Mar 2020 11:29:34 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 03/17] OvmfPkg/PvScsiDxe: Report name of driver To: devel@edk2.groups.io, liran.alon@oracle.com Cc: nikita.leshchenko@oracle.com, aaron.young@oracle.com, jordan.l.justen@intel.com, ard.biesheuvel@linaro.org References: <20200316150113.104630-1-liran.alon@oracle.com> <20200316150113.104630-4-liran.alon@oracle.com> From: "Laszlo Ersek" Message-ID: <5ecb86c3-56e0-1d6a-b392-3f5af80bec4e@redhat.com> Date: Tue, 24 Mar 2020 12:29:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200316150113.104630-4-liran.alon@oracle.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 03/16/20 16:00, Liran Alon wrote: > Install Component Name protocols to have a nice display name for the > driver in places such as UEFI shell. > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 > Reviewed-by: Nikita Leshenko > Signed-off-by: Liran Alon > --- > OvmfPkg/PvScsiDxe/PvScsi.c | 63 ++++++++++++++++++++++++++++++++++++-- > 1 file changed, 61 insertions(+), 2 deletions(-) > > diff --git a/OvmfPkg/PvScsiDxe/PvScsi.c b/OvmfPkg/PvScsiDxe/PvScsi.c > index bf0c743bad15..0c81e645de08 100644 > --- a/OvmfPkg/PvScsiDxe/PvScsi.c > +++ b/OvmfPkg/PvScsiDxe/PvScsi.c > @@ -68,6 +68,65 @@ EFI_DRIVER_BINDING_PROTOCOL mPvScsiDriverBinding = { > NULL // DriverBindingHandle, filled as well > }; > > +// > +// Component Name > +// > + > +STATIC > +EFI_UNICODE_STRING_TABLE mDriverNameTable[] = { > + { "eng;en", L"PVSCSI Host Driver" }, > + { NULL, NULL } > +}; > + > +STATIC > +EFI_COMPONENT_NAME_PROTOCOL mComponentName; > + > +STATIC > +EFI_STATUS > +EFIAPI > +PvScsiGetDriverName ( > + IN EFI_COMPONENT_NAME_PROTOCOL *This, > + IN CHAR8 *Language, > + OUT CHAR16 **DriverName > + ) > +{ > + return LookupUnicodeString2 ( > + Language, > + This->SupportedLanguages, > + mDriverNameTable, > + DriverName, > + (BOOLEAN)(This == &mComponentName) // Iso639Language > + ); > +} > + > +STATIC > +EFI_STATUS > +EFIAPI > +PvScsiGetDeviceName ( > + IN EFI_COMPONENT_NAME_PROTOCOL *This, > + IN EFI_HANDLE DeviceHandle, > + IN EFI_HANDLE ChildHandle, > + IN CHAR8 *Language, > + OUT CHAR16 **ControllerName > + ) > +{ > + return EFI_UNSUPPORTED; > +} > + > +STATIC > +EFI_COMPONENT_NAME_PROTOCOL mComponentName = { > + &PvScsiGetDriverName, > + &PvScsiGetDeviceName, > + "eng" // SupportedLanguages, ISO 639-2 language codes > +}; > + > +STATIC > +EFI_COMPONENT_NAME2_PROTOCOL mComponentName2 = { > + (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) &PvScsiGetDriverName, > + (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) &PvScsiGetDeviceName, > + "en" // SupportedLanguages, RFC 4646 language codes > +}; > + > // > // Entry Point > // > @@ -84,7 +143,7 @@ PvScsiEntryPoint ( > SystemTable, > &mPvScsiDriverBinding, > ImageHandle, > - NULL, // TODO Component name > - NULL // TODO Component name > + &mComponentName, > + &mComponentName2 > ); > } > Reviewed-by: Laszlo Ersek