debugfs.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef B43_DEBUGFS_H_
  3. #define B43_DEBUGFS_H_
  4. struct b43_wldev;
  5. struct b43_txstatus;
  6. enum b43_dyndbg { /* Dynamic debugging features */
  7. B43_DBG_XMITPOWER,
  8. B43_DBG_DMAOVERFLOW,
  9. B43_DBG_DMAVERBOSE,
  10. B43_DBG_PWORK_FAST,
  11. B43_DBG_PWORK_STOP,
  12. B43_DBG_LO,
  13. B43_DBG_FIRMWARE,
  14. B43_DBG_KEYS,
  15. B43_DBG_VERBOSESTATS,
  16. __B43_NR_DYNDBG,
  17. };
  18. #ifdef CONFIG_B43_DEBUG
  19. struct dentry;
  20. #define B43_NR_LOGGED_TXSTATUS 100
  21. struct b43_txstatus_log {
  22. /* This structure is protected by wl->mutex */
  23. struct b43_txstatus *log;
  24. int end;
  25. };
  26. struct b43_dfs_file {
  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. };
  59. bool b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature);
  60. void b43_debugfs_init(void);
  61. void b43_debugfs_exit(void);
  62. void b43_debugfs_add_device(struct b43_wldev *dev);
  63. void b43_debugfs_remove_device(struct b43_wldev *dev);
  64. void b43_debugfs_log_txstat(struct b43_wldev *dev,
  65. const struct b43_txstatus *status);
  66. #else /* CONFIG_B43_DEBUG */
  67. static inline bool b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature)
  68. {
  69. return false;
  70. }
  71. static inline void b43_debugfs_init(void)
  72. {
  73. }
  74. static inline void b43_debugfs_exit(void)
  75. {
  76. }
  77. static inline void b43_debugfs_add_device(struct b43_wldev *dev)
  78. {
  79. }
  80. static inline void b43_debugfs_remove_device(struct b43_wldev *dev)
  81. {
  82. }
  83. static inline void b43_debugfs_log_txstat(struct b43_wldev *dev,
  84. const struct b43_txstatus *status)
  85. {
  86. }
  87. #endif /* CONFIG_B43_DEBUG */
  88. #endif /* B43_DEBUGFS_H_ */