2007-06-28 00:53:31 +02:00
|
|
|
/** @file
|
|
|
|
Common Libarary for SCSI
|
2007-06-19 12:55:24 +02:00
|
|
|
|
2007-06-28 00:53:31 +02:00
|
|
|
Copyright (c) 2006 - 2007, Intel Corporation
|
|
|
|
All rights reserved. This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
2007-06-19 12:55:24 +02:00
|
|
|
|
2007-06-28 00:53:31 +02:00
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
2007-06-19 12:55:24 +02:00
|
|
|
|
2007-06-28 00:53:31 +02:00
|
|
|
**/
|
2007-06-19 12:55:24 +02:00
|
|
|
|
2008-07-25 14:21:57 +02:00
|
|
|
#ifndef _SCSI_LIB_H_
|
|
|
|
#define _SCSI_LIB_H_
|
2007-06-19 12:55:24 +02:00
|
|
|
|
2007-06-22 18:22:26 +02:00
|
|
|
#include <Protocol/ScsiIo.h>
|
|
|
|
|
2007-06-19 12:55:24 +02:00
|
|
|
//
|
|
|
|
// the time unit is 100ns, since the SCSI I/O defines timeout in 100ns unit.
|
|
|
|
//
|
|
|
|
#define EFI_SCSI_STALL_1_MICROSECOND 10
|
|
|
|
#define EFI_SCSI_STALL_1_MILLISECOND 10000
|
|
|
|
#define EFI_SCSI_STALL_1_SECOND 10000000
|
|
|
|
|
2008-08-14 05:30:12 +02:00
|
|
|
///
|
|
|
|
/// this macro cannot be directly used by the gBS->Stall(),
|
|
|
|
/// since the value output by this macro is in 100ns unit,
|
|
|
|
/// not 1us unit (1us = 1000ns)
|
|
|
|
///
|
2008-07-25 14:21:57 +02:00
|
|
|
#define EfiScsiStallSeconds(a) ((a) * EFI_SCSI_STALL_1_SECOND)
|
2007-06-19 12:55:24 +02:00
|
|
|
|
2007-07-13 05:21:40 +02:00
|
|
|
|
2008-08-14 05:30:12 +02:00
|
|
|
/**
|
2007-07-13 05:21:40 +02:00
|
|
|
Function test the ready status of the SCSI unit.
|
2008-08-14 05:30:12 +02:00
|
|
|
|
2008-10-07 11:23:48 +02:00
|
|
|
Submit SCSI test unit ready command with SCSI request packet specified by this scsi command, TimeOut
|
|
|
|
and SenseData, then get the status of the target Scsi unit.
|
|
|
|
|
|
|
|
If SenseDataLength is NULL, then ASSERT().
|
|
|
|
|
|
|
|
If HostAdapterStatus is NULL, then ASSERT().
|
|
|
|
|
|
|
|
If TargetStatus is NULL, then ASSERT().
|
|
|
|
|
2008-08-14 05:30:12 +02:00
|
|
|
@param[in] ScsiIo A pointer to SCSI IO protocol.
|
|
|
|
@param[in] Timeout The length of timeout period.
|
2008-10-07 11:29:24 +02:00
|
|
|
@param[in] SenseData A pointer to output sense data.
|
2008-08-14 05:30:12 +02:00
|
|
|
@param[out] SenseDataLength The length of output sense data.
|
|
|
|
@param[out] HostAdapterStatus The status of Host Adapter.
|
|
|
|
@param[out] TargetStatus The status of the target.
|
|
|
|
|
2007-07-13 05:21:40 +02:00
|
|
|
@retval EFI_SUCCESS The status of the unit is tested 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 InTransferLength.
|
|
|
|
@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
|
|
|
|
the SCSI Request Packet.
|
2008-10-07 11:23:48 +02:00
|
|
|
@retval EFI_INVALID_PARAMETER ScsiIo is NULL.
|
2007-07-13 05:21:40 +02:00
|
|
|
@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.
|
2008-08-14 05:30:12 +02:00
|
|
|
|
2007-07-13 05:21:40 +02:00
|
|
|
**/
|
2007-06-19 12:55:24 +02:00
|
|
|
EFI_STATUS
|
2008-07-16 08:31:22 +02:00
|
|
|
EFIAPI
|
2007-08-14 09:58:32 +02:00
|
|
|
ScsiTestUnitReadyCommand (
|
2007-06-19 12:55:24 +02:00
|
|
|
IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
|
|
|
|
IN UINT64 Timeout,
|
2008-10-07 11:29:24 +02:00
|
|
|
IN VOID *SenseData,
|
2007-06-19 12:55:24 +02:00
|
|
|
OUT UINT8 *SenseDataLength,
|
|
|
|
OUT UINT8 *HostAdapterStatus,
|
|
|
|
OUT UINT8 *TargetStatus
|
2007-07-13 05:21:40 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
|
2008-08-14 05:30:12 +02:00
|
|
|
/**
|
2007-07-13 05:21:40 +02:00
|
|
|
Function to submit SCSI inquiry command.
|
2008-08-14 05:30:12 +02:00
|
|
|
|
2008-10-07 11:23:48 +02:00
|
|
|
Submit SCSI inquiry command with the SCSI request packet specified by this SCSI command and input
|
|
|
|
parameters, then return the status of Scsi unit execution.
|
|
|
|
|
|
|
|
If SenseDataLength is NULL, then ASSERT().
|
|
|
|
|
|
|
|
If HostAdapterStatus is NULL, then ASSERT().
|
|
|
|
|
|
|
|
If TargetStatus is NULL, then ASSERT().
|
|
|
|
|
|
|
|
If InquiryDataLength is NULL, then ASSERT().
|
|
|
|
|
2008-08-14 05:30:12 +02:00
|
|
|
@param[in] ScsiIo SCSI IO Protocol to use
|
|
|
|
@param[in] Timeout The length of timeout period.
|
|
|
|
@param[in] 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] InquirydataBuffer A pointer to inquiry data buffer.
|
|
|
|
@param[in out] InquiryDataLength The length of inquiry data buffer.
|
|
|
|
@param[in] EnableVitalProductData Boolean to enable Vital Product Data.
|
|
|
|
|
2008-10-07 11:23:48 +02:00
|
|
|
@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 TransferLength.
|
|
|
|
@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
|
|
|
|
the SCSI Request Packet.
|
|
|
|
@retval EFI_INVALID_PARAMETER ScsiIo is NULL.
|
|
|
|
@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.
|
2008-08-14 05:30:12 +02:00
|
|
|
|
2007-07-13 05:21:40 +02:00
|
|
|
**/
|
2007-06-19 12:55:24 +02:00
|
|
|
EFI_STATUS
|
2008-07-16 08:31:22 +02:00
|
|
|
EFIAPI
|
2007-08-14 09:58:32 +02:00
|
|
|
ScsiInquiryCommand (
|
2007-06-19 12:55:24 +02:00
|
|
|
IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
|
|
|
|
IN UINT64 Timeout,
|
|
|
|
IN VOID *SenseData,
|
|
|
|
IN OUT UINT8 *SenseDataLength,
|
|
|
|
OUT UINT8 *HostAdapterStatus,
|
|
|
|
OUT UINT8 *TargetStatus,
|
|
|
|
IN OUT VOID *InquiryDataBuffer,
|
|
|
|
IN OUT UINT32 *InquiryDataLength,
|
|
|
|
IN BOOLEAN EnableVitalProductData
|
2007-07-13 05:21:40 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
|
2008-08-14 05:30:12 +02:00
|
|
|
/**
|
2007-07-13 05:21:40 +02:00
|
|
|
Function to submit SCSI mode sense 10 command.
|
2008-08-14 05:30:12 +02:00
|
|
|
|
2008-10-07 11:23:48 +02:00
|
|
|
Submit SCSI Mode Sense (10) command with the SCSI request packet specified by this SCSI command and
|
|
|
|
the input parameters, then return the status of Scsi unit execution.
|
|
|
|
|
|
|
|
If SenseDataLength is NULL, then ASSERT().
|
|
|
|
|
|
|
|
If HostAdapterStatus is NULL, then ASSERT().
|
|
|
|
|
|
|
|
If TargetStatus is NULL, then ASSERT().
|
|
|
|
|
|
|
|
If DataLength is NULL, then ASSERT().
|
|
|
|
|
2008-08-14 05:30:12 +02:00
|
|
|
@param[in] ScsiIo A pointer to SCSI IO protocol.
|
|
|
|
@param[in] Timeout The length of timeout period.
|
2008-10-07 11:23:48 +02:00
|
|
|
@param[in] SenseData A pointer to output sense data.
|
2008-08-14 05:30:12 +02:00
|
|
|
@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] DataBuffer A pointer to input data buffer.
|
|
|
|
@param[in out] DataLength The length of input data buffer.
|
|
|
|
@param[in] DBDField The DBD Field (Optional).
|
|
|
|
@param[in] PageControl Page Control.
|
|
|
|
@param[in] PageCode Page code.
|
|
|
|
|
2007-07-13 05:21:40 +02:00
|
|
|
@retval EFI_SUCCESS The status of the unit is tested successfully.
|
2007-09-20 11:59:05 +02:00
|
|
|
@retval EFI_BAD_BUFFER_SIZE The SCSI Request Packet was executed,
|
2007-07-13 05:21:40 +02:00
|
|
|
but the entire DataBuffer could not be transferred.
|
|
|
|
The actual number of bytes transferred is returned
|
|
|
|
in TransferLength.
|
|
|
|
@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
|
|
|
|
the SCSI Request Packet.
|
2008-10-07 11:23:48 +02:00
|
|
|
@retval EFI_INVALID_PARAMETER ScsiIo is NULL.
|
2007-07-13 05:21:40 +02:00
|
|
|
@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.
|
2008-08-14 05:30:12 +02:00
|
|
|
|
2007-07-13 05:21:40 +02:00
|
|
|
**/
|
2007-06-19 12:55:24 +02:00
|
|
|
EFI_STATUS
|
2008-07-16 08:31:22 +02:00
|
|
|
EFIAPI
|
2007-08-14 09:58:32 +02:00
|
|
|
ScsiModeSense10Command (
|
2007-06-19 12:55:24 +02:00
|
|
|
IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
|
|
|
|
IN UINT64 Timeout,
|
|
|
|
IN VOID *SenseData,
|
|
|
|
IN OUT UINT8 *SenseDataLength,
|
|
|
|
OUT UINT8 *HostAdapterStatus,
|
|
|
|
OUT UINT8 *TargetStatus,
|
|
|
|
IN VOID *DataBuffer,
|
|
|
|
IN OUT UINT32 *DataLength,
|
|
|
|
IN UINT8 DBDField, OPTIONAL
|
|
|
|
IN UINT8 PageControl,
|
|
|
|
IN UINT8 PageCode
|
2007-07-13 05:21:40 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-08-14 05:30:12 +02:00
|
|
|
/**
|
2007-07-13 05:21:40 +02:00
|
|
|
Function to submit SCSI request sense command.
|
2008-08-14 05:30:12 +02:00
|
|
|
|
2008-10-07 11:23:48 +02:00
|
|
|
Submit SCSI request sense command with the SCSI requested packet specified by this
|
|
|
|
SCSI command, TimeOut and SenseData, and then return the status of scsi unit execution.
|
|
|
|
|
|
|
|
If SenseDataLength is NULL, then ASSERT().
|
|
|
|
|
|
|
|
If HostAdapterStatus is NULL, then ASSERT().
|
|
|
|
|
|
|
|
If TargetStatus is NULL, then ASSERT().
|
|
|
|
|
|
|
|
@param[in] ScsiIo A pointer to SCSI IO protocol.
|
|
|
|
@param[in] Timeout The length of timeout period.
|
|
|
|
@param[in] 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.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS Command is executed successfully.
|
|
|
|
@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.
|
|
|
|
@retval EFI_INVALID_PARAMETER ScsiIo is NULL.
|
2008-08-14 05:30:12 +02:00
|
|
|
|
2007-07-13 05:21:40 +02:00
|
|
|
**/
|
2007-06-19 12:55:24 +02:00
|
|
|
EFI_STATUS
|
2008-07-16 08:31:22 +02:00
|
|
|
EFIAPI
|
2007-08-14 09:58:32 +02:00
|
|
|
ScsiRequestSenseCommand (
|
2007-06-19 12:55:24 +02:00
|
|
|
IN EFI_SCSI_IO_PROTOCOL *ScsiIo,
|
|
|
|
IN UINT64 Timeout,
|
|
|
|
IN VOID *SenseData,
|
|
|
|
IN OUT UINT8 *SenseDataLength,
|
|
|
|
OUT UINT8 *HostAdapterStatus,
|
|
|
|
OUT UINT8 *TargetStatus
|
2007-07-13 05:21:40 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
|
2008-08-14 05:30:12 +02:00
|
|
|
/**
|
2007-07-13 05:21:40 +02:00
|
|
|
Function to submit read capacity command.
|
|
|
|
|
2008-10-07 11:23:48 +02:00
|
|
|
Submit SCSI read capacity command with the SCSI request packet specified by this SCSI
|
|
|
|
command and the input parameters, and then return the status of Scsi unit execution.
|
|
|
|
|
|
|
|
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] 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[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_WARN_BUFFER_TOO_SMALL 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.
|
|
|
|
@retval EFI_INVALID_PARAMETER ScsiIo is NULL.
|
2008-08-14 05:30:12 +02:00
|
|
|
|
2007-07-13 05:21:40 +02:00
|
|
|
**/
|
2007-06-19 12:55:24 +02:00
|
|
|
EFI_STATUS
|
2008-07-21 09:26:20 +02:00
|
|
|
EFIAPI
|
2007-08-14 09:58:32 +02:00
|
|
|
ScsiReadCapacityCommand (
|
2007-06-19 12:55:24 +02:00
|
|
|
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
|
2007-07-13 05:21:40 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
|
2008-08-14 05:30:12 +02:00
|
|
|
/**
|
2007-07-13 05:21:40 +02:00
|
|
|
Function to submit read 10 command.
|
2008-08-14 05:30:12 +02:00
|
|
|
|
2008-10-07 11:23:48 +02:00
|
|
|
Submit SCSI read (10) command with the SCSI request packet specified by this SCSI command
|
|
|
|
and the input parameters, and then return the status of Scsi unit execution.
|
2008-08-14 05:30:12 +02:00
|
|
|
|
2008-10-07 11:23:48 +02:00
|
|
|
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] 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[out] DataBuffer Read 10 command data.
|
|
|
|
@param[in out] DataLength The length of data buffer.
|
|
|
|
@param[in] StartLba The start address of LBA.
|
|
|
|
@param[in] SectorSize The sector size.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS Command is executed successfully.
|
|
|
|
@retval EFI_WARN_BUFFER_TOO_SMALL 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.
|
|
|
|
@retval EFI_INVALID_PARAMETER ScsiIo is NULL.
|
2008-08-14 05:30:12 +02:00
|
|
|
|
2007-07-13 05:21:40 +02:00
|
|
|
**/
|
2007-06-19 12:55:24 +02:00
|
|
|
EFI_STATUS
|
2008-07-16 08:31:22 +02:00
|
|
|
EFIAPI
|
2007-08-14 09:58:32 +02:00
|
|
|
ScsiRead10Command (
|
2007-06-19 12:55:24 +02:00
|
|
|
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 UINT32 StartLba,
|
|
|
|
IN UINT32 SectorSize
|
2007-07-13 05:21:40 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
|
2008-08-14 05:30:12 +02:00
|
|
|
/**
|
2007-07-13 05:21:40 +02:00
|
|
|
Function to submit SCSI write 10 command.
|
2008-08-14 05:30:12 +02:00
|
|
|
|
2008-10-07 11:23:48 +02:00
|
|
|
Submit SCSI write (10) command with the SCSI request packet specified by this SCSI command and the
|
|
|
|
input parameters, and then return the status of Scsi unit execution.
|
|
|
|
|
|
|
|
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 SCSI IO Protocol to use
|
|
|
|
@param[in] Timeout The length of timeout period.
|
|
|
|
@param[in] 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[out] DataBuffer A pointer to a data buffer.
|
|
|
|
@param[in out] DataLength The length of data buffer.
|
|
|
|
@param[in] StartLba The start address of LBA.
|
|
|
|
@param[in] SectorSize The sector size.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS Command is executed successfully.
|
|
|
|
@retval EFI_WARN_BUFFER_TOO_SMALL 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.
|
|
|
|
@retval EFI_INVALID_PARAMETER ScsiIo is NULL.
|
2008-08-14 05:30:12 +02:00
|
|
|
|
2007-07-13 05:21:40 +02:00
|
|
|
**/
|
2007-06-19 12:55:24 +02:00
|
|
|
EFI_STATUS
|
2008-07-16 08:31:22 +02:00
|
|
|
EFIAPI
|
2007-08-14 09:58:32 +02:00
|
|
|
ScsiWrite10Command (
|
2007-06-19 12:55:24 +02:00
|
|
|
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 UINT32 StartLba,
|
|
|
|
IN UINT32 SectorSize
|
2007-07-13 05:21:40 +02:00
|
|
|
);
|
2007-06-19 12:55:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|