From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) by mx.groups.io with SMTP id smtpd.web12.15902.1588626166939910869 for ; Mon, 04 May 2020 14:02:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=xC/1i+Z9; spf=pass (domain: oracle.com, ip: 141.146.126.78, mailfrom: nikita.leshchenko@oracle.com) Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 044L0dKO077461; Mon, 4 May 2020 21:02:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=h0N8hRFqxTaZxPT5dpVxxsYA4F4qOzWkp8lhHCX52wQ=; b=xC/1i+Z9Jv2jP6Wkle+OdBnOn1eMGlLy9BdlmSw09b6bRSnkQiPvvtF0f3PZx+kLQcQJ OFeXfGmHbMAhAZIxLudLvy25fklYlZkxnHrgqBQgkDLg8zjcTheQvkLDn6662Bn/NDMJ QneT8n1iEdDgEL5y+6kpQBs5vPkS2xRjRVovcPgi23gPfMdL7soO+6cJ2L6NTs7YgeKO 3cKUBwneuYd7sstbOiJvoR1yMcK4mogNslE4BpX73WdVwnBtCNjMFkRECC8RBcg+V5by ZpX2aLfE4TjdszoyKuE84g4V2atd/TLUCvs9JMj+VxyazhWB4gIH1oCku21VX1cVkTCy kw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 30s0tm9b3q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 May 2020 21:02:43 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 044L2YN8179436; Mon, 4 May 2020 21:02:43 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 30sjjwuaph-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 May 2020 21:02:42 +0000 Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 044L2bdm019317; Mon, 4 May 2020 21:02:37 GMT Received: from spark.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 04 May 2020 14:02:37 -0700 From: "Nikita Leshenko" To: devel@edk2.groups.io Cc: Nikita Leshenko , liran.alon@oracle.com, aaron.young@oracle.com, Jordan Justen , Laszlo Ersek , Ard Biesheuvel Subject: [PATCH v6 02/12] OvmfPkg/MptScsiDxe: Install DriverBinding Protocol Date: Tue, 5 May 2020 00:05:57 +0300 Message-Id: <20200504210607.144434-3-nikita.leshchenko@oracle.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200504210607.144434-1-nikita.leshchenko@oracle.com> References: <20200504210607.144434-1-nikita.leshchenko@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9611 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxscore=0 phishscore=0 bulkscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005040164 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9611 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 suspectscore=0 phishscore=0 clxscore=1015 bulkscore=0 mlxlogscore=999 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2005040163 Content-Transfer-Encoding: 8bit In order to probe and connect to the MptScsi device we need this protocol. Currently it does nothing. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2390 Signed-off-by: Nikita Leshenko Reviewed-by: Laszlo Ersek Reviewed-by: Liran Alon --- OvmfPkg/MptScsiDxe/MptScsi.c | 67 ++++++++++++++++++++++++++++++- OvmfPkg/MptScsiDxe/MptScsiDxe.inf | 1 + 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/MptScsiDxe/MptScsi.c b/OvmfPkg/MptScsiDxe/MptScsi.c index c6c8142dfde6..581d3909b84d 100644 --- a/OvmfPkg/MptScsiDxe/MptScsi.c +++ b/OvmfPkg/MptScsiDxe/MptScsi.c @@ -9,8 +9,66 @@ **/ +#include #include +// +// Higher versions will be used before lower, 0x10-0xffffffef is the version +// range for IVH (Indie Hardware Vendors) +// +#define MPT_SCSI_BINDING_VERSION 0x10 + +// +// Driver Binding +// + +STATIC +EFI_STATUS +EFIAPI +MptScsiControllerSupported ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL + ) +{ + return EFI_UNSUPPORTED; +} + +STATIC +EFI_STATUS +EFIAPI +MptScsiControllerStart ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL + ) +{ + return EFI_UNSUPPORTED; +} + +STATIC +EFI_STATUS +EFIAPI +MptScsiControllerStop ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN UINTN NumberOfChildren, + IN EFI_HANDLE *ChildHandleBuffer + ) +{ + return EFI_UNSUPPORTED; +} + +STATIC +EFI_DRIVER_BINDING_PROTOCOL mMptScsiDriverBinding = { + &MptScsiControllerSupported, + &MptScsiControllerStart, + &MptScsiControllerStop, + MPT_SCSI_BINDING_VERSION, + NULL, // ImageHandle, filled by EfiLibInstallDriverBindingComponentName2 + NULL, // DriverBindingHandle, filled as well +}; + // // Entry Point // @@ -22,5 +80,12 @@ MptScsiEntryPoint ( IN EFI_SYSTEM_TABLE *SystemTable ) { - return EFI_UNSUPPORTED; + return EfiLibInstallDriverBindingComponentName2 ( + ImageHandle, + SystemTable, + &mMptScsiDriverBinding, + ImageHandle, // The handle to install onto + NULL, // TODO Component name + NULL // TODO Component name + ); } diff --git a/OvmfPkg/MptScsiDxe/MptScsiDxe.inf b/OvmfPkg/MptScsiDxe/MptScsiDxe.inf index b4006a7c2d97..53585068684f 100644 --- a/OvmfPkg/MptScsiDxe/MptScsiDxe.inf +++ b/OvmfPkg/MptScsiDxe/MptScsiDxe.inf @@ -24,3 +24,4 @@ [Packages] [LibraryClasses] UefiDriverEntryPoint + UefiLib -- 2.20.1