Remove spl*() calls from the bus/ infrastructure, replacing them with
[dragonfly.git] / sys / bus / cam / scsi / scsi_iu.h
1 /*
2  * This file is in the public domain.
3  * $FreeBSD: src/sys/cam/scsi/scsi_iu.h,v 1.1.2.2 2003/01/20 23:59:19 gibbs Exp $
4  * $DragonFly: src/sys/bus/cam/scsi/scsi_iu.h,v 1.2 2003/06/17 04:28:19 dillon Exp $
5  */
6 #ifndef _SCSI_SCSI_IU_H
7 #define _SCSI_SCSI_IU_H 1
8
9 struct scsi_status_iu_header
10 {
11         u_int8_t reserved[2];
12         u_int8_t flags;
13 #define SIU_SNSVALID 0x2
14 #define SIU_RSPVALID 0x1
15         u_int8_t status;
16         u_int8_t sense_length[4];
17         u_int8_t pkt_failures_length[4];
18         u_int8_t pkt_failures[1];
19 };
20
21 #define SIU_PKTFAIL_OFFSET(siu) 12
22 #define SIU_PKTFAIL_CODE(siu) (scsi_4btoul((siu)->pkt_failures) & 0xFF)
23 #define         SIU_PFC_NONE                    0
24 #define         SIU_PFC_CIU_FIELDS_INVALID      2
25 #define         SIU_PFC_TMF_NOT_SUPPORTED       4
26 #define         SIU_PFC_TMF_FAILED              5
27 #define         SIU_PFC_INVALID_TYPE_CODE       6
28 #define         SIU_PFC_ILLEGAL_REQUEST         7
29 #define SIU_SENSE_OFFSET(siu)                           \
30     (12 + (((siu)->flags & SIU_RSPVALID)                \
31         ? scsi_4btoul((siu)->pkt_failures_length)       \
32         : 0))
33
34 #define SIU_TASKMGMT_NONE               0x00
35 #define SIU_TASKMGMT_ABORT_TASK         0x01
36 #define SIU_TASKMGMT_ABORT_TASK_SET     0x02
37 #define SIU_TASKMGMT_CLEAR_TASK_SET     0x04
38 #define SIU_TASKMGMT_LUN_RESET          0x08
39 #define SIU_TASKMGMT_TARGET_RESET       0x20
40 #define SIU_TASKMGMT_CLEAR_ACA          0x40
41 #endif /*_SCSI_SCSI_IU_H*/