bnx2fc_debug.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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-2015 QLogic Corporation
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation.
  11. *
  12. */
  13. #ifndef __BNX2FC_DEBUG__
  14. #define __BNX2FC_DEBUG__
  15. /* Log level bit mask */
  16. #define LOG_IO 0x01 /* scsi cmd error, cleanup */
  17. #define LOG_TGT 0x02 /* Session setup, cleanup, etc' */
  18. #define LOG_HBA 0x04 /* lport events, link, mtu, etc' */
  19. #define LOG_ELS 0x08 /* ELS logs */
  20. #define LOG_MISC 0x10 /* fcoe L2 frame related logs*/
  21. #define LOG_ALL 0xff /* LOG all messages */
  22. extern unsigned int bnx2fc_debug_level;
  23. #define BNX2FC_ELS_DBG(fmt, ...) \
  24. do { \
  25. if (unlikely(bnx2fc_debug_level & LOG_ELS)) \
  26. pr_info(fmt, ##__VA_ARGS__); \
  27. } while (0)
  28. #define BNX2FC_MISC_DBG(fmt, ...) \
  29. do { \
  30. if (unlikely(bnx2fc_debug_level & LOG_MISC)) \
  31. pr_info(fmt, ##__VA_ARGS__); \
  32. } while (0)
  33. __printf(2, 3)
  34. void BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...);
  35. __printf(2, 3)
  36. void BNX2FC_TGT_DBG(const struct bnx2fc_rport *tgt, const char *fmt, ...);
  37. __printf(2, 3)
  38. void BNX2FC_HBA_DBG(const struct fc_lport *lport, const char *fmt, ...);
  39. #endif