2 This is definition for service binding for Hash driver.
4 Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _HASH2_DRIVER_H_
16 #define _HASH2_DRIVER_H_
20 #include <Protocol/ServiceBinding.h>
21 #include <Protocol/Hash2.h>
23 #include <Library/BaseLib.h>
24 #include <Library/BaseMemoryLib.h>
25 #include <Library/DebugLib.h>
26 #include <Library/MemoryAllocationLib.h>
27 #include <Library/UefiBootServicesTableLib.h>
28 #include <Library/UefiRuntimeServicesTableLib.h>
29 #include <Library/DevicePathLib.h>
30 #include <Library/UefiLib.h>
32 #define HASH2_SERVICE_DATA_SIGNATURE SIGNATURE_32 ('H', 'S', '2', 'S')
36 EFI_HANDLE ServiceHandle
;
37 EFI_SERVICE_BINDING_PROTOCOL ServiceBinding
;
39 LIST_ENTRY ChildrenList
;
42 #define HASH2_SERVICE_DATA_FROM_THIS(a) \
47 HASH2_SERVICE_DATA_SIGNATURE \
50 #define HASH2_INSTANCE_DATA_SIGNATURE SIGNATURE_32 ('H', 's', '2', 'I')
54 HASH2_SERVICE_DATA
*Hash2ServiceData
;
57 EFI_HASH2_PROTOCOL Hash2Protocol
;
59 VOID
*HashInfoContext
;
61 } HASH2_INSTANCE_DATA
;
63 #define HASH2_INSTANCE_DATA_FROM_THIS(a) \
66 HASH2_INSTANCE_DATA, \
68 HASH2_INSTANCE_DATA_SIGNATURE \
71 #define HASH2_INSTANCE_DATA_FROM_LINK(a) \
74 HASH2_INSTANCE_DATA, \
76 HASH2_INSTANCE_DATA_SIGNATURE \
80 Creates a child handle with a set of I/O services.
82 @param[in] This Protocol instance pointer.
83 @param[in, out] ChildHandle Pointer to the handle of the child to create. If
84 it is NULL, then a new handle is created. If
85 it is not NULL, then the I/O services are added
86 to the existing child handle.
88 @retval EFI_SUCCES The protocol was added to ChildHandle.
89 @retval EFI_INVALID_PARAMETER ChildHandle is NULL.
90 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to
92 @retval Others The child handle was not created.
97 Hash2ServiceBindingCreateChild (
98 IN EFI_SERVICE_BINDING_PROTOCOL
*This
,
99 IN OUT EFI_HANDLE
*ChildHandle
103 Destroys a child handle with a set of I/O services.
105 The DestroyChild() function does the opposite of CreateChild(). It removes a
106 protocol that was installed by CreateChild() from ChildHandle. If the removed
107 protocol is the last protocol on ChildHandle, then ChildHandle is destroyed.
109 @param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL
111 @param[in] ChildHandle Handle of the child to destroy.
113 @retval EFI_SUCCES The protocol was removed from ChildHandle.
114 @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that
116 @retval EFI_INVALID_PARAMETER ChildHandle is NULL.
117 @retval EFI_ACCESS_DENIED The protocol could not be removed from the
118 ChildHandle because its services are being
120 @retval Others The child handle was not destroyed.
125 Hash2ServiceBindingDestroyChild (
126 IN EFI_SERVICE_BINDING_PROTOCOL
*This
,
127 IN EFI_HANDLE ChildHandle
130 extern EFI_HASH2_PROTOCOL mHash2Protocol
;