0001
0002 #ifndef B43_DEBUGFS_H_
0003 #define B43_DEBUGFS_H_
0004
0005 struct b43_wldev;
0006 struct b43_txstatus;
0007
0008 enum b43_dyndbg {
0009 B43_DBG_XMITPOWER,
0010 B43_DBG_DMAOVERFLOW,
0011 B43_DBG_DMAVERBOSE,
0012 B43_DBG_PWORK_FAST,
0013 B43_DBG_PWORK_STOP,
0014 B43_DBG_LO,
0015 B43_DBG_FIRMWARE,
0016 B43_DBG_KEYS,
0017 B43_DBG_VERBOSESTATS,
0018 __B43_NR_DYNDBG,
0019 };
0020
0021 #ifdef CONFIG_B43_DEBUG
0022
0023 struct dentry;
0024
0025 #define B43_NR_LOGGED_TXSTATUS 100
0026
0027 struct b43_txstatus_log {
0028
0029
0030 struct b43_txstatus *log;
0031 int end;
0032 };
0033
0034 struct b43_dfs_file {
0035 char *buffer;
0036 size_t data_len;
0037 };
0038
0039 struct b43_dfsentry {
0040 struct b43_wldev *dev;
0041 struct dentry *subdir;
0042
0043 struct b43_dfs_file file_shm16read;
0044 struct b43_dfs_file file_shm16write;
0045 struct b43_dfs_file file_shm32read;
0046 struct b43_dfs_file file_shm32write;
0047 struct b43_dfs_file file_mmio16read;
0048 struct b43_dfs_file file_mmio16write;
0049 struct b43_dfs_file file_mmio32read;
0050 struct b43_dfs_file file_mmio32write;
0051 struct b43_dfs_file file_txstat;
0052 struct b43_dfs_file file_txpower_g;
0053 struct b43_dfs_file file_restart;
0054 struct b43_dfs_file file_loctls;
0055
0056 struct b43_txstatus_log txstatlog;
0057
0058
0059 u16 mmio16read_next;
0060
0061 u16 mmio32read_next;
0062
0063
0064 u32 shm16read_routing_next;
0065 u32 shm16read_addr_next;
0066
0067 u32 shm32read_routing_next;
0068 u32 shm32read_addr_next;
0069
0070
0071 bool dyn_debug[__B43_NR_DYNDBG];
0072 };
0073
0074 bool b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature);
0075
0076 void b43_debugfs_init(void);
0077 void b43_debugfs_exit(void);
0078 void b43_debugfs_add_device(struct b43_wldev *dev);
0079 void b43_debugfs_remove_device(struct b43_wldev *dev);
0080 void b43_debugfs_log_txstat(struct b43_wldev *dev,
0081 const struct b43_txstatus *status);
0082
0083 #else
0084
0085 static inline bool b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature)
0086 {
0087 return false;
0088 }
0089
0090 static inline void b43_debugfs_init(void)
0091 {
0092 }
0093 static inline void b43_debugfs_exit(void)
0094 {
0095 }
0096 static inline void b43_debugfs_add_device(struct b43_wldev *dev)
0097 {
0098 }
0099 static inline void b43_debugfs_remove_device(struct b43_wldev *dev)
0100 {
0101 }
0102 static inline void b43_debugfs_log_txstat(struct b43_wldev *dev,
0103 const struct b43_txstatus *status)
0104 {
0105 }
0106
0107 #endif
0108
0109 #endif