1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
5 #include <linux/types.h>
7 /* general boundary definitions */
8 #define SENSEINFOBYTES 32 /* note that this value may vary
9 between host implementations */
11 /* Command Status value */
12 #define CMD_SUCCESS 0x0000
13 #define CMD_TARGET_STATUS 0x0001
14 #define CMD_DATA_UNDERRUN 0x0002
15 #define CMD_DATA_OVERRUN 0x0003
16 #define CMD_INVALID 0x0004
17 #define CMD_PROTOCOL_ERR 0x0005
18 #define CMD_HARDWARE_ERR 0x0006
19 #define CMD_CONNECTION_LOST 0x0007
20 #define CMD_ABORTED 0x0008
21 #define CMD_ABORT_FAILED 0x0009
22 #define CMD_UNSOLICITED_ABORT 0x000A
23 #define CMD_TIMEOUT 0x000B
24 #define CMD_UNABORTABLE 0x000C
26 /* transfer direction */
27 #define XFER_NONE 0x00
28 #define XFER_WRITE 0x01
29 #define XFER_READ 0x02
30 #define XFER_RSVD 0x03
33 #define ATTR_UNTAGGED 0x00
34 #define ATTR_SIMPLE 0x04
35 #define ATTR_HEADOFQUEUE 0x05
36 #define ATTR_ORDERED 0x06
43 /* Type defs used in the following structs */
49 #define CISS_MAX_LUN 1024
51 #define LEVEL2LUN 1 /* index into Target(x) structure, due to byte swapping */
56 /* Command List Structure */
57 typedef union _SCSI3Addr_struct {
61 BYTE Mode:2; /* b00 */
66 BYTE Mode:2; /* b01 */
72 BYTE Mode:2; /* b10 */
76 typedef struct _PhysDevAddr_struct {
80 SCSI3Addr_struct Target[2]; /* 2 level target device addr */
83 typedef struct _LogDevAddr_struct {
89 typedef union _LUNAddr_struct {
91 SCSI3Addr_struct SCSI3Lun[4];
92 PhysDevAddr_struct PhysDev;
93 LogDevAddr_struct LogDev;
96 typedef struct _RequestBlock_struct {
105 } RequestBlock_struct;
107 typedef union _MoreErrInfo_struct{
115 BYTE offense_size; /* size of offending entry */
116 BYTE offense_num; /* byte # of offense 0-base */
119 } MoreErrInfo_struct;
120 typedef struct _ErrorInfo_struct {
125 MoreErrInfo_struct MoreErrInfo;
126 BYTE SenseInfo[SENSEINFOBYTES];
131 #endif /* CCISS_DEFS_H */