Loading...
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef B43legacy_DEBUGFS_H_
3#define B43legacy_DEBUGFS_H_
4
5struct b43legacy_wldev;
6struct b43legacy_txstatus;
7
8enum b43legacy_dyndbg { /* Dynamic debugging features */
9 B43legacy_DBG_XMITPOWER,
10 B43legacy_DBG_DMAOVERFLOW,
11 B43legacy_DBG_DMAVERBOSE,
12 B43legacy_DBG_PWORK_FAST,
13 B43legacy_DBG_PWORK_STOP,
14 __B43legacy_NR_DYNDBG,
15};
16
17
18#ifdef CONFIG_B43LEGACY_DEBUG
19
20struct dentry;
21
22#define B43legacy_NR_LOGGED_TXSTATUS 100
23
24struct b43legacy_txstatus_log {
25 struct b43legacy_txstatus *log;
26 int end;
27 spinlock_t lock; /* lock for debugging */
28};
29
30struct b43legacy_dfs_file {
31 struct dentry *dentry;
32 char *buffer;
33 size_t data_len;
34};
35
36struct b43legacy_dfsentry {
37 struct b43legacy_wldev *dev;
38 struct dentry *subdir;
39
40 struct b43legacy_dfs_file file_tsf;
41 struct b43legacy_dfs_file file_ucode_regs;
42 struct b43legacy_dfs_file file_shm;
43 struct b43legacy_dfs_file file_txstat;
44 struct b43legacy_dfs_file file_txpower_g;
45 struct b43legacy_dfs_file file_restart;
46 struct b43legacy_dfs_file file_loctls;
47
48 struct b43legacy_txstatus_log txstatlog;
49
50 /* Enabled/Disabled list for the dynamic debugging features. */
51 bool dyn_debug[__B43legacy_NR_DYNDBG];
52 /* Dentries for the dynamic debugging entries. */
53 struct dentry *dyn_debug_dentries[__B43legacy_NR_DYNDBG];
54};
55
56int b43legacy_debug(struct b43legacy_wldev *dev,
57 enum b43legacy_dyndbg feature);
58
59void b43legacy_debugfs_init(void);
60void b43legacy_debugfs_exit(void);
61void b43legacy_debugfs_add_device(struct b43legacy_wldev *dev);
62void b43legacy_debugfs_remove_device(struct b43legacy_wldev *dev);
63void b43legacy_debugfs_log_txstat(struct b43legacy_wldev *dev,
64 const struct b43legacy_txstatus *status);
65
66#else /* CONFIG_B43LEGACY_DEBUG*/
67
68static inline
69int b43legacy_debug(struct b43legacy_wldev *dev,
70 enum b43legacy_dyndbg feature)
71{
72 return 0;
73}
74
75static inline
76void b43legacy_debugfs_init(void) { }
77static inline
78void b43legacy_debugfs_exit(void) { }
79static inline
80void b43legacy_debugfs_add_device(struct b43legacy_wldev *dev) { }
81static inline
82void b43legacy_debugfs_remove_device(struct b43legacy_wldev *dev) { }
83static inline
84void b43legacy_debugfs_log_txstat(struct b43legacy_wldev *dev,
85 const struct b43legacy_txstatus *status)
86 { }
87
88#endif /* CONFIG_B43LEGACY_DEBUG*/
89
90#endif /* B43legacy_DEBUGFS_H_ */
1#ifndef B43legacy_DEBUGFS_H_
2#define B43legacy_DEBUGFS_H_
3
4struct b43legacy_wldev;
5struct b43legacy_txstatus;
6
7enum b43legacy_dyndbg { /* Dynamic debugging features */
8 B43legacy_DBG_XMITPOWER,
9 B43legacy_DBG_DMAOVERFLOW,
10 B43legacy_DBG_DMAVERBOSE,
11 B43legacy_DBG_PWORK_FAST,
12 B43legacy_DBG_PWORK_STOP,
13 __B43legacy_NR_DYNDBG,
14};
15
16
17#ifdef CONFIG_B43LEGACY_DEBUG
18
19struct dentry;
20
21#define B43legacy_NR_LOGGED_TXSTATUS 100
22
23struct b43legacy_txstatus_log {
24 struct b43legacy_txstatus *log;
25 int end;
26 spinlock_t lock; /* lock for debugging */
27};
28
29struct b43legacy_dfs_file {
30 struct dentry *dentry;
31 char *buffer;
32 size_t data_len;
33};
34
35struct b43legacy_dfsentry {
36 struct b43legacy_wldev *dev;
37 struct dentry *subdir;
38
39 struct b43legacy_dfs_file file_tsf;
40 struct b43legacy_dfs_file file_ucode_regs;
41 struct b43legacy_dfs_file file_shm;
42 struct b43legacy_dfs_file file_txstat;
43 struct b43legacy_dfs_file file_txpower_g;
44 struct b43legacy_dfs_file file_restart;
45 struct b43legacy_dfs_file file_loctls;
46
47 struct b43legacy_txstatus_log txstatlog;
48
49 /* Enabled/Disabled list for the dynamic debugging features. */
50 bool dyn_debug[__B43legacy_NR_DYNDBG];
51 /* Dentries for the dynamic debugging entries. */
52 struct dentry *dyn_debug_dentries[__B43legacy_NR_DYNDBG];
53};
54
55int b43legacy_debug(struct b43legacy_wldev *dev,
56 enum b43legacy_dyndbg feature);
57
58void b43legacy_debugfs_init(void);
59void b43legacy_debugfs_exit(void);
60void b43legacy_debugfs_add_device(struct b43legacy_wldev *dev);
61void b43legacy_debugfs_remove_device(struct b43legacy_wldev *dev);
62void b43legacy_debugfs_log_txstat(struct b43legacy_wldev *dev,
63 const struct b43legacy_txstatus *status);
64
65#else /* CONFIG_B43LEGACY_DEBUG*/
66
67static inline
68int b43legacy_debug(struct b43legacy_wldev *dev,
69 enum b43legacy_dyndbg feature)
70{
71 return 0;
72}
73
74static inline
75void b43legacy_debugfs_init(void) { }
76static inline
77void b43legacy_debugfs_exit(void) { }
78static inline
79void b43legacy_debugfs_add_device(struct b43legacy_wldev *dev) { }
80static inline
81void b43legacy_debugfs_remove_device(struct b43legacy_wldev *dev) { }
82static inline
83void b43legacy_debugfs_log_txstat(struct b43legacy_wldev *dev,
84 const struct b43legacy_txstatus *status)
85 { }
86
87#endif /* CONFIG_B43LEGACY_DEBUG*/
88
89#endif /* B43legacy_DEBUGFS_H_ */