debugfs.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef B43_DEBUGFS_H_
  2. #define B43_DEBUGFS_H_
  3. struct b43_wldev;
  4. struct b43_txstatus;
  5. enum b43_dyndbg { /* Dynamic debugging features */
  6. B43_DBG_XMITPOWER,
  7. B43_DBG_DMAOVERFLOW,
  8. B43_DBG_DMAVERBOSE,
  9. B43_DBG_PWORK_FAST,
  10. B43_DBG_PWORK_STOP,
  11. B43_DBG_LO,
  12. __B43_NR_DYNDBG,
  13. };
  14. #ifdef CONFIG_B43_DEBUG
  15. struct dentry;
  16. #define B43_NR_LOGGED_TXSTATUS 100
  17. struct b43_txstatus_log {
  18. struct b43_txstatus *log;
  19. int end;
  20. spinlock_t lock;
  21. };
  22. struct b43_dfs_file {
  23. struct dentry *dentry;
  24. char *buffer;
  25. size_t data_len;
  26. };
  27. struct b43_dfsentry {
  28. struct b43_wldev *dev;
  29. struct dentry *subdir;
  30. struct b43_dfs_file file_tsf;
  31. struct b43_dfs_file file_ucode_regs;
  32. struct b43_dfs_file file_shm;
  33. struct b43_dfs_file file_txstat;
  34. struct b43_dfs_file file_txpower_g;
  35. struct b43_dfs_file file_restart;
  36. struct b43_dfs_file file_loctls;
  37. struct b43_txstatus_log txstatlog;
  38. /* Enabled/Disabled list for the dynamic debugging features. */
  39. u32 dyn_debug[__B43_NR_DYNDBG];
  40. /* Dentries for the dynamic debugging entries. */
  41. struct dentry *dyn_debug_dentries[__B43_NR_DYNDBG];
  42. };
  43. int b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature);
  44. void b43_debugfs_init(void);
  45. void b43_debugfs_exit(void);
  46. void b43_debugfs_add_device(struct b43_wldev *dev);
  47. void b43_debugfs_remove_device(struct b43_wldev *dev);
  48. void b43_debugfs_log_txstat(struct b43_wldev *dev,
  49. const struct b43_txstatus *status);
  50. #else /* CONFIG_B43_DEBUG */
  51. static inline int b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature)
  52. {
  53. return 0;
  54. }
  55. static inline void b43_debugfs_init(void)
  56. {
  57. }
  58. static inline void b43_debugfs_exit(void)
  59. {
  60. }
  61. static inline void b43_debugfs_add_device(struct b43_wldev *dev)
  62. {
  63. }
  64. static inline void b43_debugfs_remove_device(struct b43_wldev *dev)
  65. {
  66. }
  67. static inline void b43_debugfs_log_txstat(struct b43_wldev *dev,
  68. const struct b43_txstatus *status)
  69. {
  70. }
  71. #endif /* CONFIG_B43_DEBUG */
  72. #endif /* B43_DEBUGFS_H_ */