]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/ServiceBinding.h
Code Scrub for Protocol and Ppi Definition
[mirror_edk2.git] / MdePkg / Include / Protocol / ServiceBinding.h
1 /** @file
2
3 The file defines the generic Service Binding Protocol functions.
4 It provides services that are required to create and destroy child
5 handles that support a given set of protocols.
6
7 Copyright (c) 2006 - 2008, Intel Corporation
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 **/
17
18 #ifndef __EFI_SERVICE_BINDING_H__
19 #define __EFI_SERVICE_BINDING_H__
20
21 //
22 // Forward reference for pure ANSI compatability
23 //
24 typedef struct _EFI_SERVICE_BINDING_PROTOCOL EFI_SERVICE_BINDING_PROTOCOL;
25
26 /**
27 Creates a child handle with a set of I/O services.
28
29 @param This Protocol instance pointer.
30 @param ChildHandle Pointer to the handle of the child to create. If it is NULL,
31 then a new handle is created. If it is not NULL, then the
32 I/O services are added to the existing child handle.
33
34 @retval EFI_SUCCES The child handle was created with the I/O services
35 @retval EFI_INVALID_PARAMETER ChildHandle is NULL.
36 @retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create
37 the child
38 @retval other The child handle was not created
39
40 **/
41 typedef
42 EFI_STATUS
43 (EFIAPI *EFI_SERVICE_BINDING_CREATE_CHILD)(
44 IN EFI_SERVICE_BINDING_PROTOCOL *This,
45 IN OUT EFI_HANDLE *ChildHandle
46 )
47 ;
48
49 /**
50 Destroys a child handle with a set of I/O services.
51
52 @param This Protocol instance pointer.
53 @param ChildHandle Handle of the child to destroy
54
55 @retval EFI_SUCCES The I/O services were removed from the child handle
56 @retval EFI_UNSUPPORTED The child handle does not support the I/O services
57 that are being removed.
58 @retval EFI_INVALID_PARAMETER Child handle is not a valid EFI Handle.
59 @retval EFI_ACCESS_DENIED The child handle could not be destroyed because its
60 I/O services are being used.
61 @retval other The child handle was not destroyed
62
63 **/
64 typedef
65 EFI_STATUS
66 (EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD)(
67 IN EFI_SERVICE_BINDING_PROTOCOL *This,
68 IN EFI_HANDLE ChildHandle
69 )
70 ;
71
72 /**
73 @par Protocol Description:
74 The EFI_SERVICE_BINDING_PROTOCOL provides member functions to create and destroy
75 child handles. A driver is responsible for adding protocols to the child handle
76 in CreateChild() and removing protocols in DestroyChild(). It is also required
77 that the CreateChild() function opens the parent protocol BY_CHILD_CONTROLLER
78 to establish the parent-child relationship, and closes the protocol in DestroyChild().
79 The pseudo code for CreateChild() and DestroyChild() is provided to specify the
80 required behavior, not to specify the required implementation. Each consumer of
81 a software protocol is responsible for calling CreateChild() when it requires the
82 protocol and calling DestroyChild() when it is finished with that protocol.
83
84 @param CreateChild
85 Creates a child handle and installs a protocol.
86
87 @param DestroyChild
88 Destroys a child handle with a protocol installed on it.
89 **/
90 struct _EFI_SERVICE_BINDING_PROTOCOL {
91 EFI_SERVICE_BINDING_CREATE_CHILD CreateChild;
92 EFI_SERVICE_BINDING_DESTROY_CHILD DestroyChild;
93 };
94
95 #endif