2 Header file for IDE controller driver.
4 Copyright (c) 2008 Intel Corporation. <BR>
5 All rights reserved. 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 _IDE_CONTROLLER_H
16 #define _IDE_CONTROLLER_H
19 #include <Protocol/ComponentName.h>
20 #include <Protocol/DriverBinding.h>
21 #include <Protocol/PciIo.h>
22 #include <Protocol/IdeControllerInit.h>
23 #include <Library/UefiDriverEntryPoint.h>
24 #include <Library/DebugLib.h>
25 #include <Library/UefiLib.h>
26 #include <Library/BaseLib.h>
27 #include <Library/BaseMemoryLib.h>
28 #include <Library/MemoryAllocationLib.h>
29 #include <Library/UefiBootServicesTableLib.h>
30 #include <IndustryStandard/Pci.h>
33 // Global Variables definitions
35 extern EFI_DRIVER_BINDING_PROTOCOL gIdeControllerDriverBinding
;
36 extern EFI_COMPONENT_NAME_PROTOCOL gIdeControllerComponentName
;
37 extern EFI_COMPONENT_NAME2_PROTOCOL gIdeControllerComponentName2
;
40 // Supports 2 channel max
42 #define ICH_IDE_MAX_CHANNEL 0x02
44 // Supports 2 devices max
46 #define ICH_IDE_MAX_DEVICES 0x02
47 #define ICH_IDE_ENUMER_ALL FALSE
50 // Driver binding functions declaration
54 IdeControllerSupported (
55 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
56 IN EFI_HANDLE Controller
,
57 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
63 Register Driver Binding protocol for this driver.
67 This -- a pointer points to the Binding Protocol instance
68 Controller -- The handle of controller to be tested.
69 *RemainingDevicePath -- A pointer to the device path. Ignored by device
70 driver but used by bus driver
74 EFI_SUCCESS -- Driver loaded.
75 other -- Driver not loaded.
82 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
83 IN EFI_HANDLE Controller
,
84 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
90 This routine is called right after the .Supported() called and return
91 EFI_SUCCESS. Notes: The supported protocols are checked but the Protocols
96 This -- a pointer points to the Binding Protocol instance
97 Controller -- The handle of controller to be tested. Parameter
99 *RemainingDevicePath -- A pointer to the device path. Should be ignored by
107 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
108 IN EFI_HANDLE Controller
,
109 IN UINTN NumberOfChildren
,
110 IN EFI_HANDLE
*ChildHandleBuffer
115 Stop this driver on Controller Handle.
118 This - Protocol instance pointer.
119 Controller - Handle of device to stop driver on
120 NumberOfChildren - Not used
121 ChildHandleBuffer - Not used
124 EFI_SUCCESS - This driver is removed DeviceHandle
125 other - This driver was not removed from this device
131 // IDE controller init functions declaration
135 IdeInitGetChannelInfo (
136 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
138 OUT BOOLEAN
*Enabled
,
139 OUT UINT8
*MaxDevices
145 TODO: Add function description
149 This - TODO: add argument description
150 Channel - TODO: add argument description
151 Enabled - TODO: add argument description
152 MaxDevices - TODO: add argument description
156 TODO: add return values
164 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
165 IN EFI_IDE_CONTROLLER_ENUM_PHASE Phase
,
172 TODO: Add function description
176 This - TODO: add argument description
177 Phase - TODO: add argument description
178 Channel - TODO: add argument description
182 TODO: add return values
190 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
193 IN EFI_IDENTIFY_DATA
*IdentifyData
199 TODO: Add function description
203 This - TODO: add argument description
204 Channel - TODO: add argument description
205 Device - TODO: add argument description
206 IdentifyData - TODO: add argument description
210 TODO: add return values
217 IdeInitSubmitFailingModes (
218 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
226 TODO: Add function description
230 This - TODO: add argument description
231 Channel - TODO: add argument description
232 Device - TODO: add argument description
236 TODO: add return values
243 IdeInitDisqualifyMode (
244 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
247 IN EFI_ATA_COLLECTIVE_MODE
*BadModes
253 TODO: Add function description
257 This - TODO: add argument description
258 Channel - TODO: add argument description
259 Device - TODO: add argument description
260 BadModes - TODO: add argument description
264 TODO: add return values
271 IdeInitCalculateMode (
272 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
275 IN EFI_ATA_COLLECTIVE_MODE
**SupportedModes
281 TODO: Add function description
285 This - TODO: add argument description
286 Channel - TODO: add argument description
287 Device - TODO: add argument description
288 SupportedModes - TODO: add argument description
292 TODO: add return values
300 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
303 IN EFI_ATA_COLLECTIVE_MODE
*Modes
309 TODO: Add function description
313 This - TODO: add argument description
314 Channel - TODO: add argument description
315 Device - TODO: add argument description
316 Modes - TODO: add argument description
320 TODO: add return values
326 // Forward reference declaration
330 IdeControllerComponentNameGetDriverName (
331 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
333 OUT CHAR16
**DriverName
338 Retrieves a Unicode string that is the user readable name of the EFI Driver.
341 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
342 Language - A pointer to a three character ISO 639-2 language identifier.
343 This is the language of the driver name that that the caller
344 is requesting, and it must match one of the languages specified
345 in SupportedLanguages. The number of languages supported by a
346 driver is up to the driver writer.
347 DriverName - A pointer to the Unicode string to return. This Unicode string
348 is the name of the driver specified by This in the language
349 specified by Language.
352 EFI_SUCCESS - The Unicode string for the Driver specified by This
353 and the language specified by Language was returned
355 EFI_INVALID_PARAMETER - Language is NULL.
356 EFI_INVALID_PARAMETER - DriverName is NULL.
357 EFI_UNSUPPORTED - The driver specified by This does not support the
358 language specified by Language.
365 IdeControllerComponentNameGetControllerName (
366 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
367 IN EFI_HANDLE ControllerHandle
,
368 IN EFI_HANDLE ChildHandle OPTIONAL
,
370 OUT CHAR16
**ControllerName
375 Retrieves a Unicode string that is the user readable name of the controller
376 that is being managed by an EFI Driver.
379 This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
380 ControllerHandle - The handle of a controller that the driver specified by
381 This is managing. This handle specifies the controller
382 whose name is to be returned.
383 ChildHandle - The handle of the child controller to retrieve the name
384 of. This is an optional parameter that may be NULL. It
385 will be NULL for device drivers. It will also be NULL
386 for a bus drivers that wish to retrieve the name of the
387 bus controller. It will not be NULL for a bus driver
388 that wishes to retrieve the name of a child controller.
389 Language - A pointer to a three character ISO 639-2 language
390 identifier. This is the language of the controller name
391 that that the caller is requesting, and it must match one
392 of the languages specified in SupportedLanguages. The
393 number of languages supported by a driver is up to the
395 ControllerName - A pointer to the Unicode string to return. This Unicode
396 string is the name of the controller specified by
397 ControllerHandle and ChildHandle in the language
398 specified by Language from the point of view of the
399 driver specified by This.
402 EFI_SUCCESS - The Unicode string for the user readable name in the
403 language specified by Language for the driver
404 specified by This was returned in DriverName.
405 EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
406 EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid
408 EFI_INVALID_PARAMETER - Language is NULL.
409 EFI_INVALID_PARAMETER - ControllerName is NULL.
410 EFI_UNSUPPORTED - The driver specified by This is not currently
411 managing the controller specified by
412 ControllerHandle and ChildHandle.
413 EFI_UNSUPPORTED - The driver specified by This does not support the
414 language specified by Language.