df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync/** @file
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync UEFI Service Binding Protocol is defined in UEFI specification.
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync The file defines the generic Service Binding Protocol functions.
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync It provides services that are required to create and destroy child
c7814cf6e1240a519cbec0441e033d0e2470ed00vboxsync handles that support a given set of protocols.
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync This program and the accompanying materials
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync are licensed and made available under the terms and conditions of the BSD License
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync which accompanies this distribution. The full text of the license may be found at
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync http://opensource.org/licenses/bsd-license.php
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync**/
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync
6decafdf89f825b3af922ab6fa02345e08e5be7bvboxsync#ifndef __EFI_SERVICE_BINDING_H__
6decafdf89f825b3af922ab6fa02345e08e5be7bvboxsync#define __EFI_SERVICE_BINDING_H__
6decafdf89f825b3af922ab6fa02345e08e5be7bvboxsync
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync///
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync/// Forward reference for pure ANSI compatability
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync///
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsynctypedef struct _EFI_SERVICE_BINDING_PROTOCOL EFI_SERVICE_BINDING_PROTOCOL;
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync
6decafdf89f825b3af922ab6fa02345e08e5be7bvboxsync/**
6decafdf89f825b3af922ab6fa02345e08e5be7bvboxsync Creates a child handle and installs a protocol.
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync The CreateChild() function installs a protocol on ChildHandle.
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
6decafdf89f825b3af922ab6fa02345e08e5be7bvboxsync @param ChildHandle Pointer to the handle of the child to create. If it is NULL,
6decafdf89f825b3af922ab6fa02345e08e5be7bvboxsync then a new handle is created. If it is a pointer to an existing UEFI handle,
6decafdf89f825b3af922ab6fa02345e08e5be7bvboxsync then the protocol is added to the existing UEFI handle.
6decafdf89f825b3af922ab6fa02345e08e5be7bvboxsync
6decafdf89f825b3af922ab6fa02345e08e5be7bvboxsync @retval EFI_SUCCES The protocol was added to ChildHandle.
6decafdf89f825b3af922ab6fa02345e08e5be7bvboxsync @retval EFI_INVALID_PARAMETER ChildHandle is NULL.
6decafdf89f825b3af922ab6fa02345e08e5be7bvboxsync @retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create
6decafdf89f825b3af922ab6fa02345e08e5be7bvboxsync the child
3a974120cf0d8d23b2531cd62fe04532e6ac205evboxsync @retval other The child handle was not created
df4e0d2af793d52c48d1f2a91a575d78eb728511vboxsync
3b5b00fc19a7b52f11075648a1b93d477137f4d3vboxsync**/
3a974120cf0d8d23b2531cd62fe04532e6ac205evboxsynctypedef
3a974120cf0d8d23b2531cd62fe04532e6ac205evboxsyncEFI_STATUS
3b5b00fc19a7b52f11075648a1b93d477137f4d3vboxsync(EFIAPI *EFI_SERVICE_BINDING_CREATE_CHILD)(
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync IN EFI_SERVICE_BINDING_PROTOCOL *This,
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync IN OUT EFI_HANDLE *ChildHandle
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync );
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync/**
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync Destroys a child handle with a protocol installed on it.
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync that was installed by CreateChild() from ChildHandle. If the removed protocol is the
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync last protocol on ChildHandle, then ChildHandle is destroyed.
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync @param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync @param ChildHandle Handle of the child to destroy
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync @retval EFI_SUCCES The protocol was removed from ChildHandle.
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync @retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync @retval EFI_INVALID_PARAMETER Child handle is NULL.
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync @retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync because its services are being used.
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync @retval other The child handle was not destroyed
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync**/
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsynctypedef
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsyncEFI_STATUS
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync(EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD)(
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync IN EFI_SERVICE_BINDING_PROTOCOL *This,
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync IN EFI_HANDLE ChildHandle
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync );
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync///
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync/// The EFI_SERVICE_BINDING_PROTOCOL provides member functions to create and destroy
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync/// child handles. A driver is responsible for adding protocols to the child handle
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync/// in CreateChild() and removing protocols in DestroyChild(). It is also required
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync/// that the CreateChild() function opens the parent protocol BY_CHILD_CONTROLLER
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync/// to establish the parent-child relationship, and closes the protocol in DestroyChild().
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync/// The pseudo code for CreateChild() and DestroyChild() is provided to specify the
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync/// required behavior, not to specify the required implementation. Each consumer of
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync/// a software protocol is responsible for calling CreateChild() when it requires the
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync/// protocol and calling DestroyChild() when it is finished with that protocol.
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync///
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsyncstruct _EFI_SERVICE_BINDING_PROTOCOL {
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync EFI_SERVICE_BINDING_CREATE_CHILD CreateChild;
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync EFI_SERVICE_BINDING_DESTROY_CHILD DestroyChild;
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync};
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync#endif
b62daae35a821b998dc41ab2c90da52d18b6f229vboxsync