diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2008-03-31 05:15:28 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-04-07 13:19:09 -0400 |
commit | 2b604c9b909ce1c98e51208eee2f70ee3e604079 (patch) | |
tree | 46a0a34dd2233b33cfbebb73d1d7c3b3c279ce21 /drivers/s390/scsi | |
parent | a9c857757ea09b63040bba7ab149557ac2bfb274 (diff) |
[SCSI] zfcp: Move DBF definitions to private header file
Unclutter the global zfcp_def.h header. Move everything required to
call into the debug feature to a new header file.
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/scsi')
-rw-r--r-- | drivers/s390/scsi/zfcp_dbf.h | 233 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_def.h | 210 |
2 files changed, 234 insertions, 209 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.h b/drivers/s390/scsi/zfcp_dbf.h new file mode 100644 index 000000000000..5d88c01d5981 --- /dev/null +++ b/drivers/s390/scsi/zfcp_dbf.h | |||
@@ -0,0 +1,233 @@ | |||
1 | /* | ||
2 | * This file is part of the zfcp device driver for | ||
3 | * FCP adapters for IBM System z9 and zSeries. | ||
4 | * | ||
5 | * Copyright IBM Corp. 2008, 2008 | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2, or (at your option) | ||
10 | * any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef ZFCP_DBF_H | ||
23 | #define ZFCP_DBF_H | ||
24 | |||
25 | #include "zfcp_fsf.h" | ||
26 | |||
27 | #define ZFCP_DBF_TAG_SIZE 4 | ||
28 | |||
29 | struct zfcp_dbf_dump { | ||
30 | u8 tag[ZFCP_DBF_TAG_SIZE]; | ||
31 | u32 total_size; /* size of total dump data */ | ||
32 | u32 offset; /* how much data has being already dumped */ | ||
33 | u32 size; /* how much data comes with this record */ | ||
34 | u8 data[]; /* dump data */ | ||
35 | } __attribute__ ((packed)); | ||
36 | |||
37 | struct zfcp_rec_dbf_record_thread { | ||
38 | u32 sema; | ||
39 | u32 total; | ||
40 | u32 ready; | ||
41 | u32 running; | ||
42 | } __attribute__ ((packed)); | ||
43 | |||
44 | struct zfcp_rec_dbf_record_target { | ||
45 | u64 ref; | ||
46 | u32 status; | ||
47 | u32 d_id; | ||
48 | u64 wwpn; | ||
49 | u64 fcp_lun; | ||
50 | u32 erp_count; | ||
51 | } __attribute__ ((packed)); | ||
52 | |||
53 | struct zfcp_rec_dbf_record_trigger { | ||
54 | u8 want; | ||
55 | u8 need; | ||
56 | u32 as; | ||
57 | u32 ps; | ||
58 | u32 us; | ||
59 | u64 ref; | ||
60 | u64 action; | ||
61 | u64 wwpn; | ||
62 | u64 fcp_lun; | ||
63 | } __attribute__ ((packed)); | ||
64 | |||
65 | struct zfcp_rec_dbf_record_action { | ||
66 | u32 status; | ||
67 | u32 step; | ||
68 | u64 action; | ||
69 | u64 fsf_req; | ||
70 | } __attribute__ ((packed)); | ||
71 | |||
72 | struct zfcp_rec_dbf_record { | ||
73 | u8 id; | ||
74 | u8 id2; | ||
75 | union { | ||
76 | struct zfcp_rec_dbf_record_action action; | ||
77 | struct zfcp_rec_dbf_record_thread thread; | ||
78 | struct zfcp_rec_dbf_record_target target; | ||
79 | struct zfcp_rec_dbf_record_trigger trigger; | ||
80 | } u; | ||
81 | } __attribute__ ((packed)); | ||
82 | |||
83 | enum { | ||
84 | ZFCP_REC_DBF_ID_ACTION, | ||
85 | ZFCP_REC_DBF_ID_THREAD, | ||
86 | ZFCP_REC_DBF_ID_TARGET, | ||
87 | ZFCP_REC_DBF_ID_TRIGGER, | ||
88 | }; | ||
89 | |||
90 | struct zfcp_hba_dbf_record_response { | ||
91 | u32 fsf_command; | ||
92 | u64 fsf_reqid; | ||
93 | u32 fsf_seqno; | ||
94 | u64 fsf_issued; | ||
95 | u32 fsf_prot_status; | ||
96 | u32 fsf_status; | ||
97 | u8 fsf_prot_status_qual[FSF_PROT_STATUS_QUAL_SIZE]; | ||
98 | u8 fsf_status_qual[FSF_STATUS_QUALIFIER_SIZE]; | ||
99 | u32 fsf_req_status; | ||
100 | u8 sbal_first; | ||
101 | u8 sbal_curr; | ||
102 | u8 sbal_last; | ||
103 | u8 pool; | ||
104 | u64 erp_action; | ||
105 | union { | ||
106 | struct { | ||
107 | u64 scsi_cmnd; | ||
108 | u64 scsi_serial; | ||
109 | } send_fcp; | ||
110 | struct { | ||
111 | u64 wwpn; | ||
112 | u32 d_id; | ||
113 | u32 port_handle; | ||
114 | } port; | ||
115 | struct { | ||
116 | u64 wwpn; | ||
117 | u64 fcp_lun; | ||
118 | u32 port_handle; | ||
119 | u32 lun_handle; | ||
120 | } unit; | ||
121 | struct { | ||
122 | u32 d_id; | ||
123 | u8 ls_code; | ||
124 | } send_els; | ||
125 | } data; | ||
126 | } __attribute__ ((packed)); | ||
127 | |||
128 | struct zfcp_hba_dbf_record_status { | ||
129 | u8 failed; | ||
130 | u32 status_type; | ||
131 | u32 status_subtype; | ||
132 | struct fsf_queue_designator | ||
133 | queue_designator; | ||
134 | u32 payload_size; | ||
135 | #define ZFCP_DBF_UNSOL_PAYLOAD 80 | ||
136 | #define ZFCP_DBF_UNSOL_PAYLOAD_SENSE_DATA_AVAIL 32 | ||
137 | #define ZFCP_DBF_UNSOL_PAYLOAD_BIT_ERROR_THRESHOLD 56 | ||
138 | #define ZFCP_DBF_UNSOL_PAYLOAD_FEATURE_UPDATE_ALERT 2 * sizeof(u32) | ||
139 | u8 payload[ZFCP_DBF_UNSOL_PAYLOAD]; | ||
140 | } __attribute__ ((packed)); | ||
141 | |||
142 | struct zfcp_hba_dbf_record_qdio { | ||
143 | u32 status; | ||
144 | u32 qdio_error; | ||
145 | u32 siga_error; | ||
146 | u8 sbal_index; | ||
147 | u8 sbal_count; | ||
148 | } __attribute__ ((packed)); | ||
149 | |||
150 | struct zfcp_hba_dbf_record { | ||
151 | u8 tag[ZFCP_DBF_TAG_SIZE]; | ||
152 | u8 tag2[ZFCP_DBF_TAG_SIZE]; | ||
153 | union { | ||
154 | struct zfcp_hba_dbf_record_response response; | ||
155 | struct zfcp_hba_dbf_record_status status; | ||
156 | struct zfcp_hba_dbf_record_qdio qdio; | ||
157 | } type; | ||
158 | } __attribute__ ((packed)); | ||
159 | |||
160 | struct zfcp_san_dbf_record_ct { | ||
161 | union { | ||
162 | struct { | ||
163 | u16 cmd_req_code; | ||
164 | u8 revision; | ||
165 | u8 gs_type; | ||
166 | u8 gs_subtype; | ||
167 | u8 options; | ||
168 | u16 max_res_size; | ||
169 | } request; | ||
170 | struct { | ||
171 | u16 cmd_rsp_code; | ||
172 | u8 revision; | ||
173 | u8 reason_code; | ||
174 | u8 reason_code_expl; | ||
175 | u8 vendor_unique; | ||
176 | } response; | ||
177 | } type; | ||
178 | u32 payload_size; | ||
179 | #define ZFCP_DBF_CT_PAYLOAD 24 | ||
180 | u8 payload[ZFCP_DBF_CT_PAYLOAD]; | ||
181 | } __attribute__ ((packed)); | ||
182 | |||
183 | struct zfcp_san_dbf_record_els { | ||
184 | u8 ls_code; | ||
185 | u32 payload_size; | ||
186 | #define ZFCP_DBF_ELS_PAYLOAD 32 | ||
187 | #define ZFCP_DBF_ELS_MAX_PAYLOAD 1024 | ||
188 | u8 payload[ZFCP_DBF_ELS_PAYLOAD]; | ||
189 | } __attribute__ ((packed)); | ||
190 | |||
191 | struct zfcp_san_dbf_record { | ||
192 | u8 tag[ZFCP_DBF_TAG_SIZE]; | ||
193 | u64 fsf_reqid; | ||
194 | u32 fsf_seqno; | ||
195 | u32 s_id; | ||
196 | u32 d_id; | ||
197 | union { | ||
198 | struct zfcp_san_dbf_record_ct ct; | ||
199 | struct zfcp_san_dbf_record_els els; | ||
200 | } type; | ||
201 | } __attribute__ ((packed)); | ||
202 | |||
203 | struct zfcp_scsi_dbf_record { | ||
204 | u8 tag[ZFCP_DBF_TAG_SIZE]; | ||
205 | u8 tag2[ZFCP_DBF_TAG_SIZE]; | ||
206 | u32 scsi_id; | ||
207 | u32 scsi_lun; | ||
208 | u32 scsi_result; | ||
209 | u64 scsi_cmnd; | ||
210 | u64 scsi_serial; | ||
211 | #define ZFCP_DBF_SCSI_OPCODE 16 | ||
212 | u8 scsi_opcode[ZFCP_DBF_SCSI_OPCODE]; | ||
213 | u8 scsi_retries; | ||
214 | u8 scsi_allowed; | ||
215 | u64 fsf_reqid; | ||
216 | u32 fsf_seqno; | ||
217 | u64 fsf_issued; | ||
218 | union { | ||
219 | u64 old_fsf_reqid; | ||
220 | struct { | ||
221 | u8 rsp_validity; | ||
222 | u8 rsp_scsi_status; | ||
223 | u32 rsp_resid; | ||
224 | u8 rsp_code; | ||
225 | #define ZFCP_DBF_SCSI_FCP_SNS_INFO 16 | ||
226 | #define ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO 256 | ||
227 | u32 sns_info_len; | ||
228 | u8 sns_info[ZFCP_DBF_SCSI_FCP_SNS_INFO]; | ||
229 | } fcp; | ||
230 | } type; | ||
231 | } __attribute__ ((packed)); | ||
232 | |||
233 | #endif /* ZFCP_DBF_H */ | ||
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 85c0488719f7..ac23be50fd74 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <asm/qdio.h> | 47 | #include <asm/qdio.h> |
48 | #include <asm/debug.h> | 48 | #include <asm/debug.h> |
49 | #include <asm/ebcdic.h> | 49 | #include <asm/ebcdic.h> |
50 | #include "zfcp_dbf.h" | ||
50 | #include "zfcp_fsf.h" | 51 | #include "zfcp_fsf.h" |
51 | 52 | ||
52 | 53 | ||
@@ -262,215 +263,6 @@ struct fcp_logo { | |||
262 | } __attribute__((packed)); | 263 | } __attribute__((packed)); |
263 | 264 | ||
264 | /* | 265 | /* |
265 | * DBF stuff | ||
266 | */ | ||
267 | #define ZFCP_DBF_TAG_SIZE 4 | ||
268 | |||
269 | struct zfcp_dbf_dump { | ||
270 | u8 tag[ZFCP_DBF_TAG_SIZE]; | ||
271 | u32 total_size; /* size of total dump data */ | ||
272 | u32 offset; /* how much data has being already dumped */ | ||
273 | u32 size; /* how much data comes with this record */ | ||
274 | u8 data[]; /* dump data */ | ||
275 | } __attribute__ ((packed)); | ||
276 | |||
277 | struct zfcp_rec_dbf_record_thread { | ||
278 | u32 sema; | ||
279 | u32 total; | ||
280 | u32 ready; | ||
281 | u32 running; | ||
282 | } __attribute__ ((packed)); | ||
283 | |||
284 | struct zfcp_rec_dbf_record_target { | ||
285 | u64 ref; | ||
286 | u32 status; | ||
287 | u32 d_id; | ||
288 | u64 wwpn; | ||
289 | u64 fcp_lun; | ||
290 | u32 erp_count; | ||
291 | } __attribute__ ((packed)); | ||
292 | |||
293 | struct zfcp_rec_dbf_record_trigger { | ||
294 | u8 want; | ||
295 | u8 need; | ||
296 | u32 as; | ||
297 | u32 ps; | ||
298 | u32 us; | ||
299 | u64 ref; | ||
300 | u64 action; | ||
301 | u64 wwpn; | ||
302 | u64 fcp_lun; | ||
303 | } __attribute__ ((packed)); | ||
304 | |||
305 | struct zfcp_rec_dbf_record_action { | ||
306 | u32 status; | ||
307 | u32 step; | ||
308 | u64 action; | ||
309 | u64 fsf_req; | ||
310 | } __attribute__ ((packed)); | ||
311 | |||
312 | struct zfcp_rec_dbf_record { | ||
313 | u8 id; | ||
314 | u8 id2; | ||
315 | union { | ||
316 | struct zfcp_rec_dbf_record_action action; | ||
317 | struct zfcp_rec_dbf_record_thread thread; | ||
318 | struct zfcp_rec_dbf_record_target target; | ||
319 | struct zfcp_rec_dbf_record_trigger trigger; | ||
320 | } u; | ||
321 | } __attribute__ ((packed)); | ||
322 | |||
323 | enum { | ||
324 | ZFCP_REC_DBF_ID_ACTION, | ||
325 | ZFCP_REC_DBF_ID_THREAD, | ||
326 | ZFCP_REC_DBF_ID_TARGET, | ||
327 | ZFCP_REC_DBF_ID_TRIGGER, | ||
328 | }; | ||
329 | |||
330 | struct zfcp_hba_dbf_record_response { | ||
331 | u32 fsf_command; | ||
332 | u64 fsf_reqid; | ||
333 | u32 fsf_seqno; | ||
334 | u64 fsf_issued; | ||
335 | u32 fsf_prot_status; | ||
336 | u32 fsf_status; | ||
337 | u8 fsf_prot_status_qual[FSF_PROT_STATUS_QUAL_SIZE]; | ||
338 | u8 fsf_status_qual[FSF_STATUS_QUALIFIER_SIZE]; | ||
339 | u32 fsf_req_status; | ||
340 | u8 sbal_first; | ||
341 | u8 sbal_curr; | ||
342 | u8 sbal_last; | ||
343 | u8 pool; | ||
344 | u64 erp_action; | ||
345 | union { | ||
346 | struct { | ||
347 | u64 scsi_cmnd; | ||
348 | u64 scsi_serial; | ||
349 | } send_fcp; | ||
350 | struct { | ||
351 | u64 wwpn; | ||
352 | u32 d_id; | ||
353 | u32 port_handle; | ||
354 | } port; | ||
355 | struct { | ||
356 | u64 wwpn; | ||
357 | u64 fcp_lun; | ||
358 | u32 port_handle; | ||
359 | u32 lun_handle; | ||
360 | } unit; | ||
361 | struct { | ||
362 | u32 d_id; | ||
363 | u8 ls_code; | ||
364 | } send_els; | ||
365 | } data; | ||
366 | } __attribute__ ((packed)); | ||
367 | |||
368 | struct zfcp_hba_dbf_record_status { | ||
369 | u8 failed; | ||
370 | u32 status_type; | ||
371 | u32 status_subtype; | ||
372 | struct fsf_queue_designator | ||
373 | queue_designator; | ||
374 | u32 payload_size; | ||
375 | #define ZFCP_DBF_UNSOL_PAYLOAD 80 | ||
376 | #define ZFCP_DBF_UNSOL_PAYLOAD_SENSE_DATA_AVAIL 32 | ||
377 | #define ZFCP_DBF_UNSOL_PAYLOAD_BIT_ERROR_THRESHOLD 56 | ||
378 | #define ZFCP_DBF_UNSOL_PAYLOAD_FEATURE_UPDATE_ALERT 2 * sizeof(u32) | ||
379 | u8 payload[ZFCP_DBF_UNSOL_PAYLOAD]; | ||
380 | } __attribute__ ((packed)); | ||
381 | |||
382 | struct zfcp_hba_dbf_record_qdio { | ||
383 | u32 status; | ||
384 | u32 qdio_error; | ||
385 | u32 siga_error; | ||
386 | u8 sbal_index; | ||
387 | u8 sbal_count; | ||
388 | } __attribute__ ((packed)); | ||
389 | |||
390 | struct zfcp_hba_dbf_record { | ||
391 | u8 tag[ZFCP_DBF_TAG_SIZE]; | ||
392 | u8 tag2[ZFCP_DBF_TAG_SIZE]; | ||
393 | union { | ||
394 | struct zfcp_hba_dbf_record_response response; | ||
395 | struct zfcp_hba_dbf_record_status status; | ||
396 | struct zfcp_hba_dbf_record_qdio qdio; | ||
397 | } type; | ||
398 | } __attribute__ ((packed)); | ||
399 | |||
400 | struct zfcp_san_dbf_record_ct { | ||
401 | union { | ||
402 | struct { | ||
403 | u16 cmd_req_code; | ||
404 | u8 revision; | ||
405 | u8 gs_type; | ||
406 | u8 gs_subtype; | ||
407 | u8 options; | ||
408 | u16 max_res_size; | ||
409 | } request; | ||
410 | struct { | ||
411 | u16 cmd_rsp_code; | ||
412 | u8 revision; | ||
413 | u8 reason_code; | ||
414 | u8 reason_code_expl; | ||
415 | u8 vendor_unique; | ||
416 | } response; | ||
417 | } type; | ||
418 | u32 payload_size; | ||
419 | #define ZFCP_DBF_CT_PAYLOAD 24 | ||
420 | u8 payload[ZFCP_DBF_CT_PAYLOAD]; | ||
421 | } __attribute__ ((packed)); | ||
422 | |||
423 | struct zfcp_san_dbf_record_els { | ||
424 | u8 ls_code; | ||
425 | u32 payload_size; | ||
426 | #define ZFCP_DBF_ELS_PAYLOAD 32 | ||
427 | #define ZFCP_DBF_ELS_MAX_PAYLOAD 1024 | ||
428 | u8 payload[ZFCP_DBF_ELS_PAYLOAD]; | ||
429 | } __attribute__ ((packed)); | ||
430 | |||
431 | struct zfcp_san_dbf_record { | ||
432 | u8 tag[ZFCP_DBF_TAG_SIZE]; | ||
433 | u64 fsf_reqid; | ||
434 | u32 fsf_seqno; | ||
435 | u32 s_id; | ||
436 | u32 d_id; | ||
437 | union { | ||
438 | struct zfcp_san_dbf_record_ct ct; | ||
439 | struct zfcp_san_dbf_record_els els; | ||
440 | } type; | ||
441 | } __attribute__ ((packed)); | ||
442 | |||
443 | struct zfcp_scsi_dbf_record { | ||
444 | u8 tag[ZFCP_DBF_TAG_SIZE]; | ||
445 | u8 tag2[ZFCP_DBF_TAG_SIZE]; | ||
446 | u32 scsi_id; | ||
447 | u32 scsi_lun; | ||
448 | u32 scsi_result; | ||
449 | u64 scsi_cmnd; | ||
450 | u64 scsi_serial; | ||
451 | #define ZFCP_DBF_SCSI_OPCODE 16 | ||
452 | u8 scsi_opcode[ZFCP_DBF_SCSI_OPCODE]; | ||
453 | u8 scsi_retries; | ||
454 | u8 scsi_allowed; | ||
455 | u64 fsf_reqid; | ||
456 | u32 fsf_seqno; | ||
457 | u64 fsf_issued; | ||
458 | union { | ||
459 | u64 old_fsf_reqid; | ||
460 | struct { | ||
461 | u8 rsp_validity; | ||
462 | u8 rsp_scsi_status; | ||
463 | u32 rsp_resid; | ||
464 | u8 rsp_code; | ||
465 | #define ZFCP_DBF_SCSI_FCP_SNS_INFO 16 | ||
466 | #define ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO 256 | ||
467 | u32 sns_info_len; | ||
468 | u8 sns_info[ZFCP_DBF_SCSI_FCP_SNS_INFO]; | ||
469 | } fcp; | ||
470 | } type; | ||
471 | } __attribute__ ((packed)); | ||
472 | |||
473 | /* | ||
474 | * FC-FS stuff | 266 | * FC-FS stuff |
475 | */ | 267 | */ |
476 | #define R_A_TOV 10 /* seconds */ | 268 | #define R_A_TOV 10 /* seconds */ |