efi_driver.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Internal structures for the EFI driver binding protocol
  4. *
  5. * Copyright (c) 2017 Heinrich Schuchardt
  6. */
  7. #ifndef _EFI_DRIVER_H
  8. #define _EFI_DRIVER_H 1
  9. #include <efi_loader.h>
  10. /**
  11. * struct efi_driver_binding_extended_protocol - extended driver binding protocol
  12. *
  13. * This structure adds internal fields to the driver binding protocol.
  14. *
  15. * @bp: driver binding protocol
  16. * @ops: operations supported by the driver
  17. */
  18. struct efi_driver_binding_extended_protocol {
  19. struct efi_driver_binding_protocol bp;
  20. const struct efi_driver_ops *ops;
  21. };
  22. /**
  23. * struct efi_driver_ops - operations support by an EFI driver
  24. *
  25. * @protocol: The GUID of the protocol which is consumed by the
  26. * driver. This GUID is used by the EFI uclass in the
  27. * supports() and start() methods of the
  28. * EFI_DRIVER_BINDING_PROTOCOL.
  29. * @child_protocol: Protocol supported by the child handles generated by
  30. * the EFI driver.
  31. * @init: Function called by the EFI uclass after installing the
  32. * driver binding protocol.
  33. * @bind: Function called by the EFI uclass to attach the
  34. * driver to EFI driver to a handle.
  35. */
  36. struct efi_driver_ops {
  37. const efi_guid_t *protocol;
  38. const efi_guid_t *child_protocol;
  39. efi_status_t (*init)(struct efi_driver_binding_extended_protocol *this);
  40. efi_status_t (*bind)(struct efi_driver_binding_extended_protocol *this,
  41. efi_handle_t handle, void *interface);
  42. };
  43. #endif /* _EFI_DRIVER_H */