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.web11.5971.1594966316579937281 for ; Thu, 16 Jul 2020 23:11:56 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@suse.com header.s=mimecast20200619 header.b=Bv9k/xZz; 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=1594966315; 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=Bv9k/xZzRpQ/bDhEGT1N72eQgWU/l2IUh/xg3vKrne0T5ACDCt22awncwGVCSVCChQYvUw ocglGH492VD5OB1eKLTEHUiZiuW8oa1Fw+Bs/m0rYS5998jAMFGSDPuYzUvcRVaRhR/ufm vSllZNmYxjDTvLz8Z+Ua0GR/muKTxbw= Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2110.outbound.protection.outlook.com [104.47.17.110]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-12-IwgaBbzrOc-iCw57qbBHVA-1; Fri, 17 Jul 2020 08:11:53 +0200 X-MC-Unique: IwgaBbzrOc-iCw57qbBHVA-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zvg5lsshLcjvvp3V5uhpp4W57z4Ge09lt7krRdgR+UG7bjprIUT2MpAUVAXqEw9TE5/dDAFAewjnxJKiD3fK2Y37mBXIs4e/m/ftJRfWGyHm0/j+bzWNlCjvbseYuxZP3aWUXVtwkUa6sTOPmhol9GouZKgzSD6pvNUF09Pc9LfLGyrxWlWNRTIOEuTr5QGpOlPsJkqW88U/xcRypl3zxb+XzIQGHiQxgcWRVXuu+wRvGgXvYlR/pu3StzYIhSdMfweO1XxwsohG8ASuZzCJuOiYoSbCaFxLkme0vDsfftpMVocHIJTXnZw0BNkn9Vxa9oob7YA6tKXO3ql4nghLwA== 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=hzJPj+LAA2CXJs79Qo0TnnJD1J/Y/toeby5ysXZKkYsnM0B07VKY6RZYHJzdtpTLplM5Ht6G1bztaU74McweQ7/y393TLo9R0i4WLFQkm81v+NT3N7UgE4l9xUIoGHk5NZDCJL57hLyJqHOlcdoFB2dOsEzdB2AvLWMpfb6QMKqgf5fiAklxd8pnwjRhsu0l0RdRgZxYC6nva+Q7pCORwSuFncjiKf+fbWbLbEmgITBuiOzqxLVZGdcgsa/y3m4ODdHuT43z4H6x/z8Pir71KXp1eABvLM6W7Mut7r9i1LM2q8Wu/YD2LzdQyiPPuPm8RG919RV/thPVswnSnH8/YA== 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:52 +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:52 +0000 From: "Gary Lin" To: devel@edk2.groups.io Cc: Jordan Justen , Laszlo Ersek , Ard Biesheuvel Subject: [PATCH v3 02/11] OvmfPkg/LsiScsiDxe: Install the skeleton of driver binding Date: Fri, 17 Jul 2020 14:11:21 +0800 Message-Id: <20200717061130.8881-3-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:51 +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: 81d7df36-d8fb-4a39-64a4-08d82a184c73 X-MS-TrafficTypeDiagnostic: AM0PR04MB4740: 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: 8xnfqsbzewV94G728Sc2q0Q8RxgFvhfEpUhzfCUhl6BIPeYvvmJ90t3SZyo+SPIvMRMAnmk/tXmCAf/modxn0xQDxIF7SIUP+wooQ0DqpIuYCWqd80K70Lln2GyRupTA3fod0oe8WwfPGsbLb3lq0MpzgH8Hv3BSa8eL+jiDTv1aDjfuvrx0d/WqEPxw5dt66y6kjuunR3B+DP2xR0YDwYzBMSbo1qm+DEEN4Q6Fn7hTVD4SyPrtBhRlVEmwUsuzRDir+aN0pDZ/DSy8T0+bh9AwrNttkotBxQuydS7oms162Wo8RO5cyHrrCCiWcLEaMTpA/CqMctQXy9jVypLq0g== 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: ElJ5OukRG+70xTxm8C+VDjT19DOm5K4JKa4UlYaohlWrXrlC4A++Es9MNNS3vft9sSKIs68DaScXSZ3OOWwVWuKW4KxSq5LlSDViMpwo6bs6Wz7f+pYSGobM3oWKr7bjvrKyv308j4MZsP5BRPKCEJG2jRe00w1GGLfMT6giRq18f9E0RDPQT4L8/ZE1bQJ46gZ7xOghHLhc1YV98R8FQZpR1hzHXPw7rdSfaL6pGaNBQbSPHCjH0Kg64czt1PqzUveGlXUHxB0gmpYUQ78u+VSRbYz4rQ+oNJEPoIB9lXWG29mRrIIF2xgAQsyNchk0zB9grljuCE7oOafMhyZkxN/KAQZzL7kQKkkMfcOqwQIfTI2It9olRcKkmGmW2cVl7Xb0AZCW9cCns12BDz1YwzAhqw0wofCyWskcHDmqPBAmv86u6PqIn8J3y7Bafsz1OMsow1ol340SM/PA+fuElt7esbCWzNRLJ/19ML4+BB+0vMiGvKNBWfxEhYaKXSLi X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 81d7df36-d8fb-4a39-64a4-08d82a184c73 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:52.6835 (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: msmCPYtC8b8ao7uh1sa6He1rBMnzHUdyKysFbcljJ+pjzs3gMsibMpLNcicyDJD3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4740 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