From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=156.151.31.86; helo=userp2130.oracle.com; envelope-from=nikita.leshchenko@oracle.com; receiver=edk2-devel@lists.01.org Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 12D07211C3859 for ; Thu, 31 Jan 2019 02:08:05 -0800 (PST) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x0VA4VwB013174 for ; Thu, 31 Jan 2019 10:08:04 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-2018-07-02; bh=rDbAiwfPB6eLgUeoMF6IWuD3NpEOR5UiiPMrxaQNhxU=; b=XqqK9mYo927it/boQ2fr0r0y3nhXFp4sFx7ybHIEGOm59tFmhnZsatJt06TFLJb+7fk9 hMjFdDau9Gdsdrq9zlCd1yN5EW5TWF6wVaBHXLmzQtQPFLL3KpYvtmGRWzcRG8Ktg2c/ UXKnIhz+b9wN0YEEUpsr1eSDS25tPgkyjtidmYsqvzQlxXXbsbpT+ARK/1njmWxWVYE9 DVCskREga1zj7nwsliyMjDKoWJu7nC9DFdd5xL1gxmbz4mtTulBmmB5D+iWhG5wVva1X 7G2m8vlTw0xfGL3B4Gik6ytcDdrd1sH2JuB3XgI0P/hHkmRJoIhwDMpJYRWeucAqHB6l Tg== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2q8eyuqn5s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 31 Jan 2019 10:08:04 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x0VA835n004367 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 31 Jan 2019 10:08:03 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x0VA83KA002699 for ; Thu, 31 Jan 2019 10:08:03 GMT Received: from spark.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 31 Jan 2019 02:08:03 -0800 From: Nikita Leshenko To: edk2-devel@lists.01.org Cc: liran.alon@oracle.com, Nikita Leshenko Date: Thu, 31 Jan 2019 12:07:12 +0200 Message-Id: <20190131100724.20907-3-nikita.leshchenko@oracle.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190131100724.20907-1-nikita.leshchenko@oracle.com> References: <20190131100724.20907-1-nikita.leshchenko@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9152 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=621 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901310080 Subject: [PATCH 02/14] OvmfPkg/MptScsiDxe: Install DriverBinding Protocol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 10:08:05 -0000 Content-Transfer-Encoding: 8bit In order to probe and connect to the MptScsi device we need this protocol. Currently it does nothing. 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 | 65 ++++++++++++++++++++++++++++++- OvmfPkg/MptScsiDxe/MptScsiDxe.inf | 1 + 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/MptScsiDxe/MptScsi.c b/OvmfPkg/MptScsiDxe/MptScsi.c index 73a693741d..4dcb1b1ae5 100644 --- a/OvmfPkg/MptScsiDxe/MptScsi.c +++ b/OvmfPkg/MptScsiDxe/MptScsi.c @@ -15,6 +15,62 @@ **/ +#include + +// +// 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; +} + +// Higher versions will be used before lower, 0x10-0xffffffef is the version +// range for IVH (Indie Hardware Vendors) +#define MPT_SCSI_BINDING_VERSION 0x10 +STATIC +EFI_DRIVER_BINDING_PROTOCOL gMptScsiDriverBinding = { + &MptScsiControllerSupported, + &MptScsiControllerStart, + &MptScsiControllerStop, + MPT_SCSI_BINDING_VERSION, + NULL, // ImageHandle filled by EfiLibInstallDriverBindingComponentName2 + NULL, // DriverBindingHandle filled by EfiLibInstallDriverBindingComponentName2 +}; + // // Entry Point // @@ -26,5 +82,12 @@ MptScsiEntryPoint ( IN EFI_SYSTEM_TABLE *SystemTable ) { - return EFI_UNSUPPORTED; + return EfiLibInstallDriverBindingComponentName2 ( + ImageHandle, + SystemTable, + &gMptScsiDriverBinding, + 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 c558d78034..8a780a661e 100644 --- a/OvmfPkg/MptScsiDxe/MptScsiDxe.inf +++ b/OvmfPkg/MptScsiDxe/MptScsiDxe.inf @@ -31,3 +31,4 @@ [LibraryClasses] UefiDriverEntryPoint + UefiLib -- 2.20.1