Yi Zou | 21b7b2f | 2011-01-28 16:04:45 -0800 | [diff] [blame] | 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 */ |
Yi Zou | fdecf31 | 2011-01-28 16:04:55 -0800 | [diff] [blame] | 7 | #define LIBFCOE_TRANSPORT_LOGGING 0x04 /* FCoE transport logging */ |
Yi Zou | 21b7b2f | 2011-01-28 16:04:45 -0800 | [diff] [blame] | 8 | |
| 9 | #define LIBFCOE_CHECK_LOGGING(LEVEL, CMD) \ |
| 10 | do { \ |
| 11 | if (unlikely(libfcoe_debug_logging & LEVEL)) \ |
| 12 | do { \ |
| 13 | CMD; \ |
| 14 | } while (0); \ |
| 15 | } while (0) |
| 16 | |
| 17 | #define LIBFCOE_DBG(fmt, args...) \ |
| 18 | LIBFCOE_CHECK_LOGGING(LIBFCOE_LOGGING, \ |
| 19 | printk(KERN_INFO "libfcoe: " fmt, ##args);) |
| 20 | |
| 21 | #define LIBFCOE_FIP_DBG(fip, fmt, args...) \ |
| 22 | LIBFCOE_CHECK_LOGGING(LIBFCOE_FIP_LOGGING, \ |
| 23 | printk(KERN_INFO "host%d: fip: " fmt, \ |
| 24 | (fip)->lp->host->host_no, ##args);) |
| 25 | |
Yi Zou | fdecf31 | 2011-01-28 16:04:55 -0800 | [diff] [blame] | 26 | #define LIBFCOE_TRANSPORT_DBG(fmt, args...) \ |
| 27 | LIBFCOE_CHECK_LOGGING(LIBFCOE_TRANSPORT_LOGGING, \ |
| 28 | printk(KERN_INFO "%s: " fmt, \ |
| 29 | __func__, ##args);) |
| 30 | |
Yi Zou | 21b7b2f | 2011-01-28 16:04:45 -0800 | [diff] [blame] | 31 | #endif /* _FCOE_LIBFCOE_H_ */ |