blob: 47ba3ba1e03bf6e00f6e254922f06ca4efe627d3 [file] [log] [blame]
Chad Dupuisde909d82015-10-19 15:40:36 -04001/* bnx2fc_debug.c: QLogic Linux FCoE offload driver.
Saurav Kashyap17d87c42014-07-03 08:18:28 -04002 * Handles operations such as session offload/upload etc, and manages
3 * session resources such as connection id and qp resources.
4 *
Chad Dupuis97586092015-10-19 15:40:35 -04005 * Copyright (c) 2008-2013 Broadcom Corporation
Chad Dupuis21144b82017-06-26 08:59:34 -07006 * Copyright (c) 2014-2016 QLogic Corporation
7 * Copyright (c) 2016-2017 Cavium Inc.
Saurav Kashyap17d87c42014-07-03 08:18:28 -04008 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation.
12 *
13 */
14
Joe Perches3db8cc12012-06-04 16:15:43 -070015#include "bnx2fc.h"
16
17void BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...)
18{
19 struct va_format vaf;
20 va_list args;
21
22 if (likely(!(bnx2fc_debug_level & LOG_IO)))
23 return;
24
25 va_start(args, fmt);
26
27 vaf.fmt = fmt;
28 vaf.va = &args;
29
30 if (io_req && io_req->port && io_req->port->lport &&
31 io_req->port->lport->host)
32 shost_printk(KERN_INFO, io_req->port->lport->host,
33 PFX "xid:0x%x %pV",
34 io_req->xid, &vaf);
35 else
36 pr_info("NULL %pV", &vaf);
37
38 va_end(args);
39}
40
41void BNX2FC_TGT_DBG(const struct bnx2fc_rport *tgt, const char *fmt, ...)
42{
43 struct va_format vaf;
44 va_list args;
45
46 if (likely(!(bnx2fc_debug_level & LOG_TGT)))
47 return;
48
49 va_start(args, fmt);
50
51 vaf.fmt = fmt;
52 vaf.va = &args;
53
54 if (tgt && tgt->port && tgt->port->lport && tgt->port->lport->host &&
55 tgt->rport)
56 shost_printk(KERN_INFO, tgt->port->lport->host,
57 PFX "port:%x %pV",
58 tgt->rport->port_id, &vaf);
59 else
60 pr_info("NULL %pV", &vaf);
61
62 va_end(args);
63}
64
65void BNX2FC_HBA_DBG(const struct fc_lport *lport, const char *fmt, ...)
66{
67 struct va_format vaf;
68 va_list args;
69
70 if (likely(!(bnx2fc_debug_level & LOG_HBA)))
71 return;
72
73 va_start(args, fmt);
74
75 vaf.fmt = fmt;
76 vaf.va = &args;
77
78 if (lport && lport->host)
79 shost_printk(KERN_INFO, lport->host, PFX "%pV", &vaf);
80 else
81 pr_info("NULL %pV", &vaf);
82
83 va_end(args);
84}