1*de909d87SChad 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 697586090SChad Dupuis * Copyright (c) 2014-2015 QLogic Corporation 717d87c45SSaurav Kashyap * 817d87c45SSaurav Kashyap * This program is free software; you can redistribute it and/or modify 917d87c45SSaurav Kashyap * it under the terms of the GNU General Public License as published by 1017d87c45SSaurav Kashyap * the Free Software Foundation. 1117d87c45SSaurav Kashyap * 1217d87c45SSaurav Kashyap */ 1317d87c45SSaurav Kashyap 14853e2bd2SBhanu Gollapudi #ifndef __BNX2FC_DEBUG__ 15853e2bd2SBhanu Gollapudi #define __BNX2FC_DEBUG__ 16853e2bd2SBhanu Gollapudi 17853e2bd2SBhanu Gollapudi /* Log level bit mask */ 18853e2bd2SBhanu Gollapudi #define LOG_IO 0x01 /* scsi cmd error, cleanup */ 19853e2bd2SBhanu Gollapudi #define LOG_TGT 0x02 /* Session setup, cleanup, etc' */ 20853e2bd2SBhanu Gollapudi #define LOG_HBA 0x04 /* lport events, link, mtu, etc' */ 21853e2bd2SBhanu Gollapudi #define LOG_ELS 0x08 /* ELS logs */ 22853e2bd2SBhanu Gollapudi #define LOG_MISC 0x10 /* fcoe L2 frame related logs*/ 23853e2bd2SBhanu Gollapudi #define LOG_ALL 0xff /* LOG all messages */ 24853e2bd2SBhanu Gollapudi 25853e2bd2SBhanu Gollapudi extern unsigned int bnx2fc_debug_level; 26853e2bd2SBhanu Gollapudi 273db8cc10SJoe Perches #define BNX2FC_ELS_DBG(fmt, ...) \ 28853e2bd2SBhanu Gollapudi do { \ 293db8cc10SJoe Perches if (unlikely(bnx2fc_debug_level & LOG_ELS)) \ 303db8cc10SJoe Perches pr_info(fmt, ##__VA_ARGS__); \ 31853e2bd2SBhanu Gollapudi } while (0) 32853e2bd2SBhanu Gollapudi 333db8cc10SJoe Perches #define BNX2FC_MISC_DBG(fmt, ...) \ 34853e2bd2SBhanu Gollapudi do { \ 353db8cc10SJoe Perches if (unlikely(bnx2fc_debug_level & LOG_MISC)) \ 363db8cc10SJoe Perches pr_info(fmt, ##__VA_ARGS__); \ 37853e2bd2SBhanu Gollapudi } while (0) 38853e2bd2SBhanu Gollapudi 393db8cc10SJoe Perches __printf(2, 3) 403db8cc10SJoe Perches void BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...); 413db8cc10SJoe Perches __printf(2, 3) 423db8cc10SJoe Perches void BNX2FC_TGT_DBG(const struct bnx2fc_rport *tgt, const char *fmt, ...); 433db8cc10SJoe Perches __printf(2, 3) 443db8cc10SJoe Perches void BNX2FC_HBA_DBG(const struct fc_lport *lport, const char *fmt, ...); 45853e2bd2SBhanu Gollapudi 46853e2bd2SBhanu Gollapudi #endif 47