]>
Commit | Line | Data |
---|---|---|
9060e3ec | 1 | /** @file\r |
2 | Internal library declaration for PCI Bus module.\r | |
3 | \r | |
306bbe82 | 4 | Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r |
cd5ebaa0 | 5 | This program and the accompanying materials\r |
9060e3ec | 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 | **/\r | |
14 | \r | |
15 | #ifndef _EFI_PCI_LIB_H_\r | |
16 | #define _EFI_PCI_LIB_H_\r | |
17 | \r | |
18 | \r | |
19 | typedef struct {\r | |
20 | EFI_HANDLE Handle;\r | |
21 | } EFI_DEVICE_HANDLE_EXTENDED_DATA_PAYLOAD;\r | |
22 | \r | |
23 | typedef struct {\r | |
24 | UINT32 Bar;\r | |
25 | UINT16 DevicePathSize;\r | |
26 | UINT16 ReqResSize;\r | |
27 | UINT16 AllocResSize;\r | |
28 | UINT8 *DevicePath;\r | |
29 | UINT8 *ReqRes;\r | |
30 | UINT8 *AllocRes;\r | |
31 | } EFI_RESOURCE_ALLOC_FAILURE_ERROR_DATA_PAYLOAD;\r | |
32 | \r | |
33 | \r | |
34 | /**\r | |
35 | Retrieve the PCI Card device BAR information via PciIo interface.\r | |
36 | \r | |
37 | @param PciIoDevice PCI Card device instance.\r | |
38 | \r | |
39 | **/\r | |
40 | VOID\r | |
41 | GetBackPcCardBar (\r | |
42 | IN PCI_IO_DEVICE *PciIoDevice\r | |
43 | );\r | |
44 | \r | |
45 | /**\r | |
46 | Remove rejected pci device from specific root bridge\r | |
47 | handle.\r | |
48 | \r | |
49 | @param RootBridgeHandle Specific parent root bridge handle.\r | |
50 | @param Bridge Bridge device instance.\r | |
51 | \r | |
52 | **/\r | |
53 | VOID\r | |
54 | RemoveRejectedPciDevices (\r | |
55 | IN EFI_HANDLE RootBridgeHandle,\r | |
56 | IN PCI_IO_DEVICE *Bridge\r | |
57 | );\r | |
58 | \r | |
59 | /**\r | |
60 | Submits the I/O and memory resource requirements for the specified PCI Host Bridge.\r | |
61 | \r | |
62 | @param PciResAlloc Point to protocol instance of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.\r | |
63 | \r | |
64 | @retval EFI_SUCCESS Successfully finished resource allocation.\r | |
65 | @retval EFI_NOT_FOUND Cannot get root bridge instance.\r | |
66 | @retval EFI_OUT_OF_RESOURCES Platform failed to program the resources if no hot plug supported.\r | |
67 | @retval other Some error occurred when allocating resources for the PCI Host Bridge.\r | |
68 | \r | |
69 | @note Feature flag PcdPciBusHotplugDeviceSupport determine whether need support hotplug.\r | |
70 | \r | |
71 | **/\r | |
72 | EFI_STATUS\r | |
73 | PciHostBridgeResourceAllocator (\r | |
74 | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc\r | |
75 | );\r | |
76 | \r | |
306bbe82 | 77 | /**\r |
78 | Allocate NumberOfBuses buses and return the next available PCI bus number.\r | |
79 | \r | |
80 | @param Bridge Bridge device instance.\r | |
81 | @param StartBusNumber Current available PCI bus number.\r | |
82 | @param NumberOfBuses Number of buses enumerated below the StartBusNumber.\r | |
83 | @param NextBusNumber Next available PCI bus number.\r | |
84 | \r | |
85 | @retval EFI_SUCCESS Available bus number resource is enough. Next available PCI bus number\r | |
86 | is returned in NextBusNumber.\r | |
87 | @retval EFI_OUT_OF_RESOURCES Available bus number resource is not enough for allocation.\r | |
88 | \r | |
89 | **/\r | |
90 | EFI_STATUS\r | |
91 | PciAllocateBusNumber (\r | |
92 | IN PCI_IO_DEVICE *Bridge,\r | |
93 | IN UINT8 StartBusNumber,\r | |
94 | IN UINT8 NumberOfBuses,\r | |
95 | OUT UINT8 *NextBusNumber\r | |
96 | );\r | |
97 | \r | |
9060e3ec | 98 | /**\r |
99 | Scan pci bus and assign bus number to the given PCI bus system.\r | |
100 | \r | |
101 | @param Bridge Bridge device instance.\r | |
102 | @param StartBusNumber start point.\r | |
103 | @param SubBusNumber Point to sub bus number.\r | |
104 | @param PaddedBusRange Customized bus number.\r | |
105 | \r | |
106 | @retval EFI_SUCCESS Successfully scanned and assigned bus number.\r | |
107 | @retval other Some error occurred when scanning pci bus.\r | |
108 | \r | |
109 | @note Feature flag PcdPciBusHotplugDeviceSupport determine whether need support hotplug.\r | |
110 | \r | |
111 | **/\r | |
112 | EFI_STATUS\r | |
113 | PciScanBus (\r | |
114 | IN PCI_IO_DEVICE *Bridge,\r | |
115 | IN UINT8 StartBusNumber,\r | |
116 | OUT UINT8 *SubBusNumber,\r | |
117 | OUT UINT8 *PaddedBusRange\r | |
118 | );\r | |
119 | \r | |
120 | /**\r | |
121 | Process Option Rom on the specified root bridge.\r | |
122 | \r | |
123 | @param Bridge Pci root bridge device instance.\r | |
124 | \r | |
125 | @retval EFI_SUCCESS Success process.\r | |
126 | @retval other Some error occurred when processing Option Rom on the root bridge.\r | |
127 | \r | |
128 | **/\r | |
129 | EFI_STATUS\r | |
130 | PciRootBridgeP2CProcess (\r | |
131 | IN PCI_IO_DEVICE *Bridge\r | |
132 | );\r | |
133 | \r | |
134 | /**\r | |
135 | Process Option Rom on the specified host bridge.\r | |
136 | \r | |
137 | @param PciResAlloc Pointer to instance of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.\r | |
138 | \r | |
139 | @retval EFI_SUCCESS Success process.\r | |
140 | @retval EFI_NOT_FOUND Can not find the root bridge instance.\r | |
141 | @retval other Some error occurred when processing Option Rom on the host bridge.\r | |
142 | \r | |
143 | **/\r | |
144 | EFI_STATUS\r | |
145 | PciHostBridgeP2CProcess (\r | |
146 | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc\r | |
147 | );\r | |
148 | \r | |
149 | /**\r | |
150 | This function is used to enumerate the entire host bridge\r | |
151 | in a given platform.\r | |
152 | \r | |
153 | @param PciResAlloc A pointer to the PCI Host Resource Allocation protocol.\r | |
154 | \r | |
155 | @retval EFI_SUCCESS Successfully enumerated the host bridge.\r | |
156 | @retval EFI_OUT_OF_RESOURCES No enough memory available.\r | |
157 | @retval other Some error occurred when enumerating the host bridge.\r | |
158 | \r | |
159 | **/\r | |
160 | EFI_STATUS\r | |
161 | PciHostBridgeEnumerator (\r | |
162 | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *PciResAlloc\r | |
163 | );\r | |
164 | \r | |
165 | #endif\r |