5 * $Id: gdth_ioctl.h,v 1.11 2003/02/27 14:59:03 achim Exp $
9 #define GDTIOCTL_MASK ('J'<<8)
10 #define GDTIOCTL_GENERAL (GDTIOCTL_MASK | 0) /* general IOCTL */
11 #define GDTIOCTL_DRVERS (GDTIOCTL_MASK | 1) /* get driver version */
12 #define GDTIOCTL_CTRTYPE (GDTIOCTL_MASK | 2) /* get controller type */
13 #define GDTIOCTL_OSVERS (GDTIOCTL_MASK | 3) /* get OS version */
14 #define GDTIOCTL_HDRLIST (GDTIOCTL_MASK | 4) /* get host drive list */
15 #define GDTIOCTL_CTRCNT (GDTIOCTL_MASK | 5) /* get controller count */
16 #define GDTIOCTL_LOCKDRV (GDTIOCTL_MASK | 6) /* lock host drive */
17 #define GDTIOCTL_LOCKCHN (GDTIOCTL_MASK | 7) /* lock channel */
18 #define GDTIOCTL_EVENT (GDTIOCTL_MASK | 8) /* read controller events */
19 #define GDTIOCTL_SCSI (GDTIOCTL_MASK | 9) /* SCSI command */
20 #define GDTIOCTL_RESET_BUS (GDTIOCTL_MASK |10) /* reset SCSI bus */
21 #define GDTIOCTL_RESCAN (GDTIOCTL_MASK |11) /* rescan host drives */
22 #define GDTIOCTL_RESET_DRV (GDTIOCTL_MASK |12) /* reset (remote) drv. res. */
24 #define GDTIOCTL_MAGIC 0xaffe0004
25 #define EVENT_SIZE 294
26 #define GDTH_MAXSG 32 /* max. s/g elements */
28 #define MAX_LDRIVES 255 /* max. log. drive count */
29 #ifdef GDTH_IOCTL_PROC
30 #define MAX_HDRIVES 100 /* max. host drive count */
32 #define MAX_HDRIVES MAX_LDRIVES /* max. host drive count */
39 #define PACKED __attribute__((packed))
41 /* scatter/gather element */
43 ulong32 sg_ptr; /* address */
44 ulong32 sg_len; /* length */
47 /* command structure */
49 ulong32 BoardNode; /* board node (always 0) */
50 ulong32 CommandIndex; /* command number */
51 ushort OpCode; /* the command (READ,..) */
54 ushort DeviceNo; /* number of cache drive */
55 ulong32 BlockNo; /* block number */
56 ulong32 BlockCnt; /* block count */
57 ulong32 DestAddr; /* dest. addr. (if s/g: -1) */
58 ulong32 sg_canz; /* s/g element count */
59 gdth_sg_str sg_lst[GDTH_MAXSG]; /* s/g list */
60 } PACKED cache; /* cache service cmd. str. */
62 ushort param_size; /* size of p_param buffer */
63 ulong32 subfunc; /* IOCTL function */
64 ulong32 channel; /* device */
65 ulong32 p_param; /* buffer */
66 } PACKED ioctl; /* IOCTL command structure */
71 ulong32 msg_handle; /* message handle */
72 ulong32 msg_addr; /* message buffer address */
74 unchar data[12]; /* buffer for rtc data, ... */
76 } PACKED screen; /* screen service cmd. str. */
79 ulong32 direction; /* data direction */
80 ulong32 mdisc_time; /* disc. time (0: no timeout)*/
81 ulong32 mcon_time; /* connect time(0: no to.) */
82 ulong32 sdata; /* dest. addr. (if s/g: -1) */
83 ulong32 sdlen; /* data length (bytes) */
84 ulong32 clen; /* SCSI cmd. length(6,10,12) */
85 unchar cmd[12]; /* SCSI command */
86 unchar target; /* target ID */
88 unchar bus; /* SCSI bus number */
89 unchar priority; /* only 0 used */
90 ulong32 sense_len; /* sense data length */
91 ulong32 sense_data; /* sense data addr. */
92 ulong32 link_p; /* linked cmds (not supp.) */
93 ulong32 sg_ranz; /* s/g element count */
94 gdth_sg_str sg_lst[GDTH_MAXSG]; /* s/g list */
95 } PACKED raw; /* raw service cmd. struct. */
97 /* additional variables */
98 unchar Service; /* controller service */
100 ushort Status; /* command result */
101 ulong32 Info; /* additional information */
102 void *RequestBuffer; /* request buffer */
103 } PACKED gdth_cmd_str;
105 /* controller event structure */
111 ushort size; /* size of structure */
124 unchar scsi_coord[3];
132 unchar scsi_coord[3];
136 ulong32 l1, l2, l3, l4;
140 unchar event_string[256];
141 } PACKED gdth_evt_data;
151 gdth_evt_data event_data;
152 } PACKED gdth_evt_str;
155 #ifdef GDTH_IOCTL_PROC
156 /* IOCTL structure (write) */
158 ulong32 magic; /* IOCTL magic */
159 ushort ioctl; /* IOCTL */
160 ushort ionode; /* controller number */
161 ushort service; /* controller service */
162 ushort timeout; /* timeout */
165 unchar command[512]; /* controller command */
166 unchar data[1]; /* add. data */
169 unchar lock; /* lock/unlock */
170 unchar drive_cnt; /* drive count */
171 ushort drives[MAX_HDRIVES];/* drives */
174 unchar lock; /* lock/unlock */
175 unchar channel; /* channel */
178 int erase; /* erase event ? */
180 unchar evt[EVENT_SIZE]; /* event structure */
183 unchar bus; /* SCSI bus */
184 unchar target; /* target ID */
185 unchar lun; /* LUN */
186 unchar cmd_len; /* command length */
187 unchar cmd[12]; /* SCSI command */
190 ushort hdr_no; /* host drive number */
191 unchar flag; /* old meth./add/remove */
196 /* IOCTL structure (read) */
198 ulong32 size; /* buffer size */
199 ulong32 status; /* IOCTL error code */
202 unchar data[1]; /* data */
205 ushort version; /* driver version */
208 unchar type; /* controller type */
209 ushort info; /* slot etc. */
210 ushort oem_id; /* OEM ID */
211 ushort bios_ver; /* not used */
212 ushort access; /* not used */
213 ushort ext_type; /* extended type */
214 ushort device_id; /* device ID */
215 ushort sub_device_id; /* sub device ID */
218 unchar version; /* OS version */
219 unchar subversion; /* OS subversion */
220 ushort revision; /* revision */
223 ushort count; /* controller count */
227 unchar evt[EVENT_SIZE]; /* event structure */
230 unchar bus; /* SCSI bus, 0xff: invalid */
231 unchar target; /* target ID */
232 unchar lun; /* LUN */
233 unchar cluster_type; /* cluster properties */
234 } hdr_list[MAX_HDRIVES]; /* index is host drive number */
239 #ifdef GDTH_IOCTL_CHRDEV
240 /* GDTIOCTL_GENERAL */
242 ushort ionode; /* controller number */
243 ushort timeout; /* timeout */
244 ulong32 info; /* error info */
245 ushort status; /* status */
246 ulong data_len; /* data buffer size */
247 ulong sense_len; /* sense buffer size */
248 gdth_cmd_str command; /* command */
249 } gdth_ioctl_general;
251 /* GDTIOCTL_LOCKDRV */
253 ushort ionode; /* controller number */
254 unchar lock; /* lock/unlock */
255 unchar drive_cnt; /* drive count */
256 ushort drives[MAX_HDRIVES]; /* drives */
257 } gdth_ioctl_lockdrv;
259 /* GDTIOCTL_LOCKCHN */
261 ushort ionode; /* controller number */
262 unchar lock; /* lock/unlock */
263 unchar channel; /* channel */
264 } gdth_ioctl_lockchn;
266 /* GDTIOCTL_OSVERS */
268 unchar version; /* OS version */
269 unchar subversion; /* OS subversion */
270 ushort revision; /* revision */
273 /* GDTIOCTL_CTRTYPE */
275 ushort ionode; /* controller number */
276 unchar type; /* controller type */
277 ushort info; /* slot etc. */
278 ushort oem_id; /* OEM ID */
279 ushort bios_ver; /* not used */
280 ushort access; /* not used */
281 ushort ext_type; /* extended type */
282 ushort device_id; /* device ID */
283 ushort sub_device_id; /* sub device ID */
284 } gdth_ioctl_ctrtype;
289 int erase; /* erase event? */
290 int handle; /* event handle */
294 /* GDTIOCTL_RESCAN/GDTIOCTL_HDRLIST */
296 ushort ionode; /* controller number */
297 unchar flag; /* add/remove */
298 ushort hdr_no; /* drive no. */
300 unchar bus; /* SCSI bus */
301 unchar target; /* target ID */
302 unchar lun; /* LUN */
303 unchar cluster_type; /* cluster properties */
304 } hdr_list[MAX_HDRIVES]; /* index is host drive number */
307 /* GDTIOCTL_RESET_BUS/GDTIOCTL_RESET_DRV */
309 ushort ionode; /* controller number */
310 ushort number; /* bus/host drive number */
311 ushort status; /* status */