MdePkg/Include/Protocol/AtaPassThru.h File Reference


Data Structures

struct  EFI_ATA_PASS_THRU_MODE
struct  _EFI_ATA_COMMAND_BLOCK
struct  _EFI_ATA_STATUS_BLOCK
struct  EFI_ATA_PASS_THRU_COMMAND_PACKET
struct  _EFI_ATA_PASS_THRU_PROTOCOL

Defines

#define EFI_ATA_PASS_THRU_PROTOCOL_GUID
#define EFI_ATA_PASS_THRU_ATTRIBUTES_PHYSICAL   0x0001
#define EFI_ATA_PASS_THRU_ATTRIBUTES_LOGICAL   0x0002
#define EFI_ATA_PASS_THRU_ATTRIBUTES_NONBLOCKIO   0x0004
#define EFI_ATA_PASS_THRU_PROTOCOL_ATA_HARDWARE_RESET   0x00
#define EFI_ATA_PASS_THRU_PROTOCOL_ATA_SOFTWARE_RESET   0x01
#define EFI_ATA_PASS_THRU_PROTOCOL_ATA_NON_DATA   0x02
#define EFI_ATA_PASS_THRU_PROTOCOL_PIO_DATA_IN   0x04
#define EFI_ATA_PASS_THRU_PROTOCOL_PIO_DATA_OUT   0x05
#define EFI_ATA_PASS_THRU_PROTOCOL_DMA   0x06
#define EFI_ATA_PASS_THRU_PROTOCOL_DMA_QUEUED   0x07
#define EFI_ATA_PASS_THRU_PROTOCOL_DEVICE_DIAGNOSTIC   0x08
#define EFI_ATA_PASS_THRU_PROTOCOL_DEVICE_RESET   0x09
#define EFI_ATA_PASS_THRU_PROTOCOL_UDMA_DATA_IN   0x0A
#define EFI_ATA_PASS_THRU_PROTOCOL_UDMA_DATA_OUT   0x0B
#define EFI_ATA_PASS_THRU_PROTOCOL_FPDMA   0x0C
#define EFI_ATA_PASS_THRU_PROTOCOL_RETURN_RESPONSE   0xFF
#define EFI_ATA_PASS_THRU_LENGTH_BYTES   0x80
#define EFI_ATA_PASS_THRU_LENGTH_MASK   0x70
#define EFI_ATA_PASS_THRU_LENGTH_NO_DATA_TRANSFER   0x00
#define EFI_ATA_PASS_THRU_LENGTH_FEATURES   0x10
#define EFI_ATA_PASS_THRU_LENGTH_SECTOR_COUNT   0x20
#define EFI_ATA_PASS_THRU_LENGTH_TPSIU   0x30
#define EFI_ATA_PASS_THRU_LENGTH_COUNT   0x0F

Typedefs

typedef struct
_EFI_ATA_PASS_THRU_PROTOCOL 
EFI_ATA_PASS_THRU_PROTOCOL
typedef struct
_EFI_ATA_COMMAND_BLOCK 
EFI_ATA_COMMAND_BLOCK
typedef struct
_EFI_ATA_STATUS_BLOCK 
EFI_ATA_STATUS_BLOCK
typedef UINT8 EFI_ATA_PASS_THRU_CMD_PROTOCOL
typedef UINT8 EFI_ATA_PASS_THRU_LENGTH
typedef EFI_STATUS(EFIAPIEFI_ATA_PASS_THRU_PASSTHRU )(IN EFI_ATA_PASS_THRU_PROTOCOL *This, IN UINT16 Port, IN UINT16 PortMultiplierPort, IN OUT EFI_ATA_PASS_THRU_COMMAND_PACKET *Packet, IN EFI_EVENT Event)
typedef EFI_STATUS(EFIAPIEFI_ATA_PASS_THRU_GET_NEXT_PORT )(IN EFI_ATA_PASS_THRU_PROTOCOL *This, IN OUT UINT16 *Port)
typedef EFI_STATUS(EFIAPIEFI_ATA_PASS_THRU_GET_NEXT_DEVICE )(IN EFI_ATA_PASS_THRU_PROTOCOL *This, IN UINT16 Port, IN OUT UINT16 *PortMultiplierPort)
typedef EFI_STATUS(EFIAPIEFI_ATA_PASS_THRU_BUILD_DEVICE_PATH )(IN EFI_ATA_PASS_THRU_PROTOCOL *This, IN UINT16 Port, IN UINT16 PortMultiplierPort, IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath)
typedef EFI_STATUS(EFIAPIEFI_ATA_PASS_THRU_GET_DEVICE )(IN EFI_ATA_PASS_THRU_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT UINT16 *Port, OUT UINT16 *PortMultiplierPort)
typedef EFI_STATUS(EFIAPIEFI_ATA_PASS_THRU_RESET_PORT )(IN EFI_ATA_PASS_THRU_PROTOCOL *This, IN UINT16 Port)
typedef EFI_STATUS(EFIAPIEFI_ATA_PASS_THRU_RESET_DEVICE )(IN EFI_ATA_PASS_THRU_PROTOCOL *This, IN UINT16 Port, IN UINT16 PortMultiplierPort)

Variables

EFI_GUID gEfiAtaPassThruProtocolGuid

Detailed Description

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 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Define Documentation

#define EFI_ATA_PASS_THRU_ATTRIBUTES_LOGICAL   0x0002

If this bit is set, then the EFI_ATA_PASS_THRU_PROTOCOL interface is for logical devices on the ATA controller.

#define EFI_ATA_PASS_THRU_ATTRIBUTES_NONBLOCKIO   0x0004

If this bit is set, then the EFI_ATA_PASS_THRU_PROTOCOL interface supports non blocking I/O. Every EFI_ATA_PASS_THRU_PROTOCOL must support blocking I/O. The support of non-blocking I/O is optional.

#define EFI_ATA_PASS_THRU_ATTRIBUTES_PHYSICAL   0x0001

If this bit is set, then the EFI_ATA_PASS_THRU_PROTOCOL interface is for physical devices on the ATA controller.

#define EFI_ATA_PASS_THRU_LENGTH_BYTES   0x80

#define EFI_ATA_PASS_THRU_LENGTH_COUNT   0x0F

#define EFI_ATA_PASS_THRU_LENGTH_FEATURES   0x10

#define EFI_ATA_PASS_THRU_LENGTH_MASK   0x70

#define EFI_ATA_PASS_THRU_LENGTH_NO_DATA_TRANSFER   0x00

#define EFI_ATA_PASS_THRU_LENGTH_SECTOR_COUNT   0x20

#define EFI_ATA_PASS_THRU_LENGTH_TPSIU   0x30

#define EFI_ATA_PASS_THRU_PROTOCOL_ATA_HARDWARE_RESET   0x00

#define EFI_ATA_PASS_THRU_PROTOCOL_ATA_NON_DATA   0x02

#define EFI_ATA_PASS_THRU_PROTOCOL_ATA_SOFTWARE_RESET   0x01

#define EFI_ATA_PASS_THRU_PROTOCOL_DEVICE_DIAGNOSTIC   0x08

#define EFI_ATA_PASS_THRU_PROTOCOL_DEVICE_RESET   0x09

#define EFI_ATA_PASS_THRU_PROTOCOL_DMA   0x06

#define EFI_ATA_PASS_THRU_PROTOCOL_DMA_QUEUED   0x07

#define EFI_ATA_PASS_THRU_PROTOCOL_FPDMA   0x0C

#define EFI_ATA_PASS_THRU_PROTOCOL_GUID

Value:

{ \
    0x1d3de7f0, 0x807, 0x424f, {0xaa, 0x69, 0x11, 0xa5, 0x4e, 0x19, 0xa4, 0x6f } \
  }

#define EFI_ATA_PASS_THRU_PROTOCOL_PIO_DATA_IN   0x04

#define EFI_ATA_PASS_THRU_PROTOCOL_PIO_DATA_OUT   0x05

#define EFI_ATA_PASS_THRU_PROTOCOL_RETURN_RESPONSE   0xFF

#define EFI_ATA_PASS_THRU_PROTOCOL_UDMA_DATA_IN   0x0A

#define EFI_ATA_PASS_THRU_PROTOCOL_UDMA_DATA_OUT   0x0B


Typedef Documentation

typedef EFI_STATUS(EFIAPI * EFI_ATA_PASS_THRU_BUILD_DEVICE_PATH)(IN EFI_ATA_PASS_THRU_PROTOCOL *This, IN UINT16 Port, IN UINT16 PortMultiplierPort, IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath)

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 0.
[in,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.

typedef EFI_STATUS(EFIAPI * EFI_ATA_PASS_THRU_GET_DEVICE)(IN EFI_ATA_PASS_THRU_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT UINT16 *Port, OUT UINT16 *PortMultiplierPort)

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.

typedef EFI_STATUS(EFIAPI * EFI_ATA_PASS_THRU_GET_NEXT_DEVICE)(IN EFI_ATA_PASS_THRU_PROTOCOL *This, IN UINT16 Port, IN OUT UINT16 *PortMultiplierPort)

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().

typedef EFI_STATUS(EFIAPI * EFI_ATA_PASS_THRU_PASSTHRU)(IN EFI_ATA_PASS_THRU_PROTOCOL *This, IN UINT16 Port, IN UINT16 PortMultiplierPort, IN OUT EFI_ATA_PASS_THRU_COMMAND_PACKET *Packet, IN EFI_EVENT Event)

Sends an ATA command to an ATA device that is attached to the ATA controller. This function supports both blocking I/O and non-blocking I/O. The blocking I/O functionality is required, and the non-blocking I/O functionality is optional.

Parameters:
[in] This A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.
[in] Port The port number of the ATA device to send the command.
[in] PortMultiplierPort The port multiplier port number of the ATA device to send the command. If there is no port multiplier, then specify 0.
[in,out] Packet A pointer to the ATA command to send to the ATA device specified by Port and PortMultiplierPort.
[in] Event If non-blocking I/O is not supported then Event is ignored, and blocking I/O is performed. If Event is NULL, then blocking I/O is performed. If Event is not NULL and non blocking I/O is supported, then non-blocking I/O is performed, and Event will be signaled when the ATA command completes.
Return values:
EFI_SUCCESS The ATA command was sent by the host. For bi-directional commands, InTransferLength bytes were transferred from InDataBuffer. For write and bi-directional commands, OutTransferLength bytes were transferred by OutDataBuffer.
EFI_BAD_BUFFER_SIZE The ATA command was not executed. The number of bytes that could be transferred is returned in InTransferLength. For write and bi-directional commands, OutTransferLength bytes were transferred by OutDataBuffer.
EFI_NOT_READY The ATA command could not be sent because there are too many ATA commands already queued. The caller may retry again later.
EFI_DEVICE_ERROR A device error occurred while attempting to send the ATA command.
EFI_INVALID_PARAMETER Port, PortMultiplierPort, or the contents of Acb are invalid. The ATA command was not sent, so no additional status information is available.

typedef EFI_STATUS(EFIAPI * EFI_ATA_PASS_THRU_RESET_DEVICE)(IN EFI_ATA_PASS_THRU_PROTOCOL *This, IN UINT16 Port, IN UINT16 PortMultiplierPort)

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 0.
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.


Variable Documentation


Generated on Thu Sep 24 23:14:19 2015 for MdePkg[ALL] by  doxygen 1.5.7.1