From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [51.163.158.102]) by mx.groups.io with SMTP id smtpd.web11.10937.1594885595820000016 for ; Thu, 16 Jul 2020 00:46:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@suse.com header.s=mimecast20200619 header.b=IcK/fR5h; spf=pass (domain: suse.com, ip: 51.163.158.102, mailfrom: glin@suse.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1594885594; 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=IcK/fR5h4cS/nV0ACdQDltmYgbIyGBjUcbUFnRESDbGqCTcv54uCCALdIpSr7OnCsHpaWk ggNGS/Y3sWzPGPBBdnX/rXUk/UXO+7nHoduz0Q4FvTtYMnwMtb5DOri1qIVWV1n/7WF7sk Un45RZ+jwjzzoMmIUf/u12sMeIXkGvI= Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-ve1eur03lp2051.outbound.protection.outlook.com [104.47.9.51]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-3-2a8z0EZ4Np2HHHcKPfyCOg-1; Thu, 16 Jul 2020 09:46:33 +0200 X-MC-Unique: 2a8z0EZ4Np2HHHcKPfyCOg-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IhCo3CjSJe3GZOsxDohTwfpYxwLGJNbOpxqIk10LDEsxQaxZajO3wUER/3dF3l53mS3Y0QbinrcwWILDTJhZhyDbsV/79LVa1wJmTfw3c6rVQtLdP3QtQGXi1QAS2Ae8mRljqQl3xIJGawc80ir0AxdcXyzrzWjKDAn0W0rdSPWPT4sXeEVF2gbm6ArH/v276QfK6JXmUCnWbP7yusuogCa5sySmS/EoSmUks1enmM/YRxJMq56wsBIvTDPo3379rmJGwGICNwtW+L1QwJ4c3BV0yCo4K1+HLZK5B6T7vv+LgAV55Md4fBBCWON6vDSFA4OyxkzWkE9FSZfe5PKm2A== 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=XJog+e51ZCAmJ/tw+Gafu4z0M5CkeJuMPdDRjNbKU2fhUspl+r9BNkQmwwFhe+8Ae9sQabuT+XNIdwVc3XVUYbrZoty2cs1Cn1vGUr8fzhCBtusPgHxCE7ZPAOM5MOiGYE2uLdOiI7cJ/RJawt1Co8G1ImgnSKbGrSpaR6tuwWJj9EZjysvHVlHQGTpNT3R5E5Lqv9tYzc/Y7GLWUtUKD7LU2Jz1fNBmUVfGfMTvrv01/ZdNAioF5YMVPfXKC3ygKK/HcjVw02aVzRb/kU0vY3GK+C+jVfjIVJv3fp39frB51YVXV/EbXnZePUrLOVMuMyCmlXctvr+TV5laAySkMg== 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 AM0PR04MB5122.eurprd04.prod.outlook.com (2603:10a6:208:ca::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.25; Thu, 16 Jul 2020 07:46:31 +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; Thu, 16 Jul 2020 07:46:31 +0000 From: "Gary Lin" To: devel@edk2.groups.io Cc: Jordan Justen , Laszlo Ersek , Ard Biesheuvel Subject: [PATCH v2 03/12] OvmfPkg/LsiScsiDxe: Report the name of the driver Date: Thu, 16 Jul 2020 15:45:58 +0800 Message-Id: <20200716074607.18048-4-glin@suse.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716074607.18048-1-glin@suse.com> References: <20200716074607.18048-1-glin@suse.com> X-ClientProxiedBy: AM3PR07CA0118.eurprd07.prod.outlook.com (2603:10a6:207:7::28) 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 AM3PR07CA0118.eurprd07.prod.outlook.com (2603:10a6:207:7::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.17 via Frontend Transport; Thu, 16 Jul 2020 07:46:30 +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: 1ed5b6a3-17cc-4dc7-299f-08d8295c5afd X-MS-TrafficTypeDiagnostic: AM0PR04MB5122: 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: q92wzmsRTYZUZM6DGLBfTFM5R1rgwSJsnHMLgGWTs/f2O6kKRkgvyATdpFl9Uc4dUABowTnl6MAkMsSprk0qBm78FAh7qSSnYbONgrIle2aAzEvi7u9iR1K4eBNotTkgfp5DG2WQXd17z2Co2sGSnhmQVjKxme/LbKxTQ/QyfEQR9L14kQsUhMRYycLst3e2w2KWwulkaugLHPCUIg1S582ePDOUi4oosVm/HEBNpCkgE6YjNZ9P20D5LF8ml+wkmHKVEteVhkzP+OxiHVs62bkBCacBYTycAOfZrdmjuacdJ9ltZ2+pk9gI5sIqd3LPvDWFgD9udMkY/cqrf4yyJQ== 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:(376002)(396003)(366004)(39860400002)(346002)(136003)(19627235002)(55236004)(6506007)(4326008)(8936002)(6512007)(86362001)(83380400001)(8676002)(6486002)(1076003)(52116002)(6916009)(36756003)(66946007)(66556008)(956004)(478600001)(5660300002)(6666004)(26005)(2616005)(316002)(54906003)(66476007)(16526019)(2906002)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: HYIKbNw8IYu+RixjK5utL010wq8o8lySrtijaBTVqjl/COcMAAm79TUbqhM5ahiYYOpolw2vWI147JNtjbWw6g3tFXOeJLfjVTHEH3UuWIBggxsONpExJ7nk717zHOzJgHAOhdi5pJh0UgM8Y9sd3IZP4ZlBbg9ejP2JKnGrQaONlsO+/XCijOvXYfabJH5IQyIE8D1WvKAFoMebrpvxWOjOEeAx6KvvrvXBpJ5r2u/JPOTd0H1iW/X0xWiSXnNMjL0xM4zVcBxPrSLJhEpfOktavGWWKOm9yWS3OZDn8uxvhzSbU5DjPq9FzMsL+amSO5vsB6Xy7FdpU4fYoxFvqbnTj2uD+JStMK2iIsCSOqT6Ae3ciZcy1HtRHUyMPXIvt9EopUmVL6c/OqHMA69vTUXzr7+IXxWi000CkgjxYMA3JESstM1M6X+U+0HSTEPE6MMeadZk1dmYKDL7YlpYDVHoOsF5U0zcwllgmr7TE8s= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ed5b6a3-17cc-4dc7-299f-08d8295c5afd X-MS-Exchange-CrossTenant-AuthSource: AM0PR0402MB3809.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2020 07:46:31.6663 (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: QxxyTz9oXzgk5ZVW9C1qpIVLCpAHY0sb4m3ULOwSasvzyt9g2WpkOZAZUDYeMQSr X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5122 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