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 3644FC433F5 for ; Thu, 6 Oct 2022 10:57:10 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4259884BAA; Thu, 6 Oct 2022 12:57:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com 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=canonical.com header.i=@canonical.com header.b="hq3hb6NE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0F3FD84BAA; Thu, 6 Oct 2022 12:57:06 +0200 (CEST) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 34B8184A35 for ; Thu, 6 Oct 2022 12:57:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id C13633F337 for ; Thu, 6 Oct 2022 10:56:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1665053819; bh=EGtcXR962C9jTuE1YwxTSGTbcP3/62YpegNOM+LzP3Q=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hq3hb6NEfodwyAMdavHDFVce/tKfwh215d57LVBEvu1xtUm9yw6jervuYl5nFPY0R Vq/eteFiDubpXBiIdDcBchpGBCTgI7/mHB/0AN4IpVgsgpgNx2tdzVhp1sYso0YND0 jWTTgKzjN+9Z8T8J/hAa51i0VIJVc71E7H23bAsDja1QQnrEosw1nhnNiarEJ3Rd4m vdy9ScYBkratwLdXOu3KmI1Haz0Mric2JG76ZydXP3cBsUzYcvBz2TEf8C9KqMn2XJ X8ec+WVgnbdCO9LA0RzuGQYZBrF+elTEbRz5OYccdpk/pBm3ACXVdvCv/8fg5TMcnS TLQbuS+wxhqLg== Received: by mail-ej1-f69.google.com with SMTP id sa15-20020a1709076d0f00b00781d793f51fso950059ejc.18 for ; Thu, 06 Oct 2022 03:56:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=EGtcXR962C9jTuE1YwxTSGTbcP3/62YpegNOM+LzP3Q=; b=5GVz67wgshKsSAjvcJNjPqPYwzf6guFM3JqDlBQoMOQRXhtzjHZ4IdpbcKxVMRY3NT MXrx60DsjMdUXQCJ7eHZkbLf8a3dKOIRhPIE6wOq5urU4biX6d0vBcemyyC6R9KtUh1r NFnyo/ZF7AyX/x9x0XNMmg4iplyyQhX3z/ocFeYjLlntZrEgttYuGdzIabqOa+7QJORJ ZOaqfmwTahAjA2gEZkBRftR0a7jRVbZdc0Pi0PzhTKgmdx/oIeDJu2lu/Z+txIh6F/xB F/VTIkOqY5HjbpAldWEulq9c8u5kUPxH6FexsR7O+OJdNWSlq1+bJz84e65MFFuu/8us axnQ== X-Gm-Message-State: ACrzQf1oIUogtMW4qhFS+WRwPEF/T1Y/htHInhYi7gBwZNhX04kT7mBB zdyvYu/b/Rs+mqpmXOzy8OV8JaFzJWKjT9sGQuPQGUd467er3D20WpfaiZRIraF9Ik0IxLgIhE2 j+/ezMse8zBqCTkogYW7DeAKeUoKxK2w= X-Received: by 2002:a17:906:730f:b0:783:27c5:f65f with SMTP id di15-20020a170906730f00b0078327c5f65fmr3624994ejc.142.1665053819412; Thu, 06 Oct 2022 03:56:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4JtMCNpyfGUbYoTSTwfgRhsrgUNwzosabD2TU8JkGg/llcfyJ7ZAHwSiUT/LTNfAiOvktThA== X-Received: by 2002:a17:906:730f:b0:783:27c5:f65f with SMTP id di15-20020a170906730f00b0078327c5f65fmr3624976ejc.142.1665053819094; Thu, 06 Oct 2022 03:56:59 -0700 (PDT) Received: from [192.168.123.94] (ip-084-118-157-002.um23.pools.vodafone-ip.de. [84.118.157.2]) by smtp.gmail.com with ESMTPSA id i15-20020a170906444f00b0073c0b87ba34sm10071340ejp.198.2022.10.06.03.56.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Oct 2022 03:56:58 -0700 (PDT) Message-ID: Date: Thu, 6 Oct 2022 12:56:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH 1/1] efi_driver: provide driver binding protocol to bind function Content-Language: en-US To: Ilias Apalodimas Cc: u-boot@lists.denx.de References: <20221004172102.169622-1-heinrich.schuchardt@canonical.com> From: Heinrich Schuchardt In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 10/6/22 11:29, Ilias Apalodimas wrote: > 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? I guess you miss: efi_driver: reformat efi_block_device.c Cf. https://source.denx.de/u-boot/custodians/u-boot-efi/-/commits/efi-2023-01 Best regards Heinrich > > 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 >>