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