blob: de38abe83bd400b22f19521b17ccc4fb3044e305 [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/**
14 * struct efi_driver_ops - operations support by an EFI driver
Heinrich Schuchardt0850d7f2018-02-12 12:55:28 +010015 *
Heinrich Schuchardtdf31fed2022-10-04 18:28:24 +020016 * @protocol: The GUID of the protocol which is consumed by the
Heinrich Schuchardt0850d7f2018-02-12 12:55:28 +010017 * driver. This GUID is used by the EFI uclass in the
18 * supports() and start() methods of the
19 * EFI_DRIVER_BINDING_PROTOCOL.
Heinrich Schuchardtdf31fed2022-10-04 18:28:24 +020020 * @child_protocol: Protocol supported by the child handles generated by
Heinrich Schuchardt0850d7f2018-02-12 12:55:28 +010021 * the EFI driver.
Heinrich Schuchardtdf31fed2022-10-04 18:28:24 +020022 * @bind: Function called by the EFI uclass to attach the
Heinrich Schuchardt0850d7f2018-02-12 12:55:28 +010023 * driver to EFI driver to a handle.
24 */
Heinrich Schuchardt05ef48a2018-01-21 19:29:30 +010025struct efi_driver_ops {
26 const efi_guid_t *protocol;
27 const efi_guid_t *child_protocol;
Heinrich Schuchardt43a58912022-10-03 10:35:35 +020028 efi_status_t (*bind)(efi_handle_t handle, void *interface);
Heinrich Schuchardt05ef48a2018-01-21 19:29:30 +010029};
30
Heinrich Schuchardtdf31fed2022-10-04 18:28:24 +020031/**
32 * struct efi_driver_binding_extended_protocol - extended driver binding protocol
33 *
Heinrich Schuchardt05ef48a2018-01-21 19:29:30 +010034 * This structure adds internal fields to the driver binding protocol.
Heinrich Schuchardtdf31fed2022-10-04 18:28:24 +020035 *
36 * @bp: driver binding protocol
37 * @ops: operations supported by the driver
Heinrich Schuchardt05ef48a2018-01-21 19:29:30 +010038 */
39struct 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 */