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.13908.1593576339321006618 for ; Tue, 30 Jun 2020 21:05:39 -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-T05lQA-9P0qY3bmuZTwoBg-1; Wed, 01 Jul 2020 06:05:34 +0200 X-MC-Unique: T05lQA-9P0qY3bmuZTwoBg-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KoZjVx+j0Eq6QtHiUYhXRU6DbSvHmqzruXtRin0604pVHQqGpXsudY564FQ3keAQw0STU8JjrShAaJS6tsTLfk4Kc2EfnbwLOSCcvoHHgHazUMZZF+FW84LRcFpfZF/ExPgR+HbFeuVjqnYoT46U1r5sGMW06OJEeHMiaQ6ZzJY2R7mNfyRPAxitS9Y7Lrn8YDE1oHxQOagtcS7n1V9GqVNLAcUiI0KK1gHEUkP4qVg/DKeVLNMrr3n19V9k4wOnIo/SUioC29lz+HRALeLT7jiPYqh7Lnj5Ofw6TIEmOF9RQaHBSREyL82XgioZIZNyIDL6iQ2DqXjOsMxOF5/VZw== 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=NYGl1iAwqaFPldL35qL3OthJhuaW5Xun2WUEGDCrva4=; b=JWmDxvBJWaBRWHuTGUgbENvyfJwDqpQN4NAYU6cpg2JR1lV5JNcHBStXRnJIbFrN8mK4oHjn90ybd+79KJaUL9M2J3W0bGcXZ92jTbvmyvFzFaWNNBmubQCl8jejzX6H6KEf85eShWXfOn7tdoQbCebYJgCTLZMr5EICBbRf50kLa3vUGbsVisZ6gBSzJ7pSNoVaFnlw21rblk6AG2YUh7pOk1S08eZ4GOYOvGN1j/Z2GqxLKRZDQA67y1OMRLYIJTWIl4s3dUKnQeVXUto7H/oDFo3CDsvxvS9cWLW/itZx25QyZV51FuOX1j0mAc75bmnIwScBpB1DVaMIxxyqag== 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:34 +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:34 +0000 From: "Gary Lin" To: devel@edk2.groups.io Cc: Jordan Justen , Laszlo Ersek , Ard Biesheuvel Subject: [PATCH 02/11] OvmfPkg/LsiScsiDxe: Install the skeleton of driver binding Date: Wed, 1 Jul 2020 12:04:39 +0800 Message-Id: <20200701040448.14871-3-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:32 +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: 60c24aed-2e9e-4d8c-68b1-08d81d7400ad X-MS-TrafficTypeDiagnostic: AM0PR04MB4481: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-Forefront-PRVS: 04519BA941 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H1CxRXKTJhSva7LFLsg2vBc+6RJGow6YC5Io0f7WSv+nhhCGgdLyvjEp0dXn+Aen1YC9PnF6RMtxyiQsmX2bzjfrFN81n8Wc+ebVOFyt15vuSEICtB3RiKJvtR62hEcDrUwqJywjW8TD8r32IZXACZmNulGmNOD6dEmCE2wZa7hK+aA9cyzIRkJl0VOyZib17U1TIjQwUFqws5vX6ETH2TVOP9c3hzWDaT3cfeHJkEXIgMMiiQkZRI/07gBy4m12pwCuMs/Le/nScqFH8PKYPOmHSH7BDqraDjxo7UcyjAAc6TCe1cl2UARPj9Xkh119XkHiyQ/GbhOEB3+zjkqMGg== 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)(66476007)(66556008)(8936002)(6486002)(52116002)(6916009)(5660300002)(8676002)(36756003)(66946007)(55236004)(316002)(6512007)(478600001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: VVHxhMMEwhP5V54mqzwzObMs7I2xAMuBu4kyTZYnJ9wzV/spKBpkLByWZlpS7+1h8MlT+PBTkbChUxGEupey7WEr36T0Gx29MtEBBb2HAc/MZLTfI0smfZjUvp6FmEGwxbZMxtKNriITIZZjEgTY6RpBj0M9WCwfnXtRw0nmrm8TzaQWly/nUnPbxOUO67Yq6qbTYFfUqyCW75Rv52SStAkYAlzDCuMjgozeNBa5s19XIdGg+Y+9T8e5tBaEb2HDLg5WPouDpfjryinj1kKf9U7QMB/bJAwyySB0WXjylgWaufFkymPgAfuh3E6bQH3ChgIpX7wGd8RJrNj2j9xZeRx5d/eGdT9HW3RshwAyu8nLV6cQcY7N5noprlyNlBo1Zm9SQmzWw/M+5oFjKgd9n69iQSXtUNuRBHou+RLUgARFMt4XUbW5sMtlRHK0pPx3egxLPc16wuzhqHHnlnpc8DNvvE3QFJDLOuTS2oO8GVQ= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60c24aed-2e9e-4d8c-68b1-08d81d7400ad 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:34.0839 (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: ncJHuVyFT0mEcetVcX6YNyHAm7N7wvOLkstjR5db5MOGKKzkIX/gn2xbW6+0lgcI X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4481 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Implement the dummy functions for EFI Driver Binding protocol. Cc: Jordan Justen Cc: Laszlo Ersek Cc: Ard Biesheuvel Signed-off-by: Gary Lin --- OvmfPkg/LsiScsiDxe/LsiScsi.c | 72 ++++++++++++++++++++++++++++++- OvmfPkg/LsiScsiDxe/LsiScsi.h | 50 +++++++++++++++++++++ OvmfPkg/LsiScsiDxe/LsiScsiDxe.inf | 2 + 3 files changed, 123 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..17738442fd5f --- /dev/null +++ b/OvmfPkg/LsiScsiDxe/LsiScsi.h @@ -0,0 +1,50 @@ +/** @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 +STATIC=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 55b483c2fa20..444ceb78e9ca 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