]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/UefiScsiLib.h
MdePkg/PiFirmwareFile: fix undefined behavior in FFS_FILE_SIZE
[mirror_edk2.git] / MdePkg / Include / Library / UefiScsiLib.h
index d6907c406077cc0ef86ebaf665552377b171c7dc..10dd81902bc5251b4f9f4888c9553211723f925a 100644 (file)
@@ -5,14 +5,8 @@
   for hard drive, CD and DVD devices that are the most common SCSI boot targets used by UEFI platforms.\r
   This library class depends on SCSI I/O Protocol defined in UEFI Specification and SCSI-2 industry standard.\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-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
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -32,6 +26,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   If HostAdapterStatus is NULL, then ASSERT().\r
   If TargetStatus is NULL, then ASSERT().\r
 \r
+  If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
+  alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
+  gets returned.\r
 \r
   @param[in]     ScsiIo             A pointer to the SCSI I/O Protocol instance\r
                                     for the specific SCSI target.\r
@@ -49,7 +46,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                     optional and may be NULL.\r
   @param[in, out] SenseDataLength   On input, a pointer to the length in bytes of\r
                                     the SenseData buffer. On output, a pointer to\r
-                                    the number of bytes written to the SenseData buffer. \r
+                                    the number of bytes written to the SenseData buffer.\r
   @param[out]     HostAdapterStatus The status of the SCSI Host Controller that produces\r
                                     the SCSI bus containing the SCSI target specified by\r
                                     ScsiIo when the SCSI Request Packet was executed.\r
@@ -59,29 +56,30 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                     by ScsiIo when the SCSI Request Packet was executed\r
                                     on the SCSI Host Controller. See the EFI SCSI I/O\r
                                     Protocol in the UEFI Specification for details on\r
-                                    the possible return values. \r
-\r
-  @retval EFI_SUCCESS          The command was executed successfully.\r
-                               See HostAdapterStatus, TargetStatus, SenseDataLength,\r
-                               and SenseData in that order for additional status\r
-                               information.\r
-  @retval EFI_NOT_READY        The SCSI Request Packet could not be sent because\r
-                               there are too many SCSI Command Packets already\r
-                               queued. The SCSI Request Packet was not sent, so\r
-                               no additional status information is available.\r
-                               The caller may retry again later.\r
-  @retval EFI_DEVICE_ERROR     A device error occurred while attempting to send\r
-                               SCSI Request Packet.  See HostAdapterStatus,\r
-                               TargetStatus, SenseDataLength, and SenseData in that\r
-                               order for additional status information.\r
-  @retval EFI_UNSUPPORTED      The command described by the SCSI Request Packet\r
-                               is not supported by the SCSI initiator(i.e., SCSI\r
-                               Host Controller). The SCSI Request Packet was not\r
-                               sent, so no additional status information is available.\r
-  @retval EFI_TIMEOUT          A timeout occurred while waiting for the SCSI Request\r
-                               Packet to execute.  See HostAdapterStatus, TargetStatus,\r
-                               SenseDataLength, and SenseData in that order for\r
-                               additional status information.\r
+                                    the possible return values.\r
+\r
+  @retval EFI_SUCCESS               The command was executed successfully.\r
+                                    See HostAdapterStatus, TargetStatus, SenseDataLength,\r
+                                    and SenseData in that order for additional status\r
+                                    information.\r
+  @retval EFI_NOT_READY             The SCSI Request Packet could not be sent because\r
+                                    there are too many SCSI Command Packets already\r
+                                    queued. The SCSI Request Packet was not sent, so\r
+                                    no additional status information is available.\r
+                                    The caller may retry again later.\r
+  @retval EFI_DEVICE_ERROR          A device error occurred while attempting to send\r
+                                    SCSI Request Packet.  See HostAdapterStatus,\r
+                                    TargetStatus, SenseDataLength, and SenseData in that\r
+                                    order for additional status information.\r
+  @retval EFI_UNSUPPORTED           The command described by the SCSI Request Packet\r
+                                    is not supported by the SCSI initiator(i.e., SCSI\r
+                                    Host Controller). The SCSI Request Packet was not\r
+                                    sent, so no additional status information is available.\r
+  @retval EFI_TIMEOUT               A timeout occurred while waiting for the SCSI Request\r
+                                    Packet to execute.  See HostAdapterStatus, TargetStatus,\r
+                                    SenseDataLength, and SenseData in that order for\r
+                                    additional status information.\r
+  @retval EFI_INVALID_PARAMETER     The contents of the SCSI Request Packet are invalid.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -108,6 +106,14 @@ ScsiTestUnitReadyCommand (
   If TargetStatus is NULL, then ASSERT().\r
   If InquiryDataLength is NULL, then ASSERT().\r
 \r
+  If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
+  alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
+  gets returned.\r
+\r
+  If InquiryDataLength is non-zero and InquiryDataBuffer is not NULL, InquiryDataBuffer\r
+  must meet buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
+  EFI_INVALID_PARAMETER gets returned.\r
+\r
   @param[in]      ScsiIo                 A pointer to the SCSI I/O Protocol instance\r
                                          for the specific SCSI target.\r
   @param[in]      Timeout                The timeout in 100 ns units to use for the\r
@@ -123,7 +129,7 @@ ScsiTestUnitReadyCommand (
                                          If SenseDataLength is 0, then this parameter\r
                                          is optional and may be NULL.\r
   @param[in, out] SenseDataLength        On input, the length in bytes of the SenseData buffer.\r
-                                         On output, the number of bytes written to the SenseData buffer. \r
+                                         On output, the number of bytes written to the SenseData buffer.\r
   @param[out]     HostAdapterStatus      The status of the SCSI Host Controller that\r
                                          produces the SCSI bus containing the SCSI\r
                                          target specified by ScsiIo when the SCSI\r
@@ -135,12 +141,12 @@ ScsiTestUnitReadyCommand (
                                          executed on the SCSI Host Controller.\r
                                          See the EFI SCSI I/O Protocol in the UEFI\r
                                          Specification for details on the possible\r
-                                         return values. \r
+                                         return values.\r
   @param[in, out] InquiryDataBuffer      A pointer to inquiry data that was generated\r
                                          by the execution of the SCSI Request Packet.\r
                                          This buffer must be allocated by the caller.\r
                                          If InquiryDataLength is 0, then this parameter\r
-                                         is optional and may be NULL. \r
+                                         is optional and may be NULL.\r
   @param[in, out] InquiryDataLength      On input, a pointer to the length in bytes\r
                                          of the InquiryDataBuffer buffer.\r
                                          On output, a pointer to the number of bytes\r
@@ -148,30 +154,31 @@ ScsiTestUnitReadyCommand (
   @param[in]      EnableVitalProductData If TRUE, then the supported vital product\r
                                          data is returned in InquiryDataBuffer.\r
                                          If FALSE, then the standard inquiry data is\r
-                                         returned in InquiryDataBuffer. \r
-\r
-  @retval EFI_SUCCESS          The command was executed successfully. See HostAdapterStatus,\r
-                               TargetStatus, SenseDataLength, and SenseData in that order\r
-                               for additional status information.\r
-  @retval EFI_BAD_BUFFER_SIZE  The SCSI Request Packet was executed, but the entire\r
-                               InquiryDataBuffer could not be transferred. The actual\r
-                               number of bytes transferred is returned in InquiryDataLength.\r
-  @retval EFI_NOT_READY        The SCSI Request Packet could not be sent because there\r
-                               are too many SCSI Command Packets already queued.\r
-                               The SCSI Request Packet was not sent, so no additional\r
-                               status information is available. The caller may retry again later.\r
-  @retval EFI_DEVICE_ERROR     A device error occurred while attempting to send SCSI\r
-                               Request Packet.  See HostAdapterStatus, TargetStatus,\r
-                               SenseDataLength, and SenseData in that order for additional\r
-                               status information.\r
-  @retval EFI_UNSUPPORTED      The command described by the SCSI Request Packet is not\r
-                               supported by the SCSI initiator(i.e., SCSI  Host Controller).\r
-                               The SCSI Request Packet was not sent, so no additional\r
-                               status information is available.\r
-  @retval EFI_TIMEOUT          A timeout occurred while waiting for the SCSI Request\r
-                               Packet to execute.  See HostAdapterStatus, TargetStatus,\r
-                               SenseDataLength, and SenseData in that order for\r
-                               additional status information.\r
+                                         returned in InquiryDataBuffer.\r
+\r
+  @retval EFI_SUCCESS                    The command was executed successfully. See HostAdapterStatus,\r
+                                         TargetStatus, SenseDataLength, and SenseData in that order\r
+                                         for additional status information.\r
+  @retval EFI_BAD_BUFFER_SIZE            The SCSI Request Packet was executed, but the entire\r
+                                         InquiryDataBuffer could not be transferred. The actual\r
+                                         number of bytes transferred is returned in InquiryDataLength.\r
+  @retval EFI_NOT_READY                  The SCSI Request Packet could not be sent because there\r
+                                         are too many SCSI Command Packets already queued.\r
+                                         The SCSI Request Packet was not sent, so no additional\r
+                                         status information is available. The caller may retry again later.\r
+  @retval EFI_DEVICE_ERROR               A device error occurred while attempting to send SCSI\r
+                                         Request Packet.  See HostAdapterStatus, TargetStatus,\r
+                                         SenseDataLength, and SenseData in that order for additional\r
+                                         status information.\r
+  @retval EFI_UNSUPPORTED                The command described by the SCSI Request Packet is not\r
+                                         supported by the SCSI initiator(i.e., SCSI  Host Controller).\r
+                                         The SCSI Request Packet was not sent, so no additional\r
+                                         status information is available.\r
+  @retval EFI_TIMEOUT                    A timeout occurred while waiting for the SCSI Request\r
+                                         Packet to execute.  See HostAdapterStatus, TargetStatus,\r
+                                         SenseDataLength, and SenseData in that order for\r
+                                         additional status information.\r
+  @retval EFI_INVALID_PARAMETER          The contents of the SCSI Request Packet are invalid.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -201,6 +208,14 @@ ScsiInquiryCommand (
   If TargetStatus is NULL, then ASSERT().\r
   If InquiryDataLength is NULL, then ASSERT().\r
 \r
+  If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
+  alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
+  gets returned.\r
+\r
+  If InquiryDataLength is non-zero and InquiryDataBuffer is not NULL, InquiryDataBuffer\r
+  must meet buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
+  EFI_INVALID_PARAMETER gets returned.\r
+\r
   @param[in]      ScsiIo                 A pointer to the SCSI I/O Protocol instance\r
                                          for the specific SCSI target.\r
   @param[in]      Timeout                The timeout in 100 ns units to use for the\r
@@ -216,7 +231,7 @@ ScsiInquiryCommand (
                                          If SenseDataLength is 0, then this parameter\r
                                          is optional and may be NULL.\r
   @param[in, out] SenseDataLength        On input, the length in bytes of the SenseData buffer.\r
-                                         On output, the number of bytes written to the SenseData buffer. \r
+                                         On output, the number of bytes written to the SenseData buffer.\r
   @param[out]     HostAdapterStatus      The status of the SCSI Host Controller that\r
                                          produces the SCSI bus containing the SCSI\r
                                          target specified by ScsiIo when the SCSI\r
@@ -228,12 +243,12 @@ ScsiInquiryCommand (
                                          executed on the SCSI Host Controller.\r
                                          See the EFI SCSI I/O Protocol in the UEFI\r
                                          Specification for details on the possible\r
-                                         return values. \r
+                                         return values.\r
   @param[in, out] InquiryDataBuffer      A pointer to inquiry data that was generated\r
                                          by the execution of the SCSI Request Packet.\r
                                          This buffer must be allocated by the caller.\r
                                          If InquiryDataLength is 0, then this parameter\r
-                                         is optional and may be NULL. \r
+                                         is optional and may be NULL.\r
   @param[in, out] InquiryDataLength      On input, a pointer to the length in bytes\r
                                          of the InquiryDataBuffer buffer.\r
                                          On output, a pointer to the number of bytes\r
@@ -245,28 +260,29 @@ ScsiInquiryCommand (
   @param[in]      PageCode               The page code of the vital product data.\r
                                          It's ignored if EnableVitalProductData is FALSE.\r
 \r
-  @retval EFI_SUCCESS          The command executed successfully. See HostAdapterStatus,\r
-                               TargetStatus, SenseDataLength, and SenseData in that order\r
-                               for additional status information.\r
-  @retval EFI_BAD_BUFFER_SIZE  The SCSI Request Packet was executed, but the entire\r
-                               InquiryDataBuffer could not be transferred. The actual\r
-                               number of bytes transferred is returned in InquiryDataLength.\r
-  @retval EFI_NOT_READY        The SCSI Request Packet could not be sent because there\r
-                               are too many SCSI Command Packets already queued.\r
-                               The SCSI Request Packet was not sent, so no additional\r
-                               status information is available. The caller may retry again later.\r
-  @retval EFI_DEVICE_ERROR     A device error occurred while attempting to send SCSI\r
-                               Request Packet.  See HostAdapterStatus, TargetStatus,\r
-                               SenseDataLength, and SenseData in that order for additional\r
-                               status information.\r
-  @retval EFI_UNSUPPORTED      The command described by the SCSI Request Packet is not\r
-                               supported by the SCSI initiator(i.e., SCSI  Host Controller).\r
-                               The SCSI Request Packet was not sent, so no additional\r
-                               status information is available.\r
-  @retval EFI_TIMEOUT          A timeout occurred while waiting for the SCSI Request\r
-                               Packet to execute.  See HostAdapterStatus, TargetStatus,\r
-                               SenseDataLength, and SenseData in that order for\r
-                               additional status information.\r
+  @retval EFI_SUCCESS                    The command executed successfully. See HostAdapterStatus,\r
+                                         TargetStatus, SenseDataLength, and SenseData in that order\r
+                                         for additional status information.\r
+  @retval EFI_BAD_BUFFER_SIZE            The SCSI Request Packet was executed, but the entire\r
+                                         InquiryDataBuffer could not be transferred. The actual\r
+                                         number of bytes transferred is returned in InquiryDataLength.\r
+  @retval EFI_NOT_READY                  The SCSI Request Packet could not be sent because there\r
+                                         are too many SCSI Command Packets already queued.\r
+                                         The SCSI Request Packet was not sent, so no additional\r
+                                         status information is available. The caller may retry again later.\r
+  @retval EFI_DEVICE_ERROR               A device error occurred while attempting to send SCSI\r
+                                         Request Packet.  See HostAdapterStatus, TargetStatus,\r
+                                         SenseDataLength, and SenseData in that order for additional\r
+                                         status information.\r
+  @retval EFI_UNSUPPORTED                The command described by the SCSI Request Packet is not\r
+                                         supported by the SCSI initiator(i.e., SCSI  Host Controller).\r
+                                         The SCSI Request Packet was not sent, so no additional\r
+                                         status information is available.\r
+  @retval EFI_TIMEOUT                    A timeout occurred while waiting for the SCSI Request\r
+                                         Packet to execute.  See HostAdapterStatus, TargetStatus,\r
+                                         SenseDataLength, and SenseData in that order for\r
+                                         additional status information.\r
+  @retval EFI_INVALID_PARAMETER          The contents of the SCSI Request Packet are invalid.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -299,6 +315,13 @@ ScsiInquiryCommandEx (
   If TargetStatus is NULL, then ASSERT().\r
   If DataLength is NULL, then ASSERT().\r
 \r
+  If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
+  alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
+  gets returned.\r
+\r
+  If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r
+  alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
+  gets returned.\r
 \r
   @param[in]      ScsiIo             A pointer to the SCSI I/O Protocol instance\r
                                      for the specific SCSI target.\r
@@ -315,7 +338,7 @@ ScsiInquiryCommandEx (
                                      If SenseDataLength is 0, then this parameter\r
                                      is optional and may be NULL.\r
   @param[in, out]  SenseDataLength   On input, the length in bytes of the SenseData buffer.\r
-                                     On output, the number of bytes written to the SenseData buffer. \r
+                                     On output, the number of bytes written to the SenseData buffer.\r
   @param[out]     HostAdapterStatus  The status of the SCSI Host Controller that\r
                                      produces the SCSI bus containing the SCSI target\r
                                      specified by ScsiIo when the SCSI Request Packet\r
@@ -331,39 +354,40 @@ ScsiInquiryCommandEx (
                                      execution of the SCSI Request Packet.  This\r
                                      buffer must be allocated by the caller. If\r
                                      DataLength is 0, then this parameter is optional\r
-                                     and may be NULL. \r
+                                     and may be NULL.\r
   @param[in, out]  DataLength        On input, a pointer to the length in bytes of\r
                                      the DataBuffer buffer.  On output, a pointer\r
                                      to the number of bytes written to the DataBuffer\r
-                                     buffer. \r
+                                     buffer.\r
   @param[in]      DBDField           Specifies the DBD field of the CDB for this SCSI Command.\r
-  @param[in]      PageControl        Specifies the PC field of the CDB for this SCSI Command. \r
-  @param[in]      PageCode           Specifies the Page Control field of the CDB for this SCSI Command. \r
-\r
-  @retval EFI_SUCCESS               The command was executed successfully.\r
-                                    See HostAdapterStatus, TargetStatus, SenseDataLength,\r
-                                    and SenseData in that order for additional status information.\r
-  @retval EFI_BAD_BUFFER_SIZE       The SCSI Request Packet was executed, but the\r
-                                    entire DataBuffer could not be transferred.\r
-                                    The actual number of bytes transferred is returned\r
-                                    in DataLength.\r
-  @retval EFI_NOT_READY             The SCSI Request Packet could not be sent because\r
-                                    there are too many SCSI Command Packets already queued.\r
-                                    The SCSI Request Packet was not sent, so no additional\r
-                                    status information is available.  The caller may retry\r
-                                    again later.\r
-  @retval EFI_DEVICE_ERROR          A device error occurred while attempting to send\r
-                                    SCSI Request Packet.  See HostAdapterStatus, TargetStatus,\r
-                                    SenseDataLength, and SenseData in that order for\r
-                                    additional status information.\r
-  @retval EFI_UNSUPPORTED           The command described by the SCSI Request Packet\r
-                                    is not supported by the SCSI initiator(i.e., SCSI\r
-                                    Host Controller). The SCSI Request Packet was not\r
-                                    sent, so no additional status information is available.\r
-  @retval EFI_TIMEOUT               A timeout occurred while waiting for the SCSI\r
-                                    Request Packet to execute.  See HostAdapterStatus,\r
-                                    TargetStatus, SenseDataLength, and SenseData in that\r
-                                    order for additional status information.\r
+  @param[in]      PageControl        Specifies the PC field of the CDB for this SCSI Command.\r
+  @param[in]      PageCode           Specifies the Page Control field of the CDB for this SCSI Command.\r
+\r
+  @retval EFI_SUCCESS                The command was executed successfully.\r
+                                     See HostAdapterStatus, TargetStatus, SenseDataLength,\r
+                                     and SenseData in that order for additional status information.\r
+  @retval EFI_BAD_BUFFER_SIZE        The SCSI Request Packet was executed, but the\r
+                                     entire DataBuffer could not be transferred.\r
+                                     The actual number of bytes transferred is returned\r
+                                     in DataLength.\r
+  @retval EFI_NOT_READY              The SCSI Request Packet could not be sent because\r
+                                     there are too many SCSI Command Packets already queued.\r
+                                     The SCSI Request Packet was not sent, so no additional\r
+                                     status information is available.  The caller may retry\r
+                                     again later.\r
+  @retval EFI_DEVICE_ERROR           A device error occurred while attempting to send\r
+                                     SCSI Request Packet.  See HostAdapterStatus, TargetStatus,\r
+                                     SenseDataLength, and SenseData in that order for\r
+                                     additional status information.\r
+  @retval EFI_UNSUPPORTED            The command described by the SCSI Request Packet\r
+                                     is not supported by the SCSI initiator(i.e., SCSI\r
+                                     Host Controller). The SCSI Request Packet was not\r
+                                     sent, so no additional status information is available.\r
+  @retval EFI_TIMEOUT                A timeout occurred while waiting for the SCSI\r
+                                     Request Packet to execute.  See HostAdapterStatus,\r
+                                     TargetStatus, SenseDataLength, and SenseData in that\r
+                                     order for additional status information.\r
+  @retval EFI_INVALID_PARAMETER      The contents of the SCSI Request Packet are invalid.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -395,6 +419,10 @@ ScsiModeSense10Command (
   If HostAdapterStatus is NULL, then ASSERT().\r
   If TargetStatus is NULL, then ASSERT().\r
 \r
+  If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
+  alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
+  gets returned.\r
+\r
   @param[in]       ScsiIo               A pointer to SCSI IO protocol.\r
   @param[in]       Timeout              The length of timeout period.\r
   @param[in, out]  SenseData            A pointer to output sense data.\r
@@ -409,6 +437,7 @@ ScsiModeSense10Command (
   @retval EFI_UNSUPPORTED               The command described by the SCSI Request Packet is not supported by\r
                                         the SCSI initiator(i.e., SCSI  Host Controller)\r
   @retval EFI_TIMEOUT                   A timeout occurred while waiting for the SCSI Request Packet to execute.\r
+  @retval EFI_INVALID_PARAMETER         The contents of the SCSI Request Packet are invalid.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -436,6 +465,14 @@ ScsiRequestSenseCommand (
   If TargetStatus is NULL, then ASSERT().\r
   If DataLength is NULL, then ASSERT().\r
 \r
+  If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
+  alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
+  gets returned.\r
+\r
+  If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r
+  alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
+  gets returned.\r
+\r
   @param[in]      ScsiIo               A pointer to SCSI IO protocol.\r
   @param[in]      Timeout              The length of timeout period.\r
   @param[in, out] SenseData            A pointer to output sense data.\r
@@ -446,16 +483,17 @@ ScsiRequestSenseCommand (
   @param[in, out] DataLength           The length of data buffer.\r
   @param[in]      Pmi                  Partial medium indicator.\r
 \r
-  @retval  EFI_SUCCESS           Command is executed successfully.\r
-  @retval  EFI_BAD_BUFFER_SIZE   The SCSI Request Packet was executed, but the entire\r
-                                 DataBuffer could not be transferred. The actual\r
-                                 number of bytes transferred is returned in DataLength.\r
-  @retval  EFI_NOT_READY         The SCSI Request Packet could not be sent because\r
-                                 there are too many SCSI Command Packets already queued.\r
-  @retval  EFI_DEVICE_ERROR      A device error occurred while attempting to send SCSI Request Packet.\r
-  @retval  EFI_UNSUPPORTED       The command described by the SCSI Request Packet\r
-                                 is not supported by the SCSI initiator(i.e., SCSI  Host Controller)\r
-  @retval  EFI_TIMEOUT           A timeout occurred while waiting for the SCSI Request Packet to execute.\r
+  @retval  EFI_SUCCESS                 Command is executed successfully.\r
+  @retval  EFI_BAD_BUFFER_SIZE         The SCSI Request Packet was executed, but the entire\r
+                                       DataBuffer could not be transferred. The actual\r
+                                       number of bytes transferred is returned in DataLength.\r
+  @retval  EFI_NOT_READY               The SCSI Request Packet could not be sent because\r
+                                       there are too many SCSI Command Packets already queued.\r
+  @retval  EFI_DEVICE_ERROR            A device error occurred while attempting to send SCSI Request Packet.\r
+  @retval  EFI_UNSUPPORTED             The command described by the SCSI Request Packet\r
+                                       is not supported by the SCSI initiator(i.e., SCSI  Host Controller)\r
+  @retval  EFI_TIMEOUT                 A timeout occurred while waiting for the SCSI Request Packet to execute.\r
+  @retval  EFI_INVALID_PARAMETER       The contents of the SCSI Request Packet are invalid.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -486,6 +524,14 @@ ScsiReadCapacityCommand (
   If TargetStatus is NULL, then ASSERT().\r
   If DataLength is NULL, then ASSERT().\r
 \r
+  If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
+  alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
+  gets returned.\r
+\r
+  If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r
+  alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
+  gets returned.\r
+\r
   @param[in]      ScsiIo               A pointer to SCSI IO protocol.\r
   @param[in]      Timeout              The length of timeout period.\r
   @param[in, out] SenseData            A pointer to output sense data.\r
@@ -496,16 +542,17 @@ ScsiReadCapacityCommand (
   @param[in, out] DataLength           The length of data buffer.\r
   @param[in]      Pmi                  Partial medium indicator.\r
 \r
-  @retval  EFI_SUCCESS           Command is executed successfully.\r
-  @retval  EFI_BAD_BUFFER_SIZE   The SCSI Request Packet was executed, but the entire\r
-                                 DataBuffer could not be transferred. The actual\r
-                                 number of bytes transferred is returned in DataLength.\r
-  @retval  EFI_NOT_READY         The SCSI Request Packet could not be sent because\r
-                                 there are too many SCSI Command Packets already queued.\r
-  @retval  EFI_DEVICE_ERROR      A device error occurred while attempting to send SCSI Request Packet.\r
-  @retval  EFI_UNSUPPORTED       The command described by the SCSI Request Packet\r
-                                 is not supported by the SCSI initiator(i.e., SCSI  Host Controller)\r
-  @retval  EFI_TIMEOUT           A timeout occurred while waiting for the SCSI Request Packet to execute.\r
+  @retval  EFI_SUCCESS                 Command is executed successfully.\r
+  @retval  EFI_BAD_BUFFER_SIZE         The SCSI Request Packet was executed, but the entire\r
+                                       DataBuffer could not be transferred. The actual\r
+                                       number of bytes transferred is returned in DataLength.\r
+  @retval  EFI_NOT_READY               The SCSI Request Packet could not be sent because\r
+                                       there are too many SCSI Command Packets already queued.\r
+  @retval  EFI_DEVICE_ERROR            A device error occurred while attempting to send SCSI Request Packet.\r
+  @retval  EFI_UNSUPPORTED             The command described by the SCSI Request Packet\r
+                                       is not supported by the SCSI initiator(i.e., SCSI  Host Controller)\r
+  @retval  EFI_TIMEOUT                 A timeout occurred while waiting for the SCSI Request Packet to execute.\r
+  @retval  EFI_INVALID_PARAMETER       The contents of the SCSI Request Packet are invalid.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -537,6 +584,13 @@ ScsiReadCapacity16Command (
   If TargetStatus is NULL, then ASSERT().\r
   If DataLength is NULL, then ASSERT().\r
 \r
+  If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
+  alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
+  gets returned.\r
+\r
+  If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r
+  alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
+  gets returned.\r
 \r
   @param[in]      ScsiIo               A pointer to SCSI IO protocol.\r
   @param[in]      Timeout              The length of timeout period.\r
@@ -547,17 +601,18 @@ ScsiReadCapacity16Command (
   @param[in, out] DataBuffer           Read 10 command data.\r
   @param[in, out] DataLength           The length of data buffer.\r
   @param[in]      StartLba             The start address of LBA.\r
-  @param[in]      SectorSize           The sector size.\r
-\r
-  @retval  EFI_SUCCESS          Command is executed successfully.\r
-  @retval  EFI_BAD_BUFFER_SIZE  The SCSI Request Packet was executed, but the entire DataBuffer could\r
-                                not be transferred. The actual number of bytes transferred is returned in DataLength.\r
-  @retval  EFI_NOT_READY        The SCSI Request Packet could not be sent because there are too many \r
-                                SCSI Command Packets already queued.\r
-  @retval  EFI_DEVICE_ERROR     A device error occurred while attempting to send SCSI Request Packet.\r
-  @retval  EFI_UNSUPPORTED      The command described by the SCSI Request Packet is not supported by \r
-                                the SCSI initiator(i.e., SCSI  Host Controller)\r
-  @retval  EFI_TIMEOUT          A timeout occurred while waiting for the SCSI Request Packet to execute.\r
+  @param[in]      SectorSize           The number of contiguous logical blocks of data that shall be transferred.\r
+\r
+  @retval  EFI_SUCCESS                 Command is executed successfully.\r
+  @retval  EFI_BAD_BUFFER_SIZE         The SCSI Request Packet was executed, but the entire DataBuffer could\r
+                                       not be transferred. The actual number of bytes transferred is returned in DataLength.\r
+  @retval  EFI_NOT_READY               The SCSI Request Packet could not be sent because there are too many\r
+                                       SCSI Command Packets already queued.\r
+  @retval  EFI_DEVICE_ERROR            A device error occurred while attempting to send SCSI Request Packet.\r
+  @retval  EFI_UNSUPPORTED             The command described by the SCSI Request Packet is not supported by\r
+                                       the SCSI initiator(i.e., SCSI  Host Controller)\r
+  @retval  EFI_TIMEOUT                 A timeout occurred while waiting for the SCSI Request Packet to execute.\r
+  @retval  EFI_INVALID_PARAMETER       The contents of the SCSI Request Packet are invalid.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -590,6 +645,14 @@ ScsiRead10Command (
   If TargetStatus is NULL, then ASSERT().\r
   If DataLength is NULL, then ASSERT().\r
 \r
+  If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
+  alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
+  gets returned.\r
+\r
+  If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r
+  alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
+  gets returned.\r
+\r
   @param[in]      ScsiIo               SCSI IO Protocol to use\r
   @param[in]      Timeout              The length of timeout period.\r
   @param[in, out] SenseData            A pointer to output sense data.\r
@@ -599,17 +662,18 @@ ScsiRead10Command (
   @param[in, out] DataBuffer           A pointer to a data buffer.\r
   @param[in, out] DataLength           The length of data buffer.\r
   @param[in]      StartLba             The start address of LBA.\r
-  @param[in]      SectorSize           The sector size.\r
-\r
-  @retval  EFI_SUCCESS          Command is executed successfully.\r
-  @retval  EFI_BAD_BUFFER_SIZE  The SCSI Request Packet was executed, but the entire DataBuffer could\r
-                                not be transferred. The actual number of bytes transferred is returned in DataLength.\r
-  @retval  EFI_NOT_READY        The SCSI Request Packet could not be sent because there are too many \r
-                                SCSI Command Packets already queued.\r
-  @retval  EFI_DEVICE_ERROR     A device error occurred while attempting to send SCSI Request Packet.\r
-  @retval  EFI_UNSUPPORTED      The command described by the SCSI Request Packet is not supported by \r
-                                the SCSI initiator(i.e., SCSI  Host Controller)\r
-  @retval  EFI_TIMEOUT          A timeout occurred while waiting for the SCSI Request Packet to execute.\r
+  @param[in]      SectorSize           The number of contiguous logical blocks of data that shall be transferred.\r
+\r
+  @retval  EFI_SUCCESS                 Command is executed successfully.\r
+  @retval  EFI_BAD_BUFFER_SIZE         The SCSI Request Packet was executed, but the entire DataBuffer could\r
+                                       not be transferred. The actual number of bytes transferred is returned in DataLength.\r
+  @retval  EFI_NOT_READY               The SCSI Request Packet could not be sent because there are too many\r
+                                       SCSI Command Packets already queued.\r
+  @retval  EFI_DEVICE_ERROR            A device error occurred while attempting to send SCSI Request Packet.\r
+  @retval  EFI_UNSUPPORTED             The command described by the SCSI Request Packet is not supported by\r
+                                       the SCSI initiator(i.e., SCSI  Host Controller)\r
+  @retval  EFI_TIMEOUT                 A timeout occurred while waiting for the SCSI Request Packet to execute.\r
+  @retval  EFI_INVALID_PARAMETER       The contents of the SCSI Request Packet are invalid.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -641,6 +705,13 @@ ScsiWrite10Command (
   If TargetStatus is NULL, then ASSERT().\r
   If DataLength is NULL, then ASSERT().\r
 \r
+  If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
+  alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
+  gets returned.\r
+\r
+  If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r
+  alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
+  gets returned.\r
 \r
   @param[in]      ScsiIo               A pointer to SCSI IO protocol.\r
   @param[in]      Timeout              The length of timeout period.\r
@@ -651,17 +722,18 @@ ScsiWrite10Command (
   @param[in, out] DataBuffer           Read 16 command data.\r
   @param[in, out] DataLength           The length of data buffer.\r
   @param[in]      StartLba             The start address of LBA.\r
-  @param[in]      SectorSize           The sector size.\r
-\r
-  @retval  EFI_SUCCESS          Command is executed successfully.\r
-  @retval  EFI_BAD_BUFFER_SIZE  The SCSI Request Packet was executed, but the entire DataBuffer could\r
-                                not be transferred. The actual number of bytes transferred is returned in DataLength.\r
-  @retval  EFI_NOT_READY        The SCSI Request Packet could not be sent because there are too many \r
-                                SCSI Command Packets already queued.\r
-  @retval  EFI_DEVICE_ERROR     A device error occurred while attempting to send SCSI Request Packet.\r
-  @retval  EFI_UNSUPPORTED      The command described by the SCSI Request Packet is not supported by \r
-                                the SCSI initiator(i.e., SCSI  Host Controller)\r
-  @retval  EFI_TIMEOUT          A timeout occurred while waiting for the SCSI Request Packet to execute.\r
+  @param[in]      SectorSize           The number of contiguous logical blocks of data that shall be transferred.\r
+\r
+  @retval  EFI_SUCCESS                 Command is executed successfully.\r
+  @retval  EFI_BAD_BUFFER_SIZE         The SCSI Request Packet was executed, but the entire DataBuffer could\r
+                                       not be transferred. The actual number of bytes transferred is returned in DataLength.\r
+  @retval  EFI_NOT_READY               The SCSI Request Packet could not be sent because there are too many\r
+                                       SCSI Command Packets already queued.\r
+  @retval  EFI_DEVICE_ERROR            A device error occurred while attempting to send SCSI Request Packet.\r
+  @retval  EFI_UNSUPPORTED             The command described by the SCSI Request Packet is not supported by\r
+                                       the SCSI initiator(i.e., SCSI  Host Controller)\r
+  @retval  EFI_TIMEOUT                 A timeout occurred while waiting for the SCSI Request Packet to execute.\r
+  @retval  EFI_INVALID_PARAMETER       The contents of the SCSI Request Packet are invalid.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -694,6 +766,14 @@ ScsiRead16Command (
   If TargetStatus is NULL, then ASSERT().\r
   If DataLength is NULL, then ASSERT().\r
 \r
+  If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet buffer\r
+  alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
+  gets returned.\r
+\r
+  If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet buffer\r
+  alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise EFI_INVALID_PARAMETER\r
+  gets returned.\r
+\r
   @param[in]      ScsiIo               SCSI IO Protocol to use\r
   @param[in]      Timeout              The length of timeout period.\r
   @param[in, out] SenseData            A pointer to output sense data.\r
@@ -703,17 +783,18 @@ ScsiRead16Command (
   @param[in, out] DataBuffer           A pointer to a data buffer.\r
   @param[in, out] DataLength           The length of data buffer.\r
   @param[in]      StartLba             The start address of LBA.\r
-  @param[in]      SectorSize           The sector size.\r
-\r
-  @retval  EFI_SUCCESS          Command is executed successfully.\r
-  @retval  EFI_BAD_BUFFER_SIZE  The SCSI Request Packet was executed, but the entire DataBuffer could\r
-                                not be transferred. The actual number of bytes transferred is returned in DataLength.\r
-  @retval  EFI_NOT_READY        The SCSI Request Packet could not be sent because there are too many \r
-                                SCSI Command Packets already queued.\r
-  @retval  EFI_DEVICE_ERROR     A device error occurred while attempting to send SCSI Request Packet.\r
-  @retval  EFI_UNSUPPORTED      The command described by the SCSI Request Packet is not supported by \r
-                                the SCSI initiator(i.e., SCSI  Host Controller)\r
-  @retval  EFI_TIMEOUT          A timeout occurred while waiting for the SCSI Request Packet to execute.\r
+  @param[in]      SectorSize           The number of contiguous logical blocks of data that shall be transferred.\r
+\r
+  @retval  EFI_SUCCESS                 Command is executed successfully.\r
+  @retval  EFI_BAD_BUFFER_SIZE         The SCSI Request Packet was executed, but the entire DataBuffer could\r
+                                       not be transferred. The actual number of bytes transferred is returned in DataLength.\r
+  @retval  EFI_NOT_READY               The SCSI Request Packet could not be sent because there are too many\r
+                                       SCSI Command Packets already queued.\r
+  @retval  EFI_DEVICE_ERROR            A device error occurred while attempting to send SCSI Request Packet.\r
+  @retval  EFI_UNSUPPORTED             The command described by the SCSI Request Packet is not supported by\r
+                                       the SCSI initiator(i.e., SCSI  Host Controller)\r
+  @retval  EFI_TIMEOUT                 A timeout occurred while waiting for the SCSI Request Packet to execute.\r
+  @retval  EFI_INVALID_PARAMETER       The contents of the SCSI Request Packet are invalid.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -731,4 +812,364 @@ ScsiWrite16Command (
   IN     UINT32                SectorSize\r
   );\r
 \r
+\r
+/**\r
+  Execute blocking/non-blocking Read(10) SCSI command on a specific SCSI\r
+  target.\r
+\r
+  Executes the SCSI Read(10) command on the SCSI target specified by ScsiIo.\r
+  When Event is NULL, blocking command will be executed. Otherwise non-blocking\r
+  command will be executed.\r
+  For blocking I/O, if Timeout is zero, this function will wait indefinitely\r
+  for the command to complete. If Timeout is greater than zero, then the\r
+  command is executed and will timeout after Timeout 100 ns units.\r
+  For non-blocking I/O, if Timeout is zero, Event will be signaled only after\r
+  the command to completes. If Timeout is greater than zero, Event will also be\r
+  signaled after Timeout 100 ns units.\r
+  The StartLba and SectorSize parameters are used to construct the CDB for this\r
+  SCSI command.\r
+\r
+  If ScsiIo is NULL, then ASSERT().\r
+  If SenseDataLength is NULL, then ASSERT().\r
+  If HostAdapterStatus is NULL, then ASSERT().\r
+  If TargetStatus is NULL, then ASSERT().\r
+  If DataLength is NULL, then ASSERT().\r
+\r
+  If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet\r
+  buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
+  EFI_INVALID_PARAMETER gets returned.\r
+\r
+  If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet\r
+  buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
+  EFI_INVALID_PARAMETER gets returned.\r
+\r
+  @param[in]      ScsiIo               A pointer to SCSI IO protocol.\r
+  @param[in]      Timeout              The length of timeout period.\r
+  @param[in, out] SenseData            A pointer to output sense data.\r
+  @param[in, out] SenseDataLength      The length of output sense data.\r
+  @param[out]     HostAdapterStatus    The status of Host Adapter.\r
+  @param[out]     TargetStatus         The status of the target.\r
+  @param[in, out] DataBuffer           Read 16 command data.\r
+  @param[in, out] DataLength           The length of data buffer.\r
+  @param[in]      StartLba             The start address of LBA.\r
+  @param[in]      SectorSize           The number of contiguous logical blocks\r
+                                       of data that shall be transferred.\r
+  @param[in]      Event                If the SCSI target does not support\r
+                                       non-blocking I/O, then Event is ignored,\r
+                                       and blocking I/O is performed. If Event\r
+                                       is NULL, then blocking I/O is performed.\r
+                                       If Event is not NULL and non-blocking\r
+                                       I/O is supported, then non-blocking I/O\r
+                                       is performed, and Event will be signaled\r
+                                       when the SCSI Read(10) command\r
+                                       completes.\r
+\r
+  @retval  EFI_SUCCESS                 Command is executed successfully.\r
+  @retval  EFI_BAD_BUFFER_SIZE         The SCSI Request Packet was executed,\r
+                                       but the entire DataBuffer could not be\r
+                                       transferred. The actual number of bytes\r
+                                       transferred is returned in DataLength.\r
+  @retval  EFI_NOT_READY               The SCSI Request Packet could not be\r
+                                       sent because there are too many SCSI\r
+                                       Command Packets already queued.\r
+  @retval  EFI_DEVICE_ERROR            A device error occurred while attempting\r
+                                       to send SCSI Request Packet.\r
+  @retval  EFI_UNSUPPORTED             The command described by the SCSI\r
+                                       Request Packet is not supported by the\r
+                                       SCSI initiator(i.e., SCSI  Host\r
+                                       Controller)\r
+  @retval  EFI_TIMEOUT                 A timeout occurred while waiting for the\r
+                                       SCSI Request Packet to execute.\r
+  @retval  EFI_INVALID_PARAMETER       The contents of the SCSI Request Packet\r
+                                       are invalid.\r
+  @retval  EFI_OUT_OF_RESOURCES        The request could not be completed due\r
+                                       to a lack of resources.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ScsiRead10CommandEx (\r
+  IN     EFI_SCSI_IO_PROTOCOL  *ScsiIo,\r
+  IN     UINT64                Timeout,\r
+  IN OUT VOID                  *SenseData,   OPTIONAL\r
+  IN OUT UINT8                 *SenseDataLength,\r
+     OUT UINT8                 *HostAdapterStatus,\r
+     OUT UINT8                 *TargetStatus,\r
+  IN OUT VOID                  *DataBuffer,  OPTIONAL\r
+  IN OUT UINT32                *DataLength,\r
+  IN     UINT32                StartLba,\r
+  IN     UINT32                SectorSize,\r
+  IN     EFI_EVENT             Event         OPTIONAL\r
+  );\r
+\r
+\r
+/**\r
+  Execute blocking/non-blocking Write(10) SCSI command on a specific SCSI\r
+  target.\r
+\r
+  Executes the SCSI Write(10) command on the SCSI target specified by ScsiIo.\r
+  When Event is NULL, blocking command will be executed. Otherwise non-blocking\r
+  command will be executed.\r
+  For blocking I/O, if Timeout is zero, this function will wait indefinitely\r
+  for the command to complete. If Timeout is greater than zero, then the\r
+  command is executed and will timeout after Timeout 100 ns units.\r
+  For non-blocking I/O, if Timeout is zero, Event will be signaled only after\r
+  the command to completes. If Timeout is greater than zero, Event will also be\r
+  signaled after Timeout 100 ns units.\r
+  The StartLba and SectorSize parameters are used to construct the CDB for this\r
+  SCSI command.\r
+\r
+  If ScsiIo is NULL, then ASSERT().\r
+  If SenseDataLength is NULL, then ASSERT().\r
+  If HostAdapterStatus is NULL, then ASSERT().\r
+  If TargetStatus is NULL, then ASSERT().\r
+  If DataLength is NULL, then ASSERT().\r
+\r
+  If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet\r
+  buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
+  EFI_INVALID_PARAMETER gets returned.\r
+\r
+  If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet\r
+  buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
+  EFI_INVALID_PARAMETER gets returned.\r
+\r
+  @param[in]      ScsiIo               SCSI IO Protocol to use\r
+  @param[in]      Timeout              The length of timeout period.\r
+  @param[in, out] SenseData            A pointer to output sense data.\r
+  @param[in, out] SenseDataLength      The length of output sense data.\r
+  @param[out]     HostAdapterStatus    The status of Host Adapter.\r
+  @param[out]     TargetStatus         The status of the target.\r
+  @param[in, out] DataBuffer           A pointer to a data buffer.\r
+  @param[in, out] DataLength           The length of data buffer.\r
+  @param[in]      StartLba             The start address of LBA.\r
+  @param[in]      SectorSize           The number of contiguous logical blocks\r
+                                       of data that shall be transferred.\r
+  @param[in]      Event                If the SCSI target does not support\r
+                                       non-blocking I/O, then Event is ignored,\r
+                                       and blocking I/O is performed. If Event\r
+                                       is NULL, then blocking I/O is performed.\r
+                                       If Event is not NULL and non-blocking\r
+                                       I/O is supported, then non-blocking I/O\r
+                                       is performed, and Event will be signaled\r
+                                       when the SCSI Write(10) command\r
+                                       completes.\r
+\r
+  @retval  EFI_SUCCESS                 Command is executed successfully.\r
+  @retval  EFI_BAD_BUFFER_SIZE         The SCSI Request Packet was executed,\r
+                                       but the entire DataBuffer could not be\r
+                                       transferred. The actual number of bytes\r
+                                       transferred is returned in DataLength.\r
+  @retval  EFI_NOT_READY               The SCSI Request Packet could not be\r
+                                       sent because there are too many SCSI\r
+                                       Command Packets already queued.\r
+  @retval  EFI_DEVICE_ERROR            A device error occurred while attempting\r
+                                       to send SCSI Request Packet.\r
+  @retval  EFI_UNSUPPORTED             The command described by the SCSI\r
+                                       Request Packet is not supported by the\r
+                                       SCSI initiator(i.e., SCSI  Host\r
+                                       Controller)\r
+  @retval  EFI_TIMEOUT                 A timeout occurred while waiting for the\r
+                                       SCSI Request Packet to execute.\r
+  @retval  EFI_INVALID_PARAMETER       The contents of the SCSI Request Packet\r
+                                       are invalid.\r
+  @retval  EFI_OUT_OF_RESOURCES        The request could not be completed due\r
+                                       to a lack of resources.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ScsiWrite10CommandEx (\r
+  IN     EFI_SCSI_IO_PROTOCOL  *ScsiIo,\r
+  IN     UINT64                Timeout,\r
+  IN OUT VOID                  *SenseData,   OPTIONAL\r
+  IN OUT UINT8                 *SenseDataLength,\r
+     OUT UINT8                 *HostAdapterStatus,\r
+     OUT UINT8                 *TargetStatus,\r
+  IN OUT VOID                  *DataBuffer,  OPTIONAL\r
+  IN OUT UINT32                *DataLength,\r
+  IN     UINT32                StartLba,\r
+  IN     UINT32                SectorSize,\r
+  IN     EFI_EVENT             Event         OPTIONAL\r
+  );\r
+\r
+\r
+/**\r
+  Execute blocking/non-blocking Read(16) SCSI command on a specific SCSI\r
+  target.\r
+\r
+  Executes the SCSI Read(16) command on the SCSI target specified by ScsiIo.\r
+  When Event is NULL, blocking command will be executed. Otherwise non-blocking\r
+  command will be executed.\r
+  For blocking I/O, if Timeout is zero, this function will wait indefinitely\r
+  for the command to complete. If Timeout is greater than zero, then the\r
+  command is executed and will timeout after Timeout 100 ns units.\r
+  For non-blocking I/O, if Timeout is zero, Event will be signaled only after\r
+  the command to completes. If Timeout is greater than zero, Event will also be\r
+  signaled after Timeout 100 ns units.\r
+  The StartLba and SectorSize parameters are used to construct the CDB for this\r
+  SCSI command.\r
+\r
+  If ScsiIo is NULL, then ASSERT().\r
+  If SenseDataLength is NULL, then ASSERT().\r
+  If HostAdapterStatus is NULL, then ASSERT().\r
+  If TargetStatus is NULL, then ASSERT().\r
+  If DataLength is NULL, then ASSERT().\r
+\r
+  If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet\r
+  buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
+  EFI_INVALID_PARAMETER gets returned.\r
+\r
+  If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet\r
+  buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
+  EFI_INVALID_PARAMETER gets returned.\r
+\r
+  @param[in]      ScsiIo               A pointer to SCSI IO protocol.\r
+  @param[in]      Timeout              The length of timeout period.\r
+  @param[in, out] SenseData            A pointer to output sense data.\r
+  @param[in, out] SenseDataLength      The length of output sense data.\r
+  @param[out]     HostAdapterStatus    The status of Host Adapter.\r
+  @param[out]     TargetStatus         The status of the target.\r
+  @param[in, out] DataBuffer           Read 16 command data.\r
+  @param[in, out] DataLength           The length of data buffer.\r
+  @param[in]      StartLba             The start address of LBA.\r
+  @param[in]      SectorSize           The number of contiguous logical blocks\r
+                                       of data that shall be transferred.\r
+  @param[in]      Event                If the SCSI target does not support\r
+                                       non-blocking I/O, then Event is ignored,\r
+                                       and blocking I/O is performed. If Event\r
+                                       is NULL, then blocking I/O is performed.\r
+                                       If Event is not NULL and non-blocking\r
+                                       I/O is supported, then non-blocking I/O\r
+                                       is performed, and Event will be signaled\r
+                                       when the SCSI Read(16) command\r
+                                       completes.\r
+\r
+  @retval  EFI_SUCCESS                 Command is executed successfully.\r
+  @retval  EFI_BAD_BUFFER_SIZE         The SCSI Request Packet was executed,\r
+                                       but the entire DataBuffer could not be\r
+                                       transferred. The actual number of bytes\r
+                                       transferred is returned in DataLength.\r
+  @retval  EFI_NOT_READY               The SCSI Request Packet could not be\r
+                                       sent because there are too many SCSI\r
+                                       Command Packets already queued.\r
+  @retval  EFI_DEVICE_ERROR            A device error occurred while attempting\r
+                                       to send SCSI Request Packet.\r
+  @retval  EFI_UNSUPPORTED             The command described by the SCSI\r
+                                       Request Packet is not supported by the\r
+                                       SCSI initiator(i.e., SCSI  Host\r
+                                       Controller)\r
+  @retval  EFI_TIMEOUT                 A timeout occurred while waiting for the\r
+                                       SCSI Request Packet to execute.\r
+  @retval  EFI_INVALID_PARAMETER       The contents of the SCSI Request Packet\r
+                                       are invalid.\r
+  @retval  EFI_OUT_OF_RESOURCES        The request could not be completed due\r
+                                       to a lack of resources.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ScsiRead16CommandEx (\r
+  IN     EFI_SCSI_IO_PROTOCOL  *ScsiIo,\r
+  IN     UINT64                Timeout,\r
+  IN OUT VOID                  *SenseData,   OPTIONAL\r
+  IN OUT UINT8                 *SenseDataLength,\r
+     OUT UINT8                 *HostAdapterStatus,\r
+     OUT UINT8                 *TargetStatus,\r
+  IN OUT VOID                  *DataBuffer,  OPTIONAL\r
+  IN OUT UINT32                *DataLength,\r
+  IN     UINT64                StartLba,\r
+  IN     UINT32                SectorSize,\r
+  IN     EFI_EVENT             Event         OPTIONAL\r
+  );\r
+\r
+\r
+/**\r
+  Execute blocking/non-blocking Write(16) SCSI command on a specific SCSI\r
+  target.\r
+\r
+  Executes the SCSI Write(16) command on the SCSI target specified by ScsiIo.\r
+  When Event is NULL, blocking command will be executed. Otherwise non-blocking\r
+  command will be executed.\r
+  For blocking I/O, if Timeout is zero, this function will wait indefinitely\r
+  for the command to complete. If Timeout is greater than zero, then the\r
+  command is executed and will timeout after Timeout 100 ns units.\r
+  For non-blocking I/O, if Timeout is zero, Event will be signaled only after\r
+  the command to completes. If Timeout is greater than zero, Event will also be\r
+  signaled after Timeout 100 ns units.\r
+  The StartLba and SectorSize parameters are used to construct the CDB for this\r
+  SCSI command.\r
+\r
+  If ScsiIo is NULL, then ASSERT().\r
+  If SenseDataLength is NULL, then ASSERT().\r
+  If HostAdapterStatus is NULL, then ASSERT().\r
+  If TargetStatus is NULL, then ASSERT().\r
+  If DataLength is NULL, then ASSERT().\r
+\r
+  If SenseDataLength is non-zero and SenseData is not NULL, SenseData must meet\r
+  buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
+  EFI_INVALID_PARAMETER gets returned.\r
+\r
+  If DataLength is non-zero and DataBuffer is not NULL, DataBuffer must meet\r
+  buffer alignment requirement defined in EFI_SCSI_IO_PROTOCOL. Otherwise\r
+  EFI_INVALID_PARAMETER gets returned.\r
+\r
+  @param[in]      ScsiIo               SCSI IO Protocol to use\r
+  @param[in]      Timeout              The length of timeout period.\r
+  @param[in, out] SenseData            A pointer to output sense data.\r
+  @param[in, out] SenseDataLength      The length of output sense data.\r
+  @param[out]     HostAdapterStatus    The status of Host Adapter.\r
+  @param[out]     TargetStatus         The status of the target.\r
+  @param[in, out] DataBuffer           A pointer to a data buffer.\r
+  @param[in, out] DataLength           The length of data buffer.\r
+  @param[in]      StartLba             The start address of LBA.\r
+  @param[in]      SectorSize           The number of contiguous logical blocks\r
+                                       of data that shall be transferred.\r
+  @param[in]      Event                If the SCSI target does not support\r
+                                       non-blocking I/O, then Event is ignored,\r
+                                       and blocking I/O is performed. If Event\r
+                                       is NULL, then blocking I/O is performed.\r
+                                       If Event is not NULL and non-blocking\r
+                                       I/O is supported, then non-blocking I/O\r
+                                       is performed, and Event will be signaled\r
+                                       when the SCSI Write(16) command\r
+                                       completes.\r
+\r
+  @retval  EFI_SUCCESS                 Command is executed successfully.\r
+  @retval  EFI_BAD_BUFFER_SIZE         The SCSI Request Packet was executed,\r
+                                       but the entire DataBuffer could not be\r
+                                       transferred. The actual number of bytes\r
+                                       transferred is returned in DataLength.\r
+  @retval  EFI_NOT_READY               The SCSI Request Packet could not be\r
+                                       sent because there are too many SCSI\r
+                                       Command Packets already queued.\r
+  @retval  EFI_DEVICE_ERROR            A device error occurred while attempting\r
+                                       to send SCSI Request Packet.\r
+  @retval  EFI_UNSUPPORTED             The command described by the SCSI\r
+                                       Request Packet is not supported by the\r
+                                       SCSI initiator(i.e., SCSI  Host\r
+                                       Controller)\r
+  @retval  EFI_TIMEOUT                 A timeout occurred while waiting for the\r
+                                       SCSI Request Packet to execute.\r
+  @retval  EFI_INVALID_PARAMETER       The contents of the SCSI Request Packet\r
+                                       are invalid.\r
+  @retval  EFI_OUT_OF_RESOURCES        The request could not be completed due\r
+                                       to a lack of resources.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ScsiWrite16CommandEx (\r
+  IN     EFI_SCSI_IO_PROTOCOL  *ScsiIo,\r
+  IN     UINT64                Timeout,\r
+  IN OUT VOID                  *SenseData,   OPTIONAL\r
+  IN OUT UINT8                 *SenseDataLength,\r
+     OUT UINT8                 *HostAdapterStatus,\r
+     OUT UINT8                 *TargetStatus,\r
+  IN OUT VOID                  *DataBuffer,  OPTIONAL\r
+  IN OUT UINT32                *DataLength,\r
+  IN     UINT64                StartLba,\r
+  IN     UINT32                SectorSize,\r
+  IN     EFI_EVENT             Event         OPTIONAL\r
+  );\r
+\r
 #endif\r