2 * This file is part of the zfcp device driver for
3 * FCP adapters for IBM System z9 and zSeries.
5 * (C) Copyright IBM Corp. 2002, 2006
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include <linux/ctype.h>
23 #include <asm/debug.h>
26 static u32 dbfsize = 4;
28 module_param(dbfsize, uint, 0400);
29 MODULE_PARM_DESC(dbfsize,
30 "number of pages for each debug feature area (default 4)");
32 #define ZFCP_LOG_AREA ZFCP_LOG_AREA_OTHER
34 static void zfcp_dbf_hexdump(debug_info_t *dbf, void *to, int to_len,
35 int level, char *from, int from_len)
38 struct zfcp_dbf_dump *dump = to;
39 int room = to_len - sizeof(*dump);
41 for (offset = 0; offset < from_len; offset += dump->size) {
42 memset(to, 0, to_len);
43 strncpy(dump->tag, "dump", ZFCP_DBF_TAG_SIZE);
44 dump->total_size = from_len;
45 dump->offset = offset;
46 dump->size = min(from_len - offset, room);
47 memcpy(dump->data, from + offset, dump->size);
48 debug_event(dbf, level, dump, dump->size);
53 zfcp_dbf_stck(char *out_buf, const char *label, unsigned long long stck)
55 unsigned long long sec;
56 struct timespec dbftime;
59 stck -= 0x8126d60e46000000LL - (0x3c26700LL * 1000000 * 4096);
63 stck -= (sec * 1000000) << 12;
64 dbftime.tv_nsec = ((stck * 1000) >> 12);
65 len += sprintf(out_buf + len, "%-24s%011lu:%06lu\n",
66 label, dbftime.tv_sec, dbftime.tv_nsec);
71 static int zfcp_dbf_tag(char *out_buf, const char *label, const char *tag)
75 len += sprintf(out_buf + len, "%-24s", label);
76 for (i = 0; i < ZFCP_DBF_TAG_SIZE; i++)
77 len += sprintf(out_buf + len, "%c", tag[i]);
78 len += sprintf(out_buf + len, "\n");
84 zfcp_dbf_view(char *out_buf, const char *label, const char *format, ...)
89 len += sprintf(out_buf + len, "%-24s", label);
90 va_start(arg, format);
91 len += vsprintf(out_buf + len, format, arg);
93 len += sprintf(out_buf + len, "\n");
98 static void zfcp_dbf_outs(char **buf, const char *s1, const char *s2)
100 *buf += sprintf(*buf, "%-24s%s\n", s1, s2);
103 static void zfcp_dbf_out(char **buf, const char *s, const char *format, ...)
107 *buf += sprintf(*buf, "%-24s", s);
108 va_start(arg, format);
109 *buf += vsprintf(*buf, format, arg);
111 *buf += sprintf(*buf, "\n");
115 zfcp_dbf_view_dump(char *out_buf, const char *label,
116 char *buffer, int buflen, int offset, int total_size)
121 len += sprintf(out_buf + len, "%-24s ", label);
125 if ((offset % 32) == 0)
126 len += sprintf(out_buf + len, "\n%-24c ", ' ');
127 else if ((offset % 4) == 0)
128 len += sprintf(out_buf + len, " ");
130 len += sprintf(out_buf + len, "%02x", *buffer++);
131 if (++offset == total_size) {
132 len += sprintf(out_buf + len, "\n");
138 len += sprintf(out_buf + len, "\n");
144 zfcp_dbf_view_header(debug_info_t * id, struct debug_view *view, int area,
145 debug_entry_t * entry, char *out_buf)
147 struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)DEBUG_DATA(entry);
150 if (strncmp(dump->tag, "dump", ZFCP_DBF_TAG_SIZE) != 0) {
151 len += zfcp_dbf_stck(out_buf + len, "timestamp",
153 len += zfcp_dbf_view(out_buf + len, "cpu", "%02i",
154 entry->id.fields.cpuid);
156 len += zfcp_dbf_view_dump(out_buf + len, NULL,
159 dump->offset, dump->total_size);
160 if ((dump->offset + dump->size) == dump->total_size)
161 len += sprintf(out_buf + len, "\n");
167 void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req)
169 struct zfcp_adapter *adapter = fsf_req->adapter;
170 struct fsf_qtcb *qtcb = fsf_req->qtcb;
171 union fsf_prot_status_qual *prot_status_qual =
172 &qtcb->prefix.prot_status_qual;
173 union fsf_status_qual *fsf_status_qual = &qtcb->header.fsf_status_qual;
174 struct scsi_cmnd *scsi_cmnd;
175 struct zfcp_port *port;
176 struct zfcp_unit *unit;
177 struct zfcp_send_els *send_els;
178 struct zfcp_hba_dbf_record *rec = &adapter->hba_dbf_buf;
179 struct zfcp_hba_dbf_record_response *response = &rec->type.response;
183 spin_lock_irqsave(&adapter->hba_dbf_lock, flags);
184 memset(rec, 0, sizeof(struct zfcp_hba_dbf_record));
185 strncpy(rec->tag, "resp", ZFCP_DBF_TAG_SIZE);
187 if ((qtcb->prefix.prot_status != FSF_PROT_GOOD) &&
188 (qtcb->prefix.prot_status != FSF_PROT_FSF_STATUS_PRESENTED)) {
189 strncpy(rec->tag2, "perr", ZFCP_DBF_TAG_SIZE);
191 } else if (qtcb->header.fsf_status != FSF_GOOD) {
192 strncpy(rec->tag2, "ferr", ZFCP_DBF_TAG_SIZE);
194 } else if ((fsf_req->fsf_command == FSF_QTCB_OPEN_PORT_WITH_DID) ||
195 (fsf_req->fsf_command == FSF_QTCB_OPEN_LUN)) {
196 strncpy(rec->tag2, "open", ZFCP_DBF_TAG_SIZE);
198 } else if (qtcb->header.log_length) {
199 strncpy(rec->tag2, "qtcb", ZFCP_DBF_TAG_SIZE);
202 strncpy(rec->tag2, "norm", ZFCP_DBF_TAG_SIZE);
206 response->fsf_command = fsf_req->fsf_command;
207 response->fsf_reqid = (unsigned long)fsf_req;
208 response->fsf_seqno = fsf_req->seq_no;
209 response->fsf_issued = fsf_req->issued;
210 response->fsf_prot_status = qtcb->prefix.prot_status;
211 response->fsf_status = qtcb->header.fsf_status;
212 memcpy(response->fsf_prot_status_qual,
213 prot_status_qual, FSF_PROT_STATUS_QUAL_SIZE);
214 memcpy(response->fsf_status_qual,
215 fsf_status_qual, FSF_STATUS_QUALIFIER_SIZE);
216 response->fsf_req_status = fsf_req->status;
217 response->sbal_first = fsf_req->sbal_first;
218 response->sbal_curr = fsf_req->sbal_curr;
219 response->sbal_last = fsf_req->sbal_last;
220 response->pool = fsf_req->pool != NULL;
221 response->erp_action = (unsigned long)fsf_req->erp_action;
223 switch (fsf_req->fsf_command) {
224 case FSF_QTCB_FCP_CMND:
225 if (fsf_req->status & ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT)
227 scsi_cmnd = (struct scsi_cmnd *)fsf_req->data;
228 if (scsi_cmnd != NULL) {
229 response->data.send_fcp.scsi_cmnd
230 = (unsigned long)scsi_cmnd;
231 response->data.send_fcp.scsi_serial
232 = scsi_cmnd->serial_number;
236 case FSF_QTCB_OPEN_PORT_WITH_DID:
237 case FSF_QTCB_CLOSE_PORT:
238 case FSF_QTCB_CLOSE_PHYSICAL_PORT:
239 port = (struct zfcp_port *)fsf_req->data;
240 response->data.port.wwpn = port->wwpn;
241 response->data.port.d_id = port->d_id;
242 response->data.port.port_handle = qtcb->header.port_handle;
245 case FSF_QTCB_OPEN_LUN:
246 case FSF_QTCB_CLOSE_LUN:
247 unit = (struct zfcp_unit *)fsf_req->data;
249 response->data.unit.wwpn = port->wwpn;
250 response->data.unit.fcp_lun = unit->fcp_lun;
251 response->data.unit.port_handle = qtcb->header.port_handle;
252 response->data.unit.lun_handle = qtcb->header.lun_handle;
255 case FSF_QTCB_SEND_ELS:
256 send_els = (struct zfcp_send_els *)fsf_req->data;
257 response->data.send_els.d_id = qtcb->bottom.support.d_id;
258 response->data.send_els.ls_code = send_els->ls_code >> 24;
261 case FSF_QTCB_ABORT_FCP_CMND:
262 case FSF_QTCB_SEND_GENERIC:
263 case FSF_QTCB_EXCHANGE_CONFIG_DATA:
264 case FSF_QTCB_EXCHANGE_PORT_DATA:
265 case FSF_QTCB_DOWNLOAD_CONTROL_FILE:
266 case FSF_QTCB_UPLOAD_CONTROL_FILE:
270 debug_event(adapter->hba_dbf, level,
271 rec, sizeof(struct zfcp_hba_dbf_record));
273 /* have fcp channel microcode fixed to use as little as possible */
274 if (fsf_req->fsf_command != FSF_QTCB_FCP_CMND) {
275 /* adjust length skipping trailing zeros */
276 char *buf = (char *)qtcb + qtcb->header.log_start;
277 int len = qtcb->header.log_length;
278 for (; len && !buf[len - 1]; len--);
279 zfcp_dbf_hexdump(adapter->hba_dbf, rec, sizeof(*rec), level,
283 spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags);
287 zfcp_hba_dbf_event_fsf_unsol(const char *tag, struct zfcp_adapter *adapter,
288 struct fsf_status_read_buffer *status_buffer)
290 struct zfcp_hba_dbf_record *rec = &adapter->hba_dbf_buf;
293 spin_lock_irqsave(&adapter->hba_dbf_lock, flags);
294 memset(rec, 0, sizeof(struct zfcp_hba_dbf_record));
295 strncpy(rec->tag, "stat", ZFCP_DBF_TAG_SIZE);
296 strncpy(rec->tag2, tag, ZFCP_DBF_TAG_SIZE);
298 rec->type.status.failed = adapter->status_read_failed;
299 if (status_buffer != NULL) {
300 rec->type.status.status_type = status_buffer->status_type;
301 rec->type.status.status_subtype = status_buffer->status_subtype;
302 memcpy(&rec->type.status.queue_designator,
303 &status_buffer->queue_designator,
304 sizeof(struct fsf_queue_designator));
306 switch (status_buffer->status_type) {
307 case FSF_STATUS_READ_SENSE_DATA_AVAIL:
308 rec->type.status.payload_size =
309 ZFCP_DBF_UNSOL_PAYLOAD_SENSE_DATA_AVAIL;
312 case FSF_STATUS_READ_BIT_ERROR_THRESHOLD:
313 rec->type.status.payload_size =
314 ZFCP_DBF_UNSOL_PAYLOAD_BIT_ERROR_THRESHOLD;
317 case FSF_STATUS_READ_LINK_DOWN:
318 switch (status_buffer->status_subtype) {
319 case FSF_STATUS_READ_SUB_NO_PHYSICAL_LINK:
320 case FSF_STATUS_READ_SUB_FDISC_FAILED:
321 rec->type.status.payload_size =
322 sizeof(struct fsf_link_down_info);
326 case FSF_STATUS_READ_FEATURE_UPDATE_ALERT:
327 rec->type.status.payload_size =
328 ZFCP_DBF_UNSOL_PAYLOAD_FEATURE_UPDATE_ALERT;
331 memcpy(&rec->type.status.payload,
332 &status_buffer->payload, rec->type.status.payload_size);
335 debug_event(adapter->hba_dbf, 2,
336 rec, sizeof(struct zfcp_hba_dbf_record));
337 spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags);
341 zfcp_hba_dbf_event_qdio(struct zfcp_adapter *adapter, unsigned int status,
342 unsigned int qdio_error, unsigned int siga_error,
343 int sbal_index, int sbal_count)
345 struct zfcp_hba_dbf_record *rec = &adapter->hba_dbf_buf;
348 spin_lock_irqsave(&adapter->hba_dbf_lock, flags);
349 memset(rec, 0, sizeof(struct zfcp_hba_dbf_record));
350 strncpy(rec->tag, "qdio", ZFCP_DBF_TAG_SIZE);
351 rec->type.qdio.status = status;
352 rec->type.qdio.qdio_error = qdio_error;
353 rec->type.qdio.siga_error = siga_error;
354 rec->type.qdio.sbal_index = sbal_index;
355 rec->type.qdio.sbal_count = sbal_count;
356 debug_event(adapter->hba_dbf, 0,
357 rec, sizeof(struct zfcp_hba_dbf_record));
358 spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags);
362 zfcp_hba_dbf_view_response(char *out_buf,
363 struct zfcp_hba_dbf_record_response *rec)
367 len += zfcp_dbf_view(out_buf + len, "fsf_command", "0x%08x",
369 len += zfcp_dbf_view(out_buf + len, "fsf_reqid", "0x%0Lx",
371 len += zfcp_dbf_view(out_buf + len, "fsf_seqno", "0x%08x",
373 len += zfcp_dbf_stck(out_buf + len, "fsf_issued", rec->fsf_issued);
374 len += zfcp_dbf_view(out_buf + len, "fsf_prot_status", "0x%08x",
375 rec->fsf_prot_status);
376 len += zfcp_dbf_view(out_buf + len, "fsf_status", "0x%08x",
378 len += zfcp_dbf_view_dump(out_buf + len, "fsf_prot_status_qual",
379 rec->fsf_prot_status_qual,
380 FSF_PROT_STATUS_QUAL_SIZE,
381 0, FSF_PROT_STATUS_QUAL_SIZE);
382 len += zfcp_dbf_view_dump(out_buf + len, "fsf_status_qual",
383 rec->fsf_status_qual,
384 FSF_STATUS_QUALIFIER_SIZE,
385 0, FSF_STATUS_QUALIFIER_SIZE);
386 len += zfcp_dbf_view(out_buf + len, "fsf_req_status", "0x%08x",
387 rec->fsf_req_status);
388 len += zfcp_dbf_view(out_buf + len, "sbal_first", "0x%02x",
390 len += zfcp_dbf_view(out_buf + len, "sbal_curr", "0x%02x",
392 len += zfcp_dbf_view(out_buf + len, "sbal_last", "0x%02x",
394 len += zfcp_dbf_view(out_buf + len, "pool", "0x%02x", rec->pool);
396 switch (rec->fsf_command) {
397 case FSF_QTCB_FCP_CMND:
398 if (rec->fsf_req_status & ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT)
400 len += zfcp_dbf_view(out_buf + len, "scsi_cmnd", "0x%0Lx",
401 rec->data.send_fcp.scsi_cmnd);
402 len += zfcp_dbf_view(out_buf + len, "scsi_serial", "0x%016Lx",
403 rec->data.send_fcp.scsi_serial);
406 case FSF_QTCB_OPEN_PORT_WITH_DID:
407 case FSF_QTCB_CLOSE_PORT:
408 case FSF_QTCB_CLOSE_PHYSICAL_PORT:
409 len += zfcp_dbf_view(out_buf + len, "wwpn", "0x%016Lx",
410 rec->data.port.wwpn);
411 len += zfcp_dbf_view(out_buf + len, "d_id", "0x%06x",
412 rec->data.port.d_id);
413 len += zfcp_dbf_view(out_buf + len, "port_handle", "0x%08x",
414 rec->data.port.port_handle);
417 case FSF_QTCB_OPEN_LUN:
418 case FSF_QTCB_CLOSE_LUN:
419 len += zfcp_dbf_view(out_buf + len, "wwpn", "0x%016Lx",
420 rec->data.unit.wwpn);
421 len += zfcp_dbf_view(out_buf + len, "fcp_lun", "0x%016Lx",
422 rec->data.unit.fcp_lun);
423 len += zfcp_dbf_view(out_buf + len, "port_handle", "0x%08x",
424 rec->data.unit.port_handle);
425 len += zfcp_dbf_view(out_buf + len, "lun_handle", "0x%08x",
426 rec->data.unit.lun_handle);
429 case FSF_QTCB_SEND_ELS:
430 len += zfcp_dbf_view(out_buf + len, "d_id", "0x%06x",
431 rec->data.send_els.d_id);
432 len += zfcp_dbf_view(out_buf + len, "ls_code", "0x%02x",
433 rec->data.send_els.ls_code);
436 case FSF_QTCB_ABORT_FCP_CMND:
437 case FSF_QTCB_SEND_GENERIC:
438 case FSF_QTCB_EXCHANGE_CONFIG_DATA:
439 case FSF_QTCB_EXCHANGE_PORT_DATA:
440 case FSF_QTCB_DOWNLOAD_CONTROL_FILE:
441 case FSF_QTCB_UPLOAD_CONTROL_FILE:
449 zfcp_hba_dbf_view_status(char *out_buf, struct zfcp_hba_dbf_record_status *rec)
453 len += zfcp_dbf_view(out_buf + len, "failed", "0x%02x", rec->failed);
454 len += zfcp_dbf_view(out_buf + len, "status_type", "0x%08x",
456 len += zfcp_dbf_view(out_buf + len, "status_subtype", "0x%08x",
457 rec->status_subtype);
458 len += zfcp_dbf_view_dump(out_buf + len, "queue_designator",
459 (char *)&rec->queue_designator,
460 sizeof(struct fsf_queue_designator),
461 0, sizeof(struct fsf_queue_designator));
462 len += zfcp_dbf_view_dump(out_buf + len, "payload",
463 (char *)&rec->payload,
464 rec->payload_size, 0, rec->payload_size);
470 zfcp_hba_dbf_view_qdio(char *out_buf, struct zfcp_hba_dbf_record_qdio *rec)
474 len += zfcp_dbf_view(out_buf + len, "status", "0x%08x", rec->status);
475 len += zfcp_dbf_view(out_buf + len, "qdio_error", "0x%08x",
477 len += zfcp_dbf_view(out_buf + len, "siga_error", "0x%08x",
479 len += zfcp_dbf_view(out_buf + len, "sbal_index", "0x%02x",
481 len += zfcp_dbf_view(out_buf + len, "sbal_count", "0x%02x",
488 zfcp_hba_dbf_view_format(debug_info_t * id, struct debug_view *view,
489 char *out_buf, const char *in_buf)
491 struct zfcp_hba_dbf_record *rec = (struct zfcp_hba_dbf_record *)in_buf;
494 if (strncmp(rec->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0)
497 len += zfcp_dbf_tag(out_buf + len, "tag", rec->tag);
498 if (isalpha(rec->tag2[0]))
499 len += zfcp_dbf_tag(out_buf + len, "tag2", rec->tag2);
500 if (strncmp(rec->tag, "resp", ZFCP_DBF_TAG_SIZE) == 0)
501 len += zfcp_hba_dbf_view_response(out_buf + len,
502 &rec->type.response);
503 else if (strncmp(rec->tag, "stat", ZFCP_DBF_TAG_SIZE) == 0)
504 len += zfcp_hba_dbf_view_status(out_buf + len,
506 else if (strncmp(rec->tag, "qdio", ZFCP_DBF_TAG_SIZE) == 0)
507 len += zfcp_hba_dbf_view_qdio(out_buf + len, &rec->type.qdio);
509 len += sprintf(out_buf + len, "\n");
514 static struct debug_view zfcp_hba_dbf_view = {
517 &zfcp_dbf_view_header,
518 &zfcp_hba_dbf_view_format,
523 static const char *zfcp_rec_dbf_tags[] = {
524 [ZFCP_REC_DBF_ID_THREAD] = "thread",
525 [ZFCP_REC_DBF_ID_TARGET] = "target",
528 static const char *zfcp_rec_dbf_ids[] = {
534 [6] = "down sleep ecd",
535 [7] = "down wakeup ecd",
536 [8] = "down sleep epd",
537 [9] = "down wakeup epd",
539 [11] = "operational",
540 [12] = "scsi slave destroy",
541 [13] = "propagate failed adapter",
542 [14] = "propagate failed port",
543 [15] = "block adapter",
544 [16] = "unblock adapter",
546 [18] = "unblock port",
548 [20] = "unblock unit",
549 [21] = "unit recovery failed",
550 [22] = "port recovery failed",
551 [23] = "adapter recovery failed",
552 [24] = "qdio queues down",
554 [26] = "nameserver lookup failed",
555 [27] = "nameserver port failed",
558 [30] = "link up status read",
559 [31] = "open port failed",
560 [32] = "open port failed",
562 [34] = "open unit failed",
563 [35] = "exclusive open unit failed",
564 [36] = "shared open unit failed",
566 [38] = "link down status read no link",
567 [39] = "link down status read fdisc login",
568 [40] = "link down status read firmware update",
569 [41] = "link down status read unknown reason",
570 [42] = "link down ecd incomplete",
571 [43] = "link down epd incomplete",
572 [44] = "sysfs adapter recovery",
573 [45] = "sysfs port recovery",
574 [46] = "sysfs unit recovery",
575 [47] = "port boxed abort",
576 [48] = "unit boxed abort",
577 [49] = "port boxed ct",
578 [50] = "port boxed close physical",
579 [51] = "port boxed open unit",
580 [52] = "port boxed close unit",
581 [53] = "port boxed fcp",
582 [54] = "unit boxed fcp",
583 [55] = "port access denied ct",
584 [56] = "port access denied els",
585 [57] = "port access denied open port",
586 [58] = "port access denied close physical",
587 [59] = "unit access denied open unit",
588 [60] = "shared unit access denied open unit",
589 [61] = "unit access denied fcp",
592 static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view,
593 char *buf, const char *_rec)
595 struct zfcp_rec_dbf_record *r = (struct zfcp_rec_dbf_record *)_rec;
598 zfcp_dbf_outs(&p, "tag", zfcp_rec_dbf_tags[r->id]);
599 zfcp_dbf_outs(&p, "hint", zfcp_rec_dbf_ids[r->id2]);
600 zfcp_dbf_out(&p, "id", "%d", r->id2);
602 case ZFCP_REC_DBF_ID_THREAD:
603 zfcp_dbf_out(&p, "sema", "%d", r->u.thread.sema);
604 zfcp_dbf_out(&p, "total", "%d", r->u.thread.total);
605 zfcp_dbf_out(&p, "ready", "%d", r->u.thread.ready);
606 zfcp_dbf_out(&p, "running", "%d", r->u.thread.running);
608 case ZFCP_REC_DBF_ID_TARGET:
609 zfcp_dbf_out(&p, "reference", "0x%016Lx", r->u.target.ref);
610 zfcp_dbf_out(&p, "status", "0x%08x", r->u.target.status);
611 zfcp_dbf_out(&p, "erp_count", "%d", r->u.target.erp_count);
612 zfcp_dbf_out(&p, "d_id", "0x%06x", r->u.target.d_id);
613 zfcp_dbf_out(&p, "wwpn", "0x%016Lx", r->u.target.wwpn);
614 zfcp_dbf_out(&p, "fcp_lun", "0x%016Lx", r->u.target.fcp_lun);
618 return (p - buf) + 1;
621 static struct debug_view zfcp_rec_dbf_view = {
624 &zfcp_dbf_view_header,
625 &zfcp_rec_dbf_view_format,
631 * zfcp_rec_dbf_event_thread - trace event related to recovery thread operation
632 * @id2: identifier for event
634 * @lock: non-zero value indicates that erp_lock has not yet been acquired
636 void zfcp_rec_dbf_event_thread(u8 id2, struct zfcp_adapter *adapter, int lock)
638 struct zfcp_rec_dbf_record *r = &adapter->rec_dbf_buf;
639 unsigned long flags = 0;
640 struct list_head *entry;
641 unsigned ready = 0, running = 0, total;
644 read_lock_irqsave(&adapter->erp_lock, flags);
645 list_for_each(entry, &adapter->erp_ready_head)
647 list_for_each(entry, &adapter->erp_running_head)
649 total = adapter->erp_total_count;
651 read_unlock_irqrestore(&adapter->erp_lock, flags);
653 spin_lock_irqsave(&adapter->rec_dbf_lock, flags);
654 memset(r, 0, sizeof(*r));
655 r->id = ZFCP_REC_DBF_ID_THREAD;
657 r->u.thread.sema = atomic_read(&adapter->erp_ready_sem.count);
658 r->u.thread.total = total;
659 r->u.thread.ready = ready;
660 r->u.thread.running = running;
661 debug_event(adapter->rec_dbf, 5, r, sizeof(*r));
662 spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags);
665 static void zfcp_rec_dbf_event_target(u8 id2, u64 ref,
666 struct zfcp_adapter *adapter,
667 atomic_t *status, atomic_t *erp_count,
668 u64 wwpn, u32 d_id, u64 fcp_lun)
670 struct zfcp_rec_dbf_record *r = &adapter->rec_dbf_buf;
673 spin_lock_irqsave(&adapter->rec_dbf_lock, flags);
674 memset(r, 0, sizeof(*r));
675 r->id = ZFCP_REC_DBF_ID_TARGET;
677 r->u.target.ref = ref;
678 r->u.target.status = atomic_read(status);
679 r->u.target.wwpn = wwpn;
680 r->u.target.d_id = d_id;
681 r->u.target.fcp_lun = fcp_lun;
682 r->u.target.erp_count = atomic_read(erp_count);
683 debug_event(adapter->rec_dbf, 3, r, sizeof(*r));
684 spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags);
688 * zfcp_rec_dbf_event_adapter - trace event for adapter state change
689 * @id: identifier for trigger of state change
690 * @ref: additional reference (e.g. request)
693 void zfcp_rec_dbf_event_adapter(u8 id, u64 ref, struct zfcp_adapter *adapter)
695 zfcp_rec_dbf_event_target(id, ref, adapter, &adapter->status,
696 &adapter->erp_counter, 0, 0, 0);
700 * zfcp_rec_dbf_event_port - trace event for port state change
701 * @id: identifier for trigger of state change
702 * @ref: additional reference (e.g. request)
705 void zfcp_rec_dbf_event_port(u8 id, u64 ref, struct zfcp_port *port)
707 struct zfcp_adapter *adapter = port->adapter;
709 zfcp_rec_dbf_event_target(id, ref, adapter, &port->status,
710 &port->erp_counter, port->wwpn, port->d_id,
715 * zfcp_rec_dbf_event_unit - trace event for unit state change
716 * @id: identifier for trigger of state change
717 * @ref: additional reference (e.g. request)
720 void zfcp_rec_dbf_event_unit(u8 id, u64 ref, struct zfcp_unit *unit)
722 struct zfcp_port *port = unit->port;
723 struct zfcp_adapter *adapter = port->adapter;
725 zfcp_rec_dbf_event_target(id, ref, adapter, &unit->status,
726 &unit->erp_counter, port->wwpn, port->d_id,
731 _zfcp_san_dbf_event_common_ct(const char *tag, struct zfcp_fsf_req *fsf_req,
732 u32 s_id, u32 d_id, void *buffer, int buflen)
734 struct zfcp_send_ct *send_ct = (struct zfcp_send_ct *)fsf_req->data;
735 struct zfcp_port *port = send_ct->port;
736 struct zfcp_adapter *adapter = port->adapter;
737 struct ct_hdr *header = (struct ct_hdr *)buffer;
738 struct zfcp_san_dbf_record *rec = &adapter->san_dbf_buf;
739 struct zfcp_san_dbf_record_ct *ct = &rec->type.ct;
742 spin_lock_irqsave(&adapter->san_dbf_lock, flags);
743 memset(rec, 0, sizeof(struct zfcp_san_dbf_record));
744 strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE);
745 rec->fsf_reqid = (unsigned long)fsf_req;
746 rec->fsf_seqno = fsf_req->seq_no;
749 if (strncmp(tag, "octc", ZFCP_DBF_TAG_SIZE) == 0) {
750 ct->type.request.cmd_req_code = header->cmd_rsp_code;
751 ct->type.request.revision = header->revision;
752 ct->type.request.gs_type = header->gs_type;
753 ct->type.request.gs_subtype = header->gs_subtype;
754 ct->type.request.options = header->options;
755 ct->type.request.max_res_size = header->max_res_size;
756 } else if (strncmp(tag, "rctc", ZFCP_DBF_TAG_SIZE) == 0) {
757 ct->type.response.cmd_rsp_code = header->cmd_rsp_code;
758 ct->type.response.revision = header->revision;
759 ct->type.response.reason_code = header->reason_code;
760 ct->type.response.reason_code_expl = header->reason_code_expl;
761 ct->type.response.vendor_unique = header->vendor_unique;
764 min(buflen - (int)sizeof(struct ct_hdr), ZFCP_DBF_CT_PAYLOAD);
765 memcpy(ct->payload, buffer + sizeof(struct ct_hdr), ct->payload_size);
766 debug_event(adapter->san_dbf, 3,
767 rec, sizeof(struct zfcp_san_dbf_record));
768 spin_unlock_irqrestore(&adapter->san_dbf_lock, flags);
771 void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req)
773 struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data;
774 struct zfcp_port *port = ct->port;
775 struct zfcp_adapter *adapter = port->adapter;
777 _zfcp_san_dbf_event_common_ct("octc", fsf_req,
778 fc_host_port_id(adapter->scsi_host),
779 port->d_id, zfcp_sg_to_address(ct->req),
783 void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req)
785 struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data;
786 struct zfcp_port *port = ct->port;
787 struct zfcp_adapter *adapter = port->adapter;
789 _zfcp_san_dbf_event_common_ct("rctc", fsf_req, port->d_id,
790 fc_host_port_id(adapter->scsi_host),
791 zfcp_sg_to_address(ct->resp),
796 _zfcp_san_dbf_event_common_els(const char *tag, int level,
797 struct zfcp_fsf_req *fsf_req, u32 s_id,
798 u32 d_id, u8 ls_code, void *buffer, int buflen)
800 struct zfcp_adapter *adapter = fsf_req->adapter;
801 struct zfcp_san_dbf_record *rec = &adapter->san_dbf_buf;
804 spin_lock_irqsave(&adapter->san_dbf_lock, flags);
805 memset(rec, 0, sizeof(struct zfcp_san_dbf_record));
806 strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE);
807 rec->fsf_reqid = (unsigned long)fsf_req;
808 rec->fsf_seqno = fsf_req->seq_no;
811 rec->type.els.ls_code = ls_code;
812 debug_event(adapter->san_dbf, level, rec, sizeof(*rec));
813 zfcp_dbf_hexdump(adapter->san_dbf, rec, sizeof(*rec), level,
814 buffer, min(buflen, ZFCP_DBF_ELS_MAX_PAYLOAD));
815 spin_unlock_irqrestore(&adapter->san_dbf_lock, flags);
818 void zfcp_san_dbf_event_els_request(struct zfcp_fsf_req *fsf_req)
820 struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data;
822 _zfcp_san_dbf_event_common_els("oels", 2, fsf_req,
823 fc_host_port_id(els->adapter->scsi_host),
825 *(u8 *) zfcp_sg_to_address(els->req),
826 zfcp_sg_to_address(els->req),
830 void zfcp_san_dbf_event_els_response(struct zfcp_fsf_req *fsf_req)
832 struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data;
834 _zfcp_san_dbf_event_common_els("rels", 2, fsf_req, els->d_id,
835 fc_host_port_id(els->adapter->scsi_host),
836 *(u8 *) zfcp_sg_to_address(els->req),
837 zfcp_sg_to_address(els->resp),
841 void zfcp_san_dbf_event_incoming_els(struct zfcp_fsf_req *fsf_req)
843 struct zfcp_adapter *adapter = fsf_req->adapter;
844 struct fsf_status_read_buffer *status_buffer =
845 (struct fsf_status_read_buffer *)fsf_req->data;
846 int length = (int)status_buffer->length -
847 (int)((void *)&status_buffer->payload - (void *)status_buffer);
849 _zfcp_san_dbf_event_common_els("iels", 1, fsf_req, status_buffer->d_id,
850 fc_host_port_id(adapter->scsi_host),
851 *(u8 *) status_buffer->payload,
852 (void *)status_buffer->payload, length);
856 zfcp_san_dbf_view_format(debug_info_t * id, struct debug_view *view,
857 char *out_buf, const char *in_buf)
859 struct zfcp_san_dbf_record *rec = (struct zfcp_san_dbf_record *)in_buf;
861 int buflen = 0, total = 0;
864 if (strncmp(rec->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0)
867 len += zfcp_dbf_tag(out_buf + len, "tag", rec->tag);
868 len += zfcp_dbf_view(out_buf + len, "fsf_reqid", "0x%0Lx",
870 len += zfcp_dbf_view(out_buf + len, "fsf_seqno", "0x%08x",
872 len += zfcp_dbf_view(out_buf + len, "s_id", "0x%06x", rec->s_id);
873 len += zfcp_dbf_view(out_buf + len, "d_id", "0x%06x", rec->d_id);
875 if (strncmp(rec->tag, "octc", ZFCP_DBF_TAG_SIZE) == 0) {
876 len += zfcp_dbf_view(out_buf + len, "cmd_req_code", "0x%04x",
877 rec->type.ct.type.request.cmd_req_code);
878 len += zfcp_dbf_view(out_buf + len, "revision", "0x%02x",
879 rec->type.ct.type.request.revision);
880 len += zfcp_dbf_view(out_buf + len, "gs_type", "0x%02x",
881 rec->type.ct.type.request.gs_type);
882 len += zfcp_dbf_view(out_buf + len, "gs_subtype", "0x%02x",
883 rec->type.ct.type.request.gs_subtype);
884 len += zfcp_dbf_view(out_buf + len, "options", "0x%02x",
885 rec->type.ct.type.request.options);
886 len += zfcp_dbf_view(out_buf + len, "max_res_size", "0x%04x",
887 rec->type.ct.type.request.max_res_size);
888 total = rec->type.ct.payload_size;
889 buffer = rec->type.ct.payload;
890 buflen = min(total, ZFCP_DBF_CT_PAYLOAD);
891 } else if (strncmp(rec->tag, "rctc", ZFCP_DBF_TAG_SIZE) == 0) {
892 len += zfcp_dbf_view(out_buf + len, "cmd_rsp_code", "0x%04x",
893 rec->type.ct.type.response.cmd_rsp_code);
894 len += zfcp_dbf_view(out_buf + len, "revision", "0x%02x",
895 rec->type.ct.type.response.revision);
896 len += zfcp_dbf_view(out_buf + len, "reason_code", "0x%02x",
897 rec->type.ct.type.response.reason_code);
899 zfcp_dbf_view(out_buf + len, "reason_code_expl", "0x%02x",
900 rec->type.ct.type.response.reason_code_expl);
902 zfcp_dbf_view(out_buf + len, "vendor_unique", "0x%02x",
903 rec->type.ct.type.response.vendor_unique);
904 total = rec->type.ct.payload_size;
905 buffer = rec->type.ct.payload;
906 buflen = min(total, ZFCP_DBF_CT_PAYLOAD);
907 } else if (strncmp(rec->tag, "oels", ZFCP_DBF_TAG_SIZE) == 0 ||
908 strncmp(rec->tag, "rels", ZFCP_DBF_TAG_SIZE) == 0 ||
909 strncmp(rec->tag, "iels", ZFCP_DBF_TAG_SIZE) == 0) {
910 len += zfcp_dbf_view(out_buf + len, "ls_code", "0x%02x",
911 rec->type.els.ls_code);
912 total = rec->type.els.payload_size;
913 buffer = rec->type.els.payload;
914 buflen = min(total, ZFCP_DBF_ELS_PAYLOAD);
917 len += zfcp_dbf_view_dump(out_buf + len, "payload",
918 buffer, buflen, 0, total);
921 len += sprintf(out_buf + len, "\n");
926 static struct debug_view zfcp_san_dbf_view = {
929 &zfcp_dbf_view_header,
930 &zfcp_san_dbf_view_format,
936 _zfcp_scsi_dbf_event_common(const char *tag, const char *tag2, int level,
937 struct zfcp_adapter *adapter,
938 struct scsi_cmnd *scsi_cmnd,
939 struct zfcp_fsf_req *fsf_req,
940 unsigned long old_req_id)
942 struct zfcp_scsi_dbf_record *rec = &adapter->scsi_dbf_buf;
943 struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)rec;
945 struct fcp_rsp_iu *fcp_rsp;
946 char *fcp_rsp_info = NULL, *fcp_sns_info = NULL;
947 int offset = 0, buflen = 0;
949 spin_lock_irqsave(&adapter->scsi_dbf_lock, flags);
951 memset(rec, 0, sizeof(struct zfcp_scsi_dbf_record));
953 strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE);
954 strncpy(rec->tag2, tag2, ZFCP_DBF_TAG_SIZE);
955 if (scsi_cmnd != NULL) {
956 if (scsi_cmnd->device) {
957 rec->scsi_id = scsi_cmnd->device->id;
958 rec->scsi_lun = scsi_cmnd->device->lun;
960 rec->scsi_result = scsi_cmnd->result;
961 rec->scsi_cmnd = (unsigned long)scsi_cmnd;
962 rec->scsi_serial = scsi_cmnd->serial_number;
963 memcpy(rec->scsi_opcode, &scsi_cmnd->cmnd,
964 min((int)scsi_cmnd->cmd_len,
965 ZFCP_DBF_SCSI_OPCODE));
966 rec->scsi_retries = scsi_cmnd->retries;
967 rec->scsi_allowed = scsi_cmnd->allowed;
969 if (fsf_req != NULL) {
970 fcp_rsp = (struct fcp_rsp_iu *)
971 &(fsf_req->qtcb->bottom.io.fcp_rsp);
973 zfcp_get_fcp_rsp_info_ptr(fcp_rsp);
975 zfcp_get_fcp_sns_info_ptr(fcp_rsp);
977 rec->type.fcp.rsp_validity =
978 fcp_rsp->validity.value;
979 rec->type.fcp.rsp_scsi_status =
980 fcp_rsp->scsi_status;
981 rec->type.fcp.rsp_resid = fcp_rsp->fcp_resid;
982 if (fcp_rsp->validity.bits.fcp_rsp_len_valid)
983 rec->type.fcp.rsp_code =
985 if (fcp_rsp->validity.bits.fcp_sns_len_valid) {
986 buflen = min((int)fcp_rsp->fcp_sns_len,
987 ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO);
988 rec->type.fcp.sns_info_len = buflen;
989 memcpy(rec->type.fcp.sns_info,
992 ZFCP_DBF_SCSI_FCP_SNS_INFO));
993 offset += min(buflen,
994 ZFCP_DBF_SCSI_FCP_SNS_INFO);
997 rec->fsf_reqid = (unsigned long)fsf_req;
998 rec->fsf_seqno = fsf_req->seq_no;
999 rec->fsf_issued = fsf_req->issued;
1001 rec->type.old_fsf_reqid = old_req_id;
1003 strncpy(dump->tag, "dump", ZFCP_DBF_TAG_SIZE);
1004 dump->total_size = buflen;
1005 dump->offset = offset;
1006 dump->size = min(buflen - offset,
1008 zfcp_scsi_dbf_record) -
1009 (int)sizeof(struct zfcp_dbf_dump));
1010 memcpy(dump->data, fcp_sns_info + offset, dump->size);
1011 offset += dump->size;
1013 debug_event(adapter->scsi_dbf, level,
1014 rec, sizeof(struct zfcp_scsi_dbf_record));
1015 } while (offset < buflen);
1016 spin_unlock_irqrestore(&adapter->scsi_dbf_lock, flags);
1020 zfcp_scsi_dbf_event_result(const char *tag, int level,
1021 struct zfcp_adapter *adapter,
1022 struct scsi_cmnd *scsi_cmnd,
1023 struct zfcp_fsf_req *fsf_req)
1025 _zfcp_scsi_dbf_event_common("rslt", tag, level,
1026 adapter, scsi_cmnd, fsf_req, 0);
1030 zfcp_scsi_dbf_event_abort(const char *tag, struct zfcp_adapter *adapter,
1031 struct scsi_cmnd *scsi_cmnd,
1032 struct zfcp_fsf_req *new_fsf_req,
1033 unsigned long old_req_id)
1035 _zfcp_scsi_dbf_event_common("abrt", tag, 1,
1036 adapter, scsi_cmnd, new_fsf_req, old_req_id);
1040 zfcp_scsi_dbf_event_devreset(const char *tag, u8 flag, struct zfcp_unit *unit,
1041 struct scsi_cmnd *scsi_cmnd)
1043 struct zfcp_adapter *adapter = unit->port->adapter;
1045 _zfcp_scsi_dbf_event_common(flag == FCP_TARGET_RESET ? "trst" : "lrst",
1046 tag, 1, adapter, scsi_cmnd, NULL, 0);
1050 zfcp_scsi_dbf_view_format(debug_info_t * id, struct debug_view *view,
1051 char *out_buf, const char *in_buf)
1053 struct zfcp_scsi_dbf_record *rec =
1054 (struct zfcp_scsi_dbf_record *)in_buf;
1057 if (strncmp(rec->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0)
1060 len += zfcp_dbf_tag(out_buf + len, "tag", rec->tag);
1061 len += zfcp_dbf_tag(out_buf + len, "tag2", rec->tag2);
1062 len += zfcp_dbf_view(out_buf + len, "scsi_id", "0x%08x", rec->scsi_id);
1063 len += zfcp_dbf_view(out_buf + len, "scsi_lun", "0x%08x",
1065 len += zfcp_dbf_view(out_buf + len, "scsi_result", "0x%08x",
1067 len += zfcp_dbf_view(out_buf + len, "scsi_cmnd", "0x%0Lx",
1069 len += zfcp_dbf_view(out_buf + len, "scsi_serial", "0x%016Lx",
1071 len += zfcp_dbf_view_dump(out_buf + len, "scsi_opcode",
1073 ZFCP_DBF_SCSI_OPCODE,
1074 0, ZFCP_DBF_SCSI_OPCODE);
1075 len += zfcp_dbf_view(out_buf + len, "scsi_retries", "0x%02x",
1077 len += zfcp_dbf_view(out_buf + len, "scsi_allowed", "0x%02x",
1079 if (strncmp(rec->tag, "abrt", ZFCP_DBF_TAG_SIZE) == 0) {
1080 len += zfcp_dbf_view(out_buf + len, "old_fsf_reqid", "0x%0Lx",
1081 rec->type.old_fsf_reqid);
1083 len += zfcp_dbf_view(out_buf + len, "fsf_reqid", "0x%0Lx",
1085 len += zfcp_dbf_view(out_buf + len, "fsf_seqno", "0x%08x",
1087 len += zfcp_dbf_stck(out_buf + len, "fsf_issued", rec->fsf_issued);
1088 if (strncmp(rec->tag, "rslt", ZFCP_DBF_TAG_SIZE) == 0) {
1090 zfcp_dbf_view(out_buf + len, "fcp_rsp_validity", "0x%02x",
1091 rec->type.fcp.rsp_validity);
1093 zfcp_dbf_view(out_buf + len, "fcp_rsp_scsi_status",
1094 "0x%02x", rec->type.fcp.rsp_scsi_status);
1096 zfcp_dbf_view(out_buf + len, "fcp_rsp_resid", "0x%08x",
1097 rec->type.fcp.rsp_resid);
1099 zfcp_dbf_view(out_buf + len, "fcp_rsp_code", "0x%08x",
1100 rec->type.fcp.rsp_code);
1102 zfcp_dbf_view(out_buf + len, "fcp_sns_info_len", "0x%08x",
1103 rec->type.fcp.sns_info_len);
1105 zfcp_dbf_view_dump(out_buf + len, "fcp_sns_info",
1106 rec->type.fcp.sns_info,
1107 min((int)rec->type.fcp.sns_info_len,
1108 ZFCP_DBF_SCSI_FCP_SNS_INFO), 0,
1109 rec->type.fcp.sns_info_len);
1112 len += sprintf(out_buf + len, "\n");
1117 static struct debug_view zfcp_scsi_dbf_view = {
1120 &zfcp_dbf_view_header,
1121 &zfcp_scsi_dbf_view_format,
1127 * zfcp_adapter_debug_register - registers debug feature for an adapter
1128 * @adapter: pointer to adapter for which debug features should be registered
1129 * return: -ENOMEM on error, 0 otherwise
1131 int zfcp_adapter_debug_register(struct zfcp_adapter *adapter)
1133 char dbf_name[DEBUG_MAX_NAME_LEN];
1135 /* debug feature area which records recovery activity */
1136 sprintf(dbf_name, "zfcp_%s_erp", zfcp_get_busid_by_adapter(adapter));
1137 adapter->erp_dbf = debug_register(dbf_name, dbfsize, 2,
1138 sizeof(struct zfcp_erp_dbf_record));
1139 if (!adapter->erp_dbf)
1141 debug_register_view(adapter->erp_dbf, &debug_hex_ascii_view);
1142 debug_set_level(adapter->erp_dbf, 3);
1144 /* debug feature area which records recovery activity */
1145 sprintf(dbf_name, "zfcp_%s_rec", zfcp_get_busid_by_adapter(adapter));
1146 adapter->rec_dbf = debug_register(dbf_name, dbfsize, 1,
1147 sizeof(struct zfcp_rec_dbf_record));
1148 if (!adapter->rec_dbf)
1150 debug_register_view(adapter->rec_dbf, &debug_hex_ascii_view);
1151 debug_register_view(adapter->rec_dbf, &zfcp_rec_dbf_view);
1152 debug_set_level(adapter->rec_dbf, 3);
1154 /* debug feature area which records HBA (FSF and QDIO) conditions */
1155 sprintf(dbf_name, "zfcp_%s_hba", zfcp_get_busid_by_adapter(adapter));
1156 adapter->hba_dbf = debug_register(dbf_name, dbfsize, 1,
1157 sizeof(struct zfcp_hba_dbf_record));
1158 if (!adapter->hba_dbf)
1160 debug_register_view(adapter->hba_dbf, &debug_hex_ascii_view);
1161 debug_register_view(adapter->hba_dbf, &zfcp_hba_dbf_view);
1162 debug_set_level(adapter->hba_dbf, 3);
1164 /* debug feature area which records SAN command failures and recovery */
1165 sprintf(dbf_name, "zfcp_%s_san", zfcp_get_busid_by_adapter(adapter));
1166 adapter->san_dbf = debug_register(dbf_name, dbfsize, 1,
1167 sizeof(struct zfcp_san_dbf_record));
1168 if (!adapter->san_dbf)
1170 debug_register_view(adapter->san_dbf, &debug_hex_ascii_view);
1171 debug_register_view(adapter->san_dbf, &zfcp_san_dbf_view);
1172 debug_set_level(adapter->san_dbf, 6);
1174 /* debug feature area which records SCSI command failures and recovery */
1175 sprintf(dbf_name, "zfcp_%s_scsi", zfcp_get_busid_by_adapter(adapter));
1176 adapter->scsi_dbf = debug_register(dbf_name, dbfsize, 1,
1177 sizeof(struct zfcp_scsi_dbf_record));
1178 if (!adapter->scsi_dbf)
1180 debug_register_view(adapter->scsi_dbf, &debug_hex_ascii_view);
1181 debug_register_view(adapter->scsi_dbf, &zfcp_scsi_dbf_view);
1182 debug_set_level(adapter->scsi_dbf, 3);
1187 zfcp_adapter_debug_unregister(adapter);
1193 * zfcp_adapter_debug_unregister - unregisters debug feature for an adapter
1194 * @adapter: pointer to adapter for which debug features should be unregistered
1196 void zfcp_adapter_debug_unregister(struct zfcp_adapter *adapter)
1198 debug_unregister(adapter->scsi_dbf);
1199 debug_unregister(adapter->san_dbf);
1200 debug_unregister(adapter->hba_dbf);
1201 debug_unregister(adapter->rec_dbf);
1202 debug_unregister(adapter->erp_dbf);
1203 adapter->scsi_dbf = NULL;
1204 adapter->san_dbf = NULL;
1205 adapter->hba_dbf = NULL;
1206 adapter->rec_dbf = NULL;
1207 adapter->erp_dbf = NULL;
1210 #undef ZFCP_LOG_AREA