2 Header file for ATA/ATAPI PASS THRU driver.
4 Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.<BR>
5 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.
14 #ifndef __ATA_ATAPI_PASS_THRU_H__
15 #define __ATA_ATAPI_PASS_THRU_H__
19 #include <IndustryStandard/Pci.h>
20 #include <IndustryStandard/Atapi.h>
21 #include <IndustryStandard/Scsi.h>
23 #include <Protocol/PciIo.h>
24 #include <Protocol/IdeControllerInit.h>
25 #include <Protocol/AtaPassThru.h>
26 #include <Protocol/ScsiPassThruExt.h>
28 #include <Library/DebugLib.h>
29 #include <Library/BaseLib.h>
30 #include <Library/BaseMemoryLib.h>
31 #include <Library/UefiDriverEntryPoint.h>
32 #include <Library/UefiBootServicesTableLib.h>
33 #include <Library/UefiLib.h>
34 #include <Library/PciLib.h>
35 #include <Library/PcdLib.h>
36 #include <Library/TimerLib.h>
37 #include <Library/MemoryAllocationLib.h>
38 #include <Library/ReportStatusCodeLib.h>
39 #include <Library/DevicePathLib.h>
44 extern EFI_DRIVER_BINDING_PROTOCOL gAtaAtapiPassThruDriverBinding
;
45 extern EFI_COMPONENT_NAME_PROTOCOL gAtaAtapiPassThruComponentName
;
46 extern EFI_COMPONENT_NAME2_PROTOCOL gAtaAtapiPassThruComponentName2
;
48 #define ATA_ATAPI_PASS_THRU_SIGNATURE SIGNATURE_32 ('a', 'a', 'p', 't')
49 #define ATA_ATAPI_DEVICE_SIGNATURE SIGNATURE_32 ('a', 'd', 'e', 'v')
50 #define ATA_NONBLOCKING_TASK_SIGNATURE SIGNATURE_32 ('a', 't', 's', 'k')
52 typedef struct _ATA_NONBLOCK_TASK ATA_NONBLOCK_TASK
;
59 } EFI_ATA_HC_WORK_MODE
;
62 EfiIdeCdrom
, /* ATAPI CDROM */
63 EfiIdeHarddisk
, /* Hard Disk */
64 EfiPortMultiplier
, /* Port Multiplier */
66 } EFI_ATA_DEVICE_TYPE
;
69 // Ahci mode device info
76 UINT16 PortMultiplier
;
77 EFI_ATA_DEVICE_TYPE Type
;
79 EFI_IDENTIFY_DATA
*IdentifyData
;
80 } EFI_ATA_DEVICE_INFO
;
85 EFI_HANDLE ControllerHandle
;
86 EFI_PCI_IO_PROTOCOL
*PciIo
;
87 EFI_IDE_CONTROLLER_INIT_PROTOCOL
*IdeControllerInit
;
89 EFI_ATA_PASS_THRU_MODE AtaPassThruMode
;
90 EFI_ATA_PASS_THRU_PROTOCOL AtaPassThru
;
91 EFI_EXT_SCSI_PASS_THRU_MODE ExtScsiPassThruMode
;
92 EFI_EXT_SCSI_PASS_THRU_PROTOCOL ExtScsiPassThru
;
94 EFI_ATA_HC_WORK_MODE Mode
;
96 EFI_IDE_REGISTERS IdeRegisters
[EfiIdeMaxChannel
];
97 EFI_AHCI_REGISTERS AhciRegisters
;
100 // The attached device list
102 LIST_ENTRY DeviceList
;
103 UINT64 EnabledPciAttributes
;
104 UINT64 OriginalPciAttributes
;
107 // For AtaPassThru protocol, using the following bytes to record the previous call in
108 // GetNextPort()/GetNextDevice().
111 UINT16 PreviousPortMultiplier
;
113 // For ExtScsiPassThru protocol, using the following bytes to record the previous call in
114 // GetNextTarget()/GetNextTargetLun().
116 UINT16 PreviousTargetId
;
122 EFI_EVENT TimerEvent
;
123 LIST_ENTRY NonBlockingTaskList
;
126 // For disabling Bus Master DMA on the device at ExitBootServices().
128 EFI_EVENT ExitBootEvent
;
129 } ATA_ATAPI_PASS_THRU_INSTANCE
;
132 // Task for Non-blocking mode.
134 struct _ATA_NONBLOCK_TASK
{
139 UINT16 PortMultiplier
;
140 EFI_ATA_PASS_THRU_COMMAND_PACKET
*Packet
;
144 BOOLEAN InfiniteWait
;
145 VOID
*Map
; // Pointer to map.
146 VOID
*TableMap
; // Pointer to PRD table map.
147 EFI_ATA_DMA_PRD
*MapBaseAddress
; // Pointer to range Base address for Map.
148 UINTN PageCount
; // The page numbers used by PCIO freebuffer.
152 // Timeout value which uses 100ns as a unit.
153 // It means 3 second span.
155 #define ATA_ATAPI_TIMEOUT EFI_TIMER_PERIOD_SECONDS(3)
157 #define IS_ALIGNED(addr, size) (((UINTN) (addr) & (size - 1)) == 0)
159 #define ATA_PASS_THRU_PRIVATE_DATA_FROM_THIS(a) \
161 ATA_ATAPI_PASS_THRU_INSTANCE, \
163 ATA_ATAPI_PASS_THRU_SIGNATURE \
166 #define EXT_SCSI_PASS_THRU_PRIVATE_DATA_FROM_THIS(a) \
168 ATA_ATAPI_PASS_THRU_INSTANCE, \
170 ATA_ATAPI_PASS_THRU_SIGNATURE \
173 #define ATA_ATAPI_DEVICE_INFO_FROM_THIS(a) \
175 EFI_ATA_DEVICE_INFO, \
177 ATA_ATAPI_DEVICE_SIGNATURE \
180 #define ATA_NON_BLOCK_TASK_FROM_ENTRY(a) \
184 ATA_NONBLOCKING_TASK_SIGNATURE \
188 Retrieves a Unicode string that is the user readable name of the driver.
190 This function retrieves the user readable name of a driver in the form of a
191 Unicode string. If the driver specified by This has a user readable name in
192 the language specified by Language, then a pointer to the driver name is
193 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
194 by This does not support the language specified by Language,
195 then EFI_UNSUPPORTED is returned.
197 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
198 EFI_COMPONENT_NAME_PROTOCOL instance.
200 @param Language[in] A pointer to a Null-terminated ASCII string
201 array indicating the language. This is the
202 language of the driver name that the caller is
203 requesting, and it must match one of the
204 languages specified in SupportedLanguages. The
205 number of languages supported by a driver is up
206 to the driver writer. Language is specified
207 in RFC 4646 or ISO 639-2 language code format.
209 @param DriverName[out] A pointer to the Unicode string to return.
210 This Unicode string is the name of the
211 driver specified by This in the language
212 specified by Language.
214 @retval EFI_SUCCESS The Unicode string for the Driver specified by
215 This and the language specified by Language was
216 returned in DriverName.
218 @retval EFI_INVALID_PARAMETER Language is NULL.
220 @retval EFI_INVALID_PARAMETER DriverName is NULL.
222 @retval EFI_UNSUPPORTED The driver specified by This does not support
223 the language specified by Language.
228 AtaAtapiPassThruComponentNameGetDriverName (
229 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
231 OUT CHAR16
**DriverName
235 Retrieves a Unicode string that is the user readable name of the controller
236 that is being managed by a driver.
238 This function retrieves the user readable name of the controller specified by
239 ControllerHandle and ChildHandle in the form of a Unicode string. If the
240 driver specified by This has a user readable name in the language specified by
241 Language, then a pointer to the controller name is returned in ControllerName,
242 and EFI_SUCCESS is returned. If the driver specified by This is not currently
243 managing the controller specified by ControllerHandle and ChildHandle,
244 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
245 support the language specified by Language, then EFI_UNSUPPORTED is returned.
247 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
248 EFI_COMPONENT_NAME_PROTOCOL instance.
250 @param ControllerHandle[in] The handle of a controller that the driver
251 specified by This is managing. This handle
252 specifies the controller whose name is to be
255 @param ChildHandle[in] The handle of the child controller to retrieve
256 the name of. This is an optional parameter that
257 may be NULL. It will be NULL for device
258 drivers. It will also be NULL for a bus drivers
259 that wish to retrieve the name of the bus
260 controller. It will not be NULL for a bus
261 driver that wishes to retrieve the name of a
264 @param Language[in] A pointer to a Null-terminated ASCII string
265 array indicating the language. This is the
266 language of the driver name that the caller is
267 requesting, and it must match one of the
268 languages specified in SupportedLanguages. The
269 number of languages supported by a driver is up
270 to the driver writer. Language is specified in
271 RFC 4646 or ISO 639-2 language code format.
273 @param ControllerName[out] A pointer to the Unicode string to return.
274 This Unicode string is the name of the
275 controller specified by ControllerHandle and
276 ChildHandle in the language specified by
277 Language from the point of view of the driver
280 @retval EFI_SUCCESS The Unicode string for the user readable name in
281 the language specified by Language for the
282 driver specified by This was returned in
285 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
287 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
290 @retval EFI_INVALID_PARAMETER Language is NULL.
292 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
294 @retval EFI_UNSUPPORTED The driver specified by This is not currently
295 managing the controller specified by
296 ControllerHandle and ChildHandle.
298 @retval EFI_UNSUPPORTED The driver specified by This does not support
299 the language specified by Language.
304 AtaAtapiPassThruComponentNameGetControllerName (
305 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
306 IN EFI_HANDLE ControllerHandle
,
307 IN EFI_HANDLE ChildHandle OPTIONAL
,
309 OUT CHAR16
**ControllerName
313 Tests to see if this driver supports a given controller. If a child device is provided,
314 it further tests to see if this driver supports creating a handle for the specified child device.
316 This function checks to see if the driver specified by This supports the device specified by
317 ControllerHandle. Drivers will typically use the device path attached to
318 ControllerHandle and/or the services from the bus I/O abstraction attached to
319 ControllerHandle to determine if the driver supports ControllerHandle. This function
320 may be called many times during platform initialization. In order to reduce boot times, the tests
321 performed by this function must be very small, and take as little time as possible to execute. This
322 function must not change the state of any hardware devices, and this function must be aware that the
323 device specified by ControllerHandle may already be managed by the same driver or a
324 different driver. This function must match its calls to AllocatePages() with FreePages(),
325 AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
326 Because ControllerHandle may have been previously started by the same driver, if a protocol is
327 already in the opened state, then it must not be closed with CloseProtocol(). This is required
328 to guarantee the state of ControllerHandle is not modified by this function.
330 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
331 @param[in] ControllerHandle The handle of the controller to test. This handle
332 must support a protocol interface that supplies
333 an I/O abstraction to the driver.
334 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
335 parameter is ignored by device drivers, and is optional for bus
336 drivers. For bus drivers, if this parameter is not NULL, then
337 the bus driver must determine if the bus controller specified
338 by ControllerHandle and the child controller specified
339 by RemainingDevicePath are both supported by this
342 @retval EFI_SUCCESS The device specified by ControllerHandle and
343 RemainingDevicePath is supported by the driver specified by This.
344 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
345 RemainingDevicePath is already being managed by the driver
347 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
348 RemainingDevicePath is already being managed by a different
349 driver or an application that requires exclusive access.
350 Currently not implemented.
351 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
352 RemainingDevicePath is not supported by the driver specified by This.
356 AtaAtapiPassThruSupported (
357 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
358 IN EFI_HANDLE Controller
,
359 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
363 Starts a device controller or a bus controller.
365 The Start() function is designed to be invoked from the EFI boot service ConnectController().
366 As a result, much of the error checking on the parameters to Start() has been moved into this
367 common boot service. It is legal to call Start() from other locations,
368 but the following calling restrictions must be followed, or the system behavior will not be deterministic.
369 1. ControllerHandle must be a valid EFI_HANDLE.
370 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
371 EFI_DEVICE_PATH_PROTOCOL.
372 3. Prior to calling Start(), the Supported() function for the driver specified by This must
373 have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
375 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
376 @param[in] ControllerHandle The handle of the controller to start. This handle
377 must support a protocol interface that supplies
378 an I/O abstraction to the driver.
379 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
380 parameter is ignored by device drivers, and is optional for bus
381 drivers. For a bus driver, if this parameter is NULL, then handles
382 for all the children of Controller are created by this driver.
383 If this parameter is not NULL and the first Device Path Node is
384 not the End of Device Path Node, then only the handle for the
385 child device specified by the first Device Path Node of
386 RemainingDevicePath is created by this driver.
387 If the first Device Path Node of RemainingDevicePath is
388 the End of Device Path Node, no child handle is created by this
391 @retval EFI_SUCCESS The device was started.
392 @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
393 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
394 @retval Others The driver failded to start the device.
399 AtaAtapiPassThruStart (
400 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
401 IN EFI_HANDLE Controller
,
402 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
406 Stops a device controller or a bus controller.
408 The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
409 As a result, much of the error checking on the parameters to Stop() has been moved
410 into this common boot service. It is legal to call Stop() from other locations,
411 but the following calling restrictions must be followed, or the system behavior will not be deterministic.
412 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
413 same driver's Start() function.
414 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
415 EFI_HANDLE. In addition, all of these handles must have been created in this driver's
416 Start() function, and the Start() function must have called OpenProtocol() on
417 ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
419 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
420 @param[in] ControllerHandle A handle to the device being stopped. The handle must
421 support a bus specific I/O protocol for the driver
422 to use to stop the device.
423 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
424 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
425 if NumberOfChildren is 0.
427 @retval EFI_SUCCESS The device was stopped.
428 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
433 AtaAtapiPassThruStop (
434 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
435 IN EFI_HANDLE Controller
,
436 IN UINTN NumberOfChildren
,
437 IN EFI_HANDLE
*ChildHandleBuffer
441 Traverse the attached ATA devices list to find out the device to access.
443 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
444 @param[in] Port The port number of the ATA device to send the command.
445 @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command.
446 If there is no port multiplier, then specify 0xFFFF.
447 @param[in] DeviceType The device type of the ATA device.
449 @retval The pointer to the data structure of the device info to access.
454 SearchDeviceInfoList (
455 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
457 IN UINT16 PortMultiplier
,
458 IN EFI_ATA_DEVICE_TYPE DeviceType
462 Allocate device info data structure to contain device info.
463 And insert the data structure to the tail of device list for tracing.
465 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
466 @param[in] Port The port number of the ATA device to send the command.
467 @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command.
468 If there is no port multiplier, then specify 0xFFFF.
469 @param[in] DeviceType The device type of the ATA device.
470 @param[in] IdentifyData The data buffer to store the output of the IDENTIFY cmd.
472 @retval EFI_SUCCESS Successfully insert the ata device to the tail of device list.
473 @retval EFI_OUT_OF_RESOURCES Can not allocate enough resource for use.
478 CreateNewDeviceInfo (
479 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
481 IN UINT16 PortMultiplier
,
482 IN EFI_ATA_DEVICE_TYPE DeviceType
,
483 IN EFI_IDENTIFY_DATA
*IdentifyData
487 Destroy all attached ATA devices info.
489 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
494 DestroyDeviceInfoList (
495 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
499 Destroy all pending non blocking tasks.
501 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
502 @param[in] IsSigEvent Indicate whether signal the task event when remove the
508 DestroyAsynTaskList (
509 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
510 IN BOOLEAN IsSigEvent
514 Enumerate all attached ATA devices at IDE mode or AHCI mode separately.
516 The function is designed to enumerate all attached ATA devices.
518 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
520 @retval EFI_SUCCESS Successfully enumerate attached ATA devices.
521 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
526 EnumerateAttachedDevice (
527 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
531 Call back funtion when the timer event is signaled.
533 @param[in] Event The Event this notify function registered to.
534 @param[in] Context Pointer to the context data registered to the
540 AsyncNonBlockingTransferRoutine (
546 Sends an ATA command to an ATA device that is attached to the ATA controller. This function
547 supports both blocking I/O and non-blocking I/O. The blocking I/O functionality is required,
548 and the non-blocking I/O functionality is optional.
550 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
551 @param[in] Port The port number of the ATA device to send the command.
552 @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command.
553 If there is no port multiplier, then specify 0xFFFF.
554 @param[in, out] Packet A pointer to the ATA command to send to the ATA device specified by Port
555 and PortMultiplierPort.
556 @param[in] Event If non-blocking I/O is not supported then Event is ignored, and blocking
557 I/O is performed. If Event is NULL, then blocking I/O is performed. If
558 Event is not NULL and non blocking I/O is supported, then non-blocking
559 I/O is performed, and Event will be signaled when the ATA command completes.
561 @retval EFI_SUCCESS The ATA command was sent by the host. For bi-directional commands,
562 InTransferLength bytes were transferred from InDataBuffer. For write and
563 bi-directional commands, OutTransferLength bytes were transferred by OutDataBuffer.
564 @retval EFI_BAD_BUFFER_SIZE The ATA command was not executed. The number of bytes that could be transferred
565 is returned in InTransferLength. For write and bi-directional commands,
566 OutTransferLength bytes were transferred by OutDataBuffer.
567 @retval EFI_NOT_READY The ATA command could not be sent because there are too many ATA commands
568 already queued. The caller may retry again later.
569 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the ATA command.
570 @retval EFI_INVALID_PARAMETER Port, PortMultiplierPort, or the contents of Acb are invalid. The ATA
571 command was not sent, so no additional status information is available.
576 AtaPassThruPassThru (
577 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
579 IN UINT16 PortMultiplierPort
,
580 IN OUT EFI_ATA_PASS_THRU_COMMAND_PACKET
*Packet
,
581 IN EFI_EVENT Event OPTIONAL
585 Used to retrieve the list of legal port numbers for ATA devices on an ATA controller.
586 These can either be the list of ports where ATA devices are actually present or the
587 list of legal port numbers for the ATA controller. Regardless, the caller of this
588 function must probe the port number returned to see if an ATA device is actually
589 present at that location on the ATA controller.
591 The GetNextPort() function retrieves the port number on an ATA controller. If on input
592 Port is 0xFFFF, then the port number of the first port on the ATA controller is returned
593 in Port and EFI_SUCCESS is returned.
595 If Port is a port number that was returned on a previous call to GetNextPort(), then the
596 port number of the next port on the ATA controller is returned in Port, and EFI_SUCCESS
597 is returned. If Port is not 0xFFFF and Port was not returned on a previous call to
598 GetNextPort(), then EFI_INVALID_PARAMETER is returned.
600 If Port is the port number of the last port on the ATA controller, then EFI_NOT_FOUND is
603 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
604 @param[in, out] Port On input, a pointer to the port number on the ATA controller.
605 On output, a pointer to the next port number on the ATA
606 controller. An input value of 0xFFFF retrieves the first port
607 number on the ATA controller.
609 @retval EFI_SUCCESS The next port number on the ATA controller was returned in Port.
610 @retval EFI_NOT_FOUND There are no more ports on this ATA controller.
611 @retval EFI_INVALID_PARAMETER Port is not 0xFFFF and Port was not returned on a previous call
617 AtaPassThruGetNextPort (
618 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
623 Used to retrieve the list of legal port multiplier port numbers for ATA devices on a port of an ATA
624 controller. These can either be the list of port multiplier ports where ATA devices are actually
625 present on port or the list of legal port multiplier ports on that port. Regardless, the caller of this
626 function must probe the port number and port multiplier port number returned to see if an ATA
627 device is actually present.
629 The GetNextDevice() function retrieves the port multiplier port number of an ATA device
630 present on a port of an ATA controller.
632 If PortMultiplierPort points to a port multiplier port number value that was returned on a
633 previous call to GetNextDevice(), then the port multiplier port number of the next ATA device
634 on the port of the ATA controller is returned in PortMultiplierPort, and EFI_SUCCESS is
637 If PortMultiplierPort points to 0xFFFF, then the port multiplier port number of the first
638 ATA device on port of the ATA controller is returned in PortMultiplierPort and
639 EFI_SUCCESS is returned.
641 If PortMultiplierPort is not 0xFFFF and the value pointed to by PortMultiplierPort
642 was not returned on a previous call to GetNextDevice(), then EFI_INVALID_PARAMETER
645 If PortMultiplierPort is the port multiplier port number of the last ATA device on the port of
646 the ATA controller, then EFI_NOT_FOUND is returned.
648 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
649 @param[in] Port The port number present on the ATA controller.
650 @param[in, out] PortMultiplierPort On input, a pointer to the port multiplier port number of an
651 ATA device present on the ATA controller.
652 If on input a PortMultiplierPort of 0xFFFF is specified,
653 then the port multiplier port number of the first ATA device
654 is returned. On output, a pointer to the port multiplier port
655 number of the next ATA device present on an ATA controller.
657 @retval EFI_SUCCESS The port multiplier port number of the next ATA device on the port
658 of the ATA controller was returned in PortMultiplierPort.
659 @retval EFI_NOT_FOUND There are no more ATA devices on this port of the ATA controller.
660 @retval EFI_INVALID_PARAMETER PortMultiplierPort is not 0xFFFF, and PortMultiplierPort was not
661 returned on a previous call to GetNextDevice().
666 AtaPassThruGetNextDevice (
667 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
669 IN OUT UINT16
*PortMultiplierPort
673 Used to allocate and build a device path node for an ATA device on an ATA controller.
675 The BuildDevicePath() function allocates and builds a single device node for the ATA
676 device specified by Port and PortMultiplierPort. If the ATA device specified by Port and
677 PortMultiplierPort is not present on the ATA controller, then EFI_NOT_FOUND is returned.
678 If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned. If there are not enough
679 resources to allocate the device path node, then EFI_OUT_OF_RESOURCES is returned.
681 Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of
682 DevicePath are initialized to describe the ATA device specified by Port and PortMultiplierPort,
683 and EFI_SUCCESS is returned.
685 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
686 @param[in] Port Port specifies the port number of the ATA device for which a
687 device path node is to be allocated and built.
688 @param[in] PortMultiplierPort The port multiplier port number of the ATA device for which a
689 device path node is to be allocated and built. If there is no
690 port multiplier, then specify 0xFFFF.
691 @param[in, out] DevicePath A pointer to a single device path node that describes the ATA
692 device specified by Port and PortMultiplierPort. This function
693 is responsible for allocating the buffer DevicePath with the
694 boot service AllocatePool(). It is the caller's responsibility
695 to free DevicePath when the caller is finished with DevicePath.
696 @retval EFI_SUCCESS The device path node that describes the ATA device specified by
697 Port and PortMultiplierPort was allocated and returned in DevicePath.
698 @retval EFI_NOT_FOUND The ATA device specified by Port and PortMultiplierPort does not
699 exist on the ATA controller.
700 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
701 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.
706 AtaPassThruBuildDevicePath (
707 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
709 IN UINT16 PortMultiplierPort
,
710 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
714 Used to translate a device path node to a port number and port multiplier port number.
716 The GetDevice() function determines the port and port multiplier port number associated with
717 the ATA device described by DevicePath. If DevicePath is a device path node type that the
718 ATA Pass Thru driver supports, then the ATA Pass Thru driver will attempt to translate the contents
719 DevicePath into a port number and port multiplier port number.
721 If this translation is successful, then that port number and port multiplier port number are returned
722 in Port and PortMultiplierPort, and EFI_SUCCESS is returned.
724 If DevicePath, Port, or PortMultiplierPort are NULL, then EFI_INVALID_PARAMETER is returned.
726 If DevicePath is not a device path node type that the ATA Pass Thru driver supports, then
727 EFI_UNSUPPORTED is returned.
729 If DevicePath is a device path node type that the ATA Pass Thru driver supports, but there is not
730 a valid translation from DevicePath to a port number and port multiplier port number, then
731 EFI_NOT_FOUND is returned.
733 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
734 @param[in] DevicePath A pointer to the device path node that describes an ATA device on the
736 @param[out] Port On return, points to the port number of an ATA device on the ATA controller.
737 @param[out] PortMultiplierPort On return, points to the port multiplier port number of an ATA device
738 on the ATA controller.
740 @retval EFI_SUCCESS DevicePath was successfully translated to a port number and port multiplier
741 port number, and they were returned in Port and PortMultiplierPort.
742 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
743 @retval EFI_INVALID_PARAMETER Port is NULL.
744 @retval EFI_INVALID_PARAMETER PortMultiplierPort is NULL.
745 @retval EFI_UNSUPPORTED This driver does not support the device path node type in DevicePath.
746 @retval EFI_NOT_FOUND A valid translation from DevicePath to a port number and port multiplier
747 port number does not exist.
752 AtaPassThruGetDevice (
753 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
754 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
756 OUT UINT16
*PortMultiplierPort
760 Resets a specific port on the ATA controller. This operation also resets all the ATA devices
761 connected to the port.
763 The ResetChannel() function resets an a specific port on an ATA controller. This operation
764 resets all the ATA devices connected to that port. If this ATA controller does not support
765 a reset port operation, then EFI_UNSUPPORTED is returned.
767 If a device error occurs while executing that port reset operation, then EFI_DEVICE_ERROR is
770 If a timeout occurs during the execution of the port reset operation, then EFI_TIMEOUT is returned.
772 If the port reset operation is completed, then EFI_SUCCESS is returned.
774 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
775 @param[in] Port The port number on the ATA controller.
777 @retval EFI_SUCCESS The ATA controller port was reset.
778 @retval EFI_UNSUPPORTED The ATA controller does not support a port reset operation.
779 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the ATA port.
780 @retval EFI_TIMEOUT A timeout occurred while attempting to reset the ATA port.
785 AtaPassThruResetPort (
786 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
791 Resets an ATA device that is connected to an ATA controller.
793 The ResetDevice() function resets the ATA device specified by Port and PortMultiplierPort.
794 If this ATA controller does not support a device reset operation, then EFI_UNSUPPORTED is
797 If Port or PortMultiplierPort are not in a valid range for this ATA controller, then
798 EFI_INVALID_PARAMETER is returned.
800 If a device error occurs while executing that device reset operation, then EFI_DEVICE_ERROR
803 If a timeout occurs during the execution of the device reset operation, then EFI_TIMEOUT is
806 If the device reset operation is completed, then EFI_SUCCESS is returned.
808 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
809 @param[in] Port Port represents the port number of the ATA device to be reset.
810 @param[in] PortMultiplierPort The port multiplier port number of the ATA device to reset.
811 If there is no port multiplier, then specify 0xFFFF.
812 @retval EFI_SUCCESS The ATA device specified by Port and PortMultiplierPort was reset.
813 @retval EFI_UNSUPPORTED The ATA controller does not support a device reset operation.
814 @retval EFI_INVALID_PARAMETER Port or PortMultiplierPort are invalid.
815 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the ATA device
816 specified by Port and PortMultiplierPort.
817 @retval EFI_TIMEOUT A timeout occurred while attempting to reset the ATA device
818 specified by Port and PortMultiplierPort.
823 AtaPassThruResetDevice (
824 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
826 IN UINT16 PortMultiplierPort
830 Sends a SCSI Request Packet to a SCSI device that is attached to the SCSI channel. This function
831 supports both blocking I/O and nonblocking I/O. The blocking I/O functionality is required, and the
832 nonblocking I/O functionality is optional.
834 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
835 @param Target The Target is an array of size TARGET_MAX_BYTES and it represents
836 the id of the SCSI device to send the SCSI Request Packet. Each
837 transport driver may choose to utilize a subset of this size to suit the needs
838 of transport target representation. For example, a Fibre Channel driver
839 may use only 8 bytes (WWN) to represent an FC target.
840 @param Lun The LUN of the SCSI device to send the SCSI Request Packet.
841 @param Packet A pointer to the SCSI Request Packet to send to the SCSI device
842 specified by Target and Lun.
843 @param Event If nonblocking I/O is not supported then Event is ignored, and blocking
844 I/O is performed. If Event is NULL, then blocking I/O is performed. If
845 Event is not NULL and non blocking I/O is supported, then
846 nonblocking I/O is performed, and Event will be signaled when the
847 SCSI Request Packet completes.
849 @retval EFI_SUCCESS The SCSI Request Packet was sent by the host. For bi-directional
850 commands, InTransferLength bytes were transferred from
851 InDataBuffer. For write and bi-directional commands,
852 OutTransferLength bytes were transferred by
854 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was not executed. The number of bytes that
855 could be transferred is returned in InTransferLength. For write
856 and bi-directional commands, OutTransferLength bytes were
857 transferred by OutDataBuffer.
858 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
859 SCSI Request Packets already queued. The caller may retry again later.
860 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the SCSI Request
862 @retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket are invalid.
863 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported
864 by the host adapter. This includes the case of Bi-directional SCSI
865 commands not supported by the implementation. The SCSI Request
866 Packet was not sent, so no additional status information is available.
867 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
872 ExtScsiPassThruPassThru (
873 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
876 IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET
*Packet
,
877 IN EFI_EVENT Event OPTIONAL
881 Used to retrieve the list of legal Target IDs and LUNs for SCSI devices on a SCSI channel. These
882 can either be the list SCSI devices that are actually present on the SCSI channel, or the list of legal
883 Target Ids and LUNs for the SCSI channel. Regardless, the caller of this function must probe the
884 Target ID and LUN returned to see if a SCSI device is actually present at that location on the SCSI
887 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
888 @param Target On input, a pointer to the Target ID (an array of size
889 TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.
890 On output, a pointer to the Target ID (an array of
891 TARGET_MAX_BYTES) of the next SCSI device present on a SCSI
892 channel. An input value of 0xF(all bytes in the array are 0xF) in the
893 Target array retrieves the Target ID of the first SCSI device present on a
895 @param Lun On input, a pointer to the LUN of a SCSI device present on the SCSI
896 channel. On output, a pointer to the LUN of the next SCSI device present
899 @retval EFI_SUCCESS The Target ID and LUN of the next SCSI device on the SCSI
900 channel was returned in Target and Lun.
901 @retval EFI_INVALID_PARAMETER Target array is not all 0xF, and Target and Lun were
902 not returned on a previous call to GetNextTargetLun().
903 @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.
908 ExtScsiPassThruGetNextTargetLun (
909 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
910 IN OUT UINT8
**Target
,
915 Used to allocate and build a device path node for a SCSI device on a SCSI channel.
917 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
918 @param Target The Target is an array of size TARGET_MAX_BYTES and it specifies the
919 Target ID of the SCSI device for which a device path node is to be
920 allocated and built. Transport drivers may chose to utilize a subset of
921 this size to suit the representation of targets. For example, a Fibre
922 Channel driver may use only 8 bytes (WWN) in the array to represent a
924 @param Lun The LUN of the SCSI device for which a device path node is to be
926 @param DevicePath A pointer to a single device path node that describes the SCSI device
927 specified by Target and Lun. This function is responsible for
928 allocating the buffer DevicePath with the boot service
929 AllocatePool(). It is the caller's responsibility to free
930 DevicePath when the caller is finished with DevicePath.
932 @retval EFI_SUCCESS The device path node that describes the SCSI device specified by
933 Target and Lun was allocated and returned in
935 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
936 @retval EFI_NOT_FOUND The SCSI devices specified by Target and Lun does not exist
938 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.
943 ExtScsiPassThruBuildDevicePath (
944 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
947 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
951 Used to translate a device path node to a Target ID and LUN.
953 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
954 @param DevicePath A pointer to a single device path node that describes the SCSI device
956 @param Target A pointer to the Target Array which represents the ID of a SCSI device
958 @param Lun A pointer to the LUN of a SCSI device on the SCSI channel.
960 @retval EFI_SUCCESS DevicePath was successfully translated to a Target ID and
961 LUN, and they were returned in Target and Lun.
962 @retval EFI_INVALID_PARAMETER DevicePath or Target or Lun is NULL.
963 @retval EFI_NOT_FOUND A valid translation from DevicePath to a Target ID and LUN
965 @retval EFI_UNSUPPORTED This driver does not support the device path node type in
971 ExtScsiPassThruGetTargetLun (
972 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
973 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
979 Resets a SCSI channel. This operation resets all the SCSI devices connected to the SCSI channel.
981 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
983 @retval EFI_SUCCESS The SCSI channel was reset.
984 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the SCSI channel.
985 @retval EFI_TIMEOUT A timeout occurred while attempting to reset the SCSI channel.
986 @retval EFI_UNSUPPORTED The SCSI channel does not support a channel reset operation.
991 ExtScsiPassThruResetChannel (
992 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
996 Resets a SCSI logical unit that is connected to a SCSI channel.
998 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
999 @param Target The Target is an array of size TARGET_MAX_BYTE and it represents the
1000 target port ID of the SCSI device containing the SCSI logical unit to
1001 reset. Transport drivers may chose to utilize a subset of this array to suit
1002 the representation of their targets.
1003 @param Lun The LUN of the SCSI device to reset.
1005 @retval EFI_SUCCESS The SCSI device specified by Target and Lun was reset.
1006 @retval EFI_INVALID_PARAMETER Target or Lun is NULL.
1007 @retval EFI_TIMEOUT A timeout occurred while attempting to reset the SCSI device
1008 specified by Target and Lun.
1009 @retval EFI_UNSUPPORTED The SCSI channel does not support a target reset operation.
1010 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the SCSI device
1011 specified by Target and Lun.
1016 ExtScsiPassThruResetTargetLun (
1017 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
1023 Used to retrieve the list of legal Target IDs for SCSI devices on a SCSI channel. These can either
1024 be the list SCSI devices that are actually present on the SCSI channel, or the list of legal Target IDs
1025 for the SCSI channel. Regardless, the caller of this function must probe the Target ID returned to
1026 see if a SCSI device is actually present at that location on the SCSI channel.
1028 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
1029 @param Target (TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.
1030 On output, a pointer to the Target ID (an array of
1031 TARGET_MAX_BYTES) of the next SCSI device present on a SCSI
1032 channel. An input value of 0xF(all bytes in the array are 0xF) in the
1033 Target array retrieves the Target ID of the first SCSI device present on a
1036 @retval EFI_SUCCESS The Target ID of the next SCSI device on the SCSI
1037 channel was returned in Target.
1038 @retval EFI_INVALID_PARAMETER Target or Lun is NULL.
1039 @retval EFI_TIMEOUT Target array is not all 0xF, and Target was not
1040 returned on a previous call to GetNextTarget().
1041 @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.
1046 ExtScsiPassThruGetNextTarget (
1047 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
1048 IN OUT UINT8
**Target
1052 Initialize ATA host controller at IDE mode.
1054 The function is designed to initialize ATA host controller.
1056 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
1061 IdeModeInitialization (
1062 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
1066 Initialize ATA host controller at AHCI mode.
1068 The function is designed to initialize ATA host controller.
1070 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
1075 AhciModeInitialization (
1076 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
1080 Start a non data transfer on specific port.
1082 @param[in] PciIo The PCI IO protocol instance.
1083 @param[in] AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
1084 @param[in] Port The number of port.
1085 @param[in] PortMultiplier The timeout value of stop.
1086 @param[in] AtapiCommand The atapi command will be used for the
1088 @param[in] AtapiCommandLength The length of the atapi command.
1089 @param[in] AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
1090 @param[in, out] AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
1091 @param[in] Timeout The timeout value of non data transfer, uses 100ns as a unit.
1092 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1093 used by non-blocking mode.
1095 @retval EFI_DEVICE_ERROR The non data transfer abort with error occurs.
1096 @retval EFI_TIMEOUT The operation is time out.
1097 @retval EFI_UNSUPPORTED The device is not ready for transfer.
1098 @retval EFI_SUCCESS The non data transfer executes successfully.
1103 AhciNonDataTransfer (
1104 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
1105 IN EFI_AHCI_REGISTERS
*AhciRegisters
,
1107 IN UINT8 PortMultiplier
,
1108 IN EFI_AHCI_ATAPI_COMMAND
*AtapiCommand OPTIONAL
,
1109 IN UINT8 AtapiCommandLength
,
1110 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1111 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1113 IN ATA_NONBLOCK_TASK
*Task
1117 Start a DMA data transfer on specific port
1119 @param[in] Instance The ATA_ATAPI_PASS_THRU_INSTANCE protocol instance.
1120 @param[in] AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
1121 @param[in] Port The number of port.
1122 @param[in] PortMultiplier The timeout value of stop.
1123 @param[in] AtapiCommand The atapi command will be used for the
1125 @param[in] AtapiCommandLength The length of the atapi command.
1126 @param[in] Read The transfer direction.
1127 @param[in] AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
1128 @param[in, out] AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
1129 @param[in, out] MemoryAddr The pointer to the data buffer.
1130 @param[in] DataCount The data count to be transferred.
1131 @param[in] Timeout The timeout value of non data transfer, uses 100ns as a unit.
1132 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1133 used by non-blocking mode.
1135 @retval EFI_DEVICE_ERROR The DMA data transfer abort with error occurs.
1136 @retval EFI_TIMEOUT The operation is time out.
1137 @retval EFI_UNSUPPORTED The device is not ready for transfer.
1138 @retval EFI_SUCCESS The DMA data transfer executes successfully.
1144 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
1145 IN EFI_AHCI_REGISTERS
*AhciRegisters
,
1147 IN UINT8 PortMultiplier
,
1148 IN EFI_AHCI_ATAPI_COMMAND
*AtapiCommand OPTIONAL
,
1149 IN UINT8 AtapiCommandLength
,
1151 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1152 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1153 IN OUT VOID
*MemoryAddr
,
1154 IN UINT32 DataCount
,
1156 IN ATA_NONBLOCK_TASK
*Task
1160 Start a PIO data transfer on specific port.
1162 @param[in] PciIo The PCI IO protocol instance.
1163 @param[in] AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
1164 @param[in] Port The number of port.
1165 @param[in] PortMultiplier The timeout value of stop.
1166 @param[in] AtapiCommand The atapi command will be used for the
1168 @param[in] AtapiCommandLength The length of the atapi command.
1169 @param[in] Read The transfer direction.
1170 @param[in] AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
1171 @param[in, out] AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
1172 @param[in, out] MemoryAddr The pointer to the data buffer.
1173 @param[in] DataCount The data count to be transferred.
1174 @param[in] Timeout The timeout value of non data transfer, uses 100ns as a unit.
1175 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1176 used by non-blocking mode.
1178 @retval EFI_DEVICE_ERROR The PIO data transfer abort with error occurs.
1179 @retval EFI_TIMEOUT The operation is time out.
1180 @retval EFI_UNSUPPORTED The device is not ready for transfer.
1181 @retval EFI_SUCCESS The PIO data transfer executes successfully.
1187 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
1188 IN EFI_AHCI_REGISTERS
*AhciRegisters
,
1190 IN UINT8 PortMultiplier
,
1191 IN EFI_AHCI_ATAPI_COMMAND
*AtapiCommand OPTIONAL
,
1192 IN UINT8 AtapiCommandLength
,
1194 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1195 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1196 IN OUT VOID
*MemoryAddr
,
1197 IN UINT32 DataCount
,
1199 IN ATA_NONBLOCK_TASK
*Task
1203 Send ATA command into device with NON_DATA protocol
1205 @param[in] PciIo A pointer to ATA_ATAPI_PASS_THRU_INSTANCE
1207 @param[in] IdeRegisters A pointer to EFI_IDE_REGISTERS data structure.
1208 @param[in] AtaCommandBlock A pointer to EFI_ATA_COMMAND_BLOCK data
1210 @param[in, out] AtaStatusBlock A pointer to EFI_ATA_STATUS_BLOCK data structure.
1211 @param[in] Timeout The time to complete the command, uses 100ns as a unit.
1212 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1213 used by non-blocking mode.
1215 @retval EFI_SUCCESS Reading succeed
1216 @retval EFI_ABORTED Command failed
1217 @retval EFI_DEVICE_ERROR Device status error.
1222 AtaNonDataCommandIn (
1223 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
1224 IN EFI_IDE_REGISTERS
*IdeRegisters
,
1225 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1226 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1228 IN ATA_NONBLOCK_TASK
*Task
1232 Perform an ATA Udma operation (Read, ReadExt, Write, WriteExt).
1234 @param[in] Instance A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data
1236 @param[in] IdeRegisters A pointer to EFI_IDE_REGISTERS data structure.
1237 @param[in] Read Flag used to determine the data transfer
1238 direction. Read equals 1, means data transferred
1239 from device to host;Read equals 0, means data
1240 transferred from host to device.
1241 @param[in] DataBuffer A pointer to the source buffer for the data.
1242 @param[in] DataLength The length of the data.
1243 @param[in] AtaCommandBlock A pointer to EFI_ATA_COMMAND_BLOCK data structure.
1244 @param[in, out] AtaStatusBlock A pointer to EFI_ATA_STATUS_BLOCK data structure.
1245 @param[in] Timeout The time to complete the command, uses 100ns as a unit.
1246 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1247 used by non-blocking mode.
1249 @retval EFI_SUCCESS the operation is successful.
1250 @retval EFI_OUT_OF_RESOURCES Build PRD table failed
1251 @retval EFI_UNSUPPORTED Unknown channel or operations command
1252 @retval EFI_DEVICE_ERROR Ata command execute failed
1258 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
1259 IN EFI_IDE_REGISTERS
*IdeRegisters
,
1261 IN VOID
*DataBuffer
,
1262 IN UINT64 DataLength
,
1263 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1264 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1266 IN ATA_NONBLOCK_TASK
*Task
1270 This function is used to send out ATA commands conforms to the PIO Data In Protocol.
1272 @param[in] PciIo A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data
1274 @param[in] IdeRegisters A pointer to EFI_IDE_REGISTERS data structure.
1275 @param[in, out] Buffer A pointer to the source buffer for the data.
1276 @param[in] ByteCount The length of the data.
1277 @param[in] Read Flag used to determine the data transfer direction.
1278 Read equals 1, means data transferred from device
1279 to host;Read equals 0, means data transferred
1280 from host to device.
1281 @param[in] AtaCommandBlock A pointer to EFI_ATA_COMMAND_BLOCK data structure.
1282 @param[in, out] AtaStatusBlock A pointer to EFI_ATA_STATUS_BLOCK data structure.
1283 @param[in] Timeout The time to complete the command, uses 100ns as a unit.
1284 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1285 used by non-blocking mode.
1287 @retval EFI_SUCCESS send out the ATA command and device send required data successfully.
1288 @retval EFI_DEVICE_ERROR command sent failed.
1294 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
1295 IN EFI_IDE_REGISTERS
*IdeRegisters
,
1296 IN OUT VOID
*Buffer
,
1297 IN UINT64 ByteCount
,
1299 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1300 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1302 IN ATA_NONBLOCK_TASK
*Task