xref: /openbmc/linux/drivers/scsi/bnx2fc/bnx2fc_debug.h (revision 17d87c45b9042fa2f830c5a47cdfd3370bb60729)
1*17d87c45SSaurav Kashyap /* bnx2fc_debug.h: QLogic NetXtreme II Linux FCoE offload driver.
2*17d87c45SSaurav Kashyap  * Handles operations such as session offload/upload etc, and manages
3*17d87c45SSaurav Kashyap  * session resources such as connection id and qp resources.
4*17d87c45SSaurav Kashyap  *
5*17d87c45SSaurav Kashyap  * Copyright (c) 2008 - 2013 Broadcom Corporation
6*17d87c45SSaurav Kashyap  * Copyright (c) 2014, QLogic Corporation
7*17d87c45SSaurav Kashyap  *
8*17d87c45SSaurav Kashyap  * This program is free software; you can redistribute it and/or modify
9*17d87c45SSaurav Kashyap  * it under the terms of the GNU General Public License as published by
10*17d87c45SSaurav Kashyap  * the Free Software Foundation.
11*17d87c45SSaurav Kashyap  *
12*17d87c45SSaurav Kashyap  */
13*17d87c45SSaurav 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