diff options
author | Hariprasad Shenai <hariprasad@chelsio.com> | 2015-01-20 09:32:21 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-25 04:13:25 +0300 |
commit | 688ea5fe7f57272af0e26e271892cead098ef934 (patch) | |
tree | be256f3ac56f422dda120c2ba14cae4104a1c3a8 /drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.h | |
parent | 49216c1c170f07c138b043d67cd34c67d75a27cc (diff) | |
download | linux-688ea5fe7f57272af0e26e271892cead098ef934.tar.xz |
cxgb4: Add debugfs options to dump the rss key, config for PF, VF, etc
Adds support to dump the rss table, rss_config, rss_key, rss_pf_config and
rss_vf_config
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.h')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.h index e162c611e089..b63cfee2d963 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.h +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.h @@ -39,6 +39,19 @@ #define FILE_DATA(_file) ((_file)->f_path.dentry->d_inode) +#define DEFINE_SIMPLE_DEBUGFS_FILE(name) \ +static int name##_open(struct inode *inode, struct file *file) \ +{ \ + return single_open(file, name##_show, inode->i_private); \ +} \ +static const struct file_operations name##_debugfs_fops = { \ + .owner = THIS_MODULE, \ + .open = name##_open, \ + .read = seq_read, \ + .llseek = seq_lseek, \ + .release = single_release \ +} + struct t4_debugfs_entry { const char *name; const struct file_operations *ops; @@ -54,6 +67,11 @@ struct seq_tab { char data[0]; /* the table data */ }; +static inline unsigned int hex2val(char c) +{ + return isdigit(c) ? c - '0' : tolower(c) - 'a' + 10; +} + 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)); |