• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This header was generated from the Linux kernel headers by update_headers.py,
3  * to provide necessary information from kernel to userspace, such as constants,
4  * structures, and macros, and thus, contains no copyrightable information.
5  */
6 #ifndef CCISS_DEFS_H
7 #define CCISS_DEFS_H
8 #include <linux/types.h>
9 #define SENSEINFOBYTES          32
10 #define CMD_SUCCESS             0x0000
11 #define CMD_TARGET_STATUS       0x0001
12 #define CMD_DATA_UNDERRUN       0x0002
13 #define CMD_DATA_OVERRUN        0x0003
14 #define CMD_INVALID             0x0004
15 #define CMD_PROTOCOL_ERR        0x0005
16 #define CMD_HARDWARE_ERR        0x0006
17 #define CMD_CONNECTION_LOST     0x0007
18 #define CMD_ABORTED             0x0008
19 #define CMD_ABORT_FAILED        0x0009
20 #define CMD_UNSOLICITED_ABORT   0x000A
21 #define CMD_TIMEOUT             0x000B
22 #define CMD_UNABORTABLE		0x000C
23 #define XFER_NONE               0x00
24 #define XFER_WRITE              0x01
25 #define XFER_READ               0x02
26 #define XFER_RSVD               0x03
27 #define ATTR_UNTAGGED           0x00
28 #define ATTR_SIMPLE             0x04
29 #define ATTR_HEADOFQUEUE        0x05
30 #define ATTR_ORDERED            0x06
31 #define ATTR_ACA                0x07
32 #define TYPE_CMD				0x00
33 #define TYPE_MSG				0x01
34 #define BYTE __u8
35 #define WORD __u16
36 #define HWORD __u16
37 #define DWORD __u32
38 #define CISS_MAX_LUN	1024
39 #define LEVEL2LUN   1
40 #define LEVEL3LUN   0
41 #pragma pack(1)
42 typedef union _SCSI3Addr_struct {
43    struct {
44     BYTE Dev;
45     BYTE Bus:6;
46     BYTE Mode:2;
47   } PeripDev;
48    struct {
49     BYTE DevLSB;
50     BYTE DevMSB:6;
51     BYTE Mode:2;
52   } LogDev;
53    struct {
54     BYTE Dev:5;
55     BYTE Bus:3;
56     BYTE Targ:6;
57     BYTE Mode:2;
58   } LogUnit;
59 } SCSI3Addr_struct;
60 typedef struct _PhysDevAddr_struct {
61   DWORD             TargetId:24;
62   DWORD             Bus:6;
63   DWORD             Mode:2;
64   SCSI3Addr_struct  Target[2];
65 } PhysDevAddr_struct;
66 typedef struct _LogDevAddr_struct {
67   DWORD            VolId:30;
68   DWORD            Mode:2;
69   BYTE             reserved[4];
70 } LogDevAddr_struct;
71 typedef union _LUNAddr_struct {
72   BYTE               LunAddrBytes[8];
73   SCSI3Addr_struct   SCSI3Lun[4];
74   PhysDevAddr_struct PhysDev;
75   LogDevAddr_struct  LogDev;
76 } LUNAddr_struct;
77 typedef struct _RequestBlock_struct {
78   BYTE   CDBLen;
79   struct {
80     BYTE Type:3;
81     BYTE Attribute:3;
82     BYTE Direction:2;
83   } Type;
84   HWORD  Timeout;
85   BYTE   CDB[16];
86 } RequestBlock_struct;
87 typedef union _MoreErrInfo_struct{
88   struct {
89     BYTE  Reserved[3];
90     BYTE  Type;
91     DWORD ErrorInfo;
92   } Common_Info;
93   struct{
94     BYTE  Reserved[2];
95     BYTE  offense_size;
96     BYTE  offense_num;
97     DWORD offense_value;
98   } Invalid_Cmd;
99 } MoreErrInfo_struct;
100 typedef struct _ErrorInfo_struct {
101   BYTE               ScsiStatus;
102   BYTE               SenseLen;
103   HWORD              CommandStatus;
104   DWORD              ResidualCnt;
105   MoreErrInfo_struct MoreErrInfo;
106   BYTE               SenseInfo[SENSEINFOBYTES];
107 } ErrorInfo_struct;
108 #pragma pack()
109 #endif
110