]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciLib.h
Coding style modification.
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Pci / PciBusDxe / PciLib.h
1 /** @file
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 typedef struct {
39 EFI_HANDLE Handle;
40 } EFI_DEVICE_HANDLE_EXTENDED_DATA_PAYLOAD;
41
42 typedef struct {
43 UINT32 Bar;
44 UINT16 DevicePathSize;
45 UINT16 ReqResSize;
46 UINT16 AllocResSize;
47 UINT8 *DevicePath;
48 UINT8 *ReqRes;
49 UINT8 *AllocRes;
50 } EFI_RESOURCE_ALLOC_FAILURE_ERROR_DATA_PAYLOAD;
51
52 void
53 InstallHotPlugRequestProtocol (
54 IN EFI_STATUS *Status
55 )
56 /**
57
58 Routine Description:
59
60 TODO: Add function description
61
62 Arguments:
63
64 Status - TODO: add argument description
65
66 Returns:
67
68 TODO: add return values
69
70 **/
71 ;
72
73 VOID
74 InstallPciHotplugGuid (
75 IN PCI_IO_DEVICE *PciIoDevice
76 )
77 /**
78
79 Routine Description:
80
81 TODO: Add function description
82
83 Arguments:
84
85 PciIoDevice - TODO: add argument description
86
87 Returns:
88
89 TODO: add return values
90
91 **/
92 ;
93
94 VOID
95 UninstallPciHotplugGuid (
96 IN PCI_IO_DEVICE *PciIoDevice
97 )
98 /**
99
100 Routine Description:
101
102 TODO: Add function description
103
104 Arguments:
105
106 PciIoDevice - TODO: add argument description
107
108 Returns:
109
110 TODO: add return values
111
112 **/
113 ;
114
115 VOID
116 GetBackPcCardBar (
117 IN PCI_IO_DEVICE *PciIoDevice
118 )
119 /**
120
121 Routine Description:
122
123 TODO: Add function description
124
125 Arguments:
126
127 PciIoDevice - TODO: add argument description
128
129 Returns:
130
131 TODO: add return values
132
133 **/
134 ;
135
136 EFI_STATUS
137 RemoveRejectedPciDevices (
138 EFI_HANDLE RootBridgeHandle,
139 IN PCI_IO_DEVICE *Bridge
140 )
141 /**
142
143 Routine Description:
144
145 TODO: Add function description
146
147 Arguments:
148
149 RootBridgeHandle - TODO: add argument description
150 Bridge - TODO: add argument description
151
152 Returns:
153
154 TODO: add return values
155
156 **/
157 ;
158
159 EFI_STATUS
160 PciHostBridgeResourceAllocator (
161 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc
162 )
163 /**
164
165 Routine Description:
166
167 TODO: Add function description
168
169 Arguments:
170
171 PciResAlloc - TODO: add argument description
172
173 Returns:
174
175 TODO: add return values
176
177 **/
178 ;
179
180 EFI_STATUS
181 PciHostBridgeResourceAllocator_WithoutHotPlugDeviceSupport (
182 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc
183 )
184 ;
185
186 EFI_STATUS
187 PciHostBridgeResourceAllocator_WithHotPlugDeviceSupport (
188 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc
189 )
190 ;
191
192 EFI_STATUS
193 PciScanBus (
194 IN PCI_IO_DEVICE *Bridge,
195 IN UINT8 StartBusNumber,
196 OUT UINT8 *SubBusNumber,
197 OUT UINT8 *PaddedBusRange
198 )
199 /**
200
201 Routine Description:
202
203 TODO: Add function description
204
205 Arguments:
206
207 Bridge - TODO: add argument description
208 StartBusNumber - TODO: add argument description
209 SubBusNumber - TODO: add argument description
210 PaddedBusRange - TODO: add argument description
211
212 Returns:
213
214 TODO: add return values
215
216 **/
217 ;
218
219 EFI_STATUS
220 PciScanBus_WithHotPlugDeviceSupport (
221 IN PCI_IO_DEVICE *Bridge,
222 IN UINT8 StartBusNumber,
223 OUT UINT8 *SubBusNumber,
224 OUT UINT8 *PaddedBusRange
225 )
226 ;
227
228 EFI_STATUS
229 PciScanBus_WithoutHotPlugDeviceSupport (
230 IN PCI_IO_DEVICE *Bridge,
231 IN UINT8 StartBusNumber,
232 OUT UINT8 *SubBusNumber,
233 OUT UINT8 *PaddedBusRange
234 )
235 ;
236
237 EFI_STATUS
238 PciRootBridgeP2CProcess (
239 IN PCI_IO_DEVICE *Bridge
240 )
241 /**
242
243 Routine Description:
244
245 TODO: Add function description
246
247 Arguments:
248
249 Bridge - TODO: add argument description
250
251 Returns:
252
253 TODO: add return values
254
255 **/
256 ;
257
258 EFI_STATUS
259 PciHostBridgeP2CProcess (
260 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc
261 )
262 /**
263
264 Routine Description:
265
266 TODO: Add function description
267
268 Arguments:
269
270 PciResAlloc - TODO: add argument description
271
272 Returns:
273
274 TODO: add return values
275
276 **/
277 ;
278
279 EFI_STATUS
280 PciHostBridgeEnumerator (
281 EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc
282 )
283 /**
284
285 Routine Description:
286
287 TODO: Add function description
288
289 Arguments:
290
291 PciResAlloc - TODO: add argument description
292
293 Returns:
294
295 TODO: add return values
296
297 **/
298 ;
299
300 /**
301 Read PCI configuration space through EFI_PCI_IO_PROTOCOL.
302
303 @param PciIo A pointer to the EFI_PCI_O_PROTOCOL.
304 @param Width Signifies the width of the memory operations.
305 @Param Address The address within the PCI configuration space for the PCI controller.
306 @param Buffer For read operations, the destination buffer to store the results. For
307 write operations, the source buffer to write data from.
308
309 @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
310 @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
311 @retval EFI_INVALID_PARAMETER Buffer is NULL.
312 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
313
314 **/
315 EFI_STATUS
316 PciIoRead (
317 IN EFI_PCI_IO_PROTOCOL *PciIo,
318 IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
319 IN UINT32 Address,
320 IN UINTN Count,
321 IN OUT VOID *Buffer
322 );
323
324 /**
325 Write PCI configuration space through EFI_PCI_IO_PROTOCOL.
326
327 @param PciIo A pointer to the EFI_PCI_O_PROTOCOL.
328 @param Width Signifies the width of the memory operations.
329 @Param Address The address within the PCI configuration space for the PCI controller.
330 @param Buffer For read operations, the destination buffer to store the results. For
331 write operations, the source buffer to write data from.
332
333 @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
334 @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
335 @retval EFI_INVALID_PARAMETER Buffer is NULL.
336 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
337
338 **/
339 EFI_STATUS
340 PciIoWrite (
341 IN EFI_PCI_IO_PROTOCOL *PciIo,
342 IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
343 IN UINT32 Address,
344 IN UINTN Count,
345 IN OUT VOID *Buffer
346 );
347
348 /**
349 Write PCI configuration space through EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
350
351 @param PciRootBridgeIo A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
352 @param Pci A pointer to PCI_TYPE00.
353 @param Width Signifies the width of the memory operations.
354 @Param Address The address within the PCI configuration space for the PCI controller.
355 @param Buffer For read operations, the destination buffer to store the results. For
356 write operations, the source buffer to write data from.
357
358 @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
359 @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
360 @retval EFI_INVALID_PARAMETER Buffer is NULL.
361 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
362
363 **/
364 EFI_STATUS
365 PciRootBridgeIoWrite (
366 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo,
367 IN PCI_TYPE00 *Pci,
368 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
369 IN UINT64 Address,
370 IN UINTN Count,
371 IN OUT VOID *Buffer
372 );
373
374 /**
375 Read PCI configuration space through EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
376
377 @param PciRootBridgeIo A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
378 @param Pci A pointer to PCI_TYPE00.
379 @param Width Signifies the width of the memory operations.
380 @Param Address The address within the PCI configuration space for the PCI controller.
381 @param Buffer For read operations, the destination buffer to store the results. For
382 write operations, the source buffer to write data from.
383
384 @retval EFI_SUCCESS The data was read from or written to the PCI root bridge.
385 @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.
386 @retval EFI_INVALID_PARAMETER Buffer is NULL.
387 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
388
389 **/
390 EFI_STATUS
391 PciRootBridgeIoRead (
392 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo,
393 IN PCI_TYPE00 *Pci,
394 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
395 IN UINT64 Address,
396 IN UINTN Count,
397 IN OUT VOID *Buffer
398 );
399 #endif