The EFI_ATA_PASS_THRU_PROTOCOL provides information about an ATA controller and the ability to send ATA Command Blocks to any ATA device attached to that ATA controller. The information includes the attributes of the ATA controller.
Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
- Revision Reference:
- This Protocol was introduced in UEFI Specification 2.3.
Used to allocate and build a device path node for an ATA device on an ATA controller.
The BuildDevicePath() function allocates and builds a single device node for the ATA device specified by Port and PortMultiplierPort. If the ATA device specified by Port and PortMultiplierPort is not present on the ATA controller, then EFI_NOT_FOUND is returned. If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned. If there are not enough resources to allocate the device path node, then EFI_OUT_OF_RESOURCES is returned.
Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of DevicePath are initialized to describe the ATA device specified by Port and PortMultiplierPort, and EFI_SUCCESS is returned.
- Parameters
-
[in] | This | A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance. |
[in] | Port | Port specifies the port number of the ATA device for which a device path node is to be allocated and built. |
[in] | PortMultiplierPort | The port multiplier port number of the ATA device for which a device path node is to be allocated and built. If there is no port multiplier, then specify 0xFFFF. |
[out] | DevicePath | A pointer to a single device path node that describes the ATA device specified by Port and PortMultiplierPort. This function is responsible for allocating the buffer DevicePath with the boot service AllocatePool(). It is the caller's responsibility to free DevicePath when the caller is finished with DevicePath. |
- Return values
-
EFI_SUCCESS | The device path node that describes the ATA device specified by Port and PortMultiplierPort was allocated and returned in DevicePath. |
EFI_NOT_FOUND | The ATA device specified by Port and PortMultiplierPort does not exist on the ATA controller. |
EFI_INVALID_PARAMETER | DevicePath is NULL. |
EFI_OUT_OF_RESOURCES | There are not enough resources to allocate DevicePath. |
Used to translate a device path node to a port number and port multiplier port number.
The GetDevice() function determines the port and port multiplier port number associated with the ATA device described by DevicePath. If DevicePath is a device path node type that the ATA Pass Thru driver supports, then the ATA Pass Thru driver will attempt to translate the contents DevicePath into a port number and port multiplier port number.
If this translation is successful, then that port number and port multiplier port number are returned in Port and PortMultiplierPort, and EFI_SUCCESS is returned.
If DevicePath, Port, or PortMultiplierPort are NULL, then EFI_INVALID_PARAMETER is returned.
If DevicePath is not a device path node type that the ATA Pass Thru driver supports, then EFI_UNSUPPORTED is returned.
If DevicePath is a device path node type that the ATA Pass Thru driver supports, but there is not a valid translation from DevicePath to a port number and port multiplier port number, then EFI_NOT_FOUND is returned.
- Parameters
-
[in] | This | A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance. |
[in] | DevicePath | A pointer to the device path node that describes an ATA device on the ATA controller. |
[out] | Port | On return, points to the port number of an ATA device on the ATA controller. |
[out] | PortMultiplierPort | On return, points to the port multiplier port number of an ATA device on the ATA controller. |
- Return values
-
EFI_SUCCESS | DevicePath was successfully translated to a port number and port multiplier port number, and they were returned in Port and PortMultiplierPort. |
EFI_INVALID_PARAMETER | DevicePath is NULL. |
EFI_INVALID_PARAMETER | Port is NULL. |
EFI_INVALID_PARAMETER | PortMultiplierPort is NULL. |
EFI_UNSUPPORTED | This driver does not support the device path node type in DevicePath. |
EFI_NOT_FOUND | A valid translation from DevicePath to a port number and port multiplier port number does not exist. |
Used to retrieve the list of legal port multiplier port numbers for ATA devices on a port of an ATA controller. These can either be the list of port multiplier ports where ATA devices are actually present on port or the list of legal port multiplier ports on that port. Regardless, the caller of this function must probe the port number and port multiplier port number returned to see if an ATA device is actually present.
The GetNextDevice() function retrieves the port multiplier port number of an ATA device present on a port of an ATA controller.
If PortMultiplierPort points to a port multiplier port number value that was returned on a previous call to GetNextDevice(), then the port multiplier port number of the next ATA device on the port of the ATA controller is returned in PortMultiplierPort, and EFI_SUCCESS is returned.
If PortMultiplierPort points to 0xFFFF, then the port multiplier port number of the first ATA device on port of the ATA controller is returned in PortMultiplierPort and EFI_SUCCESS is returned.
If PortMultiplierPort is not 0xFFFF and the value pointed to by PortMultiplierPort was not returned on a previous call to GetNextDevice(), then EFI_INVALID_PARAMETER is returned.
If PortMultiplierPort is the port multiplier port number of the last ATA device on the port of the ATA controller, then EFI_NOT_FOUND is returned.
- Parameters
-
[in] | This | A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance. |
[in] | Port | The port number present on the ATA controller. |
[in,out] | PortMultiplierPort | On input, a pointer to the port multiplier port number of an ATA device present on the ATA controller. If on input a PortMultiplierPort of 0xFFFF is specified, then the port multiplier port number of the first ATA device is returned. On output, a pointer to the port multiplier port number of the next ATA device present on an ATA controller. |
- Return values
-
EFI_SUCCESS | The port multiplier port number of the next ATA device on the port of the ATA controller was returned in PortMultiplierPort. |
EFI_NOT_FOUND | There are no more ATA devices on this port of the ATA controller. |
EFI_INVALID_PARAMETER | PortMultiplierPort is not 0xFFFF, and PortMultiplierPort was not returned on a previous call to GetNextDevice(). |
Used to retrieve the list of legal port numbers for ATA devices on an ATA controller. These can either be the list of ports where ATA devices are actually present or the list of legal port numbers for the ATA controller. Regardless, the caller of this function must probe the port number returned to see if an ATA device is actually present at that location on the ATA controller.
The GetNextPort() function retrieves the port number on an ATA controller. If on input Port is 0xFFFF, then the port number of the first port on the ATA controller is returned in Port and EFI_SUCCESS is returned.
If Port is a port number that was returned on a previous call to GetNextPort(), then the port number of the next port on the ATA controller is returned in Port, and EFI_SUCCESS is returned. If Port is not 0xFFFF and Port was not returned on a previous call to GetNextPort(), then EFI_INVALID_PARAMETER is returned.
If Port is the port number of the last port on the ATA controller, then EFI_NOT_FOUND is returned.
- Parameters
-
[in] | This | A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance. |
[in,out] | Port | On input, a pointer to the port number on the ATA controller. On output, a pointer to the next port number on the ATA controller. An input value of 0xFFFF retrieves the first port number on the ATA controller. |
- Return values
-
EFI_SUCCESS | The next port number on the ATA controller was returned in Port. |
EFI_NOT_FOUND | There are no more ports on this ATA controller. |
EFI_INVALID_PARAMETER | Port is not 0xFFFF and Port was not returned on a previous call to GetNextPort(). |
Resets an ATA device that is connected to an ATA controller.
The ResetDevice() function resets the ATA device specified by Port and PortMultiplierPort. If this ATA controller does not support a device reset operation, then EFI_UNSUPPORTED is returned.
If Port or PortMultiplierPort are not in a valid range for this ATA controller, then EFI_INVALID_PARAMETER is returned.
If a device error occurs while executing that device reset operation, then EFI_DEVICE_ERROR is returned.
If a timeout occurs during the execution of the device reset operation, then EFI_TIMEOUT is returned.
If the device reset operation is completed, then EFI_SUCCESS is returned.
- Parameters
-
[in] | This | A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance. |
[in] | Port | Port represents the port number of the ATA device to be reset. |
[in] | PortMultiplierPort | The port multiplier port number of the ATA device to reset. If there is no port multiplier, then specify 0xFFFF. |
- Return values
-
EFI_SUCCESS | The ATA device specified by Port and PortMultiplierPort was reset. |
EFI_UNSUPPORTED | The ATA controller does not support a device reset operation. |
EFI_INVALID_PARAMETER | Port or PortMultiplierPort are invalid. |
EFI_DEVICE_ERROR | A device error occurred while attempting to reset the ATA device specified by Port and PortMultiplierPort. |
EFI_TIMEOUT | A timeout occurred while attempting to reset the ATA device specified by Port and PortMultiplierPort. |
Resets a specific port on the ATA controller. This operation also resets all the ATA devices connected to the port.
The ResetChannel() function resets an a specific port on an ATA controller. This operation resets all the ATA devices connected to that port. If this ATA controller does not support a reset port operation, then EFI_UNSUPPORTED is returned.
If a device error occurs while executing that port reset operation, then EFI_DEVICE_ERROR is returned.
If a timeout occurs during the execution of the port reset operation, then EFI_TIMEOUT is returned.
If the port reset operation is completed, then EFI_SUCCESS is returned.
- Parameters
-
[in] | This | A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance. |
[in] | Port | The port number on the ATA controller. |
- Return values
-
EFI_SUCCESS | The ATA controller port was reset. |
EFI_UNSUPPORTED | The ATA controller does not support a port reset operation. |
EFI_DEVICE_ERROR | A device error occurred while attempting to reset the ATA port. |
EFI_TIMEOUT | A timeout occurred while attempting to reset the ATA port. |