From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by mx.groups.io with SMTP id smtpd.web12.3726.1585049043996221451 for ; Tue, 24 Mar 2020 04:24:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NwGSJIMi; spf=pass (domain: redhat.com, ip: 216.205.24.74, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585049043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s7GCPqanks2PHYVIsdAwxIt8drPvSuEwOjwoSgzLaj0=; b=NwGSJIMiIVNbhtVdLqTH+JNMKFvQtHmh8JxzgcMKsR+rvBeAdsVIAw9XLj/jADOrARdFjR b8Dfcb9jCdSue77XiM7QzGNouC9odjHjkEqNHa8PZ51AmguCnSIprIgaN8XKqyHg/5xW1e WMpDD7sdLHgJYHcG8AxMxaDMCPQhP/U= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-387-2C3UsM_kOL6yifll7euTYQ-1; Tue, 24 Mar 2020 07:23:59 -0400 X-MC-Unique: 2C3UsM_kOL6yifll7euTYQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AB2C619057AA; Tue, 24 Mar 2020 11:23:57 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-115-139.ams2.redhat.com [10.36.115.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 49B24194BB; Tue, 24 Mar 2020 11:23:56 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 02/17] OvmfPkg/PvScsiDxe: Install DriverBinding protocol To: devel@edk2.groups.io, liran.alon@oracle.com Cc: nikita.leshchenko@oracle.com, aaron.young@oracle.com, jordan.l.justen@intel.com, ard.biesheuvel@linaro.org References: <20200316150113.104630-1-liran.alon@oracle.com> <20200316150113.104630-3-liran.alon@oracle.com> From: "Laszlo Ersek" Message-ID: Date: Tue, 24 Mar 2020 12:23:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200316150113.104630-3-liran.alon@oracle.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 03/16/20 16:00, Liran Alon wrote: > 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: Nikita Leshenko > Signed-off-by: Liran Alon > --- > OvmfPkg/PvScsiDxe/PvScsi.c | 68 +++++++++++++++++++++++++++++++++++- > OvmfPkg/PvScsiDxe/PvScsi.inf | 1 + > 2 files changed, 68 insertions(+), 1 deletion(-) > > diff --git a/OvmfPkg/PvScsiDxe/PvScsi.c b/OvmfPkg/PvScsiDxe/PvScsi.c > index a3f704d60d77..bf0c743bad15 100644 > --- a/OvmfPkg/PvScsiDxe/PvScsi.c > +++ b/OvmfPkg/PvScsiDxe/PvScsi.c > @@ -9,6 +9,65 @@ > > **/ > > +#include > + > +// > +// Higher versions will be used before lower, 0x10-0xffffffef is the version > +// range for IVH (Indie Hardware Vendors) (1) typo: s/IVH/IHV/ > +// > +#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 = { (2) For object declarations, we generally keep STATIC on the same line as the type name. > + &PvScsiDriverBindingSupported, > + &PvScsiDriverBindingStart, > + &PvScsiDriverBindingStop, > + PVSCSI_BINDING_VERSION, > + NULL, // ImageHandle, filled by EfiLibInstallDriverBindingComponentName2() > + NULL // DriverBindingHandle, filled as well > +}; > + > // > // Entry Point > // > @@ -20,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/PvScsi.inf b/OvmfPkg/PvScsiDxe/PvScsi.inf > index 093cc0171338..d1d0e963f96d 100644 > --- a/OvmfPkg/PvScsiDxe/PvScsi.inf > +++ b/OvmfPkg/PvScsiDxe/PvScsi.inf > @@ -25,3 +25,4 @@ > > [LibraryClasses] > UefiDriverEntryPoint > + UefiLib > With (1) and (2) addressed: Reviewed-by: Laszlo Ersek (Please strip Nikita's R-b in v2, or please ask Nikita to post the R-b in response to this v1 patch.) Thanks, Laszlo