net: wireless: rockchip_wlan: add rtl8723cs support
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8723cs / os_dep / linux / rtw_proc.h
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2013 Realtek Corporation. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17  *
18  *
19  ******************************************************************************/
20 #ifndef __RTW_PROC_H__
21 #define __RTW_PROC_H__
22
23 #include <linux/proc_fs.h>
24 #include <linux/seq_file.h>
25
26 #define RTW_PROC_HDL_TYPE_SEQ   0
27 #define RTW_PROC_HDL_TYPE_SSEQ  1
28
29 struct rtw_proc_hdl {
30         char *name;
31         u8 type;
32         union {
33                 int (*show)(struct seq_file *, void *);
34                 struct seq_operations *seq_op;
35         } u;
36         ssize_t (*write)(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
37 };
38
39 #define RTW_PROC_HDL_SEQ(_name, _seq_op, _write) \
40         { .name = _name, .type = RTW_PROC_HDL_TYPE_SEQ, .u.seq_op = _seq_op, .write = _write}
41
42 #define RTW_PROC_HDL_SSEQ(_name, _show, _write) \
43         { .name = _name, .type = RTW_PROC_HDL_TYPE_SSEQ, .u.show = _show, .write = _write}
44
45 #ifdef CONFIG_PROC_DEBUG
46
47 struct proc_dir_entry *get_rtw_drv_proc(void);
48 int rtw_drv_proc_init(void);
49 void rtw_drv_proc_deinit(void);
50 struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev);
51 void rtw_adapter_proc_deinit(struct net_device *dev);
52 void rtw_adapter_proc_replace(struct net_device *dev);
53
54 #else /* !CONFIG_PROC_DEBUG */
55
56 #define get_rtw_drv_proc() NULL
57 #define rtw_drv_proc_init() 0
58 #define rtw_drv_proc_deinit() do {} while (0)
59 #define rtw_adapter_proc_init(dev) NULL
60 #define rtw_adapter_proc_deinit(dev) do {} while (0)
61 #define rtw_adapter_proc_replace(dev) do {} while (0)
62
63 #endif /* !CONFIG_PROC_DEBUG */
64
65 #endif /* __RTW_PROC_H__ */