0001
0002 #ifndef _FCOE_LIBFCOE_H_
0003 #define _FCOE_LIBFCOE_H_
0004
0005 extern unsigned int libfcoe_debug_logging;
0006 #define LIBFCOE_LOGGING 0x01
0007 #define LIBFCOE_FIP_LOGGING 0x02
0008 #define LIBFCOE_TRANSPORT_LOGGING 0x04
0009 #define LIBFCOE_SYSFS_LOGGING 0x08
0010
0011 #define LIBFCOE_CHECK_LOGGING(LEVEL, CMD) \
0012 do { \
0013 if (unlikely(libfcoe_debug_logging & LEVEL)) \
0014 do { \
0015 CMD; \
0016 } while (0); \
0017 } while (0)
0018
0019 #define LIBFCOE_DBG(fmt, args...) \
0020 LIBFCOE_CHECK_LOGGING(LIBFCOE_LOGGING, \
0021 pr_info("libfcoe: " fmt, ##args);)
0022
0023 #define LIBFCOE_FIP_DBG(fip, fmt, args...) \
0024 LIBFCOE_CHECK_LOGGING(LIBFCOE_FIP_LOGGING, \
0025 pr_info("host%d: fip: " fmt, \
0026 (fip)->lp->host->host_no, ##args);)
0027
0028 #define LIBFCOE_TRANSPORT_DBG(fmt, args...) \
0029 LIBFCOE_CHECK_LOGGING(LIBFCOE_TRANSPORT_LOGGING, \
0030 pr_info("%s: " fmt, __func__, ##args);)
0031
0032 #define LIBFCOE_SYSFS_DBG(cdev, fmt, args...) \
0033 LIBFCOE_CHECK_LOGGING(LIBFCOE_SYSFS_LOGGING, \
0034 pr_info("ctlr_%d: " fmt, cdev->id, ##args);)
0035
0036 #endif