1de909d87SChad Dupuis /* bnx2fc_debug.h: QLogic Linux FCoE offload driver. 217d87c45SSaurav Kashyap * Handles operations such as session offload/upload etc, and manages 317d87c45SSaurav Kashyap * session resources such as connection id and qp resources. 417d87c45SSaurav Kashyap * 517d87c45SSaurav Kashyap * Copyright (c) 2008-2013 Broadcom Corporation 6*21144b80SChad Dupuis * Copyright (c) 2014-2016 QLogic Corporation 7*21144b80SChad Dupuis * Copyright (c) 2016-2017 Cavium Inc. 817d87c45SSaurav Kashyap * 917d87c45SSaurav Kashyap * This program is free software; you can redistribute it and/or modify 1017d87c45SSaurav Kashyap * it under the terms of the GNU General Public License as published by 1117d87c45SSaurav Kashyap * the Free Software Foundation. 1217d87c45SSaurav Kashyap * 1317d87c45SSaurav Kashyap */ 1417d87c45SSaurav Kashyap 15853e2bd2SBhanu Gollapudi #ifndef __BNX2FC_DEBUG__ 16853e2bd2SBhanu Gollapudi #define __BNX2FC_DEBUG__ 17853e2bd2SBhanu Gollapudi 18853e2bd2SBhanu Gollapudi /* Log level bit mask */ 19853e2bd2SBhanu Gollapudi #define LOG_IO 0x01 /* scsi cmd error, cleanup */ 20853e2bd2SBhanu Gollapudi #define LOG_TGT 0x02 /* Session setup, cleanup, etc' */ 21853e2bd2SBhanu Gollapudi #define LOG_HBA 0x04 /* lport events, link, mtu, etc' */ 22853e2bd2SBhanu Gollapudi #define LOG_ELS 0x08 /* ELS logs */ 23853e2bd2SBhanu Gollapudi #define LOG_MISC 0x10 /* fcoe L2 frame related logs*/ 24853e2bd2SBhanu Gollapudi #define LOG_ALL 0xff /* LOG all messages */ 25853e2bd2SBhanu Gollapudi 26853e2bd2SBhanu Gollapudi extern unsigned int bnx2fc_debug_level; 27853e2bd2SBhanu Gollapudi 283db8cc10SJoe Perches #define BNX2FC_ELS_DBG(fmt, ...) \ 29853e2bd2SBhanu Gollapudi do { \ 303db8cc10SJoe Perches if (unlikely(bnx2fc_debug_level & LOG_ELS)) \ 313db8cc10SJoe Perches pr_info(fmt, ##__VA_ARGS__); \ 32853e2bd2SBhanu Gollapudi } while (0) 33853e2bd2SBhanu Gollapudi 343db8cc10SJoe Perches #define BNX2FC_MISC_DBG(fmt, ...) \ 35853e2bd2SBhanu Gollapudi do { \ 363db8cc10SJoe Perches if (unlikely(bnx2fc_debug_level & LOG_MISC)) \ 373db8cc10SJoe Perches pr_info(fmt, ##__VA_ARGS__); \ 38853e2bd2SBhanu Gollapudi } while (0) 39853e2bd2SBhanu Gollapudi 403db8cc10SJoe Perches __printf(2, 3) 413db8cc10SJoe Perches void BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...); 423db8cc10SJoe Perches __printf(2, 3) 433db8cc10SJoe Perches void BNX2FC_TGT_DBG(const struct bnx2fc_rport *tgt, const char *fmt, ...); 443db8cc10SJoe Perches __printf(2, 3) 453db8cc10SJoe Perches void BNX2FC_HBA_DBG(const struct fc_lport *lport, const char *fmt, ...); 46853e2bd2SBhanu Gollapudi 47853e2bd2SBhanu Gollapudi #endif 48