aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bnx2fc/bnx2fc_debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/bnx2fc/bnx2fc_debug.h')
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_debug.h73
1 files changed, 18 insertions, 55 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_debug.h b/drivers/scsi/bnx2fc/bnx2fc_debug.h
index 3416d9a746c7..4808ff99621f 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_debug.h
+++ b/drivers/scsi/bnx2fc/bnx2fc_debug.h
@@ -11,60 +11,23 @@
11 11
12extern unsigned int bnx2fc_debug_level; 12extern unsigned int bnx2fc_debug_level;
13 13
14#define BNX2FC_CHK_LOGGING(LEVEL, CMD) \ 14#define BNX2FC_ELS_DBG(fmt, ...) \
15 do { \ 15do { \
16 if (unlikely(bnx2fc_debug_level & LEVEL)) \ 16 if (unlikely(bnx2fc_debug_level & LOG_ELS)) \
17 do { \ 17 pr_info(fmt, ##__VA_ARGS__); \
18 CMD; \ 18} while (0)
19 } while (0); \ 19
20 } while (0) 20#define BNX2FC_MISC_DBG(fmt, ...) \
21 21do { \
22#define BNX2FC_ELS_DBG(fmt, arg...) \ 22 if (unlikely(bnx2fc_debug_level & LOG_MISC)) \
23 BNX2FC_CHK_LOGGING(LOG_ELS, \ 23 pr_info(fmt, ##__VA_ARGS__); \
24 printk(KERN_INFO PFX fmt, ##arg)) 24} while (0)
25 25
26#define BNX2FC_MISC_DBG(fmt, arg...) \ 26__printf(2, 3)
27 BNX2FC_CHK_LOGGING(LOG_MISC, \ 27void BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...);
28 printk(KERN_INFO PFX fmt, ##arg)) 28__printf(2, 3)
29 29void BNX2FC_TGT_DBG(const struct bnx2fc_rport *tgt, const char *fmt, ...);
30#define BNX2FC_IO_DBG(io_req, fmt, arg...) \ 30__printf(2, 3)
31 do { \ 31void BNX2FC_HBA_DBG(const struct fc_lport *lport, const char *fmt, ...);
32 if (!io_req || !io_req->port || !io_req->port->lport || \
33 !io_req->port->lport->host) \
34 BNX2FC_CHK_LOGGING(LOG_IO, \
35 printk(KERN_INFO PFX "NULL " fmt, ##arg)); \
36 else \
37 BNX2FC_CHK_LOGGING(LOG_IO, \
38 shost_printk(KERN_INFO, \
39 (io_req)->port->lport->host, \
40 PFX "xid:0x%x " fmt, \
41 (io_req)->xid, ##arg)); \
42 } while (0)
43
44#define BNX2FC_TGT_DBG(tgt, fmt, arg...) \
45 do { \
46 if (!tgt || !tgt->port || !tgt->port->lport || \
47 !tgt->port->lport->host || !tgt->rport) \
48 BNX2FC_CHK_LOGGING(LOG_TGT, \
49 printk(KERN_INFO PFX "NULL " fmt, ##arg)); \
50 else \
51 BNX2FC_CHK_LOGGING(LOG_TGT, \
52 shost_printk(KERN_INFO, \
53 (tgt)->port->lport->host, \
54 PFX "port:%x " fmt, \
55 (tgt)->rport->port_id, ##arg)); \
56 } while (0)
57
58
59#define BNX2FC_HBA_DBG(lport, fmt, arg...) \
60 do { \
61 if (!lport || !lport->host) \
62 BNX2FC_CHK_LOGGING(LOG_HBA, \
63 printk(KERN_INFO PFX "NULL " fmt, ##arg)); \
64 else \
65 BNX2FC_CHK_LOGGING(LOG_HBA, \
66 shost_printk(KERN_INFO, lport->host, \
67 PFX fmt, ##arg)); \
68 } while (0)
69 32
70#endif 33#endif