summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/MptScsiDxe
diff options
context:
space:
mode:
authorNikita Leshenko <nikita.leshchenko@oracle.com>2020-05-05 00:05:58 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-05-05 20:43:02 +0000
commitbe7fcaa1c9e952aaacdcbe806933ce70a391aa78 (patch)
treeaea337e9d285a0d0b9213e534b164854058a0182 /OvmfPkg/MptScsiDxe
parentad8f2d6b073e5c3a9612c6ca78174f8e4890c98d (diff)
downloadedk2-be7fcaa1c9e952aaacdcbe806933ce70a391aa78.tar.gz
edk2-be7fcaa1c9e952aaacdcbe806933ce70a391aa78.tar.bz2
edk2-be7fcaa1c9e952aaacdcbe806933ce70a391aa78.zip
OvmfPkg/MptScsiDxe: Report name of driver
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=2390 Signed-off-by: Nikita Leshenko <nikita.leshchenko@oracle.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Liran Alon <liran.alon@oracle.com> Message-Id: <20200504210607.144434-4-nikita.leshchenko@oracle.com>
Diffstat (limited to 'OvmfPkg/MptScsiDxe')
-rw-r--r--OvmfPkg/MptScsiDxe/MptScsi.c61
1 files changed, 59 insertions, 2 deletions
diff --git a/OvmfPkg/MptScsiDxe/MptScsi.c b/OvmfPkg/MptScsiDxe/MptScsi.c
index 581d3909b8..64949a8090 100644
--- a/OvmfPkg/MptScsiDxe/MptScsi.c
+++ b/OvmfPkg/MptScsiDxe/MptScsi.c
@@ -70,6 +70,63 @@ EFI_DRIVER_BINDING_PROTOCOL mMptScsiDriverBinding = {
};
//
+// Component Name
+//
+
+STATIC
+EFI_UNICODE_STRING_TABLE mDriverNameTable[] = {
+ { "eng;en", L"LSI Fusion MPT SCSI Driver" },
+ { NULL, NULL }
+};
+
+STATIC
+EFI_COMPONENT_NAME_PROTOCOL mComponentName;
+
+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 == &mComponentName) // 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 mComponentName = {
+ &MptScsiGetDriverName,
+ &MptScsiGetDeviceName,
+ "eng" // SupportedLanguages, ISO 639-2 language codes
+};
+
+STATIC
+EFI_COMPONENT_NAME2_PROTOCOL mComponentName2 = {
+ (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) &MptScsiGetDriverName,
+ (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) &MptScsiGetDeviceName,
+ "en" // SupportedLanguages, RFC 4646 language codes
+};
+
+//
// Entry Point
//
@@ -85,7 +142,7 @@ MptScsiEntryPoint (
SystemTable,
&mMptScsiDriverBinding,
ImageHandle, // The handle to install onto
- NULL, // TODO Component name
- NULL // TODO Component name
+ &mComponentName,
+ &mComponentName2
);
}