Path: blob/master/ALFA-W1F1/RTL8814AU/os_dep/linux/rtw_proc.h
1307 views
/******************************************************************************1*2* Copyright(c) 2007 - 2017 Realtek Corporation.3*4* This program is free software; you can redistribute it and/or modify it5* under the terms of version 2 of the GNU General Public License as6* published by the Free Software Foundation.7*8* This program is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for11* more details.12*13*****************************************************************************/14#ifndef __RTW_PROC_H__15#define __RTW_PROC_H__1617#include <linux/proc_fs.h>18#include <linux/seq_file.h>1920#define RTW_PROC_HDL_TYPE_SEQ 021#define RTW_PROC_HDL_TYPE_SSEQ 122#define RTW_PROC_HDL_TYPE_SZSEQ 22324struct rtw_proc_hdl {25char *name;26u8 type;27union {28int (*show)(struct seq_file *, void *);29struct seq_operations *seq_op;30struct {31int (*show)(struct seq_file *, void *);32size_t size;33} sz;34} u;35ssize_t (*write)(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);36};3738#define RTW_PROC_HDL_SEQ(_name, _seq_op, _write) \39{ .name = _name, .type = RTW_PROC_HDL_TYPE_SEQ, .u.seq_op = _seq_op, .write = _write}4041#define RTW_PROC_HDL_SSEQ(_name, _show, _write) \42{ .name = _name, .type = RTW_PROC_HDL_TYPE_SSEQ, .u.show = _show, .write = _write}4344#define RTW_PROC_HDL_SZSEQ(_name, _show, _write, _size) \45{ .name = _name, .type = RTW_PROC_HDL_TYPE_SZSEQ, .u.sz.show = _show, .write = _write, .u.sz.size = _size}4647#ifdef CONFIG_PROC_DEBUG4849int rtw_drv_proc_init(void);50void rtw_drv_proc_deinit(void);51struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev);52void rtw_adapter_proc_deinit(struct net_device *dev);53void rtw_adapter_proc_replace(struct net_device *dev);5455#else /* !CONFIG_PROC_DEBUG */5657static inline int rtw_drv_proc_init(void) {return _FAIL;}58#define rtw_drv_proc_deinit() do {} while (0)59static inline struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev) {return NULL;}60#define rtw_adapter_proc_deinit(dev) do {} while (0)61#define rtw_adapter_proc_replace(dev) do {} while (0)6263#endif /* !CONFIG_PROC_DEBUG */6465#endif /* __RTW_PROC_H__ */666768