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.14123.1593576340383966075 for ; Tue, 30 Jun 2020 21:05:40 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: suse.com, ip: 62.140.7.102, mailfrom: glin@suse.com) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-am5eur02lp2054.outbound.protection.outlook.com [104.47.4.54]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-28-6JgZMNkjM7Wal8lEDklPCg-2; Wed, 01 Jul 2020 06:05:37 +0200 X-MC-Unique: 6JgZMNkjM7Wal8lEDklPCg-2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fNrnufnXbwg/mxLYkSO35dqOmLVuHhQXgyFjW/SnXyByUzJ9kc7hHxHRUog52Mdy/TFP3jKqg/2iDAQCVdTxRYL93UyHZLhWLLDJYn8o2owcKqUnHHmiSJtBDgFn6bctPSPPleH+6q7jxKmq7jByxJfIjNoVMOSPRBFxbfsE5TkwbX5oWVfpDR/F/izVwl0J0O8yT+J/Cv+A+zDjFFVapUm00cur7jhOqA+N3Q4EpmLCrHHli6kpVulp+7wDcbaEn8AzuhbTkrgSUMd1k94P+S5jRYzWqd06xwFCK+J17MWeaQCSHMFauoKho2KqTBK8omcax1VaKpfwexzRhkpjcg== 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=QCClnFTVRrGhgzhc3Ltz2qVaJ68GHSHwW048y3MrNJ4=; b=DPis4deIStrfUyezOBHodkPRyxz+Ek9+7O5ORqb+2z2P1VHlnES427sGVClm4CiJH1A1IW/zJ23NcR7lcgSRROO0TCHr/jIFzim3H3tiCgHWb/BoY70pA9Tj/Amqj2OWAytICeisYJvy7qK2m+DUVzK1STZZgbVN1smCsNTXq1rVKH/TlM8ajdDD7J/xy4LMcPT+nV2Zj4MlgrcV9zxs64sW7HGt6T6eMEKFcs/gSOIVT/QMrzgWYXjJyg0jveTTOcdNewfMn/RkDHv2hJmN2Z7hdq/yoxAKY1LIziNBQzPdzfyzrS4JpBc7FbO3XqZaMDAJiEzWa8IWsgOmfjQipg== 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 AM0PR04MB4481.eurprd04.prod.outlook.com (2603:10a6:208:70::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.21; Wed, 1 Jul 2020 04:05:36 +0000 Received: from AM0PR0402MB3809.eurprd04.prod.outlook.com ([fe80::8806:715f:1409:8c6b]) by AM0PR0402MB3809.eurprd04.prod.outlook.com ([fe80::8806:715f:1409:8c6b%7]) with mapi id 15.20.3153.021; Wed, 1 Jul 2020 04:05:36 +0000 From: "Gary Lin" To: devel@edk2.groups.io Cc: Jordan Justen , Laszlo Ersek , Ard Biesheuvel Subject: [PATCH 03/11] OvmfPkg/LsiScsiDxe: Report the name of the driver Date: Wed, 1 Jul 2020 12:04:40 +0800 Message-Id: <20200701040448.14871-4-glin@suse.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200701040448.14871-1-glin@suse.com> References: <20200701040448.14871-1-glin@suse.com> X-ClientProxiedBy: AM0PR10CA0047.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:150::27) 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 AM0PR10CA0047.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:150::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.21 via Frontend Transport; Wed, 1 Jul 2020 04:05:34 +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: b51e731a-e8a8-4b3f-1c70-08d81d7401cc X-MS-TrafficTypeDiagnostic: AM0PR04MB4481: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-Forefront-PRVS: 04519BA941 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oR3f5oq+qmm37Z2DDGH9M8JZtq/E5uOFENgaHpTZN3tteZd3ub7ZtaK8JFBo2KMpsUPiyhFFQShwW1kSPCUsNsQDVztQYBOAqVeaZhIqauxjiu9s+FH0AEpH3idvQiRZ096VSg2lBPWS2IWjNAUnGJxoOM3R3CFDmu47e8lYlyR748oiAypwgc88ojlXqPFl1ORy30F3Cmx7mEL/f3MoG9iLhX7cBRu2wKgltjajLN6R7Y/unlKfWf7WZDeq/OO6Um/6L/kU5G4KzbZ57uSGURRmc9VlQb9+dcB6NDBWDmNYsMEZ2hxlIzl2ddOrIf2C6m/HTXWghLo7VVFwnOnvhw== 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:(366004)(136003)(376002)(39860400002)(396003)(346002)(2616005)(83380400001)(26005)(54906003)(4326008)(16526019)(1076003)(956004)(86362001)(19627235002)(6506007)(186003)(6666004)(66476007)(66556008)(8936002)(6486002)(52116002)(6916009)(5660300002)(8676002)(36756003)(66946007)(55236004)(316002)(6512007)(478600001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: g0Ym1j8D/+BslGLNTfnNP0plCJ6N5Z7zT8370iomW1eIaI4K5AhmfIKVK7RuqTE0giD8Bxun7lAkoWm4fvZqaS3ihdtHv94eIG1e5xqL2tvvqGi5JiIZebEFQ2p3H3Pb3F1vcjcLOQyX7bNpK+MGqYRloWWYymjQXR2pEAJMPbnJznKThevwWWnpoPCcDziLzqdeZ8Zxr8OeJbDZkqGLMPzrudE9cFBQhzY2vXa+JMINo7moM0Q8mHcYHxZ88ugR16J+ekIq0H8bhEb4YAVWgMaANFD4toeo9Cm+aHnOeoQ/xGRJSpqAxBqiDFWO/P+p/gqy5h4jNPGu7e96MVYaAbBZJKOuX7F326VGYuIt5DNKr3mgKFmZDNlu94u9x55VOeZryJ8/OpySAVQApxDIRQMa+/UpI8657DjTqZxSdUH6xhy4N0dGwylFGo6FpH0pzIjWJdRxzX4FupcKSN2hmJYvw1+dt9OP7YxxVzyREmk= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: b51e731a-e8a8-4b3f-1c70-08d81d7401cc X-MS-Exchange-CrossTenant-AuthSource: AM0PR0402MB3809.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2020 04:05:36.0138 (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: apwzZsDDtXlnjOUM2NJUnJEkCmjq9NHgiGQVi97J6MHz41n634IVmCKbvkL7bBcN X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4481 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 --- 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 17738442fd5f..00db9ada12d2 100644 --- a/OvmfPkg/LsiScsiDxe/LsiScsi.h +++ b/OvmfPkg/LsiScsiDxe/LsiScsi.h @@ -47,4 +47,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