Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cciss_defs.h
Go to the documentation of this file.
1 #ifndef CCISS_DEFS_H
2 #define CCISS_DEFS_H
3 
4 #include <linux/types.h>
5 
6 /* general boundary definitions */
7 #define SENSEINFOBYTES 32 /* note that this value may vary
8  between host implementations */
9 
10 /* Command Status value */
11 #define CMD_SUCCESS 0x0000
12 #define CMD_TARGET_STATUS 0x0001
13 #define CMD_DATA_UNDERRUN 0x0002
14 #define CMD_DATA_OVERRUN 0x0003
15 #define CMD_INVALID 0x0004
16 #define CMD_PROTOCOL_ERR 0x0005
17 #define CMD_HARDWARE_ERR 0x0006
18 #define CMD_CONNECTION_LOST 0x0007
19 #define CMD_ABORTED 0x0008
20 #define CMD_ABORT_FAILED 0x0009
21 #define CMD_UNSOLICITED_ABORT 0x000A
22 #define CMD_TIMEOUT 0x000B
23 #define CMD_UNABORTABLE 0x000C
24 
25 /* transfer direction */
26 #define XFER_NONE 0x00
27 #define XFER_WRITE 0x01
28 #define XFER_READ 0x02
29 #define XFER_RSVD 0x03
30 
31 /* task attribute */
32 #define ATTR_UNTAGGED 0x00
33 #define ATTR_SIMPLE 0x04
34 #define ATTR_HEADOFQUEUE 0x05
35 #define ATTR_ORDERED 0x06
36 #define ATTR_ACA 0x07
37 
38 /* cdb type */
39 #define TYPE_CMD 0x00
40 #define TYPE_MSG 0x01
41 
42 /* Type defs used in the following structs */
43 #define BYTE __u8
44 #define WORD __u16
45 #define HWORD __u16
46 #define DWORD __u32
47 
48 #define CISS_MAX_LUN 1024
49 
50 #define LEVEL2LUN 1 /* index into Target(x) structure, due to byte swapping */
51 #define LEVEL3LUN 0
52 
53 #pragma pack(1)
54 
55 /* Command List Structure */
56 typedef union _SCSI3Addr_struct {
57  struct {
59  BYTE Bus:6;
60  BYTE Mode:2; /* b00 */
61  } PeripDev;
62  struct {
64  BYTE DevMSB:6;
65  BYTE Mode:2; /* b01 */
66  } LogDev;
67  struct {
68  BYTE Dev:5;
69  BYTE Bus:3;
70  BYTE Targ:6;
71  BYTE Mode:2; /* b10 */
72  } LogUnit;
74 
75 typedef struct _PhysDevAddr_struct {
79  SCSI3Addr_struct Target[2]; /* 2 level target device addr */
81 
82 typedef struct _LogDevAddr_struct {
85  BYTE reserved[4];
87 
88 typedef union _LUNAddr_struct {
94 
95 typedef struct _RequestBlock_struct {
96  BYTE CDBLen;
97  struct {
100  BYTE Direction:2;
101  } Type;
103  BYTE CDB[16];
106 typedef union _MoreErrInfo_struct{
107  struct {
111  } Common_Info;
112  struct{
114  BYTE offense_size; /* size of offending entry */
115  BYTE offense_num; /* byte # of offense 0-base */
117  } Invalid_Cmd;
119 typedef struct _ErrorInfo_struct {
127 
128 #pragma pack()
129 
130 #endif /* CCISS_DEFS_H */