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