]> git.proxmox.com Git - mirror_edk2.git/commitdiff
add AtaPassThruProtocol into MdePkg.
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 9 Sep 2009 01:57:27 +0000 (01:57 +0000)
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 9 Sep 2009 01:57:27 +0000 (01:57 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9250 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Protocol/AtaPassThru.h [new file with mode: 0644]
MdePkg/MdePkg.dec

diff --git a/MdePkg/Include/Protocol/AtaPassThru.h b/MdePkg/Include/Protocol/AtaPassThru.h
new file mode 100644 (file)
index 0000000..74f90fa
--- /dev/null
@@ -0,0 +1,471 @@
+/** @file\r
+  The EFI_ATA_PASS_THRU_PROTOCOL provides information about an ATA controller and the ability\r
+  to send ATA Command Blocks to any ATA device attached to that ATA controller. The information\r
+  includes the attributes of the ATA controller.\r
+\r
+  Copyright (c) 2009, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+**/\r
+\r
+#ifndef __ATA_PASS_THROUGH_H__\r
+#define __ATA_PASS_THROUGH_H__\r
+\r
+#define EFI_ATA_PASS_THRU_PROTOCOL_GUID \\r
+  { \\r
+    0x1d3de7f0, 0x807, 0x424f, {0xaa, 0x69, 0x11, 0xa5, 0x4e, 0x19, 0xa4, 0x6f } \\r
+  }\r
+\r
+typedef struct _EFI_ATA_PASS_THRU_PROTOCOL EFI_ATA_PASS_THRU_PROTOCOL;\r
+\r
+typedef struct {\r
+  UINT32 Attributes;\r
+  UINT32 IoAlign;\r
+} EFI_ATA_PASS_THRU_MODE;\r
+\r
+///\r
+/// If this bit is set, then the EFI_ATA_PASS_THRU_PROTOCOL interface is for physical\r
+/// devices on the ATA controller.\r
+///\r
+#define EFI_ATA_PASS_THRU_ATTRIBUTES_PHYSICAL   0x0001\r
+///\r
+/// If this bit is set, then the EFI_ATA_PASS_THRU_PROTOCOL interface is for logical\r
+/// devices on the ATA controller.\r
+///\r
+#define EFI_ATA_PASS_THRU_ATTRIBUTES_LOGICAL    0x0002\r
+///\r
+/// If this bit is set, then the EFI_ATA_PASS_THRU_PROTOCOL interface supports non blocking\r
+/// I/O. Every EFI_ATA_PASS_THRU_PROTOCOL must support blocking I/O. The support of non-blocking\r
+/// I/O is optional.\r
+///\r
+#define EFI_ATA_PASS_THRU_ATTRIBUTES_NONBLOCKIO 0x0004\r
+\r
+typedef struct _EFI_ATA_COMMAND_BLOCK {\r
+  UINT8 Reserved1[2];\r
+  UINT8 AtaCommand;\r
+  UINT8 AtaFeatures;\r
+  UINT8 AtaSectorNumber;\r
+  UINT8 AtaCylinderLow;\r
+  UINT8 AtaCylinderHigh;\r
+  UINT8 AtaDeviceHead;\r
+  UINT8 AtaSectorNumberExp;\r
+  UINT8 AtaCylinderLowExp;\r
+  UINT8 AtaCylinderHighExp; \r
+  UINT8 AtaFeaturesExp;\r
+  UINT8 AtaSectorCount;\r
+  UINT8 AtaSectorCountExp;\r
+  UINT8 Reserved2[6];\r
+} EFI_ATA_COMMAND_BLOCK;\r
+\r
+typedef struct _EFI_ATA_STATUS_BLOCK {\r
+  UINT8 Reserved1[2];\r
+  UINT8 AtaStatus;\r
+  UINT8 AtaError;\r
+  UINT8 AtaSectorNumber;\r
+  UINT8 AtaCylinderLow;\r
+  UINT8 AtaCylinderHigh;\r
+  UINT8 AtaDeviceHead;\r
+  UINT8 AtaSectorNumberExp;\r
+  UINT8 AtaCylinderLowExp;\r
+  UINT8 AtaCylinderHighExp; \r
+  UINT8 Reserved2;\r
+  UINT8 AtaSectorCount;\r
+  UINT8 AtaSectorCountExp;\r
+  UINT8 Reserved2[6];\r
+} EFI_ATA_STATUS_BLOCK;\r
+\r
+typedef UINT8 EFI_ATA_PASS_THRU_CMD_PROTOCOL;\r
+\r
+#define EFI_ATA_PASS_THRU_PROTOCOL_ATA_HARDWARE_RESET 0x00\r
+#define EFI_ATA_PASS_THRU_PROTOCOL_ATA_SOFTWARE_RESET 0x01\r
+#define EFI_ATA_PASS_THRU_PROTOCOL_ATA_NON_DATA       0x02\r
+#define EFI_ATA_PASS_THRU_PROTOCOL_PIO_DATA_IN        0x04\r
+#define EFI_ATA_PASS_THRU_PROTOCOL_PIO_DATA_OUT       0x05\r
+#define EFI_ATA_PASS_THRU_PROTOCOL_DMA                0x06\r
+#define EFI_ATA_PASS_THRU_PROTOCOL_DMA_QUEUED         0x07\r
+#define EFI_ATA_PASS_THRU_PROTOCOL_DEVICE_DIAGNOSTIC  0x08\r
+#define EFI_ATA_PASS_THRU_PROTOCOL_DEVICE_RESET       0x09\r
+#define EFI_ATA_PASS_THRU_PROTOCOL_UDMA_DATA_IN       0x0A\r
+#define EFI_ATA_PASS_THRU_PROTOCOL_UDMA_DATA_OUT      0x0B\r
+#define EFI_ATA_PASS_THRU_PROTOCOL_FPDMA              0x0C\r
+#define EFI_ATA_PASS_THRU_PROTOCOL_RETURN_RESPONSE    0xFF\r
+\r
+typedef UINT8 EFI_ATA_PASS_THRU_LENGTH;\r
+\r
+#define EFI_ATA_PASS_THRU_LENGTH_BYTES                0x80\r
+\r
+\r
+#define EFI_ATA_PASS_THRU_LENGTH_MASK                 0x70\r
+#define EFI_ATA_PASS_THRU_LENGTH_NO_DATA_TRANSFER     0x00\r
+#define EFI_ATA_PASS_THRU_LENGTH_FEATURES             0x10\r
+#define EFI_ATA_PASS_THRU_LENGTH_SECTOR_COUNT         0x20\r
+#define EFI_ATA_PASS_THRU_LENGTH_TPSIU                0x30\r
+\r
+#define EFI_ATA_PASS_THRU_LENGTH_COUNT                0x0F\r
+\r
+typedef struct {\r
+  ///\r
+  /// A pointer to the sense data that was generated by the execution of the ATA\r
+  /// command. It must be aligned to the boundary specified in the IoAlign field\r
+  /// in the EFI_ATA_PASS_THRU_MODE structure.\r
+  ///\r
+  EFI_ATA_STATUS_BLOCK           *Asb;\r
+  ///\r
+  /// A pointer to buffer that contains the Command Data Block to send to the ATA\r
+  /// device specified by Port and PortMultiplierPort.\r
+  ///\r
+  EFI_ATA_COMMAND_BLOCK          *Acb;\r
+  ///\r
+  /// The timeout, in 100 ns units, to use for the execution of this ATA command.\r
+  /// A Timeout value of 0 means that this function will wait indefinitely for the\r
+  /// ATA command to execute. If Timeout is greater than zero, then this function\r
+  /// will return EFI_TIMEOUT if the time required to execute the ATA command is\r
+  /// greater than Timeout.\r
+  ///\r
+  UINT64                         Timeout;\r
+  ///\r
+  /// A pointer to the data buffer to transfer between the ATA controller and the\r
+  /// ATA device for read and bidirectional commands. For all write and non data\r
+  /// commands where InTransferLength is 0 this field is optional and may be NULL.\r
+  /// If this field is not NULL, then it must be aligned on the boundary specified\r
+  /// by the IoAlign field in the EFI_ATA_PASS_THRU_MODE structure.\r
+  ///\r
+  VOID                           *InDataBuffer;\r
+  ///\r
+  /// A pointer to the data buffer to transfer between the ATA controller and the\r
+  /// ATA device for write or bidirectional commands. For all read and non data\r
+  /// commands where OutTransferLength is 0 this field is optional and may be NULL.\r
+  /// If this field is not NULL, then it must be aligned on the boundary specified\r
+  /// by the IoAlign field in the EFI_ATA_PASS_THRU_MODE structure.\r
+  ///\r
+  VOID                           *OutDataBuffer;\r
+  ///\r
+  /// On input, the size, in bytes, of InDataBuffer. On output, the number of bytes\r
+  /// transferred between the ATA controller and the ATA device. If InTransferLength\r
+  /// is larger than the ATA controller can handle, no data will be transferred,\r
+  /// InTransferLength will be updated to contain the number of bytes that the ATA\r
+  /// controller is able to transfer, and EFI_BAD_BUFFER_SIZE will be returned.\r
+  ///\r
+  UINT32                         InTransferLength;\r
+  ///\r
+  /// On Input, the size, in bytes of OutDataBuffer. On Output, the Number of bytes\r
+  /// transferred between ATA Controller and the ATA device. If OutTransferLength is\r
+  /// larger than the ATA controller can handle, no data will be transferred, \r
+  /// OutTransferLength will be updated to contain the number of bytes that the ATA\r
+  /// controller is able to transfer, and EFI_BAD_BUFFER_SIZE will be returned.\r
+  ///\r
+  UINT32                         OutTransferLength;\r
+  ///\r
+  /// Specifies the protocol used when the ATA device executes the command.\r
+  ///\r
+  EFI_ATA_PASS_THRU_CMD_PROTOCOL Protocol;\r
+  ///\r
+  /// Specifies the way in which the ATA command length is encoded.\r
+  ///\r
+  EFI_ATA_PASS_THRU_LENGTH       Length;\r
+} EFI_ATA_PASS_THRU_COMMAND_PACKET;\r
+\r
+\r
+/**\r
+  Sends an ATA command to an ATA device that is attached to the ATA controller. This function\r
+  supports both blocking I/O and non-blocking I/O. The blocking I/O functionality is required,\r
+  and the non-blocking I/O functionality is optional.\r
+\r
+  @param[in]     This                A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance. \r
+  @param[in]     Port                The port number of the ATA device to send the command. \r
+  @param[in]     PortMultiplierPort  The port multiplier port number of the ATA device to send the command.\r
+                                     If there is no port multiplier, then specify 0.\r
+  @param[in,out] Packet              A pointer to the ATA command to send to the ATA device specified by Port\r
+                                     and PortMultiplierPort.\r
+  @param[in]     Event               If non-blocking I/O is not supported then Event is ignored, and blocking\r
+                                     I/O is performed. If Event is NULL, then blocking I/O is performed. If\r
+                                     Event is not NULL and non blocking I/O is supported, then non-blocking\r
+                                     I/O is performed, and Event will be signaled when the ATA command completes.\r
+\r
+  @retval EFI_SUCCESS                The ATA command was sent by the host. For bi-directional commands, \r
+                                     InTransferLength bytes were transferred from InDataBuffer. For write and\r
+                                     bi-directional commands, OutTransferLength bytes were transferred by OutDataBuffer.\r
+  @retval EFI_BAD_BUFFER_SIZE        The ATA command was not executed. The number of bytes that could be transferred\r
+                                     is returned in InTransferLength. For write and bi-directional commands, \r
+                                     OutTransferLength bytes were transferred by OutDataBuffer.\r
+  @retval EFI_NOT_READY              The ATA command could not be sent because there are too many ATA commands\r
+                                     already queued. The caller may retry again later.\r
+  @retval EFI_DEVICE_ERROR           A device error occurred while attempting to send the ATA command.\r
+  @retval EFI_INVALID_PARAMETER      Port, PortMultiplierPort, or the contents of Acb are invalid. The ATA\r
+                                     command was not sent, so no additional status information is available.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ATA_PASS_THRU_PASSTHRU)(\r
+  IN     EFI_ATA_PASS_THRU_PROTOCOL       *This,\r
+  IN     UINT16                           Port,\r
+  IN     UINT16                           PortMultiplierPort,\r
+  IN OUT EFI_ATA_PASS_THRU_COMMAND_PACKET *Packet,\r
+  IN     EFI_EVENT                        Event OPTIONAL\r
+  );\r
+\r
+/**\r
+  Used to retrieve the lis t of legal port numbers for ATA devices on an ATA controller.\r
+  These can either be the list of ports where ATA devices are actually present or the\r
+  list of legal port numbers for the ATA controller. Regardless, the caller of this\r
+  function must probe the port number returned to see if an ATA device is actually\r
+  present at that location on the ATA controller.\r
+\r
+  The GetNextPort() function retrieves the port number on an ATA controller. If on input\r
+  Port is 0xFFFF, then the port number of the first port on the ATA controller is returned\r
+  in Port and EFI_SUCCESS is returned.\r
+\r
+  If Port is a port number that was returned on a previous call to GetNextPort(), then the\r
+  port number of the next port on the ATA controller is returned in Port, and EFI_SUCCESS\r
+  is returned. If Port is not 0xFFFF and Port was not returned on a previous call to\r
+  GetNextPort(), then EFI_INVALID_PARAMETER is returned.\r
+\r
+  If Port is the port number of the last port on the ATA controller, then EFI_NOT_FOUND is\r
+  returned.\r
+\r
+  @param[in]     This           A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance. \r
+  @param[in,out] Port           On input, a pointer to the port number on the ATA controller.\r
+                                On output, a pointer to the next port number on the ATA\r
+                                controller. An input value of 0xFFFF retrieves the first port\r
+                                number on the ATA controller.\r
+\r
+  @retval EFI_SUCCESS           The next port number on the ATA controller was returned in Port.\r
+  @retval EFI_NOT_FOUND         There are no more ports on this ATA controller.\r
+  @retval EFI_INVALID_PARAMETER Port is not 0xFFFF and Port was not returned on a previous call\r
+                                to GetNextPort().\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ATA_PASS_THRU_GET_NEXT_PORT)(\r
+  IN EFI_ATA_PASS_THRU_PROTOCOL *This,\r
+  IN OUT UINT16                 *Port\r
+  );\r
+\r
+/**\r
+  Used to retrieve the list of legal port multiplier port numbers for ATA devices on a port of an ATA \r
+  controller. These can either be the list of port multiplier ports where ATA devices are actually \r
+  present on port or the list of legal port multiplier ports on that port. Regardless, the caller of this \r
+  function must probe the port number and port multiplier port number returned to see if an ATA \r
+  device is actually present.\r
+\r
+  The GetNextDevice() function retrieves the port multiplier port number of an ATA device \r
+  present on a port of an ATA controller.\r
+  \r
+  If PortMultiplierPort points to a port multiplier port number value that was returned on a \r
+  previous call to GetNextDevice(), then the port multiplier port number of the next ATA device\r
+  on the port of the ATA controller is returned in PortMultiplierPort, and EFI_SUCCESS is\r
+  returned.\r
+  \r
+  If PortMultiplierPort points to 0xFFFF, then the port multiplier port number of the first \r
+  ATA device on port of the ATA controller is returned in PortMultiplierPort and \r
+  EFI_SUCCESS is returned.\r
+  \r
+  If PortMultiplierPort is not 0xFFFF and the value pointed to by PortMultiplierPort\r
+  was not returned on a previous call to GetNextDevice(), then EFI_INVALID_PARAMETER\r
+  is returned.\r
+  \r
+  If PortMultiplierPort is the port multiplier port number of the last ATA device on the port of \r
+  the ATA controller, then EFI_NOT_FOUND is returned.\r
+\r
+  @param[in]     This                A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r
+  @param[in]     Port                The port number present on the ATA controller.\r
+  @param[in,out] PortMultiplierPort  On input, a pointer to the port multiplier port number of an\r
+                                     ATA device present on the ATA controller. \r
+                                     If on input a PortMultiplierPort of 0xFFFF is specified, \r
+                                     then the port multiplier port number of the first ATA device\r
+                                     is returned. On output, a pointer to the port multiplier port\r
+                                     number of the next ATA device present on an ATA controller.\r
+\r
+  @retval EFI_SUCCESS                The port multiplier port number of the next ATA device on the port\r
+                                     of the ATA controller was returned in PortMultiplierPort.\r
+  @retval EFI_NOT_FOUND              There are no more ATA devices on this port of the ATA controller.\r
+  @retval EFI_INVALID_PARAMETER      PortMultiplierPort is not 0xFFFF, and PortMultiplierPort was not\r
+                                     returned on a previous call to GetNextDevice().\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ATA_PASS_THRU_GET_NEXT_DEVICE)(\r
+  IN EFI_ATA_PASS_THRU_PROTOCOL *This,\r
+  IN UINT16                     Port,\r
+  IN OUT UINT16                 *PortMultiplierPort\r
+  );\r
+\r
+/**\r
+  Used to allocate and build a device path node for an ATA device on an ATA controller.\r
+\r
+  The BuildDevicePath() function allocates and builds a single device node for the ATA\r
+  device specified by Port and PortMultiplierPort. If the ATA device specified by Port and\r
+  PortMultiplierPort is not present on the ATA controller, then EFI_NOT_FOUND is returned.\r
+  If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned. If there are not enough\r
+  resources to allocate the device path node, then EFI_OUT_OF_RESOURCES is returned.\r
+\r
+  Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of\r
+  DevicePath are initialized to describe the ATA device specified by Port and PortMultiplierPort,\r
+  and EFI_SUCCESS is returned.\r
+\r
+  @param[in]     This                A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r
+  @param[in]     Port                Port specifies the port number of the ATA device for which a\r
+                                     device path node is to be allocated and built.\r
+  @param[in]     PortMultiplierPort  The port multiplier port number of the ATA device for which a\r
+                                     device path node is to be allocated and built. If there is no\r
+                                     port multiplier, then specify 0.\r
+  @param[in,out] DevicePath          A pointer to a single device path node that describes the ATA\r
+                                     device specified by Port and PortMultiplierPort. This function\r
+                                     is responsible for allocating the buffer DevicePath with the\r
+                                     boot service AllocatePool(). It is the caller¡¯s responsibility\r
+                                     to free DevicePath when the caller is finished with DevicePath.\r
+  @retval EFI_SUCCESS                The device path node that describes the ATA device specified by\r
+                                     Port and PortMultiplierPort was allocated and returned in DevicePath.\r
+  @retval EFI_NOT_FOUND              The ATA device specified by Port and PortMultiplierPort does not\r
+                                     exist on the ATA controller.\r
+  @retval EFI_INVALID_PARAMETER      DevicePath is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES       There are not enough resources to allocate DevicePath.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ATA_PASS_THRU_BUILD_DEVICE_PATH)(\r
+  IN     EFI_ATA_PASS_THRU_PROTOCOL *This,\r
+  IN     UINT16                     Port,\r
+  IN     UINT16                     PortMultiplierPort,\r
+  IN OUT EFI_DEVICE_PATH_PROTOCOL   **DevicePath\r
+  );\r
+\r
+/**\r
+  Used to translate a device path node to a port number and port multiplier port number.\r
+\r
+  The GetDevice() function determines the port and port multiplier port number associated with\r
+  the ATA device described by DevicePath. If DevicePath is a device path node type that the\r
+  ATA Pass Thru driver supports, then the ATA Pass Thru driver will attempt to translate the contents \r
+  DevicePath into a port number and port multiplier port number.\r
+\r
+  If this translation is successful, then that port number and port multiplier port number are returned\r
+  in Port and PortMultiplierPort, and EFI_SUCCESS is returned.\r
+\r
+  If DevicePath, Port, or PortMultiplierPort are NULL, then EFI_INVALID_PARAMETER is returned.\r
+\r
+  If DevicePath is not a device path node type that the ATA Pass Thru driver supports, then \r
+  EFI_UNSUPPORTED is returned.\r
+\r
+  If DevicePath is a device path node type that the ATA Pass Thru driver supports, but there is not \r
+  a valid translation from DevicePath to a port number and port multiplier port number, then \r
+  EFI_NOT_FOUND is returned.\r
+\r
+  @param[in]  This                A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r
+  @param[in]  DevicePath          A pointer to the device path node that describes an ATA device on the\r
+                                  ATA controller.\r
+  @param[out] Port                On return, points to the port number of an ATA device on the ATA controller.\r
+  @param[out] PortMultiplierPort  On return, points to the port multiplier port number of an ATA device\r
+                                  on the ATA controller.\r
+\r
+  @retval EFI_SUCCESS             DevicePath was successfully translated to a port number and port multiplier\r
+                                  port number, and they were returned in Port and PortMultiplierPort.\r
+  @retval EFI_INVALID_PARAMETER   DevicePath is NULL.\r
+  @retval EFI_INVALID_PARAMETER   Port is NULL.\r
+  @retval EFI_INVALID_PARAMETER   PortMultiplierPort is NULL.\r
+  @retval EFI_UNSUPPORTED         This driver does not support the device path node type in DevicePath.\r
+  @retval EFI_NOT_FOUND           A valid translation from DevicePath to a port number and port multiplier\r
+                                  port number does not exist.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ATA_PASS_THRU_GET_DEVICE)(\r
+  IN  EFI_ATA_PASS_THRU_PROTOCOL *This,\r
+  IN  EFI_DEVICE_PATH_PROTOCOL   *DevicePath,\r
+  OUT UINT16                     *Port,\r
+  OUT UINT16                     *PortMultiplierPort\r
+  );\r
+\r
+/**\r
+  Resets a specific port on the ATA controller. This operation also resets all the ATA devices\r
+  connected to the port.\r
+\r
+  The ResetChannel() function resets an a specific port on an ATA controller. This operation\r
+  resets all the ATA devices connected to that port. If this ATA controller does not support\r
+  a reset port operation, then EFI_UNSUPPORTED is returned.\r
+\r
+  If a device error occurs while executing that port reset operation, then EFI_DEVICE_ERROR is\r
+  returned.\r
+\r
+  If a timeout occurs during the execution of the port reset operation, then EFI_TIMEOUT is returned.\r
+\r
+  If the port reset operation is completed, then EFI_SUCCESS is returned.\r
+\r
+  @param[in]  This          A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r
+  @param[in]  Port          The port number on the ATA controller.\r
+\r
+  @retval EFI_SUCCESS       The ATA controller port was reset.\r
+  @retval EFI_UNSUPPORTED   The ATA controller does not support a port reset operation.\r
+  @retval EFI_DEVICE_ERROR  A device error occurred while attempting to reset the ATA port.\r
+  @retval EFI_TIMEOUT       A timeout occurred while attempting to reset the ATA port.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ATA_PASS_THRU_RESET_PORT)(\r
+  IN EFI_ATA_PASS_THRU_PROTOCOL *This,\r
+  IN UINT16                     Port\r
+  );\r
+\r
+/**\r
+  Resets an ATA device that is connected to an ATA controller.\r
+\r
+  The ResetDevice() function resets the ATA device specified by Port and PortMultiplierPort.\r
+  If this ATA controller does not support a device reset operation, then EFI_UNSUPPORTED is\r
+  returned.\r
+\r
+  If Port or PortMultiplierPort are not in a valid range for this ATA controller, then \r
+  EFI_INVALID_PARAMETER is returned.\r
+\r
+  If a device error occurs while executing that device reset operation, then EFI_DEVICE_ERROR\r
+  is returned.\r
+\r
+  If a timeout occurs during the execution of the device reset operation, then EFI_TIMEOUT is\r
+  returned.\r
+\r
+  If the device reset operation is completed, then EFI_SUCCESS is returned.\r
+\r
+  @param[in] This                A pointer to the EFI_ATA_PASS_THRU_PROTOCOL instance.\r
+  @param[in] Port                Port represents the port number of the ATA device to be reset.\r
+  @param[in] PortMultiplierPort  The port multiplier port number of the ATA device to reset.\r
+                                 If there is no port multiplier, then specify 0.\r
+  @retval EFI_SUCCESS            The ATA device specified by Port and PortMultiplierPort was reset.\r
+  @retval EFI_UNSUPPORTED        The ATA controller does not support a device reset operation.\r
+  @retval EFI_INVALID_PARAMETER  Port or PortMultiplierPort are invalid.\r
+  @retval EFI_DEVICE_ERROR       A device error occurred while attempting to reset the ATA device\r
+                                 specified by Port and PortMultiplierPort.\r
+  @retval EFI_TIMEOUT            A timeout occurred while attempting to reset the ATA device\r
+                                 specified by Port and PortMultiplierPort.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ATA_PASS_THRU_RESET_DEVICE)(\r
+  IN EFI_ATA_PASS_THRU_PROTOCOL *This,\r
+  IN UINT16                     Port,\r
+  IN UINT16                     PortMultiplierPort\r
+  );\r
+\r
+struct _EFI_ATA_PASS_THRU_PROTOCOL {\r
+  EFI_ATA_PASS_THRU_MODE               *Mode;\r
+  EFI_ATA_PASS_THRU_PASSTHRU           PassThru;\r
+  EFI_ATA_PASS_THRU_GET_NEXT_PORT      GetNextPort;\r
+  EFI_ATA_PASS_THRU_GET_NEXT_DEVICE    GetNextDevice;\r
+  EFI_ATA_PASS_THRU_BUILD_DEVICE_PATH  BuildDevicePath;\r
+  EFI_ATA_PASS_THRU_GET_DEVICE         GetDevice;\r
+  EFI_ATA_PASS_THRU_RESET_PORT         ResetPort;\r
+  EFI_ATA_PASS_THRU_RESET_DEVICE       ResetDevice;\r
+};\r
+\r
+extern EFI_GUID gEfiAtaPassThruProtocolGuid;\r
+\r
+#endif\r
index aaa8476a9f0be7a1dc815e811638a65eb0af72c1..beb456dc820fd04006a440194dbaa1f24708a31d 100644 (file)
   ## Include/Protocol/UserManager.h\r
   gEfiUserManagerProtocolGuid          = { 0x6fd5b00c, 0xd426, 0x4283, {0x98, 0x87, 0x6c, 0xf5, 0xcf, 0x1c, 0xb1, 0xfe }}\r
 \r
+  ## Include/Protocol/AtaPassThru.h\r
+  gEfiAtaPassThruProtocolGuid          = { 0x1d3de7f0, 0x807, 0x424f, {0xaa, 0x69, 0x11, 0xa5, 0x4e, 0x19, 0xa4, 0x6f }}\r
+\r
 [PcdsFeatureFlag]\r
   ## If TRUE, the component name protocol will not be installed.\r
   gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|FALSE|BOOLEAN|0x0000000d\r