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.web10.719.1586885736895506425 for ; Tue, 14 Apr 2020 10:35:37 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=jSrnb7JC; 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 03EHAfFg141189; Tue, 14 Apr 2020 17:35:33 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=jSrnb7JCMFlfVEMIuQS4xKANL2xvwuzxbQa9DsqxdX4aGWGWrp5yYW+lm6aQx6+kiLDP 68iBjT1if9eoyZuXSCOx/v0WNgntFIDTD8CYGGzeBy0AlYAUMJ6jN5e0m1856Nlw0+tE o0pZ3YkOyhA5ma51xcW3zYjElyJ59AFiA8tNL/9f291251WHPbwZq/4UvabeyHYBJm1l VOW3xm6OSk+RGn1RbY0RABsF9ZCrDTRts5UkFeYhQzkUca25Od8bn6Bd/Dg4u6jMC2Un fwnbT8efnZJyJG/mlbeh7HhBefFUMPV9uCaTyDdevSu5/e8rJ84Avga9p/lzAuFig0ic 0A== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 30b5ar68p9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Apr 2020 17:35:33 +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 03EH7ro3011980; Tue, 14 Apr 2020 17:35:33 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3030.oracle.com with ESMTP id 30bqcjamkd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Apr 2020 17:35:33 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 03EHZWnt030657; Tue, 14 Apr 2020 17:35:32 GMT Received: from spark.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 14 Apr 2020 10:35:31 -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 v4 02/13] OvmfPkg/MptScsiDxe: Install DriverBinding Protocol Date: Tue, 14 Apr 2020 20:38:02 +0300 Message-Id: <20200414173813.7715-3-nikita.leshchenko@oracle.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200414173813.7715-1-nikita.leshchenko@oracle.com> References: <20200414173813.7715-1-nikita.leshchenko@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9591 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=991 bulkscore=0 malwarescore=0 phishscore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004140131 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9591 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 phishscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004140131 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