From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by mx.groups.io with SMTP id smtpd.web11.10818.1582735227679045174 for ; Wed, 26 Feb 2020 08:40:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=xEelkFH6; spf=pass (domain: oracle.com, ip: 156.151.31.86, mailfrom: nikita.leshchenko@oracle.com) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01QGNUXv078419; Wed, 26 Feb 2020 16:40:26 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=Zdy5F5dc66yYcx33k9t+ISHFJ5RHZ6UZHXmeGfuRwKA=; b=xEelkFH6hxl1Qp34QrfghWwaAk1T9Dry3b7zHIMTiOasEkxktnrAkryC/UoMCOmwTQkz +POoyNdPMoebY/8O9JZdNx1PC3wiUsn0F2mnC4rlSH4M7Bo/toquVSFLmTavQUKXMwGT vTyCCavKXtVJE5sou3CR1uGbrRTe8gnO06BUOj4XcMP6lsGQdtXSYR7Q2FXaXUTzg6qi up8AEt/Wr+aXusM4rVguqwRo94s8Es8SfrX4YcoRWEulJ16DaatxDva3x4cUnt2Lz5vD BBj+XIp4G7AiqbVIDTWRT5hNd9nQO8CimIMxaIImWdGf9p3fN849gqxJSnp+s4ysvQj/ Yw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2ydcsncvte-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Feb 2020 16:40:26 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01QGMEMx164854; Wed, 26 Feb 2020 16:40:26 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3030.oracle.com with ESMTP id 2ydcs2hmdf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 26 Feb 2020 16:40:26 +0000 Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 01QGePME012978; Wed, 26 Feb 2020 16:40:25 GMT Received: from spark.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 26 Feb 2020 08:40:24 -0800 From: "Nikita Leshenko" To: devel@edk2.groups.io Cc: liran.alon@oracle.com, aaron.young@oracle.com, jordan.l.justen@intel.com, lersek@redhat.com, ard.biesheuvel@linaro.org, Nikita Leshenko Subject: [PATCH v2 02/13] OvmfPkg/MptScsiDxe: Install DriverBinding Protocol Date: Wed, 26 Feb 2020 18:41:40 +0200 Message-Id: <20200226164151.125182-3-nikita.leshchenko@oracle.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200226164151.125182-1-nikita.leshchenko@oracle.com> References: <20200226164151.125182-1-nikita.leshchenko@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9543 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 phishscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002260112 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9543 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 mlxlogscore=999 phishscore=0 spamscore=0 adultscore=0 suspectscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002260112 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 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Nikita Leshenko Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Aaron Young Reviewed-by: Liran Alon --- OvmfPkg/MptScsiDxe/MptScsi.c | 68 ++++++++++++++++++++++++++++++- OvmfPkg/MptScsiDxe/MptScsiDxe.inf | 1 + 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/MptScsiDxe/MptScsi.c b/OvmfPkg/MptScsiDxe/MptScsi.c index 9e0dd449d9..82d8add3a9 100644 --- a/OvmfPkg/MptScsiDxe/MptScsi.c +++ b/OvmfPkg/MptScsiDxe/MptScsi.c @@ -15,6 +15,65 @@ **/ +#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 // @@ -26,5 +85,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 bf1e0bff82..4b1a23c33a 100644 --- a/OvmfPkg/MptScsiDxe/MptScsiDxe.inf +++ b/OvmfPkg/MptScsiDxe/MptScsiDxe.inf @@ -30,3 +30,4 @@ [LibraryClasses] UefiDriverEntryPoint + UefiLib -- 2.20.1