From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=156.151.31.86; helo=userp2130.oracle.com; envelope-from=nikita.leshchenko@oracle.com; receiver=edk2-devel@lists.01.org Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) (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 9E931211C3864 for ; Thu, 31 Jan 2019 02:08:06 -0800 (PST) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x0VA4Qx5012858 for ; Thu, 31 Jan 2019 10:08:05 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-2018-07-02; bh=DqruR+VJ/lzdFc1eabLpSIDlozT4wZFjbJ8pN2pjhd8=; b=EyBXZ45XLqYfckjzUT3uT11u+rGWyi0n0cl72DyMEFva/X1e8A+/waLnXWT++/ahoOgc lHcSlb8Imm1Lum/mC5WGavcKdS3vXWKQYUVYd8VtTIMgwol4wNJeJvGVLsloyuL3ff/y omRudtCAL9aVYZhDvoSeZ/+20F+HbcnAr1QyKLwsdb6gG4xiJ3XIi6kIUmGjPc85rtYI 0DIOHsUCOroHOtSe/wNiJZ9gxn77ORhQAiRdSQpk9ukEchjhQj2+gxpV5Is4WfZSWnFT ge+zFpxoHFBn84DnLwOiKKns8+QHc+x9ZudIYs5/kaSOKXrHAxQtPI9AmWCTvGL/fjkb aA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2q8eyuqn5v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 31 Jan 2019 10:08:05 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x0VA85Ge004479 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 31 Jan 2019 10:08:05 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x0VA84QU029611 for ; Thu, 31 Jan 2019 10:08:05 GMT Received: from spark.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 31 Jan 2019 02:08:04 -0800 From: Nikita Leshenko To: edk2-devel@lists.01.org Cc: liran.alon@oracle.com, Nikita Leshenko Date: Thu, 31 Jan 2019 12:07:13 +0200 Message-Id: <20190131100724.20907-4-nikita.leshchenko@oracle.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190131100724.20907-1-nikita.leshchenko@oracle.com> References: <20190131100724.20907-1-nikita.leshchenko@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9152 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=562 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901310080 Subject: [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: Thu, 31 Jan 2019 10:08:06 -0000 Content-Transfer-Encoding: 8bit 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 ); } -- 2.20.1