]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/PciHotPlugRequest.h
MdePkg: Add definition for new warning code EFI_WARN_FILE_SYSTEM.
[mirror_edk2.git] / MdePkg / Include / Protocol / PciHotPlugRequest.h
CommitLineData
1e22c4d9 1/** @file\r
2 Provides services to notify the PCI bus driver that some events have happened \r
3 in a hot-plug controller (such as a PC Card socket, or PHPC), and to ask the \r
4 PCI bus driver to create or destroy handles for PCI-like devices.\r
5\r
6 A hot-plug capable PCI bus driver should produce the EFI PCI Hot Plug Request \r
7 protocol. When a PCI device or a PCI-like device (for example, 32-bit PC Card)\r
8 is installed after PCI bus does the enumeration, the PCI bus driver can be \r
9 notified through this protocol. For example, when a 32-bit PC Card is inserted\r
10 into the PC Card socket, the PC Card bus driver can call interface of this\r
11 protocol to notify PCI bus driver to allocate resource and create handles for\r
12 this PC Card.\r
13 \r
14 The EFI_PCI_HOTPLUG_REQUEST_PROTOCOL is installed by the PCI bus driver on a \r
15 separate handle when PCI bus driver starts up. There is only one instance in \r
16 the system. Any driver that wants to use this protocol must locate it globally.\r
17 The EFI_PCI_HOTPLUG_REQUEST_PROTOCOL allows the driver of hot-plug controller, \r
18 for example, PC Card Bus driver, to notify PCI bus driver that an event has \r
19 happened in the hot-plug controller, and the PCI bus driver is requested to \r
20 create (add) or destroy (remove) handles for the specified PCI-like devices. \r
21 For example, when a 32-bit PC Card is inserted, this protocol interface will \r
22 be called with an add operation, and the PCI bus driver will enumerate and \r
23 start the devices inserted; when a 32-bit PC Card is removed, this protocol \r
24 interface will be called with a remove operation, and the PCI bus driver will \r
25 stop the devices and destroy their handles. The existence of this protocol \r
26 represents the capability of the PCI bus driver. If this protocol exists in\r
27 system, it means PCI bus driver is hot-plug capable, thus together with the \r
28 effort of PC Card bus driver, hot-plug of PC Card can be supported. Otherwise,\r
29 the hot-plug capability is not provided. \r
30 \r
9df063a0
HT
31 Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
32 This program and the accompanying materials \r
1e22c4d9 33 are licensed and made available under the terms and conditions of the BSD License \r
34 which accompanies this distribution. The full text of the license may be found at \r
35 http://opensource.org/licenses/bsd-license.php \r
36 \r
37 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
38 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
39\r
40 @par Revision Reference:\r
41 This Protocol is defined in UEFI Platform Initialization Specification 1.2 \r
42 Volume 5: Standards\r
43 \r
44**/\r
45\r
46#ifndef __PCI_HOTPLUG_REQUEST_H_\r
47#define __PCI_HOTPLUG_REQUEST_H_\r
48\r
49///\r
50/// Global ID for EFI_PCI_HOTPLUG_REQUEST_PROTOCOL\r
51///\r
52#define EFI_PCI_HOTPLUG_REQUEST_PROTOCOL_GUID \\r
53 { \\r
54 0x19cb87ab, 0x2cb9, 0x4665, {0x83, 0x60, 0xdd, 0xcf, 0x60, 0x54, 0xf7, 0x9d} \\r
55 }\r
56\r
57///\r
58/// Forward declaration for EFI_PCI_HOTPLUG_REQUEST_PROTOCOL\r
59///\r
60typedef struct _EFI_PCI_HOTPLUG_REQUEST_PROTOCOL EFI_PCI_HOTPLUG_REQUEST_PROTOCOL;\r
61\r
62///\r
63/// Enumeration of PCI hot plug operations\r
64/// \r
65typedef enum {\r
66 ///\r
67 /// The PCI bus driver is requested to create handles for the specified devices.\r
68 /// An array of EFI_HANDLE is returned, with a NULL element marking the end of\r
69 /// the array.\r
70 ///\r
71 EfiPciHotPlugRequestAdd,\r
72\r
73 ///\r
74 /// The PCI bus driver is requested to destroy handles for the specified devices.\r
75 ///\r
76 EfiPciHotplugRequestRemove\r
77} EFI_PCI_HOTPLUG_OPERATION;\r
78\r
79/**\r
80 This function is used to notify PCI bus driver that some events happened in a\r
81 hot-plug controller, and the PCI bus driver is requested to start or stop \r
82 specified PCI-like devices.\r
83 \r
84 This function allows the PCI bus driver to be notified to act as requested when\r
85 a hot-plug event has happened on the hot-plug controller. Currently, the \r
86 operations include add operation and remove operation. If it is a add operation,\r
87 the PCI bus driver will enumerate, allocate resources for devices behind the \r
88 hot-plug controller, and create handle for the device specified by RemainingDevicePath.\r
89 The RemainingDevicePath is an optional parameter. If it is not NULL, only the \r
90 specified device is started; if it is NULL, all devices behind the hot-plug \r
91 controller are started. The newly created handles of PC Card functions are \r
92 returned in the ChildHandleBuffer, together with the number of child handle in\r
93 NumberOfChildren. If it is a remove operation, when NumberOfChildren contains\r
94 a non-zero value, child handles specified in ChildHandleBuffer are stopped and\r
95 destroyed; otherwise, PCI bus driver is notified to stop managing the controller\r
96 handle. \r
97 \r
98 @param[in] This A pointer to the EFI_PCI_HOTPLUG_REQUEST_PROTOCOL \r
99 instance.\r
100 @param[in] Operation The operation the PCI bus driver is requested \r
101 to make. \r
102 @param[in] Controller The handle of the hot-plug controller.\r
103 @param[in] RemainingDevicePath The remaining device path for the PCI-like\r
104 hot-plug device. It only contains device\r
105 path nodes behind the hot-plug controller. \r
106 It is an optional parameter and only valid\r
107 when the Operation is a add operation. If \r
108 it is NULL, all devices behind the PC Card \r
109 socket are started.\r
110 @param[in,out] NumberOfChildren The number of child handles. For an add \r
111 operation, it is an output parameter. For\r
112 a remove operation, it's an input parameter.\r
113 When it contains a non-zero value, children\r
114 handles specified in ChildHandleBuffer are\r
115 destroyed. Otherwise, PCI bus driver is \r
116 notified to stop managing the controller \r
117 handle.\r
118 @param[in,out] ChildHandleBuffer The buffer which contains the child handles. \r
119 For an add operation, it is an output \r
120 parameter and contains all newly created \r
121 child handles. For a remove operation, it\r
122 contains child handles to be destroyed when\r
123 NumberOfChildren contains a non-zero value.\r
124 It can be NULL when NumberOfChildren is 0.\r
125 It's the caller's responsibility to allocate\r
126 and free memory for this buffer.\r
127 \r
128 @retval EFI_SUCCESS The handles for the specified device have been \r
129 created or destroyed as requested, and for an \r
130 add operation, the new handles are returned in \r
131 ChildHandleBuffer.\r
132 @retval EFI_INVALID_PARAMETER Operation is not a legal value.\r
133 @retval EFI_INVALID_PARAMETER Controller is NULL or not a valid handle.\r
134 @retval EFI_INVALID_PARAMETER NumberOfChildren is NULL.\r
135 @retval EFI_INVALID_PARAMETER ChildHandleBuffer is NULL while Operation is \r
136 remove and NumberOfChildren contains a non-zero \r
137 value.\r
138 @retval EFI_INVALID_PARAMETER ChildHandleBuffer is NULL while Operation is add.\r
139 @retval EFI_OUT_OF_RESOURCES There are no enough resources to start the \r
140 devices.\r
141**/\r
142typedef\r
143EFI_STATUS\r
144(EFIAPI *EFI_PCI_HOTPLUG_REQUEST_NOTIFY)(\r
145 IN EFI_PCI_HOTPLUG_REQUEST_PROTOCOL *This,\r
146 IN EFI_PCI_HOTPLUG_OPERATION Operation,\r
147 IN EFI_HANDLE Controller,\r
148 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL,\r
149 IN OUT UINT8 *NumberOfChildren,\r
150 IN OUT EFI_HANDLE *ChildHandleBuffer\r
151 );\r
152\r
153///\r
154/// Provides services to notify PCI bus driver that some events have happened in \r
155/// a hot-plug controller (for example, PC Card socket, or PHPC), and ask PCI bus \r
156/// driver to create or destroy handles for the PCI-like devices.\r
157///\r
158struct _EFI_PCI_HOTPLUG_REQUEST_PROTOCOL {\r
159 ///\r
160 /// Notify the PCI bus driver that some events have happened in a hot-plug \r
161 /// controller (for example, PC Card socket, or PHPC), and ask PCI bus driver \r
162 /// to create or destroy handles for the PCI-like devices. See Section 0 for \r
163 /// a detailed description.\r
164 ///\r
165 EFI_PCI_HOTPLUG_REQUEST_NOTIFY Notify;\r
166};\r
167\r
168extern EFI_GUID gEfiPciHotPlugRequestProtocolGuid;\r
169\r
170#endif\r