bnx2fc_debug.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* bnx2fc_debug.h: QLogic Linux FCoE offload driver.
  2. * Handles operations such as session offload/upload etc, and manages
  3. * session resources such as connection id and qp resources.
  4. *
  5. * Copyright (c) 2008-2013 Broadcom Corporation
  6. * Copyright (c) 2014-2016 QLogic Corporation
  7. * Copyright (c) 2016-2017 Cavium Inc.
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation.
  12. *
  13. */
  14. #ifndef __BNX2FC_DEBUG__
  15. #define __BNX2FC_DEBUG__
  16. /* Log level bit mask */
  17. #define LOG_IO 0x01 /* scsi cmd error, cleanup */
  18. #define LOG_TGT 0x02 /* Session setup, cleanup, etc' */
  19. #define LOG_HBA 0x04 /* lport events, link, mtu, etc' */
  20. #define LOG_ELS 0x08 /* ELS logs */
  21. #define LOG_MISC 0x10 /* fcoe L2 frame related logs*/
  22. #define LOG_ALL 0xff /* LOG all messages */
  23. extern unsigned int bnx2fc_debug_level;
  24. #define BNX2FC_ELS_DBG(fmt, ...) \
  25. do { \
  26. if (unlikely(bnx2fc_debug_level & LOG_ELS)) \
  27. pr_info(fmt, ##__VA_ARGS__); \
  28. } while (0)
  29. #define BNX2FC_MISC_DBG(fmt, ...) \
  30. do { \
  31. if (unlikely(bnx2fc_debug_level & LOG_MISC)) \
  32. pr_info(fmt, ##__VA_ARGS__); \
  33. } while (0)
  34. __printf(2, 3)
  35. void BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...);
  36. __printf(2, 3)
  37. void BNX2FC_TGT_DBG(const struct bnx2fc_rport *tgt, const char *fmt, ...);
  38. __printf(2, 3)
  39. void BNX2FC_HBA_DBG(const struct fc_lport *lport, const char *fmt, ...);
  40. #endif