2 Header file for ATA/ATAPI PASS THRU driver.
4 Copyright (c) 2010 - 2011, 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 OriginalPciAttributes
;
106 // For AtaPassThru protocol, using the following bytes to record the previous call in
107 // GetNextPort()/GetNextDevice().
110 UINT16 PreviousPortMultiplier
;
112 // For ExtScsiPassThru protocol, using the following bytes to record the previous call in
113 // GetNextTarget()/GetNextTargetLun().
115 UINT16 PreviousTargetId
;
121 EFI_EVENT TimerEvent
;
122 LIST_ENTRY NonBlockingTaskList
;
123 } ATA_ATAPI_PASS_THRU_INSTANCE
;
126 // Task for Non-blocking mode.
128 struct _ATA_NONBLOCK_TASK
{
133 UINT16 PortMultiplier
;
134 EFI_ATA_PASS_THRU_COMMAND_PACKET
*Packet
;
138 VOID
*Map
; // Pointer to map.
139 VOID
*TableMap
;// Pointer to PRD table map.
140 EFI_ATA_DMA_PRD
*MapBaseAddress
; // Pointer to range Base address for Map.
141 UINTN PageCount
; // The page numbers used by PCIO freebuffer.
145 // Timeout value which uses 100ns as a unit.
146 // It means 3 second span.
148 #define ATA_ATAPI_TIMEOUT EFI_TIMER_PERIOD_SECONDS(3)
150 #define IS_ALIGNED(addr, size) (((UINTN) (addr) & (size - 1)) == 0)
152 #define ATA_PASS_THRU_PRIVATE_DATA_FROM_THIS(a) \
154 ATA_ATAPI_PASS_THRU_INSTANCE, \
156 ATA_ATAPI_PASS_THRU_SIGNATURE \
159 #define EXT_SCSI_PASS_THRU_PRIVATE_DATA_FROM_THIS(a) \
161 ATA_ATAPI_PASS_THRU_INSTANCE, \
163 ATA_ATAPI_PASS_THRU_SIGNATURE \
166 #define ATA_ATAPI_DEVICE_INFO_FROM_THIS(a) \
168 EFI_ATA_DEVICE_INFO, \
170 ATA_ATAPI_DEVICE_SIGNATURE \
173 #define ATA_NON_BLOCK_TASK_FROM_ENTRY(a) \
177 ATA_NONBLOCKING_TASK_SIGNATURE \
181 Retrieves a Unicode string that is the user readable name of the driver.
183 This function retrieves the user readable name of a driver in the form of a
184 Unicode string. If the driver specified by This has a user readable name in
185 the language specified by Language, then a pointer to the driver name is
186 returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
187 by This does not support the language specified by Language,
188 then EFI_UNSUPPORTED is returned.
190 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
191 EFI_COMPONENT_NAME_PROTOCOL instance.
193 @param Language[in] A pointer to a Null-terminated ASCII string
194 array indicating the language. This is the
195 language of the driver name that the caller is
196 requesting, and it must match one of the
197 languages specified in SupportedLanguages. The
198 number of languages supported by a driver is up
199 to the driver writer. Language is specified
200 in RFC 4646 or ISO 639-2 language code format.
202 @param DriverName[out] A pointer to the Unicode string to return.
203 This Unicode string is the name of the
204 driver specified by This in the language
205 specified by Language.
207 @retval EFI_SUCCESS The Unicode string for the Driver specified by
208 This and the language specified by Language was
209 returned in DriverName.
211 @retval EFI_INVALID_PARAMETER Language is NULL.
213 @retval EFI_INVALID_PARAMETER DriverName is NULL.
215 @retval EFI_UNSUPPORTED The driver specified by This does not support
216 the language specified by Language.
221 AtaAtapiPassThruComponentNameGetDriverName (
222 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
224 OUT CHAR16
**DriverName
228 Retrieves a Unicode string that is the user readable name of the controller
229 that is being managed by a driver.
231 This function retrieves the user readable name of the controller specified by
232 ControllerHandle and ChildHandle in the form of a Unicode string. If the
233 driver specified by This has a user readable name in the language specified by
234 Language, then a pointer to the controller name is returned in ControllerName,
235 and EFI_SUCCESS is returned. If the driver specified by This is not currently
236 managing the controller specified by ControllerHandle and ChildHandle,
237 then EFI_UNSUPPORTED is returned. If the driver specified by This does not
238 support the language specified by Language, then EFI_UNSUPPORTED is returned.
240 @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
241 EFI_COMPONENT_NAME_PROTOCOL instance.
243 @param ControllerHandle[in] The handle of a controller that the driver
244 specified by This is managing. This handle
245 specifies the controller whose name is to be
248 @param ChildHandle[in] The handle of the child controller to retrieve
249 the name of. This is an optional parameter that
250 may be NULL. It will be NULL for device
251 drivers. It will also be NULL for a bus drivers
252 that wish to retrieve the name of the bus
253 controller. It will not be NULL for a bus
254 driver that wishes to retrieve the name of a
257 @param Language[in] A pointer to a Null-terminated ASCII string
258 array indicating the language. This is the
259 language of the driver name that the caller is
260 requesting, and it must match one of the
261 languages specified in SupportedLanguages. The
262 number of languages supported by a driver is up
263 to the driver writer. Language is specified in
264 RFC 4646 or ISO 639-2 language code format.
266 @param ControllerName[out] A pointer to the Unicode string to return.
267 This Unicode string is the name of the
268 controller specified by ControllerHandle and
269 ChildHandle in the language specified by
270 Language from the point of view of the driver
273 @retval EFI_SUCCESS The Unicode string for the user readable name in
274 the language specified by Language for the
275 driver specified by This was returned in
278 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
280 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
283 @retval EFI_INVALID_PARAMETER Language is NULL.
285 @retval EFI_INVALID_PARAMETER ControllerName is NULL.
287 @retval EFI_UNSUPPORTED The driver specified by This is not currently
288 managing the controller specified by
289 ControllerHandle and ChildHandle.
291 @retval EFI_UNSUPPORTED The driver specified by This does not support
292 the language specified by Language.
297 AtaAtapiPassThruComponentNameGetControllerName (
298 IN EFI_COMPONENT_NAME_PROTOCOL
*This
,
299 IN EFI_HANDLE ControllerHandle
,
300 IN EFI_HANDLE ChildHandle OPTIONAL
,
302 OUT CHAR16
**ControllerName
306 Tests to see if this driver supports a given controller. If a child device is provided,
307 it further tests to see if this driver supports creating a handle for the specified child device.
309 This function checks to see if the driver specified by This supports the device specified by
310 ControllerHandle. Drivers will typically use the device path attached to
311 ControllerHandle and/or the services from the bus I/O abstraction attached to
312 ControllerHandle to determine if the driver supports ControllerHandle. This function
313 may be called many times during platform initialization. In order to reduce boot times, the tests
314 performed by this function must be very small, and take as little time as possible to execute. This
315 function must not change the state of any hardware devices, and this function must be aware that the
316 device specified by ControllerHandle may already be managed by the same driver or a
317 different driver. This function must match its calls to AllocatePages() with FreePages(),
318 AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
319 Because ControllerHandle may have been previously started by the same driver, if a protocol is
320 already in the opened state, then it must not be closed with CloseProtocol(). This is required
321 to guarantee the state of ControllerHandle is not modified by this function.
323 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
324 @param[in] ControllerHandle The handle of the controller to test. This handle
325 must support a protocol interface that supplies
326 an I/O abstraction to the driver.
327 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
328 parameter is ignored by device drivers, and is optional for bus
329 drivers. For bus drivers, if this parameter is not NULL, then
330 the bus driver must determine if the bus controller specified
331 by ControllerHandle and the child controller specified
332 by RemainingDevicePath are both supported by this
335 @retval EFI_SUCCESS The device specified by ControllerHandle and
336 RemainingDevicePath is supported by the driver specified by This.
337 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
338 RemainingDevicePath is already being managed by the driver
340 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
341 RemainingDevicePath is already being managed by a different
342 driver or an application that requires exclusive access.
343 Currently not implemented.
344 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
345 RemainingDevicePath is not supported by the driver specified by This.
349 AtaAtapiPassThruSupported (
350 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
351 IN EFI_HANDLE Controller
,
352 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
356 Starts a device controller or a bus controller.
358 The Start() function is designed to be invoked from the EFI boot service ConnectController().
359 As a result, much of the error checking on the parameters to Start() has been moved into this
360 common boot service. It is legal to call Start() from other locations,
361 but the following calling restrictions must be followed, or the system behavior will not be deterministic.
362 1. ControllerHandle must be a valid EFI_HANDLE.
363 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
364 EFI_DEVICE_PATH_PROTOCOL.
365 3. Prior to calling Start(), the Supported() function for the driver specified by This must
366 have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
368 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
369 @param[in] ControllerHandle The handle of the controller to start. This handle
370 must support a protocol interface that supplies
371 an I/O abstraction to the driver.
372 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
373 parameter is ignored by device drivers, and is optional for bus
374 drivers. For a bus driver, if this parameter is NULL, then handles
375 for all the children of Controller are created by this driver.
376 If this parameter is not NULL and the first Device Path Node is
377 not the End of Device Path Node, then only the handle for the
378 child device specified by the first Device Path Node of
379 RemainingDevicePath is created by this driver.
380 If the first Device Path Node of RemainingDevicePath is
381 the End of Device Path Node, no child handle is created by this
384 @retval EFI_SUCCESS The device was started.
385 @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.
386 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
387 @retval Others The driver failded to start the device.
392 AtaAtapiPassThruStart (
393 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
394 IN EFI_HANDLE Controller
,
395 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
399 Stops a device controller or a bus controller.
401 The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
402 As a result, much of the error checking on the parameters to Stop() has been moved
403 into this common boot service. It is legal to call Stop() from other locations,
404 but the following calling restrictions must be followed, or the system behavior will not be deterministic.
405 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
406 same driver's Start() function.
407 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
408 EFI_HANDLE. In addition, all of these handles must have been created in this driver's
409 Start() function, and the Start() function must have called OpenProtocol() on
410 ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
412 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
413 @param[in] ControllerHandle A handle to the device being stopped. The handle must
414 support a bus specific I/O protocol for the driver
415 to use to stop the device.
416 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
417 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
418 if NumberOfChildren is 0.
420 @retval EFI_SUCCESS The device was stopped.
421 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
426 AtaAtapiPassThruStop (
427 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
428 IN EFI_HANDLE Controller
,
429 IN UINTN NumberOfChildren
,
430 IN EFI_HANDLE
*ChildHandleBuffer
434 Traverse the attached ATA devices list to find out the device to access.
436 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
437 @param[in] Port The port number of the ATA device to send the command.
438 @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command.
439 If there is no port multiplier, then specify 0.
440 @param[in] DeviceType The device type of the ATA device.
442 @retval The pointer to the data structure of the device info to access.
447 SearchDeviceInfoList (
448 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
450 IN UINT16 PortMultiplier
,
451 IN EFI_ATA_DEVICE_TYPE DeviceType
455 Allocate device info data structure to contain device info.
456 And insert the data structure to the tail of device list for tracing.
458 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
459 @param[in] Port The port number of the ATA device to send the command.
460 @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command.
461 If there is no port multiplier, then specify 0.
462 @param[in] DeviceType The device type of the ATA device.
463 @param[in] IdentifyData The data buffer to store the output of the IDENTIFY cmd.
465 @retval EFI_SUCCESS Successfully insert the ata device to the tail of device list.
466 @retval EFI_OUT_OF_RESOURCES Can not allocate enough resource for use.
471 CreateNewDeviceInfo (
472 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
474 IN UINT16 PortMultiplier
,
475 IN EFI_ATA_DEVICE_TYPE DeviceType
,
476 IN EFI_IDENTIFY_DATA
*IdentifyData
480 Destroy all attached ATA devices info.
482 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
487 DestroyDeviceInfoList (
488 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
492 Destroy all pending non blocking tasks.
494 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
499 DestroyAsynTaskList (
500 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
504 Enumerate all attached ATA devices at IDE mode or AHCI mode separately.
506 The function is designed to enumerate all attached ATA devices.
508 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
510 @retval EFI_SUCCESS Successfully enumerate attached ATA devices.
511 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
516 EnumerateAttachedDevice (
517 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
521 Call back funtion when the timer event is signaled.
523 @param[in] Event The Event this notify function registered to.
524 @param[in] Context Pointer to the context data registered to the
530 AsyncNonBlockingTransferRoutine (
536 Sends an ATA command to an ATA device that is attached to the ATA controller. This function
537 supports both blocking I/O and non-blocking I/O. The blocking I/O functionality is required,
538 and the non-blocking I/O functionality is optional.
540 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
541 @param[in] Port The port number of the ATA device to send the command.
542 @param[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command.
543 If there is no port multiplier, then specify 0.
544 @param[in, out] Packet A pointer to the ATA command to send to the ATA device specified by Port
545 and PortMultiplierPort.
546 @param[in] Event If non-blocking I/O is not supported then Event is ignored, and blocking
547 I/O is performed. If Event is NULL, then blocking I/O is performed. If
548 Event is not NULL and non blocking I/O is supported, then non-blocking
549 I/O is performed, and Event will be signaled when the ATA command completes.
551 @retval EFI_SUCCESS The ATA command was sent by the host. For bi-directional commands,
552 InTransferLength bytes were transferred from InDataBuffer. For write and
553 bi-directional commands, OutTransferLength bytes were transferred by OutDataBuffer.
554 @retval EFI_BAD_BUFFER_SIZE The ATA command was not executed. The number of bytes that could be transferred
555 is returned in InTransferLength. For write and bi-directional commands,
556 OutTransferLength bytes were transferred by OutDataBuffer.
557 @retval EFI_NOT_READY The ATA command could not be sent because there are too many ATA commands
558 already queued. The caller may retry again later.
559 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the ATA command.
560 @retval EFI_INVALID_PARAMETER Port, PortMultiplierPort, or the contents of Acb are invalid. The ATA
561 command was not sent, so no additional status information is available.
566 AtaPassThruPassThru (
567 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
569 IN UINT16 PortMultiplierPort
,
570 IN OUT EFI_ATA_PASS_THRU_COMMAND_PACKET
*Packet
,
571 IN EFI_EVENT Event OPTIONAL
575 Used to retrieve the list of legal port numbers for ATA devices on an ATA controller.
576 These can either be the list of ports where ATA devices are actually present or the
577 list of legal port numbers for the ATA controller. Regardless, the caller of this
578 function must probe the port number returned to see if an ATA device is actually
579 present at that location on the ATA controller.
581 The GetNextPort() function retrieves the port number on an ATA controller. If on input
582 Port is 0xFFFF, then the port number of the first port on the ATA controller is returned
583 in Port and EFI_SUCCESS is returned.
585 If Port is a port number that was returned on a previous call to GetNextPort(), then the
586 port number of the next port on the ATA controller is returned in Port, and EFI_SUCCESS
587 is returned. If Port is not 0xFFFF and Port was not returned on a previous call to
588 GetNextPort(), then EFI_INVALID_PARAMETER is returned.
590 If Port is the port number of the last port on the ATA controller, then EFI_NOT_FOUND is
593 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
594 @param[in, out] Port On input, a pointer to the port number on the ATA controller.
595 On output, a pointer to the next port number on the ATA
596 controller. An input value of 0xFFFF retrieves the first port
597 number on the ATA controller.
599 @retval EFI_SUCCESS The next port number on the ATA controller was returned in Port.
600 @retval EFI_NOT_FOUND There are no more ports on this ATA controller.
601 @retval EFI_INVALID_PARAMETER Port is not 0xFFFF and Port was not returned on a previous call
607 AtaPassThruGetNextPort (
608 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
613 Used to retrieve the list of legal port multiplier port numbers for ATA devices on a port of an ATA
614 controller. These can either be the list of port multiplier ports where ATA devices are actually
615 present on port or the list of legal port multiplier ports on that port. Regardless, the caller of this
616 function must probe the port number and port multiplier port number returned to see if an ATA
617 device is actually present.
619 The GetNextDevice() function retrieves the port multiplier port number of an ATA device
620 present on a port of an ATA controller.
622 If PortMultiplierPort points to a port multiplier port number value that was returned on a
623 previous call to GetNextDevice(), then the port multiplier port number of the next ATA device
624 on the port of the ATA controller is returned in PortMultiplierPort, and EFI_SUCCESS is
627 If PortMultiplierPort points to 0xFFFF, then the port multiplier port number of the first
628 ATA device on port of the ATA controller is returned in PortMultiplierPort and
629 EFI_SUCCESS is returned.
631 If PortMultiplierPort is not 0xFFFF and the value pointed to by PortMultiplierPort
632 was not returned on a previous call to GetNextDevice(), then EFI_INVALID_PARAMETER
635 If PortMultiplierPort is the port multiplier port number of the last ATA device on the port of
636 the ATA controller, then EFI_NOT_FOUND is returned.
638 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
639 @param[in] Port The port number present on the ATA controller.
640 @param[in, out] PortMultiplierPort On input, a pointer to the port multiplier port number of an
641 ATA device present on the ATA controller.
642 If on input a PortMultiplierPort of 0xFFFF is specified,
643 then the port multiplier port number of the first ATA device
644 is returned. On output, a pointer to the port multiplier port
645 number of the next ATA device present on an ATA controller.
647 @retval EFI_SUCCESS The port multiplier port number of the next ATA device on the port
648 of the ATA controller was returned in PortMultiplierPort.
649 @retval EFI_NOT_FOUND There are no more ATA devices on this port of the ATA controller.
650 @retval EFI_INVALID_PARAMETER PortMultiplierPort is not 0xFFFF, and PortMultiplierPort was not
651 returned on a previous call to GetNextDevice().
656 AtaPassThruGetNextDevice (
657 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
659 IN OUT UINT16
*PortMultiplierPort
663 Used to allocate and build a device path node for an ATA device on an ATA controller.
665 The BuildDevicePath() function allocates and builds a single device node for the ATA
666 device specified by Port and PortMultiplierPort. If the ATA device specified by Port and
667 PortMultiplierPort is not present on the ATA controller, then EFI_NOT_FOUND is returned.
668 If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned. If there are not enough
669 resources to allocate the device path node, then EFI_OUT_OF_RESOURCES is returned.
671 Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of
672 DevicePath are initialized to describe the ATA device specified by Port and PortMultiplierPort,
673 and EFI_SUCCESS is returned.
675 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
676 @param[in] Port Port specifies the port number of the ATA device for which a
677 device path node is to be allocated and built.
678 @param[in] PortMultiplierPort The port multiplier port number of the ATA device for which a
679 device path node is to be allocated and built. If there is no
680 port multiplier, then specify 0.
681 @param[in, out] DevicePath A pointer to a single device path node that describes the ATA
682 device specified by Port and PortMultiplierPort. This function
683 is responsible for allocating the buffer DevicePath with the
684 boot service AllocatePool(). It is the caller's responsibility
685 to free DevicePath when the caller is finished with DevicePath.
686 @retval EFI_SUCCESS The device path node that describes the ATA device specified by
687 Port and PortMultiplierPort was allocated and returned in DevicePath.
688 @retval EFI_NOT_FOUND The ATA device specified by Port and PortMultiplierPort does not
689 exist on the ATA controller.
690 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
691 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.
696 AtaPassThruBuildDevicePath (
697 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
699 IN UINT16 PortMultiplierPort
,
700 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
704 Used to translate a device path node to a port number and port multiplier port number.
706 The GetDevice() function determines the port and port multiplier port number associated with
707 the ATA device described by DevicePath. If DevicePath is a device path node type that the
708 ATA Pass Thru driver supports, then the ATA Pass Thru driver will attempt to translate the contents
709 DevicePath into a port number and port multiplier port number.
711 If this translation is successful, then that port number and port multiplier port number are returned
712 in Port and PortMultiplierPort, and EFI_SUCCESS is returned.
714 If DevicePath, Port, or PortMultiplierPort are NULL, then EFI_INVALID_PARAMETER is returned.
716 If DevicePath is not a device path node type that the ATA Pass Thru driver supports, then
717 EFI_UNSUPPORTED is returned.
719 If DevicePath is a device path node type that the ATA Pass Thru driver supports, but there is not
720 a valid translation from DevicePath to a port number and port multiplier port number, then
721 EFI_NOT_FOUND is returned.
723 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
724 @param[in] DevicePath A pointer to the device path node that describes an ATA device on the
726 @param[out] Port On return, points to the port number of an ATA device on the ATA controller.
727 @param[out] PortMultiplierPort On return, points to the port multiplier port number of an ATA device
728 on the ATA controller.
730 @retval EFI_SUCCESS DevicePath was successfully translated to a port number and port multiplier
731 port number, and they were returned in Port and PortMultiplierPort.
732 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
733 @retval EFI_INVALID_PARAMETER Port is NULL.
734 @retval EFI_INVALID_PARAMETER PortMultiplierPort is NULL.
735 @retval EFI_UNSUPPORTED This driver does not support the device path node type in DevicePath.
736 @retval EFI_NOT_FOUND A valid translation from DevicePath to a port number and port multiplier
737 port number does not exist.
742 AtaPassThruGetDevice (
743 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
744 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
746 OUT UINT16
*PortMultiplierPort
750 Resets a specific port on the ATA controller. This operation also resets all the ATA devices
751 connected to the port.
753 The ResetChannel() function resets an a specific port on an ATA controller. This operation
754 resets all the ATA devices connected to that port. If this ATA controller does not support
755 a reset port operation, then EFI_UNSUPPORTED is returned.
757 If a device error occurs while executing that port reset operation, then EFI_DEVICE_ERROR is
760 If a timeout occurs during the execution of the port reset operation, then EFI_TIMEOUT is returned.
762 If the port reset operation is completed, then EFI_SUCCESS is returned.
764 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
765 @param[in] Port The port number on the ATA controller.
767 @retval EFI_SUCCESS The ATA controller port was reset.
768 @retval EFI_UNSUPPORTED The ATA controller does not support a port reset operation.
769 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the ATA port.
770 @retval EFI_TIMEOUT A timeout occurred while attempting to reset the ATA port.
775 AtaPassThruResetPort (
776 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
781 Resets an ATA device that is connected to an ATA controller.
783 The ResetDevice() function resets the ATA device specified by Port and PortMultiplierPort.
784 If this ATA controller does not support a device reset operation, then EFI_UNSUPPORTED is
787 If Port or PortMultiplierPort are not in a valid range for this ATA controller, then
788 EFI_INVALID_PARAMETER is returned.
790 If a device error occurs while executing that device reset operation, then EFI_DEVICE_ERROR
793 If a timeout occurs during the execution of the device reset operation, then EFI_TIMEOUT is
796 If the device reset operation is completed, then EFI_SUCCESS is returned.
798 @param[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
799 @param[in] Port Port represents the port number of the ATA device to be reset.
800 @param[in] PortMultiplierPort The port multiplier port number of the ATA device to reset.
801 If there is no port multiplier, then specify 0.
802 @retval EFI_SUCCESS The ATA device specified by Port and PortMultiplierPort was reset.
803 @retval EFI_UNSUPPORTED The ATA controller does not support a device reset operation.
804 @retval EFI_INVALID_PARAMETER Port or PortMultiplierPort are invalid.
805 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the ATA device
806 specified by Port and PortMultiplierPort.
807 @retval EFI_TIMEOUT A timeout occurred while attempting to reset the ATA device
808 specified by Port and PortMultiplierPort.
813 AtaPassThruResetDevice (
814 IN EFI_ATA_PASS_THRU_PROTOCOL
*This
,
816 IN UINT16 PortMultiplierPort
820 Sends a SCSI Request Packet to a SCSI device that is attached to the SCSI channel. This function
821 supports both blocking I/O and nonblocking I/O. The blocking I/O functionality is required, and the
822 nonblocking I/O functionality is optional.
824 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
825 @param Target The Target is an array of size TARGET_MAX_BYTES and it represents
826 the id of the SCSI device to send the SCSI Request Packet. Each
827 transport driver may choose to utilize a subset of this size to suit the needs
828 of transport target representation. For example, a Fibre Channel driver
829 may use only 8 bytes (WWN) to represent an FC target.
830 @param Lun The LUN of the SCSI device to send the SCSI Request Packet.
831 @param Packet A pointer to the SCSI Request Packet to send to the SCSI device
832 specified by Target and Lun.
833 @param Event If nonblocking I/O is not supported then Event is ignored, and blocking
834 I/O is performed. If Event is NULL, then blocking I/O is performed. If
835 Event is not NULL and non blocking I/O is supported, then
836 nonblocking I/O is performed, and Event will be signaled when the
837 SCSI Request Packet completes.
839 @retval EFI_SUCCESS The SCSI Request Packet was sent by the host. For bi-directional
840 commands, InTransferLength bytes were transferred from
841 InDataBuffer. For write and bi-directional commands,
842 OutTransferLength bytes were transferred by
844 @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was not executed. The number of bytes that
845 could be transferred is returned in InTransferLength. For write
846 and bi-directional commands, OutTransferLength bytes were
847 transferred by OutDataBuffer.
848 @retval EFI_NOT_READY The SCSI Request Packet could not be sent because there are too many
849 SCSI Request Packets already queued. The caller may retry again later.
850 @retval EFI_DEVICE_ERROR A device error occurred while attempting to send the SCSI Request
852 @retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket are invalid.
853 @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet is not supported
854 by the host adapter. This includes the case of Bi-directional SCSI
855 commands not supported by the implementation. The SCSI Request
856 Packet was not sent, so no additional status information is available.
857 @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute.
862 ExtScsiPassThruPassThru (
863 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
866 IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET
*Packet
,
867 IN EFI_EVENT Event OPTIONAL
871 Used to retrieve the list of legal Target IDs and LUNs for SCSI devices on a SCSI channel. These
872 can either be the list SCSI devices that are actually present on the SCSI channel, or the list of legal
873 Target Ids and LUNs for the SCSI channel. Regardless, the caller of this function must probe the
874 Target ID and LUN returned to see if a SCSI device is actually present at that location on the SCSI
877 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
878 @param Target On input, a pointer to the Target ID (an array of size
879 TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.
880 On output, a pointer to the Target ID (an array of
881 TARGET_MAX_BYTES) of the next SCSI device present on a SCSI
882 channel. An input value of 0xF(all bytes in the array are 0xF) in the
883 Target array retrieves the Target ID of the first SCSI device present on a
885 @param Lun On input, a pointer to the LUN of a SCSI device present on the SCSI
886 channel. On output, a pointer to the LUN of the next SCSI device present
889 @retval EFI_SUCCESS The Target ID and LUN of the next SCSI device on the SCSI
890 channel was returned in Target and Lun.
891 @retval EFI_INVALID_PARAMETER Target array is not all 0xF, and Target and Lun were
892 not returned on a previous call to GetNextTargetLun().
893 @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.
898 ExtScsiPassThruGetNextTargetLun (
899 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
900 IN OUT UINT8
**Target
,
905 Used to allocate and build a device path node for a SCSI device on a SCSI channel.
907 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
908 @param Target The Target is an array of size TARGET_MAX_BYTES and it specifies the
909 Target ID of the SCSI device for which a device path node is to be
910 allocated and built. Transport drivers may chose to utilize a subset of
911 this size to suit the representation of targets. For example, a Fibre
912 Channel driver may use only 8 bytes (WWN) in the array to represent a
914 @param Lun The LUN of the SCSI device for which a device path node is to be
916 @param DevicePath A pointer to a single device path node that describes the SCSI device
917 specified by Target and Lun. This function is responsible for
918 allocating the buffer DevicePath with the boot service
919 AllocatePool(). It is the caller's responsibility to free
920 DevicePath when the caller is finished with DevicePath.
922 @retval EFI_SUCCESS The device path node that describes the SCSI device specified by
923 Target and Lun was allocated and returned in
925 @retval EFI_INVALID_PARAMETER DevicePath is NULL.
926 @retval EFI_NOT_FOUND The SCSI devices specified by Target and Lun does not exist
928 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate DevicePath.
933 ExtScsiPassThruBuildDevicePath (
934 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
937 IN OUT EFI_DEVICE_PATH_PROTOCOL
**DevicePath
941 Used to translate a device path node to a Target ID and LUN.
943 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
944 @param DevicePath A pointer to a single device path node that describes the SCSI device
946 @param Target A pointer to the Target Array which represents the ID of a SCSI device
948 @param Lun A pointer to the LUN of a SCSI device on the SCSI channel.
950 @retval EFI_SUCCESS DevicePath was successfully translated to a Target ID and
951 LUN, and they were returned in Target and Lun.
952 @retval EFI_INVALID_PARAMETER DevicePath or Target or Lun is NULL.
953 @retval EFI_NOT_FOUND A valid translation from DevicePath to a Target ID and LUN
955 @retval EFI_UNSUPPORTED This driver does not support the device path node type in
961 ExtScsiPassThruGetTargetLun (
962 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
963 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
969 Resets a SCSI channel. This operation resets all the SCSI devices connected to the SCSI channel.
971 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
973 @retval EFI_SUCCESS The SCSI channel was reset.
974 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the SCSI channel.
975 @retval EFI_TIMEOUT A timeout occurred while attempting to reset the SCSI channel.
976 @retval EFI_UNSUPPORTED The SCSI channel does not support a channel reset operation.
981 ExtScsiPassThruResetChannel (
982 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
986 Resets a SCSI logical unit that is connected to a SCSI channel.
988 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
989 @param Target The Target is an array of size TARGET_MAX_BYTE and it represents the
990 target port ID of the SCSI device containing the SCSI logical unit to
991 reset. Transport drivers may chose to utilize a subset of this array to suit
992 the representation of their targets.
993 @param Lun The LUN of the SCSI device to reset.
995 @retval EFI_SUCCESS The SCSI device specified by Target and Lun was reset.
996 @retval EFI_INVALID_PARAMETER Target or Lun is NULL.
997 @retval EFI_TIMEOUT A timeout occurred while attempting to reset the SCSI device
998 specified by Target and Lun.
999 @retval EFI_UNSUPPORTED The SCSI channel does not support a target reset operation.
1000 @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the SCSI device
1001 specified by Target and Lun.
1006 ExtScsiPassThruResetTargetLun (
1007 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
1013 Used to retrieve the list of legal Target IDs for SCSI devices on a SCSI channel. These can either
1014 be the list SCSI devices that are actually present on the SCSI channel, or the list of legal Target IDs
1015 for the SCSI channel. Regardless, the caller of this function must probe the Target ID returned to
1016 see if a SCSI device is actually present at that location on the SCSI channel.
1018 @param This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.
1019 @param Target (TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.
1020 On output, a pointer to the Target ID (an array of
1021 TARGET_MAX_BYTES) of the next SCSI device present on a SCSI
1022 channel. An input value of 0xF(all bytes in the array are 0xF) in the
1023 Target array retrieves the Target ID of the first SCSI device present on a
1026 @retval EFI_SUCCESS The Target ID of the next SCSI device on the SCSI
1027 channel was returned in Target.
1028 @retval EFI_INVALID_PARAMETER Target or Lun is NULL.
1029 @retval EFI_TIMEOUT Target array is not all 0xF, and Target was not
1030 returned on a previous call to GetNextTarget().
1031 @retval EFI_NOT_FOUND There are no more SCSI devices on this SCSI channel.
1036 ExtScsiPassThruGetNextTarget (
1037 IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL
*This
,
1038 IN OUT UINT8
**Target
1042 Initialize ATA host controller at IDE mode.
1044 The function is designed to initialize ATA host controller.
1046 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
1051 IdeModeInitialization (
1052 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
1056 Initialize ATA host controller at AHCI mode.
1058 The function is designed to initialize ATA host controller.
1060 @param[in] Instance A pointer to the ATA_ATAPI_PASS_THRU_INSTANCE instance.
1065 AhciModeInitialization (
1066 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
1070 Start a non data transfer on specific port.
1072 @param[in] PciIo The PCI IO protocol instance.
1073 @param[in] AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
1074 @param[in] Port The number of port.
1075 @param[in] PortMultiplier The timeout value of stop.
1076 @param[in] AtapiCommand The atapi command will be used for the
1078 @param[in] AtapiCommandLength The length of the atapi command.
1079 @param[in] AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
1080 @param[in, out] AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
1081 @param[in] Timeout The timeout value of non data transfer.
1082 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1083 used by non-blocking mode.
1085 @retval EFI_DEVICE_ERROR The non data transfer abort with error occurs.
1086 @retval EFI_TIMEOUT The operation is time out.
1087 @retval EFI_UNSUPPORTED The device is not ready for transfer.
1088 @retval EFI_SUCCESS The non data transfer executes successfully.
1093 AhciNonDataTransfer (
1094 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
1095 IN EFI_AHCI_REGISTERS
*AhciRegisters
,
1097 IN UINT8 PortMultiplier
,
1098 IN EFI_AHCI_ATAPI_COMMAND
*AtapiCommand OPTIONAL
,
1099 IN UINT8 AtapiCommandLength
,
1100 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1101 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1103 IN ATA_NONBLOCK_TASK
*Task
1107 Start a DMA data transfer on specific port
1109 @param[in] Instance The ATA_ATAPI_PASS_THRU_INSTANCE protocol instance.
1110 @param[in] AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
1111 @param[in] Port The number of port.
1112 @param[in] PortMultiplier The timeout value of stop.
1113 @param[in] AtapiCommand The atapi command will be used for the
1115 @param[in] AtapiCommandLength The length of the atapi command.
1116 @param[in] Read The transfer direction.
1117 @param[in] AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
1118 @param[in, out] AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
1119 @param[in, out] MemoryAddr The pointer to the data buffer.
1120 @param[in] DataCount The data count to be transferred.
1121 @param[in] Timeout The timeout value of non data transfer.
1122 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1123 used by non-blocking mode.
1125 @retval EFI_DEVICE_ERROR The DMA data transfer abort with error occurs.
1126 @retval EFI_TIMEOUT The operation is time out.
1127 @retval EFI_UNSUPPORTED The device is not ready for transfer.
1128 @retval EFI_SUCCESS The DMA data transfer executes successfully.
1134 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
1135 IN EFI_AHCI_REGISTERS
*AhciRegisters
,
1137 IN UINT8 PortMultiplier
,
1138 IN EFI_AHCI_ATAPI_COMMAND
*AtapiCommand OPTIONAL
,
1139 IN UINT8 AtapiCommandLength
,
1141 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1142 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1143 IN OUT VOID
*MemoryAddr
,
1146 IN ATA_NONBLOCK_TASK
*Task
1150 Start a PIO data transfer on specific port.
1152 @param[in] PciIo The PCI IO protocol instance.
1153 @param[in] AhciRegisters The pointer to the EFI_AHCI_REGISTERS.
1154 @param[in] Port The number of port.
1155 @param[in] PortMultiplier The timeout value of stop.
1156 @param[in] AtapiCommand The atapi command will be used for the
1158 @param[in] AtapiCommandLength The length of the atapi command.
1159 @param[in] Read The transfer direction.
1160 @param[in] AtaCommandBlock The EFI_ATA_COMMAND_BLOCK data.
1161 @param[in, out] AtaStatusBlock The EFI_ATA_STATUS_BLOCK data.
1162 @param[in, out] MemoryAddr The pointer to the data buffer.
1163 @param[in] DataCount The data count to be transferred.
1164 @param[in] Timeout The timeout value of non data transfer.
1165 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1166 used by non-blocking mode.
1168 @retval EFI_DEVICE_ERROR The PIO data transfer abort with error occurs.
1169 @retval EFI_TIMEOUT The operation is time out.
1170 @retval EFI_UNSUPPORTED The device is not ready for transfer.
1171 @retval EFI_SUCCESS The PIO data transfer executes successfully.
1177 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
1178 IN EFI_AHCI_REGISTERS
*AhciRegisters
,
1180 IN UINT8 PortMultiplier
,
1181 IN EFI_AHCI_ATAPI_COMMAND
*AtapiCommand OPTIONAL
,
1182 IN UINT8 AtapiCommandLength
,
1184 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1185 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1186 IN OUT VOID
*MemoryAddr
,
1187 IN UINT32 DataCount
,
1189 IN ATA_NONBLOCK_TASK
*Task
1193 Send ATA command into device with NON_DATA protocol
1195 @param[in] PciIo A pointer to ATA_ATAPI_PASS_THRU_INSTANCE
1197 @param[in] IdeRegisters A pointer to EFI_IDE_REGISTERS data structure.
1198 @param[in] AtaCommandBlock A pointer to EFI_ATA_COMMAND_BLOCK data
1200 @param[in, out] AtaStatusBlock A pointer to EFI_ATA_STATUS_BLOCK data structure.
1201 @param[in] Timeout The time to complete the command.
1202 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1203 used by non-blocking mode.
1205 @retval EFI_SUCCESS Reading succeed
1206 @retval EFI_ABORTED Command failed
1207 @retval EFI_DEVICE_ERROR Device status error.
1212 AtaNonDataCommandIn (
1213 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
1214 IN EFI_IDE_REGISTERS
*IdeRegisters
,
1215 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1216 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1218 IN ATA_NONBLOCK_TASK
*Task
1222 Perform an ATA Udma operation (Read, ReadExt, Write, WriteExt).
1224 @param[in] Instance A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data
1226 @param[in] IdeRegisters A pointer to EFI_IDE_REGISTERS data structure.
1227 @param[in] Read Flag used to determine the data transfer
1228 direction. Read equals 1, means data transferred
1229 from device to host;Read equals 0, means data
1230 transferred from host to device.
1231 @param[in] DataBuffer A pointer to the source buffer for the data.
1232 @param[in] DataLength The length of the data.
1233 @param[in] AtaCommandBlock A pointer to EFI_ATA_COMMAND_BLOCK data structure.
1234 @param[in, out] AtaStatusBlock A pointer to EFI_ATA_STATUS_BLOCK data structure.
1235 @param[in] Timeout The time to complete the command.
1236 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1237 used by non-blocking mode.
1239 @retval EFI_SUCCESS the operation is successful.
1240 @retval EFI_OUT_OF_RESOURCES Build PRD table failed
1241 @retval EFI_UNSUPPORTED Unknown channel or operations command
1242 @retval EFI_DEVICE_ERROR Ata command execute failed
1248 IN ATA_ATAPI_PASS_THRU_INSTANCE
*Instance
,
1249 IN EFI_IDE_REGISTERS
*IdeRegisters
,
1251 IN VOID
*DataBuffer
,
1252 IN UINT64 DataLength
,
1253 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1254 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1256 IN ATA_NONBLOCK_TASK
*Task
1260 This function is used to send out ATA commands conforms to the PIO Data In Protocol.
1262 @param[in] PciIo A pointer to ATA_ATAPI_PASS_THRU_INSTANCE data
1264 @param[in] IdeRegisters A pointer to EFI_IDE_REGISTERS data structure.
1265 @param[in, out] Buffer A pointer to the source buffer for the data.
1266 @param[in] ByteCount The length of the data.
1267 @param[in] Read Flag used to determine the data transfer direction.
1268 Read equals 1, means data transferred from device
1269 to host;Read equals 0, means data transferred
1270 from host to device.
1271 @param[in] AtaCommandBlock A pointer to EFI_ATA_COMMAND_BLOCK data structure.
1272 @param[in] AtaStatusBlock A pointer to EFI_ATA_STATUS_BLOCK data structure.
1273 @param[in] Timeout The time to complete the command.
1274 @param[in] Task Optional. Pointer to the ATA_NONBLOCK_TASK
1275 used by non-blocking mode.
1277 @retval EFI_SUCCESS send out the ATA command and device send required data successfully.
1278 @retval EFI_DEVICE_ERROR command sent failed.
1284 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
1285 IN EFI_IDE_REGISTERS
*IdeRegisters
,
1286 IN OUT VOID
*Buffer
,
1287 IN UINT64 ByteCount
,
1289 IN EFI_ATA_COMMAND_BLOCK
*AtaCommandBlock
,
1290 IN OUT EFI_ATA_STATUS_BLOCK
*AtaStatusBlock
,
1292 IN ATA_NONBLOCK_TASK
*Task