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