Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * This file is in the public domain.
0003  */
0004 #ifndef _SCSI_SCSI_IU_H
0005 #define _SCSI_SCSI_IU_H 1
0006 
0007 struct scsi_status_iu_header
0008 {
0009     u_int8_t reserved[2];
0010     u_int8_t flags;
0011 #define SIU_SNSVALID 0x2
0012 #define SIU_RSPVALID 0x1
0013     u_int8_t status;
0014     u_int8_t sense_length[4];
0015     u_int8_t pkt_failures_length[4];
0016     u_int8_t pkt_failures[1];
0017 };
0018 
0019 #define SIU_PKTFAIL_OFFSET(siu) 12
0020 #define SIU_PKTFAIL_CODE(siu) (scsi_4btoul((siu)->pkt_failures) & 0xFF)
0021 #define     SIU_PFC_NONE            0
0022 #define     SIU_PFC_CIU_FIELDS_INVALID  2
0023 #define     SIU_PFC_TMF_NOT_SUPPORTED   4
0024 #define     SIU_PFC_TMF_FAILED      5
0025 #define     SIU_PFC_INVALID_TYPE_CODE   6
0026 #define     SIU_PFC_ILLEGAL_REQUEST     7
0027 #define SIU_SENSE_OFFSET(siu)               \
0028     (12 + (((siu)->flags & SIU_RSPVALID)        \
0029     ? scsi_4btoul((siu)->pkt_failures_length)   \
0030     : 0))
0031 
0032 #define SIU_TASKMGMT_NONE       0x00
0033 #define SIU_TASKMGMT_ABORT_TASK     0x01
0034 #define SIU_TASKMGMT_ABORT_TASK_SET 0x02
0035 #define SIU_TASKMGMT_CLEAR_TASK_SET 0x04
0036 #define SIU_TASKMGMT_LUN_RESET      0x08
0037 #define SIU_TASKMGMT_TARGET_RESET   0x20
0038 #define SIU_TASKMGMT_CLEAR_ACA      0x40
0039 #endif /*_SCSI_SCSI_IU_H*/