blob: 63a95e4cf800033388057aae44ce4fc7890c1c4f [file] [log] [blame]
Tom Rini70df9d62018-05-07 17:02:21 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Heinrich Schuchardt11206f42018-01-21 19:29:30 +01002/*
Heinrich Schuchardtb5aeef72022-10-04 18:28:24 +02003 * Internal structures for the EFI driver binding protocol
Heinrich Schuchardt11206f42018-01-21 19:29:30 +01004 *
5 * Copyright (c) 2017 Heinrich Schuchardt
Heinrich Schuchardt11206f42018-01-21 19:29:30 +01006 */
7
8#ifndef _EFI_DRIVER_H
9#define _EFI_DRIVER_H 1
10
Heinrich Schuchardt11206f42018-01-21 19:29:30 +010011#include <efi_loader.h>
12
Heinrich Schuchardtb5aeef72022-10-04 18:28:24 +020013/**
Heinrich Schuchardtff1d50b2022-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 Schuchardtb5aeef72022-10-04 18:28:24 +020027 * struct efi_driver_ops - operations support by an EFI driver
Heinrich Schuchardt77a8fbf2018-02-12 12:55:28 +010028 *
Heinrich Schuchardtb5aeef72022-10-04 18:28:24 +020029 * @protocol: The GUID of the protocol which is consumed by the
Heinrich Schuchardt77a8fbf2018-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 Schuchardtb5aeef72022-10-04 18:28:24 +020033 * @child_protocol: Protocol supported by the child handles generated by
Heinrich Schuchardt77a8fbf2018-02-12 12:55:28 +010034 * the EFI driver.
Heinrich Schuchardt6c5fd212022-10-05 11:28:47 +020035 * @init: Function called by the EFI uclass after installing the
36 * driver binding protocol.
Heinrich Schuchardtb5aeef72022-10-04 18:28:24 +020037 * @bind: Function called by the EFI uclass to attach the
Heinrich Schuchardt77a8fbf2018-02-12 12:55:28 +010038 * driver to EFI driver to a handle.
39 */
Heinrich Schuchardt11206f42018-01-21 19:29:30 +010040struct efi_driver_ops {
41 const efi_guid_t *protocol;
42 const efi_guid_t *child_protocol;
Heinrich Schuchardt6c5fd212022-10-05 11:28:47 +020043 efi_status_t (*init)(struct efi_driver_binding_extended_protocol *this);
Heinrich Schuchardtff1d50b2022-10-04 19:12:59 +020044 efi_status_t (*bind)(struct efi_driver_binding_extended_protocol *this,
45 efi_handle_t handle, void *interface);
Heinrich Schuchardt11206f42018-01-21 19:29:30 +010046};
47
48#endif /* _EFI_DRIVER_H */