rtw_proc.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #include <linux/proc_fs.h>
  23. #include <linux/seq_file.h>
  24. #define RTW_PROC_HDL_TYPE_SEQ 0
  25. #define RTW_PROC_HDL_TYPE_SSEQ 1
  26. struct rtw_proc_hdl {
  27. char *name;
  28. u8 type;
  29. union {
  30. int (*show)(struct seq_file *, void *);
  31. struct seq_operations *seq_op;
  32. } u;
  33. ssize_t (*write)(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
  34. };
  35. #define RTW_PROC_HDL_SEQ(_name, _seq_op, _write) \
  36. { .name = _name, .type = RTW_PROC_HDL_TYPE_SEQ, .u.seq_op = _seq_op, .write = _write}
  37. #define RTW_PROC_HDL_SSEQ(_name, _show, _write) \
  38. { .name = _name, .type = RTW_PROC_HDL_TYPE_SSEQ, .u.show = _show, .write = _write}
  39. #ifdef CONFIG_PROC_DEBUG
  40. struct proc_dir_entry *get_rtw_drv_proc(void);
  41. int rtw_drv_proc_init(void);
  42. void rtw_drv_proc_deinit(void);
  43. struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev);
  44. void rtw_adapter_proc_deinit(struct net_device *dev);
  45. void rtw_adapter_proc_replace(struct net_device *dev);
  46. #else /* !CONFIG_PROC_DEBUG */
  47. #define get_rtw_drv_proc() NULL
  48. #define rtw_drv_proc_init() 0
  49. #define rtw_drv_proc_deinit() do {} while (0)
  50. #define rtw_adapter_proc_init(dev) NULL
  51. #define rtw_adapter_proc_deinit(dev) do {} while (0)
  52. #define rtw_adapter_proc_replace(dev) do {} while (0)
  53. #endif /* !CONFIG_PROC_DEBUG */
  54. #endif /* __RTW_PROC_H__ */