]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/UefiScsiLib.h
Update the copyright notice format
[mirror_edk2.git] / MdePkg / Include / Library / UefiScsiLib.h
index f27844cd9526ee33a31faf5fb957ded6003c1ad4..bc5414d15b1c3f83859d7e22a881e25390b784a0 100644 (file)
@@ -1,9 +1,12 @@
 /** @file\r
+  Provides the functions to submit Scsi commands defined in SCSI-2 specification for SCSI devices.\r
 \r
-  Provides the functions to submit Scsi commands defined in SCSI-2 specification for scsi device.\r
+  This library class provides the functions to submit SCSI commands defined in SCSI-2 specification\r
+  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 - 2008, Intel Corporation<BR>\r
-All rights reserved. This program and the accompanying materials                          \r
+Copyright (c) 2006 - 2008, 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
@@ -45,7 +48,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                     If SenseDataLength is 0, then this parameter is\r
                                     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 poiinter to\r
+                                    the SenseData buffer. On output, a pointer to\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
@@ -53,7 +56,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                     See the EFI SCSI I/O Protocol in the UEFI Specification\r
                                     for details on the possible return values.\r
   @param[out]     TargetStatus      The status returned by the SCSI target specified\r
-                                    by ScsiIo when the SCSI Request Packat was executed\r
+                                    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
@@ -79,10 +82,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
                                Packet to execute.  See HostAdapterStatus, TargetStatus,\r
                                SenseDataLength, and SenseData in that order for\r
                                additional status information.\r
-  @retval EFI_BAD_BUFFER_SIZE  The SCSI Request Packet was executed, \r
-                               but the entire DataBuffer could not be transferred.\r
-                               The actual number of bytes transferred is returned\r
-                               in InTransferLength.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -132,7 +131,7 @@ ScsiTestUnitReadyCommand (
                                          SCSI I/O Protocol in the UEFI Specification\r
                                          for details on the possible return values.\r
   @param[out]     TargetStatus           The status returned by the SCSI target specified\r
-                                         by ScsiIo when the SCSI Request Packat was\r
+                                         by ScsiIo when the SCSI Request Packet was\r
                                          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
@@ -214,12 +213,12 @@ ScsiInquiryCommand (
                                      If Timeout is greater than zero, then this function\r
                                      will return EFI_TIMEOUT if the time required to\r
                                      execute the SCSI Request Packet is greater than Timeout.\r
-  @param[in,out]  SenseData          A pointer to sense data that was generated\r
+  @param[in, out]  SenseData         A pointer to sense data that was generated\r
                                      by the execution of the SCSI Request Packet.\r
                                      This buffer must be allocated by the caller.\r
                                      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
+  @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
   @param[out]     HostAdapterStatus  The status of the SCSI Host Controller that\r
                                      produces the SCSI bus containing the SCSI target\r
@@ -228,16 +227,16 @@ ScsiInquiryCommand (
                                      UEFI Specification for details on the possible\r
                                      return values.\r
   @param[out]     TargetStatus       The status returned by the SCSI target specified\r
-                                     by ScsiIo when the SCSI Request Packat was executed\r
+                                     by ScsiIo when the SCSI Request Packet was executed\r
                                      on the SCSI Host Controller.  See the EFI SCSI\r
                                      I/O Protocol in the UEFI Specification for details\r
                                      on the possible return values.\r
-  @param[in,out]  DataBuffer         A pointer to data that was generated by the\r
+  @param[in, out]  DataBuffer        A pointer to data that was generated by the\r
                                      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
-  @param[in,out]  DataLength         On input, a pointer to the length in bytes of\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
@@ -334,7 +333,7 @@ ScsiRequestSenseCommand (
   Executes the SCSI Read Capacity command on the SCSI target specified by ScsiIo.\r
   If Timeout is zero, then this function waits indefinitely for the command to complete.\r
   If Timeout is greater than zero, then the command is executed and will timeout after\r
-  Timeout 100 ns units.  The PMI parameter is used to construct the CDB for this SCSI command.\r
+  Timeout 100 ns units.  The Pmi parameter is used to construct the CDB for this SCSI command.\r
   If ScsiIo is NULL, then ASSERT().\r
   If SenseDataLength is NULL, then ASSERT().\r
   If HostAdapterStatus is NULL, then ASSERT().\r
@@ -349,17 +348,18 @@ ScsiRequestSenseCommand (
   @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]      PMI                  Partial medium indicator.\r
-\r
-  @retval  EFI_SUCCESS                Command is executed successfully.\r
-  @retval  EFI_WARN_BUFFER_TOO_SMALL  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]      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
 \r
 **/\r
 EFI_STATUS\r
@@ -373,7 +373,57 @@ ScsiReadCapacityCommand (
      OUT UINT8                 *TargetStatus,\r
   IN OUT VOID                  *DataBuffer,   OPTIONAL\r
   IN OUT UINT32                *DataLength,\r
-  IN     BOOLEAN               PMI\r
+  IN     BOOLEAN               Pmi\r
+  );\r
+\r
+\r
+/**\r
+  Execute Read Capacity SCSI 16 command on a specific SCSI target.\r
+\r
+  Executes the SCSI Read Capacity 16 command on the SCSI target specified by ScsiIo.\r
+  If Timeout is zero, then this function waits indefinitely for the command to complete.\r
+  If Timeout is greater than zero, then the command is executed and will timeout after\r
+  Timeout 100 ns units.  The Pmi parameter is used to construct the CDB for this SCSI command.\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
+  @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           A pointer to a data buffer.\r
+  @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
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ScsiReadCapacity16Command (\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     BOOLEAN               Pmi\r
   );\r
 \r
 \r
@@ -403,15 +453,15 @@ ScsiReadCapacityCommand (
   @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_WARN_BUFFER_TOO_SMALL  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_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
 \r
 **/\r
 EFI_STATUS\r
@@ -455,15 +505,15 @@ ScsiRead10Command (
   @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_WARN_BUFFER_TOO_SMALL  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_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
 \r
 **/\r
 EFI_STATUS\r