]>
Commit | Line | Data |
---|---|---|
ead42efc | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2006 - 2007, Intel Corporation\r | |
4 | All rights reserved. This program and the accompanying materials\r | |
5 | are licensed and made available under the terms and conditions of the BSD License\r | |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | PciLib.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | PCI Bus Driver Lib header file.\r | |
19 | Please use PCD feature flag PcdPciBusHotplugDeviceSupport to enable\r | |
20 | support hot plug.\r | |
21 | \r | |
22 | Revision History\r | |
23 | \r | |
24 | --*/\r | |
25 | \r | |
26 | #ifndef _EFI_PCI_LIB_H\r | |
27 | #define _EFI_PCI_LIB_H\r | |
28 | \r | |
29 | //\r | |
30 | // Mask definistions for PCD PcdPciIncompatibleDeviceSupportMask\r | |
31 | //\r | |
32 | #define PCI_INCOMPATIBLE_ACPI_RESOURCE_SUPPORT 0x01\r | |
33 | #define PCI_INCOMPATIBLE_READ_SUPPORT 0x02\r | |
34 | #define PCI_INCOMPATIBLE_WRITE_SUPPORT 0x04\r | |
35 | #define PCI_INCOMPATIBLE_REGISTER_UPDATE_SUPPORT 0x08\r | |
36 | #define PCI_INCOMPATIBLE_ACCESS_WIDTH_SUPPORT 0x0a\r | |
37 | \r | |
38 | VOID\r | |
39 | InstallHotPlugRequestProtocol (\r | |
40 | IN EFI_STATUS *Status\r | |
41 | )\r | |
42 | /*++\r | |
43 | \r | |
44 | Routine Description:\r | |
45 | \r | |
46 | TODO: Add function description\r | |
47 | \r | |
48 | Arguments:\r | |
49 | \r | |
50 | Status - TODO: add argument description\r | |
51 | \r | |
52 | Returns:\r | |
53 | \r | |
54 | TODO: add return values\r | |
55 | \r | |
56 | --*/\r | |
57 | ;\r | |
58 | \r | |
59 | VOID\r | |
60 | InstallPciHotplugGuid (\r | |
61 | IN PCI_IO_DEVICE *PciIoDevice\r | |
62 | )\r | |
63 | /*++\r | |
64 | \r | |
65 | Routine Description:\r | |
66 | \r | |
67 | TODO: Add function description\r | |
68 | \r | |
69 | Arguments:\r | |
70 | \r | |
71 | PciIoDevice - TODO: add argument description\r | |
72 | \r | |
73 | Returns:\r | |
74 | \r | |
75 | TODO: add return values\r | |
76 | \r | |
77 | --*/\r | |
78 | ;\r | |
79 | \r | |
80 | VOID\r | |
81 | UninstallPciHotplugGuid (\r | |
82 | IN PCI_IO_DEVICE *PciIoDevice\r | |
83 | )\r | |
84 | /*++\r | |
85 | \r | |
86 | Routine Description:\r | |
87 | \r | |
88 | TODO: Add function description\r | |
89 | \r | |
90 | Arguments:\r | |
91 | \r | |
92 | PciIoDevice - TODO: add argument description\r | |
93 | \r | |
94 | Returns:\r | |
95 | \r | |
96 | TODO: add return values\r | |
97 | \r | |
98 | --*/\r | |
99 | ;\r | |
100 | \r | |
101 | VOID\r | |
102 | GetBackPcCardBar (\r | |
103 | IN PCI_IO_DEVICE *PciIoDevice\r | |
104 | )\r | |
105 | /*++\r | |
106 | \r | |
107 | Routine Description:\r | |
108 | \r | |
109 | TODO: Add function description\r | |
110 | \r | |
111 | Arguments:\r | |
112 | \r | |
113 | PciIoDevice - TODO: add argument description\r | |
114 | \r | |
115 | Returns:\r | |
116 | \r | |
117 | TODO: add return values\r | |
118 | \r | |
119 | --*/\r | |
120 | ;\r | |
121 | \r | |
122 | EFI_STATUS\r | |
123 | RemoveRejectedPciDevices (\r | |
124 | EFI_HANDLE RootBridgeHandle,\r | |
125 | IN PCI_IO_DEVICE *Bridge\r | |
126 | )\r | |
127 | /*++\r | |
128 | \r | |
129 | Routine Description:\r | |
130 | \r | |
131 | TODO: Add function description\r | |
132 | \r | |
133 | Arguments:\r | |
134 | \r | |
135 | RootBridgeHandle - TODO: add argument description\r | |
136 | Bridge - TODO: add argument description\r | |
137 | \r | |
138 | Returns:\r | |
139 | \r | |
140 | TODO: add return values\r | |
141 | \r | |
142 | --*/\r | |
143 | ;\r | |
144 | \r | |
145 | EFI_STATUS\r | |
146 | PciHostBridgeResourceAllocator (\r | |
147 | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc\r | |
148 | )\r | |
149 | /*++\r | |
150 | \r | |
151 | Routine Description:\r | |
152 | \r | |
153 | TODO: Add function description\r | |
154 | \r | |
155 | Arguments:\r | |
156 | \r | |
157 | PciResAlloc - TODO: add argument description\r | |
158 | \r | |
159 | Returns:\r | |
160 | \r | |
161 | TODO: add return values\r | |
162 | \r | |
163 | --*/\r | |
164 | ;\r | |
165 | \r | |
166 | EFI_STATUS\r | |
167 | PciHostBridgeResourceAllocator_WithoutHotPlugDeviceSupport (\r | |
168 | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc\r | |
169 | )\r | |
170 | ;\r | |
171 | \r | |
172 | EFI_STATUS\r | |
173 | PciHostBridgeResourceAllocator_WithHotPlugDeviceSupport (\r | |
174 | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc\r | |
175 | )\r | |
176 | ;\r | |
177 | \r | |
178 | EFI_STATUS\r | |
179 | PciScanBus (\r | |
180 | IN PCI_IO_DEVICE *Bridge,\r | |
181 | IN UINT8 StartBusNumber,\r | |
182 | OUT UINT8 *SubBusNumber,\r | |
183 | OUT UINT8 *PaddedBusRange\r | |
184 | )\r | |
185 | /*++\r | |
186 | \r | |
187 | Routine Description:\r | |
188 | \r | |
189 | TODO: Add function description\r | |
190 | \r | |
191 | Arguments:\r | |
192 | \r | |
193 | Bridge - TODO: add argument description\r | |
194 | StartBusNumber - TODO: add argument description\r | |
195 | SubBusNumber - TODO: add argument description\r | |
196 | PaddedBusRange - TODO: add argument description\r | |
197 | \r | |
198 | Returns:\r | |
199 | \r | |
200 | TODO: add return values\r | |
201 | \r | |
202 | --*/\r | |
203 | ;\r | |
204 | \r | |
205 | EFI_STATUS\r | |
206 | PciScanBus_WithHotPlugDeviceSupport (\r | |
207 | IN PCI_IO_DEVICE *Bridge,\r | |
208 | IN UINT8 StartBusNumber,\r | |
209 | OUT UINT8 *SubBusNumber,\r | |
210 | OUT UINT8 *PaddedBusRange\r | |
211 | )\r | |
212 | ;\r | |
213 | \r | |
214 | EFI_STATUS\r | |
215 | PciScanBus_WithoutHotPlugDeviceSupport (\r | |
216 | IN PCI_IO_DEVICE *Bridge,\r | |
217 | IN UINT8 StartBusNumber,\r | |
218 | OUT UINT8 *SubBusNumber,\r | |
219 | OUT UINT8 *PaddedBusRange\r | |
220 | )\r | |
221 | ;\r | |
222 | \r | |
223 | EFI_STATUS\r | |
224 | PciRootBridgeP2CProcess (\r | |
225 | IN PCI_IO_DEVICE *Bridge\r | |
226 | )\r | |
227 | /*++\r | |
228 | \r | |
229 | Routine Description:\r | |
230 | \r | |
231 | TODO: Add function description\r | |
232 | \r | |
233 | Arguments:\r | |
234 | \r | |
235 | Bridge - TODO: add argument description\r | |
236 | \r | |
237 | Returns:\r | |
238 | \r | |
239 | TODO: add return values\r | |
240 | \r | |
241 | --*/\r | |
242 | ;\r | |
243 | \r | |
244 | EFI_STATUS\r | |
245 | PciHostBridgeP2CProcess (\r | |
246 | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc\r | |
247 | )\r | |
248 | /*++\r | |
249 | \r | |
250 | Routine Description:\r | |
251 | \r | |
252 | TODO: Add function description\r | |
253 | \r | |
254 | Arguments:\r | |
255 | \r | |
256 | PciResAlloc - TODO: add argument description\r | |
257 | \r | |
258 | Returns:\r | |
259 | \r | |
260 | TODO: add return values\r | |
261 | \r | |
262 | --*/\r | |
263 | ;\r | |
264 | \r | |
265 | EFI_STATUS\r | |
266 | PciHostBridgeEnumerator (\r | |
267 | EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc\r | |
268 | )\r | |
269 | /*++\r | |
270 | \r | |
271 | Routine Description:\r | |
272 | \r | |
273 | TODO: Add function description\r | |
274 | \r | |
275 | Arguments:\r | |
276 | \r | |
277 | PciResAlloc - TODO: add argument description\r | |
278 | \r | |
279 | Returns:\r | |
280 | \r | |
281 | TODO: add return values\r | |
282 | \r | |
283 | --*/\r | |
284 | ;\r | |
285 | \r | |
286 | /**\r | |
287 | Read PCI configuration space through EFI_PCI_IO_PROTOCOL.\r | |
288 | \r | |
289 | @param PciIo A pointer to the EFI_PCI_O_PROTOCOL.\r | |
290 | @param Width Signifies the width of the memory operations.\r | |
291 | @Param Address The address within the PCI configuration space for the PCI controller.\r | |
292 | @param Buffer For read operations, the destination buffer to store the results. For\r | |
293 | write operations, the source buffer to write data from.\r | |
294 | \r | |
295 | @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.\r | |
296 | @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.\r | |
297 | @retval EFI_INVALID_PARAMETER Buffer is NULL.\r | |
298 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r | |
299 | \r | |
300 | **/\r | |
301 | EFI_STATUS\r | |
302 | PciIoRead (\r | |
303 | IN EFI_PCI_IO_PROTOCOL *PciIo,\r | |
304 | IN EFI_PCI_IO_PROTOCOL_WIDTH Width,\r | |
305 | IN UINT32 Address,\r | |
306 | IN UINTN Count,\r | |
307 | IN OUT VOID *Buffer\r | |
308 | );\r | |
309 | \r | |
310 | /**\r | |
311 | Write PCI configuration space through EFI_PCI_IO_PROTOCOL.\r | |
312 | \r | |
313 | @param PciIo A pointer to the EFI_PCI_O_PROTOCOL.\r | |
314 | @param Width Signifies the width of the memory operations.\r | |
315 | @Param Address The address within the PCI configuration space for the PCI controller.\r | |
316 | @param Buffer For read operations, the destination buffer to store the results. For\r | |
317 | write operations, the source buffer to write data from.\r | |
318 | \r | |
319 | @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.\r | |
320 | @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.\r | |
321 | @retval EFI_INVALID_PARAMETER Buffer is NULL.\r | |
322 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r | |
323 | \r | |
324 | **/\r | |
325 | EFI_STATUS\r | |
326 | PciIoWrite (\r | |
327 | IN EFI_PCI_IO_PROTOCOL *PciIo,\r | |
328 | IN EFI_PCI_IO_PROTOCOL_WIDTH Width,\r | |
329 | IN UINT32 Address,\r | |
330 | IN UINTN Count,\r | |
331 | IN OUT VOID *Buffer\r | |
332 | );\r | |
333 | \r | |
334 | /**\r | |
335 | Write PCI configuration space through EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r | |
336 | \r | |
337 | @param PciRootBridgeIo A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r | |
338 | @param Pci A pointer to PCI_TYPE00.\r | |
339 | @param Width Signifies the width of the memory operations.\r | |
340 | @Param Address The address within the PCI configuration space for the PCI controller.\r | |
341 | @param Buffer For read operations, the destination buffer to store the results. For\r | |
342 | write operations, the source buffer to write data from.\r | |
343 | \r | |
344 | @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.\r | |
345 | @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.\r | |
346 | @retval EFI_INVALID_PARAMETER Buffer is NULL.\r | |
347 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r | |
348 | \r | |
349 | **/\r | |
350 | EFI_STATUS\r | |
351 | PciRootBridgeIoWrite (\r | |
352 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo,\r | |
353 | IN PCI_TYPE00 *Pci,\r | |
354 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,\r | |
355 | IN UINT64 Address,\r | |
356 | IN UINTN Count,\r | |
357 | IN OUT VOID *Buffer\r | |
358 | );\r | |
359 | \r | |
360 | /**\r | |
361 | Read PCI configuration space through EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r | |
362 | \r | |
363 | @param PciRootBridgeIo A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r | |
364 | @param Pci A pointer to PCI_TYPE00.\r | |
365 | @param Width Signifies the width of the memory operations.\r | |
366 | @Param Address The address within the PCI configuration space for the PCI controller.\r | |
367 | @param Buffer For read operations, the destination buffer to store the results. For\r | |
368 | write operations, the source buffer to write data from.\r | |
369 | \r | |
370 | @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.\r | |
371 | @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.\r | |
372 | @retval EFI_INVALID_PARAMETER Buffer is NULL.\r | |
373 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r | |
374 | \r | |
375 | **/\r | |
376 | EFI_STATUS\r | |
377 | PciRootBridgeIoRead (\r | |
378 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo,\r | |
379 | IN PCI_TYPE00 *Pci,\r | |
380 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,\r | |
381 | IN UINT64 Address,\r | |
382 | IN UINTN Count,\r | |
383 | IN OUT VOID *Buffer\r | |
384 | );\r | |
385 | #endif\r |