]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.h
PcAtChipsetPkg/IsaAcpiDxe: Restore PCI attributes correctly
[mirror_edk2.git] / PcAtChipsetPkg / IsaAcpiDxe / PcatIsaAcpi.h
... / ...
CommitLineData
1/** @file\r
2 EFI PCAT ISA ACPI Driver for a Generic PC Platform\r
3\r
4Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials \r
6are licensed and made available under the terms and conditions of the BSD License \r
7which accompanies this distribution. The full text of the license may be found at \r
8http://opensource.org/licenses/bsd-license.php \r
9 \r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12\r
13**/\r
14\r
15#ifndef _PCAT_ISA_ACPI_H_\r
16#define _PCAT_ISA_ACPI_H_\r
17\r
18#include <PiDxe.h>\r
19\r
20#include <IndustryStandard/Pci.h>\r
21\r
22#include <Protocol/DevicePath.h>\r
23#include <Protocol/PciIo.h>\r
24#include <Protocol/IsaIo.h>\r
25#include <Protocol/DriverBinding.h>\r
26#include <Protocol/ComponentName.h>\r
27#include <Protocol/ComponentName2.h>\r
28\r
29\r
30#include <Library/UefiLib.h>\r
31#include <Library/UefiBootServicesTableLib.h>\r
32#include <Library/BaseMemoryLib.h>\r
33#include <Library/PcdLib.h>\r
34\r
35#include <Protocol/IsaAcpi.h>\r
36//\r
37// PCAT ISA ACPI device private data structure\r
38//\r
39#define PCAT_ISA_ACPI_DEV_SIGNATURE SIGNATURE_32('L','P','C','D')\r
40\r
41typedef struct {\r
42 UINTN Signature;\r
43 EFI_HANDLE Handle; \r
44 EFI_ISA_ACPI_PROTOCOL IsaAcpi;\r
45 EFI_PCI_IO_PROTOCOL *PciIo;\r
46 UINT64 OriginalAttributes;\r
47} PCAT_ISA_ACPI_DEV;\r
48\r
49#define PCAT_ISA_ACPI_DEV_FROM_THIS(a) BASE_CR(a, PCAT_ISA_ACPI_DEV, IsaAcpi)\r
50\r
51//\r
52// Global Variables\r
53//\r
54extern EFI_DRIVER_BINDING_PROTOCOL gPcatIsaAcpiDriverBinding;\r
55\r
56extern EFI_COMPONENT_NAME2_PROTOCOL gPcatIsaAcpiComponentName2;\r
57\r
58extern EFI_COMPONENT_NAME_PROTOCOL gPcatIsaAcpiComponentName;\r
59\r
60\r
61//\r
62// Prototypes for Driver model protocol interface\r
63//\r
64/**\r
65 ControllerDriver Protocol Method\r
66\r
67 @param This Driver Binding protocol instance pointer. \r
68 @param Controller Handle of device to test.\r
69 @param RemainingDevicePath Optional parameter use to pick a specific child\r
70 device to start.\r
71 @retval EFI_SUCCESS This driver supports this device.\r
72 @retval other This driver does not support this device.\r
73\r
74**/\r
75EFI_STATUS\r
76EFIAPI\r
77PcatIsaAcpiDriverBindingSupported (\r
78 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
79 IN EFI_HANDLE Controller,\r
80 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
81 );\r
82\r
83/**\r
84 Install EFI_ISA_ACPI_PROTOCOL.\r
85\r
86 @param This Driver Binding protocol instance pointer.\r
87 @param ControllerHandle Handle of device to bind driver to.\r
88 @param RemainingDevicePath Optional parameter use to pick a specific child\r
89 device to start.\r
90\r
91 @retval EFI_SUCCESS This driver is added to ControllerHandle\r
92 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle\r
93 @retval other This driver does not support this device\r
94**/\r
95EFI_STATUS\r
96EFIAPI\r
97PcatIsaAcpiDriverBindingStart (\r
98 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
99 IN EFI_HANDLE Controller,\r
100 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
101 );\r
102\r
103/**\r
104 Stop this driver on ControllerHandle. Support stopping any child handles\r
105 created by this driver.\r
106\r
107 @param This Protocol instance pointer.\r
108 @param ControllerHandle Handle of device to stop driver on\r
109 @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of\r
110 children is zero stop the entire bus driver.\r
111 @param ChildHandleBuffer List of Child Handles to Stop.\r
112\r
113 @retval EFI_SUCCESS This driver is removed ControllerHandle\r
114 @retval other This driver was not removed from this device\r
115\r
116**/\r
117EFI_STATUS\r
118EFIAPI\r
119PcatIsaAcpiDriverBindingStop (\r
120 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
121 IN EFI_HANDLE Controller,\r
122 IN UINTN NumberOfChildren,\r
123 IN EFI_HANDLE *ChildHandleBuffer\r
124 );\r
125\r
126//\r
127// Prototypes for the ISA ACPI protocol interface\r
128//\r
129/**\r
130 Enumerate the ISA devices on the ISA bus\r
131\r
132\r
133 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL\r
134 @param Device Point to device ID instance \r
135\r
136 @retval EFI_NOT_FOUND Can not found the next Isa device.\r
137 @retval EFI_SUCCESS Success retrieve the next Isa device for enumration.\r
138\r
139**/\r
140EFI_STATUS\r
141EFIAPI\r
142IsaDeviceEnumerate (\r
143 IN EFI_ISA_ACPI_PROTOCOL *This,\r
144 OUT EFI_ISA_ACPI_DEVICE_ID **Device\r
145 );\r
146\r
147/**\r
148 Set ISA device power\r
149\r
150\r
151 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL\r
152 @param Device Point to device ID instance \r
153 @param OnOff TRUE for setting isa device power on,\r
154 FALSE for setting isa device power off\r
155\r
156 @return EFI_SUCCESS Success to change power status for isa device.\r
157**/\r
158EFI_STATUS\r
159EFIAPI\r
160IsaDeviceSetPower (\r
161 IN EFI_ISA_ACPI_PROTOCOL *This,\r
162 IN EFI_ISA_ACPI_DEVICE_ID *Device,\r
163 IN BOOLEAN OnOff\r
164 );\r
165 \r
166/**\r
167 Get current resource for the specific ISA device.\r
168\r
169 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL\r
170 @param Device Point to device ID instance \r
171 @param ResourceList On return, point to resources instances for given isa device\r
172\r
173 @retval EFI_NOT_FOUND Can not found the resource instance for given isa device\r
174 @retval EFI_SUCCESS Success to get resource instance for given isa device.\r
175**/\r
176EFI_STATUS\r
177EFIAPI\r
178IsaGetCurrentResource (\r
179 IN EFI_ISA_ACPI_PROTOCOL *This,\r
180 IN EFI_ISA_ACPI_DEVICE_ID *Device,\r
181 OUT EFI_ISA_ACPI_RESOURCE_LIST **ResourceList\r
182 );\r
183 \r
184/**\r
185 Get possible resource for the specific ISA device.\r
186 \r
187 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL\r
188 @param Device Point to device ID instance \r
189 @param ResourceList On return, point to resources instances for given isa device\r
190\r
191 @retval EFI_SUCCESS Success to get resource instance for given isa device.\r
192**/\r
193EFI_STATUS\r
194EFIAPI\r
195IsaGetPossibleResource (\r
196 IN EFI_ISA_ACPI_PROTOCOL *This,\r
197 IN EFI_ISA_ACPI_DEVICE_ID *Device, \r
198 OUT EFI_ISA_ACPI_RESOURCE_LIST **ResourceList\r
199 );\r
200 \r
201/**\r
202 Set resource for the specific ISA device.\r
203\r
204 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL\r
205 @param Device Point to device ID instance \r
206 @param ResourceList Point to resources instances for given isa device\r
207\r
208 @return EFI_SUCCESS Success to set resource.\r
209\r
210**/\r
211EFI_STATUS\r
212EFIAPI\r
213IsaSetResource (\r
214 IN EFI_ISA_ACPI_PROTOCOL *This,\r
215 IN EFI_ISA_ACPI_DEVICE_ID *Device,\r
216 IN EFI_ISA_ACPI_RESOURCE_LIST *ResourceList\r
217 );\r
218 \r
219/**\r
220 Enable/Disable the specific ISA device.\r
221\r
222 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL\r
223 @param Device Point to device ID instance \r
224 @param Enable Enable/Disable\r
225\r
226 @return EFI_SUCCESS Success to enable/disable.\r
227\r
228**/\r
229EFI_STATUS\r
230EFIAPI\r
231IsaEnableDevice (\r
232 IN EFI_ISA_ACPI_PROTOCOL *This,\r
233 IN EFI_ISA_ACPI_DEVICE_ID *Device,\r
234 IN BOOLEAN Enable\r
235 );\r
236\r
237/**\r
238 Initialize the specific ISA device.\r
239\r
240 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL\r
241 @param Device Point to device ID instance \r
242\r
243 @return EFI_SUCCESS Success to initialize.\r
244\r
245**/\r
246EFI_STATUS\r
247EFIAPI\r
248IsaInitDevice (\r
249 IN EFI_ISA_ACPI_PROTOCOL *This,\r
250 IN EFI_ISA_ACPI_DEVICE_ID *Device\r
251 );\r
252 \r
253/**\r
254 Initialize the ISA interface.\r
255\r
256 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL\r
257\r
258 @return EFI_SUCCESS Success to initialize ISA interface.\r
259\r
260**/\r
261EFI_STATUS\r
262EFIAPI\r
263IsaInterfaceInit (\r
264 IN EFI_ISA_ACPI_PROTOCOL *This\r
265 ); \r
266\r
267/**\r
268 Initialize the ISA device list.\r
269**/\r
270VOID\r
271InitializePcatIsaAcpiDeviceList (\r
272 VOID\r
273 );\r
274\r
275#endif\r