1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
3 * Copyright(c) 2015, 2016, 2018 Intel Corporation.
6 #ifndef _HFI1_DEBUGFS_H
7 #define _HFI1_DEBUGFS_H
11 #define DEBUGFS_SEQ_FILE_OPS(name) \
12 static const struct seq_operations _##name##_seq_ops = { \
13 .start = _##name##_seq_start, \
14 .next = _##name##_seq_next, \
15 .stop = _##name##_seq_stop, \
16 .show = _##name##_seq_show \
19 #define DEBUGFS_SEQ_FILE_OPEN(name) \
20 static int _##name##_open(struct inode *inode, struct file *s) \
22 struct seq_file *seq; \
24 ret = seq_open(s, &_##name##_seq_ops); \
27 seq = s->private_data; \
28 seq->private = inode->i_private; \
32 #define DEBUGFS_FILE_OPS(name) \
33 static const struct file_operations _##name##_file_ops = { \
34 .owner = THIS_MODULE, \
35 .open = _##name##_open, \
36 .read = hfi1_seq_read, \
37 .llseek = hfi1_seq_lseek, \
38 .release = seq_release \
42 ssize_t
hfi1_seq_read(struct file
*file
, char __user
*buf
, size_t size
,
44 loff_t
hfi1_seq_lseek(struct file
*file
, loff_t offset
, int whence
);
46 #ifdef CONFIG_DEBUG_FS
47 void hfi1_dbg_ibdev_init(struct hfi1_ibdev
*ibd
);
48 void hfi1_dbg_ibdev_exit(struct hfi1_ibdev
*ibd
);
49 void hfi1_dbg_init(void);
50 void hfi1_dbg_exit(void);
53 static inline void hfi1_dbg_ibdev_init(struct hfi1_ibdev
*ibd
)
57 static inline void hfi1_dbg_ibdev_exit(struct hfi1_ibdev
*ibd
)
61 static inline void hfi1_dbg_init(void)
65 static inline void hfi1_dbg_exit(void)
70 #endif /* _HFI1_DEBUGFS_H */