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