xref: /wlan-driver/qca-wifi-host-cmn/qdf/linux/src/i_qdf_debugfs.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2017,2021 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /**
20  * DOC: qdf_debugfs.h
21  * Linux specific implementation for debug filesystem APIs.
22  */
23 
24 
25 #ifndef _I_QDF_DEBUGFS_H
26 #define _I_QDF_DEBUGFS_H
27 
28 #include <linux/fs.h>
29 #include <linux/debugfs.h>
30 
31 typedef struct dentry *__qdf_dentry_t;
32 typedef struct seq_file *__qdf_debugfs_file_t;
33 typedef struct debugfs_blob_wrapper *__qdf_debugfs_blob_wrap_t;
34 typedef void *__qdf_entry_t;
35 typedef const struct file_operations *__qdf_file_ops_t;
36 
37 #ifdef WLAN_DEBUGFS
38 
39 /**
40  * qdf_debugfs_get_root() - get debugfs root
41  *
42  * Return: dentry * or NULL in case of failure
43  */
44 struct dentry *qdf_debugfs_get_root(void);
45 
46 /**
47  * qdf_debugfs_get_filemode() - get Linux specific file mode
48  * @mode: This is a bitmap of file modes,
49  *		QDF_FILE_USR_READ
50  *		QDF_FILE_USR_WRITE
51  *		QDF_FILE_OTH_READ
52  *		QDF_FILE_OTH_WRITE
53  *		QDF_FILE_GRP_READ
54  *		QDF_FILE_GRP_WRITE
55  *
56  * Return: Linux specific file mode
57  */
58 umode_t qdf_debugfs_get_filemode(uint16_t mode);
59 
60 #endif /* WLAN_DEBUGFS */
61 #endif /* _I_QDF_DEBUGFS_H */
62