Home | History | Annotate | Line # | Download | only in scsipi
scsi_iu.h revision 1.2.10.1
      1  1.2.10.1  kent /*	$NetBSD: scsi_iu.h,v 1.2.10.1 2005/04/29 11:29:16 kent Exp $	*/
      2       1.2  fvdl 
      3       1.1  fvdl /*
      4       1.1  fvdl  * This file is in the public domain.
      5       1.1  fvdl  * $FreeBSD: src/sys/cam/scsi/scsi_iu.h,v 1.2 2003/01/20 18:05:46 gibbs Exp $
      6       1.1  fvdl  */
      7       1.1  fvdl #ifndef	_SCSI_SCSI_IU_H
      8       1.1  fvdl #define _SCSI_SCSI_IU_H 1
      9       1.1  fvdl 
     10       1.1  fvdl struct scsi_status_iu_header
     11       1.1  fvdl {
     12       1.1  fvdl 	u_int8_t reserved[2];
     13       1.1  fvdl 	u_int8_t flags;
     14       1.1  fvdl #define	SIU_SNSVALID 0x2
     15       1.1  fvdl #define	SIU_RSPVALID 0x1
     16       1.1  fvdl 	u_int8_t status;
     17       1.1  fvdl 	u_int8_t sense_length[4];
     18       1.1  fvdl 	u_int8_t pkt_failures_length[4];
     19       1.1  fvdl 	u_int8_t pkt_failures[1];
     20       1.1  fvdl };
     21       1.1  fvdl 
     22       1.1  fvdl #define SIU_PKTFAIL_OFFSET(siu) 12
     23       1.1  fvdl #define SIU_PKTFAIL_CODE(siu) (scsi_4btoul((siu)->pkt_failures) & 0xFF)
     24       1.1  fvdl #define		SIU_PFC_NONE			0
     25       1.1  fvdl #define		SIU_PFC_CIU_FIELDS_INVALID	2
     26       1.1  fvdl #define		SIU_PFC_TMF_NOT_SUPPORTED	4
     27       1.1  fvdl #define		SIU_PFC_TMF_FAILED		5
     28       1.1  fvdl #define		SIU_PFC_INVALID_TYPE_CODE	6
     29       1.1  fvdl #define		SIU_PFC_ILLEGAL_REQUEST		7
     30       1.1  fvdl #define SIU_SENSE_OFFSET(siu)				\
     31       1.1  fvdl     (12 + (((siu)->flags & SIU_RSPVALID)		\
     32       1.1  fvdl 	? scsi_4btoul((siu)->pkt_failures_length)	\
     33       1.1  fvdl 	: 0))
     34       1.1  fvdl 
     35       1.1  fvdl #define	SIU_TASKMGMT_NONE		0x00
     36       1.1  fvdl #define	SIU_TASKMGMT_ABORT_TASK		0x01
     37       1.1  fvdl #define	SIU_TASKMGMT_ABORT_TASK_SET	0x02
     38       1.1  fvdl #define	SIU_TASKMGMT_CLEAR_TASK_SET	0x04
     39       1.1  fvdl #define	SIU_TASKMGMT_LUN_RESET		0x08
     40       1.1  fvdl #define	SIU_TASKMGMT_TARGET_RESET	0x20
     41       1.1  fvdl #define	SIU_TASKMGMT_CLEAR_ACA		0x40
     42       1.1  fvdl #endif /*_SCSI_SCSI_IU_H*/
     43