#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;
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(…);
static ssize_t dev_counters_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{ … }
static ssize_t dev_names_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{ … }
struct counter_info { … };
static ssize_t portnames_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{ … }
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)
{ … }
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)
{ … }
static ssize_t qsfp_debugfs_dump(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{ … }
static ssize_t __i2c_debugfs_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos, u32 target)
{ … }
static ssize_t i2c1_debugfs_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{ … }
static ssize_t i2c2_debugfs_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{ … }
static ssize_t __i2c_debugfs_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos, u32 target)
{ … }
static ssize_t i2c1_debugfs_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{ … }
static ssize_t i2c2_debugfs_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{ … }
static ssize_t __qsfp_debugfs_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos, u32 target)
{ … }
static ssize_t qsfp1_debugfs_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{ … }
static ssize_t qsfp2_debugfs_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{ … }
static ssize_t __qsfp_debugfs_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos, u32 target)
{ … }
static ssize_t qsfp1_debugfs_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{ … }
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)
{ … }
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)
{ … }