162306a36Sopenharmony_ci/* bnx2fc_debug.h: QLogic Linux FCoE offload driver.
262306a36Sopenharmony_ci * Handles operations such as session offload/upload etc, and manages
362306a36Sopenharmony_ci * session resources such as connection id and qp resources.
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Copyright (c) 2008-2013 Broadcom Corporation
662306a36Sopenharmony_ci * Copyright (c) 2014-2016 QLogic Corporation
762306a36Sopenharmony_ci * Copyright (c) 2016-2017 Cavium Inc.
862306a36Sopenharmony_ci *
962306a36Sopenharmony_ci * This program is free software; you can redistribute it and/or modify
1062306a36Sopenharmony_ci * it under the terms of the GNU General Public License as published by
1162306a36Sopenharmony_ci * the Free Software Foundation.
1262306a36Sopenharmony_ci *
1362306a36Sopenharmony_ci */
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci#ifndef __BNX2FC_DEBUG__
1662306a36Sopenharmony_ci#define __BNX2FC_DEBUG__
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci/* Log level bit mask */
1962306a36Sopenharmony_ci#define LOG_IO		0x01	/* scsi cmd error, cleanup */
2062306a36Sopenharmony_ci#define LOG_TGT		0x02	/* Session setup, cleanup, etc' */
2162306a36Sopenharmony_ci#define LOG_HBA		0x04	/* lport events, link, mtu, etc' */
2262306a36Sopenharmony_ci#define LOG_ELS		0x08	/* ELS logs */
2362306a36Sopenharmony_ci#define LOG_MISC	0x10	/* fcoe L2 frame related logs*/
2462306a36Sopenharmony_ci#define LOG_ALL		0xff	/* LOG all messages */
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ciextern unsigned int bnx2fc_debug_level;
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci#define BNX2FC_ELS_DBG(fmt, ...)				\
2962306a36Sopenharmony_cido {								\
3062306a36Sopenharmony_ci	if (unlikely(bnx2fc_debug_level & LOG_ELS))		\
3162306a36Sopenharmony_ci		pr_info(fmt, ##__VA_ARGS__);			\
3262306a36Sopenharmony_ci} while (0)
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci#define BNX2FC_MISC_DBG(fmt, ...)				\
3562306a36Sopenharmony_cido {								\
3662306a36Sopenharmony_ci	if (unlikely(bnx2fc_debug_level & LOG_MISC))		\
3762306a36Sopenharmony_ci		pr_info(fmt, ##__VA_ARGS__);			\
3862306a36Sopenharmony_ci} while (0)
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ci__printf(2, 3)
4162306a36Sopenharmony_civoid BNX2FC_IO_DBG(const struct bnx2fc_cmd *io_req, const char *fmt, ...);
4262306a36Sopenharmony_ci__printf(2, 3)
4362306a36Sopenharmony_civoid BNX2FC_TGT_DBG(const struct bnx2fc_rport *tgt, const char *fmt, ...);
4462306a36Sopenharmony_ci__printf(2, 3)
4562306a36Sopenharmony_civoid BNX2FC_HBA_DBG(const struct fc_lport *lport, const char *fmt, ...);
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci#endif
48