Tom Rini | f739fcd | 2018-05-07 17:02:21 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Heinrich Schuchardt | 05ef48a | 2018-01-21 19:29:30 +0100 | [diff] [blame] | 2 | /* |
| 3 | * EFI application loader |
| 4 | * |
| 5 | * Copyright (c) 2017 Heinrich Schuchardt |
Heinrich Schuchardt | 05ef48a | 2018-01-21 19:29:30 +0100 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef _EFI_DRIVER_H |
| 9 | #define _EFI_DRIVER_H 1 |
| 10 | |
| 11 | #include <common.h> |
| 12 | #include <dm.h> |
| 13 | #include <efi_loader.h> |
| 14 | |
Heinrich Schuchardt | 0850d7f | 2018-02-12 12:55:28 +0100 | [diff] [blame] | 15 | /* |
| 16 | * Operations supported by an EFI driver with respect to the EFI uclass |
| 17 | * |
| 18 | * @protocol The GUID of the protocol which is consumed by the |
| 19 | * driver. This GUID is used by the EFI uclass in the |
| 20 | * supports() and start() methods of the |
| 21 | * EFI_DRIVER_BINDING_PROTOCOL. |
| 22 | * @child_protocol Protocol supported by the child handles generated by |
| 23 | * the EFI driver. |
| 24 | * @bind Function called by the EFI uclass to attach the |
| 25 | * driver to EFI driver to a handle. |
| 26 | */ |
Heinrich Schuchardt | 05ef48a | 2018-01-21 19:29:30 +0100 | [diff] [blame] | 27 | struct efi_driver_ops { |
| 28 | const efi_guid_t *protocol; |
| 29 | const efi_guid_t *child_protocol; |
| 30 | int (*bind)(efi_handle_t handle, void *interface); |
| 31 | }; |
| 32 | |
| 33 | /* |
| 34 | * This structure adds internal fields to the driver binding protocol. |
| 35 | */ |
| 36 | struct efi_driver_binding_extended_protocol { |
| 37 | struct efi_driver_binding_protocol bp; |
| 38 | const struct efi_driver_ops *ops; |
| 39 | }; |
| 40 | |
| 41 | #endif /* _EFI_DRIVER_H */ |