linux/drivers/infiniband/hw/hfi1/debugfs.c

// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
 * Copyright(c) 2015-2018 Intel Corporation.
 */

#include <linux/debugfs.h>
#include <linux/seq_file.h>
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/ratelimit.h>
#include <linux/fault-inject.h>

#include "hfi.h"
#include "trace.h"
#include "debugfs.h"
#include "device.h"
#include "qp.h"
#include "sdma.h"
#include "fault.h"

static struct dentry *hfi1_dbg_root;

/* wrappers to enforce srcu in seq file */
ssize_t hfi1_seq_read(struct file *file, char __user *buf, size_t size,
		      loff_t *ppos)
{}

loff_t hfi1_seq_lseek(struct file *file, loff_t offset, int whence)
{}

#define private2dd(file)
#define private2ppd(file)

static void *_opcode_stats_seq_start(struct seq_file *s, loff_t *pos)
{}

static void *_opcode_stats_seq_next(struct seq_file *s, void *v, loff_t *pos)
{}

static void _opcode_stats_seq_stop(struct seq_file *s, void *v)
{}

static int opcode_stats_show(struct seq_file *s, u8 i, u64 packets, u64 bytes)
{}

static int _opcode_stats_seq_show(struct seq_file *s, void *v)
{}

DEBUGFS_SEQ_FILE_OPS();
DEBUGFS_SEQ_FILE_OPEN()
DEBUGFS_FILE_OPS();

static void *_tx_opcode_stats_seq_start(struct seq_file *s, loff_t *pos)
{}

static void *_tx_opcode_stats_seq_next(struct seq_file *s, void *v, loff_t *pos)
{}

static void _tx_opcode_stats_seq_stop(struct seq_file *s, void *v)
{}

static int _tx_opcode_stats_seq_show(struct seq_file *s, void *v)
{}

DEBUGFS_SEQ_FILE_OPS();
DEBUGFS_SEQ_FILE_OPEN()
DEBUGFS_FILE_OPS();

static void *_ctx_stats_seq_start(struct seq_file *s, loff_t *pos)
{}

static void *_ctx_stats_seq_next(struct seq_file *s, void *v, loff_t *pos)
{}

static void _ctx_stats_seq_stop(struct seq_file *s, void *v)
{}

static int _ctx_stats_seq_show(struct seq_file *s, void *v)
{}

DEBUGFS_SEQ_FILE_OPS();
DEBUGFS_SEQ_FILE_OPEN()
DEBUGFS_FILE_OPS();

static void *_qp_stats_seq_start(struct seq_file *s, loff_t *pos)
	__acquires(RCU)
{}

static void *_qp_stats_seq_next(struct seq_file *s, void *iter_ptr,
				loff_t *pos)
	__must_hold(RCU)
{}

static void _qp_stats_seq_stop(struct seq_file *s, void *iter_ptr)
	__releases(RCU)
{}

static int _qp_stats_seq_show(struct seq_file *s, void *iter_ptr)
{}

DEBUGFS_SEQ_FILE_OPS();
DEBUGFS_SEQ_FILE_OPEN()
DEBUGFS_FILE_OPS();

static void *_sdes_seq_start(struct seq_file *s, loff_t *pos)
{}

static void *_sdes_seq_next(struct seq_file *s, void *v, loff_t *pos)
{}

static void _sdes_seq_stop(struct seq_file *s, void *v)
{}

static int _sdes_seq_show(struct seq_file *s, void *v)
{}

DEBUGFS_SEQ_FILE_OPS();
DEBUGFS_SEQ_FILE_OPEN()
DEBUGFS_FILE_OPS();

static void *_rcds_seq_start(struct seq_file *s, loff_t *pos)
{}

static void *_rcds_seq_next(struct seq_file *s, void *v, loff_t *pos)
{}

static void _rcds_seq_stop(struct seq_file *s, void *v)
{}

static int _rcds_seq_show(struct seq_file *s, void *v)
{}

DEBUGFS_SEQ_FILE_OPS();
DEBUGFS_SEQ_FILE_OPEN()
DEBUGFS_FILE_OPS();

static void *_pios_seq_start(struct seq_file *s, loff_t *pos)
{}

static void *_pios_seq_next(struct seq_file *s, void *v, loff_t *pos)
{}

static void _pios_seq_stop(struct seq_file *s, void *v)
{}

static int _pios_seq_show(struct seq_file *s, void *v)
{}

DEBUGFS_SEQ_FILE_OPS();
DEBUGFS_SEQ_FILE_OPEN()
DEBUGFS_FILE_OPS();

/* read the per-device counters */
static ssize_t dev_counters_read(struct file *file, char __user *buf,
				 size_t count, loff_t *ppos)
{}

/* read the per-device counters */
static ssize_t dev_names_read(struct file *file, char __user *buf,
			      size_t count, loff_t *ppos)
{}

struct counter_info {};

/*
 * Could use file_inode(file)->i_ino to figure out which file,
 * instead of separate routine for each, but for now, this works...
 */

/* read the per-port names (same for each port) */
static ssize_t portnames_read(struct file *file, char __user *buf,
			      size_t count, loff_t *ppos)
{}

/* read the per-port counters */
static ssize_t portcntrs_debugfs_read(struct file *file, char __user *buf,
				      size_t count, loff_t *ppos)
{}

static void check_dyn_flag(u64 scratch0, char *p, int size, int *used,
			   int this_hfi, int hfi, u32 flag, const char *what)
{}

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

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

/* read the dc8051 memory */
static ssize_t dc8051_memory_read(struct file *file, char __user *buf,
				  size_t count, loff_t *ppos)
{}

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

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

/*
 * read the per-port QSFP data for ppd
 */
static ssize_t qsfp_debugfs_dump(struct file *file, char __user *buf,
				 size_t count, loff_t *ppos)
{}

/* Do an i2c write operation on the chain for the given HFI. */
static ssize_t __i2c_debugfs_write(struct file *file, const char __user *buf,
				   size_t count, loff_t *ppos, u32 target)
{}

/* Do an i2c write operation on chain for HFI 0. */
static ssize_t i2c1_debugfs_write(struct file *file, const char __user *buf,
				  size_t count, loff_t *ppos)
{}

/* Do an i2c write operation on chain for HFI 1. */
static ssize_t i2c2_debugfs_write(struct file *file, const char __user *buf,
				  size_t count, loff_t *ppos)
{}

/* Do an i2c read operation on the chain for the given HFI. */
static ssize_t __i2c_debugfs_read(struct file *file, char __user *buf,
				  size_t count, loff_t *ppos, u32 target)
{}

/* Do an i2c read operation on chain for HFI 0. */
static ssize_t i2c1_debugfs_read(struct file *file, char __user *buf,
				 size_t count, loff_t *ppos)
{}

/* Do an i2c read operation on chain for HFI 1. */
static ssize_t i2c2_debugfs_read(struct file *file, char __user *buf,
				 size_t count, loff_t *ppos)
{}

/* Do a QSFP write operation on the i2c chain for the given HFI. */
static ssize_t __qsfp_debugfs_write(struct file *file, const char __user *buf,
				    size_t count, loff_t *ppos, u32 target)
{}

/* Do a QSFP write operation on i2c chain for HFI 0. */
static ssize_t qsfp1_debugfs_write(struct file *file, const char __user *buf,
				   size_t count, loff_t *ppos)
{}

/* Do a QSFP write operation on i2c chain for HFI 1. */
static ssize_t qsfp2_debugfs_write(struct file *file, const char __user *buf,
				   size_t count, loff_t *ppos)
{}

/* Do a QSFP read operation on the i2c chain for the given HFI. */
static ssize_t __qsfp_debugfs_read(struct file *file, char __user *buf,
				   size_t count, loff_t *ppos, u32 target)
{}

/* Do a QSFP read operation on i2c chain for HFI 0. */
static ssize_t qsfp1_debugfs_read(struct file *file, char __user *buf,
				  size_t count, loff_t *ppos)
{}

/* Do a QSFP read operation on i2c chain for HFI 1. */
static ssize_t qsfp2_debugfs_read(struct file *file, char __user *buf,
				  size_t count, loff_t *ppos)
{}

static int __i2c_debugfs_open(struct inode *in, struct file *fp, u32 target)
{}

static int i2c1_debugfs_open(struct inode *in, struct file *fp)
{}

static int i2c2_debugfs_open(struct inode *in, struct file *fp)
{}

static int __i2c_debugfs_release(struct inode *in, struct file *fp, u32 target)
{}

static int i2c1_debugfs_release(struct inode *in, struct file *fp)
{}

static int i2c2_debugfs_release(struct inode *in, struct file *fp)
{}

static int __qsfp_debugfs_open(struct inode *in, struct file *fp, u32 target)
{}

static int qsfp1_debugfs_open(struct inode *in, struct file *fp)
{}

static int qsfp2_debugfs_open(struct inode *in, struct file *fp)
{}

static int __qsfp_debugfs_release(struct inode *in, struct file *fp, u32 target)
{}

static int qsfp1_debugfs_release(struct inode *in, struct file *fp)
{}

static int qsfp2_debugfs_release(struct inode *in, struct file *fp)
{}

#define EXPROM_WRITE_ENABLE

static bool exprom_wp_disabled;

static int exprom_wp_set(struct hfi1_devdata *dd, bool disable)
{}

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

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

static unsigned long exprom_in_use;

static int exprom_wp_debugfs_open(struct inode *in, struct file *fp)
{}

static int exprom_wp_debugfs_release(struct inode *in, struct file *fp)
{}

#define DEBUGFS_OPS(nm, readroutine, writeroutine)

#define DEBUGFS_XOPS(nm, readf, writef, openf, releasef)

static const struct counter_info cntr_ops[] =;

static const struct counter_info port_cntr_ops[] =;

static void *_sdma_cpu_list_seq_start(struct seq_file *s, loff_t *pos)
{}

static void *_sdma_cpu_list_seq_next(struct seq_file *s, void *v, loff_t *pos)
{}

static void _sdma_cpu_list_seq_stop(struct seq_file *s, void *v)
{}

static int _sdma_cpu_list_seq_show(struct seq_file *s, void *v)
{}

DEBUGFS_SEQ_FILE_OPS();
DEBUGFS_SEQ_FILE_OPEN()
DEBUGFS_FILE_OPS();

void hfi1_dbg_ibdev_init(struct hfi1_ibdev *ibd)
{}

void hfi1_dbg_ibdev_exit(struct hfi1_ibdev *ibd)
{}

/*
 * driver stats field names, one line per stat, single string.  Used by
 * programs like hfistats to print the stats in a way which works for
 * different versions of drivers, without changing program source.
 * if hfi1_ib_stats changes, this needs to change.  Names need to be
 * 12 chars or less (w/o newline), for proper display by hfistats utility.
 */
static const char * const hfi1_statnames[] =;

static void *_driver_stats_names_seq_start(struct seq_file *s, loff_t *pos)
{}

static void *_driver_stats_names_seq_next(
	struct seq_file *s,
	void *v,
	loff_t *pos)
{}

static void _driver_stats_names_seq_stop(struct seq_file *s, void *v)
{}

static int _driver_stats_names_seq_show(struct seq_file *s, void *v)
{}

DEBUGFS_SEQ_FILE_OPS();
DEBUGFS_SEQ_FILE_OPEN()
DEBUGFS_FILE_OPS();

static void *_driver_stats_seq_start(struct seq_file *s, loff_t *pos)
{}

static void *_driver_stats_seq_next(struct seq_file *s, void *v, loff_t *pos)
{}

static void _driver_stats_seq_stop(struct seq_file *s, void *v)
{}

static void hfi1_sps_show_ints(struct seq_file *s)
{}

static int _driver_stats_seq_show(struct seq_file *s, void *v)
{}

DEBUGFS_SEQ_FILE_OPS();
DEBUGFS_SEQ_FILE_OPEN()
DEBUGFS_FILE_OPS();

void hfi1_dbg_init(void)
{}

void hfi1_dbg_exit(void)
{}