2 This is definition for service binding for Hash driver.
4 Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _HASH2_DRIVER_H_
10 #define _HASH2_DRIVER_H_
14 #include <Protocol/ServiceBinding.h>
15 #include <Protocol/Hash2.h>
17 #include <Library/BaseLib.h>
18 #include <Library/BaseMemoryLib.h>
19 #include <Library/DebugLib.h>
20 #include <Library/MemoryAllocationLib.h>
21 #include <Library/UefiBootServicesTableLib.h>
22 #include <Library/UefiRuntimeServicesTableLib.h>
23 #include <Library/DevicePathLib.h>
24 #include <Library/UefiLib.h>
26 #define HASH2_SERVICE_DATA_SIGNATURE SIGNATURE_32 ('H', 'S', '2', 'S')
30 EFI_HANDLE ServiceHandle
;
31 EFI_SERVICE_BINDING_PROTOCOL ServiceBinding
;
33 LIST_ENTRY ChildrenList
;
36 #define HASH2_SERVICE_DATA_FROM_THIS(a) \
41 HASH2_SERVICE_DATA_SIGNATURE \
44 #define HASH2_INSTANCE_DATA_SIGNATURE SIGNATURE_32 ('H', 's', '2', 'I')
48 HASH2_SERVICE_DATA
*Hash2ServiceData
;
51 EFI_HASH2_PROTOCOL Hash2Protocol
;
53 VOID
*HashInfoContext
;
55 } HASH2_INSTANCE_DATA
;
57 #define HASH2_INSTANCE_DATA_FROM_THIS(a) \
60 HASH2_INSTANCE_DATA, \
62 HASH2_INSTANCE_DATA_SIGNATURE \
65 #define HASH2_INSTANCE_DATA_FROM_LINK(a) \
68 HASH2_INSTANCE_DATA, \
70 HASH2_INSTANCE_DATA_SIGNATURE \
74 Creates a child handle with a set of I/O services.
76 @param[in] This Protocol instance pointer.
77 @param[in, out] ChildHandle Pointer to the handle of the child to create. If
78 it is NULL, then a new handle is created. If
79 it is not NULL, then the I/O services are added
80 to the existing child handle.
82 @retval EFI_SUCCES The protocol was added to ChildHandle.
83 @retval EFI_INVALID_PARAMETER ChildHandle is NULL.
84 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to
86 @retval Others The child handle was not created.
91 Hash2ServiceBindingCreateChild (
92 IN EFI_SERVICE_BINDING_PROTOCOL
*This
,
93 IN OUT EFI_HANDLE
*ChildHandle
97 Destroys a child handle with a set of I/O services.
99 The DestroyChild() function does the opposite of CreateChild(). It removes a
100 protocol that was installed by CreateChild() from ChildHandle. If the removed
101 protocol is the last protocol on ChildHandle, then ChildHandle is destroyed.
103 @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL
105 @param[in] ChildHandle Handle of the child to destroy.
107 @retval EFI_SUCCES The protocol was removed from ChildHandle.
108 @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that
110 @retval EFI_INVALID_PARAMETER ChildHandle is NULL.
111 @retval EFI_ACCESS_DENIED The protocol could not be removed from the
112 ChildHandle because its services are being
114 @retval Others The child handle was not destroyed.
119 Hash2ServiceBindingDestroyChild (
120 IN EFI_SERVICE_BINDING_PROTOCOL
*This
,
121 IN EFI_HANDLE ChildHandle
124 extern EFI_HASH2_PROTOCOL mHash2Protocol
;