summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe/libfcoe.h
diff options
context:
space:
mode:
authorYi Zou <yi.zou@intel.com>2011-01-28 16:04:45 -0800
committerJames Bottomley <James.Bottomley@suse.de>2011-02-12 11:05:22 -0600
commit21b7b2f557f4b105a4b7d739671d1ce6b867d3e6 (patch)
treea1abdd2beb33e14dce0a69ed099a0f8f81a9dcd7 /drivers/scsi/fcoe/libfcoe.h
parent6c8cc1c003cee1c4290f5d8c684912d60354056a (diff)
downloadop-kernel-dev-21b7b2f557f4b105a4b7d739671d1ce6b867d3e6.zip
op-kernel-dev-21b7b2f557f4b105a4b7d739671d1ce6b867d3e6.tar.gz
[SCSI] libfcoe: move logging macros into the local libfcoe.h header file
libfcoe kernel module debug macros will used by the fcoe transport code as well when later it gets added. Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/fcoe/libfcoe.h')
-rw-r--r--drivers/scsi/fcoe/libfcoe.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/scsi/fcoe/libfcoe.h b/drivers/scsi/fcoe/libfcoe.h
new file mode 100644
index 0000000..c3fe316
--- /dev/null
+++ b/drivers/scsi/fcoe/libfcoe.h
@@ -0,0 +1,25 @@
+#ifndef _FCOE_LIBFCOE_H_
+#define _FCOE_LIBFCOE_H_
+
+extern unsigned int libfcoe_debug_logging;
+#define LIBFCOE_LOGGING 0x01 /* General logging, not categorized */
+#define LIBFCOE_FIP_LOGGING 0x02 /* FIP logging */
+
+#define LIBFCOE_CHECK_LOGGING(LEVEL, CMD) \
+do { \
+ if (unlikely(libfcoe_debug_logging & LEVEL)) \
+ do { \
+ CMD; \
+ } while (0); \
+} while (0)
+
+#define LIBFCOE_DBG(fmt, args...) \
+ LIBFCOE_CHECK_LOGGING(LIBFCOE_LOGGING, \
+ printk(KERN_INFO "libfcoe: " fmt, ##args);)
+
+#define LIBFCOE_FIP_DBG(fip, fmt, args...) \
+ LIBFCOE_CHECK_LOGGING(LIBFCOE_FIP_LOGGING, \
+ printk(KERN_INFO "host%d: fip: " fmt, \
+ (fip)->lp->host->host_no, ##args);)
+
+#endif /* _FCOE_LIBFCOE_H_ */
OpenPOWER on IntegriCloud