1 #ifndef BCM43xx_DEBUGFS_H_
2 #define BCM43xx_DEBUGFS_H_
5 struct bcm43xx_txstatus;
7 enum bcm43xx_dyndbg { /* Dynamic debugging features */
9 BCM43xx_DBG_DMAOVERFLOW,
10 BCM43xx_DBG_PWORK_FAST,
11 BCM43xx_DBG_PWORK_STOP,
16 #ifdef CONFIG_BCM43XX_MAC80211_DEBUG
20 #define BCM43xx_NR_LOGGED_TXSTATUS 100
22 struct bcm43xx_txstatus_log {
23 struct bcm43xx_txstatus *log;
26 char printbuf[(BCM43xx_NR_LOGGED_TXSTATUS * 70) + 200];
31 struct bcm43xx_dfsentry {
32 struct dentry *subdir;
33 struct dentry *dentry_tsf;
34 struct dentry *dentry_txstat;
35 struct dentry *dentry_txpower_g;
36 struct dentry *dentry_restart;
38 struct bcm43xx_wldev *dev;
40 struct bcm43xx_txstatus_log txstatlog;
42 /* Enabled/Disabled list for the dynamic debugging features. */
43 u32 dyn_debug[__BCM43xx_NR_DYNDBG];
44 /* Dentries for the dynamic debugging entries. */
45 struct dentry *dyn_debug_dentries[__BCM43xx_NR_DYNDBG];
48 struct bcm43xx_debugfs {
50 struct dentry *dentry_driverinfo;
53 int bcm43xx_debug(struct bcm43xx_wldev *dev, enum bcm43xx_dyndbg feature);
55 void bcm43xx_debugfs_init(void);
56 void bcm43xx_debugfs_exit(void);
57 void bcm43xx_debugfs_add_device(struct bcm43xx_wldev *dev);
58 void bcm43xx_debugfs_remove_device(struct bcm43xx_wldev *dev);
59 void bcm43xx_debugfs_log_txstat(struct bcm43xx_wldev *dev,
60 const struct bcm43xx_txstatus *status);
62 /* Debug helper: Dump binary data through printk. */
63 void bcm43xx_printk_dump(const char *data,
65 const char *description);
66 /* Debug helper: Dump bitwise binary data through printk. */
67 void bcm43xx_printk_bitdump(const unsigned char *data,
68 size_t bytes, int msb_to_lsb,
69 const char *description);
70 #define bcm43xx_printk_bitdumpt(pointer, msb_to_lsb, description) \
72 bcm43xx_printk_bitdump((const unsigned char *)(pointer), \
78 #else /* CONFIG_BCM43XX_MAC80211_DEBUG*/
81 int bcm43xx_debug(struct bcm43xx_wldev *dev, enum bcm43xx_dyndbg feature)
87 void bcm43xx_debugfs_init(void) { }
89 void bcm43xx_debugfs_exit(void) { }
91 void bcm43xx_debugfs_add_device(struct bcm43xx_wldev *dev) { }
93 void bcm43xx_debugfs_remove_device(struct bcm43xx_wldev *dev) { }
95 void bcm43xx_debugfs_log_txstat(struct bcm43xx_wldev *dev,
96 const struct bcm43xx_txstatus *status) { }
99 void bcm43xx_printk_dump(const char *data,
101 const char *description)
105 void bcm43xx_printk_bitdump(const unsigned char *data,
106 size_t bytes, int msb_to_lsb,
107 const char *description)
110 #define bcm43xx_printk_bitdumpt(pointer, msb_to_lsb, description) do { /* nothing */ } while (0)
112 #endif /* CONFIG_BCM43XX_MAC80211_DEBUG*/
114 /* Ugly helper macros to make incomplete code more verbose on runtime */
120 printk(KERN_INFO PFX "TODO: Incomplete code in %s() at %s:%d\n", \
121 __FUNCTION__, __FILE__, __LINE__); \
129 printk(KERN_INFO PFX "FIXME: Possibly broken code in %s() at %s:%d\n", \
130 __FUNCTION__, __FILE__, __LINE__); \
133 #endif /* BCM43xx_DEBUGFS_H_ */