]>
Commit | Line | Data |
---|---|---|
9095d37b | 1 | /** @file\r |
f1004231 | 2 | UEFI Service Binding Protocol is defined in UEFI specification.\r |
c311f86b | 3 | \r |
4ca9b6c4 | 4 | The file defines the generic Service Binding Protocol functions.\r |
9095d37b | 5 | It provides services that are required to create and destroy child\r |
4ca9b6c4 | 6 | handles that support a given set of protocols.\r |
c311f86b | 7 | \r |
9095d37b | 8 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 9 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
d1f95000 | 10 | \r |
d1f95000 | 11 | **/\r |
12 | \r | |
13 | #ifndef __EFI_SERVICE_BINDING_H__\r | |
14 | #define __EFI_SERVICE_BINDING_H__\r | |
15 | \r | |
99e8ed21 | 16 | ///\r |
17 | /// Forward reference for pure ANSI compatability\r | |
18 | ///\r | |
d1f95000 | 19 | typedef struct _EFI_SERVICE_BINDING_PROTOCOL EFI_SERVICE_BINDING_PROTOCOL;\r |
20 | \r | |
21 | /**\r | |
f1004231 | 22 | Creates a child handle and installs a protocol.\r |
9095d37b LG |
23 | \r |
24 | The CreateChild() function installs a protocol on ChildHandle.\r | |
25 | If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.\r | |
f1004231 | 26 | If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.\r |
d1f95000 | 27 | \r |
f1004231 LG |
28 | @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r |
29 | @param ChildHandle Pointer to the handle of the child to create. If it is NULL,\r | |
9095d37b | 30 | then a new handle is created. If it is a pointer to an existing UEFI handle,\r |
f1004231 | 31 | then the protocol is added to the existing UEFI handle.\r |
d1f95000 | 32 | \r |
f1004231 | 33 | @retval EFI_SUCCES The protocol was added to ChildHandle.\r |
d1f95000 | 34 | @retval EFI_INVALID_PARAMETER ChildHandle is NULL.\r |
b88df761 | 35 | @retval EFI_OUT_OF_RESOURCES There are not enough resources available to create\r |
d1f95000 | 36 | the child\r |
37 | @retval other The child handle was not created\r | |
38 | \r | |
39 | **/\r | |
40 | typedef\r | |
41 | EFI_STATUS\r | |
8b13229b | 42 | (EFIAPI *EFI_SERVICE_BINDING_CREATE_CHILD)(\r |
d1f95000 | 43 | IN EFI_SERVICE_BINDING_PROTOCOL *This,\r |
44 | IN OUT EFI_HANDLE *ChildHandle\r | |
ed66e1bc | 45 | );\r |
d1f95000 | 46 | \r |
47 | /**\r | |
f1004231 | 48 | Destroys a child handle with a protocol installed on it.\r |
9095d37b LG |
49 | \r |
50 | The DestroyChild() function does the opposite of CreateChild(). It removes a protocol\r | |
51 | that was installed by CreateChild() from ChildHandle. If the removed protocol is the\r | |
f1004231 | 52 | last protocol on ChildHandle, then ChildHandle is destroyed.\r |
d1f95000 | 53 | \r |
f1004231 | 54 | @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r |
d1f95000 | 55 | @param ChildHandle Handle of the child to destroy\r |
56 | \r | |
f1004231 LG |
57 | @retval EFI_SUCCES The protocol was removed from ChildHandle.\r |
58 | @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.\r | |
18bd7e85 | 59 | @retval EFI_INVALID_PARAMETER Child handle is NULL.\r |
f1004231 | 60 | @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle\r |
ee6c452c | 61 | because its services are being used.\r |
d1f95000 | 62 | @retval other The child handle was not destroyed\r |
63 | \r | |
64 | **/\r | |
65 | typedef\r | |
66 | EFI_STATUS\r | |
8b13229b | 67 | (EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD)(\r |
d1f95000 | 68 | IN EFI_SERVICE_BINDING_PROTOCOL *This,\r |
69 | IN EFI_HANDLE ChildHandle\r | |
ed66e1bc | 70 | );\r |
d1f95000 | 71 | \r |
44717a39 | 72 | ///\r |
9095d37b LG |
73 | /// The EFI_SERVICE_BINDING_PROTOCOL provides member functions to create and destroy\r |
74 | /// child handles. A driver is responsible for adding protocols to the child handle\r | |
75 | /// in CreateChild() and removing protocols in DestroyChild(). It is also required\r | |
76 | /// that the CreateChild() function opens the parent protocol BY_CHILD_CONTROLLER\r | |
44717a39 | 77 | /// to establish the parent-child relationship, and closes the protocol in DestroyChild().\r |
9095d37b LG |
78 | /// The pseudo code for CreateChild() and DestroyChild() is provided to specify the\r |
79 | /// required behavior, not to specify the required implementation. Each consumer of\r | |
80 | /// a software protocol is responsible for calling CreateChild() when it requires the\r | |
44717a39 | 81 | /// protocol and calling DestroyChild() when it is finished with that protocol.\r |
82 | ///\r | |
d1f95000 | 83 | struct _EFI_SERVICE_BINDING_PROTOCOL {\r |
2f88bd3a MK |
84 | EFI_SERVICE_BINDING_CREATE_CHILD CreateChild;\r |
85 | EFI_SERVICE_BINDING_DESTROY_CHILD DestroyChild;\r | |
d1f95000 | 86 | };\r |
87 | \r | |
88 | #endif\r |