linux/drivers/scsi/lpfc/lpfc_debugfs.h

/*******************************************************************
 * This file is part of the Emulex Linux Device Driver for         *
 * Fibre Channel Host Bus Adapters.                                *
 * Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term *
 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.     *
 * Copyright (C) 2007-2011 Emulex.  All rights reserved.           *
 * EMULEX and SLI are trademarks of Emulex.                        *
 * www.broadcom.com                                                *
 *                                                                 *
 * This program is free software; you can redistribute it and/or   *
 * modify it under the terms of version 2 of the GNU General       *
 * Public License as published by the Free Software Foundation.    *
 * This program is distributed in the hope that it will be useful. *
 * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND          *
 * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,  *
 * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE      *
 * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
 * TO BE LEGALLY INVALID.  See the GNU General Public License for  *
 * more details, a copy of which can be found in the file COPYING  *
 * included with this package.                                     *
 *******************************************************************/

#ifndef _H_LPFC_DEBUG_FS
#define _H_LPFC_DEBUG_FS

#ifdef CONFIG_SCSI_LPFC_DEBUG_FS

/* size of output line, for discovery_trace and slow_ring_trace */
#define LPFC_DEBUG_TRC_ENTRY_SIZE

/* nodelist output buffer size */
#define LPFC_NODELIST_SIZE
#define LPFC_NODELIST_ENTRY_SIZE

/* dumpHBASlim output buffer size */
#define LPFC_DUMPHBASLIM_SIZE

/* dumpHostSlim output buffer size */
#define LPFC_DUMPHOSTSLIM_SIZE

/* dumpSLIqinfo output buffer size */
#define LPFC_DUMPSLIQINFO_SIZE

/* hbqinfo output buffer size */
#define LPFC_HBQINFO_SIZE

/* nvmestat output buffer size */
#define LPFC_NVMESTAT_SIZE
#define LPFC_IOKTIME_SIZE
#define LPFC_NVMEIO_TRC_SIZE

/* scsistat output buffer size */
#define LPFC_SCSISTAT_SIZE

/* Congestion Info Buffer size */
#define LPFC_CGN_BUF_SIZE

#define LPFC_DEBUG_OUT_LINE_SZ

/*
 * For SLI4 iDiag debugfs diagnostics tool
 */

/* pciConf */
#define LPFC_PCI_CFG_BROWSE
#define LPFC_PCI_CFG_RD_CMD_ARG
#define LPFC_PCI_CFG_WR_CMD_ARG
#define LPFC_PCI_CFG_SIZE
#define LPFC_PCI_CFG_RD_SIZE

#define IDIAG_PCICFG_WHERE_INDX
#define IDIAG_PCICFG_COUNT_INDX
#define IDIAG_PCICFG_VALUE_INDX

/* barAcc */
#define LPFC_PCI_BAR_BROWSE
#define LPFC_PCI_BAR_RD_CMD_ARG
#define LPFC_PCI_BAR_WR_CMD_ARG

#define LPFC_PCI_IF0_BAR0_SIZE
#define LPFC_PCI_IF0_BAR1_SIZE
#define LPFC_PCI_IF0_BAR2_SIZE
#define LPFC_PCI_IF2_BAR0_SIZE

#define LPFC_PCI_BAR_RD_BUF_SIZE
#define LPFC_PCI_BAR_RD_SIZE

#define LPFC_PCI_IF0_BAR0_RD_SIZE
#define LPFC_PCI_IF0_BAR1_RD_SIZE
#define LPFC_PCI_IF0_BAR2_RD_SIZE
#define LPFC_PCI_IF2_BAR0_RD_SIZE

#define IDIAG_BARACC_BAR_NUM_INDX
#define IDIAG_BARACC_OFF_SET_INDX
#define IDIAG_BARACC_ACC_MOD_INDX
#define IDIAG_BARACC_REG_VAL_INDX
#define IDIAG_BARACC_BAR_SZE_INDX

#define IDIAG_BARACC_BAR_0
#define IDIAG_BARACC_BAR_1
#define IDIAG_BARACC_BAR_2

#define SINGLE_WORD

/* queue info */
#define LPFC_QUE_INFO_GET_BUF_SIZE

/* queue acc */
#define LPFC_QUE_ACC_BROWSE
#define LPFC_QUE_ACC_RD_CMD_ARG
#define LPFC_QUE_ACC_WR_CMD_ARG
#define LPFC_QUE_ACC_BUF_SIZE
#define LPFC_QUE_ACC_SIZE

#define LPFC_IDIAG_EQ
#define LPFC_IDIAG_CQ
#define LPFC_IDIAG_MQ
#define LPFC_IDIAG_WQ
#define LPFC_IDIAG_RQ

#define IDIAG_QUEACC_QUETP_INDX
#define IDIAG_QUEACC_QUEID_INDX
#define IDIAG_QUEACC_INDEX_INDX
#define IDIAG_QUEACC_COUNT_INDX
#define IDIAG_QUEACC_OFFST_INDX
#define IDIAG_QUEACC_VALUE_INDX

/* doorbell register acc */
#define LPFC_DRB_ACC_ALL
#define LPFC_DRB_ACC_RD_CMD_ARG
#define LPFC_DRB_ACC_WR_CMD_ARG
#define LPFC_DRB_ACC_BUF_SIZE

#define LPFC_DRB_EQ
#define LPFC_DRB_CQ
#define LPFC_DRB_MQ
#define LPFC_DRB_WQ
#define LPFC_DRB_RQ

#define LPFC_DRB_MAX

#define IDIAG_DRBACC_REGID_INDX
#define IDIAG_DRBACC_VALUE_INDX

/* control register acc */
#define LPFC_CTL_ACC_ALL
#define LPFC_CTL_ACC_RD_CMD_ARG
#define LPFC_CTL_ACC_WR_CMD_ARG
#define LPFC_CTL_ACC_BUF_SIZE

#define LPFC_CTL_PORT_SEM
#define LPFC_CTL_PORT_STA
#define LPFC_CTL_PORT_CTL
#define LPFC_CTL_PORT_ER1
#define LPFC_CTL_PORT_ER2
#define LPFC_CTL_PDEV_CTL

#define LPFC_CTL_MAX

#define IDIAG_CTLACC_REGID_INDX
#define IDIAG_CTLACC_VALUE_INDX

/* mailbox access */
#define LPFC_MBX_DMP_ARG

#define LPFC_MBX_ACC_BUF_SIZE
#define LPFC_MBX_ACC_LBUF_SZ

#define LPFC_MBX_DMP_MBX_WORD
#define LPFC_MBX_DMP_MBX_BYTE
#define LPFC_MBX_DMP_MBX_ALL

#define LPFC_BSG_DMP_MBX_RD_MBX
#define LPFC_BSG_DMP_MBX_RD_BUF
#define LPFC_BSG_DMP_MBX_WR_MBX
#define LPFC_BSG_DMP_MBX_WR_BUF
#define LPFC_BSG_DMP_MBX_ALL

#define LPFC_MBX_DMP_ALL
#define LPFC_MBX_ALL_CMD

#define IDIAG_MBXACC_MBCMD_INDX
#define IDIAG_MBXACC_DPMAP_INDX
#define IDIAG_MBXACC_DPCNT_INDX
#define IDIAG_MBXACC_WDCNT_INDX

/* extents access */
#define LPFC_EXT_ACC_CMD_ARG
#define LPFC_EXT_ACC_BUF_SIZE

#define LPFC_EXT_ACC_AVAIL
#define LPFC_EXT_ACC_ALLOC
#define LPFC_EXT_ACC_DRIVR
#define LPFC_EXT_ACC_ALL

#define IDIAG_EXTACC_EXMAP_INDX

#define SIZE_U8
#define SIZE_U16
#define SIZE_U32

#define lpfc_nvmeio_data(phba, fmt, arg...)

struct lpfc_debug {};

struct lpfc_debugfs_trc {};

struct lpfc_debugfs_nvmeio_trc {};

struct lpfc_idiag_offset {};

#define LPFC_IDIAG_CMD_DATA_SIZE
struct lpfc_idiag_cmd {};

struct lpfc_idiag {};

#define MAX_DEBUGFS_RX_INFO_SIZE
struct lpfc_rx_monitor_debug {};

#else

#define lpfc_nvmeio_data

#endif

/* multixripool output buffer size */
#define LPFC_DUMP_MULTIXRIPOOL_SIZE

enum {};

/* Mask for discovery_trace */
#define LPFC_DISC_TRC_ELS_CMD
#define LPFC_DISC_TRC_ELS_RSP
#define LPFC_DISC_TRC_ELS_UNSOL
#define LPFC_DISC_TRC_ELS_ALL
#define LPFC_DISC_TRC_MBOX_VPORT
#define LPFC_DISC_TRC_MBOX
#define LPFC_DISC_TRC_MBOX_ALL
#define LPFC_DISC_TRC_CT
#define LPFC_DISC_TRC_DSM
#define LPFC_DISC_TRC_RPORT
#define LPFC_DISC_TRC_NODE

#define LPFC_DISC_TRC_DISCOVERY
#endif /* H_LPFC_DEBUG_FS */


/*
 * Driver debug utility routines outside of debugfs. The debug utility
 * routines implemented here is intended to be used in the instrumented
 * debug driver for debugging host or port issues.
 */

/**
 * lpfc_debug_dump_qe - dump an specific entry from a queue
 * @q: Pointer to the queue descriptor.
 * @idx: Index to the entry on the queue.
 *
 * This function dumps an entry indexed by @idx from a queue specified by the
 * queue descriptor @q.
 **/
static void
lpfc_debug_dump_qe(struct lpfc_queue *q, uint32_t idx)
{}

/**
 * lpfc_debug_dump_q - dump all entries from an specific queue
 * @q: Pointer to the queue descriptor.
 *
 * This function dumps all entries from a queue specified by the queue
 * descriptor @q.
 **/
static inline void
lpfc_debug_dump_q(struct lpfc_queue *q)
{}

/**
 * lpfc_debug_dump_wq - dump all entries from the fcp or nvme work queue
 * @phba: Pointer to HBA context object.
 * @wqidx: Index to a FCP or NVME work queue.
 *
 * This function dumps all entries from a FCP or NVME work queue specified
 * by the wqidx.
 **/
static inline void
lpfc_debug_dump_wq(struct lpfc_hba *phba, int qtype, int wqidx)
{}

/**
 * lpfc_debug_dump_cq - dump all entries from a fcp or nvme work queue's
 * cmpl queue
 * @phba: Pointer to HBA context object.
 * @wqidx: Index to a FCP work queue.
 *
 * This function dumps all entries from a FCP or NVME completion queue
 * which is associated to the work queue specified by the @wqidx.
 **/
static inline void
lpfc_debug_dump_cq(struct lpfc_hba *phba, int qtype, int wqidx)
{}

/**
 * lpfc_debug_dump_hba_eq - dump all entries from a fcp work queue's evt queue
 * @phba: Pointer to HBA context object.
 * @fcp_wqidx: Index to a FCP work queue.
 *
 * This function dumps all entries from a FCP event queue which is
 * associated to the FCP work queue specified by the @fcp_wqidx.
 **/
static inline void
lpfc_debug_dump_hba_eq(struct lpfc_hba *phba, int qidx)
{}

/**
 * lpfc_debug_dump_dat_rq - dump all entries from the receive data queue
 * @phba: Pointer to HBA context object.
 *
 * This function dumps all entries from the receive data queue.
 **/
static inline void
lpfc_debug_dump_dat_rq(struct lpfc_hba *phba)
{}

/**
 * lpfc_debug_dump_hdr_rq - dump all entries from the receive header queue
 * @phba: Pointer to HBA context object.
 *
 * This function dumps all entries from the receive header queue.
 **/
static inline void
lpfc_debug_dump_hdr_rq(struct lpfc_hba *phba)
{}

/**
 * lpfc_debug_dump_wq_by_id - dump all entries from a work queue by queue id
 * @phba: Pointer to HBA context object.
 * @qid: Work queue identifier.
 *
 * This function dumps all entries from a work queue identified by the queue
 * identifier.
 **/
static inline void
lpfc_debug_dump_wq_by_id(struct lpfc_hba *phba, int qid)
{}

/**
 * lpfc_debug_dump_mq_by_id - dump all entries from a mbox queue by queue id
 * @phba: Pointer to HBA context object.
 * @qid: Mbox work queue identifier.
 *
 * This function dumps all entries from a mbox work queue identified by the
 * queue identifier.
 **/
static inline void
lpfc_debug_dump_mq_by_id(struct lpfc_hba *phba, int qid)
{}

/**
 * lpfc_debug_dump_rq_by_id - dump all entries from a receive queue by queue id
 * @phba: Pointer to HBA context object.
 * @qid: Receive queue identifier.
 *
 * This function dumps all entries from a receive queue identified by the
 * queue identifier.
 **/
static inline void
lpfc_debug_dump_rq_by_id(struct lpfc_hba *phba, int qid)
{}

/**
 * lpfc_debug_dump_cq_by_id - dump all entries from a cmpl queue by queue id
 * @phba: Pointer to HBA context object.
 * @qid: Complete queue identifier.
 *
 * This function dumps all entries from a complete queue identified by the
 * queue identifier.
 **/
static inline void
lpfc_debug_dump_cq_by_id(struct lpfc_hba *phba, int qid)
{}

/**
 * lpfc_debug_dump_eq_by_id - dump all entries from an event queue by queue id
 * @phba: Pointer to HBA context object.
 * @qid: Complete queue identifier.
 *
 * This function dumps all entries from an event queue identified by the
 * queue identifier.
 **/
static inline void
lpfc_debug_dump_eq_by_id(struct lpfc_hba *phba, int qid)
{}

void lpfc_debug_dump_all_queues(struct lpfc_hba *);