]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Include/Protocol/PciHotPlugRequest.h
Committing changes to the comments, to improve code documentation.
[mirror_edk2.git] / IntelFrameworkModulePkg / Include / Protocol / PciHotPlugRequest.h
CommitLineData
8ca67c46 1/** @file\r
20774adc
LG
2 Provides services to notify PCI bus driver that some events have happened in a hot-plug controller\r
3 (for example, PC Card socket, or PHPC), and ask PCI bus driver to create or destroy handles for the\r
4 PCI-like devices.\r
a9102619 5\r
f4671790 6Copyright (c) 2006 - 2009, Intel Corporation \r
a9102619 7All rights reserved. This program and the accompanying materials \r
8are licensed and made available under the terms and conditions of the BSD License \r
9which accompanies this distribution. The full text of the license may be found at \r
10http://opensource.org/licenses/bsd-license.php \r
11 \r
12THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
13WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
14\r
3db51098 15**/\r
a9102619 16\r
17#ifndef __PCI_HOTPLUG_REQUEST_H_\r
18#define __PCI_HOTPLUG_REQUEST_H_\r
19\r
20#define EFI_PCI_HOTPLUG_REQUEST_PROTOCOL_GUID \\r
d9aef0a8 21 {\r
22 0x19cb87ab, 0x2cb9, 0x4665, {0x83, 0x60, 0xdd, 0xcf, 0x60, 0x54, 0xf7, 0x9d} \\r
23 }\r
a9102619 24\r
25typedef enum {\r
20774adc
LG
26 ///\r
27 /// The PCI bus driver is requested to create handles for the specified devices. An array of\r
28 /// EFI_HANDLE is returned, a NULL element marks the end of the array.\r
29 ///\r
a9102619 30 EfiPciHotPlugRequestAdd,\r
20774adc
LG
31\r
32 ///\r
33 /// The PCI bus driver is requested to destroy handles for the specified devices.\r
34 ///\r
a9102619 35 EfiPciHotplugRequestRemove\r
36} EFI_PCI_HOTPLUG_OPERATION;\r
37\r
38typedef struct _EFI_PCI_HOTPLUG_REQUEST_PROTOCOL EFI_PCI_HOTPLUG_REQUEST_PROTOCOL;\r
39\r
f4671790 40/**\r
20774adc 41 This function allows the PCI bus driver to be notified to act as requested when a hot-plug event has\r
d9aef0a8 42 happened on the hot-plug controller. Currently, the operations include add operation and remove operation.\r
f4671790 43 \r
d9aef0a8 44 @param This A pointer to the hot plug request protocol.\r
45 @param Operation The operation the PCI bus driver is requested to make.\r
46 @param Controller The handle of the hot-plug controller.\r
47 @param RemainingDevicePath The remaining device path for the PCI-like hot-plug device.\r
48 @param NumberOfChildren The number of child handles. For a add operation, it is an output parameter. \r
49 For a remove operation, it's an input parameter. When it contains a non-zero\r
50 value, children handles specified in ChildHandleBuffer are destroyed. Otherwise,\r
51 PCI bus driver is notified to stop managing the controller handle.\r
52 @param ChildHandleBuffer The buffer which contains the child handles. For a add operation, it is an output \r
53 parameter and contains all newly created child handles. For a remove operation, it \r
54 contains child handles to be destroyed when NumberOfChildren contains a non-\r
55 zero value. It can be NULL when NumberOfChildren is 0. It's the caller's \r
56 responsibility to allocate and free memory for this buffer.\r
f4671790 57 \r
20774adc
LG
58 @retval EFI_SUCCESS The handles for the specified device have been created or destroyed\r
59 as requested, and for an add operation, the new handles are\r
60 returned in ChildHandleBuffer.\r
d9aef0a8 61 @retval EFI_INVALID_PARAMETER Operation is not a legal value.\r
62 @retval EFI_INVALID_PARAMETER Controller is NULL or not a valid handle.\r
63 @retval EFI_INVALID_PARAMETER NumberOfChildren is NULL.\r
64 @retval EFI_INVALID_PARAMETER ChildHandleBuffer is NULL while Operation is remove and \r
65 NumberOfChildren contains a non-zero value.\r
66 @retval EFI_INVALID_PARAMETER ChildHandleBuffer is NULL while Operation is add.\r
67 @retval EFI_OUT_OF_RESOURCES There are no enough resources to start the devices.\r
f4671790 68**/\r
a9102619 69typedef\r
70EFI_STATUS\r
71(EFIAPI *EFI_PCI_HOTPLUG_REQUEST_NOTIFY) (\r
72 IN EFI_PCI_HOTPLUG_REQUEST_PROTOCOL *This,\r
73 IN EFI_PCI_HOTPLUG_OPERATION Operation,\r
74 IN EFI_HANDLE Controller,\r
75 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL,\r
76 IN OUT UINT8 *NumberOfChildren,\r
77 IN OUT EFI_HANDLE *ChildHandleBuffer\r
78);\r
79\r
80\r
81\r
82struct _EFI_PCI_HOTPLUG_REQUEST_PROTOCOL {\r
83 EFI_PCI_HOTPLUG_REQUEST_NOTIFY Notify;\r
84};\r
85\r
86extern EFI_GUID gEfiPciHotPlugRequestProtocolGuid;\r
87\r
88#endif\r