diff options
author | Swen Schillig <swen@vnet.ibm.com> | 2009-08-18 09:43:21 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-09-05 09:49:30 -0400 |
commit | 5771710bd5edfafcb8656f49b93690a6fae5a4d2 (patch) | |
tree | f7ca88bc0f3d780794aa564855c0ed0ddeb9af18 /drivers/s390/scsi | |
parent | 799b76d09aeee558d18c1f5b93e63f58f1d1fc11 (diff) |
[SCSI] zfcp: Update dbf calls
Change the dbf data and functions to use the zfcp_dbf prefix
throughout the code. Also change the calls to dbf to use zfcp_dbf
instead of zfcp_adapter.
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi')
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 7 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_dbf.c | 408 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_dbf.h | 152 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 49 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_ext.h | 52 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fc.c | 2 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 24 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_qdio.c | 6 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_scsi.c | 27 |
9 files changed, 347 insertions, 380 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 572dcd67e71..7a50f64c36b 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
@@ -517,6 +517,7 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device) | |||
517 | goto qdio_mem_failed; | 517 | goto qdio_mem_failed; |
518 | 518 | ||
519 | adapter->qdio->adapter = adapter; | 519 | adapter->qdio->adapter = adapter; |
520 | |||
520 | ccw_device->handler = NULL; | 521 | ccw_device->handler = NULL; |
521 | adapter->ccw_device = ccw_device; | 522 | adapter->ccw_device = ccw_device; |
522 | atomic_set(&adapter->refcount, 0); | 523 | atomic_set(&adapter->refcount, 0); |
@@ -530,7 +531,7 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device) | |||
530 | if (zfcp_reqlist_alloc(adapter)) | 531 | if (zfcp_reqlist_alloc(adapter)) |
531 | goto failed_low_mem_buffers; | 532 | goto failed_low_mem_buffers; |
532 | 533 | ||
533 | if (zfcp_adapter_debug_register(adapter)) | 534 | if (zfcp_dbf_adapter_register(adapter)) |
534 | goto debug_register_failed; | 535 | goto debug_register_failed; |
535 | 536 | ||
536 | if (zfcp_setup_adapter_work_queue(adapter)) | 537 | if (zfcp_setup_adapter_work_queue(adapter)) |
@@ -577,7 +578,7 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device) | |||
577 | sysfs_failed: | 578 | sysfs_failed: |
578 | zfcp_destroy_adapter_work_queue(adapter); | 579 | zfcp_destroy_adapter_work_queue(adapter); |
579 | work_queue_failed: | 580 | work_queue_failed: |
580 | zfcp_adapter_debug_unregister(adapter); | 581 | zfcp_dbf_adapter_unregister(adapter->dbf); |
581 | debug_register_failed: | 582 | debug_register_failed: |
582 | dev_set_drvdata(&ccw_device->dev, NULL); | 583 | dev_set_drvdata(&ccw_device->dev, NULL); |
583 | kfree(adapter->req_list); | 584 | kfree(adapter->req_list); |
@@ -616,7 +617,7 @@ void zfcp_adapter_dequeue(struct zfcp_adapter *adapter) | |||
616 | return; | 617 | return; |
617 | 618 | ||
618 | zfcp_destroy_adapter_work_queue(adapter); | 619 | zfcp_destroy_adapter_work_queue(adapter); |
619 | zfcp_adapter_debug_unregister(adapter); | 620 | zfcp_dbf_adapter_unregister(adapter->dbf); |
620 | zfcp_qdio_free(adapter->qdio); | 621 | zfcp_qdio_free(adapter->qdio); |
621 | zfcp_free_low_mem_buffers(adapter); | 622 | zfcp_free_low_mem_buffers(adapter); |
622 | kfree(adapter->req_list); | 623 | kfree(adapter->req_list); |
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 3179b08bda6..c066428b287 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c | |||
@@ -120,9 +120,9 @@ static int zfcp_dbf_view_header(debug_info_t *id, struct debug_view *view, | |||
120 | return p - out_buf; | 120 | return p - out_buf; |
121 | } | 121 | } |
122 | 122 | ||
123 | void _zfcp_hba_dbf_event_fsf_response(const char *tag2, int level, | 123 | void _zfcp_dbf_hba_fsf_response(const char *tag2, int level, |
124 | struct zfcp_fsf_req *fsf_req, | 124 | struct zfcp_fsf_req *fsf_req, |
125 | struct zfcp_dbf *dbf) | 125 | struct zfcp_dbf *dbf) |
126 | { | 126 | { |
127 | struct fsf_qtcb *qtcb = fsf_req->qtcb; | 127 | struct fsf_qtcb *qtcb = fsf_req->qtcb; |
128 | union fsf_prot_status_qual *prot_status_qual = | 128 | union fsf_prot_status_qual *prot_status_qual = |
@@ -132,11 +132,11 @@ void _zfcp_hba_dbf_event_fsf_response(const char *tag2, int level, | |||
132 | struct zfcp_port *port; | 132 | struct zfcp_port *port; |
133 | struct zfcp_unit *unit; | 133 | struct zfcp_unit *unit; |
134 | struct zfcp_send_els *send_els; | 134 | struct zfcp_send_els *send_els; |
135 | struct zfcp_hba_dbf_record *rec = &dbf->hba_dbf_buf; | 135 | struct zfcp_dbf_hba_record *rec = &dbf->hba_buf; |
136 | struct zfcp_hba_dbf_record_response *response = &rec->u.response; | 136 | struct zfcp_dbf_hba_record_response *response = &rec->u.response; |
137 | unsigned long flags; | 137 | unsigned long flags; |
138 | 138 | ||
139 | spin_lock_irqsave(&dbf->hba_dbf_lock, flags); | 139 | spin_lock_irqsave(&dbf->hba_lock, flags); |
140 | memset(rec, 0, sizeof(*rec)); | 140 | memset(rec, 0, sizeof(*rec)); |
141 | strncpy(rec->tag, "resp", ZFCP_DBF_TAG_SIZE); | 141 | strncpy(rec->tag, "resp", ZFCP_DBF_TAG_SIZE); |
142 | strncpy(rec->tag2, tag2, ZFCP_DBF_TAG_SIZE); | 142 | strncpy(rec->tag2, tag2, ZFCP_DBF_TAG_SIZE); |
@@ -203,7 +203,7 @@ void _zfcp_hba_dbf_event_fsf_response(const char *tag2, int level, | |||
203 | break; | 203 | break; |
204 | } | 204 | } |
205 | 205 | ||
206 | debug_event(dbf->hba_dbf, level, rec, sizeof(*rec)); | 206 | debug_event(dbf->hba, level, rec, sizeof(*rec)); |
207 | 207 | ||
208 | /* have fcp channel microcode fixed to use as little as possible */ | 208 | /* have fcp channel microcode fixed to use as little as possible */ |
209 | if (fsf_req->fsf_command != FSF_QTCB_FCP_CMND) { | 209 | if (fsf_req->fsf_command != FSF_QTCB_FCP_CMND) { |
@@ -211,27 +211,25 @@ void _zfcp_hba_dbf_event_fsf_response(const char *tag2, int level, | |||
211 | char *buf = (char *)qtcb + qtcb->header.log_start; | 211 | char *buf = (char *)qtcb + qtcb->header.log_start; |
212 | int len = qtcb->header.log_length; | 212 | int len = qtcb->header.log_length; |
213 | for (; len && !buf[len - 1]; len--); | 213 | for (; len && !buf[len - 1]; len--); |
214 | zfcp_dbf_hexdump(dbf->hba_dbf, rec, sizeof(*rec), level, buf, | 214 | zfcp_dbf_hexdump(dbf->hba, rec, sizeof(*rec), level, buf, |
215 | len); | 215 | len); |
216 | } | 216 | } |
217 | 217 | ||
218 | spin_unlock_irqrestore(&dbf->hba_dbf_lock, flags); | 218 | spin_unlock_irqrestore(&dbf->hba_lock, flags); |
219 | } | 219 | } |
220 | 220 | ||
221 | void _zfcp_hba_dbf_event_fsf_unsol(const char *tag, int level, | 221 | void _zfcp_dbf_hba_fsf_unsol(const char *tag, int level, struct zfcp_dbf *dbf, |
222 | struct zfcp_adapter *adapter, | 222 | struct fsf_status_read_buffer *status_buffer) |
223 | struct fsf_status_read_buffer *status_buffer) | ||
224 | { | 223 | { |
225 | struct zfcp_dbf *dbf = adapter->dbf; | 224 | struct zfcp_dbf_hba_record *rec = &dbf->hba_buf; |
226 | struct zfcp_hba_dbf_record *rec = &dbf->hba_dbf_buf; | ||
227 | unsigned long flags; | 225 | unsigned long flags; |
228 | 226 | ||
229 | spin_lock_irqsave(&dbf->hba_dbf_lock, flags); | 227 | spin_lock_irqsave(&dbf->hba_lock, flags); |
230 | memset(rec, 0, sizeof(*rec)); | 228 | memset(rec, 0, sizeof(*rec)); |
231 | strncpy(rec->tag, "stat", ZFCP_DBF_TAG_SIZE); | 229 | strncpy(rec->tag, "stat", ZFCP_DBF_TAG_SIZE); |
232 | strncpy(rec->tag2, tag, ZFCP_DBF_TAG_SIZE); | 230 | strncpy(rec->tag2, tag, ZFCP_DBF_TAG_SIZE); |
233 | 231 | ||
234 | rec->u.status.failed = atomic_read(&adapter->stat_miss); | 232 | rec->u.status.failed = atomic_read(&dbf->adapter->stat_miss); |
235 | if (status_buffer != NULL) { | 233 | if (status_buffer != NULL) { |
236 | rec->u.status.status_type = status_buffer->status_type; | 234 | rec->u.status.status_type = status_buffer->status_type; |
237 | rec->u.status.status_subtype = status_buffer->status_subtype; | 235 | rec->u.status.status_subtype = status_buffer->status_subtype; |
@@ -268,58 +266,54 @@ void _zfcp_hba_dbf_event_fsf_unsol(const char *tag, int level, | |||
268 | &status_buffer->payload, rec->u.status.payload_size); | 266 | &status_buffer->payload, rec->u.status.payload_size); |
269 | } | 267 | } |
270 | 268 | ||
271 | debug_event(dbf->hba_dbf, level, rec, sizeof(*rec)); | 269 | debug_event(dbf->hba, level, rec, sizeof(*rec)); |
272 | spin_unlock_irqrestore(&dbf->hba_dbf_lock, flags); | 270 | spin_unlock_irqrestore(&dbf->hba_lock, flags); |
273 | } | 271 | } |
274 | 272 | ||
275 | /** | 273 | /** |
276 | * zfcp_hba_dbf_event_qdio - trace event for QDIO related failure | 274 | * zfcp_dbf_hba_qdio - trace event for QDIO related failure |
277 | * @qdio: qdio structure affected by this QDIO related event | 275 | * @qdio: qdio structure affected by this QDIO related event |
278 | * @qdio_error: as passed by qdio module | 276 | * @qdio_error: as passed by qdio module |
279 | * @sbal_index: first buffer with error condition, as passed by qdio module | 277 | * @sbal_index: first buffer with error condition, as passed by qdio module |
280 | * @sbal_count: number of buffers affected, as passed by qdio module | 278 | * @sbal_count: number of buffers affected, as passed by qdio module |
281 | */ | 279 | */ |
282 | void zfcp_hba_dbf_event_qdio(struct zfcp_qdio *qdio, | 280 | void zfcp_dbf_hba_qdio(struct zfcp_dbf *dbf, unsigned int qdio_error, |
283 | unsigned int qdio_error, int sbal_index, | 281 | int sbal_index, int sbal_count) |
284 | int sbal_count) | ||
285 | { | 282 | { |
286 | struct zfcp_dbf *dbf = qdio->adapter->dbf; | 283 | struct zfcp_dbf_hba_record *r = &dbf->hba_buf; |
287 | struct zfcp_hba_dbf_record *r = &dbf->hba_dbf_buf; | ||
288 | unsigned long flags; | 284 | unsigned long flags; |
289 | 285 | ||
290 | spin_lock_irqsave(&dbf->hba_dbf_lock, flags); | 286 | spin_lock_irqsave(&dbf->hba_lock, flags); |
291 | memset(r, 0, sizeof(*r)); | 287 | memset(r, 0, sizeof(*r)); |
292 | strncpy(r->tag, "qdio", ZFCP_DBF_TAG_SIZE); | 288 | strncpy(r->tag, "qdio", ZFCP_DBF_TAG_SIZE); |
293 | r->u.qdio.qdio_error = qdio_error; | 289 | r->u.qdio.qdio_error = qdio_error; |
294 | r->u.qdio.sbal_index = sbal_index; | 290 | r->u.qdio.sbal_index = sbal_index; |
295 | r->u.qdio.sbal_count = sbal_count; | 291 | r->u.qdio.sbal_count = sbal_count; |
296 | debug_event(dbf->hba_dbf, 0, r, sizeof(*r)); | 292 | debug_event(dbf->hba, 0, r, sizeof(*r)); |
297 | spin_unlock_irqrestore(&dbf->hba_dbf_lock, flags); | 293 | spin_unlock_irqrestore(&dbf->hba_lock, flags); |
298 | } | 294 | } |
299 | 295 | ||
300 | /** | 296 | /** |
301 | * zfcp_hba_dbf_event_berr - trace event for bit error threshold | 297 | * zfcp_dbf_hba_berr - trace event for bit error threshold |
302 | * @adapter: adapter affected by this QDIO related event | 298 | * @dbf: dbf structure affected by this QDIO related event |
303 | * @req: fsf request | 299 | * @req: fsf request |
304 | */ | 300 | */ |
305 | void zfcp_hba_dbf_event_berr(struct zfcp_adapter *adapter, | 301 | void zfcp_dbf_hba_berr(struct zfcp_dbf *dbf, struct zfcp_fsf_req *req) |
306 | struct zfcp_fsf_req *req) | ||
307 | { | 302 | { |
308 | struct zfcp_dbf *dbf = adapter->dbf; | 303 | struct zfcp_dbf_hba_record *r = &dbf->hba_buf; |
309 | struct zfcp_hba_dbf_record *r = &dbf->hba_dbf_buf; | ||
310 | struct fsf_status_read_buffer *sr_buf = req->data; | 304 | struct fsf_status_read_buffer *sr_buf = req->data; |
311 | struct fsf_bit_error_payload *err = &sr_buf->payload.bit_error; | 305 | struct fsf_bit_error_payload *err = &sr_buf->payload.bit_error; |
312 | unsigned long flags; | 306 | unsigned long flags; |
313 | 307 | ||
314 | spin_lock_irqsave(&dbf->hba_dbf_lock, flags); | 308 | spin_lock_irqsave(&dbf->hba_lock, flags); |
315 | memset(r, 0, sizeof(*r)); | 309 | memset(r, 0, sizeof(*r)); |
316 | strncpy(r->tag, "berr", ZFCP_DBF_TAG_SIZE); | 310 | strncpy(r->tag, "berr", ZFCP_DBF_TAG_SIZE); |
317 | memcpy(&r->u.berr, err, sizeof(struct fsf_bit_error_payload)); | 311 | memcpy(&r->u.berr, err, sizeof(struct fsf_bit_error_payload)); |
318 | debug_event(dbf->hba_dbf, 0, r, sizeof(*r)); | 312 | debug_event(dbf->hba, 0, r, sizeof(*r)); |
319 | spin_unlock_irqrestore(&dbf->hba_dbf_lock, flags); | 313 | spin_unlock_irqrestore(&dbf->hba_lock, flags); |
320 | } | 314 | } |
321 | static void zfcp_hba_dbf_view_response(char **p, | 315 | static void zfcp_dbf_hba_view_response(char **p, |
322 | struct zfcp_hba_dbf_record_response *r) | 316 | struct zfcp_dbf_hba_record_response *r) |
323 | { | 317 | { |
324 | struct timespec t; | 318 | struct timespec t; |
325 | 319 | ||
@@ -380,8 +374,8 @@ static void zfcp_hba_dbf_view_response(char **p, | |||
380 | } | 374 | } |
381 | } | 375 | } |
382 | 376 | ||
383 | static void zfcp_hba_dbf_view_status(char **p, | 377 | static void zfcp_dbf_hba_view_status(char **p, |
384 | struct zfcp_hba_dbf_record_status *r) | 378 | struct zfcp_dbf_hba_record_status *r) |
385 | { | 379 | { |
386 | zfcp_dbf_out(p, "failed", "0x%02x", r->failed); | 380 | zfcp_dbf_out(p, "failed", "0x%02x", r->failed); |
387 | zfcp_dbf_out(p, "status_type", "0x%08x", r->status_type); | 381 | zfcp_dbf_out(p, "status_type", "0x%08x", r->status_type); |
@@ -393,14 +387,14 @@ static void zfcp_hba_dbf_view_status(char **p, | |||
393 | r->payload_size); | 387 | r->payload_size); |
394 | } | 388 | } |
395 | 389 | ||
396 | static void zfcp_hba_dbf_view_qdio(char **p, struct zfcp_hba_dbf_record_qdio *r) | 390 | static void zfcp_dbf_hba_view_qdio(char **p, struct zfcp_dbf_hba_record_qdio *r) |
397 | { | 391 | { |
398 | zfcp_dbf_out(p, "qdio_error", "0x%08x", r->qdio_error); | 392 | zfcp_dbf_out(p, "qdio_error", "0x%08x", r->qdio_error); |
399 | zfcp_dbf_out(p, "sbal_index", "0x%02x", r->sbal_index); | 393 | zfcp_dbf_out(p, "sbal_index", "0x%02x", r->sbal_index); |
400 | zfcp_dbf_out(p, "sbal_count", "0x%02x", r->sbal_count); | 394 | zfcp_dbf_out(p, "sbal_count", "0x%02x", r->sbal_count); |
401 | } | 395 | } |
402 | 396 | ||
403 | static void zfcp_hba_dbf_view_berr(char **p, struct fsf_bit_error_payload *r) | 397 | static void zfcp_dbf_hba_view_berr(char **p, struct fsf_bit_error_payload *r) |
404 | { | 398 | { |
405 | zfcp_dbf_out(p, "link_failures", "%d", r->link_failure_error_count); | 399 | zfcp_dbf_out(p, "link_failures", "%d", r->link_failure_error_count); |
406 | zfcp_dbf_out(p, "loss_of_sync_err", "%d", r->loss_of_sync_error_count); | 400 | zfcp_dbf_out(p, "loss_of_sync_err", "%d", r->loss_of_sync_error_count); |
@@ -424,10 +418,10 @@ static void zfcp_hba_dbf_view_berr(char **p, struct fsf_bit_error_payload *r) | |||
424 | r->current_transmit_b2b_credit); | 418 | r->current_transmit_b2b_credit); |
425 | } | 419 | } |
426 | 420 | ||
427 | static int zfcp_hba_dbf_view_format(debug_info_t *id, struct debug_view *view, | 421 | static int zfcp_dbf_hba_view_format(debug_info_t *id, struct debug_view *view, |
428 | char *out_buf, const char *in_buf) | 422 | char *out_buf, const char *in_buf) |
429 | { | 423 | { |
430 | struct zfcp_hba_dbf_record *r = (struct zfcp_hba_dbf_record *)in_buf; | 424 | struct zfcp_dbf_hba_record *r = (struct zfcp_dbf_hba_record *)in_buf; |
431 | char *p = out_buf; | 425 | char *p = out_buf; |
432 | 426 | ||
433 | if (strncmp(r->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0) | 427 | if (strncmp(r->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0) |
@@ -438,45 +432,42 @@ static int zfcp_hba_dbf_view_format(debug_info_t *id, struct debug_view *view, | |||
438 | zfcp_dbf_tag(&p, "tag2", r->tag2); | 432 | zfcp_dbf_tag(&p, "tag2", r->tag2); |
439 | 433 | ||
440 | if (strncmp(r->tag, "resp", ZFCP_DBF_TAG_SIZE) == 0) | 434 | if (strncmp(r->tag, "resp", ZFCP_DBF_TAG_SIZE) == 0) |
441 | zfcp_hba_dbf_view_response(&p, &r->u.response); | 435 | zfcp_dbf_hba_view_response(&p, &r->u.response); |
442 | else if (strncmp(r->tag, "stat", ZFCP_DBF_TAG_SIZE) == 0) | 436 | else if (strncmp(r->tag, "stat", ZFCP_DBF_TAG_SIZE) == 0) |
443 | zfcp_hba_dbf_view_status(&p, &r->u.status); | 437 | zfcp_dbf_hba_view_status(&p, &r->u.status); |
444 | else if (strncmp(r->tag, "qdio", ZFCP_DBF_TAG_SIZE) == 0) | 438 | else if (strncmp(r->tag, "qdio", ZFCP_DBF_TAG_SIZE) == 0) |
445 | zfcp_hba_dbf_view_qdio(&p, &r->u.qdio); | 439 | zfcp_dbf_hba_view_qdio(&p, &r->u.qdio); |
446 | else if (strncmp(r->tag, "berr", ZFCP_DBF_TAG_SIZE) == 0) | 440 | else if (strncmp(r->tag, "berr", ZFCP_DBF_TAG_SIZE) == 0) |
447 | zfcp_hba_dbf_view_berr(&p, &r->u.berr); | 441 | zfcp_dbf_hba_view_berr(&p, &r->u.berr); |
448 | 442 | ||
449 | if (strncmp(r->tag, "resp", ZFCP_DBF_TAG_SIZE) != 0) | 443 | if (strncmp(r->tag, "resp", ZFCP_DBF_TAG_SIZE) != 0) |
450 | p += sprintf(p, "\n"); | 444 | p += sprintf(p, "\n"); |
451 | return p - out_buf; | 445 | return p - out_buf; |
452 | } | 446 | } |
453 | 447 | ||
454 | static struct debug_view zfcp_hba_dbf_view = { | 448 | static struct debug_view zfcp_dbf_hba_view = { |
455 | "structured", | 449 | .name = "structured", |
456 | NULL, | 450 | .header_proc = zfcp_dbf_view_header, |
457 | &zfcp_dbf_view_header, | 451 | .format_proc = zfcp_dbf_hba_view_format, |
458 | &zfcp_hba_dbf_view_format, | ||
459 | NULL, | ||
460 | NULL | ||
461 | }; | 452 | }; |
462 | 453 | ||
463 | static const char *zfcp_rec_dbf_tags[] = { | 454 | static const char *zfcp_dbf_rec_tags[] = { |
464 | [ZFCP_REC_DBF_ID_THREAD] = "thread", | 455 | [ZFCP_REC_DBF_ID_THREAD] = "thread", |
465 | [ZFCP_REC_DBF_ID_TARGET] = "target", | 456 | [ZFCP_REC_DBF_ID_TARGET] = "target", |
466 | [ZFCP_REC_DBF_ID_TRIGGER] = "trigger", | 457 | [ZFCP_REC_DBF_ID_TRIGGER] = "trigger", |
467 | [ZFCP_REC_DBF_ID_ACTION] = "action", | 458 | [ZFCP_REC_DBF_ID_ACTION] = "action", |
468 | }; | 459 | }; |
469 | 460 | ||
470 | static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, | 461 | static int zfcp_dbf_rec_view_format(debug_info_t *id, struct debug_view *view, |
471 | char *buf, const char *_rec) | 462 | char *buf, const char *_rec) |
472 | { | 463 | { |
473 | struct zfcp_rec_dbf_record *r = (struct zfcp_rec_dbf_record *)_rec; | 464 | struct zfcp_dbf_rec_record *r = (struct zfcp_dbf_rec_record *)_rec; |
474 | char *p = buf; | 465 | char *p = buf; |
475 | char hint[ZFCP_DBF_ID_SIZE + 1]; | 466 | char hint[ZFCP_DBF_ID_SIZE + 1]; |
476 | 467 | ||
477 | memcpy(hint, r->id2, ZFCP_DBF_ID_SIZE); | 468 | memcpy(hint, r->id2, ZFCP_DBF_ID_SIZE); |
478 | hint[ZFCP_DBF_ID_SIZE] = 0; | 469 | hint[ZFCP_DBF_ID_SIZE] = 0; |
479 | zfcp_dbf_outs(&p, "tag", zfcp_rec_dbf_tags[r->id]); | 470 | zfcp_dbf_outs(&p, "tag", zfcp_dbf_rec_tags[r->id]); |
480 | zfcp_dbf_outs(&p, "hint", hint); | 471 | zfcp_dbf_outs(&p, "hint", hint); |
481 | switch (r->id) { | 472 | switch (r->id) { |
482 | case ZFCP_REC_DBF_ID_THREAD: | 473 | case ZFCP_REC_DBF_ID_THREAD: |
@@ -514,25 +505,22 @@ static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, | |||
514 | return p - buf; | 505 | return p - buf; |
515 | } | 506 | } |
516 | 507 | ||
517 | static struct debug_view zfcp_rec_dbf_view = { | 508 | static struct debug_view zfcp_dbf_rec_view = { |
518 | "structured", | 509 | .name = "structured", |
519 | NULL, | 510 | .header_proc = zfcp_dbf_view_header, |
520 | &zfcp_dbf_view_header, | 511 | .format_proc = zfcp_dbf_rec_view_format, |
521 | &zfcp_rec_dbf_view_format, | ||
522 | NULL, | ||
523 | NULL | ||
524 | }; | 512 | }; |
525 | 513 | ||
526 | /** | 514 | /** |
527 | * zfcp_rec_dbf_event_thread - trace event related to recovery thread operation | 515 | * zfcp_dbf_rec_thread - trace event related to recovery thread operation |
528 | * @id2: identifier for event | 516 | * @id2: identifier for event |
529 | * @adapter: adapter | 517 | * @dbf: reference to dbf structure |
530 | * This function assumes that the caller is holding erp_lock. | 518 | * This function assumes that the caller is holding erp_lock. |
531 | */ | 519 | */ |
532 | void zfcp_rec_dbf_event_thread(char *id2, struct zfcp_adapter *adapter) | 520 | void zfcp_dbf_rec_thread(char *id2, struct zfcp_dbf *dbf) |
533 | { | 521 | { |
534 | struct zfcp_dbf *dbf = adapter->dbf; | 522 | struct zfcp_adapter *adapter = dbf->adapter; |
535 | struct zfcp_rec_dbf_record *r = &dbf->rec_dbf_buf; | 523 | struct zfcp_dbf_rec_record *r = &dbf->rec_buf; |
536 | unsigned long flags = 0; | 524 | unsigned long flags = 0; |
537 | struct list_head *entry; | 525 | struct list_head *entry; |
538 | unsigned ready = 0, running = 0, total; | 526 | unsigned ready = 0, running = 0, total; |
@@ -543,42 +531,41 @@ void zfcp_rec_dbf_event_thread(char *id2, struct zfcp_adapter *adapter) | |||
543 | running++; | 531 | running++; |
544 | total = adapter->erp_total_count; | 532 | total = adapter->erp_total_count; |
545 | 533 | ||
546 | spin_lock_irqsave(&dbf->rec_dbf_lock, flags); | 534 | spin_lock_irqsave(&dbf->rec_lock, flags); |
547 | memset(r, 0, sizeof(*r)); | 535 | memset(r, 0, sizeof(*r)); |
548 | r->id = ZFCP_REC_DBF_ID_THREAD; | 536 | r->id = ZFCP_REC_DBF_ID_THREAD; |
549 | memcpy(r->id2, id2, ZFCP_DBF_ID_SIZE); | 537 | memcpy(r->id2, id2, ZFCP_DBF_ID_SIZE); |
550 | r->u.thread.total = total; | 538 | r->u.thread.total = total; |
551 | r->u.thread.ready = ready; | 539 | r->u.thread.ready = ready; |
552 | r->u.thread.running = running; | 540 | r->u.thread.running = running; |
553 | debug_event(dbf->rec_dbf, 6, r, sizeof(*r)); | 541 | debug_event(dbf->rec, 6, r, sizeof(*r)); |
554 | spin_unlock_irqrestore(&dbf->rec_dbf_lock, flags); | 542 | spin_unlock_irqrestore(&dbf->rec_lock, flags); |
555 | } | 543 | } |
556 | 544 | ||
557 | /** | 545 | /** |
558 | * zfcp_rec_dbf_event_thread - trace event related to recovery thread operation | 546 | * zfcp_dbf_rec_thread - trace event related to recovery thread operation |
559 | * @id2: identifier for event | 547 | * @id2: identifier for event |
560 | * @adapter: adapter | 548 | * @adapter: adapter |
561 | * This function assumes that the caller does not hold erp_lock. | 549 | * This function assumes that the caller does not hold erp_lock. |
562 | */ | 550 | */ |
563 | void zfcp_rec_dbf_event_thread_lock(char *id2, struct zfcp_adapter *adapter) | 551 | void zfcp_dbf_rec_thread_lock(char *id2, struct zfcp_dbf *dbf) |
564 | { | 552 | { |
553 | struct zfcp_adapter *adapter = dbf->adapter; | ||
565 | unsigned long flags; | 554 | unsigned long flags; |
566 | 555 | ||
567 | read_lock_irqsave(&adapter->erp_lock, flags); | 556 | read_lock_irqsave(&adapter->erp_lock, flags); |
568 | zfcp_rec_dbf_event_thread(id2, adapter); | 557 | zfcp_dbf_rec_thread(id2, dbf); |
569 | read_unlock_irqrestore(&adapter->erp_lock, flags); | 558 | read_unlock_irqrestore(&adapter->erp_lock, flags); |
570 | } | 559 | } |
571 | 560 | ||
572 | static void zfcp_rec_dbf_event_target(char *id2, void *ref, | 561 | static void zfcp_dbf_rec_target(char *id2, void *ref, struct zfcp_dbf *dbf, |
573 | struct zfcp_adapter *adapter, | 562 | atomic_t *status, atomic_t *erp_count, u64 wwpn, |
574 | atomic_t *status, atomic_t *erp_count, | 563 | u32 d_id, u64 fcp_lun) |
575 | u64 wwpn, u32 d_id, u64 fcp_lun) | ||
576 | { | 564 | { |
577 | struct zfcp_dbf *dbf = adapter->dbf; | 565 | struct zfcp_dbf_rec_record *r = &dbf->rec_buf; |
578 | struct zfcp_rec_dbf_record *r = &dbf->rec_dbf_buf; | ||
579 | unsigned long flags; | 566 | unsigned long flags; |
580 | 567 | ||
581 | spin_lock_irqsave(&dbf->rec_dbf_lock, flags); | 568 | spin_lock_irqsave(&dbf->rec_lock, flags); |
582 | memset(r, 0, sizeof(*r)); | 569 | memset(r, 0, sizeof(*r)); |
583 | r->id = ZFCP_REC_DBF_ID_TARGET; | 570 | r->id = ZFCP_REC_DBF_ID_TARGET; |
584 | memcpy(r->id2, id2, ZFCP_DBF_ID_SIZE); | 571 | memcpy(r->id2, id2, ZFCP_DBF_ID_SIZE); |
@@ -588,56 +575,57 @@ static void zfcp_rec_dbf_event_target(char *id2, void *ref, | |||
588 | r->u.target.d_id = d_id; | 575 | r->u.target.d_id = d_id; |
589 | r->u.target.fcp_lun = fcp_lun; | 576 | r->u.target.fcp_lun = fcp_lun; |
590 | r->u.target.erp_count = atomic_read(erp_count); | 577 | r->u.target.erp_count = atomic_read(erp_count); |
591 | debug_event(dbf->rec_dbf, 3, r, sizeof(*r)); | 578 | debug_event(dbf->rec, 3, r, sizeof(*r)); |
592 | spin_unlock_irqrestore(&dbf->rec_dbf_lock, flags); | 579 | spin_unlock_irqrestore(&dbf->rec_lock, flags); |
593 | } | 580 | } |
594 | 581 | ||
595 | /** | 582 | /** |
596 | * zfcp_rec_dbf_event_adapter - trace event for adapter state change | 583 | * zfcp_dbf_rec_adapter - trace event for adapter state change |
597 | * @id: identifier for trigger of state change | 584 | * @id: identifier for trigger of state change |
598 | * @ref: additional reference (e.g. request) | 585 | * @ref: additional reference (e.g. request) |
599 | * @adapter: adapter | 586 | * @dbf: reference to dbf structure |
600 | */ | 587 | */ |
601 | void zfcp_rec_dbf_event_adapter(char *id, void *ref, | 588 | void zfcp_dbf_rec_adapter(char *id, void *ref, struct zfcp_dbf *dbf) |
602 | struct zfcp_adapter *adapter) | ||
603 | { | 589 | { |
604 | zfcp_rec_dbf_event_target(id, ref, adapter, &adapter->status, | 590 | struct zfcp_adapter *adapter = dbf->adapter; |
591 | |||
592 | zfcp_dbf_rec_target(id, ref, dbf, &adapter->status, | ||
605 | &adapter->erp_counter, 0, 0, 0); | 593 | &adapter->erp_counter, 0, 0, 0); |
606 | } | 594 | } |
607 | 595 | ||
608 | /** | 596 | /** |
609 | * zfcp_rec_dbf_event_port - trace event for port state change | 597 | * zfcp_dbf_rec_port - trace event for port state change |
610 | * @id: identifier for trigger of state change | 598 | * @id: identifier for trigger of state change |
611 | * @ref: additional reference (e.g. request) | 599 | * @ref: additional reference (e.g. request) |
612 | * @port: port | 600 | * @port: port |
613 | */ | 601 | */ |
614 | void zfcp_rec_dbf_event_port(char *id, void *ref, struct zfcp_port *port) | 602 | void zfcp_dbf_rec_port(char *id, void *ref, struct zfcp_port *port) |
615 | { | 603 | { |
616 | struct zfcp_adapter *adapter = port->adapter; | 604 | struct zfcp_dbf *dbf = port->adapter->dbf; |
617 | 605 | ||
618 | zfcp_rec_dbf_event_target(id, ref, adapter, &port->status, | 606 | zfcp_dbf_rec_target(id, ref, dbf, &port->status, |
619 | &port->erp_counter, port->wwpn, port->d_id, | 607 | &port->erp_counter, port->wwpn, port->d_id, |
620 | 0); | 608 | 0); |
621 | } | 609 | } |
622 | 610 | ||
623 | /** | 611 | /** |
624 | * zfcp_rec_dbf_event_unit - trace event for unit state change | 612 | * zfcp_dbf_rec_unit - trace event for unit state change |
625 | * @id: identifier for trigger of state change | 613 | * @id: identifier for trigger of state change |
626 | * @ref: additional reference (e.g. request) | 614 | * @ref: additional reference (e.g. request) |
627 | * @unit: unit | 615 | * @unit: unit |
628 | */ | 616 | */ |
629 | void zfcp_rec_dbf_event_unit(char *id, void *ref, struct zfcp_unit *unit) | 617 | void zfcp_dbf_rec_unit(char *id, void *ref, struct zfcp_unit *unit) |
630 | { | 618 | { |
631 | struct zfcp_port *port = unit->port; | 619 | struct zfcp_port *port = unit->port; |
632 | struct zfcp_adapter *adapter = port->adapter; | 620 | struct zfcp_dbf *dbf = port->adapter->dbf; |
633 | 621 | ||
634 | zfcp_rec_dbf_event_target(id, ref, adapter, &unit->status, | 622 | zfcp_dbf_rec_target(id, ref, dbf, &unit->status, |
635 | &unit->erp_counter, port->wwpn, port->d_id, | 623 | &unit->erp_counter, port->wwpn, port->d_id, |
636 | unit->fcp_lun); | 624 | unit->fcp_lun); |
637 | } | 625 | } |
638 | 626 | ||
639 | /** | 627 | /** |
640 | * zfcp_rec_dbf_event_trigger - trace event for triggered error recovery | 628 | * zfcp_dbf_rec_trigger - trace event for triggered error recovery |
641 | * @id2: identifier for error recovery trigger | 629 | * @id2: identifier for error recovery trigger |
642 | * @ref: additional reference (e.g. request) | 630 | * @ref: additional reference (e.g. request) |
643 | * @want: originally requested error recovery action | 631 | * @want: originally requested error recovery action |
@@ -647,15 +635,15 @@ void zfcp_rec_dbf_event_unit(char *id, void *ref, struct zfcp_unit *unit) | |||
647 | * @port: port | 635 | * @port: port |
648 | * @unit: unit | 636 | * @unit: unit |
649 | */ | 637 | */ |
650 | void zfcp_rec_dbf_event_trigger(char *id2, void *ref, u8 want, u8 need, | 638 | void zfcp_dbf_rec_trigger(char *id2, void *ref, u8 want, u8 need, void *action, |
651 | void *action, struct zfcp_adapter *adapter, | 639 | struct zfcp_adapter *adapter, struct zfcp_port *port, |
652 | struct zfcp_port *port, struct zfcp_unit *unit) | 640 | struct zfcp_unit *unit) |
653 | { | 641 | { |
654 | struct zfcp_dbf *dbf = adapter->dbf; | 642 | struct zfcp_dbf *dbf = adapter->dbf; |
655 | struct zfcp_rec_dbf_record *r = &dbf->rec_dbf_buf; | 643 | struct zfcp_dbf_rec_record *r = &dbf->rec_buf; |
656 | unsigned long flags; | 644 | unsigned long flags; |
657 | 645 | ||
658 | spin_lock_irqsave(&dbf->rec_dbf_lock, flags); | 646 | spin_lock_irqsave(&dbf->rec_lock, flags); |
659 | memset(r, 0, sizeof(*r)); | 647 | memset(r, 0, sizeof(*r)); |
660 | r->id = ZFCP_REC_DBF_ID_TRIGGER; | 648 | r->id = ZFCP_REC_DBF_ID_TRIGGER; |
661 | memcpy(r->id2, id2, ZFCP_DBF_ID_SIZE); | 649 | memcpy(r->id2, id2, ZFCP_DBF_ID_SIZE); |
@@ -672,23 +660,22 @@ void zfcp_rec_dbf_event_trigger(char *id2, void *ref, u8 want, u8 need, | |||
672 | r->u.trigger.us = atomic_read(&unit->status); | 660 | r->u.trigger.us = atomic_read(&unit->status); |
673 | r->u.trigger.fcp_lun = unit->fcp_lun; | 661 | r->u.trigger.fcp_lun = unit->fcp_lun; |
674 | } | 662 | } |
675 | debug_event(dbf->rec_dbf, action ? 1 : 4, r, sizeof(*r)); | 663 | debug_event(dbf->rec, action ? 1 : 4, r, sizeof(*r)); |
676 | spin_unlock_irqrestore(&dbf->rec_dbf_lock, flags); | 664 | spin_unlock_irqrestore(&dbf->rec_lock, flags); |
677 | } | 665 | } |
678 | 666 | ||
679 | /** | 667 | /** |
680 | * zfcp_rec_dbf_event_action - trace event showing progress of recovery action | 668 | * zfcp_dbf_rec_action - trace event showing progress of recovery action |
681 | * @id2: identifier | 669 | * @id2: identifier |
682 | * @erp_action: error recovery action struct pointer | 670 | * @erp_action: error recovery action struct pointer |
683 | */ | 671 | */ |
684 | void zfcp_rec_dbf_event_action(char *id2, struct zfcp_erp_action *erp_action) | 672 | void zfcp_dbf_rec_action(char *id2, struct zfcp_erp_action *erp_action) |
685 | { | 673 | { |
686 | struct zfcp_adapter *adapter = erp_action->adapter; | 674 | struct zfcp_dbf *dbf = erp_action->adapter->dbf; |
687 | struct zfcp_dbf *dbf = adapter->dbf; | 675 | struct zfcp_dbf_rec_record *r = &dbf->rec_buf; |
688 | struct zfcp_rec_dbf_record *r = &dbf->rec_dbf_buf; | ||
689 | unsigned long flags; | 676 | unsigned long flags; |
690 | 677 | ||
691 | spin_lock_irqsave(&dbf->rec_dbf_lock, flags); | 678 | spin_lock_irqsave(&dbf->rec_lock, flags); |
692 | memset(r, 0, sizeof(*r)); | 679 | memset(r, 0, sizeof(*r)); |
693 | r->id = ZFCP_REC_DBF_ID_ACTION; | 680 | r->id = ZFCP_REC_DBF_ID_ACTION; |
694 | memcpy(r->id2, id2, ZFCP_DBF_ID_SIZE); | 681 | memcpy(r->id2, id2, ZFCP_DBF_ID_SIZE); |
@@ -696,27 +683,27 @@ void zfcp_rec_dbf_event_action(char *id2, struct zfcp_erp_action *erp_action) | |||
696 | r->u.action.status = erp_action->status; | 683 | r->u.action.status = erp_action->status; |
697 | r->u.action.step = erp_action->step; | 684 | r->u.action.step = erp_action->step; |
698 | r->u.action.fsf_req = (unsigned long)erp_action->fsf_req; | 685 | r->u.action.fsf_req = (unsigned long)erp_action->fsf_req; |
699 | debug_event(dbf->rec_dbf, 5, r, sizeof(*r)); | 686 | debug_event(dbf->rec, 5, r, sizeof(*r)); |
700 | spin_unlock_irqrestore(&dbf->rec_dbf_lock, flags); | 687 | spin_unlock_irqrestore(&dbf->rec_lock, flags); |
701 | } | 688 | } |
702 | 689 | ||
703 | /** | 690 | /** |
704 | * zfcp_san_dbf_event_ct_request - trace event for issued CT request | 691 | * zfcp_dbf_san_ct_request - trace event for issued CT request |
705 | * @fsf_req: request containing issued CT data | 692 | * @fsf_req: request containing issued CT data |
706 | */ | 693 | */ |
707 | void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req) | 694 | void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *fsf_req) |
708 | { | 695 | { |
709 | struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data; | 696 | struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data; |
710 | struct zfcp_wka_port *wka_port = ct->wka_port; | 697 | struct zfcp_wka_port *wka_port = ct->wka_port; |
711 | struct zfcp_adapter *adapter = wka_port->adapter; | 698 | struct zfcp_adapter *adapter = wka_port->adapter; |
712 | struct zfcp_dbf *dbf = adapter->dbf; | 699 | struct zfcp_dbf *dbf = adapter->dbf; |
713 | struct ct_hdr *hdr = sg_virt(ct->req); | 700 | struct ct_hdr *hdr = sg_virt(ct->req); |
714 | struct zfcp_san_dbf_record *r = &dbf->san_dbf_buf; | 701 | struct zfcp_dbf_san_record *r = &dbf->san_buf; |
715 | struct zfcp_san_dbf_record_ct_request *oct = &r->u.ct_req; | 702 | struct zfcp_dbf_san_record_ct_request *oct = &r->u.ct_req; |
716 | int level = 3; | 703 | int level = 3; |
717 | unsigned long flags; | 704 | unsigned long flags; |
718 | 705 | ||
719 | spin_lock_irqsave(&dbf->san_dbf_lock, flags); | 706 | spin_lock_irqsave(&dbf->san_lock, flags); |
720 | memset(r, 0, sizeof(*r)); | 707 | memset(r, 0, sizeof(*r)); |
721 | strncpy(r->tag, "octc", ZFCP_DBF_TAG_SIZE); | 708 | strncpy(r->tag, "octc", ZFCP_DBF_TAG_SIZE); |
722 | r->fsf_reqid = fsf_req->req_id; | 709 | r->fsf_reqid = fsf_req->req_id; |
@@ -731,29 +718,29 @@ void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req) | |||
731 | oct->max_res_size = hdr->max_res_size; | 718 | oct->max_res_size = hdr->max_res_size; |
732 | oct->len = min((int)ct->req->length - (int)sizeof(struct ct_hdr), | 719 | oct->len = min((int)ct->req->length - (int)sizeof(struct ct_hdr), |
733 | ZFCP_DBF_SAN_MAX_PAYLOAD); | 720 | ZFCP_DBF_SAN_MAX_PAYLOAD); |
734 | debug_event(dbf->san_dbf, level, r, sizeof(*r)); | 721 | debug_event(dbf->san, level, r, sizeof(*r)); |
735 | zfcp_dbf_hexdump(dbf->san_dbf, r, sizeof(*r), level, | 722 | zfcp_dbf_hexdump(dbf->san, r, sizeof(*r), level, |
736 | (void *)hdr + sizeof(struct ct_hdr), oct->len); | 723 | (void *)hdr + sizeof(struct ct_hdr), oct->len); |
737 | spin_unlock_irqrestore(&dbf->san_dbf_lock, flags); | 724 | spin_unlock_irqrestore(&dbf->san_lock, flags); |
738 | } | 725 | } |
739 | 726 | ||
740 | /** | 727 | /** |
741 | * zfcp_san_dbf_event_ct_response - trace event for completion of CT request | 728 | * zfcp_dbf_san_ct_response - trace event for completion of CT request |
742 | * @fsf_req: request containing CT response | 729 | * @fsf_req: request containing CT response |
743 | */ | 730 | */ |
744 | void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req) | 731 | void zfcp_dbf_san_ct_response(struct zfcp_fsf_req *fsf_req) |
745 | { | 732 | { |
746 | struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data; | 733 | struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data; |
747 | struct zfcp_wka_port *wka_port = ct->wka_port; | 734 | struct zfcp_wka_port *wka_port = ct->wka_port; |
748 | struct zfcp_adapter *adapter = wka_port->adapter; | 735 | struct zfcp_adapter *adapter = wka_port->adapter; |
749 | struct ct_hdr *hdr = sg_virt(ct->resp); | 736 | struct ct_hdr *hdr = sg_virt(ct->resp); |
750 | struct zfcp_dbf *dbf = adapter->dbf; | 737 | struct zfcp_dbf *dbf = adapter->dbf; |
751 | struct zfcp_san_dbf_record *r = &dbf->san_dbf_buf; | 738 | struct zfcp_dbf_san_record *r = &dbf->san_buf; |
752 | struct zfcp_san_dbf_record_ct_response *rct = &r->u.ct_resp; | 739 | struct zfcp_dbf_san_record_ct_response *rct = &r->u.ct_resp; |
753 | int level = 3; | 740 | int level = 3; |
754 | unsigned long flags; | 741 | unsigned long flags; |
755 | 742 | ||
756 | spin_lock_irqsave(&dbf->san_dbf_lock, flags); | 743 | spin_lock_irqsave(&dbf->san_lock, flags); |
757 | memset(r, 0, sizeof(*r)); | 744 | memset(r, 0, sizeof(*r)); |
758 | strncpy(r->tag, "rctc", ZFCP_DBF_TAG_SIZE); | 745 | strncpy(r->tag, "rctc", ZFCP_DBF_TAG_SIZE); |
759 | r->fsf_reqid = fsf_req->req_id; | 746 | r->fsf_reqid = fsf_req->req_id; |
@@ -768,23 +755,22 @@ void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req) | |||
768 | rct->max_res_size = hdr->max_res_size; | 755 | rct->max_res_size = hdr->max_res_size; |
769 | rct->len = min((int)ct->resp->length - (int)sizeof(struct ct_hdr), | 756 | rct->len = min((int)ct->resp->length - (int)sizeof(struct ct_hdr), |
770 | ZFCP_DBF_SAN_MAX_PAYLOAD); | 757 | ZFCP_DBF_SAN_MAX_PAYLOAD); |
771 | debug_event(dbf->san_dbf, level, r, sizeof(*r)); | 758 | debug_event(dbf->san, level, r, sizeof(*r)); |
772 | zfcp_dbf_hexdump(dbf->san_dbf, r, sizeof(*r), level, | 759 | zfcp_dbf_hexdump(dbf->san, r, sizeof(*r), level, |
773 | (void *)hdr + sizeof(struct ct_hdr), rct->len); | 760 | (void *)hdr + sizeof(struct ct_hdr), rct->len); |
774 | spin_unlock_irqrestore(&dbf->san_dbf_lock, flags); | 761 | spin_unlock_irqrestore(&dbf->san_lock, flags); |
775 | } | 762 | } |
776 | 763 | ||
777 | static void zfcp_san_dbf_event_els(const char *tag, int level, | 764 | static void zfcp_dbf_san_els(const char *tag, int level, |
778 | struct zfcp_fsf_req *fsf_req, u32 s_id, | 765 | struct zfcp_fsf_req *fsf_req, u32 s_id, u32 d_id, |
779 | u32 d_id, u8 ls_code, void *buffer, | 766 | u8 ls_code, void *buffer, int buflen) |
780 | int buflen) | ||
781 | { | 767 | { |
782 | struct zfcp_adapter *adapter = fsf_req->adapter; | 768 | struct zfcp_adapter *adapter = fsf_req->adapter; |
783 | struct zfcp_dbf *dbf = adapter->dbf; | 769 | struct zfcp_dbf *dbf = adapter->dbf; |
784 | struct zfcp_san_dbf_record *rec = &dbf->san_dbf_buf; | 770 | struct zfcp_dbf_san_record *rec = &dbf->san_buf; |
785 | unsigned long flags; | 771 | unsigned long flags; |
786 | 772 | ||
787 | spin_lock_irqsave(&dbf->san_dbf_lock, flags); | 773 | spin_lock_irqsave(&dbf->san_lock, flags); |
788 | memset(rec, 0, sizeof(*rec)); | 774 | memset(rec, 0, sizeof(*rec)); |
789 | strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE); | 775 | strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE); |
790 | rec->fsf_reqid = fsf_req->req_id; | 776 | rec->fsf_reqid = fsf_req->req_id; |
@@ -792,45 +778,45 @@ static void zfcp_san_dbf_event_els(const char *tag, int level, | |||
792 | rec->s_id = s_id; | 778 | rec->s_id = s_id; |
793 | rec->d_id = d_id; | 779 | rec->d_id = d_id; |
794 | rec->u.els.ls_code = ls_code; | 780 | rec->u.els.ls_code = ls_code; |
795 | debug_event(dbf->san_dbf, level, rec, sizeof(*rec)); | 781 | debug_event(dbf->san, level, rec, sizeof(*rec)); |
796 | zfcp_dbf_hexdump(dbf->san_dbf, rec, sizeof(*rec), level, | 782 | zfcp_dbf_hexdump(dbf->san, rec, sizeof(*rec), level, |
797 | buffer, min(buflen, ZFCP_DBF_SAN_MAX_PAYLOAD)); | 783 | buffer, min(buflen, ZFCP_DBF_SAN_MAX_PAYLOAD)); |
798 | spin_unlock_irqrestore(&dbf->san_dbf_lock, flags); | 784 | spin_unlock_irqrestore(&dbf->san_lock, flags); |
799 | } | 785 | } |
800 | 786 | ||
801 | /** | 787 | /** |
802 | * zfcp_san_dbf_event_els_request - trace event for issued ELS | 788 | * zfcp_dbf_san_els_request - trace event for issued ELS |
803 | * @fsf_req: request containing issued ELS | 789 | * @fsf_req: request containing issued ELS |
804 | */ | 790 | */ |
805 | void zfcp_san_dbf_event_els_request(struct zfcp_fsf_req *fsf_req) | 791 | void zfcp_dbf_san_els_request(struct zfcp_fsf_req *fsf_req) |
806 | { | 792 | { |
807 | struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data; | 793 | struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data; |
808 | 794 | ||
809 | zfcp_san_dbf_event_els("oels", 2, fsf_req, | 795 | zfcp_dbf_san_els("oels", 2, fsf_req, |
810 | fc_host_port_id(els->adapter->scsi_host), | 796 | fc_host_port_id(els->adapter->scsi_host), |
811 | els->d_id, *(u8 *) sg_virt(els->req), | 797 | els->d_id, *(u8 *) sg_virt(els->req), |
812 | sg_virt(els->req), els->req->length); | 798 | sg_virt(els->req), els->req->length); |
813 | } | 799 | } |
814 | 800 | ||
815 | /** | 801 | /** |
816 | * zfcp_san_dbf_event_els_response - trace event for completed ELS | 802 | * zfcp_dbf_san_els_response - trace event for completed ELS |
817 | * @fsf_req: request containing ELS response | 803 | * @fsf_req: request containing ELS response |
818 | */ | 804 | */ |
819 | void zfcp_san_dbf_event_els_response(struct zfcp_fsf_req *fsf_req) | 805 | void zfcp_dbf_san_els_response(struct zfcp_fsf_req *fsf_req) |
820 | { | 806 | { |
821 | struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data; | 807 | struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data; |
822 | 808 | ||
823 | zfcp_san_dbf_event_els("rels", 2, fsf_req, els->d_id, | 809 | zfcp_dbf_san_els("rels", 2, fsf_req, els->d_id, |
824 | fc_host_port_id(els->adapter->scsi_host), | 810 | fc_host_port_id(els->adapter->scsi_host), |
825 | *(u8 *)sg_virt(els->req), sg_virt(els->resp), | 811 | *(u8 *)sg_virt(els->req), sg_virt(els->resp), |
826 | els->resp->length); | 812 | els->resp->length); |
827 | } | 813 | } |
828 | 814 | ||
829 | /** | 815 | /** |
830 | * zfcp_san_dbf_event_incoming_els - trace event for incomig ELS | 816 | * zfcp_dbf_san_incoming_els - trace event for incomig ELS |
831 | * @fsf_req: request containing unsolicited status buffer with incoming ELS | 817 | * @fsf_req: request containing unsolicited status buffer with incoming ELS |
832 | */ | 818 | */ |
833 | void zfcp_san_dbf_event_incoming_els(struct zfcp_fsf_req *fsf_req) | 819 | void zfcp_dbf_san_incoming_els(struct zfcp_fsf_req *fsf_req) |
834 | { | 820 | { |
835 | struct zfcp_adapter *adapter = fsf_req->adapter; | 821 | struct zfcp_adapter *adapter = fsf_req->adapter; |
836 | struct fsf_status_read_buffer *buf = | 822 | struct fsf_status_read_buffer *buf = |
@@ -838,16 +824,16 @@ void zfcp_san_dbf_event_incoming_els(struct zfcp_fsf_req *fsf_req) | |||
838 | int length = (int)buf->length - | 824 | int length = (int)buf->length - |
839 | (int)((void *)&buf->payload - (void *)buf); | 825 | (int)((void *)&buf->payload - (void *)buf); |
840 | 826 | ||
841 | zfcp_san_dbf_event_els("iels", 1, fsf_req, buf->d_id, | 827 | zfcp_dbf_san_els("iels", 1, fsf_req, buf->d_id, |
842 | fc_host_port_id(adapter->scsi_host), | 828 | fc_host_port_id(adapter->scsi_host), |
843 | buf->payload.data[0], (void *)buf->payload.data, | 829 | buf->payload.data[0], (void *)buf->payload.data, |
844 | length); | 830 | length); |
845 | } | 831 | } |
846 | 832 | ||
847 | static int zfcp_san_dbf_view_format(debug_info_t *id, struct debug_view *view, | 833 | static int zfcp_dbf_san_view_format(debug_info_t *id, struct debug_view *view, |
848 | char *out_buf, const char *in_buf) | 834 | char *out_buf, const char *in_buf) |
849 | { | 835 | { |
850 | struct zfcp_san_dbf_record *r = (struct zfcp_san_dbf_record *)in_buf; | 836 | struct zfcp_dbf_san_record *r = (struct zfcp_dbf_san_record *)in_buf; |
851 | char *p = out_buf; | 837 | char *p = out_buf; |
852 | 838 | ||
853 | if (strncmp(r->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0) | 839 | if (strncmp(r->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0) |
@@ -860,7 +846,7 @@ static int zfcp_san_dbf_view_format(debug_info_t *id, struct debug_view *view, | |||
860 | zfcp_dbf_out(&p, "d_id", "0x%06x", r->d_id); | 846 | zfcp_dbf_out(&p, "d_id", "0x%06x", r->d_id); |
861 | 847 | ||
862 | if (strncmp(r->tag, "octc", ZFCP_DBF_TAG_SIZE) == 0) { | 848 | if (strncmp(r->tag, "octc", ZFCP_DBF_TAG_SIZE) == 0) { |
863 | struct zfcp_san_dbf_record_ct_request *ct = &r->u.ct_req; | 849 | struct zfcp_dbf_san_record_ct_request *ct = &r->u.ct_req; |
864 | zfcp_dbf_out(&p, "cmd_req_code", "0x%04x", ct->cmd_req_code); | 850 | zfcp_dbf_out(&p, "cmd_req_code", "0x%04x", ct->cmd_req_code); |
865 | zfcp_dbf_out(&p, "revision", "0x%02x", ct->revision); | 851 | zfcp_dbf_out(&p, "revision", "0x%02x", ct->revision); |
866 | zfcp_dbf_out(&p, "gs_type", "0x%02x", ct->gs_type); | 852 | zfcp_dbf_out(&p, "gs_type", "0x%02x", ct->gs_type); |
@@ -868,7 +854,7 @@ static int zfcp_san_dbf_view_format(debug_info_t *id, struct debug_view *view, | |||
868 | zfcp_dbf_out(&p, "options", "0x%02x", ct->options); | 854 | zfcp_dbf_out(&p, "options", "0x%02x", ct->options); |
869 | zfcp_dbf_out(&p, "max_res_size", "0x%04x", ct->max_res_size); | 855 | zfcp_dbf_out(&p, "max_res_size", "0x%04x", ct->max_res_size); |
870 | } else if (strncmp(r->tag, "rctc", ZFCP_DBF_TAG_SIZE) == 0) { | 856 | } else if (strncmp(r->tag, "rctc", ZFCP_DBF_TAG_SIZE) == 0) { |
871 | struct zfcp_san_dbf_record_ct_response *ct = &r->u.ct_resp; | 857 | struct zfcp_dbf_san_record_ct_response *ct = &r->u.ct_resp; |
872 | zfcp_dbf_out(&p, "cmd_rsp_code", "0x%04x", ct->cmd_rsp_code); | 858 | zfcp_dbf_out(&p, "cmd_rsp_code", "0x%04x", ct->cmd_rsp_code); |
873 | zfcp_dbf_out(&p, "revision", "0x%02x", ct->revision); | 859 | zfcp_dbf_out(&p, "revision", "0x%02x", ct->revision); |
874 | zfcp_dbf_out(&p, "reason_code", "0x%02x", ct->reason_code); | 860 | zfcp_dbf_out(&p, "reason_code", "0x%02x", ct->reason_code); |
@@ -878,34 +864,30 @@ static int zfcp_san_dbf_view_format(debug_info_t *id, struct debug_view *view, | |||
878 | } else if (strncmp(r->tag, "oels", ZFCP_DBF_TAG_SIZE) == 0 || | 864 | } else if (strncmp(r->tag, "oels", ZFCP_DBF_TAG_SIZE) == 0 || |
879 | strncmp(r->tag, "rels", ZFCP_DBF_TAG_SIZE) == 0 || | 865 | strncmp(r->tag, "rels", ZFCP_DBF_TAG_SIZE) == 0 || |
880 | strncmp(r->tag, "iels", ZFCP_DBF_TAG_SIZE) == 0) { | 866 | strncmp(r->tag, "iels", ZFCP_DBF_TAG_SIZE) == 0) { |
881 | struct zfcp_san_dbf_record_els *els = &r->u.els; | 867 | struct zfcp_dbf_san_record_els *els = &r->u.els; |
882 | zfcp_dbf_out(&p, "ls_code", "0x%02x", els->ls_code); | 868 | zfcp_dbf_out(&p, "ls_code", "0x%02x", els->ls_code); |
883 | } | 869 | } |
884 | return p - out_buf; | 870 | return p - out_buf; |
885 | } | 871 | } |
886 | 872 | ||
887 | static struct debug_view zfcp_san_dbf_view = { | 873 | static struct debug_view zfcp_dbf_san_view = { |
888 | "structured", | 874 | .name = "structured", |
889 | NULL, | 875 | .header_proc = zfcp_dbf_view_header, |
890 | &zfcp_dbf_view_header, | 876 | .format_proc = zfcp_dbf_san_view_format, |
891 | &zfcp_san_dbf_view_format, | ||
892 | NULL, | ||
893 | NULL | ||
894 | }; | 877 | }; |
895 | 878 | ||
896 | void _zfcp_scsi_dbf_event(const char *tag, const char *tag2, int level, | 879 | void _zfcp_dbf_scsi(const char *tag, const char *tag2, int level, |
897 | struct zfcp_dbf *dbf, struct scsi_cmnd *scsi_cmnd, | 880 | struct zfcp_dbf *dbf, struct scsi_cmnd *scsi_cmnd, |
898 | struct zfcp_fsf_req *fsf_req, | 881 | struct zfcp_fsf_req *fsf_req, unsigned long old_req_id) |
899 | unsigned long old_req_id) | ||
900 | { | 882 | { |
901 | struct zfcp_scsi_dbf_record *rec = &dbf->scsi_dbf_buf; | 883 | struct zfcp_dbf_scsi_record *rec = &dbf->scsi_buf; |
902 | struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)rec; | 884 | struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)rec; |
903 | unsigned long flags; | 885 | unsigned long flags; |
904 | struct fcp_rsp_iu *fcp_rsp; | 886 | struct fcp_rsp_iu *fcp_rsp; |
905 | char *fcp_rsp_info = NULL, *fcp_sns_info = NULL; | 887 | char *fcp_rsp_info = NULL, *fcp_sns_info = NULL; |
906 | int offset = 0, buflen = 0; | 888 | int offset = 0, buflen = 0; |
907 | 889 | ||
908 | spin_lock_irqsave(&dbf->scsi_dbf_lock, flags); | 890 | spin_lock_irqsave(&dbf->scsi_lock, flags); |
909 | do { | 891 | do { |
910 | memset(rec, 0, sizeof(*rec)); | 892 | memset(rec, 0, sizeof(*rec)); |
911 | if (offset == 0) { | 893 | if (offset == 0) { |
@@ -959,20 +941,20 @@ void _zfcp_scsi_dbf_event(const char *tag, const char *tag2, int level, | |||
959 | dump->offset = offset; | 941 | dump->offset = offset; |
960 | dump->size = min(buflen - offset, | 942 | dump->size = min(buflen - offset, |
961 | (int)sizeof(struct | 943 | (int)sizeof(struct |
962 | zfcp_scsi_dbf_record) - | 944 | zfcp_dbf_scsi_record) - |
963 | (int)sizeof(struct zfcp_dbf_dump)); | 945 | (int)sizeof(struct zfcp_dbf_dump)); |
964 | memcpy(dump->data, fcp_sns_info + offset, dump->size); | 946 | memcpy(dump->data, fcp_sns_info + offset, dump->size); |
965 | offset += dump->size; | 947 | offset += dump->size; |
966 | } | 948 | } |
967 | debug_event(dbf->scsi_dbf, level, rec, sizeof(*rec)); | 949 | debug_event(dbf->scsi, level, rec, sizeof(*rec)); |
968 | } while (offset < buflen); | 950 | } while (offset < buflen); |
969 | spin_unlock_irqrestore(&dbf->scsi_dbf_lock, flags); | 951 | spin_unlock_irqrestore(&dbf->scsi_lock, flags); |
970 | } | 952 | } |
971 | 953 | ||
972 | static int zfcp_scsi_dbf_view_format(debug_info_t *id, struct debug_view *view, | 954 | static int zfcp_dbf_scsi_view_format(debug_info_t *id, struct debug_view *view, |
973 | char *out_buf, const char *in_buf) | 955 | char *out_buf, const char *in_buf) |
974 | { | 956 | { |
975 | struct zfcp_scsi_dbf_record *r = (struct zfcp_scsi_dbf_record *)in_buf; | 957 | struct zfcp_dbf_scsi_record *r = (struct zfcp_dbf_scsi_record *)in_buf; |
976 | struct timespec t; | 958 | struct timespec t; |
977 | char *p = out_buf; | 959 | char *p = out_buf; |
978 | 960 | ||
@@ -1013,13 +995,10 @@ static int zfcp_scsi_dbf_view_format(debug_info_t *id, struct debug_view *view, | |||
1013 | return p - out_buf; | 995 | return p - out_buf; |
1014 | } | 996 | } |
1015 | 997 | ||
1016 | static struct debug_view zfcp_scsi_dbf_view = { | 998 | static struct debug_view zfcp_dbf_scsi_view = { |
1017 | "structured", | 999 | .name = "structured", |
1018 | NULL, | 1000 | .header_proc = zfcp_dbf_view_header, |
1019 | &zfcp_dbf_view_header, | 1001 | .format_proc = zfcp_dbf_scsi_view_format, |
1020 | &zfcp_scsi_dbf_view_format, | ||
1021 | NULL, | ||
1022 | NULL | ||
1023 | }; | 1002 | }; |
1024 | 1003 | ||
1025 | static debug_info_t *zfcp_dbf_reg(const char *name, int level, | 1004 | static debug_info_t *zfcp_dbf_reg(const char *name, int level, |
@@ -1043,7 +1022,7 @@ static debug_info_t *zfcp_dbf_reg(const char *name, int level, | |||
1043 | * @adapter: pointer to adapter for which debug features should be registered | 1022 | * @adapter: pointer to adapter for which debug features should be registered |
1044 | * return: -ENOMEM on error, 0 otherwise | 1023 | * return: -ENOMEM on error, 0 otherwise |
1045 | */ | 1024 | */ |
1046 | int zfcp_adapter_debug_register(struct zfcp_adapter *adapter) | 1025 | int zfcp_dbf_adapter_register(struct zfcp_adapter *adapter) |
1047 | { | 1026 | { |
1048 | char dbf_name[DEBUG_MAX_NAME_LEN]; | 1027 | char dbf_name[DEBUG_MAX_NAME_LEN]; |
1049 | struct zfcp_dbf *dbf; | 1028 | struct zfcp_dbf *dbf; |
@@ -1052,63 +1031,60 @@ int zfcp_adapter_debug_register(struct zfcp_adapter *adapter) | |||
1052 | if (!dbf) | 1031 | if (!dbf) |
1053 | return -ENOMEM; | 1032 | return -ENOMEM; |
1054 | 1033 | ||
1055 | spin_lock_init(&dbf->hba_dbf_lock); | 1034 | dbf->adapter = adapter; |
1056 | spin_lock_init(&dbf->san_dbf_lock); | 1035 | |
1057 | spin_lock_init(&dbf->scsi_dbf_lock); | 1036 | spin_lock_init(&dbf->hba_lock); |
1058 | spin_lock_init(&dbf->rec_dbf_lock); | 1037 | spin_lock_init(&dbf->san_lock); |
1038 | spin_lock_init(&dbf->scsi_lock); | ||
1039 | spin_lock_init(&dbf->rec_lock); | ||
1059 | 1040 | ||
1060 | /* debug feature area which records recovery activity */ | 1041 | /* debug feature area which records recovery activity */ |
1061 | sprintf(dbf_name, "zfcp_%s_rec", dev_name(&adapter->ccw_device->dev)); | 1042 | sprintf(dbf_name, "zfcp_%s_rec", dev_name(&adapter->ccw_device->dev)); |
1062 | dbf->rec_dbf = zfcp_dbf_reg(dbf_name, 3, &zfcp_rec_dbf_view, | 1043 | dbf->rec = zfcp_dbf_reg(dbf_name, 3, &zfcp_dbf_rec_view, |
1063 | sizeof(struct zfcp_rec_dbf_record)); | 1044 | sizeof(struct zfcp_dbf_rec_record)); |
1064 | if (!dbf->rec_dbf) | 1045 | if (!dbf->rec) |
1065 | goto fail_rec; | 1046 | goto err_out; |
1066 | 1047 | ||
1067 | /* debug feature area which records HBA (FSF and QDIO) conditions */ | 1048 | /* debug feature area which records HBA (FSF and QDIO) conditions */ |
1068 | sprintf(dbf_name, "zfcp_%s_hba", dev_name(&adapter->ccw_device->dev)); | 1049 | sprintf(dbf_name, "zfcp_%s_hba", dev_name(&adapter->ccw_device->dev)); |
1069 | dbf->hba_dbf = zfcp_dbf_reg(dbf_name, 3, &zfcp_hba_dbf_view, | 1050 | dbf->hba = zfcp_dbf_reg(dbf_name, 3, &zfcp_dbf_hba_view, |
1070 | sizeof(struct zfcp_hba_dbf_record)); | 1051 | sizeof(struct zfcp_dbf_hba_record)); |
1071 | if (!dbf->hba_dbf) | 1052 | if (!dbf->hba) |
1072 | goto fail_hba; | 1053 | goto err_out; |
1073 | 1054 | ||
1074 | /* debug feature area which records SAN command failures and recovery */ | 1055 | /* debug feature area which records SAN command failures and recovery */ |
1075 | sprintf(dbf_name, "zfcp_%s_san", dev_name(&adapter->ccw_device->dev)); | 1056 | sprintf(dbf_name, "zfcp_%s_san", dev_name(&adapter->ccw_device->dev)); |
1076 | dbf->san_dbf = zfcp_dbf_reg(dbf_name, 6, &zfcp_san_dbf_view, | 1057 | dbf->san = zfcp_dbf_reg(dbf_name, 6, &zfcp_dbf_san_view, |
1077 | sizeof(struct zfcp_san_dbf_record)); | 1058 | sizeof(struct zfcp_dbf_san_record)); |
1078 | if (!dbf->san_dbf) | 1059 | if (!dbf->san) |
1079 | goto fail_san; | 1060 | goto err_out; |
1080 | 1061 | ||
1081 | /* debug feature area which records SCSI command failures and recovery */ | 1062 | /* debug feature area which records SCSI command failures and recovery */ |
1082 | sprintf(dbf_name, "zfcp_%s_scsi", dev_name(&adapter->ccw_device->dev)); | 1063 | sprintf(dbf_name, "zfcp_%s_scsi", dev_name(&adapter->ccw_device->dev)); |
1083 | dbf->scsi_dbf = zfcp_dbf_reg(dbf_name, 3, &zfcp_scsi_dbf_view, | 1064 | dbf->scsi = zfcp_dbf_reg(dbf_name, 3, &zfcp_dbf_scsi_view, |
1084 | sizeof(struct zfcp_scsi_dbf_record)); | 1065 | sizeof(struct zfcp_dbf_scsi_record)); |
1085 | if (!dbf->scsi_dbf) | 1066 | if (!dbf->scsi) |
1086 | goto fail_scsi; | 1067 | goto err_out; |
1087 | 1068 | ||
1088 | adapter->dbf = dbf; | 1069 | adapter->dbf = dbf; |
1089 | return 0; | 1070 | return 0; |
1090 | 1071 | ||
1091 | fail_scsi: | 1072 | err_out: |
1092 | debug_unregister(dbf->san_dbf); | 1073 | zfcp_dbf_adapter_unregister(dbf); |
1093 | fail_san: | ||
1094 | debug_unregister(dbf->hba_dbf); | ||
1095 | fail_hba: | ||
1096 | debug_unregister(dbf->rec_dbf); | ||
1097 | fail_rec: | ||
1098 | kfree(dbf); | ||
1099 | return -ENOMEM; | 1074 | return -ENOMEM; |
1100 | } | 1075 | } |
1101 | 1076 | ||
1102 | /** | 1077 | /** |
1103 | * zfcp_adapter_debug_unregister - unregisters debug feature for an adapter | 1078 | * zfcp_adapter_debug_unregister - unregisters debug feature for an adapter |
1104 | * @adapter: pointer to adapter for which debug features should be unregistered | 1079 | * @dbf: pointer to dbf for which debug features should be unregistered |
1105 | */ | 1080 | */ |
1106 | void zfcp_adapter_debug_unregister(struct zfcp_adapter *adapter) | 1081 | void zfcp_dbf_adapter_unregister(struct zfcp_dbf *dbf) |
1107 | { | 1082 | { |
1108 | debug_unregister(adapter->dbf->scsi_dbf); | 1083 | debug_unregister(dbf->scsi); |
1109 | debug_unregister(adapter->dbf->san_dbf); | 1084 | debug_unregister(dbf->san); |
1110 | debug_unregister(adapter->dbf->hba_dbf); | 1085 | debug_unregister(dbf->hba); |
1111 | debug_unregister(adapter->dbf->rec_dbf); | 1086 | debug_unregister(dbf->rec); |
1112 | kfree(adapter->dbf); | 1087 | dbf->adapter->dbf = NULL; |
1113 | adapter->dbf = NULL; | 1088 | kfree(dbf); |
1114 | } | 1089 | } |
1090 | |||
diff --git a/drivers/s390/scsi/zfcp_dbf.h b/drivers/s390/scsi/zfcp_dbf.h index bceaff44903..6b1461e8f84 100644 --- a/drivers/s390/scsi/zfcp_dbf.h +++ b/drivers/s390/scsi/zfcp_dbf.h | |||
@@ -37,13 +37,13 @@ struct zfcp_dbf_dump { | |||
37 | u8 data[]; /* dump data */ | 37 | u8 data[]; /* dump data */ |
38 | } __attribute__ ((packed)); | 38 | } __attribute__ ((packed)); |
39 | 39 | ||
40 | struct zfcp_rec_dbf_record_thread { | 40 | struct zfcp_dbf_rec_record_thread { |
41 | u32 total; | 41 | u32 total; |
42 | u32 ready; | 42 | u32 ready; |
43 | u32 running; | 43 | u32 running; |
44 | }; | 44 | }; |
45 | 45 | ||
46 | struct zfcp_rec_dbf_record_target { | 46 | struct zfcp_dbf_rec_record_target { |
47 | u64 ref; | 47 | u64 ref; |
48 | u32 status; | 48 | u32 status; |
49 | u32 d_id; | 49 | u32 d_id; |
@@ -52,7 +52,7 @@ struct zfcp_rec_dbf_record_target { | |||
52 | u32 erp_count; | 52 | u32 erp_count; |
53 | }; | 53 | }; |
54 | 54 | ||
55 | struct zfcp_rec_dbf_record_trigger { | 55 | struct zfcp_dbf_rec_record_trigger { |
56 | u8 want; | 56 | u8 want; |
57 | u8 need; | 57 | u8 need; |
58 | u32 as; | 58 | u32 as; |
@@ -64,21 +64,21 @@ struct zfcp_rec_dbf_record_trigger { | |||
64 | u64 fcp_lun; | 64 | u64 fcp_lun; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | struct zfcp_rec_dbf_record_action { | 67 | struct zfcp_dbf_rec_record_action { |
68 | u32 status; | 68 | u32 status; |
69 | u32 step; | 69 | u32 step; |
70 | u64 action; | 70 | u64 action; |
71 | u64 fsf_req; | 71 | u64 fsf_req; |
72 | }; | 72 | }; |
73 | 73 | ||
74 | struct zfcp_rec_dbf_record { | 74 | struct zfcp_dbf_rec_record { |
75 | u8 id; | 75 | u8 id; |
76 | char id2[7]; | 76 | char id2[7]; |
77 | union { | 77 | union { |
78 | struct zfcp_rec_dbf_record_action action; | 78 | struct zfcp_dbf_rec_record_action action; |
79 | struct zfcp_rec_dbf_record_thread thread; | 79 | struct zfcp_dbf_rec_record_thread thread; |
80 | struct zfcp_rec_dbf_record_target target; | 80 | struct zfcp_dbf_rec_record_target target; |
81 | struct zfcp_rec_dbf_record_trigger trigger; | 81 | struct zfcp_dbf_rec_record_trigger trigger; |
82 | } u; | 82 | } u; |
83 | }; | 83 | }; |
84 | 84 | ||
@@ -89,7 +89,7 @@ enum { | |||
89 | ZFCP_REC_DBF_ID_TRIGGER, | 89 | ZFCP_REC_DBF_ID_TRIGGER, |
90 | }; | 90 | }; |
91 | 91 | ||
92 | struct zfcp_hba_dbf_record_response { | 92 | struct zfcp_dbf_hba_record_response { |
93 | u32 fsf_command; | 93 | u32 fsf_command; |
94 | u64 fsf_reqid; | 94 | u64 fsf_reqid; |
95 | u32 fsf_seqno; | 95 | u32 fsf_seqno; |
@@ -127,7 +127,7 @@ struct zfcp_hba_dbf_record_response { | |||
127 | } u; | 127 | } u; |
128 | } __attribute__ ((packed)); | 128 | } __attribute__ ((packed)); |
129 | 129 | ||
130 | struct zfcp_hba_dbf_record_status { | 130 | struct zfcp_dbf_hba_record_status { |
131 | u8 failed; | 131 | u8 failed; |
132 | u32 status_type; | 132 | u32 status_type; |
133 | u32 status_subtype; | 133 | u32 status_subtype; |
@@ -141,24 +141,24 @@ struct zfcp_hba_dbf_record_status { | |||
141 | u8 payload[ZFCP_DBF_UNSOL_PAYLOAD]; | 141 | u8 payload[ZFCP_DBF_UNSOL_PAYLOAD]; |
142 | } __attribute__ ((packed)); | 142 | } __attribute__ ((packed)); |
143 | 143 | ||
144 | struct zfcp_hba_dbf_record_qdio { | 144 | struct zfcp_dbf_hba_record_qdio { |
145 | u32 qdio_error; | 145 | u32 qdio_error; |
146 | u8 sbal_index; | 146 | u8 sbal_index; |
147 | u8 sbal_count; | 147 | u8 sbal_count; |
148 | } __attribute__ ((packed)); | 148 | } __attribute__ ((packed)); |
149 | 149 | ||
150 | struct zfcp_hba_dbf_record { | 150 | struct zfcp_dbf_hba_record { |
151 | u8 tag[ZFCP_DBF_TAG_SIZE]; | 151 | u8 tag[ZFCP_DBF_TAG_SIZE]; |
152 | u8 tag2[ZFCP_DBF_TAG_SIZE]; | 152 | u8 tag2[ZFCP_DBF_TAG_SIZE]; |
153 | union { | 153 | union { |
154 | struct zfcp_hba_dbf_record_response response; | 154 | struct zfcp_dbf_hba_record_response response; |
155 | struct zfcp_hba_dbf_record_status status; | 155 | struct zfcp_dbf_hba_record_status status; |
156 | struct zfcp_hba_dbf_record_qdio qdio; | 156 | struct zfcp_dbf_hba_record_qdio qdio; |
157 | struct fsf_bit_error_payload berr; | 157 | struct fsf_bit_error_payload berr; |
158 | } u; | 158 | } u; |
159 | } __attribute__ ((packed)); | 159 | } __attribute__ ((packed)); |
160 | 160 | ||
161 | struct zfcp_san_dbf_record_ct_request { | 161 | struct zfcp_dbf_san_record_ct_request { |
162 | u16 cmd_req_code; | 162 | u16 cmd_req_code; |
163 | u8 revision; | 163 | u8 revision; |
164 | u8 gs_type; | 164 | u8 gs_type; |
@@ -168,7 +168,7 @@ struct zfcp_san_dbf_record_ct_request { | |||
168 | u32 len; | 168 | u32 len; |
169 | } __attribute__ ((packed)); | 169 | } __attribute__ ((packed)); |
170 | 170 | ||
171 | struct zfcp_san_dbf_record_ct_response { | 171 | struct zfcp_dbf_san_record_ct_response { |
172 | u16 cmd_rsp_code; | 172 | u16 cmd_rsp_code; |
173 | u8 revision; | 173 | u8 revision; |
174 | u8 reason_code; | 174 | u8 reason_code; |
@@ -178,27 +178,27 @@ struct zfcp_san_dbf_record_ct_response { | |||
178 | u32 len; | 178 | u32 len; |
179 | } __attribute__ ((packed)); | 179 | } __attribute__ ((packed)); |
180 | 180 | ||
181 | struct zfcp_san_dbf_record_els { | 181 | struct zfcp_dbf_san_record_els { |
182 | u8 ls_code; | 182 | u8 ls_code; |
183 | u32 len; | 183 | u32 len; |
184 | } __attribute__ ((packed)); | 184 | } __attribute__ ((packed)); |
185 | 185 | ||
186 | struct zfcp_san_dbf_record { | 186 | struct zfcp_dbf_san_record { |
187 | u8 tag[ZFCP_DBF_TAG_SIZE]; | 187 | u8 tag[ZFCP_DBF_TAG_SIZE]; |
188 | u64 fsf_reqid; | 188 | u64 fsf_reqid; |
189 | u32 fsf_seqno; | 189 | u32 fsf_seqno; |
190 | u32 s_id; | 190 | u32 s_id; |
191 | u32 d_id; | 191 | u32 d_id; |
192 | union { | 192 | union { |
193 | struct zfcp_san_dbf_record_ct_request ct_req; | 193 | struct zfcp_dbf_san_record_ct_request ct_req; |
194 | struct zfcp_san_dbf_record_ct_response ct_resp; | 194 | struct zfcp_dbf_san_record_ct_response ct_resp; |
195 | struct zfcp_san_dbf_record_els els; | 195 | struct zfcp_dbf_san_record_els els; |
196 | } u; | 196 | } u; |
197 | #define ZFCP_DBF_SAN_MAX_PAYLOAD 1024 | 197 | #define ZFCP_DBF_SAN_MAX_PAYLOAD 1024 |
198 | u8 payload[32]; | 198 | u8 payload[32]; |
199 | } __attribute__ ((packed)); | 199 | } __attribute__ ((packed)); |
200 | 200 | ||
201 | struct zfcp_scsi_dbf_record { | 201 | struct zfcp_dbf_scsi_record { |
202 | u8 tag[ZFCP_DBF_TAG_SIZE]; | 202 | u8 tag[ZFCP_DBF_TAG_SIZE]; |
203 | u8 tag2[ZFCP_DBF_TAG_SIZE]; | 203 | u8 tag2[ZFCP_DBF_TAG_SIZE]; |
204 | u32 scsi_id; | 204 | u32 scsi_id; |
@@ -225,86 +225,84 @@ struct zfcp_scsi_dbf_record { | |||
225 | } __attribute__ ((packed)); | 225 | } __attribute__ ((packed)); |
226 | 226 | ||
227 | struct zfcp_dbf { | 227 | struct zfcp_dbf { |
228 | debug_info_t *rec_dbf; | 228 | debug_info_t *rec; |
229 | debug_info_t *hba_dbf; | 229 | debug_info_t *hba; |
230 | debug_info_t *san_dbf; | 230 | debug_info_t *san; |
231 | debug_info_t *scsi_dbf; | 231 | debug_info_t *scsi; |
232 | spinlock_t rec_dbf_lock; | 232 | spinlock_t rec_lock; |
233 | spinlock_t hba_dbf_lock; | 233 | spinlock_t hba_lock; |
234 | spinlock_t san_dbf_lock; | 234 | spinlock_t san_lock; |
235 | spinlock_t scsi_dbf_lock; | 235 | spinlock_t scsi_lock; |
236 | struct zfcp_rec_dbf_record rec_dbf_buf; | 236 | struct zfcp_dbf_rec_record rec_buf; |
237 | struct zfcp_hba_dbf_record hba_dbf_buf; | 237 | struct zfcp_dbf_hba_record hba_buf; |
238 | struct zfcp_san_dbf_record san_dbf_buf; | 238 | struct zfcp_dbf_san_record san_buf; |
239 | struct zfcp_scsi_dbf_record scsi_dbf_buf; | 239 | struct zfcp_dbf_scsi_record scsi_buf; |
240 | struct zfcp_adapter *adapter; | ||
240 | }; | 241 | }; |
241 | 242 | ||
242 | static inline | 243 | static inline |
243 | void zfcp_hba_dbf_event_fsf_resp(const char *tag2, int level, | 244 | void zfcp_dbf_hba_fsf_resp(const char *tag2, int level, |
244 | struct zfcp_fsf_req *req, struct zfcp_dbf *dbf) | 245 | struct zfcp_fsf_req *req, struct zfcp_dbf *dbf) |
245 | { | 246 | { |
246 | if (level <= dbf->hba_dbf->level) | 247 | if (level <= dbf->hba->level) |
247 | _zfcp_hba_dbf_event_fsf_response(tag2, level, req, dbf); | 248 | _zfcp_dbf_hba_fsf_response(tag2, level, req, dbf); |
248 | } | 249 | } |
249 | 250 | ||
250 | /** | 251 | /** |
251 | * zfcp_hba_dbf_event_fsf_response - trace event for request completion | 252 | * zfcp_dbf_hba_fsf_response - trace event for request completion |
252 | * @fsf_req: request that has been completed | 253 | * @fsf_req: request that has been completed |
253 | */ | 254 | */ |
254 | static inline void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *req) | 255 | static inline void zfcp_dbf_hba_fsf_response(struct zfcp_fsf_req *req) |
255 | { | 256 | { |
256 | struct zfcp_dbf *dbf = req->adapter->dbf; | 257 | struct zfcp_dbf *dbf = req->adapter->dbf; |
257 | struct fsf_qtcb *qtcb = req->qtcb; | 258 | struct fsf_qtcb *qtcb = req->qtcb; |
258 | 259 | ||
259 | if ((qtcb->prefix.prot_status != FSF_PROT_GOOD) && | 260 | if ((qtcb->prefix.prot_status != FSF_PROT_GOOD) && |
260 | (qtcb->prefix.prot_status != FSF_PROT_FSF_STATUS_PRESENTED)) { | 261 | (qtcb->prefix.prot_status != FSF_PROT_FSF_STATUS_PRESENTED)) { |
261 | zfcp_hba_dbf_event_fsf_resp("perr", 1, req, dbf); | 262 | zfcp_dbf_hba_fsf_resp("perr", 1, req, dbf); |
262 | 263 | ||
263 | } else if (qtcb->header.fsf_status != FSF_GOOD) { | 264 | } else if (qtcb->header.fsf_status != FSF_GOOD) { |
264 | zfcp_hba_dbf_event_fsf_resp("ferr", 1, req, dbf); | 265 | zfcp_dbf_hba_fsf_resp("ferr", 1, req, dbf); |
265 | 266 | ||
266 | } else if ((req->fsf_command == FSF_QTCB_OPEN_PORT_WITH_DID) || | 267 | } else if ((req->fsf_command == FSF_QTCB_OPEN_PORT_WITH_DID) || |
267 | (req->fsf_command == FSF_QTCB_OPEN_LUN)) { | 268 | (req->fsf_command == FSF_QTCB_OPEN_LUN)) { |
268 | zfcp_hba_dbf_event_fsf_resp("open", 4, req, dbf); | 269 | zfcp_dbf_hba_fsf_resp("open", 4, req, dbf); |
269 | 270 | ||
270 | } else if (qtcb->header.log_length) { | 271 | } else if (qtcb->header.log_length) { |
271 | zfcp_hba_dbf_event_fsf_resp("qtcb", 5, req, dbf); | 272 | zfcp_dbf_hba_fsf_resp("qtcb", 5, req, dbf); |
272 | 273 | ||
273 | } else { | 274 | } else { |
274 | zfcp_hba_dbf_event_fsf_resp("norm", 6, req, dbf); | 275 | zfcp_dbf_hba_fsf_resp("norm", 6, req, dbf); |
275 | } | 276 | } |
276 | } | 277 | } |
277 | 278 | ||
278 | /** | 279 | /** |
279 | * zfcp_hba_dbf_event_fsf_unsol - trace event for an unsolicited status buffer | 280 | * zfcp_dbf_hba_fsf_unsol - trace event for an unsolicited status buffer |
280 | * @tag: tag indicating which kind of unsolicited status has been received | 281 | * @tag: tag indicating which kind of unsolicited status has been received |
281 | * @adapter: adapter that has issued the unsolicited status buffer | 282 | * @dbf: reference to dbf structure |
282 | * @status_buffer: buffer containing payload of unsolicited status | 283 | * @status_buffer: buffer containing payload of unsolicited status |
283 | */ | 284 | */ |
284 | static inline | 285 | static inline |
285 | void zfcp_hba_dbf_event_fsf_unsol(const char *tag, struct zfcp_adapter *adapter, | 286 | void zfcp_dbf_hba_fsf_unsol(const char *tag, struct zfcp_dbf *dbf, |
286 | struct fsf_status_read_buffer *buf) | 287 | struct fsf_status_read_buffer *buf) |
287 | { | 288 | { |
288 | struct zfcp_dbf *dbf = adapter->dbf; | ||
289 | int level = 2; | 289 | int level = 2; |
290 | 290 | ||
291 | if (level <= dbf->hba_dbf->level) | 291 | if (level <= dbf->hba->level) |
292 | _zfcp_hba_dbf_event_fsf_unsol(tag, level, adapter, buf); | 292 | _zfcp_dbf_hba_fsf_unsol(tag, level, dbf, buf); |
293 | } | 293 | } |
294 | 294 | ||
295 | static inline | 295 | static inline |
296 | void zfcp_scsi_dbf_event(const char *tag, const char *tag2, int level, | 296 | void zfcp_dbf_scsi(const char *tag, const char *tag2, int level, |
297 | struct zfcp_adapter *adapter, struct scsi_cmnd *scmd, | 297 | struct zfcp_dbf *dbf, struct scsi_cmnd *scmd, |
298 | struct zfcp_fsf_req *req, unsigned long old_id) | 298 | struct zfcp_fsf_req *req, unsigned long old_id) |
299 | { | 299 | { |
300 | struct zfcp_dbf *dbf = adapter->dbf; | 300 | if (level <= dbf->scsi->level) |
301 | 301 | _zfcp_dbf_scsi(tag, tag2, level, dbf, scmd, req, old_id); | |
302 | if (level <= dbf->scsi_dbf->level) | ||
303 | _zfcp_scsi_dbf_event(tag, tag2, level, dbf, scmd, req, old_id); | ||
304 | } | 302 | } |
305 | 303 | ||
306 | /** | 304 | /** |
307 | * zfcp_scsi_dbf_event_result - trace event for SCSI command completion | 305 | * zfcp_dbf_scsi_result - trace event for SCSI command completion |
308 | * @tag: tag indicating success or failure of SCSI command | 306 | * @tag: tag indicating success or failure of SCSI command |
309 | * @level: trace level applicable for this event | 307 | * @level: trace level applicable for this event |
310 | * @adapter: adapter that has been used to issue the SCSI command | 308 | * @adapter: adapter that has been used to issue the SCSI command |
@@ -312,16 +310,14 @@ void zfcp_scsi_dbf_event(const char *tag, const char *tag2, int level, | |||
312 | * @fsf_req: request used to issue SCSI command (might be NULL) | 310 | * @fsf_req: request used to issue SCSI command (might be NULL) |
313 | */ | 311 | */ |
314 | static inline | 312 | static inline |
315 | void zfcp_scsi_dbf_event_result(const char *tag, int level, | 313 | void zfcp_dbf_scsi_result(const char *tag, int level, struct zfcp_dbf *dbf, |
316 | struct zfcp_adapter *adapter, | 314 | struct scsi_cmnd *scmd, struct zfcp_fsf_req *fsf_req) |
317 | struct scsi_cmnd *scmd, | ||
318 | struct zfcp_fsf_req *fsf_req) | ||
319 | { | 315 | { |
320 | zfcp_scsi_dbf_event("rslt", tag, level, adapter, scmd, fsf_req, 0); | 316 | zfcp_dbf_scsi("rslt", tag, level, dbf, scmd, fsf_req, 0); |
321 | } | 317 | } |
322 | 318 | ||
323 | /** | 319 | /** |
324 | * zfcp_scsi_dbf_event_abort - trace event for SCSI command abort | 320 | * zfcp_dbf_scsi_abort - trace event for SCSI command abort |
325 | * @tag: tag indicating success or failure of abort operation | 321 | * @tag: tag indicating success or failure of abort operation |
326 | * @adapter: adapter thas has been used to issue SCSI command to be aborted | 322 | * @adapter: adapter thas has been used to issue SCSI command to be aborted |
327 | * @scmd: SCSI command to be aborted | 323 | * @scmd: SCSI command to be aborted |
@@ -329,28 +325,26 @@ void zfcp_scsi_dbf_event_result(const char *tag, int level, | |||
329 | * @old_id: identifier of request containg SCSI command to be aborted | 325 | * @old_id: identifier of request containg SCSI command to be aborted |
330 | */ | 326 | */ |
331 | static inline | 327 | static inline |
332 | void zfcp_scsi_dbf_event_abort(const char *tag, struct zfcp_adapter *adapter, | 328 | void zfcp_dbf_scsi_abort(const char *tag, struct zfcp_dbf *dbf, |
333 | struct scsi_cmnd *scmd, | 329 | struct scsi_cmnd *scmd, struct zfcp_fsf_req *new_req, |
334 | struct zfcp_fsf_req *new_req, | 330 | unsigned long old_id) |
335 | unsigned long old_id) | ||
336 | { | 331 | { |
337 | zfcp_scsi_dbf_event("abrt", tag, 1, adapter, scmd, new_req, old_id); | 332 | zfcp_dbf_scsi("abrt", tag, 1, dbf, scmd, new_req, old_id); |
338 | } | 333 | } |
339 | 334 | ||
340 | /** | 335 | /** |
341 | * zfcp_scsi_dbf_event_devreset - trace event for Logical Unit or Target Reset | 336 | * zfcp_dbf_scsi_devreset - trace event for Logical Unit or Target Reset |
342 | * @tag: tag indicating success or failure of reset operation | 337 | * @tag: tag indicating success or failure of reset operation |
343 | * @flag: indicates type of reset (Target Reset, Logical Unit Reset) | 338 | * @flag: indicates type of reset (Target Reset, Logical Unit Reset) |
344 | * @unit: unit that needs reset | 339 | * @unit: unit that needs reset |
345 | * @scsi_cmnd: SCSI command which caused this error recovery | 340 | * @scsi_cmnd: SCSI command which caused this error recovery |
346 | */ | 341 | */ |
347 | static inline | 342 | static inline |
348 | void zfcp_scsi_dbf_event_devreset(const char *tag, u8 flag, | 343 | void zfcp_dbf_scsi_devreset(const char *tag, u8 flag, struct zfcp_unit *unit, |
349 | struct zfcp_unit *unit, | 344 | struct scsi_cmnd *scsi_cmnd) |
350 | struct scsi_cmnd *scsi_cmnd) | ||
351 | { | 345 | { |
352 | zfcp_scsi_dbf_event(flag == FCP_TARGET_RESET ? "trst" : "lrst", tag, 1, | 346 | zfcp_dbf_scsi(flag == FCP_TARGET_RESET ? "trst" : "lrst", tag, 1, |
353 | unit->port->adapter, scsi_cmnd, NULL, 0); | 347 | unit->port->adapter->dbf, scsi_cmnd, NULL, 0); |
354 | } | 348 | } |
355 | 349 | ||
356 | #endif /* ZFCP_DBF_H */ | 350 | #endif /* ZFCP_DBF_H */ |
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 67297d2744f..373567eda8f 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -74,9 +74,9 @@ static void zfcp_erp_action_ready(struct zfcp_erp_action *act) | |||
74 | struct zfcp_adapter *adapter = act->adapter; | 74 | struct zfcp_adapter *adapter = act->adapter; |
75 | 75 | ||
76 | list_move(&act->list, &act->adapter->erp_ready_head); | 76 | list_move(&act->list, &act->adapter->erp_ready_head); |
77 | zfcp_rec_dbf_event_action("erardy1", act); | 77 | zfcp_dbf_rec_action("erardy1", act); |
78 | up(&adapter->erp_ready_sem); | 78 | up(&adapter->erp_ready_sem); |
79 | zfcp_rec_dbf_event_thread("erardy2", adapter); | 79 | zfcp_dbf_rec_thread("erardy2", adapter->dbf); |
80 | } | 80 | } |
81 | 81 | ||
82 | static void zfcp_erp_action_dismiss(struct zfcp_erp_action *act) | 82 | static void zfcp_erp_action_dismiss(struct zfcp_erp_action *act) |
@@ -227,11 +227,10 @@ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, | |||
227 | ++adapter->erp_total_count; | 227 | ++adapter->erp_total_count; |
228 | list_add_tail(&act->list, &adapter->erp_ready_head); | 228 | list_add_tail(&act->list, &adapter->erp_ready_head); |
229 | up(&adapter->erp_ready_sem); | 229 | up(&adapter->erp_ready_sem); |
230 | zfcp_rec_dbf_event_thread("eracte1", adapter); | 230 | zfcp_dbf_rec_thread("eracte1", adapter->dbf); |
231 | retval = 0; | 231 | retval = 0; |
232 | out: | 232 | out: |
233 | zfcp_rec_dbf_event_trigger(id, ref, want, need, act, | 233 | zfcp_dbf_rec_trigger(id, ref, want, need, act, adapter, port, unit); |
234 | adapter, port, unit); | ||
235 | return retval; | 234 | return retval; |
236 | } | 235 | } |
237 | 236 | ||
@@ -442,28 +441,28 @@ static int status_change_clear(unsigned long mask, atomic_t *status) | |||
442 | static void zfcp_erp_adapter_unblock(struct zfcp_adapter *adapter) | 441 | static void zfcp_erp_adapter_unblock(struct zfcp_adapter *adapter) |
443 | { | 442 | { |
444 | if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status)) | 443 | if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status)) |
445 | zfcp_rec_dbf_event_adapter("eraubl1", NULL, adapter); | 444 | zfcp_dbf_rec_adapter("eraubl1", NULL, adapter->dbf); |
446 | atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status); | 445 | atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status); |
447 | } | 446 | } |
448 | 447 | ||
449 | static void zfcp_erp_port_unblock(struct zfcp_port *port) | 448 | static void zfcp_erp_port_unblock(struct zfcp_port *port) |
450 | { | 449 | { |
451 | if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status)) | 450 | if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status)) |
452 | zfcp_rec_dbf_event_port("erpubl1", NULL, port); | 451 | zfcp_dbf_rec_port("erpubl1", NULL, port); |
453 | atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status); | 452 | atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status); |
454 | } | 453 | } |
455 | 454 | ||
456 | static void zfcp_erp_unit_unblock(struct zfcp_unit *unit) | 455 | static void zfcp_erp_unit_unblock(struct zfcp_unit *unit) |
457 | { | 456 | { |
458 | if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status)) | 457 | if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status)) |
459 | zfcp_rec_dbf_event_unit("eruubl1", NULL, unit); | 458 | zfcp_dbf_rec_unit("eruubl1", NULL, unit); |
460 | atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status); | 459 | atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status); |
461 | } | 460 | } |
462 | 461 | ||
463 | static void zfcp_erp_action_to_running(struct zfcp_erp_action *erp_action) | 462 | static void zfcp_erp_action_to_running(struct zfcp_erp_action *erp_action) |
464 | { | 463 | { |
465 | list_move(&erp_action->list, &erp_action->adapter->erp_running_head); | 464 | list_move(&erp_action->list, &erp_action->adapter->erp_running_head); |
466 | zfcp_rec_dbf_event_action("erator1", erp_action); | 465 | zfcp_dbf_rec_action("erator1", erp_action); |
467 | } | 466 | } |
468 | 467 | ||
469 | static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *act) | 468 | static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *act) |
@@ -479,11 +478,11 @@ static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *act) | |||
479 | if (act->status & (ZFCP_STATUS_ERP_DISMISSED | | 478 | if (act->status & (ZFCP_STATUS_ERP_DISMISSED | |
480 | ZFCP_STATUS_ERP_TIMEDOUT)) { | 479 | ZFCP_STATUS_ERP_TIMEDOUT)) { |
481 | act->fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED; | 480 | act->fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED; |
482 | zfcp_rec_dbf_event_action("erscf_1", act); | 481 | zfcp_dbf_rec_action("erscf_1", act); |
483 | act->fsf_req->erp_action = NULL; | 482 | act->fsf_req->erp_action = NULL; |
484 | } | 483 | } |
485 | if (act->status & ZFCP_STATUS_ERP_TIMEDOUT) | 484 | if (act->status & ZFCP_STATUS_ERP_TIMEDOUT) |
486 | zfcp_rec_dbf_event_action("erscf_2", act); | 485 | zfcp_dbf_rec_action("erscf_2", act); |
487 | if (act->fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED) | 486 | if (act->fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED) |
488 | act->fsf_req = NULL; | 487 | act->fsf_req = NULL; |
489 | } else | 488 | } else |
@@ -641,9 +640,9 @@ static int zfcp_erp_adapter_strat_fsf_xconf(struct zfcp_erp_action *erp_action) | |||
641 | return ZFCP_ERP_FAILED; | 640 | return ZFCP_ERP_FAILED; |
642 | } | 641 | } |
643 | 642 | ||
644 | zfcp_rec_dbf_event_thread_lock("erasfx1", adapter); | 643 | zfcp_dbf_rec_thread_lock("erasfx1", adapter->dbf); |
645 | down(&adapter->erp_ready_sem); | 644 | down(&adapter->erp_ready_sem); |
646 | zfcp_rec_dbf_event_thread_lock("erasfx2", adapter); | 645 | zfcp_dbf_rec_thread_lock("erasfx2", adapter->dbf); |
647 | if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) | 646 | if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) |
648 | break; | 647 | break; |
649 | 648 | ||
@@ -682,9 +681,9 @@ static int zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *act) | |||
682 | if (ret) | 681 | if (ret) |
683 | return ZFCP_ERP_FAILED; | 682 | return ZFCP_ERP_FAILED; |
684 | 683 | ||
685 | zfcp_rec_dbf_event_thread_lock("erasox1", adapter); | 684 | zfcp_dbf_rec_thread_lock("erasox1", adapter->dbf); |
686 | down(&adapter->erp_ready_sem); | 685 | down(&adapter->erp_ready_sem); |
687 | zfcp_rec_dbf_event_thread_lock("erasox2", adapter); | 686 | zfcp_dbf_rec_thread_lock("erasox2", adapter->dbf); |
688 | if (act->status & ZFCP_STATUS_ERP_TIMEDOUT) | 687 | if (act->status & ZFCP_STATUS_ERP_TIMEDOUT) |
689 | return ZFCP_ERP_FAILED; | 688 | return ZFCP_ERP_FAILED; |
690 | 689 | ||
@@ -1138,7 +1137,7 @@ static void zfcp_erp_action_dequeue(struct zfcp_erp_action *erp_action) | |||
1138 | } | 1137 | } |
1139 | 1138 | ||
1140 | list_del(&erp_action->list); | 1139 | list_del(&erp_action->list); |
1141 | zfcp_rec_dbf_event_action("eractd1", erp_action); | 1140 | zfcp_dbf_rec_action("eractd1", erp_action); |
1142 | 1141 | ||
1143 | switch (erp_action->action) { | 1142 | switch (erp_action->action) { |
1144 | case ZFCP_ERP_ACTION_REOPEN_UNIT: | 1143 | case ZFCP_ERP_ACTION_REOPEN_UNIT: |
@@ -1297,9 +1296,9 @@ static int zfcp_erp_thread(void *data) | |||
1297 | while (!(atomic_read(&adapter->status) & | 1296 | while (!(atomic_read(&adapter->status) & |
1298 | ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL)) { | 1297 | ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL)) { |
1299 | 1298 | ||
1300 | zfcp_rec_dbf_event_thread_lock("erthrd1", adapter); | 1299 | zfcp_dbf_rec_thread_lock("erthrd1", adapter->dbf); |
1301 | ignore = down_interruptible(&adapter->erp_ready_sem); | 1300 | ignore = down_interruptible(&adapter->erp_ready_sem); |
1302 | zfcp_rec_dbf_event_thread_lock("erthrd2", adapter); | 1301 | zfcp_dbf_rec_thread_lock("erthrd2", adapter->dbf); |
1303 | 1302 | ||
1304 | write_lock_irqsave(&adapter->erp_lock, flags); | 1303 | write_lock_irqsave(&adapter->erp_lock, flags); |
1305 | next = adapter->erp_ready_head.next; | 1304 | next = adapter->erp_ready_head.next; |
@@ -1356,7 +1355,7 @@ void zfcp_erp_thread_kill(struct zfcp_adapter *adapter) | |||
1356 | { | 1355 | { |
1357 | atomic_set_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL, &adapter->status); | 1356 | atomic_set_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL, &adapter->status); |
1358 | up(&adapter->erp_ready_sem); | 1357 | up(&adapter->erp_ready_sem); |
1359 | zfcp_rec_dbf_event_thread_lock("erthrk1", adapter); | 1358 | zfcp_dbf_rec_thread_lock("erthrk1", adapter->dbf); |
1360 | 1359 | ||
1361 | wait_event(adapter->erp_thread_wqh, | 1360 | wait_event(adapter->erp_thread_wqh, |
1362 | !(atomic_read(&adapter->status) & | 1361 | !(atomic_read(&adapter->status) & |
@@ -1431,11 +1430,11 @@ void zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, char *id, | |||
1431 | 1430 | ||
1432 | if (set_or_clear == ZFCP_SET) { | 1431 | if (set_or_clear == ZFCP_SET) { |
1433 | if (status_change_set(mask, &adapter->status)) | 1432 | if (status_change_set(mask, &adapter->status)) |
1434 | zfcp_rec_dbf_event_adapter(id, ref, adapter); | 1433 | zfcp_dbf_rec_adapter(id, ref, adapter->dbf); |
1435 | atomic_set_mask(mask, &adapter->status); | 1434 | atomic_set_mask(mask, &adapter->status); |
1436 | } else { | 1435 | } else { |
1437 | if (status_change_clear(mask, &adapter->status)) | 1436 | if (status_change_clear(mask, &adapter->status)) |
1438 | zfcp_rec_dbf_event_adapter(id, ref, adapter); | 1437 | zfcp_dbf_rec_adapter(id, ref, adapter->dbf); |
1439 | atomic_clear_mask(mask, &adapter->status); | 1438 | atomic_clear_mask(mask, &adapter->status); |
1440 | if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) | 1439 | if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) |
1441 | atomic_set(&adapter->erp_counter, 0); | 1440 | atomic_set(&adapter->erp_counter, 0); |
@@ -1465,11 +1464,11 @@ void zfcp_erp_modify_port_status(struct zfcp_port *port, char *id, void *ref, | |||
1465 | 1464 | ||
1466 | if (set_or_clear == ZFCP_SET) { | 1465 | if (set_or_clear == ZFCP_SET) { |
1467 | if (status_change_set(mask, &port->status)) | 1466 | if (status_change_set(mask, &port->status)) |
1468 | zfcp_rec_dbf_event_port(id, ref, port); | 1467 | zfcp_dbf_rec_port(id, ref, port); |
1469 | atomic_set_mask(mask, &port->status); | 1468 | atomic_set_mask(mask, &port->status); |
1470 | } else { | 1469 | } else { |
1471 | if (status_change_clear(mask, &port->status)) | 1470 | if (status_change_clear(mask, &port->status)) |
1472 | zfcp_rec_dbf_event_port(id, ref, port); | 1471 | zfcp_dbf_rec_port(id, ref, port); |
1473 | atomic_clear_mask(mask, &port->status); | 1472 | atomic_clear_mask(mask, &port->status); |
1474 | if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) | 1473 | if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) |
1475 | atomic_set(&port->erp_counter, 0); | 1474 | atomic_set(&port->erp_counter, 0); |
@@ -1494,11 +1493,11 @@ void zfcp_erp_modify_unit_status(struct zfcp_unit *unit, char *id, void *ref, | |||
1494 | { | 1493 | { |
1495 | if (set_or_clear == ZFCP_SET) { | 1494 | if (set_or_clear == ZFCP_SET) { |
1496 | if (status_change_set(mask, &unit->status)) | 1495 | if (status_change_set(mask, &unit->status)) |
1497 | zfcp_rec_dbf_event_unit(id, ref, unit); | 1496 | zfcp_dbf_rec_unit(id, ref, unit); |
1498 | atomic_set_mask(mask, &unit->status); | 1497 | atomic_set_mask(mask, &unit->status); |
1499 | } else { | 1498 | } else { |
1500 | if (status_change_clear(mask, &unit->status)) | 1499 | if (status_change_clear(mask, &unit->status)) |
1501 | zfcp_rec_dbf_event_unit(id, ref, unit); | 1500 | zfcp_dbf_rec_unit(id, ref, unit); |
1502 | atomic_clear_mask(mask, &unit->status); | 1501 | atomic_clear_mask(mask, &unit->status); |
1503 | if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) { | 1502 | if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) { |
1504 | atomic_set(&unit->erp_counter, 0); | 1503 | atomic_set(&unit->erp_counter, 0); |
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index 7650cec7f71..a49d00921b9 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h | |||
@@ -34,35 +34,31 @@ extern struct zfcp_adapter *zfcp_get_adapter_by_busid(char *); | |||
34 | extern struct miscdevice zfcp_cfdc_misc; | 34 | extern struct miscdevice zfcp_cfdc_misc; |
35 | 35 | ||
36 | /* zfcp_dbf.c */ | 36 | /* zfcp_dbf.c */ |
37 | extern int zfcp_adapter_debug_register(struct zfcp_adapter *); | 37 | extern int zfcp_dbf_adapter_register(struct zfcp_adapter *); |
38 | extern void zfcp_adapter_debug_unregister(struct zfcp_adapter *); | 38 | extern void zfcp_dbf_adapter_unregister(struct zfcp_dbf *); |
39 | extern void zfcp_rec_dbf_event_thread(char *, struct zfcp_adapter *); | 39 | extern void zfcp_dbf_rec_thread(char *, struct zfcp_dbf *); |
40 | extern void zfcp_rec_dbf_event_thread_lock(char *, struct zfcp_adapter *); | 40 | extern void zfcp_dbf_rec_thread_lock(char *, struct zfcp_dbf *); |
41 | extern void zfcp_rec_dbf_event_adapter(char *, void *, struct zfcp_adapter *); | 41 | extern void zfcp_dbf_rec_adapter(char *, void *, struct zfcp_dbf *); |
42 | extern void zfcp_rec_dbf_event_port(char *, void *, struct zfcp_port *); | 42 | extern void zfcp_dbf_rec_port(char *, void *, struct zfcp_port *); |
43 | extern void zfcp_rec_dbf_event_unit(char *, void *, struct zfcp_unit *); | 43 | extern void zfcp_dbf_rec_unit(char *, void *, struct zfcp_unit *); |
44 | extern void zfcp_rec_dbf_event_trigger(char *, void *, u8, u8, void *, | 44 | extern void zfcp_dbf_rec_trigger(char *, void *, u8, u8, void *, |
45 | struct zfcp_adapter *, | 45 | struct zfcp_adapter *, struct zfcp_port *, |
46 | struct zfcp_port *, struct zfcp_unit *); | 46 | struct zfcp_unit *); |
47 | extern void zfcp_rec_dbf_event_action(char *, struct zfcp_erp_action *); | 47 | extern void zfcp_dbf_rec_action(char *, struct zfcp_erp_action *); |
48 | extern void _zfcp_hba_dbf_event_fsf_response(const char *, int level, | 48 | extern void _zfcp_dbf_hba_fsf_response(const char *, int, struct zfcp_fsf_req *, |
49 | struct zfcp_fsf_req *, | 49 | struct zfcp_dbf *); |
50 | struct zfcp_dbf *dbf); | 50 | extern void _zfcp_dbf_hba_fsf_unsol(const char *, int level, struct zfcp_dbf *, |
51 | extern void _zfcp_hba_dbf_event_fsf_unsol(const char *, int level, | ||
52 | struct zfcp_adapter *, | ||
53 | struct fsf_status_read_buffer *); | 51 | struct fsf_status_read_buffer *); |
54 | extern void zfcp_hba_dbf_event_qdio(struct zfcp_qdio *, unsigned int, int, | 52 | extern void zfcp_dbf_hba_qdio(struct zfcp_dbf *, unsigned int, int, int); |
55 | int); | 53 | extern void zfcp_dbf_hba_berr(struct zfcp_dbf *, struct zfcp_fsf_req *); |
56 | extern void zfcp_hba_dbf_event_berr(struct zfcp_adapter *, | 54 | extern void zfcp_dbf_san_ct_request(struct zfcp_fsf_req *); |
57 | struct zfcp_fsf_req *); | 55 | extern void zfcp_dbf_san_ct_response(struct zfcp_fsf_req *); |
58 | extern void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *); | 56 | extern void zfcp_dbf_san_els_request(struct zfcp_fsf_req *); |
59 | extern void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *); | 57 | extern void zfcp_dbf_san_els_response(struct zfcp_fsf_req *); |
60 | extern void zfcp_san_dbf_event_els_request(struct zfcp_fsf_req *); | 58 | extern void zfcp_dbf_san_incoming_els(struct zfcp_fsf_req *); |
61 | extern void zfcp_san_dbf_event_els_response(struct zfcp_fsf_req *); | 59 | extern void _zfcp_dbf_scsi(const char *, const char *, int, struct zfcp_dbf *, |
62 | extern void zfcp_san_dbf_event_incoming_els(struct zfcp_fsf_req *); | 60 | struct scsi_cmnd *, struct zfcp_fsf_req *, |
63 | extern void _zfcp_scsi_dbf_event(const char *, const char *, int, | 61 | unsigned long); |
64 | struct zfcp_dbf *, struct scsi_cmnd *, | ||
65 | struct zfcp_fsf_req *, unsigned long); | ||
66 | 62 | ||
67 | /* zfcp_erp.c */ | 63 | /* zfcp_erp.c */ |
68 | extern void zfcp_erp_modify_adapter_status(struct zfcp_adapter *, char *, | 64 | extern void zfcp_erp_modify_adapter_status(struct zfcp_adapter *, char *, |
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index bc0c9f54d0d..309f1dfad3f 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c | |||
@@ -242,7 +242,7 @@ void zfcp_fc_incoming_els(struct zfcp_fsf_req *fsf_req) | |||
242 | (struct fsf_status_read_buffer *) fsf_req->data; | 242 | (struct fsf_status_read_buffer *) fsf_req->data; |
243 | unsigned int els_type = status_buffer->payload.data[0]; | 243 | unsigned int els_type = status_buffer->payload.data[0]; |
244 | 244 | ||
245 | zfcp_san_dbf_event_incoming_els(fsf_req); | 245 | zfcp_dbf_san_incoming_els(fsf_req); |
246 | if (els_type == LS_PLOGI) | 246 | if (els_type == LS_PLOGI) |
247 | zfcp_fc_incoming_plogi(fsf_req); | 247 | zfcp_fc_incoming_plogi(fsf_req); |
248 | else if (els_type == LS_LOGO) | 248 | else if (els_type == LS_LOGO) |
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 048f1a848f3..665967f049a 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -248,13 +248,13 @@ static void zfcp_fsf_status_read_handler(struct zfcp_fsf_req *req) | |||
248 | struct fsf_status_read_buffer *sr_buf = req->data; | 248 | struct fsf_status_read_buffer *sr_buf = req->data; |
249 | 249 | ||
250 | if (req->status & ZFCP_STATUS_FSFREQ_DISMISSED) { | 250 | if (req->status & ZFCP_STATUS_FSFREQ_DISMISSED) { |
251 | zfcp_hba_dbf_event_fsf_unsol("dism", adapter, sr_buf); | 251 | zfcp_dbf_hba_fsf_unsol("dism", adapter->dbf, sr_buf); |
252 | mempool_free(sr_buf, adapter->pool.status_read_data); | 252 | mempool_free(sr_buf, adapter->pool.status_read_data); |
253 | zfcp_fsf_req_free(req); | 253 | zfcp_fsf_req_free(req); |
254 | return; | 254 | return; |
255 | } | 255 | } |
256 | 256 | ||
257 | zfcp_hba_dbf_event_fsf_unsol("read", adapter, sr_buf); | 257 | zfcp_dbf_hba_fsf_unsol("read", adapter->dbf, sr_buf); |
258 | 258 | ||
259 | switch (sr_buf->status_type) { | 259 | switch (sr_buf->status_type) { |
260 | case FSF_STATUS_READ_PORT_CLOSED: | 260 | case FSF_STATUS_READ_PORT_CLOSED: |
@@ -269,7 +269,7 @@ static void zfcp_fsf_status_read_handler(struct zfcp_fsf_req *req) | |||
269 | dev_warn(&adapter->ccw_device->dev, | 269 | dev_warn(&adapter->ccw_device->dev, |
270 | "The error threshold for checksum statistics " | 270 | "The error threshold for checksum statistics " |
271 | "has been exceeded\n"); | 271 | "has been exceeded\n"); |
272 | zfcp_hba_dbf_event_berr(adapter, req); | 272 | zfcp_dbf_hba_berr(adapter->dbf, req); |
273 | break; | 273 | break; |
274 | case FSF_STATUS_READ_LINK_DOWN: | 274 | case FSF_STATUS_READ_LINK_DOWN: |
275 | zfcp_fsf_status_read_link_down(req); | 275 | zfcp_fsf_status_read_link_down(req); |
@@ -355,7 +355,7 @@ static void zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *req) | |||
355 | struct fsf_qtcb *qtcb = req->qtcb; | 355 | struct fsf_qtcb *qtcb = req->qtcb; |
356 | union fsf_prot_status_qual *psq = &qtcb->prefix.prot_status_qual; | 356 | union fsf_prot_status_qual *psq = &qtcb->prefix.prot_status_qual; |
357 | 357 | ||
358 | zfcp_hba_dbf_event_fsf_response(req); | 358 | zfcp_dbf_hba_fsf_response(req); |
359 | 359 | ||
360 | if (req->status & ZFCP_STATUS_FSFREQ_DISMISSED) { | 360 | if (req->status & ZFCP_STATUS_FSFREQ_DISMISSED) { |
361 | req->status |= ZFCP_STATUS_FSFREQ_ERROR | | 361 | req->status |= ZFCP_STATUS_FSFREQ_ERROR | |
@@ -848,7 +848,7 @@ failed_req_send: | |||
848 | mempool_free(sr_buf, adapter->pool.status_read_data); | 848 | mempool_free(sr_buf, adapter->pool.status_read_data); |
849 | failed_buf: | 849 | failed_buf: |
850 | zfcp_fsf_req_free(req); | 850 | zfcp_fsf_req_free(req); |
851 | zfcp_hba_dbf_event_fsf_unsol("fail", adapter, NULL); | 851 | zfcp_dbf_hba_fsf_unsol("fail", adapter->dbf, NULL); |
852 | out: | 852 | out: |
853 | spin_unlock_bh(&qdio->req_q_lock); | 853 | spin_unlock_bh(&qdio->req_q_lock); |
854 | return retval; | 854 | return retval; |
@@ -968,7 +968,7 @@ static void zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *req) | |||
968 | 968 | ||
969 | switch (header->fsf_status) { | 969 | switch (header->fsf_status) { |
970 | case FSF_GOOD: | 970 | case FSF_GOOD: |
971 | zfcp_san_dbf_event_ct_response(req); | 971 | zfcp_dbf_san_ct_response(req); |
972 | send_ct->status = 0; | 972 | send_ct->status = 0; |
973 | break; | 973 | break; |
974 | case FSF_SERVICE_CLASS_NOT_SUPPORTED: | 974 | case FSF_SERVICE_CLASS_NOT_SUPPORTED: |
@@ -1100,7 +1100,7 @@ int zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool) | |||
1100 | req->qtcb->bottom.support.timeout = ct->timeout; | 1100 | req->qtcb->bottom.support.timeout = ct->timeout; |
1101 | req->data = ct; | 1101 | req->data = ct; |
1102 | 1102 | ||
1103 | zfcp_san_dbf_event_ct_request(req); | 1103 | zfcp_dbf_san_ct_request(req); |
1104 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); | 1104 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); |
1105 | 1105 | ||
1106 | ret = zfcp_fsf_req_send(req); | 1106 | ret = zfcp_fsf_req_send(req); |
@@ -1129,7 +1129,7 @@ static void zfcp_fsf_send_els_handler(struct zfcp_fsf_req *req) | |||
1129 | 1129 | ||
1130 | switch (header->fsf_status) { | 1130 | switch (header->fsf_status) { |
1131 | case FSF_GOOD: | 1131 | case FSF_GOOD: |
1132 | zfcp_san_dbf_event_els_response(req); | 1132 | zfcp_dbf_san_els_response(req); |
1133 | send_els->status = 0; | 1133 | send_els->status = 0; |
1134 | break; | 1134 | break; |
1135 | case FSF_SERVICE_CLASS_NOT_SUPPORTED: | 1135 | case FSF_SERVICE_CLASS_NOT_SUPPORTED: |
@@ -1203,7 +1203,7 @@ int zfcp_fsf_send_els(struct zfcp_send_els *els) | |||
1203 | bottom->timeout = 2 * R_A_TOV; | 1203 | bottom->timeout = 2 * R_A_TOV; |
1204 | req->data = els; | 1204 | req->data = els; |
1205 | 1205 | ||
1206 | zfcp_san_dbf_event_els_request(req); | 1206 | zfcp_dbf_san_els_request(req); |
1207 | 1207 | ||
1208 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); | 1208 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); |
1209 | ret = zfcp_fsf_req_send(req); | 1209 | ret = zfcp_fsf_req_send(req); |
@@ -2213,11 +2213,11 @@ static void zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *req) | |||
2213 | } | 2213 | } |
2214 | skip_fsfstatus: | 2214 | skip_fsfstatus: |
2215 | if (scpnt->result != 0) | 2215 | if (scpnt->result != 0) |
2216 | zfcp_scsi_dbf_event_result("erro", 3, req->adapter, scpnt, req); | 2216 | zfcp_dbf_scsi_result("erro", 3, req->adapter->dbf, scpnt, req); |
2217 | else if (scpnt->retries > 0) | 2217 | else if (scpnt->retries > 0) |
2218 | zfcp_scsi_dbf_event_result("retr", 4, req->adapter, scpnt, req); | 2218 | zfcp_dbf_scsi_result("retr", 4, req->adapter->dbf, scpnt, req); |
2219 | else | 2219 | else |
2220 | zfcp_scsi_dbf_event_result("norm", 6, req->adapter, scpnt, req); | 2220 | zfcp_dbf_scsi_result("norm", 6, req->adapter->dbf, scpnt, req); |
2221 | 2221 | ||
2222 | scpnt->host_scribble = NULL; | 2222 | scpnt->host_scribble = NULL; |
2223 | (scpnt->scsi_done) (scpnt); | 2223 | (scpnt->scsi_done) (scpnt); |
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c index 0b3f634509b..84527ebbbe5 100644 --- a/drivers/s390/scsi/zfcp_qdio.c +++ b/drivers/s390/scsi/zfcp_qdio.c | |||
@@ -101,7 +101,8 @@ static void zfcp_qdio_int_req(struct ccw_device *cdev, unsigned int qdio_err, | |||
101 | struct zfcp_qdio_queue *queue = &qdio->req_q; | 101 | struct zfcp_qdio_queue *queue = &qdio->req_q; |
102 | 102 | ||
103 | if (unlikely(qdio_err)) { | 103 | if (unlikely(qdio_err)) { |
104 | zfcp_hba_dbf_event_qdio(qdio, qdio_err, first, count); | 104 | zfcp_dbf_hba_qdio(qdio->adapter->dbf, qdio_err, first, |
105 | count); | ||
105 | zfcp_qdio_handler_error(qdio, "qdireq1"); | 106 | zfcp_qdio_handler_error(qdio, "qdireq1"); |
106 | return; | 107 | return; |
107 | } | 108 | } |
@@ -143,7 +144,8 @@ static void zfcp_qdio_int_resp(struct ccw_device *cdev, unsigned int qdio_err, | |||
143 | int sbal_idx, sbal_no; | 144 | int sbal_idx, sbal_no; |
144 | 145 | ||
145 | if (unlikely(qdio_err)) { | 146 | if (unlikely(qdio_err)) { |
146 | zfcp_hba_dbf_event_qdio(qdio, qdio_err, first, count); | 147 | zfcp_dbf_hba_qdio(qdio->adapter->dbf, qdio_err, first, |
148 | count); | ||
147 | zfcp_qdio_handler_error(qdio, "qdires1"); | 149 | zfcp_qdio_handler_error(qdio, "qdires1"); |
148 | return; | 150 | return; |
149 | } | 151 | } |
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 4414720c87f..b6177ad2d5b 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -53,11 +53,11 @@ static int zfcp_scsi_slave_configure(struct scsi_device *sdp) | |||
53 | 53 | ||
54 | static void zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result) | 54 | static void zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result) |
55 | { | 55 | { |
56 | struct zfcp_adapter *adapter = | ||
57 | (struct zfcp_adapter *) scpnt->device->host->hostdata[0]; | ||
56 | set_host_byte(scpnt, result); | 58 | set_host_byte(scpnt, result); |
57 | if ((scpnt->device != NULL) && (scpnt->device->host != NULL)) | 59 | if ((scpnt->device != NULL) && (scpnt->device->host != NULL)) |
58 | zfcp_scsi_dbf_event_result("fail", 4, | 60 | zfcp_dbf_scsi_result("fail", 4, adapter->dbf, scpnt, NULL); |
59 | (struct zfcp_adapter*) scpnt->device->host->hostdata[0], | ||
60 | scpnt, NULL); | ||
61 | /* return directly */ | 61 | /* return directly */ |
62 | scpnt->scsi_done(scpnt); | 62 | scpnt->scsi_done(scpnt); |
63 | } | 63 | } |
@@ -93,7 +93,7 @@ static int zfcp_scsi_queuecommand(struct scsi_cmnd *scpnt, | |||
93 | scsi_result = fc_remote_port_chkready(rport); | 93 | scsi_result = fc_remote_port_chkready(rport); |
94 | if (unlikely(scsi_result)) { | 94 | if (unlikely(scsi_result)) { |
95 | scpnt->result = scsi_result; | 95 | scpnt->result = scsi_result; |
96 | zfcp_scsi_dbf_event_result("fail", 4, adapter, scpnt, NULL); | 96 | zfcp_dbf_scsi_result("fail", 4, adapter->dbf, scpnt, NULL); |
97 | scpnt->scsi_done(scpnt); | 97 | scpnt->scsi_done(scpnt); |
98 | return 0; | 98 | return 0; |
99 | } | 99 | } |
@@ -181,8 +181,8 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) | |||
181 | spin_unlock(&adapter->req_list_lock); | 181 | spin_unlock(&adapter->req_list_lock); |
182 | if (!old_req) { | 182 | if (!old_req) { |
183 | write_unlock_irqrestore(&adapter->abort_lock, flags); | 183 | write_unlock_irqrestore(&adapter->abort_lock, flags); |
184 | zfcp_scsi_dbf_event_abort("lte1", adapter, scpnt, NULL, | 184 | zfcp_dbf_scsi_abort("lte1", adapter->dbf, scpnt, NULL, |
185 | old_reqid); | 185 | old_reqid); |
186 | return FAILED; /* completion could be in progress */ | 186 | return FAILED; /* completion could be in progress */ |
187 | } | 187 | } |
188 | old_req->data = NULL; | 188 | old_req->data = NULL; |
@@ -198,8 +198,8 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) | |||
198 | zfcp_erp_wait(adapter); | 198 | zfcp_erp_wait(adapter); |
199 | if (!(atomic_read(&adapter->status) & | 199 | if (!(atomic_read(&adapter->status) & |
200 | ZFCP_STATUS_COMMON_RUNNING)) { | 200 | ZFCP_STATUS_COMMON_RUNNING)) { |
201 | zfcp_scsi_dbf_event_abort("nres", adapter, scpnt, NULL, | 201 | zfcp_dbf_scsi_abort("nres", adapter->dbf, scpnt, NULL, |
202 | old_reqid); | 202 | old_reqid); |
203 | return SUCCESS; | 203 | return SUCCESS; |
204 | } | 204 | } |
205 | } | 205 | } |
@@ -216,7 +216,7 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) | |||
216 | dbf_tag = "fail"; | 216 | dbf_tag = "fail"; |
217 | retval = FAILED; | 217 | retval = FAILED; |
218 | } | 218 | } |
219 | zfcp_scsi_dbf_event_abort(dbf_tag, adapter, scpnt, abrt_req, old_reqid); | 219 | zfcp_dbf_scsi_abort(dbf_tag, adapter->dbf, scpnt, abrt_req, old_reqid); |
220 | zfcp_fsf_req_free(abrt_req); | 220 | zfcp_fsf_req_free(abrt_req); |
221 | return retval; | 221 | return retval; |
222 | } | 222 | } |
@@ -237,8 +237,7 @@ static int zfcp_task_mgmt_function(struct scsi_cmnd *scpnt, u8 tm_flags) | |||
237 | zfcp_erp_wait(adapter); | 237 | zfcp_erp_wait(adapter); |
238 | if (!(atomic_read(&adapter->status) & | 238 | if (!(atomic_read(&adapter->status) & |
239 | ZFCP_STATUS_COMMON_RUNNING)) { | 239 | ZFCP_STATUS_COMMON_RUNNING)) { |
240 | zfcp_scsi_dbf_event_devreset("nres", tm_flags, unit, | 240 | zfcp_dbf_scsi_devreset("nres", tm_flags, unit, scpnt); |
241 | scpnt); | ||
242 | return SUCCESS; | 241 | return SUCCESS; |
243 | } | 242 | } |
244 | } | 243 | } |
@@ -248,13 +247,13 @@ static int zfcp_task_mgmt_function(struct scsi_cmnd *scpnt, u8 tm_flags) | |||
248 | wait_for_completion(&fsf_req->completion); | 247 | wait_for_completion(&fsf_req->completion); |
249 | 248 | ||
250 | if (fsf_req->status & ZFCP_STATUS_FSFREQ_TMFUNCFAILED) { | 249 | if (fsf_req->status & ZFCP_STATUS_FSFREQ_TMFUNCFAILED) { |
251 | zfcp_scsi_dbf_event_devreset("fail", tm_flags, unit, scpnt); | 250 | zfcp_dbf_scsi_devreset("fail", tm_flags, unit, scpnt); |
252 | retval = FAILED; | 251 | retval = FAILED; |
253 | } else if (fsf_req->status & ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP) { | 252 | } else if (fsf_req->status & ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP) { |
254 | zfcp_scsi_dbf_event_devreset("nsup", tm_flags, unit, scpnt); | 253 | zfcp_dbf_scsi_devreset("nsup", tm_flags, unit, scpnt); |
255 | retval = FAILED; | 254 | retval = FAILED; |
256 | } else | 255 | } else |
257 | zfcp_scsi_dbf_event_devreset("okay", tm_flags, unit, scpnt); | 256 | zfcp_dbf_scsi_devreset("okay", tm_flags, unit, scpnt); |
258 | 257 | ||
259 | zfcp_fsf_req_free(fsf_req); | 258 | zfcp_fsf_req_free(fsf_req); |
260 | return retval; | 259 | return retval; |