2 EFI PCAT ISA ACPI Driver for a Generic PC Platform
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
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.
15 #ifndef _PCAT_ISA_ACPI_H_
16 #define _PCAT_ISA_ACPI_H_
20 #include <IndustryStandard/Pci.h>
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>
30 #include <Library/UefiLib.h>
31 #include <Library/UefiBootServicesTableLib.h>
33 #include <Protocol/IsaAcpi.h>
35 // PCAT ISA ACPI device private data structure
37 #define PCAT_ISA_ACPI_DEV_SIGNATURE SIGNATURE_32('L','P','C','D')
42 EFI_ISA_ACPI_PROTOCOL IsaAcpi
;
43 EFI_PCI_IO_PROTOCOL
*PciIo
;
46 #define PCAT_ISA_ACPI_DEV_FROM_THIS(a) BASE_CR(a, PCAT_ISA_ACPI_DEV, IsaAcpi)
51 extern EFI_DRIVER_BINDING_PROTOCOL gPcatIsaAcpiDriverBinding
;
53 extern EFI_COMPONENT_NAME2_PROTOCOL gPcatIsaAcpiComponentName2
;
55 extern EFI_COMPONENT_NAME_PROTOCOL gPcatIsaAcpiComponentName
;
59 // Prototypes for Driver model protocol interface
62 ControllerDriver Protocol Method
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
68 @retval EFI_SUCCESS This driver supports this device.
69 @retval other This driver does not support this device.
74 PcatIsaAcpiDriverBindingSupported (
75 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
76 IN EFI_HANDLE Controller
,
77 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
81 Install EFI_ISA_ACPI_PROTOCOL.
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
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
94 PcatIsaAcpiDriverBindingStart (
95 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
96 IN EFI_HANDLE Controller
,
97 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
101 Stop this driver on ControllerHandle. Support stopping any child handles
102 created by this driver.
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.
110 @retval EFI_SUCCESS This driver is removed ControllerHandle
111 @retval other This driver was not removed from this device
116 PcatIsaAcpiDriverBindingStop (
117 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
118 IN EFI_HANDLE Controller
,
119 IN UINTN NumberOfChildren
,
120 IN EFI_HANDLE
*ChildHandleBuffer
124 // Prototypes for the ISA ACPI protocol interface
127 Enumerate the ISA devices on the ISA bus
130 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
131 @param Device Point to device ID instance
133 @retval EFI_NOT_FOUND Can not found the next Isa device.
134 @retval EFI_SUCESS Success retrieve the next Isa device for enumration.
140 IN EFI_ISA_ACPI_PROTOCOL
*This
,
141 OUT EFI_ISA_ACPI_DEVICE_ID
**Device
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
153 @return EFI_SUCCESS Sucess to change power status for isa device.
158 IN EFI_ISA_ACPI_PROTOCOL
*This
,
159 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
164 Get current resource for the specific ISA device.
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
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.
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
182 Get possible resource for the specific ISA device.
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
188 @retval EFI_SUCCESS Success to get resource instance for given isa device.
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
199 Set resource for the specific ISA device.
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
205 @return EFI_SUCESS Success to set resource.
211 IN EFI_ISA_ACPI_PROTOCOL
*This
,
212 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
213 IN EFI_ISA_ACPI_RESOURCE_LIST
*ResourceList
217 Enable/Disable the specific ISA device.
219 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
220 @param Device Point to device ID instance
221 @param Enable Enable/Disable
223 @return EFI_SUCESS Success to enable/disable.
229 IN EFI_ISA_ACPI_PROTOCOL
*This
,
230 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
235 Initialize the specific ISA device.
237 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
238 @param Device Point to device ID instance
240 @return EFI_SUCESS Success to initialize.
246 IN EFI_ISA_ACPI_PROTOCOL
*This
,
247 IN EFI_ISA_ACPI_DEVICE_ID
*Device
251 Initialize the ISA interface.
253 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
255 @return EFI_SUCESS Success to initialize ISA interface.
261 IN EFI_ISA_ACPI_PROTOCOL
*This