1 #ifndef BCM43xx_DEBUGFS_H_
2 #define BCM43xx_DEBUGFS_H_
4 struct bcm43xx_private;
5 struct bcm43xx_xmitstatus;
7 #ifdef CONFIG_BCM43XX_DEBUG
9 #include <linux/list.h>
10 #include <asm/semaphore.h>
14 /* limited by the size of the "really_big_buffer" */
15 #define BCM43xx_NR_LOGGED_XMITSTATUS 100
17 struct bcm43xx_dfsentry {
18 struct dentry *subdir;
19 struct dentry *dentry_devinfo;
20 struct dentry *dentry_spromdump;
21 struct dentry *dentry_tsf;
22 struct dentry *dentry_txstat;
24 struct bcm43xx_private *bcm;
26 /* saved xmitstatus. */
27 struct bcm43xx_xmitstatus *xmitstatus_buffer;
30 /* We need a seperate buffer while printing to avoid
31 * concurrency issues. (New xmitstatus can arrive
32 * while we are printing).
34 struct bcm43xx_xmitstatus *xmitstatus_print_buffer;
35 int saved_xmitstatus_ptr;
36 int saved_xmitstatus_cnt;
37 int xmitstatus_printing;
40 struct bcm43xx_debugfs {
42 struct dentry *dentry_driverinfo;
45 void bcm43xx_debugfs_init(void);
46 void bcm43xx_debugfs_exit(void);
47 void bcm43xx_debugfs_add_device(struct bcm43xx_private *bcm);
48 void bcm43xx_debugfs_remove_device(struct bcm43xx_private *bcm);
49 void bcm43xx_debugfs_log_txstat(struct bcm43xx_private *bcm,
50 struct bcm43xx_xmitstatus *status);
52 /* Debug helper: Dump binary data through printk. */
53 void bcm43xx_printk_dump(const char *data,
55 const char *description);
56 /* Debug helper: Dump bitwise binary data through printk. */
57 void bcm43xx_printk_bitdump(const unsigned char *data,
58 size_t bytes, int msb_to_lsb,
59 const char *description);
60 #define bcm43xx_printk_bitdumpt(pointer, msb_to_lsb, description) \
62 bcm43xx_printk_bitdump((const unsigned char *)(pointer), \
68 #else /* CONFIG_BCM43XX_DEBUG*/
71 void bcm43xx_debugfs_init(void) { }
73 void bcm43xx_debugfs_exit(void) { }
75 void bcm43xx_debugfs_add_device(struct bcm43xx_private *bcm) { }
77 void bcm43xx_debugfs_remove_device(struct bcm43xx_private *bcm) { }
79 void bcm43xx_debugfs_log_txstat(struct bcm43xx_private *bcm,
80 struct bcm43xx_xmitstatus *status) { }
83 void bcm43xx_printk_dump(const char *data,
85 const char *description)
89 void bcm43xx_printk_bitdump(const unsigned char *data,
90 size_t bytes, int msb_to_lsb,
91 const char *description)
94 #define bcm43xx_printk_bitdumpt(pointer, msb_to_lsb, description) do { /* nothing */ } while (0)
96 #endif /* CONFIG_BCM43XX_DEBUG*/
98 /* Ugly helper macros to make incomplete code more verbose on runtime */
104 printk(KERN_INFO PFX "TODO: Incomplete code in %s() at %s:%d\n", \
105 __FUNCTION__, __FILE__, __LINE__); \
113 printk(KERN_INFO PFX "FIXME: Possibly broken code in %s() at %s:%d\n", \
114 __FUNCTION__, __FILE__, __LINE__); \
117 #endif /* BCM43xx_DEBUGFS_H_ */