linux/drivers/scsi/qedi/qedi_dbg.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * QLogic iSCSI Offload Driver
 * Copyright (c) 2016 Cavium Inc.
 */

#ifndef _QEDI_DBG_H_
#define _QEDI_DBG_H_

#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/compiler.h>
#include <linux/string.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <scsi/scsi_transport.h>
#include <scsi/scsi_transport_iscsi.h>
#include <linux/fs.h>

#define __PREVENT_QED_HSI__
#include <linux/qed/common_hsi.h>
#include <linux/qed/qed_if.h>

extern uint qedi_dbg_log;

/* Debug print level definitions */
#define QEDI_LOG_DEFAULT
#define QEDI_LOG_INFO
#define QEDI_LOG_DISC
#define QEDI_LOG_LL2
#define QEDI_LOG_CONN
#define QEDI_LOG_EVT
#define QEDI_LOG_TIMER
#define QEDI_LOG_MP_REQ
#define QEDI_LOG_SCSI_TM
#define QEDI_LOG_UNSOL
#define QEDI_LOG_IO
#define QEDI_LOG_MQ
#define QEDI_LOG_BSG
#define QEDI_LOG_DEBUGFS
#define QEDI_LOG_LPORT
#define QEDI_LOG_ELS
#define QEDI_LOG_NPIV
#define QEDI_LOG_SESS
#define QEDI_LOG_UIO
#define QEDI_LOG_TID
#define QEDI_TRACK_TID
#define QEDI_TRACK_CMD_LIST
#define QEDI_LOG_NOTICE
#define QEDI_LOG_WARN

/* Debug context structure */
struct qedi_dbg_ctx {};

#define QEDI_ERR(pdev, fmt, ...)
#define QEDI_WARN(pdev, fmt, ...)
#define QEDI_NOTICE(pdev, fmt, ...)
#define QEDI_INFO(pdev, level, fmt, ...)

void qedi_dbg_err(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
		  const char *fmt, ...);
void qedi_dbg_warn(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
		   const char *fmt, ...);
void qedi_dbg_notice(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
		     const char *fmt, ...);
void qedi_dbg_info(struct qedi_dbg_ctx *qedi, const char *func, u32 line,
		   u32 info, const char *fmt, ...);

struct Scsi_Host;

struct sysfs_bin_attrs {};

int qedi_create_sysfs_attr(struct Scsi_Host *shost,
			   struct sysfs_bin_attrs *iter);
void qedi_remove_sysfs_attr(struct Scsi_Host *shost,
			    struct sysfs_bin_attrs *iter);

/* DebugFS related code */
struct qedi_list_of_funcs {};

struct qedi_debugfs_ops {};

#define qedi_dbg_fileops(drv, ops)

/* Used for debugfs sequential files */
#define qedi_dbg_fileops_seq(drv, ops)

void qedi_dbg_host_init(struct qedi_dbg_ctx *qedi,
			const struct qedi_debugfs_ops *dops,
			const struct file_operations *fops);
void qedi_dbg_host_exit(struct qedi_dbg_ctx *qedi);
void qedi_dbg_init(char *drv_name);
void qedi_dbg_exit(void);

#endif /* _QEDI_DBG_H_ */