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.web12.10698.1594885593812790093 for ; Thu, 16 Jul 2020 00:46:34 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@suse.com header.s=mimecast20200619 header.b=PugfbsKQ; 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=1594885592; 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=oqkZkH4yqkyshCli1fpyH6MassKD8qDb87ywTDXMIQc=; b=PugfbsKQr1uhDx1Yqud0cjDNx4FyihtWRmAGGWKY3JlIEZ+Hb4qXgZbISK/tpZTBEJPc4q pvX1Nni/RTbnDkJx0/j41jHePUsx2jUvqcQEpD6cTtSkdeR94Q1Vp8OG9wS9XdRnwhUfVv DWCV3jm050FIbwccnMZMukqogwZXHng= Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2058.outbound.protection.outlook.com [104.47.14.58]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-12-7vx71pnGOrC8DY-xq0jSEg-1; Thu, 16 Jul 2020 09:46:30 +0200 X-MC-Unique: 7vx71pnGOrC8DY-xq0jSEg-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AlbckhYcLCwYVsD5UofCI4UkGfwhy3m8a1Ptihj6P5oAwhWUBNnuxJwqQMHIkzQBdDjneoh/c710/XfDm1PYvDtwM51NMkj133fNs/Rq7WtU4t2xC5S8sZEq0Wkii40DMnFT6BqEJzedAVRJX67egSyQUZQuy7JQA2ReyFiqkL+CDp2F1lU40HIBAnfqOO9p95kdD3S0wy/5kMtKViCARrE5Eb1EWtvjC1xrbCfcg9BBemD0gkHtArqVLQDxOI+OP/9EueKcIbh1l/JcLDRop/5PfMGRfUkcpAmsxpv6oev6nRGagqOIgEtGkCHlzYZscSDjZmiNNejYtstZA3twZQ== 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=oqkZkH4yqkyshCli1fpyH6MassKD8qDb87ywTDXMIQc=; b=CIi0XRESraR6PFxSQg/RjG/8zQL4bIOzU0my1Yzlq+rgqVg3eZaOp5fvWcIjBOR1Hj9WZRl0DAeSFxA+C2jjEqprLzSXBw65ooqqytjK91V6y6mnaL1KakxQops9im3qooVqmRKeFJqfPYY/Mdjbt0FrTxj+Rh7gBYtwtBU/V+PgcjUs4l421XOywbrCGilzPmNNBayqMAEa2CSDg5aHNDJS7gLWcm0pDS7jsmDZXWb6ifMqurwSim8pxRVoQ+2eSZhDBpdSXm7VW350Q14o+/4u9B1BjL/mIkBMtI0ZTK1ANhsCw6WwX4K6FP7zczL1VnD6nf6VyV5OtJ5S+xH1Ww== 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:29 +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:29 +0000 From: "Gary Lin" To: devel@edk2.groups.io Cc: Jordan Justen , Laszlo Ersek , Ard Biesheuvel Subject: [PATCH v2 02/12] OvmfPkg/LsiScsiDxe: Install the skeleton of driver binding Date: Thu, 16 Jul 2020 15:45:57 +0800 Message-Id: <20200716074607.18048-3-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:27 +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: dff0225f-ceb6-4d7a-f732-08d8295c59a4 X-MS-TrafficTypeDiagnostic: AM0PR04MB5122: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jyBr8Plt/z8esry8meAw7rNxKVHtPm9nHGH9/VldxlfBPzMV+DjfYm3cZhLSaeUrn6Jc24Pg1OLvkwjjKJhd8e/3YFzGVXvyWYU4gpJwF8YSfSp3IVLCC/1AehJokdRv4LDaU4IRCNrluS1bhyzTZVmnpzgO/sqt/zcOoLdeeUbsLu25a4sinLVCRbxLKYMxsgzBdSdg+NABBtnDeQY/0dj70VNOTVS0Psds71jbxV+lkd2Ai0I1se5iqz5Lf/6pGyfx1Pgg6gEGm4JI2/mFWlgerGPKQCOUUTK4OJBFZ2P6iTltQUf3MX8LMsBkFQtZzoI3EC75rR/taha3jsqOdw== 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: W/WxIeV/qE65A61DCU8y6eLn+VatjOYSdmhEwFk5/KE4nSGK+LuygVh2CVAAPCih8E5l3u8B5/vlHb49HlcB2Or6KJzbrwv21vI6cxjkGcD0wGF5H2NAi0BMgJ0AUUpLYyXeGYTy/BaM32ZfFEY2ENf9YyXHR/WYl2EHANtnT214bcA6tygieQfdArdbSzzzpUpPBgnrvZw6kUERiTu0hmMhyQtA6SrirbjChjrzRyxvUGnS781DGfT5JXynu6PG05aiRcKJmq0NYYEIfTjT4a7FGf5pzctByRq2n8yudSF4bKaMUJUk/4rz71VwKDxEerrwOZXxZFMnE6ipxP0IlwHULknnQBWHbAtqUUnwfTzoAWphyT1oBbdE0394Wp+SXRVaHCzNPSz+UzhRFDcSU+dr2MKUCRVtQMicB73nw+K8xqOSyHe8yEJ+e1kIqYw6WVESH2d+L2NjMeAjKEg1d/tJBymozQWHBNhNXepfmho= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: dff0225f-ceb6-4d7a-f732-08d8295c59a4 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:29.7314 (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: HPalz/uLgUl3fO7lCc3PyJq6pi3Ht/SlV3KBIxi7/Bi4KiWoIY8mDYgAhMpqx/76 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5122 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Implement the dummy functions for EFI Driver Binding protocol. v2: Remove "STATIC" from LsiScsiControllerSupported() Cc: Jordan Justen Cc: Laszlo Ersek Cc: Ard Biesheuvel Signed-off-by: Gary Lin Reviewed-by: Laszlo Ersek --- OvmfPkg/LsiScsiDxe/LsiScsi.c | 72 ++++++++++++++++++++++++++++++- OvmfPkg/LsiScsiDxe/LsiScsi.h | 49 +++++++++++++++++++++ OvmfPkg/LsiScsiDxe/LsiScsiDxe.inf | 2 + 3 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 OvmfPkg/LsiScsiDxe/LsiScsi.h diff --git a/OvmfPkg/LsiScsiDxe/LsiScsi.c b/OvmfPkg/LsiScsiDxe/LsiScsi.c index 9c90941688ed..79a2af4fee73 100644 --- a/OvmfPkg/LsiScsiDxe/LsiScsi.c +++ b/OvmfPkg/LsiScsiDxe/LsiScsi.c @@ -9,8 +9,71 @@ =0D **/=0D =0D +#include =0D #include =0D =0D +#include "LsiScsi.h"=0D +=0D +//=0D +// Probe, start and stop functions of this driver, called by the DXE core = for=0D +// specific devices.=0D +//=0D +// The following specifications document these interfaces:=0D +// - Driver Writer's Guide for UEFI 2.3.1 v1.01, 9 Driver Binding Protocol= =0D +// - UEFI Spec 2.3.1 + Errata C, 10.1 EFI Driver Binding Protocol=0D +//=0D +=0D +EFI_STATUS=0D +EFIAPI=0D +LsiScsiControllerSupported (=0D + IN EFI_DRIVER_BINDING_PROTOCOL *This,=0D + IN EFI_HANDLE ControllerHandle,=0D + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL=0D + )=0D +{=0D + return EFI_UNSUPPORTED;=0D +}=0D +=0D +EFI_STATUS=0D +EFIAPI=0D +LsiScsiControllerStart (=0D + IN EFI_DRIVER_BINDING_PROTOCOL *This,=0D + IN EFI_HANDLE ControllerHandle,=0D + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL=0D + )=0D +{=0D + return EFI_SUCCESS;=0D +}=0D +=0D +EFI_STATUS=0D +EFIAPI=0D +LsiScsiControllerStop (=0D + IN EFI_DRIVER_BINDING_PROTOCOL *This,=0D + IN EFI_HANDLE ControllerHandle,=0D + IN UINTN NumberOfChildren,=0D + IN EFI_HANDLE *ChildHandleBuffer=0D + )=0D +{=0D + return EFI_SUCCESS;=0D +}=0D +=0D +//=0D +// The static object that groups the Supported() (ie. probe), Start() and= =0D +// Stop() functions of the driver together. Refer to UEFI Spec 2.3.1 + Err= ata=0D +// C, 10.1 EFI Driver Binding Protocol.=0D +//=0D +STATIC=0D +EFI_DRIVER_BINDING_PROTOCOL gDriverBinding =3D {=0D + &LsiScsiControllerSupported,=0D + &LsiScsiControllerStart,=0D + &LsiScsiControllerStop,=0D + 0x10, // Version, must be in [0x10 .. 0xFFFFFFEF] for IHV-developed driv= ers=0D + NULL, // ImageHandle, to be overwritten by=0D + // EfiLibInstallDriverBindingComponentName2() in LsiScsiEntryPoint= ()=0D + NULL // DriverBindingHandle, ditto=0D +};=0D +=0D +=0D //=0D // Entry point of this driver=0D //=0D @@ -21,5 +84,12 @@ LsiScsiEntryPoint ( IN EFI_SYSTEM_TABLE *SystemTable=0D )=0D {=0D - return EFI_UNSUPPORTED;=0D + return EfiLibInstallDriverBindingComponentName2 (=0D + ImageHandle,=0D + SystemTable,=0D + &gDriverBinding,=0D + ImageHandle, // The handle to install onto=0D + NULL, // TODO Component name=0D + NULL // TODO Component name=0D + );=0D }=0D diff --git a/OvmfPkg/LsiScsiDxe/LsiScsi.h b/OvmfPkg/LsiScsiDxe/LsiScsi.h new file mode 100644 index 000000000000..328bd289b8e8 --- /dev/null +++ b/OvmfPkg/LsiScsiDxe/LsiScsi.h @@ -0,0 +1,49 @@ +/** @file=0D +=0D + Internal definitions for the LSI 53C895A SCSI driver, which produces=0D + Extended SCSI Pass Thru Protocol instances for LSI 53C895A SCSI devices.= =0D +=0D + Copyright (C) 2020, SUSE LLC.=0D +=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D +**/=0D +=0D +#ifndef _LSI_SCSI_DXE_H_=0D +#define _LSI_SCSI_DXE_H_=0D +=0D +//=0D +// Probe, start and stop functions of this driver, called by the DXE core = for=0D +// specific devices.=0D +//=0D +// The following specifications document these interfaces:=0D +// - Driver Writer's Guide for UEFI 2.3.1 v1.01, 9 Driver Binding Protocol= =0D +// - UEFI Spec 2.3.1 + Errata C, 10.1 EFI Driver Binding Protocol=0D +//=0D +=0D +EFI_STATUS=0D +EFIAPI=0D +LsiScsiControllerSupported (=0D + IN EFI_DRIVER_BINDING_PROTOCOL *This,=0D + IN EFI_HANDLE ControllerHandle,=0D + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL=0D + );=0D +=0D +EFI_STATUS=0D +EFIAPI=0D +LsiScsiControllerStart (=0D + IN EFI_DRIVER_BINDING_PROTOCOL *This,=0D + IN EFI_HANDLE ControllerHandle,=0D + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL=0D + );=0D +=0D +EFI_STATUS=0D +EFIAPI=0D +LsiScsiControllerStop (=0D + IN EFI_DRIVER_BINDING_PROTOCOL *This,=0D + IN EFI_HANDLE ControllerHandle,=0D + IN UINTN NumberOfChildren,=0D + IN EFI_HANDLE *ChildHandleBuffer=0D + );=0D +=0D +#endif // _LSI_SCSI_DXE_H_=0D diff --git a/OvmfPkg/LsiScsiDxe/LsiScsiDxe.inf b/OvmfPkg/LsiScsiDxe/LsiScsi= Dxe.inf index 8b6dccaff3eb..5cb15c456549 100644 --- a/OvmfPkg/LsiScsiDxe/LsiScsiDxe.inf +++ b/OvmfPkg/LsiScsiDxe/LsiScsiDxe.inf @@ -18,9 +18,11 @@ [Defines] =0D [Sources]=0D LsiScsi.c=0D + LsiScsi.h=0D =0D [Packages]=0D MdePkg/MdePkg.dec=0D =0D [LibraryClasses]=0D UefiDriverEntryPoint=0D + UefiLib=0D --=20 2.25.1