From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by mx.groups.io with SMTP id smtpd.web10.14112.1585425518501725114 for ; Sat, 28 Mar 2020 12:58:38 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=eq0v+1mm; spf=pass (domain: oracle.com, ip: 156.151.31.85, mailfrom: liran.alon@oracle.com) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 02SJmQhi032615; Sat, 28 Mar 2020 19:58:38 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=Yd2F9w0LClGHWkVNcn+52UVPlR5DUxzC6kMUgNkLL+o=; b=eq0v+1mmW3gOQvJe7raH7WQhBsT+yE7BKP/gGIPz3FWqc/+qvAE3XDfz7WPrfOxdoO/S rGOOoRgvIU2YqW+g7q2zsftZ0dUutMDCA/VoLhbH6WIdQdUq6TiiGXhGHkZNELJhOFwb VcP5ktGstgYjUvhIMjA3ebcy1HSv1mM/g6adBhorqlD1wtUYTHhmP0bp+dafgaHKFQBn kqz2wooZjTWoDZ+fByvt+nbCs7B3mEwxy435A3TtGgBz/mCmiHyVtfwh+AXOSp0KY1Kj QkIOYy9Bj3PA7JaL77ProMMGcc3BHeTjtnLir9WkEVtfYY1mIwB5jXAWnb+l7G1sTZNk zw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 301y7mhf80-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 28 Mar 2020 19:58:37 +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 02SJontT164696; Sat, 28 Mar 2020 19:58:37 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 301ups6h1q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 28 Mar 2020 19:58:37 +0000 Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 02SJwaUt024961; Sat, 28 Mar 2020 19:58:36 GMT Received: from spark.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 28 Mar 2020 12:58:36 -0700 From: "Liran Alon" To: devel@edk2.groups.io, lersek@redhat.com Cc: nikita.leshchenko@oracle.com, aaron.young@oracle.com, jordan.l.justen@intel.com, ard.biesheuvel@linaro.org, Liran Alon Subject: [PATCH v3 02/17] OvmfPkg/PvScsiDxe: Install DriverBinding protocol Date: Sat, 28 Mar 2020 23:00:45 +0300 Message-Id: <20200328200100.60786-3-liran.alon@oracle.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200328200100.60786-1-liran.alon@oracle.com> References: <20200328200100.60786-1-liran.alon@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9574 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 adultscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003280189 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9574 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 phishscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 lowpriorityscore=0 adultscore=0 priorityscore=1501 bulkscore=0 clxscore=1015 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003280189 Content-Transfer-Encoding: 8bit In order to probe and connect to the PvScsi device we need this protocol. Currently it does nothing. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 Reviewed-by: Laszlo Ersek Signed-off-by: Liran Alon --- OvmfPkg/PvScsiDxe/PvScsi.c | 66 ++++++++++++++++++++++++++++++++- OvmfPkg/PvScsiDxe/PvScsiDxe.inf | 1 + 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/PvScsiDxe/PvScsi.c b/OvmfPkg/PvScsiDxe/PvScsi.c index 1ae4de9869c1..77b28b326784 100644 --- a/OvmfPkg/PvScsiDxe/PvScsi.c +++ b/OvmfPkg/PvScsiDxe/PvScsi.c @@ -9,8 +9,65 @@ **/ +#include #include +// +// Higher versions will be used before lower, 0x10-0xffffffef is the version +// range for IHV (Indie Hardware Vendors) +// +#define PVSCSI_BINDING_VERSION 0x10 + +// +// Driver Binding +// + +STATIC +EFI_STATUS +EFIAPI +PvScsiDriverBindingSupported ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL + ) +{ + return EFI_UNSUPPORTED; +} + +STATIC +EFI_STATUS +EFIAPI +PvScsiDriverBindingStart ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL + ) +{ + return EFI_UNSUPPORTED; +} + +STATIC +EFI_STATUS +EFIAPI +PvScsiDriverBindingStop ( + 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 mPvScsiDriverBinding = { + &PvScsiDriverBindingSupported, + &PvScsiDriverBindingStart, + &PvScsiDriverBindingStop, + PVSCSI_BINDING_VERSION, + NULL, // ImageHandle, filled by EfiLibInstallDriverBindingComponentName2() + NULL // DriverBindingHandle, filled as well +}; + // // Entry Point // @@ -22,5 +79,12 @@ PvScsiEntryPoint ( IN EFI_SYSTEM_TABLE *SystemTable ) { - return EFI_UNSUPPORTED; + return EfiLibInstallDriverBindingComponentName2 ( + ImageHandle, + SystemTable, + &mPvScsiDriverBinding, + ImageHandle, + NULL, // TODO Component name + NULL // TODO Component name + ); } diff --git a/OvmfPkg/PvScsiDxe/PvScsiDxe.inf b/OvmfPkg/PvScsiDxe/PvScsiDxe.inf index 093cc0171338..d1d0e963f96d 100644 --- a/OvmfPkg/PvScsiDxe/PvScsiDxe.inf +++ b/OvmfPkg/PvScsiDxe/PvScsiDxe.inf @@ -25,3 +25,4 @@ [LibraryClasses] UefiDriverEntryPoint + UefiLib -- 2.20.1