debugfs.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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_mmio16read;
  31. struct b43_dfs_file file_mmio16write;
  32. struct b43_dfs_file file_mmio32read;
  33. struct b43_dfs_file file_mmio32write;
  34. struct b43_dfs_file file_tsf;
  35. struct b43_dfs_file file_ucode_regs;
  36. struct b43_dfs_file file_shm;
  37. struct b43_dfs_file file_txstat;
  38. struct b43_dfs_file file_txpower_g;
  39. struct b43_dfs_file file_restart;
  40. struct b43_dfs_file file_loctls;
  41. struct b43_txstatus_log txstatlog;
  42. /* The cached address for the next mmio16read file read */
  43. u16 mmio16read_next;
  44. /* The cached address for the next mmio32read file read */
  45. u16 mmio32read_next;
  46. /* Enabled/Disabled list for the dynamic debugging features. */
  47. u32 dyn_debug[__B43_NR_DYNDBG];
  48. /* Dentries for the dynamic debugging entries. */
  49. struct dentry *dyn_debug_dentries[__B43_NR_DYNDBG];
  50. };
  51. int b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature);
  52. void b43_debugfs_init(void);
  53. void b43_debugfs_exit(void);
  54. void b43_debugfs_add_device(struct b43_wldev *dev);
  55. void b43_debugfs_remove_device(struct b43_wldev *dev);
  56. void b43_debugfs_log_txstat(struct b43_wldev *dev,
  57. const struct b43_txstatus *status);
  58. #else /* CONFIG_B43_DEBUG */
  59. static inline int b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature)
  60. {
  61. return 0;
  62. }
  63. static inline void b43_debugfs_init(void)
  64. {
  65. }
  66. static inline void b43_debugfs_exit(void)
  67. {
  68. }
  69. static inline void b43_debugfs_add_device(struct b43_wldev *dev)
  70. {
  71. }
  72. static inline void b43_debugfs_remove_device(struct b43_wldev *dev)
  73. {
  74. }
  75. static inline void b43_debugfs_log_txstat(struct b43_wldev *dev,
  76. const struct b43_txstatus *status)
  77. {
  78. }
  79. #endif /* CONFIG_B43_DEBUG */
  80. #endif /* B43_DEBUGFS_H_ */