debugfs.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef B43legacy_DEBUGFS_H_
  3. #define B43legacy_DEBUGFS_H_
  4. struct b43legacy_wldev;
  5. struct b43legacy_txstatus;
  6. enum b43legacy_dyndbg { /* Dynamic debugging features */
  7. B43legacy_DBG_XMITPOWER,
  8. B43legacy_DBG_DMAOVERFLOW,
  9. B43legacy_DBG_DMAVERBOSE,
  10. B43legacy_DBG_PWORK_FAST,
  11. B43legacy_DBG_PWORK_STOP,
  12. __B43legacy_NR_DYNDBG,
  13. };
  14. #ifdef CONFIG_B43LEGACY_DEBUG
  15. struct dentry;
  16. #define B43legacy_NR_LOGGED_TXSTATUS 100
  17. struct b43legacy_txstatus_log {
  18. struct b43legacy_txstatus *log;
  19. int end;
  20. spinlock_t lock; /* lock for debugging */
  21. };
  22. struct b43legacy_dfs_file {
  23. struct dentry *dentry;
  24. char *buffer;
  25. size_t data_len;
  26. };
  27. struct b43legacy_dfsentry {
  28. struct b43legacy_wldev *dev;
  29. struct dentry *subdir;
  30. struct b43legacy_dfs_file file_tsf;
  31. struct b43legacy_dfs_file file_ucode_regs;
  32. struct b43legacy_dfs_file file_shm;
  33. struct b43legacy_dfs_file file_txstat;
  34. struct b43legacy_dfs_file file_txpower_g;
  35. struct b43legacy_dfs_file file_restart;
  36. struct b43legacy_dfs_file file_loctls;
  37. struct b43legacy_txstatus_log txstatlog;
  38. /* Enabled/Disabled list for the dynamic debugging features. */
  39. bool dyn_debug[__B43legacy_NR_DYNDBG];
  40. /* Dentries for the dynamic debugging entries. */
  41. struct dentry *dyn_debug_dentries[__B43legacy_NR_DYNDBG];
  42. };
  43. int b43legacy_debug(struct b43legacy_wldev *dev,
  44. enum b43legacy_dyndbg feature);
  45. void b43legacy_debugfs_init(void);
  46. void b43legacy_debugfs_exit(void);
  47. void b43legacy_debugfs_add_device(struct b43legacy_wldev *dev);
  48. void b43legacy_debugfs_remove_device(struct b43legacy_wldev *dev);
  49. void b43legacy_debugfs_log_txstat(struct b43legacy_wldev *dev,
  50. const struct b43legacy_txstatus *status);
  51. #else /* CONFIG_B43LEGACY_DEBUG*/
  52. static inline
  53. int b43legacy_debug(struct b43legacy_wldev *dev,
  54. enum b43legacy_dyndbg feature)
  55. {
  56. return 0;
  57. }
  58. static inline
  59. void b43legacy_debugfs_init(void) { }
  60. static inline
  61. void b43legacy_debugfs_exit(void) { }
  62. static inline
  63. void b43legacy_debugfs_add_device(struct b43legacy_wldev *dev) { }
  64. static inline
  65. void b43legacy_debugfs_remove_device(struct b43legacy_wldev *dev) { }
  66. static inline
  67. void b43legacy_debugfs_log_txstat(struct b43legacy_wldev *dev,
  68. const struct b43legacy_txstatus *status)
  69. { }
  70. #endif /* CONFIG_B43LEGACY_DEBUG*/
  71. #endif /* B43legacy_DEBUGFS_H_ */