public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: Gary Lin <glin@suse.com>, devel@edk2.groups.io
Cc: Jordan Justen <jordan.l.justen@intel.com>,
	Ard Biesheuvel <ard.biesheuvel@arm.com>
Subject: Re: [PATCH 03/11] OvmfPkg/LsiScsiDxe: Report the name of the driver
Date: Tue, 7 Jul 2020 10:09:15 +0200	[thread overview]
Message-ID: <78a58776-938f-f6cd-ba6b-c2237afde9bb@redhat.com> (raw)
In-Reply-To: <20200701040448.14871-4-glin@suse.com>

On 07/01/20 06:04, Gary Lin wrote:
> Implement LsiScsiGetDriverName() and LsiScsiGetDeviceName()
> to report the name of the driver.
> 
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
> Signed-off-by: Gary Lin <glin@suse.com>
> ---
>  OvmfPkg/LsiScsiDxe/LsiScsi.c | 69 ++++++++++++++++++++++++++++++++++--
>  OvmfPkg/LsiScsiDxe/LsiScsi.h | 31 ++++++++++++++++
>  2 files changed, 98 insertions(+), 2 deletions(-)
> 
> diff --git a/OvmfPkg/LsiScsiDxe/LsiScsi.c b/OvmfPkg/LsiScsiDxe/LsiScsi.c
> index 79a2af4fee73..62daa3ab99bf 100644
> --- a/OvmfPkg/LsiScsiDxe/LsiScsi.c
> +++ b/OvmfPkg/LsiScsiDxe/LsiScsi.c
> @@ -74,6 +74,71 @@ EFI_DRIVER_BINDING_PROTOCOL gDriverBinding = {
>  };
>  
>  
> +//
> +// The purpose of the following scaffolding (EFI_COMPONENT_NAME_PROTOCOL and
> +// EFI_COMPONENT_NAME2_PROTOCOL implementation) is to format the driver's name
> +// in English, for display on standard console devices. This is recommended for
> +// UEFI drivers that follow the UEFI Driver Model. Refer to the Driver Writer's
> +// Guide for UEFI 2.3.1 v1.01, 11 UEFI Driver and Controller Names.
> +//
> +// Device type names ("LSI 53C895A SCSI Controller") are not formatted because
> +// the driver supports only that device type. Therefore the driver name
> +// suffices for unambiguous identification.
> +//
> +
> +STATIC
> +EFI_UNICODE_STRING_TABLE mDriverNameTable[] = {
> +  { "eng;en", L"LSI 53C895A SCSI Controller Driver" },
> +  { NULL,     NULL                                  }
> +};
> +
> +STATIC
> +EFI_COMPONENT_NAME_PROTOCOL gComponentName;
> +
> +EFI_STATUS
> +EFIAPI
> +LsiScsiGetDriverName (
> +  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
> +LsiScsiGetDeviceName (
> +  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 = {
> +  &LsiScsiGetDriverName,
> +  &LsiScsiGetDeviceName,
> +  "eng" // SupportedLanguages, ISO 639-2 language codes
> +};
> +
> +STATIC
> +EFI_COMPONENT_NAME2_PROTOCOL gComponentName2 = {
> +  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME)     &LsiScsiGetDriverName,
> +  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) &LsiScsiGetDeviceName,
> +  "en" // SupportedLanguages, RFC 4646 language codes
> +};
> +
>  //
>  // Entry point of this driver
>  //
> @@ -89,7 +154,7 @@ LsiScsiEntryPoint (
>             SystemTable,
>             &gDriverBinding,
>             ImageHandle, // The handle to install onto
> -           NULL, // TODO Component name
> -           NULL  // TODO Component name
> +           &gComponentName,
> +           &gComponentName2
>             );
>  }
> diff --git a/OvmfPkg/LsiScsiDxe/LsiScsi.h b/OvmfPkg/LsiScsiDxe/LsiScsi.h
> index 17738442fd5f..00db9ada12d2 100644
> --- a/OvmfPkg/LsiScsiDxe/LsiScsi.h
> +++ b/OvmfPkg/LsiScsiDxe/LsiScsi.h
> @@ -47,4 +47,35 @@ LsiScsiControllerStop (
>    IN EFI_HANDLE                  *ChildHandleBuffer
>    );
>  
> +
> +//
> +// The purpose of the following scaffolding (EFI_COMPONENT_NAME_PROTOCOL and
> +// EFI_COMPONENT_NAME2_PROTOCOL implementation) is to format the driver's name
> +// in English, for display on standard console devices. This is recommended for
> +// UEFI drivers that follow the UEFI Driver Model. Refer to the Driver Writer's
> +// Guide for UEFI 2.3.1 v1.01, 11 UEFI Driver and Controller Names.
> +//
> +// Device type names ("LSI 53C895A SCSI Controller") are not formatted because
> +// the driver supports only that device type. Therefore the driver name
> +// suffices for unambiguous identification.
> +//
> +
> +EFI_STATUS
> +EFIAPI
> +LsiScsiGetDriverName (
> +  IN  EFI_COMPONENT_NAME_PROTOCOL *This,
> +  IN  CHAR8                       *Language,
> +  OUT CHAR16                      **DriverName
> +  );
> +
> +EFI_STATUS
> +EFIAPI
> +LsiScsiGetDeviceName (
> +  IN  EFI_COMPONENT_NAME_PROTOCOL *This,
> +  IN  EFI_HANDLE                  DeviceHandle,
> +  IN  EFI_HANDLE                  ChildHandle,
> +  IN  CHAR8                       *Language,
> +  OUT CHAR16                      **ControllerName
> +  );
> +
>  #endif // _LSI_SCSI_DXE_H_
> 

Reviewed-by: Laszlo Ersek <lersek@redhat.com>


  reply	other threads:[~2020-07-07  8:09 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01  4:04 [PATCH 00/11] Introduce LsiScsi driver to OvmfPkg Gary Lin
2020-07-01  4:04 ` [PATCH 01/11] OvmfPkg/LsiScsiDxe: Create the empty driver Gary Lin
2020-07-07  7:59   ` Laszlo Ersek
2020-07-07  8:24     ` Gary Lin
2020-07-01  4:04 ` [PATCH 02/11] OvmfPkg/LsiScsiDxe: Install the skeleton of driver binding Gary Lin
2020-07-07  8:06   ` Laszlo Ersek
2020-07-07  8:34     ` Gary Lin
2020-07-01  4:04 ` [PATCH 03/11] OvmfPkg/LsiScsiDxe: Report the name of the driver Gary Lin
2020-07-07  8:09   ` Laszlo Ersek [this message]
2020-07-01  4:04 ` [PATCH 04/11] OvmfPkg/LsiScsiDxe: Probe PCI devices and look for LsiScsi Gary Lin
2020-07-07  8:15   ` Laszlo Ersek
2020-07-07  8:16     ` Laszlo Ersek
2020-07-01  4:04 ` [PATCH 05/11] OvmfPkg/LsiScsiDxe: Install stubbed EXT_SCSI_PASS_THRU Gary Lin
2020-07-07  8:28   ` Laszlo Ersek
2020-07-01  4:04 ` [PATCH 06/11] OvmfPkg/LsiScsiDxe: Report Targets and LUNs Gary Lin
2020-07-07  9:04   ` Laszlo Ersek
2020-07-08  2:34     ` Gary Lin
2020-07-08 15:26       ` Laszlo Ersek
2020-07-01  4:04 ` [PATCH 07/11] OvmfPkg/LsiScsiDxe: Open PciIo protocol and initialize the device Gary Lin
2020-07-07  9:46   ` Laszlo Ersek
2020-07-08  2:37     ` Gary Lin
2020-07-01  4:04 ` [PATCH 08/11] OvmfPkg/LsiScsiDxe: Map DMA buffer Gary Lin
2020-07-07  9:59   ` Laszlo Ersek
2020-07-08  2:41     ` Gary Lin
2020-07-01  4:04 ` [PATCH 09/11] OvmfPkg/LsiScsiDxe: Examine the incoming SCSI Request Packet Gary Lin
2020-07-07 10:17   ` Laszlo Ersek
2020-07-08  2:43     ` Gary Lin
2020-07-01  4:04 ` [PATCH 10/11] OvmfPkg/LsiScsiDxe: Process the " Gary Lin
2020-07-07 12:46   ` Laszlo Ersek
2020-07-08  6:02     ` Gary Lin
     [not found]     ` <161FB1B03BD2D339.11266@groups.io>
2020-07-14  8:19       ` [edk2-devel] " Gary Lin
2020-07-01  4:04 ` [PATCH 11/11] Maintainers.txt: Add myself as the reviewer for LsiScsi driver Gary Lin
2020-07-07 12:49   ` Laszlo Ersek
2020-07-08  6:03     ` Gary Lin
2020-07-03 14:08 ` [edk2-devel] [PATCH 00/11] Introduce LsiScsi driver to OvmfPkg Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=78a58776-938f-f6cd-ba6b-c2237afde9bb@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox