| Michael Buesch | e4d6b79 | 2007-09-18 15:39:42 -0400 | [diff] [blame] | 1 | #ifndef B43_DEBUGFS_H_ | 
 | 2 | #define B43_DEBUGFS_H_ | 
 | 3 |  | 
 | 4 | struct b43_wldev; | 
 | 5 | struct b43_txstatus; | 
 | 6 |  | 
 | 7 | enum 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 Buesch | f5eda47 | 2008-04-20 16:03:32 +0200 | [diff] [blame] | 13 | 	B43_DBG_LO, | 
| Michael Buesch | 923fd70 | 2008-06-20 18:02:08 +0200 | [diff] [blame] | 14 | 	B43_DBG_FIRMWARE, | 
| Michael Buesch | e4d6b79 | 2007-09-18 15:39:42 -0400 | [diff] [blame] | 15 | 	__B43_NR_DYNDBG, | 
 | 16 | }; | 
 | 17 |  | 
 | 18 | #ifdef CONFIG_B43_DEBUG | 
 | 19 |  | 
 | 20 | struct dentry; | 
 | 21 |  | 
 | 22 | #define B43_NR_LOGGED_TXSTATUS	100 | 
 | 23 |  | 
 | 24 | struct b43_txstatus_log { | 
 | 25 | 	struct b43_txstatus *log; | 
 | 26 | 	int end; | 
 | 27 | 	spinlock_t lock; | 
 | 28 | }; | 
 | 29 |  | 
 | 30 | struct b43_dfs_file { | 
 | 31 | 	struct dentry *dentry; | 
 | 32 | 	char *buffer; | 
 | 33 | 	size_t data_len; | 
 | 34 | }; | 
 | 35 |  | 
 | 36 | struct b43_dfsentry { | 
 | 37 | 	struct b43_wldev *dev; | 
 | 38 | 	struct dentry *subdir; | 
 | 39 |  | 
| Michael Buesch | 6bbc321 | 2008-06-19 19:33:51 +0200 | [diff] [blame] | 40 | 	struct b43_dfs_file file_shm16read; | 
 | 41 | 	struct b43_dfs_file file_shm16write; | 
 | 42 | 	struct b43_dfs_file file_shm32read; | 
 | 43 | 	struct b43_dfs_file file_shm32write; | 
| Michael Buesch | 8bd463f | 2008-06-19 00:35:49 +0200 | [diff] [blame] | 44 | 	struct b43_dfs_file file_mmio16read; | 
 | 45 | 	struct b43_dfs_file file_mmio16write; | 
 | 46 | 	struct b43_dfs_file file_mmio32read; | 
 | 47 | 	struct b43_dfs_file file_mmio32write; | 
| Michael Buesch | e4d6b79 | 2007-09-18 15:39:42 -0400 | [diff] [blame] | 48 | 	struct b43_dfs_file file_tsf; | 
| Michael Buesch | e4d6b79 | 2007-09-18 15:39:42 -0400 | [diff] [blame] | 49 | 	struct b43_dfs_file file_txstat; | 
 | 50 | 	struct b43_dfs_file file_txpower_g; | 
 | 51 | 	struct b43_dfs_file file_restart; | 
 | 52 | 	struct b43_dfs_file file_loctls; | 
 | 53 |  | 
 | 54 | 	struct b43_txstatus_log txstatlog; | 
 | 55 |  | 
| Michael Buesch | 8bd463f | 2008-06-19 00:35:49 +0200 | [diff] [blame] | 56 | 	/* The cached address for the next mmio16read file read */ | 
 | 57 | 	u16 mmio16read_next; | 
 | 58 | 	/* The cached address for the next mmio32read file read */ | 
 | 59 | 	u16 mmio32read_next; | 
 | 60 |  | 
| Michael Buesch | 6bbc321 | 2008-06-19 19:33:51 +0200 | [diff] [blame] | 61 | 	/* The cached address for the next shm16read file read */ | 
 | 62 | 	u32 shm16read_routing_next; | 
 | 63 | 	u32 shm16read_addr_next; | 
 | 64 | 	/* The cached address for the next shm32read file read */ | 
 | 65 | 	u32 shm32read_routing_next; | 
 | 66 | 	u32 shm32read_addr_next; | 
 | 67 |  | 
| Michael Buesch | e4d6b79 | 2007-09-18 15:39:42 -0400 | [diff] [blame] | 68 | 	/* Enabled/Disabled list for the dynamic debugging features. */ | 
 | 69 | 	u32 dyn_debug[__B43_NR_DYNDBG]; | 
 | 70 | 	/* Dentries for the dynamic debugging entries. */ | 
 | 71 | 	struct dentry *dyn_debug_dentries[__B43_NR_DYNDBG]; | 
 | 72 | }; | 
 | 73 |  | 
 | 74 | int b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature); | 
 | 75 |  | 
 | 76 | void b43_debugfs_init(void); | 
 | 77 | void b43_debugfs_exit(void); | 
 | 78 | void b43_debugfs_add_device(struct b43_wldev *dev); | 
 | 79 | void b43_debugfs_remove_device(struct b43_wldev *dev); | 
 | 80 | void b43_debugfs_log_txstat(struct b43_wldev *dev, | 
 | 81 | 			    const struct b43_txstatus *status); | 
 | 82 |  | 
 | 83 | #else /* CONFIG_B43_DEBUG */ | 
 | 84 |  | 
 | 85 | static inline int b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature) | 
 | 86 | { | 
 | 87 | 	return 0; | 
 | 88 | } | 
 | 89 |  | 
 | 90 | static inline void b43_debugfs_init(void) | 
 | 91 | { | 
 | 92 | } | 
 | 93 | static inline void b43_debugfs_exit(void) | 
 | 94 | { | 
 | 95 | } | 
 | 96 | static inline void b43_debugfs_add_device(struct b43_wldev *dev) | 
 | 97 | { | 
 | 98 | } | 
 | 99 | static inline void b43_debugfs_remove_device(struct b43_wldev *dev) | 
 | 100 | { | 
 | 101 | } | 
 | 102 | static inline void b43_debugfs_log_txstat(struct b43_wldev *dev, | 
 | 103 | 					  const struct b43_txstatus *status) | 
 | 104 | { | 
 | 105 | } | 
 | 106 |  | 
 | 107 | #endif /* CONFIG_B43_DEBUG */ | 
 | 108 |  | 
 | 109 | #endif /* B43_DEBUGFS_H_ */ |