debugfs.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef B43legacy_DEBUGFS_H_
  2. #define B43legacy_DEBUGFS_H_
  3. struct b43legacy_wldev;
  4. struct b43legacy_txstatus;
  5. enum b43legacy_dyndbg { /* Dynamic debugging features */
  6. B43legacy_DBG_XMITPOWER,
  7. B43legacy_DBG_DMAOVERFLOW,
  8. B43legacy_DBG_DMAVERBOSE,
  9. B43legacy_DBG_PWORK_FAST,
  10. B43legacy_DBG_PWORK_STOP,
  11. __B43legacy_NR_DYNDBG,
  12. };
  13. #ifdef CONFIG_B43LEGACY_DEBUG
  14. struct dentry;
  15. #define B43legacy_NR_LOGGED_TXSTATUS 100
  16. struct b43legacy_txstatus_log {
  17. struct b43legacy_txstatus *log;
  18. int end;
  19. spinlock_t lock; /* lock for debugging */
  20. };
  21. struct b43legacy_dfs_file {
  22. struct dentry *dentry;
  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. /* Dentries for the dynamic debugging entries. */
  40. struct dentry *dyn_debug_dentries[__B43legacy_NR_DYNDBG];
  41. };
  42. int b43legacy_debug(struct b43legacy_wldev *dev,
  43. enum b43legacy_dyndbg feature);
  44. void b43legacy_debugfs_init(void);
  45. void b43legacy_debugfs_exit(void);
  46. void b43legacy_debugfs_add_device(struct b43legacy_wldev *dev);
  47. void b43legacy_debugfs_remove_device(struct b43legacy_wldev *dev);
  48. void b43legacy_debugfs_log_txstat(struct b43legacy_wldev *dev,
  49. const struct b43legacy_txstatus *status);
  50. #else /* CONFIG_B43LEGACY_DEBUG*/
  51. static inline
  52. int b43legacy_debug(struct b43legacy_wldev *dev,
  53. enum b43legacy_dyndbg feature)
  54. {
  55. return 0;
  56. }
  57. static inline
  58. void b43legacy_debugfs_init(void) { }
  59. static inline
  60. void b43legacy_debugfs_exit(void) { }
  61. static inline
  62. void b43legacy_debugfs_add_device(struct b43legacy_wldev *dev) { }
  63. static inline
  64. void b43legacy_debugfs_remove_device(struct b43legacy_wldev *dev) { }
  65. static inline
  66. void b43legacy_debugfs_log_txstat(struct b43legacy_wldev *dev,
  67. const struct b43legacy_txstatus *status)
  68. { }
  69. #endif /* CONFIG_B43LEGACY_DEBUG*/
  70. #endif /* B43legacy_DEBUGFS_H_ */