]>
Commit | Line | Data |
---|---|---|
a1f11f75 | 1 | /** @file\r |
2 | Header file for IDE controller driver.\r | |
3 | \r | |
95d48e82 HT |
4 | Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>\r |
5 | This program and the accompanying materials \r | |
a1f11f75 | 6 | are licensed and made available under the terms and conditions of the BSD License \r |
7 | which accompanies this distribution. The full text of the license may be found at \r | |
8 | http://opensource.org/licenses/bsd-license.php \r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _IDE_CONTROLLER_H\r | |
16 | #define _IDE_CONTROLLER_H\r | |
17 | \r | |
18 | #include <Uefi.h>\r | |
19 | #include <Protocol/ComponentName.h>\r | |
20 | #include <Protocol/DriverBinding.h>\r | |
21 | #include <Protocol/PciIo.h>\r | |
22 | #include <Protocol/IdeControllerInit.h>\r | |
23 | #include <Library/UefiDriverEntryPoint.h>\r | |
24 | #include <Library/DebugLib.h>\r | |
25 | #include <Library/UefiLib.h>\r | |
26 | #include <Library/BaseLib.h>\r | |
27 | #include <Library/BaseMemoryLib.h>\r | |
28 | #include <Library/MemoryAllocationLib.h>\r | |
29 | #include <Library/UefiBootServicesTableLib.h>\r | |
30 | #include <IndustryStandard/Pci.h>\r | |
31 | \r | |
32 | //\r | |
33 | // Global Variables definitions\r | |
34 | //\r | |
35 | extern EFI_DRIVER_BINDING_PROTOCOL gIdeControllerDriverBinding;\r | |
36 | extern EFI_COMPONENT_NAME_PROTOCOL gIdeControllerComponentName;\r | |
37 | extern EFI_COMPONENT_NAME2_PROTOCOL gIdeControllerComponentName2;\r | |
38 | \r | |
39 | //\r | |
40 | // Supports 2 channel max\r | |
41 | //\r | |
42 | #define ICH_IDE_MAX_CHANNEL 0x02\r | |
43 | //\r | |
44 | // Supports 2 devices max\r | |
45 | //\r | |
46 | #define ICH_IDE_MAX_DEVICES 0x02\r | |
47 | #define ICH_IDE_ENUMER_ALL FALSE\r | |
48 | \r | |
49 | //\r | |
50 | // Driver binding functions declaration\r | |
51 | //\r | |
52 | EFI_STATUS\r | |
53 | EFIAPI\r | |
54 | IdeControllerSupported (\r | |
55 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
56 | IN EFI_HANDLE Controller,\r | |
57 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
58 | )\r | |
59 | /*++\r | |
60 | \r | |
61 | Routine Description:\r | |
62 | \r | |
63 | Register Driver Binding protocol for this driver.\r | |
64 | \r | |
65 | Arguments:\r | |
66 | \r | |
67 | This -- a pointer points to the Binding Protocol instance\r | |
68 | Controller -- The handle of controller to be tested. \r | |
69 | *RemainingDevicePath -- A pointer to the device path. Ignored by device\r | |
70 | driver but used by bus driver\r | |
71 | \r | |
72 | Returns:\r | |
73 | \r | |
74 | EFI_SUCCESS -- Driver loaded.\r | |
75 | other -- Driver not loaded.\r | |
76 | --*/\r | |
77 | ;\r | |
78 | \r | |
79 | EFI_STATUS\r | |
80 | EFIAPI\r | |
81 | IdeControllerStart (\r | |
82 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
83 | IN EFI_HANDLE Controller,\r | |
84 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
85 | )\r | |
86 | /*++\r | |
87 | \r | |
88 | Routine Description:\r | |
89 | \r | |
90 | This routine is called right after the .Supported() called and return \r | |
91 | EFI_SUCCESS. Notes: The supported protocols are checked but the Protocols\r | |
92 | are closed.\r | |
93 | \r | |
94 | Arguments:\r | |
95 | \r | |
96 | This -- a pointer points to the Binding Protocol instance\r | |
97 | Controller -- The handle of controller to be tested. Parameter\r | |
98 | passed by the caller\r | |
99 | *RemainingDevicePath -- A pointer to the device path. Should be ignored by\r | |
100 | device driver\r | |
101 | --*/\r | |
102 | ;\r | |
103 | \r | |
104 | EFI_STATUS\r | |
105 | EFIAPI\r | |
106 | IdeControllerStop (\r | |
107 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
108 | IN EFI_HANDLE Controller,\r | |
109 | IN UINTN NumberOfChildren,\r | |
110 | IN EFI_HANDLE *ChildHandleBuffer\r | |
111 | )\r | |
112 | /*++\r | |
113 | \r | |
114 | Routine Description:\r | |
115 | Stop this driver on Controller Handle. \r | |
116 | \r | |
117 | Arguments:\r | |
118 | This - Protocol instance pointer.\r | |
119 | Controller - Handle of device to stop driver on \r | |
120 | NumberOfChildren - Not used\r | |
121 | ChildHandleBuffer - Not used\r | |
122 | \r | |
123 | Returns:\r | |
124 | EFI_SUCCESS - This driver is removed DeviceHandle\r | |
125 | other - This driver was not removed from this device\r | |
126 | \r | |
127 | --*/\r | |
128 | ;\r | |
129 | \r | |
130 | //\r | |
131 | // IDE controller init functions declaration\r | |
132 | //\r | |
133 | EFI_STATUS\r | |
134 | EFIAPI\r | |
135 | IdeInitGetChannelInfo (\r | |
136 | IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r | |
137 | IN UINT8 Channel,\r | |
138 | OUT BOOLEAN *Enabled,\r | |
139 | OUT UINT8 *MaxDevices\r | |
140 | )\r | |
141 | /*++\r | |
142 | \r | |
143 | Routine Description:\r | |
144 | \r | |
145 | TODO: Add function description\r | |
146 | \r | |
147 | Arguments:\r | |
148 | \r | |
149 | This - TODO: add argument description\r | |
150 | Channel - TODO: add argument description\r | |
151 | Enabled - TODO: add argument description\r | |
152 | MaxDevices - TODO: add argument description\r | |
153 | \r | |
154 | Returns:\r | |
155 | \r | |
156 | TODO: add return values\r | |
157 | \r | |
158 | --*/\r | |
159 | ;\r | |
160 | \r | |
161 | EFI_STATUS\r | |
162 | EFIAPI\r | |
163 | IdeInitNotifyPhase (\r | |
164 | IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r | |
165 | IN EFI_IDE_CONTROLLER_ENUM_PHASE Phase,\r | |
166 | OUT UINT8 Channel\r | |
167 | )\r | |
168 | /*++\r | |
169 | \r | |
170 | Routine Description:\r | |
171 | \r | |
172 | TODO: Add function description\r | |
173 | \r | |
174 | Arguments:\r | |
175 | \r | |
176 | This - TODO: add argument description\r | |
177 | Phase - TODO: add argument description\r | |
178 | Channel - TODO: add argument description\r | |
179 | \r | |
180 | Returns:\r | |
181 | \r | |
182 | TODO: add return values\r | |
183 | \r | |
184 | --*/\r | |
185 | ;\r | |
186 | \r | |
187 | EFI_STATUS\r | |
188 | EFIAPI\r | |
189 | IdeInitSubmitData (\r | |
190 | IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r | |
191 | IN UINT8 Channel,\r | |
192 | IN UINT8 Device,\r | |
193 | IN EFI_IDENTIFY_DATA *IdentifyData\r | |
194 | )\r | |
195 | /*++\r | |
196 | \r | |
197 | Routine Description:\r | |
198 | \r | |
199 | TODO: Add function description\r | |
200 | \r | |
201 | Arguments:\r | |
202 | \r | |
203 | This - TODO: add argument description\r | |
204 | Channel - TODO: add argument description\r | |
205 | Device - TODO: add argument description\r | |
206 | IdentifyData - TODO: add argument description\r | |
207 | \r | |
208 | Returns:\r | |
209 | \r | |
210 | TODO: add return values\r | |
211 | \r | |
212 | --*/\r | |
213 | ;\r | |
214 | \r | |
215 | EFI_STATUS\r | |
216 | EFIAPI\r | |
217 | IdeInitSubmitFailingModes (\r | |
218 | IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r | |
219 | IN UINT8 Channel,\r | |
220 | IN UINT8 Device\r | |
221 | )\r | |
222 | /*++\r | |
223 | \r | |
224 | Routine Description:\r | |
225 | \r | |
226 | TODO: Add function description\r | |
227 | \r | |
228 | Arguments:\r | |
229 | \r | |
230 | This - TODO: add argument description\r | |
231 | Channel - TODO: add argument description\r | |
232 | Device - TODO: add argument description\r | |
233 | \r | |
234 | Returns:\r | |
235 | \r | |
236 | TODO: add return values\r | |
237 | \r | |
238 | --*/\r | |
239 | ;\r | |
240 | \r | |
241 | EFI_STATUS\r | |
242 | EFIAPI\r | |
243 | IdeInitDisqualifyMode (\r | |
244 | IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r | |
245 | IN UINT8 Channel,\r | |
246 | IN UINT8 Device,\r | |
247 | IN EFI_ATA_COLLECTIVE_MODE *BadModes\r | |
248 | )\r | |
249 | /*++\r | |
250 | \r | |
251 | Routine Description:\r | |
252 | \r | |
253 | TODO: Add function description\r | |
254 | \r | |
255 | Arguments:\r | |
256 | \r | |
257 | This - TODO: add argument description\r | |
258 | Channel - TODO: add argument description\r | |
259 | Device - TODO: add argument description\r | |
260 | BadModes - TODO: add argument description\r | |
261 | \r | |
262 | Returns:\r | |
263 | \r | |
264 | TODO: add return values\r | |
265 | \r | |
266 | --*/\r | |
267 | ;\r | |
268 | \r | |
269 | EFI_STATUS\r | |
270 | EFIAPI\r | |
271 | IdeInitCalculateMode (\r | |
272 | IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r | |
273 | IN UINT8 Channel,\r | |
274 | IN UINT8 Device,\r | |
275 | IN EFI_ATA_COLLECTIVE_MODE **SupportedModes\r | |
276 | )\r | |
277 | /*++\r | |
278 | \r | |
279 | Routine Description:\r | |
280 | \r | |
281 | TODO: Add function description\r | |
282 | \r | |
283 | Arguments:\r | |
284 | \r | |
285 | This - TODO: add argument description\r | |
286 | Channel - TODO: add argument description\r | |
287 | Device - TODO: add argument description\r | |
288 | SupportedModes - TODO: add argument description\r | |
289 | \r | |
290 | Returns:\r | |
291 | \r | |
292 | TODO: add return values\r | |
293 | \r | |
294 | --*/\r | |
295 | ;\r | |
296 | \r | |
297 | EFI_STATUS\r | |
298 | EFIAPI\r | |
299 | IdeInitSetTiming (\r | |
300 | IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r | |
301 | IN UINT8 Channel,\r | |
302 | IN UINT8 Device,\r | |
303 | IN EFI_ATA_COLLECTIVE_MODE *Modes\r | |
304 | )\r | |
305 | /*++\r | |
306 | \r | |
307 | Routine Description:\r | |
308 | \r | |
309 | TODO: Add function description\r | |
310 | \r | |
311 | Arguments:\r | |
312 | \r | |
313 | This - TODO: add argument description\r | |
314 | Channel - TODO: add argument description\r | |
315 | Device - TODO: add argument description\r | |
316 | Modes - TODO: add argument description\r | |
317 | \r | |
318 | Returns:\r | |
319 | \r | |
320 | TODO: add return values\r | |
321 | \r | |
322 | --*/\r | |
323 | ;\r | |
324 | \r | |
325 | //\r | |
326 | // Forward reference declaration\r | |
327 | //\r | |
328 | EFI_STATUS\r | |
329 | EFIAPI\r | |
330 | IdeControllerComponentNameGetDriverName (\r | |
331 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
332 | IN CHAR8 *Language,\r | |
333 | OUT CHAR16 **DriverName\r | |
334 | )\r | |
335 | /*++\r | |
336 | \r | |
337 | Routine Description:\r | |
338 | Retrieves a Unicode string that is the user readable name of the EFI Driver.\r | |
339 | \r | |
340 | Arguments:\r | |
341 | This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
342 | Language - A pointer to a three character ISO 639-2 language identifier.\r | |
343 | This is the language of the driver name that that the caller \r | |
344 | is requesting, and it must match one of the languages specified\r | |
345 | in SupportedLanguages. The number of languages supported by a \r | |
346 | driver is up to the driver writer.\r | |
347 | DriverName - A pointer to the Unicode string to return. This Unicode string\r | |
348 | is the name of the driver specified by This in the language \r | |
349 | specified by Language.\r | |
350 | \r | |
351 | Returns:\r | |
352 | EFI_SUCCESS - The Unicode string for the Driver specified by This\r | |
353 | and the language specified by Language was returned \r | |
354 | in DriverName.\r | |
355 | EFI_INVALID_PARAMETER - Language is NULL.\r | |
356 | EFI_INVALID_PARAMETER - DriverName is NULL.\r | |
357 | EFI_UNSUPPORTED - The driver specified by This does not support the \r | |
358 | language specified by Language.\r | |
359 | \r | |
360 | --*/\r | |
361 | ;\r | |
362 | \r | |
363 | EFI_STATUS\r | |
364 | EFIAPI\r | |
365 | IdeControllerComponentNameGetControllerName (\r | |
366 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
367 | IN EFI_HANDLE ControllerHandle,\r | |
368 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
369 | IN CHAR8 *Language,\r | |
370 | OUT CHAR16 **ControllerName\r | |
371 | )\r | |
372 | /*++\r | |
373 | \r | |
374 | Routine Description:\r | |
375 | Retrieves a Unicode string that is the user readable name of the controller\r | |
376 | that is being managed by an EFI Driver.\r | |
377 | \r | |
378 | Arguments:\r | |
379 | This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
380 | ControllerHandle - The handle of a controller that the driver specified by \r | |
381 | This is managing. This handle specifies the controller \r | |
382 | whose name is to be returned.\r | |
383 | ChildHandle - The handle of the child controller to retrieve the name \r | |
384 | of. This is an optional parameter that may be NULL. It \r | |
385 | will be NULL for device drivers. It will also be NULL \r | |
386 | for a bus drivers that wish to retrieve the name of the \r | |
387 | bus controller. It will not be NULL for a bus driver \r | |
388 | that wishes to retrieve the name of a child controller.\r | |
389 | Language - A pointer to a three character ISO 639-2 language \r | |
390 | identifier. This is the language of the controller name \r | |
391 | that that the caller is requesting, and it must match one\r | |
392 | of the languages specified in SupportedLanguages. The \r | |
393 | number of languages supported by a driver is up to the \r | |
394 | driver writer.\r | |
395 | ControllerName - A pointer to the Unicode string to return. This Unicode\r | |
396 | string is the name of the controller specified by \r | |
397 | ControllerHandle and ChildHandle in the language \r | |
398 | specified by Language from the point of view of the \r | |
399 | driver specified by This. \r | |
400 | \r | |
401 | Returns:\r | |
402 | EFI_SUCCESS - The Unicode string for the user readable name in the \r | |
403 | language specified by Language for the driver \r | |
404 | specified by This was returned in DriverName.\r | |
405 | EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r | |
406 | EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid \r | |
407 | EFI_HANDLE.\r | |
408 | EFI_INVALID_PARAMETER - Language is NULL.\r | |
409 | EFI_INVALID_PARAMETER - ControllerName is NULL.\r | |
410 | EFI_UNSUPPORTED - The driver specified by This is not currently \r | |
411 | managing the controller specified by \r | |
412 | ControllerHandle and ChildHandle.\r | |
413 | EFI_UNSUPPORTED - The driver specified by This does not support the \r | |
414 | language specified by Language.\r | |
415 | \r | |
416 | --*/\r | |
417 | ;\r | |
418 | \r | |
419 | #endif\r |