aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe/libfcoe.c
diff options
context:
space:
mode:
authorYi Zou <yi.zou@intel.com>2011-01-28 19:04:45 -0500
committerJames Bottomley <James.Bottomley@suse.de>2011-02-12 12:05:22 -0500
commit21b7b2f557f4b105a4b7d739671d1ce6b867d3e6 (patch)
treea1abdd2beb33e14dce0a69ed099a0f8f81a9dcd7 /drivers/scsi/fcoe/libfcoe.c
parent6c8cc1c003cee1c4290f5d8c684912d60354056a (diff)
[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.c')
-rw-r--r--drivers/scsi/fcoe/libfcoe.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index 625c6be25396..a4757ca2a4ed 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -44,6 +44,8 @@
44#include <scsi/libfc.h> 44#include <scsi/libfc.h>
45#include <scsi/libfcoe.h> 45#include <scsi/libfcoe.h>
46 46
47#include "libfcoe.h"
48
47MODULE_AUTHOR("Open-FCoE.org"); 49MODULE_AUTHOR("Open-FCoE.org");
48MODULE_DESCRIPTION("FIP discovery protocol support for FCoE HBAs"); 50MODULE_DESCRIPTION("FIP discovery protocol support for FCoE HBAs");
49MODULE_LICENSE("GPL v2"); 51MODULE_LICENSE("GPL v2");
@@ -70,26 +72,6 @@ unsigned int libfcoe_debug_logging;
70module_param_named(debug_logging, libfcoe_debug_logging, int, S_IRUGO|S_IWUSR); 72module_param_named(debug_logging, libfcoe_debug_logging, int, S_IRUGO|S_IWUSR);
71MODULE_PARM_DESC(debug_logging, "a bit mask of logging levels"); 73MODULE_PARM_DESC(debug_logging, "a bit mask of logging levels");
72 74
73#define LIBFCOE_LOGGING 0x01 /* General logging, not categorized */
74#define LIBFCOE_FIP_LOGGING 0x02 /* FIP logging */
75
76#define LIBFCOE_CHECK_LOGGING(LEVEL, CMD) \
77do { \
78 if (unlikely(libfcoe_debug_logging & LEVEL)) \
79 do { \
80 CMD; \
81 } while (0); \
82} while (0)
83
84#define LIBFCOE_DBG(fmt, args...) \
85 LIBFCOE_CHECK_LOGGING(LIBFCOE_LOGGING, \
86 printk(KERN_INFO "libfcoe: " fmt, ##args);)
87
88#define LIBFCOE_FIP_DBG(fip, fmt, args...) \
89 LIBFCOE_CHECK_LOGGING(LIBFCOE_FIP_LOGGING, \
90 printk(KERN_INFO "host%d: fip: " fmt, \
91 (fip)->lp->host->host_no, ##args);)
92
93static const char *fcoe_ctlr_states[] = { 75static const char *fcoe_ctlr_states[] = {
94 [FIP_ST_DISABLED] = "DISABLED", 76 [FIP_ST_DISABLED] = "DISABLED",
95 [FIP_ST_LINK_WAIT] = "LINK_WAIT", 77 [FIP_ST_LINK_WAIT] = "LINK_WAIT",