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