Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef B43legacy_DEBUGFS_H_
0003 #define B43legacy_DEBUGFS_H_
0004 
0005 struct b43legacy_wldev;
0006 struct b43legacy_txstatus;
0007 
0008 enum b43legacy_dyndbg { /* Dynamic debugging features */
0009     B43legacy_DBG_XMITPOWER,
0010     B43legacy_DBG_DMAOVERFLOW,
0011     B43legacy_DBG_DMAVERBOSE,
0012     B43legacy_DBG_PWORK_FAST,
0013     B43legacy_DBG_PWORK_STOP,
0014     __B43legacy_NR_DYNDBG,
0015 };
0016 
0017 
0018 #ifdef CONFIG_B43LEGACY_DEBUG
0019 
0020 struct dentry;
0021 
0022 #define B43legacy_NR_LOGGED_TXSTATUS    100
0023 
0024 struct b43legacy_txstatus_log {
0025     struct b43legacy_txstatus *log;
0026     int end;
0027     spinlock_t lock;    /* lock for debugging */
0028 };
0029 
0030 struct b43legacy_dfs_file {
0031     char *buffer;
0032     size_t data_len;
0033 };
0034 
0035 struct b43legacy_dfsentry {
0036     struct b43legacy_wldev *dev;
0037     struct dentry *subdir;
0038 
0039     struct b43legacy_dfs_file file_tsf;
0040     struct b43legacy_dfs_file file_ucode_regs;
0041     struct b43legacy_dfs_file file_shm;
0042     struct b43legacy_dfs_file file_txstat;
0043     struct b43legacy_dfs_file file_txpower_g;
0044     struct b43legacy_dfs_file file_restart;
0045     struct b43legacy_dfs_file file_loctls;
0046 
0047     struct b43legacy_txstatus_log txstatlog;
0048 
0049     /* Enabled/Disabled list for the dynamic debugging features. */
0050     bool dyn_debug[__B43legacy_NR_DYNDBG];
0051 };
0052 
0053 int b43legacy_debug(struct b43legacy_wldev *dev,
0054             enum b43legacy_dyndbg feature);
0055 
0056 void b43legacy_debugfs_init(void);
0057 void b43legacy_debugfs_exit(void);
0058 void b43legacy_debugfs_add_device(struct b43legacy_wldev *dev);
0059 void b43legacy_debugfs_remove_device(struct b43legacy_wldev *dev);
0060 void b43legacy_debugfs_log_txstat(struct b43legacy_wldev *dev,
0061                   const struct b43legacy_txstatus *status);
0062 
0063 #else /* CONFIG_B43LEGACY_DEBUG*/
0064 
0065 static inline
0066 int b43legacy_debug(struct b43legacy_wldev *dev,
0067             enum b43legacy_dyndbg feature)
0068 {
0069     return 0;
0070 }
0071 
0072 static inline
0073 void b43legacy_debugfs_init(void) { }
0074 static inline
0075 void b43legacy_debugfs_exit(void) { }
0076 static inline
0077 void b43legacy_debugfs_add_device(struct b43legacy_wldev *dev) { }
0078 static inline
0079 void b43legacy_debugfs_remove_device(struct b43legacy_wldev *dev) { }
0080 static inline
0081 void b43legacy_debugfs_log_txstat(struct b43legacy_wldev *dev,
0082                   const struct b43legacy_txstatus *status)
0083                   { }
0084 
0085 #endif /* CONFIG_B43LEGACY_DEBUG*/
0086 
0087 #endif /* B43legacy_DEBUGFS_H_ */