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