Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / net / wireless / broadcom / b43 / debugfs.h
blob0bf437c86c67ea214712015f968b7800063e6447
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef B43_DEBUGFS_H_
3 #define B43_DEBUGFS_H_
5 struct b43_wldev;
6 struct b43_txstatus;
8 enum b43_dyndbg { /* Dynamic debugging features */
9 B43_DBG_XMITPOWER,
10 B43_DBG_DMAOVERFLOW,
11 B43_DBG_DMAVERBOSE,
12 B43_DBG_PWORK_FAST,
13 B43_DBG_PWORK_STOP,
14 B43_DBG_LO,
15 B43_DBG_FIRMWARE,
16 B43_DBG_KEYS,
17 B43_DBG_VERBOSESTATS,
18 __B43_NR_DYNDBG,
21 #ifdef CONFIG_B43_DEBUG
23 struct dentry;
25 #define B43_NR_LOGGED_TXSTATUS 100
27 struct b43_txstatus_log {
28 /* This structure is protected by wl->mutex */
30 struct b43_txstatus *log;
31 int end;
34 struct b43_dfs_file {
35 struct dentry *dentry;
36 char *buffer;
37 size_t data_len;
40 struct b43_dfsentry {
41 struct b43_wldev *dev;
42 struct dentry *subdir;
44 struct b43_dfs_file file_shm16read;
45 struct b43_dfs_file file_shm16write;
46 struct b43_dfs_file file_shm32read;
47 struct b43_dfs_file file_shm32write;
48 struct b43_dfs_file file_mmio16read;
49 struct b43_dfs_file file_mmio16write;
50 struct b43_dfs_file file_mmio32read;
51 struct b43_dfs_file file_mmio32write;
52 struct b43_dfs_file file_txstat;
53 struct b43_dfs_file file_txpower_g;
54 struct b43_dfs_file file_restart;
55 struct b43_dfs_file file_loctls;
57 struct b43_txstatus_log txstatlog;
59 /* The cached address for the next mmio16read file read */
60 u16 mmio16read_next;
61 /* The cached address for the next mmio32read file read */
62 u16 mmio32read_next;
64 /* The cached address for the next shm16read file read */
65 u32 shm16read_routing_next;
66 u32 shm16read_addr_next;
67 /* The cached address for the next shm32read file read */
68 u32 shm32read_routing_next;
69 u32 shm32read_addr_next;
71 /* Enabled/Disabled list for the dynamic debugging features. */
72 bool dyn_debug[__B43_NR_DYNDBG];
73 /* Dentries for the dynamic debugging entries. */
74 struct dentry *dyn_debug_dentries[__B43_NR_DYNDBG];
77 bool b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature);
79 void b43_debugfs_init(void);
80 void b43_debugfs_exit(void);
81 void b43_debugfs_add_device(struct b43_wldev *dev);
82 void b43_debugfs_remove_device(struct b43_wldev *dev);
83 void b43_debugfs_log_txstat(struct b43_wldev *dev,
84 const struct b43_txstatus *status);
86 #else /* CONFIG_B43_DEBUG */
88 static inline bool b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature)
90 return false;
93 static inline void b43_debugfs_init(void)
96 static inline void b43_debugfs_exit(void)
99 static inline void b43_debugfs_add_device(struct b43_wldev *dev)
102 static inline void b43_debugfs_remove_device(struct b43_wldev *dev)
105 static inline void b43_debugfs_log_txstat(struct b43_wldev *dev,
106 const struct b43_txstatus *status)
110 #endif /* CONFIG_B43_DEBUG */
112 #endif /* B43_DEBUGFS_H_ */