1*1da177e4SLinus Torvalds /* 2*1da177e4SLinus Torvalds * This file is in the public domain. 3*1da177e4SLinus Torvalds */ 4*1da177e4SLinus Torvalds #ifndef _SCSI_SCSI_IU_H 5*1da177e4SLinus Torvalds #define _SCSI_SCSI_IU_H 1 6*1da177e4SLinus Torvalds 7*1da177e4SLinus Torvalds struct scsi_status_iu_header 8*1da177e4SLinus Torvalds { 9*1da177e4SLinus Torvalds u_int8_t reserved[2]; 10*1da177e4SLinus Torvalds u_int8_t flags; 11*1da177e4SLinus Torvalds #define SIU_SNSVALID 0x2 12*1da177e4SLinus Torvalds #define SIU_RSPVALID 0x1 13*1da177e4SLinus Torvalds u_int8_t status; 14*1da177e4SLinus Torvalds u_int8_t sense_length[4]; 15*1da177e4SLinus Torvalds u_int8_t pkt_failures_length[4]; 16*1da177e4SLinus Torvalds u_int8_t pkt_failures[1]; 17*1da177e4SLinus Torvalds }; 18*1da177e4SLinus Torvalds 19*1da177e4SLinus Torvalds #define SIU_PKTFAIL_OFFSET(siu) 12 20*1da177e4SLinus Torvalds #define SIU_PKTFAIL_CODE(siu) (scsi_4btoul((siu)->pkt_failures) & 0xFF) 21*1da177e4SLinus Torvalds #define SIU_PFC_NONE 0 22*1da177e4SLinus Torvalds #define SIU_PFC_CIU_FIELDS_INVALID 2 23*1da177e4SLinus Torvalds #define SIU_PFC_TMF_NOT_SUPPORTED 4 24*1da177e4SLinus Torvalds #define SIU_PFC_TMF_FAILED 5 25*1da177e4SLinus Torvalds #define SIU_PFC_INVALID_TYPE_CODE 6 26*1da177e4SLinus Torvalds #define SIU_PFC_ILLEGAL_REQUEST 7 27*1da177e4SLinus Torvalds #define SIU_SENSE_OFFSET(siu) \ 28*1da177e4SLinus Torvalds (12 + (((siu)->flags & SIU_RSPVALID) \ 29*1da177e4SLinus Torvalds ? scsi_4btoul((siu)->pkt_failures_length) \ 30*1da177e4SLinus Torvalds : 0)) 31*1da177e4SLinus Torvalds 32*1da177e4SLinus Torvalds #define SIU_TASKMGMT_NONE 0x00 33*1da177e4SLinus Torvalds #define SIU_TASKMGMT_ABORT_TASK 0x01 34*1da177e4SLinus Torvalds #define SIU_TASKMGMT_ABORT_TASK_SET 0x02 35*1da177e4SLinus Torvalds #define SIU_TASKMGMT_CLEAR_TASK_SET 0x04 36*1da177e4SLinus Torvalds #define SIU_TASKMGMT_LUN_RESET 0x08 37*1da177e4SLinus Torvalds #define SIU_TASKMGMT_TARGET_RESET 0x20 38*1da177e4SLinus Torvalds #define SIU_TASKMGMT_CLEAR_ACA 0x40 39*1da177e4SLinus Torvalds #endif /*_SCSI_SCSI_IU_H*/ 40