xref: /openbmc/linux/drivers/scsi/bnx2fc/bnx2fc_debug.h (revision 3db8cc106569aa81088ee83d46f52a631471811c)
1853e2bd2SBhanu Gollapudi #ifndef __BNX2FC_DEBUG__
2853e2bd2SBhanu Gollapudi #define __BNX2FC_DEBUG__
3853e2bd2SBhanu Gollapudi 
4853e2bd2SBhanu Gollapudi /* Log level bit mask */
5853e2bd2SBhanu Gollapudi #define LOG_IO		0x01	/* scsi cmd error, cleanup */
6853e2bd2SBhanu Gollapudi #define LOG_TGT		0x02	/* Session setup, cleanup, etc' */
7853e2bd2SBhanu Gollapudi #define LOG_HBA		0x04	/* lport events, link, mtu, etc' */
8853e2bd2SBhanu Gollapudi #define LOG_ELS		0x08	/* ELS logs */
9853e2bd2SBhanu Gollapudi #define LOG_MISC	0x10	/* fcoe L2 frame related logs*/
10853e2bd2SBhanu Gollapudi #define LOG_ALL		0xff	/* LOG all messages */
11853e2bd2SBhanu Gollapudi 
12853e2bd2SBhanu Gollapudi extern unsigned int bnx2fc_debug_level;
13853e2bd2SBhanu Gollapudi 
14*3db8cc10SJoe Perches #define BNX2FC_ELS_DBG(fmt, ...)				\
15853e2bd2SBhanu Gollapudi do {								\
16*3db8cc10SJoe Perches 	if (unlikely(bnx2fc_debug_level & LOG_ELS))		\
17*3db8cc10SJoe Perches 		pr_info(fmt, ##__VA_ARGS__);			\
18853e2bd2SBhanu Gollapudi } while (0)
19853e2bd2SBhanu Gollapudi 
20*3db8cc10SJoe Perches #define BNX2FC_MISC_DBG(fmt, ...)				\
21853e2bd2SBhanu Gollapudi do {								\
22*3db8cc10SJoe Perches 	if (unlikely(bnx2fc_debug_level & LOG_MISC))		\
23*3db8cc10SJoe Perches 		pr_info(fmt, ##__VA_ARGS__);			\
24853e2bd2SBhanu Gollapudi } while (0)
25853e2bd2SBhanu Gollapudi 
26*3db8cc10SJoe Perches __printf(2, 3)
27*3db8cc10SJoe Perches void BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...);
28*3db8cc10SJoe Perches __printf(2, 3)
29*3db8cc10SJoe Perches void BNX2FC_TGT_DBG(const struct bnx2fc_rport *tgt, const char *fmt, ...);
30*3db8cc10SJoe Perches __printf(2, 3)
31*3db8cc10SJoe Perches void BNX2FC_HBA_DBG(const struct fc_lport *lport, const char *fmt, ...);
32853e2bd2SBhanu Gollapudi 
33853e2bd2SBhanu Gollapudi #endif
34