4 #include <linux/types.h>
5 #include <linux/ioctl.h>
7 #define CCISS_IOC_MAGIC 'B'
10 typedef struct _cciss_pci_info_struct
14 unsigned short domain
;
16 } cciss_pci_info_struct
;
18 typedef struct _cciss_coalint_struct
22 } cciss_coalint_struct
;
24 typedef char NodeName_type
[16];
26 typedef __u32 Heartbeat_type
;
28 #define CISS_PARSCSIU2 0x0001
29 #define CISS_PARCSCIU3 0x0002
30 #define CISS_FIBRE1G 0x0100
31 #define CISS_FIBRE2G 0x0200
32 typedef __u32 BusTypes_type
;
34 typedef char FirmwareVer_type
[4];
35 typedef __u32 DriverVer_type
;
37 #define MAX_KMALLOC_SIZE 128000
40 // This defines are duplicated in cciss_cmd.h in the driver directory
42 //general boundary defintions
43 #define SENSEINFOBYTES 32//note that this value may vary between host implementations
45 //Command Status value
46 #define CMD_SUCCESS 0x0000
47 #define CMD_TARGET_STATUS 0x0001
48 #define CMD_DATA_UNDERRUN 0x0002
49 #define CMD_DATA_OVERRUN 0x0003
50 #define CMD_INVALID 0x0004
51 #define CMD_PROTOCOL_ERR 0x0005
52 #define CMD_HARDWARE_ERR 0x0006
53 #define CMD_CONNECTION_LOST 0x0007
54 #define CMD_ABORTED 0x0008
55 #define CMD_ABORT_FAILED 0x0009
56 #define CMD_UNSOLICITED_ABORT 0x000A
57 #define CMD_TIMEOUT 0x000B
58 #define CMD_UNABORTABLE 0x000C
61 #define XFER_NONE 0x00
62 #define XFER_WRITE 0x01
63 #define XFER_READ 0x02
64 #define XFER_RSVD 0x03
67 #define ATTR_UNTAGGED 0x00
68 #define ATTR_SIMPLE 0x04
69 #define ATTR_HEADOFQUEUE 0x05
70 #define ATTR_ORDERED 0x06
77 // Type defs used in the following structs
83 #define CISS_MAX_LUN 16
85 #define LEVEL2LUN 1 // index into Target(x) structure, due to byte swapping
90 //Command List Structure
91 typedef union _SCSI3Addr_struct
{
110 typedef struct _PhysDevAddr_struct
{
114 SCSI3Addr_struct Target
[2]; //2 level target device addr
115 } PhysDevAddr_struct
;
117 typedef struct _LogDevAddr_struct
{
123 typedef union _LUNAddr_struct
{
124 BYTE LunAddrBytes
[8];
125 SCSI3Addr_struct SCSI3Lun
[4];
126 PhysDevAddr_struct PhysDev
;
127 LogDevAddr_struct LogDev
;
130 typedef struct _RequestBlock_struct
{
139 } RequestBlock_struct
;
141 typedef union _MoreErrInfo_struct
{
149 BYTE offense_size
;//size of offending entry
150 BYTE offense_num
; //byte # of offense 0-base
154 typedef struct _ErrorInfo_struct
{
159 MoreErrInfo_struct MoreErrInfo
;
160 BYTE SenseInfo
[SENSEINFOBYTES
];
164 #endif /* CCISS_CMD_H */
166 typedef struct _IOCTL_Command_struct
{
167 LUNAddr_struct LUN_info
;
168 RequestBlock_struct Request
;
169 ErrorInfo_struct error_info
;
170 WORD buf_size
; /* size in bytes of the buf */
172 } IOCTL_Command_struct
;
174 typedef struct _BIG_IOCTL_Command_struct
{
175 LUNAddr_struct LUN_info
;
176 RequestBlock_struct Request
;
177 ErrorInfo_struct error_info
;
178 DWORD malloc_size
; /* < MAX_KMALLOC_SIZE in cciss.c */
179 DWORD buf_size
; /* size in bytes of the buf */
180 /* < malloc_size * MAXSGENTRIES */
182 } BIG_IOCTL_Command_struct
;
184 typedef struct _LogvolInfo_struct
{
186 int num_opens
; /* number of opens on the logical volume */
187 int num_parts
; /* number of partitions configured on logvol */
190 #define CCISS_GETPCIINFO _IOR(CCISS_IOC_MAGIC, 1, cciss_pci_info_struct)
192 #define CCISS_GETINTINFO _IOR(CCISS_IOC_MAGIC, 2, cciss_coalint_struct)
193 #define CCISS_SETINTINFO _IOW(CCISS_IOC_MAGIC, 3, cciss_coalint_struct)
195 #define CCISS_GETNODENAME _IOR(CCISS_IOC_MAGIC, 4, NodeName_type)
196 #define CCISS_SETNODENAME _IOW(CCISS_IOC_MAGIC, 5, NodeName_type)
198 #define CCISS_GETHEARTBEAT _IOR(CCISS_IOC_MAGIC, 6, Heartbeat_type)
199 #define CCISS_GETBUSTYPES _IOR(CCISS_IOC_MAGIC, 7, BusTypes_type)
200 #define CCISS_GETFIRMVER _IOR(CCISS_IOC_MAGIC, 8, FirmwareVer_type)
201 #define CCISS_GETDRIVVER _IOR(CCISS_IOC_MAGIC, 9, DriverVer_type)
202 #define CCISS_REVALIDVOLS _IO(CCISS_IOC_MAGIC, 10)
203 #define CCISS_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 11, IOCTL_Command_struct)
204 #define CCISS_DEREGDISK _IO(CCISS_IOC_MAGIC, 12)
206 /* no longer used... use REGNEWD instead */
207 #define CCISS_REGNEWDISK _IOW(CCISS_IOC_MAGIC, 13, int)
209 #define CCISS_REGNEWD _IO(CCISS_IOC_MAGIC, 14)
210 #define CCISS_RESCANDISK _IO(CCISS_IOC_MAGIC, 16)
211 #define CCISS_GETLUNINFO _IOR(CCISS_IOC_MAGIC, 17, LogvolInfo_struct)
212 #define CCISS_BIG_PASSTHRU _IOWR(CCISS_IOC_MAGIC, 18, BIG_IOCTL_Command_struct)
217 /* 32 bit compatible ioctl structs */
218 typedef struct _IOCTL32_Command_struct
{
219 LUNAddr_struct LUN_info
;
220 RequestBlock_struct Request
;
221 ErrorInfo_struct error_info
;
222 WORD buf_size
; /* size in bytes of the buf */
223 __u32 buf
; /* 32 bit pointer to data buffer */
224 } IOCTL32_Command_struct
;
226 typedef struct _BIG_IOCTL32_Command_struct
{
227 LUNAddr_struct LUN_info
;
228 RequestBlock_struct Request
;
229 ErrorInfo_struct error_info
;
230 DWORD malloc_size
; /* < MAX_KMALLOC_SIZE in cciss.c */
231 DWORD buf_size
; /* size in bytes of the buf */
232 /* < malloc_size * MAXSGENTRIES */
233 __u32 buf
; /* 32 bit pointer to data buffer */
234 } BIG_IOCTL32_Command_struct
;
236 #define CCISS_PASSTHRU32 _IOWR(CCISS_IOC_MAGIC, 11, IOCTL32_Command_struct)
237 #define CCISS_BIG_PASSTHRU32 _IOWR(CCISS_IOC_MAGIC, 18, BIG_IOCTL32_Command_struct)
239 #endif /* CONFIG_COMPAT */
240 #endif /* __KERNEL__ */