21b50a27 |
1 | /** @file\r |
2 | This file declares EFI PCI Hot Plug Init Protocol\r |
3 | \r |
4 | Copyright (c) 2006, Intel Corporation \r |
5 | All rights reserved. This program and the accompanying materials \r |
6 | are licensed and made available under the terms and conditions of the BSD License \r |
7 | which accompanies this distribution. The full text of the license may be found at \r |
8 | http://opensource.org/licenses/bsd-license.php \r |
9 | \r |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r |
12 | \r |
13 | Module Name: PciHotPlugInit.h\r |
14 | \r |
15 | @par Revision Reference:\r |
16 | This protocol is defined in Framework of EFI Hot Plug Pci Initialization Protocol Spec\r |
17 | Version 0.9\r |
18 | \r |
19 | **/\r |
20 | \r |
21 | #ifndef _EFI_PCI_HOT_PLUG_INIT_H\r |
22 | #define _EFI_PCI_HOT_PLUG_INIT_H\r |
23 | \r |
24 | //\r |
25 | // Global ID for the PCI Hot Plug Protocol\r |
26 | //\r |
27 | #define EFI_PCI_HOT_PLUG_INIT_PROTOCOL_GUID \\r |
28 | { 0xaa0e8bc1, 0xdabc, 0x46b0, {0xa8, 0x44, 0x37, 0xb8, 0x16, 0x9b, 0x2b, 0xea } }\r |
29 | \r |
30 | \r |
31 | typedef struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL EFI_PCI_HOT_PLUG_INIT_PROTOCOL;\r |
32 | \r |
33 | #define EFI_HPC_STATE_INITIALIZED 0x01\r |
34 | #define EFI_HPC_STATE_ENABLED 0x02\r |
35 | \r |
36 | typedef UINT16 EFI_HPC_STATE;\r |
37 | \r |
38 | \r |
39 | typedef struct{\r |
40 | EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath;\r |
41 | EFI_DEVICE_PATH_PROTOCOL *HpbDevicePath;\r |
42 | } EFI_HPC_LOCATION;\r |
43 | \r |
44 | \r |
45 | typedef enum{\r |
46 | EfiPaddingPciBus,\r |
47 | EfiPaddingPciRootBridge\r |
48 | } EFI_HPC_PADDING_ATTRIBUTES;\r |
49 | \r |
50 | /**\r |
51 | Returns a list of root Hot Plug Controllers (HPCs) that require initialization \r |
52 | during the boot process.\r |
53 | \r |
54 | @param This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.\r |
55 | \r |
56 | @param HpcCount The number of root HPCs that were returned.\r |
57 | \r |
58 | @param HpcList The list of root HPCs. HpcCount defines the number of \r |
59 | elements in this list.\r |
60 | \r |
61 | @retval EFI_SUCCESS HpcList was returned.\r |
62 | \r |
63 | @retval EFI_OUT_OF_RESOURCES HpcList was not returned due to insufficient resources.\r |
64 | \r |
65 | @retval EFI_INVALID_PARAMETER HpcCount is NULL or HpcList is NULL.\r |
66 | \r |
67 | **/\r |
68 | typedef\r |
69 | EFI_STATUS\r |
70 | (EFIAPI *EFI_GET_ROOT_HPC_LIST) (\r |
71 | IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This,\r |
72 | OUT UINTN *HpcCount,\r |
73 | OUT EFI_HPC_LOCATION **HpcList\r |
74 | );\r |
75 | \r |
76 | /**\r |
77 | Initializes one root Hot Plug Controller (HPC). This process may causes \r |
78 | initialization of its subordinate buses. \r |
79 | \r |
80 | @param This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.\r |
81 | \r |
82 | @param HpcDevicePath The device path to the HPC that is being initialized.\r |
83 | \r |
84 | @param HpcPciAddress The address of the HPC function on the PCI bus.\r |
85 | \r |
86 | @param Event The event that should be signaled when the HPC initialization \r |
87 | is complete.\r |
88 | \r |
89 | @param HpcState The state of the HPC hardware. \r |
90 | \r |
91 | @retval EFI_SUCCESS If Event is NULL, the specific HPC was successfully \r |
92 | initialized. If Event is not NULL, Event will be signaled at a later time \r |
93 | when initialization is complete.\r |
94 | \r |
95 | @retval EFI_UNSUPPORTED This instance of EFI_PCI_HOT_PLUG_INIT_PROTOCOL \r |
96 | does not support the specified HPC.\r |
97 | \r |
98 | @retval EFI_OUT_OF_RESOURCES Initialization failed due to insufficient \r |
99 | resources.\r |
100 | \r |
101 | @retval EFI_INVALID_PARAMETER HpcState is NULL.\r |
102 | \r |
103 | **/\r |
104 | typedef\r |
105 | EFI_STATUS\r |
106 | (EFIAPI *EFI_INITIALIZE_ROOT_HPC) (\r |
107 | IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This,\r |
108 | IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath,\r |
109 | IN UINT64 HpcPciAddress,\r |
110 | IN EFI_EVENT Event, OPTIONAL\r |
111 | OUT EFI_HPC_STATE *HpcState\r |
112 | );\r |
113 | \r |
114 | /**\r |
115 | Returns the resource padding that is required by the PCI bus that is controlled \r |
116 | by the specified Hot Plug Controller (HPC).\r |
117 | \r |
118 | @param This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.\r |
119 | \r |
120 | @param HpcDevicePath The device path to the HPC.\r |
121 | \r |
122 | @param HpcPciAddress The address of the HPC function on the PCI bus. \r |
123 | \r |
124 | @param HpcState The state of the HPC hardware. \r |
125 | \r |
126 | @param Padding The amount of resource padding that is required by the \r |
127 | PCI bus under the control of the specified HPC. \r |
128 | \r |
129 | @param Attributes Describes how padding is accounted for. The padding \r |
130 | is returned in the form of ACPI 2.0 resource descriptors. \r |
131 | \r |
132 | @retval EFI_SUCCESS The resource padding was successfully returned.\r |
133 | \r |
134 | @retval EFI_UNSUPPORTED This instance of the EFI_PCI_HOT_PLUG_INIT_PROTOCOL \r |
135 | does not support the specified HPC.\r |
136 | \r |
137 | @retval EFI_NOT_READY This function was called before HPC initialization is complete.\r |
138 | \r |
139 | @retval EFI_INVALID_PARAMETER HpcState or Padding or Attributes is NULL.\r |
140 | \r |
141 | @retval EFI_OUT_OF_RESOURCES ACPI 2.0 resource descriptors for Padding \r |
142 | cannot be allocated due to insufficient resources.\r |
143 | \r |
144 | **/\r |
145 | typedef\r |
146 | EFI_STATUS\r |
147 | (EFIAPI *EFI_GET_PCI_HOT_PLUG_PADDING) (\r |
148 | IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This,\r |
149 | IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath,\r |
150 | IN UINT64 HpcPciAddress,\r |
151 | OUT EFI_HPC_STATE *HpcState,\r |
152 | OUT VOID **Padding,\r |
153 | OUT EFI_HPC_PADDING_ATTRIBUTES *Attributes\r |
154 | ); \r |
155 | \r |
156 | \r |
157 | //\r |
158 | // Prototypes for the PCI Hot Plug Init Protocol\r |
159 | //\r |
160 | \r |
161 | /**\r |
162 | @par Protocol Description:\r |
163 | This protocol provides the necessary functionality to initialize the \r |
164 | Hot Plug Controllers (HPCs) and the buses that they control. This protocol \r |
165 | also provides information regarding resource padding. \r |
166 | \r |
167 | @param GetRootHpcList\r |
168 | Returns a list of root HPCs and the buses that they control.\r |
169 | \r |
170 | @param InitializeRootHpc\r |
171 | Initializes the specified root HPC.\r |
172 | \r |
173 | @param GetResourcePadding\r |
174 | Returns the resource padding that is required by the HPC.\r |
175 | \r |
176 | **/\r |
177 | struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL {\r |
178 | EFI_GET_ROOT_HPC_LIST GetRootHpcList;\r |
179 | EFI_INITIALIZE_ROOT_HPC InitializeRootHpc;\r |
180 | EFI_GET_PCI_HOT_PLUG_PADDING GetResourcePadding;\r |
181 | };\r |
182 | \r |
183 | extern EFI_GUID gEfiPciHotPlugInitProtocolGuid;\r |
184 | \r |
185 | #endif\r |