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 | /* |
Heinrich Schuchardt | b5aeef7 | 2022-10-04 18:28:24 +0200 | [diff] [blame] | 3 | * Internal structures for the EFI driver binding protocol |
Heinrich Schuchardt | 11206f4 | 2018-01-21 19:29:30 +0100 | [diff] [blame] | 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 | b5aeef7 | 2022-10-04 18:28:24 +0200 | [diff] [blame] | 13 | /** |
Heinrich Schuchardt | ff1d50b | 2022-10-04 19:12:59 +0200 | [diff] [blame] | 14 | * struct efi_driver_binding_extended_protocol - extended driver binding protocol |
| 15 | * |
| 16 | * This structure adds internal fields to the driver binding protocol. |
| 17 | * |
| 18 | * @bp: driver binding protocol |
| 19 | * @ops: operations supported by the driver |
| 20 | */ |
| 21 | struct efi_driver_binding_extended_protocol { |
| 22 | struct efi_driver_binding_protocol bp; |
| 23 | const struct efi_driver_ops *ops; |
| 24 | }; |
| 25 | |
| 26 | /** |
Heinrich Schuchardt | b5aeef7 | 2022-10-04 18:28:24 +0200 | [diff] [blame] | 27 | * struct efi_driver_ops - operations support by an EFI driver |
Heinrich Schuchardt | 77a8fbf | 2018-02-12 12:55:28 +0100 | [diff] [blame] | 28 | * |
Heinrich Schuchardt | b5aeef7 | 2022-10-04 18:28:24 +0200 | [diff] [blame] | 29 | * @protocol: The GUID of the protocol which is consumed by the |
Heinrich Schuchardt | 77a8fbf | 2018-02-12 12:55:28 +0100 | [diff] [blame] | 30 | * driver. This GUID is used by the EFI uclass in the |
| 31 | * supports() and start() methods of the |
| 32 | * EFI_DRIVER_BINDING_PROTOCOL. |
Heinrich Schuchardt | b5aeef7 | 2022-10-04 18:28:24 +0200 | [diff] [blame] | 33 | * @child_protocol: Protocol supported by the child handles generated by |
Heinrich Schuchardt | 77a8fbf | 2018-02-12 12:55:28 +0100 | [diff] [blame] | 34 | * the EFI driver. |
Heinrich Schuchardt | 6c5fd21 | 2022-10-05 11:28:47 +0200 | [diff] [blame] | 35 | * @init: Function called by the EFI uclass after installing the |
| 36 | * driver binding protocol. |
Heinrich Schuchardt | b5aeef7 | 2022-10-04 18:28:24 +0200 | [diff] [blame] | 37 | * @bind: Function called by the EFI uclass to attach the |
Heinrich Schuchardt | 77a8fbf | 2018-02-12 12:55:28 +0100 | [diff] [blame] | 38 | * driver to EFI driver to a handle. |
| 39 | */ |
Heinrich Schuchardt | 11206f4 | 2018-01-21 19:29:30 +0100 | [diff] [blame] | 40 | struct efi_driver_ops { |
| 41 | const efi_guid_t *protocol; |
| 42 | const efi_guid_t *child_protocol; |
Heinrich Schuchardt | 6c5fd21 | 2022-10-05 11:28:47 +0200 | [diff] [blame] | 43 | efi_status_t (*init)(struct efi_driver_binding_extended_protocol *this); |
Heinrich Schuchardt | ff1d50b | 2022-10-04 19:12:59 +0200 | [diff] [blame] | 44 | efi_status_t (*bind)(struct efi_driver_binding_extended_protocol *this, |
| 45 | efi_handle_t handle, void *interface); |
Heinrich Schuchardt | 11206f4 | 2018-01-21 19:29:30 +0100 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | #endif /* _EFI_DRIVER_H */ |