debugfs.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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_DBG_FIRMWARE,
  13. B43_DBG_KEYS,
  14. B43_DBG_VERBOSESTATS,
  15. __B43_NR_DYNDBG,
  16. };
  17. #ifdef CONFIG_B43_DEBUG
  18. struct dentry;
  19. #define B43_NR_LOGGED_TXSTATUS 100
  20. struct b43_txstatus_log {
  21. /* This structure is protected by wl->mutex */
  22. struct b43_txstatus *log;
  23. int end;
  24. };
  25. struct b43_dfs_file {
  26. struct dentry *dentry;
  27. char *buffer;
  28. size_t data_len;
  29. };
  30. struct b43_dfsentry {
  31. struct b43_wldev *dev;
  32. struct dentry *subdir;
  33. struct b43_dfs_file file_shm16read;
  34. struct b43_dfs_file file_shm16write;
  35. struct b43_dfs_file file_shm32read;
  36. struct b43_dfs_file file_shm32write;
  37. struct b43_dfs_file file_mmio16read;
  38. struct b43_dfs_file file_mmio16write;
  39. struct b43_dfs_file file_mmio32read;
  40. struct b43_dfs_file file_mmio32write;
  41. struct b43_dfs_file file_txstat;
  42. struct b43_dfs_file file_txpower_g;
  43. struct b43_dfs_file file_restart;
  44. struct b43_dfs_file file_loctls;
  45. struct b43_txstatus_log txstatlog;
  46. /* The cached address for the next mmio16read file read */
  47. u16 mmio16read_next;
  48. /* The cached address for the next mmio32read file read */
  49. u16 mmio32read_next;
  50. /* The cached address for the next shm16read file read */
  51. u32 shm16read_routing_next;
  52. u32 shm16read_addr_next;
  53. /* The cached address for the next shm32read file read */
  54. u32 shm32read_routing_next;
  55. u32 shm32read_addr_next;
  56. /* Enabled/Disabled list for the dynamic debugging features. */
  57. bool dyn_debug[__B43_NR_DYNDBG];
  58. /* Dentries for the dynamic debugging entries. */
  59. struct dentry *dyn_debug_dentries[__B43_NR_DYNDBG];
  60. };
  61. bool b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature);
  62. void b43_debugfs_init(void);
  63. void b43_debugfs_exit(void);
  64. void b43_debugfs_add_device(struct b43_wldev *dev);
  65. void b43_debugfs_remove_device(struct b43_wldev *dev);
  66. void b43_debugfs_log_txstat(struct b43_wldev *dev,
  67. const struct b43_txstatus *status);
  68. #else /* CONFIG_B43_DEBUG */
  69. static inline bool b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature)
  70. {
  71. return false;
  72. }
  73. static inline void b43_debugfs_init(void)
  74. {
  75. }
  76. static inline void b43_debugfs_exit(void)
  77. {
  78. }
  79. static inline void b43_debugfs_add_device(struct b43_wldev *dev)
  80. {
  81. }
  82. static inline void b43_debugfs_remove_device(struct b43_wldev *dev)
  83. {
  84. }
  85. static inline void b43_debugfs_log_txstat(struct b43_wldev *dev,
  86. const struct b43_txstatus *status)
  87. {
  88. }
  89. #endif /* CONFIG_B43_DEBUG */
  90. #endif /* B43_DEBUGFS_H_ */