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