Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / net / wireless / broadcom / b43legacy / debugfs.h
blob7a37764406b1b661397e81a6679e6c10f8c48bce
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef B43legacy_DEBUGFS_H_
3 #define B43legacy_DEBUGFS_H_
5 struct b43legacy_wldev;
6 struct b43legacy_txstatus;
8 enum 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,
18 #ifdef CONFIG_B43LEGACY_DEBUG
20 struct dentry;
22 #define B43legacy_NR_LOGGED_TXSTATUS 100
24 struct b43legacy_txstatus_log {
25 struct b43legacy_txstatus *log;
26 int end;
27 spinlock_t lock; /* lock for debugging */
30 struct b43legacy_dfs_file {
31 struct dentry *dentry;
32 char *buffer;
33 size_t data_len;
36 struct b43legacy_dfsentry {
37 struct b43legacy_wldev *dev;
38 struct dentry *subdir;
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;
48 struct b43legacy_txstatus_log txstatlog;
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];
56 int b43legacy_debug(struct b43legacy_wldev *dev,
57 enum b43legacy_dyndbg feature);
59 void b43legacy_debugfs_init(void);
60 void b43legacy_debugfs_exit(void);
61 void b43legacy_debugfs_add_device(struct b43legacy_wldev *dev);
62 void b43legacy_debugfs_remove_device(struct b43legacy_wldev *dev);
63 void b43legacy_debugfs_log_txstat(struct b43legacy_wldev *dev,
64 const struct b43legacy_txstatus *status);
66 #else /* CONFIG_B43LEGACY_DEBUG*/
68 static inline
69 int b43legacy_debug(struct b43legacy_wldev *dev,
70 enum b43legacy_dyndbg feature)
72 return 0;
75 static inline
76 void b43legacy_debugfs_init(void) { }
77 static inline
78 void b43legacy_debugfs_exit(void) { }
79 static inline
80 void b43legacy_debugfs_add_device(struct b43legacy_wldev *dev) { }
81 static inline
82 void b43legacy_debugfs_remove_device(struct b43legacy_wldev *dev) { }
83 static inline
84 void b43legacy_debugfs_log_txstat(struct b43legacy_wldev *dev,
85 const struct b43legacy_txstatus *status)
86 { }
88 #endif /* CONFIG_B43LEGACY_DEBUG*/
90 #endif /* B43legacy_DEBUGFS_H_ */