blob: b8bdfab51a5844dd3ec868d42da7a26ef03784c6 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Yi Zou21b7b2f2011-01-28 16:04:45 -08002#ifndef _FCOE_LIBFCOE_H_
3#define _FCOE_LIBFCOE_H_
4
5extern unsigned int libfcoe_debug_logging;
Robert Love3993de62012-11-27 06:53:24 +00006#define LIBFCOE_LOGGING 0x01 /* General logging, not categorized */
7#define LIBFCOE_FIP_LOGGING 0x02 /* FIP logging */
8#define LIBFCOE_TRANSPORT_LOGGING 0x04 /* FCoE transport logging */
9#define LIBFCOE_SYSFS_LOGGING 0x08 /* fcoe_sysfs logging */
Yi Zou21b7b2f2011-01-28 16:04:45 -080010
11#define LIBFCOE_CHECK_LOGGING(LEVEL, CMD) \
12do { \
13 if (unlikely(libfcoe_debug_logging & LEVEL)) \
14 do { \
15 CMD; \
16 } while (0); \
17} while (0)
18
19#define LIBFCOE_DBG(fmt, args...) \
20 LIBFCOE_CHECK_LOGGING(LIBFCOE_LOGGING, \
Robert Love8e6c5362012-12-04 02:14:53 +000021 pr_info("libfcoe: " fmt, ##args);)
Yi Zou21b7b2f2011-01-28 16:04:45 -080022
23#define LIBFCOE_FIP_DBG(fip, fmt, args...) \
24 LIBFCOE_CHECK_LOGGING(LIBFCOE_FIP_LOGGING, \
Robert Love8e6c5362012-12-04 02:14:53 +000025 pr_info("host%d: fip: " fmt, \
26 (fip)->lp->host->host_no, ##args);)
Yi Zou21b7b2f2011-01-28 16:04:45 -080027
Yi Zoufdecf312011-01-28 16:04:55 -080028#define LIBFCOE_TRANSPORT_DBG(fmt, args...) \
29 LIBFCOE_CHECK_LOGGING(LIBFCOE_TRANSPORT_LOGGING, \
Robert Love8e6c5362012-12-04 02:14:53 +000030 pr_info("%s: " fmt, __func__, ##args);)
Yi Zoufdecf312011-01-28 16:04:55 -080031
Robert Love3993de62012-11-27 06:53:24 +000032#define LIBFCOE_SYSFS_DBG(cdev, fmt, args...) \
33 LIBFCOE_CHECK_LOGGING(LIBFCOE_SYSFS_LOGGING, \
34 pr_info("ctlr_%d: " fmt, cdev->id, ##args);)
35
Yi Zou21b7b2f2011-01-28 16:04:45 -080036#endif /* _FCOE_LIBFCOE_H_ */