[U-Boot] [PATCH v4 3/9] efi_driver: add name to driver binding protocol

AKASHI Takahiro takahiro.akashi at linaro.org
Thu Jan 17 05:33:16 UTC 2019


You raised a couple of questions to me.

On Tue, Jan 15, 2019 at 04:41:08AM +0100, Heinrich Schuchardt wrote:
> On 1/15/19 3:55 AM, AKASHI Takahiro wrote:
> > This new field will be shown as a driver's name in "efitool drivers"
> > command.
> 
> We can have drivers supplied by U-Boot

I assume that what you mention here is a UCLASS_EFI driver.

What's the problem is;
efi_add_driver() adds EFI_DRIVER_BINDING_PROTOCOL with
*efi_driver_binding_extended_protocol* interface, which is NOT compatible
with EFI_DRIVER_BINDING_PROTOCOL.
On the other hand, for example, in your efi_selftest_controller test
a test driver is set up by installing EFI_DRIVER_BINDING_PROTOCOL
with EFI_DRIVER_BINDING_PROTOCOL interface.

So we have no way to distinguish the two cases(handles) and cannot
deal with them properly.

> and drivers supplied by an EFI
> binary that we recently installed via the bootefi command.
> 
> A driver installed via the bootefi command will not have allocated
> memory for the extra fields.

There is no good example of driver of such kind.
I don't know how we can retrieve a meaningful "driver name."

> So you cannot use the name field in your "efitool drivers" command.

Any suggestion?

Thanks,
-Takahiro Akashi

> 
> Best regards
> 
> Heinrich
> 
> > 
> > Signed-off-by: AKASHI Takahiro <takahiro.akashi at linaro.org>
> > ---
> >  include/efi_driver.h        | 1 +
> >  lib/efi_driver/efi_uclass.c | 1 +
> >  2 files changed, 2 insertions(+)
> > 
> > diff --git a/include/efi_driver.h b/include/efi_driver.h
> > index 840483a416a4..ee8867816094 100644
> > --- a/include/efi_driver.h
> > +++ b/include/efi_driver.h
> > @@ -34,6 +34,7 @@ struct efi_driver_ops {
> >   * This structure adds internal fields to the driver binding protocol.
> >   */
> >  struct efi_driver_binding_extended_protocol {
> > +	const char *name;
> >  	struct efi_driver_binding_protocol bp;
> >  	const struct efi_driver_ops *ops;
> >  };
> > diff --git a/lib/efi_driver/efi_uclass.c b/lib/efi_driver/efi_uclass.c
> > index bb86ffd399c3..8bbaa02d490e 100644
> > --- a/lib/efi_driver/efi_uclass.c
> > +++ b/lib/efi_driver/efi_uclass.c
> > @@ -271,6 +271,7 @@ static efi_status_t efi_add_driver(struct driver *drv)
> >  	bp->bp.stop = efi_uc_stop;
> >  	bp->bp.version = 0xffffffff;
> >  	bp->ops = drv->ops;
> > +	bp->name = drv->name;
> >  
> >  	ret = efi_create_handle(&bp->bp.driver_binding_handle);
> >  	if (ret != EFI_SUCCESS) {
> > 
> 


More information about the U-Boot mailing list