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