debugfs.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. char *buffer;
  24. size_t data_len;
  25. };
  26. struct b43legacy_dfsentry {
  27. struct b43legacy_wldev *dev;
  28. struct dentry *subdir;
  29. struct b43legacy_dfs_file file_tsf;
  30. struct b43legacy_dfs_file file_ucode_regs;
  31. struct b43legacy_dfs_file file_shm;
  32. struct b43legacy_dfs_file file_txstat;
  33. struct b43legacy_dfs_file file_txpower_g;
  34. struct b43legacy_dfs_file file_restart;
  35. struct b43legacy_dfs_file file_loctls;
  36. struct b43legacy_txstatus_log txstatlog;
  37. /* Enabled/Disabled list for the dynamic debugging features. */
  38. bool dyn_debug[__B43legacy_NR_DYNDBG];
  39. };
  40. int b43legacy_debug(struct b43legacy_wldev *dev,
  41. enum b43legacy_dyndbg feature);
  42. void b43legacy_debugfs_init(void);
  43. void b43legacy_debugfs_exit(void);
  44. void b43legacy_debugfs_add_device(struct b43legacy_wldev *dev);
  45. void b43legacy_debugfs_remove_device(struct b43legacy_wldev *dev);
  46. void b43legacy_debugfs_log_txstat(struct b43legacy_wldev *dev,
  47. const struct b43legacy_txstatus *status);
  48. #else /* CONFIG_B43LEGACY_DEBUG*/
  49. static inline
  50. int b43legacy_debug(struct b43legacy_wldev *dev,
  51. enum b43legacy_dyndbg feature)
  52. {
  53. return 0;
  54. }
  55. static inline
  56. void b43legacy_debugfs_init(void) { }
  57. static inline
  58. void b43legacy_debugfs_exit(void) { }
  59. static inline
  60. void b43legacy_debugfs_add_device(struct b43legacy_wldev *dev) { }
  61. static inline
  62. void b43legacy_debugfs_remove_device(struct b43legacy_wldev *dev) { }
  63. static inline
  64. void b43legacy_debugfs_log_txstat(struct b43legacy_wldev *dev,
  65. const struct b43legacy_txstatus *status)
  66. { }
  67. #endif /* CONFIG_B43LEGACY_DEBUG*/
  68. #endif /* B43legacy_DEBUGFS_H_ */