]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/InternalIsaBus.h
Remove the EDK prefix from library instance folder's name
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Isa / IsaBusDxe / InternalIsaBus.h
CommitLineData
c3902377 1/*++\r
2\r
3e0578d2 3 Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
4 All rights reserved. This program and the accompanying materials\r
5 are licensed and made available under the terms and conditions of the BSD License\r
6 which accompanies this distribution. The full text of the license may be found at\r
7 http://opensource.org/licenses/bsd-license.php\r
8\r
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
c3902377 11\r
12Module Name:\r
13\r
14 IsaBus.h\r
15 \r
16Abstract:\r
17 \r
18 The header file for ISA bus driver\r
19 \r
20Revision History:\r
21\r
22--*/\r
23\r
24#ifndef _EFI_ISA_BUS_H\r
25#define _EFI_ISA_BUS_H\r
26\r
27//\r
28// Include common header file for this module.\r
29//\r
30#include "CommonHeader.h"\r
31\r
32#include "ComponentName.h"\r
33\r
34extern EFI_ISA_IO_PROTOCOL IsaIoInterface;\r
35\r
36typedef enum {\r
37 IsaAccessTypeUnknown,\r
38 IsaAccessTypeIo,\r
39 IsaAccessTypeMem,\r
40 IsaAccessTypeMaxType\r
41} ISA_ACCESS_TYPE;\r
42\r
43//\r
44// 16 MB Memory Range\r
45//\r
46#define ISA_MAX_MEMORY_ADDRESS 0x1000000\r
47//\r
48// 64K I/O Range\r
49//\r
50#define ISA_MAX_IO_ADDRESS 0x10000\r
51\r
52typedef struct {\r
53 UINT8 Address;\r
54 UINT8 Page;\r
55 UINT8 Count;\r
56} EFI_ISA_DMA_REGISTERS;\r
57\r
58//\r
59// ISA I/O Device Structure\r
60//\r
61#define ISA_IO_DEVICE_SIGNATURE EFI_SIGNATURE_32 ('i', 's', 'a', 'i')\r
62\r
63typedef struct {\r
64 UINT32 Signature;\r
65 EFI_HANDLE Handle;\r
66 EFI_ISA_IO_PROTOCOL IsaIo;\r
67 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
68 EFI_PCI_IO_PROTOCOL *PciIo;\r
69} ISA_IO_DEVICE;\r
70\r
71#define ISA_IO_DEVICE_FROM_ISA_IO_THIS(a) CR (a, ISA_IO_DEVICE, IsaIo, ISA_IO_DEVICE_SIGNATURE)\r
72\r
73//\r
74// Global Variables\r
75//\r
76extern EFI_DRIVER_BINDING_PROTOCOL gIsaBusControllerDriver;\r
77\r
78//\r
79// Mapping structure for performing ISA DMA to a buffer above 16 MB\r
80//\r
81typedef struct {\r
82 EFI_ISA_IO_PROTOCOL_OPERATION Operation;\r
83 UINTN NumberOfBytes;\r
84 UINTN NumberOfPages;\r
85 EFI_PHYSICAL_ADDRESS HostAddress;\r
86 EFI_PHYSICAL_ADDRESS MappedHostAddress;\r
87} ISA_MAP_INFO;\r
88\r
89//\r
90// EFI Driver Binding Protocol Interface Functions\r
91//\r
92\r
93EFI_STATUS\r
94EFIAPI\r
95IsaBusControllerDriverSupported (\r
96 IN EFI_DRIVER_BINDING_PROTOCOL * This,\r
97 IN EFI_HANDLE Controller,\r
98 IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL\r
99 )\r
100/*++\r
101\r
102 Routine Description:\r
103 \r
104 This function checks to see if a controller can be managed by the ISA Bus \r
105 Driver. This is done by checking to see if the controller supports the \r
106 EFI_PCI_IO_PROTOCOL protocol, and then looking at the PCI Configuration \r
107 Header to see if the device is a PCI to ISA bridge. The class code of \r
108 PCI to ISA bridge: Base class 06h, Sub class 01h Interface 00h \r
109 \r
110 Arguments:\r
111 \r
112 This - The EFI_DRIVER_BINDING_PROTOCOL instance.\r
113 Controller - The handle of the device to check.\r
114 RemainingDevicePath - A pointer to the remaining portion of a device path.\r
115\r
116 Returns:\r
117 \r
118 EFI_SUCCESS - The device is supported by this driver.\r
119 EFI_UNSUPPORTED - The device is not supported by this driver.\r
120\r
121--*/\r
122;\r
123\r
124EFI_STATUS\r
125EFIAPI\r
126IsaBusControllerDriverStart (\r
127 IN EFI_DRIVER_BINDING_PROTOCOL * This,\r
128 IN EFI_HANDLE Controller,\r
129 IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL\r
130 )\r
131/*++\r
132\r
133 Routine Description:\r
134 \r
135 This function tells the ISA Bus Driver to start managing a PCI to ISA \r
136 Bridge controller. \r
137 \r
138 Arguments:\r
139 \r
140 This - The EFI_DRIVER_BINDING_PROTOCOL instance.\r
141 Controller - A handle to the device being started. \r
142 RemainingDevicePath - A pointer to the remaining portion of a device path.\r
143\r
144 Returns:\r
145 \r
146 EFI_SUCCESS - The device was started.\r
147 EFI_UNSUPPORTED - The device is not supported.\r
148 EFI_DEVICE_ERROR - The device could not be started due to a device error.\r
149 EFI_ALREADY_STARTED - The device has already been started.\r
150 EFI_INVALID_PARAMETER - One of the parameters has an invalid value.\r
151 EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of \r
152 resources.\r
153 \r
154--*/\r
155;\r
156\r
157EFI_STATUS\r
158EFIAPI\r
159IsaBusControllerDriverStop (\r
160 IN EFI_DRIVER_BINDING_PROTOCOL * This,\r
161 IN EFI_HANDLE Controller,\r
162 IN UINTN NumberOfChildren,\r
163 IN EFI_HANDLE * ChildHandleBuffer OPTIONAL\r
164 )\r
165/*++\r
166\r
167 Routine Description:\r
168 \r
169 This function tells the ISA Bus Driver to stop managing a PCI to ISA \r
170 Bridge controller. \r
171 \r
172 Arguments:\r
173 \r
174 This - The EFI_DRIVER_BINDING_PROTOCOL instance.\r
175 Controller - A handle to the device being stopped.\r
176 NumberOfChindren - The number of child device handles in ChildHandleBuffer.\r
177 ChildHandleBuffer - An array of child handles to be freed.\r
178\r
179 \r
180 Returns:\r
181 \r
182 EFI_SUCCESS - The device was stopped.\r
183 EFI_DEVICE_ERROR - The device could not be stopped due to a device error.\r
184 EFI_NOT_STARTED - The device has not been started.\r
185 EFI_INVALID_PARAMETER - One of the parameters has an invalid value.\r
186 EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of \r
187 resources.\r
188\r
189--*/\r
190;\r
191\r
192//\r
193// Function Prototypes\r
194//\r
195\r
196EFI_STATUS\r
197IsaCreateDevice (\r
198 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
199 IN EFI_HANDLE Controller,\r
200 IN EFI_PCI_IO_PROTOCOL *PciIo,\r
201 IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,\r
202 IN EFI_ISA_ACPI_RESOURCE_LIST *IsaDeviceResourceList,\r
203 OUT EFI_DEVICE_PATH_PROTOCOL **ChildDevicePath\r
204 )\r
205/*++\r
206\r
207 Routine Description:\r
208 \r
209 Create ISA device found by IsaPnpProtocol \r
210\r
211 Arguments:\r
212 \r
213 This - The EFI_DRIVER_BINDING_PROTOCOL instance.\r
214 Controller - The handle of ISA bus controller(PCI to ISA bridge)\r
215 PciIo - The Pointer to the PCI protocol \r
216 ParentDevicePath - Device path of the ISA bus controller\r
217 IsaDeviceResourceList - The resource list of the ISA device\r
218 ChildDevicePath - The pointer to the child device.\r
219\r
220 Returns:\r
221 \r
222 EFI_SUCCESS - Create the child device.\r
223 EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of \r
224 resources.\r
225 EFI_DEVICE_ERROR - Can not create child device.\r
226 \r
227--*/\r
228;\r
229\r
230EFI_STATUS\r
231InitializeIsaIoInstance (\r
232 IN ISA_IO_DEVICE *IsaIoDevice,\r
233 IN EFI_ISA_ACPI_RESOURCE_LIST *IsaDevice\r
234 )\r
235/*++\r
236\r
237Routine Description:\r
238\r
239 Initializes an ISA I/O Instance\r
240\r
241Arguments:\r
242\r
243 IsaIoDevice - The iso device to be initialized.\r
244 IsaDevice - The resource list.\r
245 \r
246Returns:\r
247\r
248 EFI_SUCCESS - Initial success.\r
249 \r
250--*/\r
251;\r
252\r
253#endif\r