18c2ecf20Sopenharmony_ci/* bnx2fc_debug.h: QLogic Linux FCoE offload driver. 28c2ecf20Sopenharmony_ci * Handles operations such as session offload/upload etc, and manages 38c2ecf20Sopenharmony_ci * session resources such as connection id and qp resources. 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (c) 2008-2013 Broadcom Corporation 68c2ecf20Sopenharmony_ci * Copyright (c) 2014-2016 QLogic Corporation 78c2ecf20Sopenharmony_ci * Copyright (c) 2016-2017 Cavium Inc. 88c2ecf20Sopenharmony_ci * 98c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or modify 108c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License as published by 118c2ecf20Sopenharmony_ci * the Free Software Foundation. 128c2ecf20Sopenharmony_ci * 138c2ecf20Sopenharmony_ci */ 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci#ifndef __BNX2FC_DEBUG__ 168c2ecf20Sopenharmony_ci#define __BNX2FC_DEBUG__ 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ci/* Log level bit mask */ 198c2ecf20Sopenharmony_ci#define LOG_IO 0x01 /* scsi cmd error, cleanup */ 208c2ecf20Sopenharmony_ci#define LOG_TGT 0x02 /* Session setup, cleanup, etc' */ 218c2ecf20Sopenharmony_ci#define LOG_HBA 0x04 /* lport events, link, mtu, etc' */ 228c2ecf20Sopenharmony_ci#define LOG_ELS 0x08 /* ELS logs */ 238c2ecf20Sopenharmony_ci#define LOG_MISC 0x10 /* fcoe L2 frame related logs*/ 248c2ecf20Sopenharmony_ci#define LOG_ALL 0xff /* LOG all messages */ 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ciextern unsigned int bnx2fc_debug_level; 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci#define BNX2FC_ELS_DBG(fmt, ...) \ 298c2ecf20Sopenharmony_cido { \ 308c2ecf20Sopenharmony_ci if (unlikely(bnx2fc_debug_level & LOG_ELS)) \ 318c2ecf20Sopenharmony_ci pr_info(fmt, ##__VA_ARGS__); \ 328c2ecf20Sopenharmony_ci} while (0) 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci#define BNX2FC_MISC_DBG(fmt, ...) \ 358c2ecf20Sopenharmony_cido { \ 368c2ecf20Sopenharmony_ci if (unlikely(bnx2fc_debug_level & LOG_MISC)) \ 378c2ecf20Sopenharmony_ci pr_info(fmt, ##__VA_ARGS__); \ 388c2ecf20Sopenharmony_ci} while (0) 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci__printf(2, 3) 418c2ecf20Sopenharmony_civoid BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...); 428c2ecf20Sopenharmony_ci__printf(2, 3) 438c2ecf20Sopenharmony_civoid BNX2FC_TGT_DBG(const struct bnx2fc_rport *tgt, const char *fmt, ...); 448c2ecf20Sopenharmony_ci__printf(2, 3) 458c2ecf20Sopenharmony_civoid BNX2FC_HBA_DBG(const struct fc_lport *lport, const char *fmt, ...); 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ci#endif 48