]>
Commit | Line | Data |
---|---|---|
ead42efc | 1 | /** @file\r |
2 | Header file for IDE Bus Driver.\r | |
3 | \r | |
c2d9a4d2 | 4 | Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r |
180a5a35 | 5 | This program and the accompanying materials\r |
694b922c | 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 | |
ead42efc | 9 | \r |
694b922c | 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 | |
ead42efc | 12 | \r |
13 | **/\r | |
14 | \r | |
eeefcb9d | 15 | #ifndef _IDE_BUS_H_\r |
16 | #define _IDE_BUS_H_\r | |
ead42efc | 17 | \r |
18 | \r | |
ed7748fe | 19 | \r |
694b922c | 20 | #include <FrameworkDxe.h>\r |
ed7748fe | 21 | \r |
ead42efc | 22 | #include <Protocol/IdeControllerInit.h>\r |
23 | #include <Protocol/BlockIo.h>\r | |
24 | #include <Protocol/PciIo.h>\r | |
25 | #include <Protocol/DiskInfo.h>\r | |
26 | #include <Protocol/DevicePath.h>\r | |
ed7748fe | 27 | \r |
ead42efc | 28 | #include <Library/DebugLib.h>\r |
29 | #include <Library/UefiDriverEntryPoint.h>\r | |
30 | #include <Library/BaseLib.h>\r | |
31 | #include <Library/UefiLib.h>\r | |
32 | #include <Library/BaseMemoryLib.h>\r | |
33 | #include <Library/ReportStatusCodeLib.h>\r | |
34 | #include <Library/MemoryAllocationLib.h>\r | |
35 | #include <Library/PerformanceLib.h>\r | |
36 | #include <Library/UefiBootServicesTableLib.h>\r | |
37 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
38 | #include <Library/DevicePathLib.h>\r | |
39 | \r | |
6a27a4eb | 40 | #include <Guid/EventGroup.h>\r |
41 | \r | |
7d1aa703 | 42 | #include <IndustryStandard/Pci.h>\r |
e89cde87 | 43 | #include "IdeData.h"\r |
ead42efc | 44 | \r |
9f6531d1 | 45 | //\r |
46 | // Global Variables\r | |
47 | //\r | |
48 | extern EFI_DRIVER_BINDING_PROTOCOL gIDEBusDriverBinding;\r | |
49 | extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL gIDEBusDriverDiagnostics;\r | |
50 | extern EFI_DRIVER_DIAGNOSTICS2_PROTOCOL gIDEBusDriverDiagnostics2;\r | |
51 | \r | |
ead42efc | 52 | //\r |
53 | // Extra Definition to porting\r | |
54 | //\r | |
ead42efc | 55 | #define MAX_IDE_DEVICE 4\r |
56 | #define MAX_IDE_CHANNELS 2\r | |
57 | #define MAX_IDE_DRIVES 2\r | |
58 | \r | |
59 | #define INVALID_DEVICE_TYPE 0xff\r | |
60 | #define ATA_DEVICE_TYPE 0x00\r | |
61 | #define ATAPI_DEVICE_TYPE 0x01\r | |
62 | \r | |
63 | typedef struct {\r | |
64 | BOOLEAN HaveScannedDevice[MAX_IDE_DEVICE];\r | |
65 | BOOLEAN DeviceFound[MAX_IDE_DEVICE];\r | |
66 | BOOLEAN DeviceProcessed[MAX_IDE_DEVICE];\r | |
67 | } IDE_BUS_DRIVER_PRIVATE_DATA;\r | |
68 | \r | |
f02bd376 | 69 | #define IDE_BLK_IO_DEV_SIGNATURE SIGNATURE_32 ('i', 'b', 'i', 'd')\r |
ead42efc | 70 | \r |
71 | typedef struct {\r | |
72 | UINT32 Signature;\r | |
73 | \r | |
74 | EFI_HANDLE Handle;\r | |
75 | EFI_BLOCK_IO_PROTOCOL BlkIo;\r | |
76 | EFI_BLOCK_IO_MEDIA BlkMedia;\r | |
77 | EFI_DISK_INFO_PROTOCOL DiskInfo;\r | |
78 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
79 | EFI_PCI_IO_PROTOCOL *PciIo;\r | |
80 | IDE_BUS_DRIVER_PRIVATE_DATA *IdeBusDriverPrivateData;\r | |
81 | \r | |
82 | //\r | |
83 | // Local Data for IDE interface goes here\r | |
84 | //\r | |
85 | EFI_IDE_CHANNEL Channel;\r | |
86 | EFI_IDE_DEVICE Device;\r | |
87 | UINT16 Lun;\r | |
88 | IDE_DEVICE_TYPE Type;\r | |
89 | \r | |
90 | IDE_BASE_REGISTERS *IoPort;\r | |
91 | UINT16 AtapiError;\r | |
92 | \r | |
e72ca438 | 93 | ATAPI_INQUIRY_DATA *InquiryData;\r |
94 | EFI_IDENTIFY_DATA *IdData;\r | |
ead42efc | 95 | ATA_PIO_MODE PioMode;\r |
96 | EFI_ATA_MODE UdmaMode;\r | |
97 | CHAR8 ModelName[41];\r | |
1e23bd8d | 98 | ATAPI_REQUEST_SENSE_DATA *SenseData;\r |
ead42efc | 99 | UINT8 SenseDataNumber;\r |
100 | UINT8 *Cache;\r | |
101 | \r | |
102 | //\r | |
103 | // ExitBootService Event, it is used to clear pending IDE interrupt\r | |
104 | //\r | |
105 | EFI_EVENT ExitBootServiceEvent;\r | |
106 | \r | |
107 | EFI_UNICODE_STRING_TABLE *ControllerNameTable;\r | |
108 | } IDE_BLK_IO_DEV;\r | |
109 | \r | |
110 | #include "ComponentName.h"\r | |
111 | \r | |
112 | #define IDE_BLOCK_IO_DEV_FROM_THIS(a) CR (a, IDE_BLK_IO_DEV, BlkIo, IDE_BLK_IO_DEV_SIGNATURE)\r | |
113 | #define IDE_BLOCK_IO_DEV_FROM_DISK_INFO_THIS(a) CR (a, IDE_BLK_IO_DEV, DiskInfo, IDE_BLK_IO_DEV_SIGNATURE)\r | |
114 | \r | |
e89cde87 | 115 | #include "Ide.h"\r |
ead42efc | 116 | \r |
ead42efc | 117 | \r |
118 | /**\r | |
630d580d | 119 | Supported function of Driver Binding protocol for this driver.\r |
ead42efc | 120 | \r |
630d580d | 121 | @param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r |
122 | @param ControllerHandle The handle of the controller to test.\r | |
123 | @param RemainingDevicePath A pointer to the remaining portion of a device path.\r | |
ead42efc | 124 | \r |
630d580d | 125 | @retval EFI_SUCCESS Driver loaded.\r |
126 | @retval other Driver not loaded.\r | |
ead42efc | 127 | \r |
128 | **/\r | |
129 | EFI_STATUS\r | |
130 | EFIAPI\r | |
131 | IDEBusDriverBindingSupported (\r | |
132 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
133 | IN EFI_HANDLE Controller,\r | |
134 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
ed66e1bc | 135 | );\r |
ead42efc | 136 | \r |
137 | /**\r | |
630d580d | 138 | Start function of Driver binding protocol which start this driver on Controller\r |
139 | by detecting all disks and installing BlockIo protocol on them.\r | |
ead42efc | 140 | \r |
630d580d | 141 | @param This Protocol instance pointer.\r |
142 | @param Controller Handle of device to bind driver to.\r | |
143 | @param RemainingDevicePath produce all possible children.\r | |
ead42efc | 144 | \r |
630d580d | 145 | @retval EFI_SUCCESS This driver is added to ControllerHandle.\r |
146 | @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle.\r | |
147 | @retval other This driver does not support this device.\r | |
ead42efc | 148 | \r |
149 | **/\r | |
150 | EFI_STATUS\r | |
151 | EFIAPI\r | |
152 | IDEBusDriverBindingStart (\r | |
153 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
154 | IN EFI_HANDLE Controller,\r | |
155 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r | |
ed66e1bc | 156 | );\r |
ead42efc | 157 | \r |
158 | /**\r | |
630d580d | 159 | Stop function of Driver Binding Protocol which is to stop the driver on Controller Handle and all\r |
160 | child handle attached to the controller handle if there are.\r | |
ead42efc | 161 | \r |
630d580d | 162 | @param This Protocol instance pointer.\r |
163 | @param Controller Handle of device to stop driver on\r | |
164 | @param NumberOfChildren Not used\r | |
165 | @param ChildHandleBuffer Not used\r | |
ead42efc | 166 | \r |
630d580d | 167 | @retval EFI_SUCCESS This driver is removed DeviceHandle\r |
168 | @retval other This driver was not removed from this device\r | |
ead42efc | 169 | \r |
170 | **/\r | |
171 | EFI_STATUS\r | |
172 | EFIAPI\r | |
173 | IDEBusDriverBindingStop (\r | |
174 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
175 | IN EFI_HANDLE Controller,\r | |
176 | IN UINTN NumberOfChildren,\r | |
177 | IN EFI_HANDLE *ChildHandleBuffer\r | |
ed66e1bc | 178 | );\r |
ead42efc | 179 | \r |
180 | //\r | |
181 | // EFI Driver Configuration Functions\r | |
182 | //\r | |
eeefcb9d | 183 | /**\r |
630d580d | 184 | Allows the user to set controller specific options for a controller that a \r |
185 | driver is currently managing.\r | |
186 | \r | |
187 | @param This A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.\r | |
188 | @param ControllerHandle The handle of the controller to set options on.\r | |
189 | @param ChildHandle The handle of the child controller to set options on.\r | |
190 | This is an optional parameter that may be NULL.\r | |
191 | It will be NULL for device drivers, and for a bus drivers\r | |
192 | that wish to set options for the bus controller.\r | |
193 | It will not be NULL for a bus driver that wishes to set\r | |
194 | options for one of its child controllers.\r | |
195 | @param Language A pointer to a three character ISO 639-2 language identifier. \r | |
196 | This is the language of the user interface that should be presented \r | |
197 | to the user, and it must match one of the languages specified in \r | |
198 | SupportedLanguages. The number of languages supported by a driver is up to\r | |
199 | the driver writer.\r | |
200 | @param ActionRequired A pointer to the action that the calling agent is required \r | |
201 | to perform when this function returns.\r | |
202 | \r | |
203 | \r | |
204 | @retval EFI_SUCCESS The driver specified by This successfully set the configuration \r | |
205 | options for the controller specified by ControllerHandle..\r | |
206 | @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r | |
207 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r | |
208 | @retval EFI_INVALID_PARAMETER ActionRequired is NULL.\r | |
209 | @retval EFI_UNSUPPORTED The driver specified by This does not support setting configuration options for \r | |
210 | the controller specified by ControllerHandle and ChildHandle.\r | |
211 | @retval EFI_UNSUPPORTED The driver specified by This does not support the language specified by Language.\r | |
212 | @retval EFI_DEVICE_ERROR A device error occurred while attempt to set the configuration options for the \r | |
213 | controller specified by ControllerHandle and ChildHandle.\r | |
214 | @retval EFI_OUT_RESOURCES There are not enough resources available to set the configuration options for the \r | |
215 | controller specified by ControllerHandle and ChildHandle\r | |
eeefcb9d | 216 | **/\r |
ead42efc | 217 | EFI_STATUS\r |
6ba0bc7c | 218 | EFIAPI\r |
ead42efc | 219 | IDEBusDriverConfigurationSetOptions (\r |
220 | IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,\r | |
221 | IN EFI_HANDLE ControllerHandle,\r | |
222 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
223 | IN CHAR8 *Language,\r | |
224 | OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired\r | |
225 | );\r | |
226 | \r | |
eeefcb9d | 227 | /**\r |
630d580d | 228 | Tests to see if a controller's current configuration options are valid.\r |
229 | \r | |
230 | @param This A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance.\r | |
231 | @param ControllerHandle The handle of the controller to test if it's current configuration options \r | |
232 | are valid.\r | |
233 | @param ChildHandle The handle of the child controller to test if it's current configuration \r | |
234 | options are valid. This is an optional parameter that may be NULL. It will \r | |
235 | be NULL for device drivers. It will also be NULL for a bus drivers that\r | |
236 | wish to test the configuration options for the bus controller. It will \r | |
237 | not be NULL for a bus driver that wishes to test configuration options for \r | |
238 | one of its child controllers.\r | |
239 | @retval EFI_SUCCESS The controller specified by ControllerHandle and ChildHandle that is being\r | |
240 | managed by the driver specified by This has a valid set of configuration\r | |
241 | options.\r | |
242 | @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r | |
243 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r | |
244 | @retval EFI_UNSUPPORTED The driver specified by This is not currently managing the controller \r | |
245 | specified by ControllerHandle and ChildHandle.\r | |
246 | @retval EFI_DEVICE_ERROR The controller specified by ControllerHandle and ChildHandle that is being\r | |
247 | managed by the driver specified by This has an invalid set of configuration\r | |
248 | options.\r | |
eeefcb9d | 249 | **/\r |
ead42efc | 250 | EFI_STATUS\r |
6ba0bc7c | 251 | EFIAPI\r |
ead42efc | 252 | IDEBusDriverConfigurationOptionsValid (\r |
253 | IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,\r | |
254 | IN EFI_HANDLE ControllerHandle,\r | |
255 | IN EFI_HANDLE ChildHandle OPTIONAL\r | |
256 | );\r | |
257 | \r | |
eeefcb9d | 258 | /**\r |
630d580d | 259 | Forces a driver to set the default configuration options for a controller.\r |
260 | \r | |
261 | @param This A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.\r | |
262 | @param ControllerHandle The handle of the controller to force default configuration options on.\r | |
263 | @param ChildHandle The handle of the child controller to force default configuration \r | |
264 | options on This is an optional parameter that may be NULL. It \r | |
265 | will be NULL for device drivers. It will also be NULL for a bus \r | |
266 | drivers that wish to force default configuration options for the bus\r | |
267 | controller. It will not be NULL for a bus driver that wishes to force\r | |
268 | default configuration options for one of its child controllers.\r | |
269 | @param DefaultType The type of default configuration options to force on the controller \r | |
270 | specified by ControllerHandle and ChildHandle. \r | |
271 | @param ActionRequired A pointer to the action that the calling agent is required to perform \r | |
272 | when this function returns.\r | |
273 | \r | |
274 | @retval EFI_SUCCESS The driver specified by This successfully forced the \r | |
275 | default configuration options on the controller specified by \r | |
276 | ControllerHandle and ChildHandle.\r | |
277 | @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r | |
278 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r | |
279 | @retval EFI_INVALID_PARAMETER ActionRequired is NULL.\r | |
280 | @retval EFI_UNSUPPORTED The driver specified by This does not support forcing the default \r | |
281 | configuration options on the controller specified by ControllerHandle\r | |
282 | and ChildHandle.\r | |
283 | @retval EFI_UNSUPPORTED The driver specified by This does not support the configuration type \r | |
284 | specified by DefaultType.\r | |
285 | @retval EFI_DEVICE_ERROR A device error occurred while attempt to force the default configuration \r | |
286 | options on the controller specified by ControllerHandle and ChildHandle.\r | |
287 | @retval EFI_OUT_RESOURCES There are not enough resources available to force the default configuration \r | |
288 | options on the controller specified by ControllerHandle and ChildHandle.\r | |
eeefcb9d | 289 | **/\r |
ead42efc | 290 | EFI_STATUS\r |
6ba0bc7c | 291 | EFIAPI\r |
ead42efc | 292 | IDEBusDriverConfigurationForceDefaults (\r |
293 | IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,\r | |
294 | IN EFI_HANDLE ControllerHandle,\r | |
295 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
296 | IN UINT32 DefaultType,\r | |
297 | OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired\r | |
298 | );\r | |
299 | \r | |
300 | //\r | |
301 | // EFI Driver Diagnostics Functions\r | |
302 | //\r | |
eeefcb9d | 303 | /**\r |
630d580d | 304 | Runs diagnostics on a controller.\r |
305 | \r | |
306 | @param This A pointer to the EFI_DRIVER_DIAGNOSTICS_PROTOCOLinstance.\r | |
307 | @param ControllerHandle The handle of the controller to run diagnostics on.\r | |
308 | @param ChildHandle The handle of the child controller to run diagnostics on\r | |
309 | This is an optional parameter that may be NULL. It will\r | |
310 | be NULL for device drivers. It will also be NULL for a\r | |
311 | bus drivers that wish to run diagnostics on the bus controller. \r | |
312 | It will not be NULL for a bus driver that wishes to run \r | |
313 | diagnostics on one of its child controllers.\r | |
314 | @param DiagnosticType Indicates type of diagnostics to perform on the controller\r | |
315 | specified by ControllerHandle and ChildHandle.\r | |
316 | @param Language A pointer to a three character ISO 639-2 language identifier. \r | |
317 | This is the language in which the optional error message should \r | |
318 | be returned in Buffer, and it must match one of the languages \r | |
319 | specified in SupportedLanguages. The number of languages supported by\r | |
320 | a driver is up to the driver writer.\r | |
321 | @param ErrorType A GUID that defines the format of the data returned in Buffer.\r | |
322 | @param BufferSize The size, in bytes, of the data returned in Buffer.\r | |
323 | @param Buffer A buffer that contains a Null-terminated Unicode string\r | |
324 | plus some additional data whose format is defined by ErrorType. \r | |
325 | Buffer is allocated by this function with AllocatePool(), and \r | |
326 | it is the caller's responsibility to free it with a call to FreePool().\r | |
327 | \r | |
328 | @retval EFI_SUCCESS The controller specified by ControllerHandle and ChildHandle passed \r | |
329 | the diagnostic.\r | |
c2d9a4d2 | 330 | @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r |
630d580d | 331 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r |
332 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
333 | @retval EFI_INVALID_PARAMETER ErrorType is NULL.\r | |
334 | @retval EFI_INVALID_PARAMETER BufferType is NULL.\r | |
335 | @retval EFI_INVALID_PARAMETER Buffer is NULL.\r | |
336 | @retval EFI_UNSUPPORTED The driver specified by This does not support running \r | |
337 | diagnostics for the controller specified by ControllerHandle \r | |
338 | and ChildHandle.\r | |
339 | @retval EFI_UNSUPPORTED The driver specified by This does not support the\r | |
340 | type of diagnostic specified by DiagnosticType.\r | |
341 | @retval EFI_UNSUPPORTED The driver specified by This does not support the language \r | |
342 | specified by Language.\r | |
343 | @retval EFI_OUT_OF_RESOURCES There are not enough resources available to complete the \r | |
344 | diagnostics.\r | |
345 | @retval EFI_OUT_OF_RESOURCES There are not enough resources available to return the \r | |
346 | status information in ErrorType, BufferSize,and Buffer.\r | |
347 | @retval EFI_DEVICE_ERROR The controller specified by ControllerHandle and ChildHandle \r | |
348 | did not pass the diagnostic.\r | |
eeefcb9d | 349 | **/\r |
ead42efc | 350 | EFI_STATUS\r |
6ba0bc7c | 351 | EFIAPI\r |
ead42efc | 352 | IDEBusDriverDiagnosticsRunDiagnostics (\r |
353 | IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL *This,\r | |
354 | IN EFI_HANDLE ControllerHandle,\r | |
355 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
356 | IN EFI_DRIVER_DIAGNOSTIC_TYPE DiagnosticType,\r | |
357 | IN CHAR8 *Language,\r | |
358 | OUT EFI_GUID **ErrorType,\r | |
359 | OUT UINTN *BufferSize,\r | |
360 | OUT CHAR16 **Buffer\r | |
361 | );\r | |
362 | \r | |
ead42efc | 363 | /**\r |
630d580d | 364 | issue ATA or ATAPI command to reset a block IO device.\r |
365 | @param This Block IO protocol instance pointer.\r | |
366 | @param ExtendedVerification If FALSE,for ATAPI device, driver will only invoke ATAPI reset method\r | |
367 | If TRUE, for ATAPI device, driver need invoke ATA reset method after\r | |
368 | invoke ATAPI reset method\r | |
ead42efc | 369 | \r |
630d580d | 370 | @retval EFI_DEVICE_ERROR When the device is neighther ATA device or ATAPI device.\r |
371 | @retval EFI_SUCCESS The device reset successfully\r | |
ead42efc | 372 | \r |
373 | **/\r | |
374 | EFI_STATUS\r | |
375 | EFIAPI\r | |
376 | IDEBlkIoReset (\r | |
377 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
378 | IN BOOLEAN ExtendedVerification\r | |
ed66e1bc | 379 | );\r |
ead42efc | 380 | \r |
381 | /**\r | |
cd57e888 | 382 | Read data from a block IO device.\r |
ead42efc | 383 | \r |
630d580d | 384 | @param This Block IO protocol instance pointer.\r |
385 | @param MediaId The media ID of the device\r | |
cd57e888 | 386 | @param Lba Starting LBA address to read data\r |
630d580d | 387 | @param BufferSize The size of data to be read\r |
388 | @param Buffer Caller supplied buffer to save data\r | |
ead42efc | 389 | \r |
630d580d | 390 | @retval EFI_DEVICE_ERROR unknown device type\r |
391 | @retval EFI_SUCCESS read the data successfully.\r | |
ead42efc | 392 | \r |
393 | **/\r | |
394 | EFI_STATUS\r | |
395 | EFIAPI\r | |
396 | IDEBlkIoReadBlocks (\r | |
397 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
398 | IN UINT32 MediaId,\r | |
e72ca438 | 399 | IN EFI_LBA Lba,\r |
ead42efc | 400 | IN UINTN BufferSize,\r |
401 | OUT VOID *Buffer\r | |
ed66e1bc | 402 | );\r |
ead42efc | 403 | \r |
404 | /**\r | |
630d580d | 405 | Write data to block io device\r |
ead42efc | 406 | \r |
630d580d | 407 | @param This Protocol instance pointer.\r |
408 | @param MediaId The media ID of the device\r | |
cd57e888 | 409 | @param Lba Starting LBA address to write data\r |
630d580d | 410 | @param BufferSize The size of data to be written\r |
411 | @param Buffer Caller supplied buffer to save data\r | |
ead42efc | 412 | \r |
630d580d | 413 | @retval EFI_DEVICE_ERROR unknown device type\r |
414 | @retval other write data status\r | |
ead42efc | 415 | \r |
416 | **/\r | |
417 | EFI_STATUS\r | |
418 | EFIAPI\r | |
419 | IDEBlkIoWriteBlocks (\r | |
420 | IN EFI_BLOCK_IO_PROTOCOL *This,\r | |
421 | IN UINT32 MediaId,\r | |
e72ca438 | 422 | IN EFI_LBA Lba,\r |
ead42efc | 423 | IN UINTN BufferSize,\r |
424 | IN VOID *Buffer\r | |
ed66e1bc | 425 | );\r |
ead42efc | 426 | \r |
427 | /**\r | |
630d580d | 428 | Flushes all modified data to a physical block devices\r |
ead42efc | 429 | \r |
630d580d | 430 | @param This Indicates a pointer to the calling context which to sepcify a \r |
431 | sepcific block device\r | |
ead42efc | 432 | \r |
630d580d | 433 | @retval EFI_SUCCESS Always return success.\r |
ead42efc | 434 | **/\r |
435 | EFI_STATUS\r | |
436 | EFIAPI\r | |
437 | IDEBlkIoFlushBlocks (\r | |
438 | IN EFI_BLOCK_IO_PROTOCOL *This\r | |
ed66e1bc | 439 | );\r |
ead42efc | 440 | /**\r |
bab0c17a | 441 | This function is used by the IDE bus driver to get inquiry data. \r |
442 | Data format of Identify data is defined by the Interface GUID.\r | |
ead42efc | 443 | \r |
bab0c17a | 444 | @param This Pointer to the EFI_DISK_INFO_PROTOCOL instance.\r |
445 | @param InquiryData Pointer to a buffer for the inquiry data.\r | |
446 | @param InquiryDataSize Pointer to the value for the inquiry data size.\r | |
ead42efc | 447 | \r |
bab0c17a | 448 | @retval EFI_SUCCESS The command was accepted without any errors.\r |
449 | @retval EFI_NOT_FOUND Device does not support this data class \r | |
450 | @retval EFI_DEVICE_ERROR Error reading InquiryData from device \r | |
451 | @retval EFI_BUFFER_TOO_SMALL IntquiryDataSize not big enough \r | |
ead42efc | 452 | \r |
453 | **/\r | |
454 | EFI_STATUS\r | |
455 | EFIAPI\r | |
456 | IDEDiskInfoInquiry (\r | |
457 | IN EFI_DISK_INFO_PROTOCOL *This,\r | |
458 | IN OUT VOID *InquiryData,\r | |
cd57e888 | 459 | IN OUT UINT32 *InquiryDataSize\r |
ed66e1bc | 460 | );\r |
ead42efc | 461 | \r |
462 | /**\r | |
bab0c17a | 463 | This function is used by the IDE bus driver to get identify data. \r |
630d580d | 464 | Data format of Identify data is defined by the Interface GUID.\r |
ead42efc | 465 | \r |
bab0c17a | 466 | @param This Pointer to the EFI_DISK_INFO_PROTOCOL instance.\r |
467 | @param IdentifyData Pointer to a buffer for the identify data.\r | |
468 | @param IdentifyDataSize Pointer to the value for the identify data size.\r | |
ead42efc | 469 | \r |
bab0c17a | 470 | @retval EFI_SUCCESS The command was accepted without any errors.\r |
471 | @retval EFI_NOT_FOUND Device does not support this data class \r | |
472 | @retval EFI_DEVICE_ERROR Error reading IdentifyData from device \r | |
473 | @retval EFI_BUFFER_TOO_SMALL IdentifyDataSize not big enough \r | |
ead42efc | 474 | \r |
475 | **/\r | |
476 | EFI_STATUS\r | |
477 | EFIAPI\r | |
478 | IDEDiskInfoIdentify (\r | |
479 | IN EFI_DISK_INFO_PROTOCOL *This,\r | |
480 | IN OUT VOID *IdentifyData,\r | |
481 | IN OUT UINT32 *IdentifyDataSize\r | |
ed66e1bc | 482 | );\r |
ead42efc | 483 | \r |
484 | /**\r | |
bab0c17a | 485 | This function is used by the IDE bus driver to get sense data. \r |
630d580d | 486 | Data format of Sense data is defined by the Interface GUID.\r |
ead42efc | 487 | \r |
bab0c17a | 488 | @param This Pointer to the EFI_DISK_INFO_PROTOCOL instance. \r |
489 | @param SenseData Pointer to the SenseData. \r | |
490 | @param SenseDataSize Size of SenseData in bytes. \r | |
491 | @param SenseDataNumber Pointer to the value for the identify data size.\r | |
ead42efc | 492 | \r |
bab0c17a | 493 | @retval EFI_SUCCESS The command was accepted without any errors.\r |
494 | @retval EFI_NOT_FOUND Device does not support this data class \r | |
495 | @retval EFI_DEVICE_ERROR Error reading InquiryData from device \r | |
496 | @retval EFI_BUFFER_TOO_SMALL SenseDataSize not big enough \r | |
ead42efc | 497 | \r |
498 | **/\r | |
499 | EFI_STATUS\r | |
500 | EFIAPI\r | |
501 | IDEDiskInfoSenseData (\r | |
502 | IN EFI_DISK_INFO_PROTOCOL *This,\r | |
503 | IN OUT VOID *SenseData,\r | |
504 | IN OUT UINT32 *SenseDataSize,\r | |
505 | OUT UINT8 *SenseDataNumber\r | |
ed66e1bc | 506 | );\r |
ead42efc | 507 | \r |
508 | /**\r | |
bab0c17a | 509 | This function is used by the IDE bus driver to get controller information.\r |
ead42efc | 510 | \r |
bab0c17a | 511 | @param This Pointer to the EFI_DISK_INFO_PROTOCOL instance. \r |
512 | @param IdeChannel Pointer to the Ide Channel number. Primary or secondary.\r | |
513 | @param IdeDevice Pointer to the Ide Device number. Master or slave.\r | |
ead42efc | 514 | \r |
bab0c17a | 515 | @retval EFI_SUCCESS IdeChannel and IdeDevice are valid \r |
516 | @retval EFI_UNSUPPORTED This is not an IDE device \r | |
ead42efc | 517 | \r |
518 | **/\r | |
519 | EFI_STATUS\r | |
520 | EFIAPI\r | |
521 | IDEDiskInfoWhichIde (\r | |
522 | IN EFI_DISK_INFO_PROTOCOL *This,\r | |
523 | OUT UINT32 *IdeChannel,\r | |
524 | OUT UINT32 *IdeDevice\r | |
ed66e1bc | 525 | );\r |
630d580d | 526 | /**\r |
527 | The is an event(generally the event is exitBootService event) call back function. \r | |
528 | Clear pending IDE interrupt before OS loader/kernel take control of the IDE device.\r | |
529 | \r | |
530 | @param Event Pointer to this event\r | |
e3644786 | 531 | @param Context Event handler private data\r |
ead42efc | 532 | \r |
630d580d | 533 | **/\r |
534 | VOID\r | |
535 | EFIAPI\r | |
536 | ClearInterrupt (\r | |
537 | IN EFI_EVENT Event,\r | |
538 | IN VOID *Context\r | |
539 | );\r | |
ead42efc | 540 | #endif\r |