Back to home page

OSCL-LXR

 
 

    


0001 /* bnx2fc_debug.h: QLogic Linux FCoE offload driver.
0002  * Handles operations such as session offload/upload etc, and manages
0003  * session resources such as connection id and qp resources.
0004  *
0005  * Copyright (c) 2008-2013 Broadcom Corporation
0006  * Copyright (c) 2014-2016 QLogic Corporation
0007  * Copyright (c) 2016-2017 Cavium Inc.
0008  *
0009  * This program is free software; you can redistribute it and/or modify
0010  * it under the terms of the GNU General Public License as published by
0011  * the Free Software Foundation.
0012  *
0013  */
0014 
0015 #ifndef __BNX2FC_DEBUG__
0016 #define __BNX2FC_DEBUG__
0017 
0018 /* Log level bit mask */
0019 #define LOG_IO      0x01    /* scsi cmd error, cleanup */
0020 #define LOG_TGT     0x02    /* Session setup, cleanup, etc' */
0021 #define LOG_HBA     0x04    /* lport events, link, mtu, etc' */
0022 #define LOG_ELS     0x08    /* ELS logs */
0023 #define LOG_MISC    0x10    /* fcoe L2 frame related logs*/
0024 #define LOG_ALL     0xff    /* LOG all messages */
0025 
0026 extern unsigned int bnx2fc_debug_level;
0027 
0028 #define BNX2FC_ELS_DBG(fmt, ...)                \
0029 do {                                \
0030     if (unlikely(bnx2fc_debug_level & LOG_ELS))     \
0031         pr_info(fmt, ##__VA_ARGS__);            \
0032 } while (0)
0033 
0034 #define BNX2FC_MISC_DBG(fmt, ...)               \
0035 do {                                \
0036     if (unlikely(bnx2fc_debug_level & LOG_MISC))        \
0037         pr_info(fmt, ##__VA_ARGS__);            \
0038 } while (0)
0039 
0040 __printf(2, 3)
0041 void BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...);
0042 __printf(2, 3)
0043 void BNX2FC_TGT_DBG(const struct bnx2fc_rport *tgt, const char *fmt, ...);
0044 __printf(2, 3)
0045 void BNX2FC_HBA_DBG(const struct fc_lport *lport, const char *fmt, ...);
0046 
0047 #endif