blob: 71e0d3194ea82a7bcf0d5c35b32b8fed9ca46f98 [file] [log] [blame]
Tom Rinif739fcd2018-05-07 17:02:21 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Heinrich Schuchardt05ef48a2018-01-21 19:29:30 +01002/*
Heinrich Schuchardtdf31fed2022-10-04 18:28:24 +02003 * Internal structures for the EFI driver binding protocol
Heinrich Schuchardt05ef48a2018-01-21 19:29:30 +01004 *
5 * Copyright (c) 2017 Heinrich Schuchardt
Heinrich Schuchardt05ef48a2018-01-21 19:29:30 +01006 */
7
8#ifndef _EFI_DRIVER_H
9#define _EFI_DRIVER_H 1
10
Heinrich Schuchardt05ef48a2018-01-21 19:29:30 +010011#include <efi_loader.h>
12
Heinrich Schuchardtdf31fed2022-10-04 18:28:24 +020013/**
Heinrich Schuchardtec4f6752022-10-04 19:12:59 +020014 * 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 */
21struct efi_driver_binding_extended_protocol {
22 struct efi_driver_binding_protocol bp;
23 const struct efi_driver_ops *ops;
24};
25
26/**
Heinrich Schuchardtdf31fed2022-10-04 18:28:24 +020027 * struct efi_driver_ops - operations support by an EFI driver
Heinrich Schuchardt0850d7f2018-02-12 12:55:28 +010028 *
Heinrich Schuchardtdf31fed2022-10-04 18:28:24 +020029 * @protocol: The GUID of the protocol which is consumed by the
Heinrich Schuchardt0850d7f2018-02-12 12:55:28 +010030 * driver. This GUID is used by the EFI uclass in the
31 * supports() and start() methods of the
32 * EFI_DRIVER_BINDING_PROTOCOL.
Heinrich Schuchardtdf31fed2022-10-04 18:28:24 +020033 * @child_protocol: Protocol supported by the child handles generated by
Heinrich Schuchardt0850d7f2018-02-12 12:55:28 +010034 * the EFI driver.
Heinrich Schuchardtdf31fed2022-10-04 18:28:24 +020035 * @bind: Function called by the EFI uclass to attach the
Heinrich Schuchardt0850d7f2018-02-12 12:55:28 +010036 * driver to EFI driver to a handle.
37 */
Heinrich Schuchardt05ef48a2018-01-21 19:29:30 +010038struct efi_driver_ops {
39 const efi_guid_t *protocol;
40 const efi_guid_t *child_protocol;
Heinrich Schuchardtec4f6752022-10-04 19:12:59 +020041 efi_status_t (*bind)(struct efi_driver_binding_extended_protocol *this,
42 efi_handle_t handle, void *interface);
Heinrich Schuchardt05ef48a2018-01-21 19:29:30 +010043};
44
45#endif /* _EFI_DRIVER_H */