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