rsi_debugfs.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /**
  2. * Copyright (c) 2014 Redpine Signals Inc.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef __RSI_DEBUGFS_H__
  17. #define __RSI_DEBUGFS_H__
  18. #include "rsi_main.h"
  19. #include <linux/debugfs.h>
  20. #ifndef CONFIG_RSI_DEBUGFS
  21. static inline int rsi_init_dbgfs(struct rsi_hw *adapter)
  22. {
  23. return 0;
  24. }
  25. static inline void rsi_remove_dbgfs(struct rsi_hw *adapter)
  26. {
  27. return;
  28. }
  29. #else
  30. struct rsi_dbg_files {
  31. const char *name;
  32. umode_t perms;
  33. const struct file_operations fops;
  34. };
  35. struct rsi_debugfs {
  36. struct dentry *subdir;
  37. struct rsi_dbg_ops *dfs_get_ops;
  38. struct dentry *rsi_files[MAX_DEBUGFS_ENTRIES];
  39. };
  40. int rsi_init_dbgfs(struct rsi_hw *adapter);
  41. void rsi_remove_dbgfs(struct rsi_hw *adapter);
  42. #endif
  43. #endif