diff options
author | Yi Zou <yi.zou@intel.com> | 2011-01-28 19:04:45 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2011-02-12 12:05:22 -0500 |
commit | 21b7b2f557f4b105a4b7d739671d1ce6b867d3e6 (patch) | |
tree | a1abdd2beb33e14dce0a69ed099a0f8f81a9dcd7 /drivers/scsi/fcoe/libfcoe.c | |
parent | 6c8cc1c003cee1c4290f5d8c684912d60354056a (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.c | 22 |
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 | |||
47 | MODULE_AUTHOR("Open-FCoE.org"); | 49 | MODULE_AUTHOR("Open-FCoE.org"); |
48 | MODULE_DESCRIPTION("FIP discovery protocol support for FCoE HBAs"); | 50 | MODULE_DESCRIPTION("FIP discovery protocol support for FCoE HBAs"); |
49 | MODULE_LICENSE("GPL v2"); | 51 | MODULE_LICENSE("GPL v2"); |
@@ -70,26 +72,6 @@ unsigned int libfcoe_debug_logging; | |||
70 | module_param_named(debug_logging, libfcoe_debug_logging, int, S_IRUGO|S_IWUSR); | 72 | module_param_named(debug_logging, libfcoe_debug_logging, int, S_IRUGO|S_IWUSR); |
71 | MODULE_PARM_DESC(debug_logging, "a bit mask of logging levels"); | 73 | MODULE_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) \ | ||
77 | do { \ | ||
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 | |||
93 | static const char *fcoe_ctlr_states[] = { | 75 | static 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", |