From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by mx.groups.io with SMTP id smtpd.web10.69827.1584370815217614653 for ; Mon, 16 Mar 2020 08:00:15 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=AbZBu27g; spf=pass (domain: oracle.com, ip: 156.151.31.86, mailfrom: liran.alon@oracle.com) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 02GEqjKM088847; Mon, 16 Mar 2020 15:00:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=x9gB9GsixDcByVR9ctgiOvEF5ovXZspHy0nVa//kZ28=; b=AbZBu27gkR2EDEH+hBmP0j1c0yVUgzLkN+hA8687qA4uStZIGqMxai4hofmmSxpwb9s3 HXOFw/V4UNinMz4aE8kLyi53kQTQG4rFzBh92dxRusuegsfPMSlkFxISQxm3fKQwQYKz /3EL0KBOtVSDUav5xioctq8cQunbQECbGVD3edz9Vnl0sAYRM/HqN0+snwltcnrflsBJ ZjOYHegFAjNcxby7Id2Q/fcHIhgbMlLFG0EwPWwPGZKBfrAfYAV5Ds5NcTAd8j0Ce3o4 hbf2nrER048FovbVKShg+1RVDVtNTFBAp/nrbmM+6arUDHDqUl3vyOmnM3fj6eNVV6Vx QQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2yrppqyfas-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Mar 2020 15:00:12 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 02GEqNdn172713; Mon, 16 Mar 2020 15:00:12 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 2ys8yvyhgw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 16 Mar 2020 15:00:12 +0000 Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 02GF0Bp9029965; Mon, 16 Mar 2020 15:00:11 GMT Received: from spark.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 16 Mar 2020 08:00:10 -0700 From: "Liran Alon" To: devel@edk2.groups.io, lersek@redhat.com Cc: nikita.leshchenko@oracle.com, aaron.young@oracle.com, jordan.l.justen@intel.com, ard.biesheuvel@linaro.org, Liran Alon Subject: [PATCH 03/17] OvmfPkg/PvScsiDxe: Report name of driver Date: Mon, 16 Mar 2020 17:00:59 +0200 Message-Id: <20200316150113.104630-4-liran.alon@oracle.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200316150113.104630-1-liran.alon@oracle.com> References: <20200316150113.104630-1-liran.alon@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9561 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 bulkscore=0 malwarescore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003160072 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9561 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 suspectscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 clxscore=1015 impostorscore=0 priorityscore=1501 spamscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003160072 Content-Transfer-Encoding: 8bit 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 ); } -- 2.20.1