linux/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c

/*
 * This file is part of the Chelsio T4 Ethernet driver for Linux.
 *
 * Copyright (c) 2003-2014 Chelsio Communications, Inc. All rights reserved.
 *
 * This software is available to you under a choice of one of two
 * licenses.  You may choose to be licensed under the terms of the GNU
 * General Public License (GPL) Version 2, available from the file
 * COPYING in the main directory of this source tree, or the
 * OpenIB.org BSD license below:
 *
 *     Redistribution and use in source and binary forms, with or
 *     without modification, are permitted provided that the following
 *     conditions are met:
 *
 *      - Redistributions of source code must retain the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer.
 *
 *      - Redistributions in binary form must reproduce the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer in the documentation and/or other materials
 *        provided with the distribution.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

#include <linux/seq_file.h>
#include <linux/debugfs.h>
#include <linux/string_helpers.h>
#include <linux/sort.h>
#include <linux/ctype.h>

#include "cxgb4.h"
#include "t4_regs.h"
#include "t4_values.h"
#include "t4fw_api.h"
#include "cxgb4_debugfs.h"
#include "clip_tbl.h"
#include "l2t.h"
#include "cudbg_if.h"
#include "cudbg_lib_common.h"
#include "cudbg_entity.h"
#include "cudbg_lib.h"
#include "cxgb4_tc_mqprio.h"

/* generic seq_file support for showing a table of size rows x width. */
static void *seq_tab_get_idx(struct seq_tab *tb, loff_t pos)
{}

static void *seq_tab_start(struct seq_file *seq, loff_t *pos)
{}

static void *seq_tab_next(struct seq_file *seq, void *v, loff_t *pos)
{}

static void seq_tab_stop(struct seq_file *seq, void *v)
{}

static int seq_tab_show(struct seq_file *seq, void *v)
{}

static const struct seq_operations seq_tab_ops =;

struct seq_tab *seq_open_tab(struct file *f, unsigned int rows,
			     unsigned int width, unsigned int have_header,
			     int (*show)(struct seq_file *seq, void *v, int i))
{}

/* Trim the size of a seq_tab to the supplied number of rows.  The operation is
 * irreversible.
 */
static int seq_tab_trim(struct seq_tab *p, unsigned int new_rows)
{}

static int cim_la_show(struct seq_file *seq, void *v, int idx)
{}

static int cim_la_show_3in1(struct seq_file *seq, void *v, int idx)
{}

static int cim_la_show_t6(struct seq_file *seq, void *v, int idx)
{}

static int cim_la_show_pc_t6(struct seq_file *seq, void *v, int idx)
{}

static int cim_la_open(struct inode *inode, struct file *file)
{}

static const struct file_operations cim_la_fops =;

static int cim_pif_la_show(struct seq_file *seq, void *v, int idx)
{}

static int cim_pif_la_open(struct inode *inode, struct file *file)
{}

static const struct file_operations cim_pif_la_fops =;

static int cim_ma_la_show(struct seq_file *seq, void *v, int idx)
{}

static int cim_ma_la_open(struct inode *inode, struct file *file)
{}

static const struct file_operations cim_ma_la_fops =;

static int cim_qcfg_show(struct seq_file *seq, void *v)
{}
DEFINE_SHOW_ATTRIBUTE();

static int cimq_show(struct seq_file *seq, void *v, int idx)
{}

static int cim_ibq_open(struct inode *inode, struct file *file)
{}

static const struct file_operations cim_ibq_fops =;

static int cim_obq_open(struct inode *inode, struct file *file)
{}

static const struct file_operations cim_obq_fops =;

struct field_desc {};

static void field_desc_show(struct seq_file *seq, u64 v,
			    const struct field_desc *p)
{}

static struct field_desc tp_la0[] =;

static int tp_la_show(struct seq_file *seq, void *v, int idx)
{}

static int tp_la_show2(struct seq_file *seq, void *v, int idx)
{}

static int tp_la_show3(struct seq_file *seq, void *v, int idx)
{}

static int tp_la_open(struct inode *inode, struct file *file)
{}

static ssize_t tp_la_write(struct file *file, const char __user *buf,
			   size_t count, loff_t *pos)
{}

static const struct file_operations tp_la_fops =;

static int ulprx_la_show(struct seq_file *seq, void *v, int idx)
{}

static int ulprx_la_open(struct inode *inode, struct file *file)
{}

static const struct file_operations ulprx_la_fops =;

/* Show the PM memory stats.  These stats include:
 *
 * TX:
 *   Read: memory read operation
 *   Write Bypass: cut-through
 *   Bypass + mem: cut-through and save copy
 *
 * RX:
 *   Read: memory read
 *   Write Bypass: cut-through
 *   Flush: payload trim or drop
 */
static int pm_stats_show(struct seq_file *seq, void *v)
{}

static int pm_stats_open(struct inode *inode, struct file *file)
{}

static ssize_t pm_stats_clear(struct file *file, const char __user *buf,
			      size_t count, loff_t *pos)
{}

static const struct file_operations pm_stats_debugfs_fops =;

static int tx_rate_show(struct seq_file *seq, void *v)
{}
DEFINE_SHOW_ATTRIBUTE();

static int cctrl_tbl_show(struct seq_file *seq, void *v)
{}
DEFINE_SHOW_ATTRIBUTE();

/* Format a value in a unit that differs from the value's native unit by the
 * given factor.
 */
static char *unit_conv(char *buf, size_t len, unsigned int val,
		       unsigned int factor)
{}

static int clk_show(struct seq_file *seq, void *v)
{}
DEFINE_SHOW_ATTRIBUTE();

/* Firmware Device Log dump. */
static const char * const devlog_level_strings[] =;

static const char * const devlog_facility_strings[] =;

/* Information gathered by Device Log Open routine for the display routine.
 */
struct devlog_info {};

/* Dump a Firmaware Device Log entry.
 */
static int devlog_show(struct seq_file *seq, void *v)
{}

/* Sequential File Operations for Device Log.
 */
static inline void *devlog_get_idx(struct devlog_info *dinfo, loff_t pos)
{}

static void *devlog_start(struct seq_file *seq, loff_t *pos)
{}

static void *devlog_next(struct seq_file *seq, void *v, loff_t *pos)
{}

static void devlog_stop(struct seq_file *seq, void *v)
{}

static const struct seq_operations devlog_seq_ops =;

/* Set up for reading the firmware's device log.  We read the entire log here
 * and then display it incrementally in devlog_show().
 */
static int devlog_open(struct inode *inode, struct file *file)
{}

static const struct file_operations devlog_fops =;

/* Show Firmware Mailbox Command/Reply Log
 *
 * Note that we don't do any locking when dumping the Firmware Mailbox Log so
 * it's possible that we can catch things during a log update and therefore
 * see partially corrupted log entries.  But it's probably Good Enough(tm).
 * If we ever decide that we want to make sure that we're dumping a coherent
 * log, we'd need to perform locking in the mailbox logging and in
 * mboxlog_open() where we'd need to grab the entire mailbox log in one go
 * like we do for the Firmware Device Log.
 */
static int mboxlog_show(struct seq_file *seq, void *v)
{}

static inline void *mboxlog_get_idx(struct seq_file *seq, loff_t pos)
{}

static void *mboxlog_start(struct seq_file *seq, loff_t *pos)
{}

static void *mboxlog_next(struct seq_file *seq, void *v, loff_t *pos)
{}

static void mboxlog_stop(struct seq_file *seq, void *v)
{}

static const struct seq_operations mboxlog_seq_ops =;

static int mboxlog_open(struct inode *inode, struct file *file)
{}

static const struct file_operations mboxlog_fops =;

static int mbox_show(struct seq_file *seq, void *v)
{}

static int mbox_open(struct inode *inode, struct file *file)
{}

static ssize_t mbox_write(struct file *file, const char __user *buf,
			  size_t count, loff_t *pos)
{}

static const struct file_operations mbox_debugfs_fops =;

static int mps_trc_show(struct seq_file *seq, void *v)
{}

static int mps_trc_open(struct inode *inode, struct file *file)
{}

static unsigned int xdigit2int(unsigned char c)
{}

#define TRC_PORT_NONE
#define TRC_RSS_ENABLE
#define TRC_RSS_DISABLE

/* Set an MPS trace filter.  Syntax is:
 *
 * disable
 *
 * to disable tracing, or
 *
 * interface qid=<qid no> [snaplen=<val>] [minlen=<val>] [not] [<pattern>]...
 *
 * where interface is one of rxN, txN, or loopbackN, N = 0..3, qid can be one
 * of the NIC's response qid obtained from sge_qinfo and pattern has the form
 *
 * <pattern data>[/<pattern mask>][@<anchor>]
 *
 * Up to 2 filter patterns can be specified.  If 2 are supplied the first one
 * must be anchored at 0.  An omitted mask is taken as a mask of 1s, an omitted
 * anchor is taken as 0.
 */
static ssize_t mps_trc_write(struct file *file, const char __user *buf,
			     size_t count, loff_t *pos)
{}

static const struct file_operations mps_trc_debugfs_fops =;

static ssize_t flash_read(struct file *file, char __user *buf, size_t count,
			  loff_t *ppos)
{}

static const struct file_operations flash_debugfs_fops =;

static inline void tcamxy2valmask(u64 x, u64 y, u8 *addr, u64 *mask)
{}

static int mps_tcam_show(struct seq_file *seq, void *v)
{}

static inline void *mps_tcam_get_idx(struct seq_file *seq, loff_t pos)
{}

static void *mps_tcam_start(struct seq_file *seq, loff_t *pos)
{}

static void *mps_tcam_next(struct seq_file *seq, void *v, loff_t *pos)
{}

static void mps_tcam_stop(struct seq_file *seq, void *v)
{}

static const struct seq_operations mps_tcam_seq_ops =;

static int mps_tcam_open(struct inode *inode, struct file *file)
{}

static const struct file_operations mps_tcam_debugfs_fops =;

/* Display various sensor information.
 */
static int sensors_show(struct seq_file *seq, void *v)
{}
DEFINE_SHOW_ATTRIBUTE();

#if IS_ENABLED(CONFIG_IPV6)
DEFINE_SHOW_ATTRIBUTE();
#endif

/*RSS Table.
 */

static int rss_show(struct seq_file *seq, void *v, int idx)
{}

static int rss_open(struct inode *inode, struct file *file)
{}

static const struct file_operations rss_debugfs_fops =;

/* RSS Configuration.
 */

/* Small utility function to return the strings "yes" or "no" if the supplied
 * argument is non-zero.
 */
static const char *yesno(int x)
{}

static int rss_config_show(struct seq_file *seq, void *v)
{}
DEFINE_SHOW_ATTRIBUTE();

/* RSS Secret Key.
 */

static int rss_key_show(struct seq_file *seq, void *v)
{}

static int rss_key_open(struct inode *inode, struct file *file)
{}

static ssize_t rss_key_write(struct file *file, const char __user *buf,
			     size_t count, loff_t *pos)
{}

static const struct file_operations rss_key_debugfs_fops =;

/* PF RSS Configuration.
 */

struct rss_pf_conf {};

static int rss_pf_config_show(struct seq_file *seq, void *v, int idx)
{}

static int rss_pf_config_open(struct inode *inode, struct file *file)
{}

static const struct file_operations rss_pf_config_debugfs_fops =;

/* VF RSS Configuration.
 */

struct rss_vf_conf {};

static int rss_vf_config_show(struct seq_file *seq, void *v, int idx)
{}

static int rss_vf_config_open(struct inode *inode, struct file *file)
{}

static const struct file_operations rss_vf_config_debugfs_fops =;

#ifdef CONFIG_CHELSIO_T4_DCB

/* Data Center Briging information for each port.
 */
static int dcb_info_show(struct seq_file *seq, void *v)
{}

static inline void *dcb_info_get_idx(struct adapter *adap, loff_t pos)
{}

static void *dcb_info_start(struct seq_file *seq, loff_t *pos)
{}

static void dcb_info_stop(struct seq_file *seq, void *v)
{}

static void *dcb_info_next(struct seq_file *seq, void *v, loff_t *pos)
{}

static const struct seq_operations dcb_info_seq_ops =;

static int dcb_info_open(struct inode *inode, struct file *file)
{}

static const struct file_operations dcb_info_debugfs_fops =;
#endif /* CONFIG_CHELSIO_T4_DCB */

static int resources_show(struct seq_file *seq, void *v)
{}
DEFINE_SHOW_ATTRIBUTE();

/**
 * ethqset2pinfo - return port_info of an Ethernet Queue Set
 * @adap: the adapter
 * @qset: Ethernet Queue Set
 */
static inline struct port_info *ethqset2pinfo(struct adapter *adap, int qset)
{}

static int sge_qinfo_uld_txq_entries(const struct adapter *adap, int uld)
{}

static int sge_qinfo_uld_rspq_entries(const struct adapter *adap, int uld,
				      bool ciq)
{}

static int sge_qinfo_uld_rxq_entries(const struct adapter *adap, int uld)
{}

static int sge_qinfo_uld_ciq_entries(const struct adapter *adap, int uld)
{}

static int sge_qinfo_show(struct seq_file *seq, void *v)
{}

static int sge_queue_entries(struct adapter *adap)
{}

static void *sge_queue_start(struct seq_file *seq, loff_t *pos)
{}

static void sge_queue_stop(struct seq_file *seq, void *v)
{}

static void *sge_queue_next(struct seq_file *seq, void *v, loff_t *pos)
{}

static const struct seq_operations sge_qinfo_seq_ops =;

static int sge_qinfo_open(struct inode *inode, struct file *file)
{}

static const struct file_operations sge_qinfo_debugfs_fops =;

int mem_open(struct inode *inode, struct file *file)
{}

static ssize_t mem_read(struct file *file, char __user *buf, size_t count,
			loff_t *ppos)
{}
static const struct file_operations mem_debugfs_fops =;

static int tid_info_show(struct seq_file *seq, void *v)
{}
DEFINE_SHOW_ATTRIBUTE();

static void add_debugfs_mem(struct adapter *adap, const char *name,
			    unsigned int idx, unsigned int size_mb)
{}

static ssize_t blocked_fl_read(struct file *filp, char __user *ubuf,
			       size_t count, loff_t *ppos)
{}

static ssize_t blocked_fl_write(struct file *filp, const char __user *ubuf,
				size_t count, loff_t *ppos)
{}

static const struct file_operations blocked_fl_fops =;

static void mem_region_show(struct seq_file *seq, const char *name,
			    unsigned int from, unsigned int to)
{}

static int meminfo_show(struct seq_file *seq, void *v)
{}
DEFINE_SHOW_ATTRIBUTE();

static int chcr_stats_show(struct seq_file *seq, void *v)
{}
DEFINE_SHOW_ATTRIBUTE();

#define PRINT_ADAP_STATS

#define PRINT_CH_STATS

#define PRINT_CH_STATS2

static void show_tcp_stats(struct seq_file *seq)
{}

static void show_ddp_stats(struct seq_file *seq)
{}

static void show_rdma_stats(struct seq_file *seq)
{}

static void show_tp_err_adapter_stats(struct seq_file *seq)
{}

static void show_cpl_stats(struct seq_file *seq)
{}

static void show_tp_err_channel_stats(struct seq_file *seq)
{}

static void show_fcoe_stats(struct seq_file *seq)
{}

#undef PRINT_CH_STATS2
#undef PRINT_CH_STATS
#undef PRINT_ADAP_STATS

static int tp_stats_show(struct seq_file *seq, void *v)
{}
DEFINE_SHOW_ATTRIBUTE();

/* Add an array of Debug FS files.
 */
void add_debugfs_files(struct adapter *adap,
		       struct t4_debugfs_entry *files,
		       unsigned int nfiles)
{}

int t4_setup_debugfs(struct adapter *adap)
{}