aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/gdth_ioctl.h
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2010-01-04 10:19:34 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-01-18 11:48:16 -0500
commit1fe6dbf4d0afba52ad0249f398e6296a1433a004 (patch)
tree0eb9d2cebc7cd287662726a93109974e5ceb2e3e /drivers/scsi/gdth_ioctl.h
parente7efe5932b1d3916c79326a4221693ea90a900e2 (diff)
[SCSI] gdth: Convert to use regular kernel types.
converted using this script.. perl -p -i -e 's|ulong32|u32|g' drivers/scsi/gdth* perl -p -i -e 's|ulong64|u64|g' drivers/scsi/gdth* perl -p -i -e 's|ushort|u16|g' drivers/scsi/gdth* perl -p -i -e 's|unchar|u8|g' drivers/scsi/gdth* perl -p -i -e 's|ulong|unsigned long|g' drivers/scsi/gdth* perl -p -i -e 's|PACKED|__attribute__((packed))|g' drivers/scsi/gdth* sha1sum of the generated code was identical before and after. Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/gdth_ioctl.h')
-rw-r--r--drivers/scsi/gdth_ioctl.h366
1 files changed, 179 insertions, 187 deletions
diff --git a/drivers/scsi/gdth_ioctl.h b/drivers/scsi/gdth_ioctl.h
index 783fae737f17..b004c6165887 100644
--- a/drivers/scsi/gdth_ioctl.h
+++ b/drivers/scsi/gdth_ioctl.h
@@ -32,109 +32,101 @@
32#define MAX_HDRIVES MAX_LDRIVES /* max. host drive count */ 32#define MAX_HDRIVES MAX_LDRIVES /* max. host drive count */
33#endif 33#endif
34 34
35/* typedefs */
36#ifdef __KERNEL__
37typedef u32 ulong32;
38typedef u64 ulong64;
39#endif
40
41#define PACKED __attribute__((packed))
42
43/* scatter/gather element */ 35/* scatter/gather element */
44typedef struct { 36typedef struct {
45 ulong32 sg_ptr; /* address */ 37 u32 sg_ptr; /* address */
46 ulong32 sg_len; /* length */ 38 u32 sg_len; /* length */
47} PACKED gdth_sg_str; 39} __attribute__((packed)) gdth_sg_str;
48 40
49/* scatter/gather element - 64bit addresses */ 41/* scatter/gather element - 64bit addresses */
50typedef struct { 42typedef struct {
51 ulong64 sg_ptr; /* address */ 43 u64 sg_ptr; /* address */
52 ulong32 sg_len; /* length */ 44 u32 sg_len; /* length */
53} PACKED gdth_sg64_str; 45} __attribute__((packed)) gdth_sg64_str;
54 46
55/* command structure */ 47/* command structure */
56typedef struct { 48typedef struct {
57 ulong32 BoardNode; /* board node (always 0) */ 49 u32 BoardNode; /* board node (always 0) */
58 ulong32 CommandIndex; /* command number */ 50 u32 CommandIndex; /* command number */
59 ushort OpCode; /* the command (READ,..) */ 51 u16 OpCode; /* the command (READ,..) */
60 union { 52 union {
61 struct { 53 struct {
62 ushort DeviceNo; /* number of cache drive */ 54 u16 DeviceNo; /* number of cache drive */
63 ulong32 BlockNo; /* block number */ 55 u32 BlockNo; /* block number */
64 ulong32 BlockCnt; /* block count */ 56 u32 BlockCnt; /* block count */
65 ulong32 DestAddr; /* dest. addr. (if s/g: -1) */ 57 u32 DestAddr; /* dest. addr. (if s/g: -1) */
66 ulong32 sg_canz; /* s/g element count */ 58 u32 sg_canz; /* s/g element count */
67 gdth_sg_str sg_lst[GDTH_MAXSG]; /* s/g list */ 59 gdth_sg_str sg_lst[GDTH_MAXSG]; /* s/g list */
68 } PACKED cache; /* cache service cmd. str. */ 60 } __attribute__((packed)) cache; /* cache service cmd. str. */
69 struct { 61 struct {
70 ushort DeviceNo; /* number of cache drive */ 62 u16 DeviceNo; /* number of cache drive */
71 ulong64 BlockNo; /* block number */ 63 u64 BlockNo; /* block number */
72 ulong32 BlockCnt; /* block count */ 64 u32 BlockCnt; /* block count */
73 ulong64 DestAddr; /* dest. addr. (if s/g: -1) */ 65 u64 DestAddr; /* dest. addr. (if s/g: -1) */
74 ulong32 sg_canz; /* s/g element count */ 66 u32 sg_canz; /* s/g element count */
75 gdth_sg64_str sg_lst[GDTH_MAXSG]; /* s/g list */ 67 gdth_sg64_str sg_lst[GDTH_MAXSG]; /* s/g list */
76 } PACKED cache64; /* cache service cmd. str. */ 68 } __attribute__((packed)) cache64; /* cache service cmd. str. */
77 struct { 69 struct {
78 ushort param_size; /* size of p_param buffer */ 70 u16 param_size; /* size of p_param buffer */
79 ulong32 subfunc; /* IOCTL function */ 71 u32 subfunc; /* IOCTL function */
80 ulong32 channel; /* device */ 72 u32 channel; /* device */
81 ulong64 p_param; /* buffer */ 73 u64 p_param; /* buffer */
82 } PACKED ioctl; /* IOCTL command structure */ 74 } __attribute__((packed)) ioctl; /* IOCTL command structure */
83 struct { 75 struct {
84 ushort reserved; 76 u16 reserved;
85 union { 77 union {
86 struct { 78 struct {
87 ulong32 msg_handle; /* message handle */ 79 u32 msg_handle; /* message handle */
88 ulong64 msg_addr; /* message buffer address */ 80 u64 msg_addr; /* message buffer address */
89 } PACKED msg; 81 } __attribute__((packed)) msg;
90 unchar data[12]; /* buffer for rtc data, ... */ 82 u8 data[12]; /* buffer for rtc data, ... */
91 } su; 83 } su;
92 } PACKED screen; /* screen service cmd. str. */ 84 } __attribute__((packed)) screen; /* screen service cmd. str. */
93 struct { 85 struct {
94 ushort reserved; 86 u16 reserved;
95 ulong32 direction; /* data direction */ 87 u32 direction; /* data direction */
96 ulong32 mdisc_time; /* disc. time (0: no timeout)*/ 88 u32 mdisc_time; /* disc. time (0: no timeout)*/
97 ulong32 mcon_time; /* connect time(0: no to.) */ 89 u32 mcon_time; /* connect time(0: no to.) */
98 ulong32 sdata; /* dest. addr. (if s/g: -1) */ 90 u32 sdata; /* dest. addr. (if s/g: -1) */
99 ulong32 sdlen; /* data length (bytes) */ 91 u32 sdlen; /* data length (bytes) */
100 ulong32 clen; /* SCSI cmd. length(6,10,12) */ 92 u32 clen; /* SCSI cmd. length(6,10,12) */
101 unchar cmd[12]; /* SCSI command */ 93 u8 cmd[12]; /* SCSI command */
102 unchar target; /* target ID */ 94 u8 target; /* target ID */
103 unchar lun; /* LUN */ 95 u8 lun; /* LUN */
104 unchar bus; /* SCSI bus number */ 96 u8 bus; /* SCSI bus number */
105 unchar priority; /* only 0 used */ 97 u8 priority; /* only 0 used */
106 ulong32 sense_len; /* sense data length */ 98 u32 sense_len; /* sense data length */
107 ulong32 sense_data; /* sense data addr. */ 99 u32 sense_data; /* sense data addr. */
108 ulong32 link_p; /* linked cmds (not supp.) */ 100 u32 link_p; /* linked cmds (not supp.) */
109 ulong32 sg_ranz; /* s/g element count */ 101 u32 sg_ranz; /* s/g element count */
110 gdth_sg_str sg_lst[GDTH_MAXSG]; /* s/g list */ 102 gdth_sg_str sg_lst[GDTH_MAXSG]; /* s/g list */
111 } PACKED raw; /* raw service cmd. struct. */ 103 } __attribute__((packed)) raw; /* raw service cmd. struct. */
112 struct { 104 struct {
113 ushort reserved; 105 u16 reserved;
114 ulong32 direction; /* data direction */ 106 u32 direction; /* data direction */
115 ulong32 mdisc_time; /* disc. time (0: no timeout)*/ 107 u32 mdisc_time; /* disc. time (0: no timeout)*/
116 ulong32 mcon_time; /* connect time(0: no to.) */ 108 u32 mcon_time; /* connect time(0: no to.) */
117 ulong64 sdata; /* dest. addr. (if s/g: -1) */ 109 u64 sdata; /* dest. addr. (if s/g: -1) */
118 ulong32 sdlen; /* data length (bytes) */ 110 u32 sdlen; /* data length (bytes) */
119 ulong32 clen; /* SCSI cmd. length(6,..,16) */ 111 u32 clen; /* SCSI cmd. length(6,..,16) */
120 unchar cmd[16]; /* SCSI command */ 112 u8 cmd[16]; /* SCSI command */
121 unchar target; /* target ID */ 113 u8 target; /* target ID */
122 unchar lun; /* LUN */ 114 u8 lun; /* LUN */
123 unchar bus; /* SCSI bus number */ 115 u8 bus; /* SCSI bus number */
124 unchar priority; /* only 0 used */ 116 u8 priority; /* only 0 used */
125 ulong32 sense_len; /* sense data length */ 117 u32 sense_len; /* sense data length */
126 ulong64 sense_data; /* sense data addr. */ 118 u64 sense_data; /* sense data addr. */
127 ulong32 sg_ranz; /* s/g element count */ 119 u32 sg_ranz; /* s/g element count */
128 gdth_sg64_str sg_lst[GDTH_MAXSG]; /* s/g list */ 120 gdth_sg64_str sg_lst[GDTH_MAXSG]; /* s/g list */
129 } PACKED raw64; /* raw service cmd. struct. */ 121 } __attribute__((packed)) raw64; /* raw service cmd. struct. */
130 } u; 122 } u;
131 /* additional variables */ 123 /* additional variables */
132 unchar Service; /* controller service */ 124 u8 Service; /* controller service */
133 unchar reserved; 125 u8 reserved;
134 ushort Status; /* command result */ 126 u16 Status; /* command result */
135 ulong32 Info; /* additional information */ 127 u32 Info; /* additional information */
136 void *RequestBuffer; /* request buffer */ 128 void *RequestBuffer; /* request buffer */
137} PACKED gdth_cmd_str; 129} __attribute__((packed)) gdth_cmd_str;
138 130
139/* controller event structure */ 131/* controller event structure */
140#define ES_ASYNC 1 132#define ES_ASYNC 1
@@ -142,129 +134,129 @@ typedef struct {
142#define ES_TEST 3 134#define ES_TEST 3
143#define ES_SYNC 4 135#define ES_SYNC 4
144typedef struct { 136typedef struct {
145 ushort size; /* size of structure */ 137 u16 size; /* size of structure */
146 union { 138 union {
147 char stream[16]; 139 char stream[16];
148 struct { 140 struct {
149 ushort ionode; 141 u16 ionode;
150 ushort service; 142 u16 service;
151 ulong32 index; 143 u32 index;
152 } PACKED driver; 144 } __attribute__((packed)) driver;
153 struct { 145 struct {
154 ushort ionode; 146 u16 ionode;
155 ushort service; 147 u16 service;
156 ushort status; 148 u16 status;
157 ulong32 info; 149 u32 info;
158 unchar scsi_coord[3]; 150 u8 scsi_coord[3];
159 } PACKED async; 151 } __attribute__((packed)) async;
160 struct { 152 struct {
161 ushort ionode; 153 u16 ionode;
162 ushort service; 154 u16 service;
163 ushort status; 155 u16 status;
164 ulong32 info; 156 u32 info;
165 ushort hostdrive; 157 u16 hostdrive;
166 unchar scsi_coord[3]; 158 u8 scsi_coord[3];
167 unchar sense_key; 159 u8 sense_key;
168 } PACKED sync; 160 } __attribute__((packed)) sync;
169 struct { 161 struct {
170 ulong32 l1, l2, l3, l4; 162 u32 l1, l2, l3, l4;
171 } PACKED test; 163 } __attribute__((packed)) test;
172 } eu; 164 } eu;
173 ulong32 severity; 165 u32 severity;
174 unchar event_string[256]; 166 u8 event_string[256];
175} PACKED gdth_evt_data; 167} __attribute__((packed)) gdth_evt_data;
176 168
177typedef struct { 169typedef struct {
178 ulong32 first_stamp; 170 u32 first_stamp;
179 ulong32 last_stamp; 171 u32 last_stamp;
180 ushort same_count; 172 u16 same_count;
181 ushort event_source; 173 u16 event_source;
182 ushort event_idx; 174 u16 event_idx;
183 unchar application; 175 u8 application;
184 unchar reserved; 176 u8 reserved;
185 gdth_evt_data event_data; 177 gdth_evt_data event_data;
186} PACKED gdth_evt_str; 178} __attribute__((packed)) gdth_evt_str;
187 179
188 180
189#ifdef GDTH_IOCTL_PROC 181#ifdef GDTH_IOCTL_PROC
190/* IOCTL structure (write) */ 182/* IOCTL structure (write) */
191typedef struct { 183typedef struct {
192 ulong32 magic; /* IOCTL magic */ 184 u32 magic; /* IOCTL magic */
193 ushort ioctl; /* IOCTL */ 185 u16 ioctl; /* IOCTL */
194 ushort ionode; /* controller number */ 186 u16 ionode; /* controller number */
195 ushort service; /* controller service */ 187 u16 service; /* controller service */
196 ushort timeout; /* timeout */ 188 u16 timeout; /* timeout */
197 union { 189 union {
198 struct { 190 struct {
199 unchar command[512]; /* controller command */ 191 u8 command[512]; /* controller command */
200 unchar data[1]; /* add. data */ 192 u8 data[1]; /* add. data */
201 } general; 193 } general;
202 struct { 194 struct {
203 unchar lock; /* lock/unlock */ 195 u8 lock; /* lock/unlock */
204 unchar drive_cnt; /* drive count */ 196 u8 drive_cnt; /* drive count */
205 ushort drives[MAX_HDRIVES];/* drives */ 197 u16 drives[MAX_HDRIVES];/* drives */
206 } lockdrv; 198 } lockdrv;
207 struct { 199 struct {
208 unchar lock; /* lock/unlock */ 200 u8 lock; /* lock/unlock */
209 unchar channel; /* channel */ 201 u8 channel; /* channel */
210 } lockchn; 202 } lockchn;
211 struct { 203 struct {
212 int erase; /* erase event ? */ 204 int erase; /* erase event ? */
213 int handle; 205 int handle;
214 unchar evt[EVENT_SIZE]; /* event structure */ 206 u8 evt[EVENT_SIZE]; /* event structure */
215 } event; 207 } event;
216 struct { 208 struct {
217 unchar bus; /* SCSI bus */ 209 u8 bus; /* SCSI bus */
218 unchar target; /* target ID */ 210 u8 target; /* target ID */
219 unchar lun; /* LUN */ 211 u8 lun; /* LUN */
220 unchar cmd_len; /* command length */ 212 u8 cmd_len; /* command length */
221 unchar cmd[12]; /* SCSI command */ 213 u8 cmd[12]; /* SCSI command */
222 } scsi; 214 } scsi;
223 struct { 215 struct {
224 ushort hdr_no; /* host drive number */ 216 u16 hdr_no; /* host drive number */
225 unchar flag; /* old meth./add/remove */ 217 u8 flag; /* old meth./add/remove */
226 } rescan; 218 } rescan;
227 } iu; 219 } iu;
228} gdth_iowr_str; 220} gdth_iowr_str;
229 221
230/* IOCTL structure (read) */ 222/* IOCTL structure (read) */
231typedef struct { 223typedef struct {
232 ulong32 size; /* buffer size */ 224 u32 size; /* buffer size */
233 ulong32 status; /* IOCTL error code */ 225 u32 status; /* IOCTL error code */
234 union { 226 union {
235 struct { 227 struct {
236 unchar data[1]; /* data */ 228 u8 data[1]; /* data */
237 } general; 229 } general;
238 struct { 230 struct {
239 ushort version; /* driver version */ 231 u16 version; /* driver version */
240 } drvers; 232 } drvers;
241 struct { 233 struct {
242 unchar type; /* controller type */ 234 u8 type; /* controller type */
243 ushort info; /* slot etc. */ 235 u16 info; /* slot etc. */
244 ushort oem_id; /* OEM ID */ 236 u16 oem_id; /* OEM ID */
245 ushort bios_ver; /* not used */ 237 u16 bios_ver; /* not used */
246 ushort access; /* not used */ 238 u16 access; /* not used */
247 ushort ext_type; /* extended type */ 239 u16 ext_type; /* extended type */
248 ushort device_id; /* device ID */ 240 u16 device_id; /* device ID */
249 ushort sub_device_id; /* sub device ID */ 241 u16 sub_device_id; /* sub device ID */
250 } ctrtype; 242 } ctrtype;
251 struct { 243 struct {
252 unchar version; /* OS version */ 244 u8 version; /* OS version */
253 unchar subversion; /* OS subversion */ 245 u8 subversion; /* OS subversion */
254 ushort revision; /* revision */ 246 u16 revision; /* revision */
255 } osvers; 247 } osvers;
256 struct { 248 struct {
257 ushort count; /* controller count */ 249 u16 count; /* controller count */
258 } ctrcnt; 250 } ctrcnt;
259 struct { 251 struct {
260 int handle; 252 int handle;
261 unchar evt[EVENT_SIZE]; /* event structure */ 253 u8 evt[EVENT_SIZE]; /* event structure */
262 } event; 254 } event;
263 struct { 255 struct {
264 unchar bus; /* SCSI bus, 0xff: invalid */ 256 u8 bus; /* SCSI bus, 0xff: invalid */
265 unchar target; /* target ID */ 257 u8 target; /* target ID */
266 unchar lun; /* LUN */ 258 u8 lun; /* LUN */
267 unchar cluster_type; /* cluster properties */ 259 u8 cluster_type; /* cluster properties */
268 } hdr_list[MAX_HDRIVES]; /* index is host drive number */ 260 } hdr_list[MAX_HDRIVES]; /* index is host drive number */
269 } iu; 261 } iu;
270} gdth_iord_str; 262} gdth_iord_str;
@@ -272,53 +264,53 @@ typedef struct {
272 264
273/* GDTIOCTL_GENERAL */ 265/* GDTIOCTL_GENERAL */
274typedef struct { 266typedef struct {
275 ushort ionode; /* controller number */ 267 u16 ionode; /* controller number */
276 ushort timeout; /* timeout */ 268 u16 timeout; /* timeout */
277 ulong32 info; /* error info */ 269 u32 info; /* error info */
278 ushort status; /* status */ 270 u16 status; /* status */
279 ulong data_len; /* data buffer size */ 271 unsigned long data_len; /* data buffer size */
280 ulong sense_len; /* sense buffer size */ 272 unsigned long sense_len; /* sense buffer size */
281 gdth_cmd_str command; /* command */ 273 gdth_cmd_str command; /* command */
282} gdth_ioctl_general; 274} gdth_ioctl_general;
283 275
284/* GDTIOCTL_LOCKDRV */ 276/* GDTIOCTL_LOCKDRV */
285typedef struct { 277typedef struct {
286 ushort ionode; /* controller number */ 278 u16 ionode; /* controller number */
287 unchar lock; /* lock/unlock */ 279 u8 lock; /* lock/unlock */
288 unchar drive_cnt; /* drive count */ 280 u8 drive_cnt; /* drive count */
289 ushort drives[MAX_HDRIVES]; /* drives */ 281 u16 drives[MAX_HDRIVES]; /* drives */
290} gdth_ioctl_lockdrv; 282} gdth_ioctl_lockdrv;
291 283
292/* GDTIOCTL_LOCKCHN */ 284/* GDTIOCTL_LOCKCHN */
293typedef struct { 285typedef struct {
294 ushort ionode; /* controller number */ 286 u16 ionode; /* controller number */
295 unchar lock; /* lock/unlock */ 287 u8 lock; /* lock/unlock */
296 unchar channel; /* channel */ 288 u8 channel; /* channel */
297} gdth_ioctl_lockchn; 289} gdth_ioctl_lockchn;
298 290
299/* GDTIOCTL_OSVERS */ 291/* GDTIOCTL_OSVERS */
300typedef struct { 292typedef struct {
301 unchar version; /* OS version */ 293 u8 version; /* OS version */
302 unchar subversion; /* OS subversion */ 294 u8 subversion; /* OS subversion */
303 ushort revision; /* revision */ 295 u16 revision; /* revision */
304} gdth_ioctl_osvers; 296} gdth_ioctl_osvers;
305 297
306/* GDTIOCTL_CTRTYPE */ 298/* GDTIOCTL_CTRTYPE */
307typedef struct { 299typedef struct {
308 ushort ionode; /* controller number */ 300 u16 ionode; /* controller number */
309 unchar type; /* controller type */ 301 u8 type; /* controller type */
310 ushort info; /* slot etc. */ 302 u16 info; /* slot etc. */
311 ushort oem_id; /* OEM ID */ 303 u16 oem_id; /* OEM ID */
312 ushort bios_ver; /* not used */ 304 u16 bios_ver; /* not used */
313 ushort access; /* not used */ 305 u16 access; /* not used */
314 ushort ext_type; /* extended type */ 306 u16 ext_type; /* extended type */
315 ushort device_id; /* device ID */ 307 u16 device_id; /* device ID */
316 ushort sub_device_id; /* sub device ID */ 308 u16 sub_device_id; /* sub device ID */
317} gdth_ioctl_ctrtype; 309} gdth_ioctl_ctrtype;
318 310
319/* GDTIOCTL_EVENT */ 311/* GDTIOCTL_EVENT */
320typedef struct { 312typedef struct {
321 ushort ionode; 313 u16 ionode;
322 int erase; /* erase event? */ 314 int erase; /* erase event? */
323 int handle; /* event handle */ 315 int handle; /* event handle */
324 gdth_evt_str event; 316 gdth_evt_str event;
@@ -326,22 +318,22 @@ typedef struct {
326 318
327/* GDTIOCTL_RESCAN/GDTIOCTL_HDRLIST */ 319/* GDTIOCTL_RESCAN/GDTIOCTL_HDRLIST */
328typedef struct { 320typedef struct {
329 ushort ionode; /* controller number */ 321 u16 ionode; /* controller number */
330 unchar flag; /* add/remove */ 322 u8 flag; /* add/remove */
331 ushort hdr_no; /* drive no. */ 323 u16 hdr_no; /* drive no. */
332 struct { 324 struct {
333 unchar bus; /* SCSI bus */ 325 u8 bus; /* SCSI bus */
334 unchar target; /* target ID */ 326 u8 target; /* target ID */
335 unchar lun; /* LUN */ 327 u8 lun; /* LUN */
336 unchar cluster_type; /* cluster properties */ 328 u8 cluster_type; /* cluster properties */
337 } hdr_list[MAX_HDRIVES]; /* index is host drive number */ 329 } hdr_list[MAX_HDRIVES]; /* index is host drive number */
338} gdth_ioctl_rescan; 330} gdth_ioctl_rescan;
339 331
340/* GDTIOCTL_RESET_BUS/GDTIOCTL_RESET_DRV */ 332/* GDTIOCTL_RESET_BUS/GDTIOCTL_RESET_DRV */
341typedef struct { 333typedef struct {
342 ushort ionode; /* controller number */ 334 u16 ionode; /* controller number */
343 ushort number; /* bus/host drive number */ 335 u16 number; /* bus/host drive number */
344 ushort status; /* status */ 336 u16 status; /* status */
345} gdth_ioctl_reset; 337} gdth_ioctl_reset;
346 338
347#endif 339#endif