blob: d6848696cee02f4645a973b0086c6de32e199851 [file] [log] [blame]
Michael Buesche4d6b792007-09-18 15:39:42 -04001#ifndef B43_DEBUGFS_H_
2#define B43_DEBUGFS_H_
3
4struct b43_wldev;
5struct b43_txstatus;
6
7enum b43_dyndbg { /* Dynamic debugging features */
8 B43_DBG_XMITPOWER,
9 B43_DBG_DMAOVERFLOW,
10 B43_DBG_DMAVERBOSE,
11 B43_DBG_PWORK_FAST,
12 B43_DBG_PWORK_STOP,
Michael Bueschf5eda472008-04-20 16:03:32 +020013 B43_DBG_LO,
Michael Buesche4d6b792007-09-18 15:39:42 -040014 __B43_NR_DYNDBG,
15};
16
17#ifdef CONFIG_B43_DEBUG
18
19struct dentry;
20
21#define B43_NR_LOGGED_TXSTATUS 100
22
23struct b43_txstatus_log {
24 struct b43_txstatus *log;
25 int end;
26 spinlock_t lock;
27};
28
29struct b43_dfs_file {
30 struct dentry *dentry;
31 char *buffer;
32 size_t data_len;
33};
34
35struct b43_dfsentry {
36 struct b43_wldev *dev;
37 struct dentry *subdir;
38
Michael Buesch8bd463f2008-06-19 00:35:49 +020039 struct b43_dfs_file file_mmio16read;
40 struct b43_dfs_file file_mmio16write;
41 struct b43_dfs_file file_mmio32read;
42 struct b43_dfs_file file_mmio32write;
Michael Buesche4d6b792007-09-18 15:39:42 -040043 struct b43_dfs_file file_tsf;
44 struct b43_dfs_file file_ucode_regs;
45 struct b43_dfs_file file_shm;
46 struct b43_dfs_file file_txstat;
47 struct b43_dfs_file file_txpower_g;
48 struct b43_dfs_file file_restart;
49 struct b43_dfs_file file_loctls;
50
51 struct b43_txstatus_log txstatlog;
52
Michael Buesch8bd463f2008-06-19 00:35:49 +020053 /* The cached address for the next mmio16read file read */
54 u16 mmio16read_next;
55 /* The cached address for the next mmio32read file read */
56 u16 mmio32read_next;
57
Michael Buesche4d6b792007-09-18 15:39:42 -040058 /* Enabled/Disabled list for the dynamic debugging features. */
59 u32 dyn_debug[__B43_NR_DYNDBG];
60 /* Dentries for the dynamic debugging entries. */
61 struct dentry *dyn_debug_dentries[__B43_NR_DYNDBG];
62};
63
64int b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature);
65
66void b43_debugfs_init(void);
67void b43_debugfs_exit(void);
68void b43_debugfs_add_device(struct b43_wldev *dev);
69void b43_debugfs_remove_device(struct b43_wldev *dev);
70void b43_debugfs_log_txstat(struct b43_wldev *dev,
71 const struct b43_txstatus *status);
72
73#else /* CONFIG_B43_DEBUG */
74
75static inline int b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature)
76{
77 return 0;
78}
79
80static inline void b43_debugfs_init(void)
81{
82}
83static inline void b43_debugfs_exit(void)
84{
85}
86static inline void b43_debugfs_add_device(struct b43_wldev *dev)
87{
88}
89static inline void b43_debugfs_remove_device(struct b43_wldev *dev)
90{
91}
92static inline void b43_debugfs_log_txstat(struct b43_wldev *dev,
93 const struct b43_txstatus *status)
94{
95}
96
97#endif /* CONFIG_B43_DEBUG */
98
99#endif /* B43_DEBUGFS_H_ */