bnx2fc_debug.h 994 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef __BNX2FC_DEBUG__
  2. #define __BNX2FC_DEBUG__
  3. /* Log level bit mask */
  4. #define LOG_IO 0x01 /* scsi cmd error, cleanup */
  5. #define LOG_TGT 0x02 /* Session setup, cleanup, etc' */
  6. #define LOG_HBA 0x04 /* lport events, link, mtu, etc' */
  7. #define LOG_ELS 0x08 /* ELS logs */
  8. #define LOG_MISC 0x10 /* fcoe L2 frame related logs*/
  9. #define LOG_ALL 0xff /* LOG all messages */
  10. extern unsigned int bnx2fc_debug_level;
  11. #define BNX2FC_ELS_DBG(fmt, ...) \
  12. do { \
  13. if (unlikely(bnx2fc_debug_level & LOG_ELS)) \
  14. pr_info(fmt, ##__VA_ARGS__); \
  15. } while (0)
  16. #define BNX2FC_MISC_DBG(fmt, ...) \
  17. do { \
  18. if (unlikely(bnx2fc_debug_level & LOG_MISC)) \
  19. pr_info(fmt, ##__VA_ARGS__); \
  20. } while (0)
  21. __printf(2, 3)
  22. void BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...);
  23. __printf(2, 3)
  24. void BNX2FC_TGT_DBG(const struct bnx2fc_rport *tgt, const char *fmt, ...);
  25. __printf(2, 3)
  26. void BNX2FC_HBA_DBG(const struct fc_lport *lport, const char *fmt, ...);
  27. #endif