debugfs.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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_NR_DYNDBG,
  12. };
  13. #ifdef CONFIG_B43_DEBUG
  14. struct dentry;
  15. #define B43_NR_LOGGED_TXSTATUS 100
  16. struct b43_txstatus_log {
  17. struct b43_txstatus *log;
  18. int end;
  19. spinlock_t lock;
  20. };
  21. struct b43_dfs_file {
  22. struct dentry *dentry;
  23. char *buffer;
  24. size_t data_len;
  25. };
  26. struct b43_dfsentry {
  27. struct b43_wldev *dev;
  28. struct dentry *subdir;
  29. struct b43_dfs_file file_tsf;
  30. struct b43_dfs_file file_ucode_regs;
  31. struct b43_dfs_file file_shm;
  32. struct b43_dfs_file file_txstat;
  33. struct b43_dfs_file file_txpower_g;
  34. struct b43_dfs_file file_restart;
  35. struct b43_dfs_file file_loctls;
  36. struct b43_txstatus_log txstatlog;
  37. /* Enabled/Disabled list for the dynamic debugging features. */
  38. u32 dyn_debug[__B43_NR_DYNDBG];
  39. /* Dentries for the dynamic debugging entries. */
  40. struct dentry *dyn_debug_dentries[__B43_NR_DYNDBG];
  41. };
  42. int b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature);
  43. void b43_debugfs_init(void);
  44. void b43_debugfs_exit(void);
  45. void b43_debugfs_add_device(struct b43_wldev *dev);
  46. void b43_debugfs_remove_device(struct b43_wldev *dev);
  47. void b43_debugfs_log_txstat(struct b43_wldev *dev,
  48. const struct b43_txstatus *status);
  49. #else /* CONFIG_B43_DEBUG */
  50. static inline int b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature)
  51. {
  52. return 0;
  53. }
  54. static inline void b43_debugfs_init(void)
  55. {
  56. }
  57. static inline void b43_debugfs_exit(void)
  58. {
  59. }
  60. static inline void b43_debugfs_add_device(struct b43_wldev *dev)
  61. {
  62. }
  63. static inline void b43_debugfs_remove_device(struct b43_wldev *dev)
  64. {
  65. }
  66. static inline void b43_debugfs_log_txstat(struct b43_wldev *dev,
  67. const struct b43_txstatus *status)
  68. {
  69. }
  70. #endif /* CONFIG_B43_DEBUG */
  71. #endif /* B43_DEBUGFS_H_ */