debugfs.h 2.5 KB

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