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.h | |
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.h')
-rw-r--r-- | drivers/scsi/fcoe/libfcoe.h | 25 |
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 000000000000..c3fe3167ff71 --- /dev/null +++ b/drivers/scsi/fcoe/libfcoe.h | |||
@@ -0,0 +1,25 @@ | |||
1 | #ifndef _FCOE_LIBFCOE_H_ | ||
2 | #define _FCOE_LIBFCOE_H_ | ||
3 | |||
4 | extern 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) \ | ||
9 | do { \ | ||
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_ */ | ||