X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FInclude%2FLibrary%2FUefiScsiLib.h;h=072a35d63a6ccee815f6e88d5cc4e465b9491ed5;hb=5e11e7c691b9b3a91362f4fea88963861bb74c51;hp=b990cfded58f5e0356c45fcb180bb74405ba4fd2;hpb=adde977ad413073801212f78950cdaab046b9ead;p=mirror_edk2.git diff --git a/MdePkg/Include/Library/UefiScsiLib.h b/MdePkg/Include/Library/UefiScsiLib.h index b990cfded5..072a35d63a 100644 --- a/MdePkg/Include/Library/UefiScsiLib.h +++ b/MdePkg/Include/Library/UefiScsiLib.h @@ -1,7 +1,10 @@ /** @file - Provides the functions to submit Scsi commands defined in SCSI-2 specification for scsi device. + This library class provides the functions to submit SCSI commands defined in SCSI-2 specification + for hard drive, CD and DVD devices that are the most common SCSI boot targets used by UEFI platforms. + This library class depends on SCSI I/O Protocol defined in UEFI Specification and SCSI-2 industry standard. + Copyright (c) 2006 - 2008, Intel Corporation
All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -45,7 +48,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. If SenseDataLength is 0, then this parameter is optional and may be NULL. @param[in, out] SenseDataLength On input, a pointer to the length in bytes of - the SenseData buffer. On output, a poiinter to + the SenseData buffer. On output, a pointer to the number of bytes written to the SenseData buffer. @param[out] HostAdapterStatus The status of the SCSI Host Controller that produces the SCSI bus containing the SCSI target specified by @@ -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 for details on the possible return values. @param[out] TargetStatus The status returned by the SCSI target specified - by ScsiIo when the SCSI Request Packat was executed + by ScsiIo when the SCSI Request Packet was executed on the SCSI Host Controller. See the EFI SCSI I/O Protocol in the UEFI Specification for details on the possible return values. @@ -79,10 +82,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Packet to execute. See HostAdapterStatus, TargetStatus, SenseDataLength, and SenseData in that order for additional status information. - @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, - but the entire DataBuffer could not be transferred. - The actual number of bytes transferred is returned - in InTransferLength. **/ EFI_STATUS @@ -132,7 +131,7 @@ ScsiTestUnitReadyCommand ( SCSI I/O Protocol in the UEFI Specification for details on the possible return values. @param[out] TargetStatus The status returned by the SCSI target specified - by ScsiIo when the SCSI Request Packat was + by ScsiIo when the SCSI Request Packet was executed on the SCSI Host Controller. See the EFI SCSI I/O Protocol in the UEFI Specification for details on the possible @@ -228,7 +227,7 @@ ScsiInquiryCommand ( UEFI Specification for details on the possible return values. @param[out] TargetStatus The status returned by the SCSI target specified - by ScsiIo when the SCSI Request Packat was executed + by ScsiIo when the SCSI Request Packet was executed on the SCSI Host Controller. See the EFI SCSI I/O Protocol in the UEFI Specification for details on the possible return values. @@ -334,7 +333,7 @@ ScsiRequestSenseCommand ( Executes the SCSI Read Capacity command on the SCSI target specified by ScsiIo. If Timeout is zero, then this function waits indefinitely for the command to complete. If Timeout is greater than zero, then the command is executed and will timeout after - Timeout 100 ns units. The PMI parameter is used to construct the CDB for this SCSI command. + Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command. If ScsiIo is NULL, then ASSERT(). If SenseDataLength is NULL, then ASSERT(). If HostAdapterStatus is NULL, then ASSERT(). @@ -349,7 +348,7 @@ ScsiRequestSenseCommand ( @param[out] TargetStatus The status of the target. @param[in, out] DataBuffer A pointer to a data buffer. @param[in, out] DataLength The length of data buffer. - @param[in] PMI Partial medium indicator. + @param[in] Pmi Partial medium indicator. @retval EFI_SUCCESS Command is executed successfully. @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire @@ -374,7 +373,57 @@ ScsiReadCapacityCommand ( OUT UINT8 *TargetStatus, IN OUT VOID *DataBuffer, OPTIONAL IN OUT UINT32 *DataLength, - IN BOOLEAN PMI + IN BOOLEAN Pmi + ); + + +/** + Execute Read Capacity SCSI 16 command on a specific SCSI target. + + Executes the SCSI Read Capacity 16 command on the SCSI target specified by ScsiIo. + If Timeout is zero, then this function waits indefinitely for the command to complete. + If Timeout is greater than zero, then the command is executed and will timeout after + Timeout 100 ns units. The Pmi parameter is used to construct the CDB for this SCSI command. + If ScsiIo is NULL, then ASSERT(). + If SenseDataLength is NULL, then ASSERT(). + If HostAdapterStatus is NULL, then ASSERT(). + If TargetStatus is NULL, then ASSERT(). + If DataLength is NULL, then ASSERT(). + + @param[in] ScsiIo A pointer to SCSI IO protocol. + @param[in] Timeout The length of timeout period. + @param[in, out] SenseData A pointer to output sense data. + @param[in, out] SenseDataLength The length of output sense data. + @param[out] HostAdapterStatus The status of Host Adapter. + @param[out] TargetStatus The status of the target. + @param[in, out] DataBuffer A pointer to a data buffer. + @param[in, out] DataLength The length of data buffer. + @param[in] Pmi Partial medium indicator. + + @retval EFI_SUCCESS Command is executed successfully. + @retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed, but the entire + DataBuffer could not be transferred. The actual + number of bytes transferred is returned in DataLength. + @retval EFI_NOT_READY The SCSI Request Packet could not be sent because + there are too many SCSI Command Packets already queued. + @retval EFI_DEVICE_ERROR A device error occurred while attempting to send SCSI Request Packet. + @retval EFI_UNSUPPORTED The command described by the SCSI Request Packet + is not supported by the SCSI initiator(i.e., SCSI Host Controller) + @retval EFI_TIMEOUT A timeout occurred while waiting for the SCSI Request Packet to execute. + +**/ +EFI_STATUS +EFIAPI +ScsiReadCapacity16Command ( + IN EFI_SCSI_IO_PROTOCOL *ScsiIo, + IN UINT64 Timeout, + IN VOID *SenseData, + IN OUT UINT8 *SenseDataLength, + OUT UINT8 *HostAdapterStatus, + OUT UINT8 *TargetStatus, + OUT VOID *DataBuffer, + IN OUT UINT32 *DataLength, + IN BOOLEAN Pmi );