libfcoe.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _FCOE_LIBFCOE_H_
  3. #define _FCOE_LIBFCOE_H_
  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. #define LIBFCOE_TRANSPORT_LOGGING 0x04 /* FCoE transport logging */
  8. #define LIBFCOE_SYSFS_LOGGING 0x08 /* fcoe_sysfs logging */
  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. #define LIBFCOE_DBG(fmt, args...) \
  17. LIBFCOE_CHECK_LOGGING(LIBFCOE_LOGGING, \
  18. pr_info("libfcoe: " fmt, ##args);)
  19. #define LIBFCOE_FIP_DBG(fip, fmt, args...) \
  20. LIBFCOE_CHECK_LOGGING(LIBFCOE_FIP_LOGGING, \
  21. pr_info("host%d: fip: " fmt, \
  22. (fip)->lp->host->host_no, ##args);)
  23. #define LIBFCOE_TRANSPORT_DBG(fmt, args...) \
  24. LIBFCOE_CHECK_LOGGING(LIBFCOE_TRANSPORT_LOGGING, \
  25. pr_info("%s: " fmt, __func__, ##args);)
  26. #define LIBFCOE_SYSFS_DBG(cdev, fmt, args...) \
  27. LIBFCOE_CHECK_LOGGING(LIBFCOE_SYSFS_LOGGING, \
  28. pr_info("ctlr_%d: " fmt, cdev->id, ##args);)
  29. #endif /* _FCOE_LIBFCOE_H_ */