From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [62.140.7.102]) by mx.groups.io with SMTP id smtpd.web10.5997.1594966318991211678 for ; Thu, 16 Jul 2020 23:11:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@suse.com header.s=mimecast20200619 header.b=Vvky9Rea; spf=pass (domain: suse.com, ip: 62.140.7.102, mailfrom: glin@suse.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1594966317; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=28SI9s2Shz/DoCip7DxOA2Y/cu4qGNCUZ2PWhW5YwWc=; b=Vvky9ReakXO7oOHgsbAIkQ0rpxtKpeIigiyJE6GN4mHkbxQj5c2fZEs9gAqHFHRhalzhgx MBSG7dNe7j/PIBZylwrSYutVXMHsaW1vGERQLZp4uE2mO5G2nKE4g3DWsz0b6vyXg6hSvM 80swjn8YrnKrkhC9ZPYL6hgujHuXaxo= Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2105.outbound.protection.outlook.com [104.47.17.105]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-12-nvIVYSHhOt2IdYA-iAFLmQ-1; Fri, 17 Jul 2020 08:11:56 +0200 X-MC-Unique: nvIVYSHhOt2IdYA-iAFLmQ-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I6lsUMgzs5efJ9Ravxo3RpNYdy/I3lolmFVYPBhUxHofiIrVjIuc2/VvLPRTtMnmAHx2tB2uswhv+eCeJ+hKmS/qW9ebOZEuMt4LOVrYGa7qKuq5AAjIAstNS5Rg/kY4UNlXo3DTNwqPdR7OUdYioqN8cVPSMgleIjlK2Pf8ijXmz1tkArye78Xa6pPxyHt3deIGFlek/VIDctCu4sME4oEWwTmMsIGSz9JWlk63UWi0659byjUmKaqFQx2jPSyREDO1VWtoHE/CkJpNIDizIfcnpEFOitoxTAVX18uoVQIAstK9TpZPmvkPJ6UyY8OFVX2ci2vgVUVq8jA9k5hSNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=28SI9s2Shz/DoCip7DxOA2Y/cu4qGNCUZ2PWhW5YwWc=; b=CavKT3ymnEq86ED2sP+doq3B6mgWkXVHp7GOSffaXGFW7wxJ5fy/hx/qbirXPFISAfYegbUU9t3N4asnq/RcewGgpYCyvCKkmqnmsOkMvLsranR9+JMzBnNfIwo2oejPk4Et0BFOiXknSJnpbZqW3xmTgjI4sGy3hEjk9T/hPDuVwBq8jVSMAzutFu3EdVfRoMLou/AJU8FArFRW+KdK6svjDuVEC5VuFeL6Ksap2w592MBIn3RKId11VLQHh8j8qMSZHtiQ3GG7r/EE1iqYZLK3auPq/9Alnh4OaplziJ/LHV74Y/ucoXOGJy3xz49TxDmTMi+txMlm2iNIr+l7+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=suse.com; Received: from AM0PR0402MB3809.eurprd04.prod.outlook.com (2603:10a6:208:10::30) by AM0PR04MB4740.eurprd04.prod.outlook.com (2603:10a6:208:c8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.17; Fri, 17 Jul 2020 06:11:55 +0000 Received: from AM0PR0402MB3809.eurprd04.prod.outlook.com ([fe80::a14c:d441:c8a9:77ba]) by AM0PR0402MB3809.eurprd04.prod.outlook.com ([fe80::a14c:d441:c8a9:77ba%6]) with mapi id 15.20.3174.026; Fri, 17 Jul 2020 06:11:55 +0000 From: "Gary Lin" To: devel@edk2.groups.io Cc: Jordan Justen , Laszlo Ersek , Ard Biesheuvel Subject: [PATCH v3 03/11] OvmfPkg/LsiScsiDxe: Report the name of the driver Date: Fri, 17 Jul 2020 14:11:22 +0800 Message-Id: <20200717061130.8881-4-glin@suse.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200717061130.8881-1-glin@suse.com> References: <20200717061130.8881-1-glin@suse.com> X-ClientProxiedBy: AM0PR04CA0138.eurprd04.prod.outlook.com (2603:10a6:208:55::43) To AM0PR0402MB3809.eurprd04.prod.outlook.com (2603:10a6:208:10::30) Return-Path: glin@suse.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from GaryWorkstation.suse.cz (60.251.47.115) by AM0PR04CA0138.eurprd04.prod.outlook.com (2603:10a6:208:55::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.18 via Frontend Transport; Fri, 17 Jul 2020 06:11:52 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [60.251.47.115] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2c808e99-30a9-4915-8d56-08d82a184dc6 X-MS-TrafficTypeDiagnostic: AM0PR04MB4740: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gbY7xDm0kDgh1hpBVlO/FWzAfbCBaeH3uX1O4tU12x+F8ghvceh/3yt/GHEIFhlmP4CVkICk7vuo51e4GD3yVXpDK5jBR7QXlM3qk4fqswyUKV5YiEnhcpzLFKZcgzY1rRudMDK4pa1VuCYFmSiktRsWPuVX1bPX6t1qlI93GxNHjKvTSBd6fil+sNkG6Q6kxpZEM1TIc08KE/t6GiNYyFJ17TZwi2Tf4oyxkMp+3wkpIhrqu4MrXsd/W+ijuDKhpDDB7X9Vk2G/9SZwRObOI7ns3P0cXXLmqFT3XDPJ0JPuHOlzmGaepAbf8isLfd3MYbcc5BzEjypihq5m6KQpZQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR0402MB3809.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(39860400002)(136003)(396003)(376002)(346002)(366004)(55236004)(2906002)(186003)(1076003)(16526019)(66556008)(6506007)(66946007)(6486002)(8936002)(19627235002)(66476007)(54906003)(86362001)(6916009)(8676002)(26005)(83380400001)(5660300002)(6512007)(316002)(6666004)(52116002)(478600001)(956004)(36756003)(2616005)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: YP2sNfyKMU5TrF/2PixW8UOaT33aXVa6fz//8o/PDYGg+R2zCzm4tPjLe18mg2XDZkj7Fvzq0rGxKX/Mf2K3xTlRn5y6HUQ/xbO0sxzC3zX2Th7W7AZoEXR9odGly+kJCtTns3DLOUsBLUgbS6CsfZm+CBcc+rjzk6atYDTNkMzZU0IpFPw5+Rv5j17VSut9E41n6jClhv8dl97MWCcNwF/oHz9E10Bz2m01+g38BWHLkXg7oCQRptYKRtppZVCoz337BRjTvm4qlY8S4UjllMH2+ow/RmolpHY45jlpT+aw/S9OHRIk30bePHSVOXkfCFkcV+AYzGKUG+W+R7ELZjI4DNNgh62wv2/hZKoBxzvrsIlCjaYkmu18zZy/sPUUOp4VEjo9d6P18sspw5YIbrC2iy9371mx+0yhno/P2C0m2wJH9Vm+6+2FpWltTlnCtXnlXnprhr8WPVZzgaSJm09/ExMFmoCPoijcRorYc1U= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c808e99-30a9-4915-8d56-08d82a184dc6 X-MS-Exchange-CrossTenant-AuthSource: AM0PR0402MB3809.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2020 06:11:55.1561 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LU5mEbBvAKVnwEn28D0+SyD3yiOzUH625SH4Cym37VSAhHwdKseLC9zuKu7QQXs7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4740 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Implement LsiScsiGetDriverName() and LsiScsiGetDeviceName() to report the name of the driver. Cc: Jordan Justen Cc: Laszlo Ersek Cc: Ard Biesheuvel Signed-off-by: Gary Lin Reviewed-by: Laszlo Ersek --- 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 =3D { };=0D =0D =0D +//=0D +// The purpose of the following scaffolding (EFI_COMPONENT_NAME_PROTOCOL a= nd=0D +// EFI_COMPONENT_NAME2_PROTOCOL implementation) is to format the driver's = name=0D +// in English, for display on standard console devices. This is recommende= d for=0D +// UEFI drivers that follow the UEFI Driver Model. Refer to the Driver Wri= ter's=0D +// Guide for UEFI 2.3.1 v1.01, 11 UEFI Driver and Controller Names.=0D +//=0D +// Device type names ("LSI 53C895A SCSI Controller") are not formatted bec= ause=0D +// the driver supports only that device type. Therefore the driver name=0D +// suffices for unambiguous identification.=0D +//=0D +=0D +STATIC=0D +EFI_UNICODE_STRING_TABLE mDriverNameTable[] =3D {=0D + { "eng;en", L"LSI 53C895A SCSI Controller Driver" },=0D + { NULL, NULL }=0D +};=0D +=0D +STATIC=0D +EFI_COMPONENT_NAME_PROTOCOL gComponentName;=0D +=0D +EFI_STATUS=0D +EFIAPI=0D +LsiScsiGetDriverName (=0D + IN EFI_COMPONENT_NAME_PROTOCOL *This,=0D + IN CHAR8 *Language,=0D + OUT CHAR16 **DriverName=0D + )=0D +{=0D + return LookupUnicodeString2 (=0D + Language,=0D + This->SupportedLanguages,=0D + mDriverNameTable,=0D + DriverName,=0D + (BOOLEAN)(This =3D=3D &gComponentName) // Iso639Language=0D + );=0D +}=0D +=0D +EFI_STATUS=0D +EFIAPI=0D +LsiScsiGetDeviceName (=0D + IN EFI_COMPONENT_NAME_PROTOCOL *This,=0D + IN EFI_HANDLE DeviceHandle,=0D + IN EFI_HANDLE ChildHandle,=0D + IN CHAR8 *Language,=0D + OUT CHAR16 **ControllerName=0D + )=0D +{=0D + return EFI_UNSUPPORTED;=0D +}=0D +=0D +STATIC=0D +EFI_COMPONENT_NAME_PROTOCOL gComponentName =3D {=0D + &LsiScsiGetDriverName,=0D + &LsiScsiGetDeviceName,=0D + "eng" // SupportedLanguages, ISO 639-2 language codes=0D +};=0D +=0D +STATIC=0D +EFI_COMPONENT_NAME2_PROTOCOL gComponentName2 =3D {=0D + (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) &LsiScsiGetDriverName,=0D + (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) &LsiScsiGetDeviceName,=0D + "en" // SupportedLanguages, RFC 4646 language codes=0D +};=0D +=0D //=0D // Entry point of this driver=0D //=0D @@ -89,7 +154,7 @@ LsiScsiEntryPoint ( SystemTable,=0D &gDriverBinding,=0D ImageHandle, // The handle to install onto=0D - NULL, // TODO Component name=0D - NULL // TODO Component name=0D + &gComponentName,=0D + &gComponentName2=0D );=0D }=0D diff --git a/OvmfPkg/LsiScsiDxe/LsiScsi.h b/OvmfPkg/LsiScsiDxe/LsiScsi.h index 328bd289b8e8..6c8dcbd70a0a 100644 --- a/OvmfPkg/LsiScsiDxe/LsiScsi.h +++ b/OvmfPkg/LsiScsiDxe/LsiScsi.h @@ -46,4 +46,35 @@ LsiScsiControllerStop ( IN EFI_HANDLE *ChildHandleBuffer=0D );=0D =0D +=0D +//=0D +// The purpose of the following scaffolding (EFI_COMPONENT_NAME_PROTOCOL a= nd=0D +// EFI_COMPONENT_NAME2_PROTOCOL implementation) is to format the driver's = name=0D +// in English, for display on standard console devices. This is recommende= d for=0D +// UEFI drivers that follow the UEFI Driver Model. Refer to the Driver Wri= ter's=0D +// Guide for UEFI 2.3.1 v1.01, 11 UEFI Driver and Controller Names.=0D +//=0D +// Device type names ("LSI 53C895A SCSI Controller") are not formatted bec= ause=0D +// the driver supports only that device type. Therefore the driver name=0D +// suffices for unambiguous identification.=0D +//=0D +=0D +EFI_STATUS=0D +EFIAPI=0D +LsiScsiGetDriverName (=0D + IN EFI_COMPONENT_NAME_PROTOCOL *This,=0D + IN CHAR8 *Language,=0D + OUT CHAR16 **DriverName=0D + );=0D +=0D +EFI_STATUS=0D +EFIAPI=0D +LsiScsiGetDeviceName (=0D + IN EFI_COMPONENT_NAME_PROTOCOL *This,=0D + IN EFI_HANDLE DeviceHandle,=0D + IN EFI_HANDLE ChildHandle,=0D + IN CHAR8 *Language,=0D + OUT CHAR16 **ControllerName=0D + );=0D +=0D #endif // _LSI_SCSI_DXE_H_=0D --=20 2.25.1