libfcoe.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef _FCOE_LIBFCOE_H_
  2. #define _FCOE_LIBFCOE_H_
  3. extern unsigned int libfcoe_debug_logging;
  4. #define LIBFCOE_LOGGING 0x01 /* General logging, not categorized */
  5. #define LIBFCOE_FIP_LOGGING 0x02 /* FIP logging */
  6. #define LIBFCOE_TRANSPORT_LOGGING 0x04 /* FCoE transport logging */
  7. #define LIBFCOE_SYSFS_LOGGING 0x08 /* fcoe_sysfs logging */
  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. #define LIBFCOE_DBG(fmt, args...) \
  16. LIBFCOE_CHECK_LOGGING(LIBFCOE_LOGGING, \
  17. pr_info("libfcoe: " fmt, ##args);)
  18. #define LIBFCOE_FIP_DBG(fip, fmt, args...) \
  19. LIBFCOE_CHECK_LOGGING(LIBFCOE_FIP_LOGGING, \
  20. pr_info("host%d: fip: " fmt, \
  21. (fip)->lp->host->host_no, ##args);)
  22. #define LIBFCOE_TRANSPORT_DBG(fmt, args...) \
  23. LIBFCOE_CHECK_LOGGING(LIBFCOE_TRANSPORT_LOGGING, \
  24. pr_info("%s: " fmt, __func__, ##args);)
  25. #define LIBFCOE_SYSFS_DBG(cdev, fmt, args...) \
  26. LIBFCOE_CHECK_LOGGING(LIBFCOE_SYSFS_LOGGING, \
  27. pr_info("ctlr_%d: " fmt, cdev->id, ##args);)
  28. #endif /* _FCOE_LIBFCOE_H_ */