blob: c3fe3167ff719a5b4def5c805d995e97c0fd847d [file] [log] [blame]
Yi Zou21b7b2f2011-01-28 16:04:45 -08001#ifndef _FCOE_LIBFCOE_H_
2#define _FCOE_LIBFCOE_H_
3
4extern unsigned int libfcoe_debug_logging;
5#define LIBFCOE_LOGGING 0x01 /* General logging, not categorized */
6#define LIBFCOE_FIP_LOGGING 0x02 /* FIP logging */
7
8#define LIBFCOE_CHECK_LOGGING(LEVEL, CMD) \
9do { \
10 if (unlikely(libfcoe_debug_logging & LEVEL)) \
11 do { \
12 CMD; \
13 } while (0); \
14} while (0)
15
16#define LIBFCOE_DBG(fmt, args...) \
17 LIBFCOE_CHECK_LOGGING(LIBFCOE_LOGGING, \
18 printk(KERN_INFO "libfcoe: " fmt, ##args);)
19
20#define LIBFCOE_FIP_DBG(fip, fmt, args...) \
21 LIBFCOE_CHECK_LOGGING(LIBFCOE_FIP_LOGGING, \
22 printk(KERN_INFO "host%d: fip: " fmt, \
23 (fip)->lp->host->host_no, ##args);)
24
25#endif /* _FCOE_LIBFCOE_H_ */