SCSI_PASS_THROUGH结构的说明

来源:互联网 发布:memcached java 编辑:程序博客网 时间:2024/05/23 21:25


typedef struct _SCSI_PASS_THROUGH {

   USHORT Length;

    UCHAR ScsiStatus;

    UCHAR PathId;

    UCHAR TargetId;

    UCHAR Lun;

    UCHAR CdbLength;

    UCHAR SenseInfoLength;

    UCHAR DataIn;

    ULONG DataTransferLength;

    ULONG TimeOutValue;

    ULONG DataBufferOffset;

    ULONG SenseInfoOffset;

    UCHAR Cdb[16];

}SCSI_PASS_THROUGH, *PSCSI_PASS_THROUGH;

The Length is the size of the SCSI_PASS_THROUGH structure. 

The ScsiStatus should be initialized to 0.  The SCSI status of the requested SCSI operation is returned in this structure member.  The possible SCSI statuses are defined in SCSI.H and are of the form SCSISTAT_xxx.

The PathId is the bus number for the SCSI host adapter that controls the SCSI device in question.  Typically, this value will be 0, but there are SCSI host adapters that have more than one SCSI bus on the adapter. 

The TargetId and Lun are the SCSI ID number and logical unit number for the device.  If the handle was obtained for a claimed device, then the PathId, TargetId and Lun as defined in this structure will be ignored and the appropriate class driver will provide this SCSI address information.  If the handle was obtained for the SCSI port driver, then the PathId, TargetId and Lun must be correct for the device intended. 

The CdbLength is the length of the CDB. Typical values are 6, 10, and 12 up to the maximum of 16.  The SenseInfoLength is the length of the SenseInfo buffer.  DataIn has three possible values which are defined in NTDDSCSI.H;  SCSI_IOCTL_DATA_OUT, SCSI_IOCTL_DATA_IN and SCSI_IOCTL_DATA_UNSPECIFIED. SCSI_IOCTL_DATA_UNSPECIFIED should be used only if the appropriate SCSI miniport driver supports its usage.  The DataTransferLength is the byte size of the data buffer.  The TimeOutValue is the length of time, in seconds, until a time-out error should occur.  This can range from 0 to a maximum of 30 minutes (108000 seconds). 

The DataBufferOffset is the offset of the data buffer from the beginning of the pass through structure.  For the SCSI_PASS_THROUGH_DIRECT structure, this value is not an offset, but rather is a pointer to a data buffer.  The SenseInfoOffset is similarly an offset to the SenseInfo buffer from the beginning of the pass through structure. Finally, the sixteen remaining bytes are for the CDB data.  The format of this data must conform to the SCSI-2 standard as defined by ANSI.
0 0
原创粉丝点击