]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/ServiceBinding.h
Update comments for Protocol definitions to match UEFI spec.
[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 Destroys a child handle with a set of I/O services.
50
51 @param This Protocol instance pointer.
52 @param ChildHandle Handle of the child to destroy
53
54 @retval EFI_SUCCES The I/O services were removed from the child handle
55 @retval EFI_UNSUPPORTED The child handle does not support the I/O services
56 that are being removed.
57 @retval EFI_INVALID_PARAMETER Child handle is not a valid EFI Handle.
58 @retval EFI_ACCESS_DENIED The child handle could not be destroyed because its
59 I/O services are being used.
60 @retval other The child handle was not destroyed
61
62 **/
63 typedef
64 EFI_STATUS
65 (EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD)(
66 IN EFI_SERVICE_BINDING_PROTOCOL *This,
67 IN EFI_HANDLE ChildHandle
68 );
69
70 ///
71 /// The EFI_SERVICE_BINDING_PROTOCOL provides member functions to create and destroy
72 /// child handles. A driver is responsible for adding protocols to the child handle
73 /// in CreateChild() and removing protocols in DestroyChild(). It is also required
74 /// that the CreateChild() function opens the parent protocol BY_CHILD_CONTROLLER
75 /// to establish the parent-child relationship, and closes the protocol in DestroyChild().
76 /// The pseudo code for CreateChild() and DestroyChild() is provided to specify the
77 /// required behavior, not to specify the required implementation. Each consumer of
78 /// a software protocol is responsible for calling CreateChild() when it requires the
79 /// protocol and calling DestroyChild() when it is finished with that protocol.
80 ///
81 struct _EFI_SERVICE_BINDING_PROTOCOL {
82 EFI_SERVICE_BINDING_CREATE_CHILD CreateChild;
83 EFI_SERVICE_BINDING_DESTROY_CHILD DestroyChild;
84 };
85
86 #endif