From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 70B40211C6067 for ; Fri, 1 Feb 2019 02:25:20 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0176F2E6076; Fri, 1 Feb 2019 10:25:20 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-49.rdu2.redhat.com [10.10.120.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1ADC06031B; Fri, 1 Feb 2019 10:25:18 +0000 (UTC) To: Nikita Leshenko , edk2-devel@lists.01.org Cc: liran.alon@oracle.com References: <20190131100724.20907-1-nikita.leshchenko@oracle.com> <20190131100724.20907-4-nikita.leshchenko@oracle.com> From: Laszlo Ersek Message-ID: Date: Fri, 1 Feb 2019 11:25:18 +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: <20190131100724.20907-4-nikita.leshchenko@oracle.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 01 Feb 2019 10:25:20 +0000 (UTC) Subject: Re: [PATCH 03/14] OvmfPkg/MptScsiDxe: Report name of driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 10:25:20 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 01/31/19 11:07, Nikita Leshenko wrote: > Install Component Name protocols to have a nice display name for the > driver in places such as UEFI shell. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Nikita Leshenko > Reviewed-by: Konrad Rzeszutek Wilk > Reviewed-by: Aaron Young > Reviewed-by: Liran Alon > --- > OvmfPkg/MptScsiDxe/MptScsi.c | 61 ++++++++++++++++++++++++++++++++++-- > 1 file changed, 59 insertions(+), 2 deletions(-) > > diff --git a/OvmfPkg/MptScsiDxe/MptScsi.c b/OvmfPkg/MptScsiDxe/MptScsi.c > index 4dcb1b1ae5..38cdda1abe 100644 > --- a/OvmfPkg/MptScsiDxe/MptScsi.c > +++ b/OvmfPkg/MptScsiDxe/MptScsi.c > @@ -71,6 +71,63 @@ EFI_DRIVER_BINDING_PROTOCOL gMptScsiDriverBinding = { > NULL, // DriverBindingHandle filled by EfiLibInstallDriverBindingComponentName2 > }; > > +// > +// Component Name > +// > + > +STATIC > +EFI_UNICODE_STRING_TABLE mDriverNameTable[] = { > + { "eng;en", L"LSI Fusion MPT SCSI Driver" }, > + { NULL, NULL } > +}; > + > +STATIC > +EFI_COMPONENT_NAME_PROTOCOL gComponentName; > + > +EFI_STATUS > +EFIAPI > +MptScsiGetDriverName ( > + IN EFI_COMPONENT_NAME_PROTOCOL *This, > + IN CHAR8 *Language, > + OUT CHAR16 **DriverName > + ) > +{ > + return LookupUnicodeString2 ( > + Language, > + This->SupportedLanguages, > + mDriverNameTable, > + DriverName, > + (BOOLEAN) (This == &gComponentName) // Iso639Language > + ); > +} > + > +EFI_STATUS > +EFIAPI > +MptScsiGetDeviceName ( > + 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 gComponentName = { > + &MptScsiGetDriverName, > + &MptScsiGetDeviceName, > + "eng" // SupportedLanguages, ISO 639-2 language codes > +}; > + > +STATIC > +EFI_COMPONENT_NAME2_PROTOCOL gComponentName2 = { > + (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) &MptScsiGetDriverName, > + (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) &MptScsiGetDeviceName, > + "en" // SupportedLanguages, RFC 4646 language codes > +}; > + > // > // Entry Point > // > @@ -87,7 +144,7 @@ MptScsiEntryPoint ( > SystemTable, > &gMptScsiDriverBinding, > ImageHandle, // The handle to install onto > - NULL, // TODO Component name > - NULL // TODO Component name > + &gComponentName, > + &gComponentName2 > ); > } > (1) Please replace the "g" prefix with "m" in gComponentName and gComponentName2. With that: Reviewed-by: Laszlo Ersek Thanks Laszlo