1139743Simp/*- 297881Sgibbs * This file is in the public domain. 397881Sgibbs * $FreeBSD: releng/11.0/sys/cam/scsi/scsi_iu.h 139743 2005-01-05 22:34:37Z imp $ 497881Sgibbs */ 597881Sgibbs#ifndef _SCSI_SCSI_IU_H 697881Sgibbs#define _SCSI_SCSI_IU_H 1 797881Sgibbs 897881Sgibbsstruct scsi_status_iu_header 997881Sgibbs{ 1097881Sgibbs u_int8_t reserved[2]; 1197881Sgibbs u_int8_t flags; 1297881Sgibbs#define SIU_SNSVALID 0x2 1397881Sgibbs#define SIU_RSPVALID 0x1 1497881Sgibbs u_int8_t status; 1597881Sgibbs u_int8_t sense_length[4]; 1697881Sgibbs u_int8_t pkt_failures_length[4]; 1797881Sgibbs u_int8_t pkt_failures[1]; 1897881Sgibbs}; 1997881Sgibbs 2097881Sgibbs#define SIU_PKTFAIL_OFFSET(siu) 12 2197881Sgibbs#define SIU_PKTFAIL_CODE(siu) (scsi_4btoul((siu)->pkt_failures) & 0xFF) 2297881Sgibbs#define SIU_PFC_NONE 0 2397881Sgibbs#define SIU_PFC_CIU_FIELDS_INVALID 2 2497881Sgibbs#define SIU_PFC_TMF_NOT_SUPPORTED 4 2597881Sgibbs#define SIU_PFC_TMF_FAILED 5 2697881Sgibbs#define SIU_PFC_INVALID_TYPE_CODE 6 2797881Sgibbs#define SIU_PFC_ILLEGAL_REQUEST 7 2897881Sgibbs#define SIU_SENSE_OFFSET(siu) \ 2997881Sgibbs (12 + (((siu)->flags & SIU_RSPVALID) \ 3097881Sgibbs ? scsi_4btoul((siu)->pkt_failures_length) \ 3197881Sgibbs : 0)) 32109577Sgibbs 33109577Sgibbs#define SIU_TASKMGMT_NONE 0x00 34109577Sgibbs#define SIU_TASKMGMT_ABORT_TASK 0x01 35109577Sgibbs#define SIU_TASKMGMT_ABORT_TASK_SET 0x02 36109577Sgibbs#define SIU_TASKMGMT_CLEAR_TASK_SET 0x04 37109577Sgibbs#define SIU_TASKMGMT_LUN_RESET 0x08 38109577Sgibbs#define SIU_TASKMGMT_TARGET_RESET 0x20 39109577Sgibbs#define SIU_TASKMGMT_CLEAR_ACA 0x40 4097881Sgibbs#endif /*_SCSI_SCSI_IU_H*/ 41