blob: 132c81f2f98df49335e010927fd89f85d5808638 [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 Buesch6bbc3212008-06-19 19:33:51 +020039 struct b43_dfs_file file_shm16read;
40 struct b43_dfs_file file_shm16write;
41 struct b43_dfs_file file_shm32read;
42 struct b43_dfs_file file_shm32write;
Michael Buesch8bd463f2008-06-19 00:35:49 +020043 struct b43_dfs_file file_mmio16read;
44 struct b43_dfs_file file_mmio16write;
45 struct b43_dfs_file file_mmio32read;
46 struct b43_dfs_file file_mmio32write;
Michael Buesche4d6b792007-09-18 15:39:42 -040047 struct b43_dfs_file file_tsf;
Michael Buesche4d6b792007-09-18 15:39:42 -040048 struct b43_dfs_file file_txstat;
49 struct b43_dfs_file file_txpower_g;
50 struct b43_dfs_file file_restart;
51 struct b43_dfs_file file_loctls;
52
53 struct b43_txstatus_log txstatlog;
54
Michael Buesch8bd463f2008-06-19 00:35:49 +020055 /* The cached address for the next mmio16read file read */
56 u16 mmio16read_next;
57 /* The cached address for the next mmio32read file read */
58 u16 mmio32read_next;
59
Michael Buesch6bbc3212008-06-19 19:33:51 +020060 /* The cached address for the next shm16read file read */
61 u32 shm16read_routing_next;
62 u32 shm16read_addr_next;
63 /* The cached address for the next shm32read file read */
64 u32 shm32read_routing_next;
65 u32 shm32read_addr_next;
66
Michael Buesche4d6b792007-09-18 15:39:42 -040067 /* Enabled/Disabled list for the dynamic debugging features. */
68 u32 dyn_debug[__B43_NR_DYNDBG];
69 /* Dentries for the dynamic debugging entries. */
70 struct dentry *dyn_debug_dentries[__B43_NR_DYNDBG];
71};
72
73int b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature);
74
75void b43_debugfs_init(void);
76void b43_debugfs_exit(void);
77void b43_debugfs_add_device(struct b43_wldev *dev);
78void b43_debugfs_remove_device(struct b43_wldev *dev);
79void b43_debugfs_log_txstat(struct b43_wldev *dev,
80 const struct b43_txstatus *status);
81
82#else /* CONFIG_B43_DEBUG */
83
84static inline int b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature)
85{
86 return 0;
87}
88
89static inline void b43_debugfs_init(void)
90{
91}
92static inline void b43_debugfs_exit(void)
93{
94}
95static inline void b43_debugfs_add_device(struct b43_wldev *dev)
96{
97}
98static inline void b43_debugfs_remove_device(struct b43_wldev *dev)
99{
100}
101static inline void b43_debugfs_log_txstat(struct b43_wldev *dev,
102 const struct b43_txstatus *status)
103{
104}
105
106#endif /* CONFIG_B43_DEBUG */
107
108#endif /* B43_DEBUGFS_H_ */