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
;
23 struct dentry
*dentry_restart
;
25 struct bcm43xx_private
*bcm
;
27 /* saved xmitstatus. */
28 struct bcm43xx_xmitstatus
*xmitstatus_buffer
;
31 /* We need a seperate buffer while printing to avoid
32 * concurrency issues. (New xmitstatus can arrive
33 * while we are printing).
35 struct bcm43xx_xmitstatus
*xmitstatus_print_buffer
;
36 int saved_xmitstatus_ptr
;
37 int saved_xmitstatus_cnt
;
38 int xmitstatus_printing
;
41 struct bcm43xx_debugfs
{
43 struct dentry
*dentry_driverinfo
;
46 void bcm43xx_debugfs_init(void);
47 void bcm43xx_debugfs_exit(void);
48 void bcm43xx_debugfs_add_device(struct bcm43xx_private
*bcm
);
49 void bcm43xx_debugfs_remove_device(struct bcm43xx_private
*bcm
);
50 void bcm43xx_debugfs_log_txstat(struct bcm43xx_private
*bcm
,
51 struct bcm43xx_xmitstatus
*status
);
53 /* Debug helper: Dump binary data through printk. */
54 void bcm43xx_printk_dump(const char *data
,
56 const char *description
);
57 /* Debug helper: Dump bitwise binary data through printk. */
58 void bcm43xx_printk_bitdump(const unsigned char *data
,
59 size_t bytes
, int msb_to_lsb
,
60 const char *description
);
61 #define bcm43xx_printk_bitdumpt(pointer, msb_to_lsb, description) \
63 bcm43xx_printk_bitdump((const unsigned char *)(pointer), \
69 #else /* CONFIG_BCM43XX_DEBUG*/
72 void bcm43xx_debugfs_init(void) { }
74 void bcm43xx_debugfs_exit(void) { }
76 void bcm43xx_debugfs_add_device(struct bcm43xx_private
*bcm
) { }
78 void bcm43xx_debugfs_remove_device(struct bcm43xx_private
*bcm
) { }
80 void bcm43xx_debugfs_log_txstat(struct bcm43xx_private
*bcm
,
81 struct bcm43xx_xmitstatus
*status
) { }
84 void bcm43xx_printk_dump(const char *data
,
86 const char *description
)
90 void bcm43xx_printk_bitdump(const unsigned char *data
,
91 size_t bytes
, int msb_to_lsb
,
92 const char *description
)
95 #define bcm43xx_printk_bitdumpt(pointer, msb_to_lsb, description) do { /* nothing */ } while (0)
97 #endif /* CONFIG_BCM43XX_DEBUG*/
99 /* Ugly helper macros to make incomplete code more verbose on runtime */
105 printk(KERN_INFO PFX "TODO: Incomplete code in %s() at %s:%d\n", \
106 __FUNCTION__, __FILE__, __LINE__); \
114 printk(KERN_INFO PFX "FIXME: Possibly broken code in %s() at %s:%d\n", \
115 __FUNCTION__, __FILE__, __LINE__); \
118 #endif /* BCM43xx_DEBUGFS_H_ */