blob: 34fda3e04d27024a8325191ec6fbf47c0e3a4a8f [file] [log] [blame]
Chad Dupuisde909d82015-10-19 15:40:36 -04001/* bnx2fc_debug.h: QLogic Linux FCoE offload driver.
Saurav Kashyap17d87c42014-07-03 08:18:28 -04002 * Handles operations such as session offload/upload etc, and manages
3 * session resources such as connection id and qp resources.
4 *
Chad Dupuis97586092015-10-19 15:40:35 -04005 * Copyright (c) 2008-2013 Broadcom Corporation
6 * Copyright (c) 2014-2015 QLogic Corporation
Saurav Kashyap17d87c42014-07-03 08:18:28 -04007 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation.
11 *
12 */
13
Bhanu Gollapudi853e2bd2011-02-04 12:10:34 -080014#ifndef __BNX2FC_DEBUG__
15#define __BNX2FC_DEBUG__
16
17/* Log level bit mask */
18#define LOG_IO 0x01 /* scsi cmd error, cleanup */
19#define LOG_TGT 0x02 /* Session setup, cleanup, etc' */
20#define LOG_HBA 0x04 /* lport events, link, mtu, etc' */
21#define LOG_ELS 0x08 /* ELS logs */
22#define LOG_MISC 0x10 /* fcoe L2 frame related logs*/
23#define LOG_ALL 0xff /* LOG all messages */
24
25extern unsigned int bnx2fc_debug_level;
26
Joe Perches3db8cc12012-06-04 16:15:43 -070027#define BNX2FC_ELS_DBG(fmt, ...) \
28do { \
29 if (unlikely(bnx2fc_debug_level & LOG_ELS)) \
30 pr_info(fmt, ##__VA_ARGS__); \
31} while (0)
Bhanu Gollapudi853e2bd2011-02-04 12:10:34 -080032
Joe Perches3db8cc12012-06-04 16:15:43 -070033#define BNX2FC_MISC_DBG(fmt, ...) \
34do { \
35 if (unlikely(bnx2fc_debug_level & LOG_MISC)) \
36 pr_info(fmt, ##__VA_ARGS__); \
37} while (0)
Bhanu Gollapudi853e2bd2011-02-04 12:10:34 -080038
Joe Perches3db8cc12012-06-04 16:15:43 -070039__printf(2, 3)
40void BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...);
41__printf(2, 3)
42void BNX2FC_TGT_DBG(const struct bnx2fc_rport *tgt, const char *fmt, ...);
43__printf(2, 3)
44void BNX2FC_HBA_DBG(const struct fc_lport *lport, const char *fmt, ...);
Bhanu Gollapudi853e2bd2011-02-04 12:10:34 -080045
46#endif