5 * $Id: gdth_ioctl.h,v 1.14 2004/02/19 15:43:15 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 */
41 #define PACKED __attribute__((packed))
43 /* scatter/gather element */
45 ulong32 sg_ptr
; /* address */
46 ulong32 sg_len
; /* length */
49 /* scatter/gather element - 64bit addresses */
51 ulong64 sg_ptr
; /* address */
52 ulong32 sg_len
; /* length */
53 } PACKED gdth_sg64_str
;
55 /* command structure */
57 ulong32 BoardNode
; /* board node (always 0) */
58 ulong32 CommandIndex
; /* command number */
59 ushort OpCode
; /* the command (READ,..) */
62 ushort DeviceNo
; /* number of cache drive */
63 ulong32 BlockNo
; /* block number */
64 ulong32 BlockCnt
; /* block count */
65 ulong32 DestAddr
; /* dest. addr. (if s/g: -1) */
66 ulong32 sg_canz
; /* s/g element count */
67 gdth_sg_str sg_lst
[GDTH_MAXSG
]; /* s/g list */
68 } PACKED cache
; /* cache service cmd. str. */
70 ushort DeviceNo
; /* number of cache drive */
71 ulong64 BlockNo
; /* block number */
72 ulong32 BlockCnt
; /* block count */
73 ulong64 DestAddr
; /* dest. addr. (if s/g: -1) */
74 ulong32 sg_canz
; /* s/g element count */
75 gdth_sg64_str sg_lst
[GDTH_MAXSG
]; /* s/g list */
76 } PACKED cache64
; /* cache service cmd. str. */
78 ushort param_size
; /* size of p_param buffer */
79 ulong32 subfunc
; /* IOCTL function */
80 ulong32 channel
; /* device */
81 ulong64 p_param
; /* buffer */
82 } PACKED ioctl
; /* IOCTL command structure */
87 ulong32 msg_handle
; /* message handle */
88 ulong64 msg_addr
; /* message buffer address */
90 unchar data
[12]; /* buffer for rtc data, ... */
92 } PACKED screen
; /* screen service cmd. str. */
95 ulong32 direction
; /* data direction */
96 ulong32 mdisc_time
; /* disc. time (0: no timeout)*/
97 ulong32 mcon_time
; /* connect time(0: no to.) */
98 ulong32 sdata
; /* dest. addr. (if s/g: -1) */
99 ulong32 sdlen
; /* data length (bytes) */
100 ulong32 clen
; /* SCSI cmd. length(6,10,12) */
101 unchar cmd
[12]; /* SCSI command */
102 unchar target
; /* target ID */
103 unchar lun
; /* LUN */
104 unchar bus
; /* SCSI bus number */
105 unchar priority
; /* only 0 used */
106 ulong32 sense_len
; /* sense data length */
107 ulong32 sense_data
; /* sense data addr. */
108 ulong32 link_p
; /* linked cmds (not supp.) */
109 ulong32 sg_ranz
; /* s/g element count */
110 gdth_sg_str sg_lst
[GDTH_MAXSG
]; /* s/g list */
111 } PACKED raw
; /* raw service cmd. struct. */
114 ulong32 direction
; /* data direction */
115 ulong32 mdisc_time
; /* disc. time (0: no timeout)*/
116 ulong32 mcon_time
; /* connect time(0: no to.) */
117 ulong64 sdata
; /* dest. addr. (if s/g: -1) */
118 ulong32 sdlen
; /* data length (bytes) */
119 ulong32 clen
; /* SCSI cmd. length(6,..,16) */
120 unchar cmd
[16]; /* SCSI command */
121 unchar target
; /* target ID */
122 unchar lun
; /* LUN */
123 unchar bus
; /* SCSI bus number */
124 unchar priority
; /* only 0 used */
125 ulong32 sense_len
; /* sense data length */
126 ulong64 sense_data
; /* sense data addr. */
127 ulong32 sg_ranz
; /* s/g element count */
128 gdth_sg64_str sg_lst
[GDTH_MAXSG
]; /* s/g list */
129 } PACKED raw64
; /* raw service cmd. struct. */
131 /* additional variables */
132 unchar Service
; /* controller service */
134 ushort Status
; /* command result */
135 ulong32 Info
; /* additional information */
136 void *RequestBuffer
; /* request buffer */
137 } PACKED gdth_cmd_str
;
139 /* controller event structure */
145 ushort size
; /* size of structure */
158 unchar scsi_coord
[3];
166 unchar scsi_coord
[3];
170 ulong32 l1
, l2
, l3
, l4
;
174 unchar event_string
[256];
175 } PACKED gdth_evt_data
;
185 gdth_evt_data event_data
;
186 } PACKED gdth_evt_str
;
189 #ifdef GDTH_IOCTL_PROC
190 /* IOCTL structure (write) */
192 ulong32 magic
; /* IOCTL magic */
193 ushort ioctl
; /* IOCTL */
194 ushort ionode
; /* controller number */
195 ushort service
; /* controller service */
196 ushort timeout
; /* timeout */
199 unchar command
[512]; /* controller command */
200 unchar data
[1]; /* add. data */
203 unchar lock
; /* lock/unlock */
204 unchar drive_cnt
; /* drive count */
205 ushort drives
[MAX_HDRIVES
];/* drives */
208 unchar lock
; /* lock/unlock */
209 unchar channel
; /* channel */
212 int erase
; /* erase event ? */
214 unchar evt
[EVENT_SIZE
]; /* event structure */
217 unchar bus
; /* SCSI bus */
218 unchar target
; /* target ID */
219 unchar lun
; /* LUN */
220 unchar cmd_len
; /* command length */
221 unchar cmd
[12]; /* SCSI command */
224 ushort hdr_no
; /* host drive number */
225 unchar flag
; /* old meth./add/remove */
230 /* IOCTL structure (read) */
232 ulong32 size
; /* buffer size */
233 ulong32 status
; /* IOCTL error code */
236 unchar data
[1]; /* data */
239 ushort version
; /* driver version */
242 unchar type
; /* controller type */
243 ushort info
; /* slot etc. */
244 ushort oem_id
; /* OEM ID */
245 ushort bios_ver
; /* not used */
246 ushort access
; /* not used */
247 ushort ext_type
; /* extended type */
248 ushort device_id
; /* device ID */
249 ushort sub_device_id
; /* sub device ID */
252 unchar version
; /* OS version */
253 unchar subversion
; /* OS subversion */
254 ushort revision
; /* revision */
257 ushort count
; /* controller count */
261 unchar evt
[EVENT_SIZE
]; /* event structure */
264 unchar bus
; /* SCSI bus, 0xff: invalid */
265 unchar target
; /* target ID */
266 unchar lun
; /* LUN */
267 unchar cluster_type
; /* cluster properties */
268 } hdr_list
[MAX_HDRIVES
]; /* index is host drive number */
273 /* GDTIOCTL_GENERAL */
275 ushort ionode
; /* controller number */
276 ushort timeout
; /* timeout */
277 ulong32 info
; /* error info */
278 ushort status
; /* status */
279 ulong data_len
; /* data buffer size */
280 ulong sense_len
; /* sense buffer size */
281 gdth_cmd_str command
; /* command */
282 } gdth_ioctl_general
;
284 /* GDTIOCTL_LOCKDRV */
286 ushort ionode
; /* controller number */
287 unchar lock
; /* lock/unlock */
288 unchar drive_cnt
; /* drive count */
289 ushort drives
[MAX_HDRIVES
]; /* drives */
290 } gdth_ioctl_lockdrv
;
292 /* GDTIOCTL_LOCKCHN */
294 ushort ionode
; /* controller number */
295 unchar lock
; /* lock/unlock */
296 unchar channel
; /* channel */
297 } gdth_ioctl_lockchn
;
299 /* GDTIOCTL_OSVERS */
301 unchar version
; /* OS version */
302 unchar subversion
; /* OS subversion */
303 ushort revision
; /* revision */
306 /* GDTIOCTL_CTRTYPE */
308 ushort ionode
; /* controller number */
309 unchar type
; /* controller type */
310 ushort info
; /* slot etc. */
311 ushort oem_id
; /* OEM ID */
312 ushort bios_ver
; /* not used */
313 ushort access
; /* not used */
314 ushort ext_type
; /* extended type */
315 ushort device_id
; /* device ID */
316 ushort sub_device_id
; /* sub device ID */
317 } gdth_ioctl_ctrtype
;
322 int erase
; /* erase event? */
323 int handle
; /* event handle */
327 /* GDTIOCTL_RESCAN/GDTIOCTL_HDRLIST */
329 ushort ionode
; /* controller number */
330 unchar flag
; /* add/remove */
331 ushort hdr_no
; /* drive no. */
333 unchar bus
; /* SCSI bus */
334 unchar target
; /* target ID */
335 unchar lun
; /* LUN */
336 unchar cluster_type
; /* cluster properties */
337 } hdr_list
[MAX_HDRIVES
]; /* index is host drive number */
340 /* GDTIOCTL_RESET_BUS/GDTIOCTL_RESET_DRV */
342 ushort ionode
; /* controller number */
343 ushort number
; /* bus/host drive number */
344 ushort status
; /* status */
This page took 0.037191 seconds and 5 git commands to generate.