zfcp: fix payload trace length for SAN request&response
[firefly-linux-kernel-4.4.55.git] / drivers / s390 / scsi / zfcp_dbf.c
1 /*
2  * zfcp device driver
3  *
4  * Debug traces for zfcp.
5  *
6  * Copyright IBM Corp. 2002, 2015
7  */
8
9 #define KMSG_COMPONENT "zfcp"
10 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
11
12 #include <linux/module.h>
13 #include <linux/ctype.h>
14 #include <linux/slab.h>
15 #include <asm/debug.h>
16 #include "zfcp_dbf.h"
17 #include "zfcp_ext.h"
18 #include "zfcp_fc.h"
19
20 static u32 dbfsize = 4;
21
22 module_param(dbfsize, uint, 0400);
23 MODULE_PARM_DESC(dbfsize,
24                  "number of pages for each debug feature area (default 4)");
25
26 static u32 dbflevel = 3;
27
28 module_param(dbflevel, uint, 0400);
29 MODULE_PARM_DESC(dbflevel,
30                  "log level for each debug feature area "
31                  "(default 3, range 0..6)");
32
33 static inline unsigned int zfcp_dbf_plen(unsigned int offset)
34 {
35         return sizeof(struct zfcp_dbf_pay) + offset - ZFCP_DBF_PAY_MAX_REC;
36 }
37
38 static inline
39 void zfcp_dbf_pl_write(struct zfcp_dbf *dbf, void *data, u16 length, char *area,
40                        u64 req_id)
41 {
42         struct zfcp_dbf_pay *pl = &dbf->pay_buf;
43         u16 offset = 0, rec_length;
44
45         spin_lock(&dbf->pay_lock);
46         memset(pl, 0, sizeof(*pl));
47         pl->fsf_req_id = req_id;
48         memcpy(pl->area, area, ZFCP_DBF_TAG_LEN);
49
50         while (offset < length) {
51                 rec_length = min((u16) ZFCP_DBF_PAY_MAX_REC,
52                                  (u16) (length - offset));
53                 memcpy(pl->data, data + offset, rec_length);
54                 debug_event(dbf->pay, 1, pl, zfcp_dbf_plen(rec_length));
55
56                 offset += rec_length;
57                 pl->counter++;
58         }
59
60         spin_unlock(&dbf->pay_lock);
61 }
62
63 /**
64  * zfcp_dbf_hba_fsf_res - trace event for fsf responses
65  * @tag: tag indicating which kind of unsolicited status has been received
66  * @req: request for which a response was received
67  */
68 void zfcp_dbf_hba_fsf_res(char *tag, int level, struct zfcp_fsf_req *req)
69 {
70         struct zfcp_dbf *dbf = req->adapter->dbf;
71         struct fsf_qtcb_prefix *q_pref = &req->qtcb->prefix;
72         struct fsf_qtcb_header *q_head = &req->qtcb->header;
73         struct zfcp_dbf_hba *rec = &dbf->hba_buf;
74         unsigned long flags;
75
76         spin_lock_irqsave(&dbf->hba_lock, flags);
77         memset(rec, 0, sizeof(*rec));
78
79         memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN);
80         rec->id = ZFCP_DBF_HBA_RES;
81         rec->fsf_req_id = req->req_id;
82         rec->fsf_req_status = req->status;
83         rec->fsf_cmd = req->fsf_command;
84         rec->fsf_seq_no = req->seq_no;
85         rec->u.res.req_issued = req->issued;
86         rec->u.res.prot_status = q_pref->prot_status;
87         rec->u.res.fsf_status = q_head->fsf_status;
88         rec->u.res.port_handle = q_head->port_handle;
89         rec->u.res.lun_handle = q_head->lun_handle;
90
91         memcpy(rec->u.res.prot_status_qual, &q_pref->prot_status_qual,
92                FSF_PROT_STATUS_QUAL_SIZE);
93         memcpy(rec->u.res.fsf_status_qual, &q_head->fsf_status_qual,
94                FSF_STATUS_QUALIFIER_SIZE);
95
96         if (req->fsf_command != FSF_QTCB_FCP_CMND) {
97                 rec->pl_len = q_head->log_length;
98                 zfcp_dbf_pl_write(dbf, (char *)q_pref + q_head->log_start,
99                                   rec->pl_len, "fsf_res", req->req_id);
100         }
101
102         debug_event(dbf->hba, level, rec, sizeof(*rec));
103         spin_unlock_irqrestore(&dbf->hba_lock, flags);
104 }
105
106 /**
107  * zfcp_dbf_hba_fsf_uss - trace event for an unsolicited status buffer
108  * @tag: tag indicating which kind of unsolicited status has been received
109  * @req: request providing the unsolicited status
110  */
111 void zfcp_dbf_hba_fsf_uss(char *tag, struct zfcp_fsf_req *req)
112 {
113         struct zfcp_dbf *dbf = req->adapter->dbf;
114         struct fsf_status_read_buffer *srb = req->data;
115         struct zfcp_dbf_hba *rec = &dbf->hba_buf;
116         unsigned long flags;
117
118         spin_lock_irqsave(&dbf->hba_lock, flags);
119         memset(rec, 0, sizeof(*rec));
120
121         memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN);
122         rec->id = ZFCP_DBF_HBA_USS;
123         rec->fsf_req_id = req->req_id;
124         rec->fsf_req_status = req->status;
125         rec->fsf_cmd = req->fsf_command;
126
127         if (!srb)
128                 goto log;
129
130         rec->u.uss.status_type = srb->status_type;
131         rec->u.uss.status_subtype = srb->status_subtype;
132         rec->u.uss.d_id = ntoh24(srb->d_id);
133         rec->u.uss.lun = srb->fcp_lun;
134         memcpy(&rec->u.uss.queue_designator, &srb->queue_designator,
135                sizeof(rec->u.uss.queue_designator));
136
137         /* status read buffer payload length */
138         rec->pl_len = (!srb->length) ? 0 : srb->length -
139                         offsetof(struct fsf_status_read_buffer, payload);
140
141         if (rec->pl_len)
142                 zfcp_dbf_pl_write(dbf, srb->payload.data, rec->pl_len,
143                                   "fsf_uss", req->req_id);
144 log:
145         debug_event(dbf->hba, 2, rec, sizeof(*rec));
146         spin_unlock_irqrestore(&dbf->hba_lock, flags);
147 }
148
149 /**
150  * zfcp_dbf_hba_bit_err - trace event for bit error conditions
151  * @tag: tag indicating which kind of unsolicited status has been received
152  * @req: request which caused the bit_error condition
153  */
154 void zfcp_dbf_hba_bit_err(char *tag, struct zfcp_fsf_req *req)
155 {
156         struct zfcp_dbf *dbf = req->adapter->dbf;
157         struct zfcp_dbf_hba *rec = &dbf->hba_buf;
158         struct fsf_status_read_buffer *sr_buf = req->data;
159         unsigned long flags;
160
161         spin_lock_irqsave(&dbf->hba_lock, flags);
162         memset(rec, 0, sizeof(*rec));
163
164         memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN);
165         rec->id = ZFCP_DBF_HBA_BIT;
166         rec->fsf_req_id = req->req_id;
167         rec->fsf_req_status = req->status;
168         rec->fsf_cmd = req->fsf_command;
169         memcpy(&rec->u.be, &sr_buf->payload.bit_error,
170                sizeof(struct fsf_bit_error_payload));
171
172         debug_event(dbf->hba, 1, rec, sizeof(*rec));
173         spin_unlock_irqrestore(&dbf->hba_lock, flags);
174 }
175
176 /**
177  * zfcp_dbf_hba_def_err - trace event for deferred error messages
178  * @adapter: pointer to struct zfcp_adapter
179  * @req_id: request id which caused the deferred error message
180  * @scount: number of sbals incl. the signaling sbal
181  * @pl: array of all involved sbals
182  */
183 void zfcp_dbf_hba_def_err(struct zfcp_adapter *adapter, u64 req_id, u16 scount,
184                           void **pl)
185 {
186         struct zfcp_dbf *dbf = adapter->dbf;
187         struct zfcp_dbf_pay *payload = &dbf->pay_buf;
188         unsigned long flags;
189         u16 length;
190
191         if (!pl)
192                 return;
193
194         spin_lock_irqsave(&dbf->pay_lock, flags);
195         memset(payload, 0, sizeof(*payload));
196
197         memcpy(payload->area, "def_err", 7);
198         payload->fsf_req_id = req_id;
199         payload->counter = 0;
200         length = min((u16)sizeof(struct qdio_buffer),
201                      (u16)ZFCP_DBF_PAY_MAX_REC);
202
203         while (payload->counter < scount && (char *)pl[payload->counter]) {
204                 memcpy(payload->data, (char *)pl[payload->counter], length);
205                 debug_event(dbf->pay, 1, payload, zfcp_dbf_plen(length));
206                 payload->counter++;
207         }
208
209         spin_unlock_irqrestore(&dbf->pay_lock, flags);
210 }
211
212 /**
213  * zfcp_dbf_hba_basic - trace event for basic adapter events
214  * @adapter: pointer to struct zfcp_adapter
215  */
216 void zfcp_dbf_hba_basic(char *tag, struct zfcp_adapter *adapter)
217 {
218         struct zfcp_dbf *dbf = adapter->dbf;
219         struct zfcp_dbf_hba *rec = &dbf->hba_buf;
220         unsigned long flags;
221
222         spin_lock_irqsave(&dbf->hba_lock, flags);
223         memset(rec, 0, sizeof(*rec));
224
225         memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN);
226         rec->id = ZFCP_DBF_HBA_BASIC;
227
228         debug_event(dbf->hba, 1, rec, sizeof(*rec));
229         spin_unlock_irqrestore(&dbf->hba_lock, flags);
230 }
231
232 static void zfcp_dbf_set_common(struct zfcp_dbf_rec *rec,
233                                 struct zfcp_adapter *adapter,
234                                 struct zfcp_port *port,
235                                 struct scsi_device *sdev)
236 {
237         rec->adapter_status = atomic_read(&adapter->status);
238         if (port) {
239                 rec->port_status = atomic_read(&port->status);
240                 rec->wwpn = port->wwpn;
241                 rec->d_id = port->d_id;
242         }
243         if (sdev) {
244                 rec->lun_status = atomic_read(&sdev_to_zfcp(sdev)->status);
245                 rec->lun = zfcp_scsi_dev_lun(sdev);
246         } else
247                 rec->lun = ZFCP_DBF_INVALID_LUN;
248 }
249
250 /**
251  * zfcp_dbf_rec_trig - trace event related to triggered recovery
252  * @tag: identifier for event
253  * @adapter: adapter on which the erp_action should run
254  * @port: remote port involved in the erp_action
255  * @sdev: scsi device involved in the erp_action
256  * @want: wanted erp_action
257  * @need: required erp_action
258  *
259  * The adapter->erp_lock has to be held.
260  */
261 void zfcp_dbf_rec_trig(char *tag, struct zfcp_adapter *adapter,
262                        struct zfcp_port *port, struct scsi_device *sdev,
263                        u8 want, u8 need)
264 {
265         struct zfcp_dbf *dbf = adapter->dbf;
266         struct zfcp_dbf_rec *rec = &dbf->rec_buf;
267         struct list_head *entry;
268         unsigned long flags;
269
270         spin_lock_irqsave(&dbf->rec_lock, flags);
271         memset(rec, 0, sizeof(*rec));
272
273         rec->id = ZFCP_DBF_REC_TRIG;
274         memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN);
275         zfcp_dbf_set_common(rec, adapter, port, sdev);
276
277         list_for_each(entry, &adapter->erp_ready_head)
278                 rec->u.trig.ready++;
279
280         list_for_each(entry, &adapter->erp_running_head)
281                 rec->u.trig.running++;
282
283         rec->u.trig.want = want;
284         rec->u.trig.need = need;
285
286         debug_event(dbf->rec, 1, rec, sizeof(*rec));
287         spin_unlock_irqrestore(&dbf->rec_lock, flags);
288 }
289
290
291 /**
292  * zfcp_dbf_rec_run - trace event related to running recovery
293  * @tag: identifier for event
294  * @erp: erp_action running
295  */
296 void zfcp_dbf_rec_run(char *tag, struct zfcp_erp_action *erp)
297 {
298         struct zfcp_dbf *dbf = erp->adapter->dbf;
299         struct zfcp_dbf_rec *rec = &dbf->rec_buf;
300         unsigned long flags;
301
302         spin_lock_irqsave(&dbf->rec_lock, flags);
303         memset(rec, 0, sizeof(*rec));
304
305         rec->id = ZFCP_DBF_REC_RUN;
306         memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN);
307         zfcp_dbf_set_common(rec, erp->adapter, erp->port, erp->sdev);
308
309         rec->u.run.fsf_req_id = erp->fsf_req_id;
310         rec->u.run.rec_status = erp->status;
311         rec->u.run.rec_step = erp->step;
312         rec->u.run.rec_action = erp->action;
313
314         if (erp->sdev)
315                 rec->u.run.rec_count =
316                         atomic_read(&sdev_to_zfcp(erp->sdev)->erp_counter);
317         else if (erp->port)
318                 rec->u.run.rec_count = atomic_read(&erp->port->erp_counter);
319         else
320                 rec->u.run.rec_count = atomic_read(&erp->adapter->erp_counter);
321
322         debug_event(dbf->rec, 1, rec, sizeof(*rec));
323         spin_unlock_irqrestore(&dbf->rec_lock, flags);
324 }
325
326 /**
327  * zfcp_dbf_rec_run_wka - trace wka port event with info like running recovery
328  * @tag: identifier for event
329  * @wka_port: well known address port
330  * @req_id: request ID to correlate with potential HBA trace record
331  */
332 void zfcp_dbf_rec_run_wka(char *tag, struct zfcp_fc_wka_port *wka_port,
333                           u64 req_id)
334 {
335         struct zfcp_dbf *dbf = wka_port->adapter->dbf;
336         struct zfcp_dbf_rec *rec = &dbf->rec_buf;
337         unsigned long flags;
338
339         spin_lock_irqsave(&dbf->rec_lock, flags);
340         memset(rec, 0, sizeof(*rec));
341
342         rec->id = ZFCP_DBF_REC_RUN;
343         memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN);
344         rec->port_status = wka_port->status;
345         rec->d_id = wka_port->d_id;
346         rec->lun = ZFCP_DBF_INVALID_LUN;
347
348         rec->u.run.fsf_req_id = req_id;
349         rec->u.run.rec_status = ~0;
350         rec->u.run.rec_step = ~0;
351         rec->u.run.rec_action = ~0;
352         rec->u.run.rec_count = ~0;
353
354         debug_event(dbf->rec, 1, rec, sizeof(*rec));
355         spin_unlock_irqrestore(&dbf->rec_lock, flags);
356 }
357
358 static inline
359 void zfcp_dbf_san(char *tag, struct zfcp_dbf *dbf, void *data, u8 id, u16 len,
360                   u64 req_id, u32 d_id)
361 {
362         struct zfcp_dbf_san *rec = &dbf->san_buf;
363         u16 rec_len;
364         unsigned long flags;
365
366         spin_lock_irqsave(&dbf->san_lock, flags);
367         memset(rec, 0, sizeof(*rec));
368
369         rec->id = id;
370         rec->fsf_req_id = req_id;
371         rec->d_id = d_id;
372         rec_len = min(len, (u16)ZFCP_DBF_SAN_MAX_PAYLOAD);
373         memcpy(rec->payload, data, rec_len);
374         memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN);
375
376         debug_event(dbf->san, 1, rec, sizeof(*rec));
377         spin_unlock_irqrestore(&dbf->san_lock, flags);
378 }
379
380 /**
381  * zfcp_dbf_san_req - trace event for issued SAN request
382  * @tag: identifier for event
383  * @fsf_req: request containing issued CT data
384  * d_id: destination ID
385  */
386 void zfcp_dbf_san_req(char *tag, struct zfcp_fsf_req *fsf, u32 d_id)
387 {
388         struct zfcp_dbf *dbf = fsf->adapter->dbf;
389         struct zfcp_fsf_ct_els *ct_els = fsf->data;
390         u16 length;
391
392         length = (u16)(ct_els->req->length);
393         zfcp_dbf_san(tag, dbf, sg_virt(ct_els->req), ZFCP_DBF_SAN_REQ, length,
394                      fsf->req_id, d_id);
395 }
396
397 /**
398  * zfcp_dbf_san_res - trace event for received SAN request
399  * @tag: identifier for event
400  * @fsf_req: request containing issued CT data
401  */
402 void zfcp_dbf_san_res(char *tag, struct zfcp_fsf_req *fsf)
403 {
404         struct zfcp_dbf *dbf = fsf->adapter->dbf;
405         struct zfcp_fsf_ct_els *ct_els = fsf->data;
406         u16 length;
407
408         length = (u16)(ct_els->resp->length);
409         zfcp_dbf_san(tag, dbf, sg_virt(ct_els->resp), ZFCP_DBF_SAN_RES, length,
410                      fsf->req_id, ct_els->d_id);
411 }
412
413 /**
414  * zfcp_dbf_san_in_els - trace event for incoming ELS
415  * @tag: identifier for event
416  * @fsf_req: request containing issued CT data
417  */
418 void zfcp_dbf_san_in_els(char *tag, struct zfcp_fsf_req *fsf)
419 {
420         struct zfcp_dbf *dbf = fsf->adapter->dbf;
421         struct fsf_status_read_buffer *srb =
422                 (struct fsf_status_read_buffer *) fsf->data;
423         u16 length;
424
425         length = (u16)(srb->length -
426                         offsetof(struct fsf_status_read_buffer, payload));
427         zfcp_dbf_san(tag, dbf, srb->payload.data, ZFCP_DBF_SAN_ELS, length,
428                      fsf->req_id, ntoh24(srb->d_id));
429 }
430
431 /**
432  * zfcp_dbf_scsi - trace event for scsi commands
433  * @tag: identifier for event
434  * @sc: pointer to struct scsi_cmnd
435  * @fsf: pointer to struct zfcp_fsf_req
436  */
437 void zfcp_dbf_scsi(char *tag, int level, struct scsi_cmnd *sc,
438                    struct zfcp_fsf_req *fsf)
439 {
440         struct zfcp_adapter *adapter =
441                 (struct zfcp_adapter *) sc->device->host->hostdata[0];
442         struct zfcp_dbf *dbf = adapter->dbf;
443         struct zfcp_dbf_scsi *rec = &dbf->scsi_buf;
444         struct fcp_resp_with_ext *fcp_rsp;
445         struct fcp_resp_rsp_info *fcp_rsp_info;
446         unsigned long flags;
447
448         spin_lock_irqsave(&dbf->scsi_lock, flags);
449         memset(rec, 0, sizeof(*rec));
450
451         memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN);
452         rec->id = ZFCP_DBF_SCSI_CMND;
453         rec->scsi_result = sc->result;
454         rec->scsi_retries = sc->retries;
455         rec->scsi_allowed = sc->allowed;
456         rec->scsi_id = sc->device->id;
457         /* struct zfcp_dbf_scsi needs to be updated to handle 64bit LUNs */
458         rec->scsi_lun = (u32)sc->device->lun;
459         rec->host_scribble = (unsigned long)sc->host_scribble;
460
461         memcpy(rec->scsi_opcode, sc->cmnd,
462                min((int)sc->cmd_len, ZFCP_DBF_SCSI_OPCODE));
463
464         if (fsf) {
465                 rec->fsf_req_id = fsf->req_id;
466                 fcp_rsp = (struct fcp_resp_with_ext *)
467                                 &(fsf->qtcb->bottom.io.fcp_rsp);
468                 memcpy(&rec->fcp_rsp, fcp_rsp, FCP_RESP_WITH_EXT);
469                 if (fcp_rsp->resp.fr_flags & FCP_RSP_LEN_VAL) {
470                         fcp_rsp_info = (struct fcp_resp_rsp_info *) &fcp_rsp[1];
471                         rec->fcp_rsp_info = fcp_rsp_info->rsp_code;
472                 }
473                 if (fcp_rsp->resp.fr_flags & FCP_SNS_LEN_VAL) {
474                         rec->pl_len = min((u16)SCSI_SENSE_BUFFERSIZE,
475                                           (u16)ZFCP_DBF_PAY_MAX_REC);
476                         zfcp_dbf_pl_write(dbf, sc->sense_buffer, rec->pl_len,
477                                           "fcp_sns", fsf->req_id);
478                 }
479         }
480
481         debug_event(dbf->scsi, level, rec, sizeof(*rec));
482         spin_unlock_irqrestore(&dbf->scsi_lock, flags);
483 }
484
485 static debug_info_t *zfcp_dbf_reg(const char *name, int size, int rec_size)
486 {
487         struct debug_info *d;
488
489         d = debug_register(name, size, 1, rec_size);
490         if (!d)
491                 return NULL;
492
493         debug_register_view(d, &debug_hex_ascii_view);
494         debug_set_level(d, dbflevel);
495
496         return d;
497 }
498
499 static void zfcp_dbf_unregister(struct zfcp_dbf *dbf)
500 {
501         if (!dbf)
502                 return;
503
504         debug_unregister(dbf->scsi);
505         debug_unregister(dbf->san);
506         debug_unregister(dbf->hba);
507         debug_unregister(dbf->pay);
508         debug_unregister(dbf->rec);
509         kfree(dbf);
510 }
511
512 /**
513  * zfcp_adapter_debug_register - registers debug feature for an adapter
514  * @adapter: pointer to adapter for which debug features should be registered
515  * return: -ENOMEM on error, 0 otherwise
516  */
517 int zfcp_dbf_adapter_register(struct zfcp_adapter *adapter)
518 {
519         char name[DEBUG_MAX_NAME_LEN];
520         struct zfcp_dbf *dbf;
521
522         dbf = kzalloc(sizeof(struct zfcp_dbf), GFP_KERNEL);
523         if (!dbf)
524                 return -ENOMEM;
525
526         spin_lock_init(&dbf->pay_lock);
527         spin_lock_init(&dbf->hba_lock);
528         spin_lock_init(&dbf->san_lock);
529         spin_lock_init(&dbf->scsi_lock);
530         spin_lock_init(&dbf->rec_lock);
531
532         /* debug feature area which records recovery activity */
533         sprintf(name, "zfcp_%s_rec", dev_name(&adapter->ccw_device->dev));
534         dbf->rec = zfcp_dbf_reg(name, dbfsize, sizeof(struct zfcp_dbf_rec));
535         if (!dbf->rec)
536                 goto err_out;
537
538         /* debug feature area which records HBA (FSF and QDIO) conditions */
539         sprintf(name, "zfcp_%s_hba", dev_name(&adapter->ccw_device->dev));
540         dbf->hba = zfcp_dbf_reg(name, dbfsize, sizeof(struct zfcp_dbf_hba));
541         if (!dbf->hba)
542                 goto err_out;
543
544         /* debug feature area which records payload info */
545         sprintf(name, "zfcp_%s_pay", dev_name(&adapter->ccw_device->dev));
546         dbf->pay = zfcp_dbf_reg(name, dbfsize * 2, sizeof(struct zfcp_dbf_pay));
547         if (!dbf->pay)
548                 goto err_out;
549
550         /* debug feature area which records SAN command failures and recovery */
551         sprintf(name, "zfcp_%s_san", dev_name(&adapter->ccw_device->dev));
552         dbf->san = zfcp_dbf_reg(name, dbfsize, sizeof(struct zfcp_dbf_san));
553         if (!dbf->san)
554                 goto err_out;
555
556         /* debug feature area which records SCSI command failures and recovery */
557         sprintf(name, "zfcp_%s_scsi", dev_name(&adapter->ccw_device->dev));
558         dbf->scsi = zfcp_dbf_reg(name, dbfsize, sizeof(struct zfcp_dbf_scsi));
559         if (!dbf->scsi)
560                 goto err_out;
561
562         adapter->dbf = dbf;
563
564         return 0;
565 err_out:
566         zfcp_dbf_unregister(dbf);
567         return -ENOMEM;
568 }
569
570 /**
571  * zfcp_adapter_debug_unregister - unregisters debug feature for an adapter
572  * @adapter: pointer to adapter for which debug features should be unregistered
573  */
574 void zfcp_dbf_adapter_unregister(struct zfcp_adapter *adapter)
575 {
576         struct zfcp_dbf *dbf = adapter->dbf;
577
578         adapter->dbf = NULL;
579         zfcp_dbf_unregister(dbf);
580 }
581