Bhanu Gollapudi | 853e2bd | 2011-02-04 12:10:34 -0800 | [diff] [blame] | 1 | #ifndef __BNX2FC_DEBUG__ |
| 2 | #define __BNX2FC_DEBUG__ |
| 3 | |
| 4 | /* Log level bit mask */ |
| 5 | #define LOG_IO 0x01 /* scsi cmd error, cleanup */ |
| 6 | #define LOG_TGT 0x02 /* Session setup, cleanup, etc' */ |
| 7 | #define LOG_HBA 0x04 /* lport events, link, mtu, etc' */ |
| 8 | #define LOG_ELS 0x08 /* ELS logs */ |
| 9 | #define LOG_MISC 0x10 /* fcoe L2 frame related logs*/ |
| 10 | #define LOG_ALL 0xff /* LOG all messages */ |
| 11 | |
| 12 | extern unsigned int bnx2fc_debug_level; |
| 13 | |
Joe Perches | 3db8cc1 | 2012-06-04 16:15:43 -0700 | [diff] [blame] | 14 | #define BNX2FC_ELS_DBG(fmt, ...) \ |
| 15 | do { \ |
| 16 | if (unlikely(bnx2fc_debug_level & LOG_ELS)) \ |
| 17 | pr_info(fmt, ##__VA_ARGS__); \ |
| 18 | } while (0) |
Bhanu Gollapudi | 853e2bd | 2011-02-04 12:10:34 -0800 | [diff] [blame] | 19 | |
Joe Perches | 3db8cc1 | 2012-06-04 16:15:43 -0700 | [diff] [blame] | 20 | #define BNX2FC_MISC_DBG(fmt, ...) \ |
| 21 | do { \ |
| 22 | if (unlikely(bnx2fc_debug_level & LOG_MISC)) \ |
| 23 | pr_info(fmt, ##__VA_ARGS__); \ |
| 24 | } while (0) |
Bhanu Gollapudi | 853e2bd | 2011-02-04 12:10:34 -0800 | [diff] [blame] | 25 | |
Joe Perches | 3db8cc1 | 2012-06-04 16:15:43 -0700 | [diff] [blame] | 26 | __printf(2, 3) |
| 27 | void BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...); |
| 28 | __printf(2, 3) |
| 29 | void BNX2FC_TGT_DBG(const struct bnx2fc_rport *tgt, const char *fmt, ...); |
| 30 | __printf(2, 3) |
| 31 | void BNX2FC_HBA_DBG(const struct fc_lport *lport, const char *fmt, ...); |
Bhanu Gollapudi | 853e2bd | 2011-02-04 12:10:34 -0800 | [diff] [blame] | 32 | |
| 33 | #endif |