From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7D443C433F5 for ; Thu, 6 Oct 2022 09:29:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D79718492C; Thu, 6 Oct 2022 11:29:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="iKSLdNzc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0EF5A84B73; Thu, 6 Oct 2022 11:29:50 +0200 (CEST) Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5276984512 for ; Thu, 6 Oct 2022 11:29:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ej1-x631.google.com with SMTP id b2so3242477eja.6 for ; Thu, 06 Oct 2022 02:29:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=K2QThTueoU3rKYo4wHhE6RcTPpSkfdaBCNzLBIzXoOE=; b=iKSLdNzciSoHPSy+KKUJVC9bDGXxp7o+grRKWxJSVp5NM1AFtB0pDO3+pGfNkf6LfE mmo9T5z6xqbMT5SCdWvypYSHtuTJ/6MahmkSBv1Gy9I51pUQ4HUhABA0WDxCE+Rr9SBF oQFvY0g6Qk65yGwyF5x36OrT+I63hwqRZKboY4B1FUxyWeCmqM+UizP1FfKePa6dQqxJ 3CT4zl/N94i+wY7cd38rDhszfgVfdqJOkwV9HroEsm+s+L4bKBht4NQpGdHBujypwB7J vE8D++Mr1s6vQBpLnug6gzGpXjDnPWmnHhTZyS2wgaiAtDO0nZfLCXPiI0osX+GLQGYl swrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=K2QThTueoU3rKYo4wHhE6RcTPpSkfdaBCNzLBIzXoOE=; b=djyQ8WxLZ+rv0x1Gu0U96ge2zL+APuc2Xu1Lav2SFuNieIGq87F0B+YE2wJkw08Uyh TqxS7UUNYSwbec/1v6aWWZL7uYbEBgmEKObjDUFN+ETzo3BsHVTj3gwa1qPGentn2lEM iaiskhlHFpOIP/Ay/fNVZIR2/rIH52KOqOoA5zwwhZmCw3MQSIqJJxWAZy01rA0qoism sQ7Kkev0eECb7bSXwfN1+nXLd2YZOUo+/5uQyHtKS+U8BFElP6wHHsNfu/QdP/THQUkS 0yXtZ4cAFRzM8cbJ/whmcqpsvXLpHxkzfB6U10FxAItxCpWxLihl4SCTKcbGiQ06IvZo xZVg== X-Gm-Message-State: ACrzQf3CZhJ9o6DDHlwAyTLQbGRS5qr1qSyEF5oSClvUeOmsce5DVXeX yWBHC1kbAArAtEvrNCAjbyqtMg== X-Google-Smtp-Source: AMsMyM46OGHAEx7OMfr5c0JPtPJscmXyWopK3GJrGB0i0IKBIUERgNr2+MPTHa+Y6OYXqANWDDX+TQ== X-Received: by 2002:a17:907:3f8b:b0:783:2008:e562 with SMTP id hr11-20020a1709073f8b00b007832008e562mr3200789ejc.261.1665048586871; Thu, 06 Oct 2022 02:29:46 -0700 (PDT) Received: from hades (ppp046103015185.access.hol.gr. [46.103.15.185]) by smtp.gmail.com with ESMTPSA id lu22-20020a170906fad600b0078b1bb98615sm2109377ejb.51.2022.10.06.02.29.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Oct 2022 02:29:46 -0700 (PDT) Date: Thu, 6 Oct 2022 12:29:44 +0300 From: Ilias Apalodimas To: Heinrich Schuchardt Cc: u-boot@lists.denx.de Subject: Re: [PATCH 1/1] efi_driver: provide driver binding protocol to bind function Message-ID: References: <20221004172102.169622-1-heinrich.schuchardt@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221004172102.169622-1-heinrich.schuchardt@canonical.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Hi Heinrich, On Tue, Oct 04, 2022 at 07:21:02PM +0200, Heinrich Schuchardt wrote: > DisconnectController() is based on the open protocol information created > when the driver opens a protocol with BY_CHILD_CONTROLLER or BY_DRIVER. > > To create an open protocol information it is required to supply the handle > of the driver as agent handle. This information is available as field > DriverBindingHandle in the driver binding protocol. > > Signed-off-by: Heinrich Schuchardt This doesn't seem to apply on current -master. Is there a patch that needs to be applied before that? Thanks /Ilias > --- > include/efi_driver.h | 29 +++++++++++++++-------------- > lib/efi_driver/efi_block_device.c | 5 ++++- > lib/efi_driver/efi_uclass.c | 2 +- > 3 files changed, 20 insertions(+), 16 deletions(-) > > diff --git a/include/efi_driver.h b/include/efi_driver.h > index de38abe83b..71e0d3194e 100644 > --- a/include/efi_driver.h > +++ b/include/efi_driver.h > @@ -10,6 +10,19 @@ > > #include > > +/** > + * struct efi_driver_binding_extended_protocol - extended driver binding protocol > + * > + * This structure adds internal fields to the driver binding protocol. > + * > + * @bp: driver binding protocol > + * @ops: operations supported by the driver > + */ > +struct efi_driver_binding_extended_protocol { > + struct efi_driver_binding_protocol bp; > + const struct efi_driver_ops *ops; > +}; > + > /** > * struct efi_driver_ops - operations support by an EFI driver > * > @@ -25,20 +38,8 @@ > struct efi_driver_ops { > const efi_guid_t *protocol; > const efi_guid_t *child_protocol; > - efi_status_t (*bind)(efi_handle_t handle, void *interface); > -}; > - > -/** > - * struct efi_driver_binding_extended_protocol - extended driver binding protocol > - * > - * This structure adds internal fields to the driver binding protocol. > - * > - * @bp: driver binding protocol > - * @ops: operations supported by the driver > - */ > -struct efi_driver_binding_extended_protocol { > - struct efi_driver_binding_protocol bp; > - const struct efi_driver_ops *ops; > + efi_status_t (*bind)(struct efi_driver_binding_extended_protocol *this, > + efi_handle_t handle, void *interface); > }; > > #endif /* _EFI_DRIVER_H */ > diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c > index e9eabbde58..f440067f70 100644 > --- a/lib/efi_driver/efi_block_device.c > +++ b/lib/efi_driver/efi_block_device.c > @@ -174,11 +174,14 @@ err: > /** > * efi_bl_bind() - bind to a block io protocol > * > + * @this: driver binding protocol > * @handle: handle > * @interface: block io protocol > * Return: status code > */ > -static efi_status_t efi_bl_bind(efi_handle_t handle, void *interface) > +static efi_status_t efi_bl_bind( > + struct efi_driver_binding_extended_protocol *this, > + efi_handle_t handle, void *interface) > { > efi_status_t ret = EFI_SUCCESS; > struct efi_object *obj = efi_search_obj(handle); > diff --git a/lib/efi_driver/efi_uclass.c b/lib/efi_driver/efi_uclass.c > index aabee0e260..0a16c594e3 100644 > --- a/lib/efi_driver/efi_uclass.c > +++ b/lib/efi_driver/efi_uclass.c > @@ -146,7 +146,7 @@ static efi_status_t EFIAPI efi_uc_start( > ret = check_node_type(controller_handle); > if (ret != EFI_SUCCESS) > goto err; > - ret = bp->ops->bind(controller_handle, interface); > + ret = bp->ops->bind(bp, controller_handle, interface); > if (ret == EFI_SUCCESS) > goto out; > > -- > 2.37.2 >