3 /* ########################################################################## */
5 /* ########################################################################## */
6 #define CISS_VERSION "1.00"
8 /* general boundary defintions */
9 #define SENSEINFOBYTES 32 /* note that this value may vary */
10 /* between host implementations */
11 #define MAXSGENTRIES 31
12 #define MAXREPLYQS 256
14 /* Command Status value */
15 #define CMD_SUCCESS 0x0000
16 #define CMD_TARGET_STATUS 0x0001
17 #define CMD_DATA_UNDERRUN 0x0002
18 #define CMD_DATA_OVERRUN 0x0003
19 #define CMD_INVALID 0x0004
20 #define CMD_PROTOCOL_ERR 0x0005
21 #define CMD_HARDWARE_ERR 0x0006
22 #define CMD_CONNECTION_LOST 0x0007
23 #define CMD_ABORTED 0x0008
24 #define CMD_ABORT_FAILED 0x0009
25 #define CMD_UNSOLICITED_ABORT 0x000A
26 #define CMD_TIMEOUT 0x000B
27 #define CMD_UNABORTABLE 0x000C
29 /* transfer direction */
30 #define XFER_NONE 0x00
31 #define XFER_WRITE 0x01
32 #define XFER_READ 0x02
33 #define XFER_RSVD 0x03
36 #define ATTR_UNTAGGED 0x00
37 #define ATTR_SIMPLE 0x04
38 #define ATTR_HEADOFQUEUE 0x05
39 #define ATTR_ORDERED 0x06
46 /* config space register offsets */
47 #define CFG_VENDORID 0x00
48 #define CFG_DEVICEID 0x02
49 #define CFG_I2OBAR 0x10
50 #define CFG_MEM1BAR 0x14
52 /* i2o space register offsets */
53 #define I2O_IBDB_SET 0x20
54 #define I2O_IBDB_CLEAR 0x70
55 #define I2O_INT_STATUS 0x30
56 #define I2O_INT_MASK 0x34
57 #define I2O_IBPOST_Q 0x40
58 #define I2O_OBPOST_Q 0x44
60 /* Configuration Table */
61 #define CFGTBL_ChangeReq 0x00000001l
62 #define CFGTBL_AccCmds 0x00000001l
64 #define CFGTBL_Trans_Simple 0x00000002l
66 #define CFGTBL_BusType_Ultra2 0x00000001l
67 #define CFGTBL_BusType_Ultra3 0x00000002l
68 #define CFGTBL_BusType_Fibre1G 0x00000100l
69 #define CFGTBL_BusType_Fibre2G 0x00000200l
70 typedef struct _vals32
82 /* Type defs used in the following structs */
89 /* ######################################################################### */
91 /* ######################################################################### */
92 #define CISS_MAX_LUN 16
93 #define CISS_MAX_PHYS_LUN 1024
98 #define CISS_INQUIRY 0x12
100 typedef struct _InquiryData_struct
103 } InquiryData_struct;
105 #define CISS_REPORT_LOG 0xc2 /* Report Logical LUNs */
106 #define CISS_REPORT_PHYS 0xc3 /* Report Physical LUNs */
108 typedef struct _ReportLUNdata_struct
110 BYTE LUNListLength[4];
112 BYTE LUN[CISS_MAX_LUN][8];
113 } ReportLunData_struct;
115 #define CCISS_READ_CAPACITY 0x25 /* Read Capacity */
116 typedef struct _ReadCapdata_struct
118 BYTE total_size[4]; /* Total size in blocks */
119 BYTE block_size[4]; /* Size of blocks in bytes */
120 } ReadCapdata_struct;
122 /* 12 byte commands not implemented in firmware yet. */
123 /* #define CCISS_READ 0xa8 Read(12) */
124 /* #define CCISS_WRITE 0xaa Write(12) */
125 #define CCISS_READ 0x28 /* Read(10) */
126 #define CCISS_WRITE 0x2a /* Write(10) */
129 #define BMIC_READ 0x26
130 #define BMIC_WRITE 0x27
131 #define BMIC_CACHE_FLUSH 0xc2
132 #define CCISS_CACHE_FLUSH 0x01 /* 0xC2 was already being used by CCISS */
134 /* Command List Structure */
135 typedef union _SCSI3Addr_struct {
139 BYTE Mode:2; /* b00 */
144 BYTE Mode:2; /* b01 */
150 BYTE Mode:2; /* b10 */
154 typedef struct _PhysDevAddr_struct {
158 SCSI3Addr_struct Target[2]; /* 2 level target device addr */
159 } PhysDevAddr_struct;
161 typedef struct _LogDevAddr_struct {
167 typedef union _LUNAddr_struct {
168 BYTE LunAddrBytes[8];
169 SCSI3Addr_struct SCSI3Lun[4];
170 PhysDevAddr_struct PhysDev;
171 LogDevAddr_struct LogDev;
174 typedef struct _CommandListHeader_struct {
180 } CommandListHeader_struct;
181 typedef struct _RequestBlock_struct {
190 } RequestBlock_struct;
191 typedef struct _ErrDescriptor_struct {
194 } ErrDescriptor_struct;
195 typedef struct _SGDescriptor_struct {
199 } SGDescriptor_struct;
201 typedef union _MoreErrInfo_struct{
209 BYTE offense_size; /* size of offending entry */
210 BYTE offense_num; /* byte # of offense 0-base */
214 typedef struct _ErrorInfo_struct {
219 MoreErrInfo_struct MoreErrInfo;
220 BYTE SenseInfo[SENSEINFOBYTES];
224 #define CMD_RWREQ 0x00
225 #define CMD_IOCTL_PEND 0x01
226 #define CMD_SCSI 0x03
227 #define CMD_MSG_DONE 0x04
228 #define CMD_MSG_TIMEOUT 0x05
230 typedef struct _CommandList_struct {
231 CommandListHeader_struct Header;
232 RequestBlock_struct Request;
233 ErrDescriptor_struct ErrDesc;
234 SGDescriptor_struct SG[MAXSGENTRIES];
235 /* information associated with the command */
236 __u32 busaddr; /* physical address of this record */
237 ErrorInfo_struct * err_info; /* pointer to the allocated mem */
240 struct _CommandList_struct *prev;
241 struct _CommandList_struct *next;
243 struct completion *waiting;
245 #ifdef CONFIG_CISS_SCSI_TAPE
248 } CommandList_struct;
250 /* Configuration Table Structure */
251 typedef struct _HostWrite_struct {
252 DWORD TransportRequest;
258 typedef struct _CfgTable_struct {
261 DWORD TransportSupport;
262 DWORD TransportActive;
263 HostWrite_struct HostWrite;
272 #endif /* CCISS_CMD_H */