Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/ALFA-W1F1/RTL8814AU/os_dep/linux/rtw_proc.h
1307 views
1
/******************************************************************************
2
*
3
* Copyright(c) 2007 - 2017 Realtek Corporation.
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
*****************************************************************************/
15
#ifndef __RTW_PROC_H__
16
#define __RTW_PROC_H__
17
18
#include <linux/proc_fs.h>
19
#include <linux/seq_file.h>
20
21
#define RTW_PROC_HDL_TYPE_SEQ 0
22
#define RTW_PROC_HDL_TYPE_SSEQ 1
23
#define RTW_PROC_HDL_TYPE_SZSEQ 2
24
25
struct rtw_proc_hdl {
26
char *name;
27
u8 type;
28
union {
29
int (*show)(struct seq_file *, void *);
30
struct seq_operations *seq_op;
31
struct {
32
int (*show)(struct seq_file *, void *);
33
size_t size;
34
} sz;
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
#define RTW_PROC_HDL_SZSEQ(_name, _show, _write, _size) \
46
{ .name = _name, .type = RTW_PROC_HDL_TYPE_SZSEQ, .u.sz.show = _show, .write = _write, .u.sz.size = _size}
47
48
#ifdef CONFIG_PROC_DEBUG
49
50
int rtw_drv_proc_init(void);
51
void rtw_drv_proc_deinit(void);
52
struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev);
53
void rtw_adapter_proc_deinit(struct net_device *dev);
54
void rtw_adapter_proc_replace(struct net_device *dev);
55
56
#else /* !CONFIG_PROC_DEBUG */
57
58
static inline int rtw_drv_proc_init(void) {return _FAIL;}
59
#define rtw_drv_proc_deinit() do {} while (0)
60
static inline struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev) {return NULL;}
61
#define rtw_adapter_proc_deinit(dev) do {} while (0)
62
#define rtw_adapter_proc_replace(dev) do {} while (0)
63
64
#endif /* !CONFIG_PROC_DEBUG */
65
66
#endif /* __RTW_PROC_H__ */
67
68