typedef struct _SCSI_REQUEST_BLOCK {
USHORT Length;
UCHAR Function;
UCHAR SrbStatus;
UCHAR ScsiStatus;
UCHAR PathId;
UCHAR TargetId;
UCHAR Lun;
UCHAR QueueTag;
UCHAR QueueAction;
UCHAR CdbLength;
UCHAR SenseInfoBufferLength;
ULONG SrbFlags;
ULONG DataTransferLength;
ULONG TimeOutValue;
PVOID DataBuffer;
PVOID SenseInfoBuffer;
struct _SCSI_REQUEST_BLOCK *NextSrb;
PVOID OriginalRequest;
PVOID SrbExtension;
ULONG QueueSortKey;
UCHAR Cdb[16];
} SCSI_REQUEST_BLOCK, *PSCSI_REQUEST_BLOCK;
Operation | Meaning |
---|---|
SRB_FUNCTION_EXECUTE_SCSI | A SCSI device I/O request should be executed on the target logical unit. |
SRB_FUNCTION_ABORT_COMMAND | A SCSIMESS_ABORT message should be sent to cancel the request pointed to by the NextSrb field. If this is tagged queue request, then a SCSIMESS_ABORT_WITH_TAG message should be used. If the indicated request has been completed, this request should be completed normally. Only the Function, PathId, TargetId, Lun, and NextSrb fields are valid. |
SRB_FUNCTION_RESET_DEVICE | The SCSI target controller should be reset using the SCSIMESS_BUS_DEVICE_RESET message. The HBA miniport driver should complete any active requests for the target controller. Only the Function, TargetId and PathId fields are valid. |
SRB_FUNCTION_TERMINATE_IO | A SCSIMESS_TERMINATE_IO_PROCESS message should be sent to cancel the request pointed to by the NextSrb field. If the indicated request has already completed, this request should be completed normally. Only the Function, PathId, TargetId, Lun, and NextSrb fields are valid. |
SRB_FUNCTION_RELEASE_RECOVERY | A SCSIMESS_RELEASE_RECOVERY message should be sent to the target controller. Only the Function, PathId, TargetId and Lun fields are valid. |
SRB_FUNCTION_RECEIVE_EVENT | The HBA should be prepared to receive an Asynchronous Event Notification from the addressed target. The DataBuffer indicates where the data should be placed. |
SRB_FUNCTION_SHUTDOWN | The system is being shut down. The request is passed to the miniport driver if CachesData was set to TRUE in the PORT_CONFIGURATION_INFORMATION data. The miniport driver can receive several of these notifications before all system activity is actually stopped; however, the last shutdown notification will occur after the last start I/O. Only the Function, PathId, TargetId and Lun fields are valid. |
SRB_FUNCTION_FLUSH | The miniport should flush any cached data for the device. The request is passed to the miniport driver if CachesData is TRUE in the PORT_CONFIGURATION_INFORMATION data. Only the Function, PathId, TargetId and Lun fields are valid. |
SRB_FUNCTION_IO_CONTROL | The request is an I/O control request. The SRB DataBuffer points to an SRB_IO_CONTROL header followed by the data area. The value in DataBuffer can be used by the driver, regardless of the value of MapBuffers field. If the HBA miniport driver supports this request, it should execute the request and notify the OS-specific port driver when it has completed it, using the normal mechanism of ScsiPortNotification with RequestComplete and NextRequest. Only the Function, SrbFlags, TimeOutValue, DataBuffer, DataTransferLength and SrbExtension are valid. |
Status | Meaning |
---|---|
SRB_STATUS_PENDING | Indicates the request in progress. The OS-specific port driver will initialize the SrbStatus to this value. This value should not be set by the HBA miniport driver. |
SRB_STATUS_SUCCESS | Indicates the request was completed successfully. |
SRB_STATUS_ABORTED | Indicates the request was aborted. |
SRB_STATUS_ABORT_FAILED | Indicates an attempt to abort the request failed. This status is returned for a SRB_FUNCTION_ABORT_COMMAND request when the specified request cannot be located. |
SRB_STATUS_ERROR | Indicates the request was completed with an error in the SCSI bus status. |
SRB_STATUS_BUSY | Indicates the device could not accept the request at this time. |
SRB_STATUS_INVALID_REQUEST | Indicates the miniport driver does not support the request. |
SRB_STATUS_INVALID_PATH_ID | Indicates the PathId specified in the SRB doesn't exist. |
SRB_STATUS_NO_DEVICE | Indicates the device did not respond. |
SRB_STATUS_TIMEOUT | Indicates the request timed out. |
SRB_STATUS_SELECTION_TIMEOUT | Indicates the SCSI device selection timed out. |
SRB_STATUS_COMMAND_TIMEOUT | Indicates the target did not complete the command within the time limit. |
SRB_STATUS_MESSAGE_REJECTED | Indicates the target rejected a message. This is normally returned for message type requests such as SRB_FUNCTION_TERMINATE_IO. |
SRB_STATUS_BUS_RESET | Indicates a bus reset occurred while this request was being executed. |
SRB_STATUS_PARITY_ERROR | Indicates a parity error occurred on the SCSI bus and that a retry failed. |
SRB_STATUS_REQUEST_SENSE_FAILED | Indicates the request sense command failed. This is returned only if the controller performs auto request sense. |
SRB_STATUS_NO_HBA | Indicates the HBA does not respond. |
SRB_STATUS_DATA_OVERRUN | Indicates that a data overrun or underrun error occurred. The SRB's DataTransferLength field should be updated. |
SRB_STATUS_UNEXPECTED_BUS_FREE | Indicates the target disconnected unexpectedly. |
SRB_STATUS_PHASE_SEQUENCE_ FAILURE | Indicates the adapter detected an illegal phase sequence failure error. |
SRB_STATUS_BAD_SRB_BLOCK_LENGTH | Indicates the SRB has an invalid length. |
SRB_STATUS_REQUEST_FLUSHED | Indicates the request for status was stopped. |
SRB_STATUS_INVALID_LUN | Indicates the LUN in the SRB is invalid. |
SRB_STATUS_INVALID_TARGET_ID | Indicates the TargetID in the SRB is invalid. |
SRB_STATUS_BAD_FUNCTION | Indicates the SRB function code is not supported. |
SRB_STATUS_ERROR_RECOVERY | Indicates the request was completed with an error in the SCSI bus status and that the INITIATE RECOVERY message was received. |
SRB_STATUS_AUTOSENSE_VALID | Indicates information returned in the SenseInfoBuffer is valid. |
Value | Meaning |
---|---|
SRB_FLAGS_QUEUE_ACTION_ENABLE | Indicates tagged-queue actions are to be enabled. |
SRB_FLAGS_DISABLE_AUTOSENSE | Indicates that request sense information should not be returned. |
SRB_FLAGS_DATA_IN | Indicates data will be transferred from the device to the system. |
SRB_FLAGS_DATA_OUT | Indicates data will be transferred from the system to the device. |
SRB_FLAGS_NO_DATA_TRANSFER | Indicates no data transfer with this request. If this is set, the flags SRB_FLAGS_DATA_OUT and SRB_FLAGS_DATA_IN are both clear. |
SRB_FLAGS_DISABLE_SYNCH_ TRANSFER | Indicates the HBA should not attempt to negotiate synchronous transfer with this request. |
SRB_FLAGS_BYPASS_FROZEN_ QUEUE | Not used by the miniport driver. |
SRB_FLAGS_NO_QUEUE_FREEZE | Not used by the miniport driver. |
SRB_FLAGS_IS_ACTIVE | Not used by the miniport driver. |
SRB_FLAGS_ALLOCATED_FROM_ ZONE | Indicates whether the SRB was allocated from a zone buffer. If TRUE, a class driver must call ExInterlockedFreeToZone to release the SRB; otherwise, it must call ExFreePool. |
SRB_FLAGS_DISABLE_DISCONNECT | Indicates the HBA should not allow the target to disconnect from the SCSI bus during processing of this request. |
SRB_FLAGS_ENABLE_ADAPTER_ CACHE | Indicates that the HBA can cache the data for this transfer request; otherwise, the data should be read or written to the device before the request has been completed. The adapter is responsible for ensuring that inconsistencies do not occur. For example, if a write occurs with caching enabled and, then, a read occurs without caching enabled, the adapter must return the last data written. |
HW_INITIALIZATION_DATA, ScsiPortGetPhysicalAddress, ScsiPortGetSrb, ScsiPortNotification, SRB_IO_CONTROL