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_DMAVERBOSE
,
11 BCM43xx_DBG_PWORK_FAST
,
12 BCM43xx_DBG_PWORK_STOP
,
17 #ifdef CONFIG_BCM43XX_MAC80211_DEBUG
21 #define BCM43xx_NR_LOGGED_TXSTATUS 100
23 struct bcm43xx_txstatus_log
{
24 struct bcm43xx_txstatus
*log
;
27 char printbuf
[(BCM43xx_NR_LOGGED_TXSTATUS
* 70) + 200];
32 struct bcm43xx_dfsentry
{
33 struct dentry
*subdir
;
34 struct dentry
*dentry_tsf
;
35 struct dentry
*dentry_txstat
;
36 struct dentry
*dentry_txpower_g
;
37 struct dentry
*dentry_restart
;
39 struct bcm43xx_wldev
*dev
;
41 struct bcm43xx_txstatus_log txstatlog
;
43 /* Enabled/Disabled list for the dynamic debugging features. */
44 u32 dyn_debug
[__BCM43xx_NR_DYNDBG
];
45 /* Dentries for the dynamic debugging entries. */
46 struct dentry
*dyn_debug_dentries
[__BCM43xx_NR_DYNDBG
];
49 struct bcm43xx_debugfs
{
51 struct dentry
*dentry_driverinfo
;
54 int bcm43xx_debug(struct bcm43xx_wldev
*dev
, enum bcm43xx_dyndbg feature
);
56 void bcm43xx_debugfs_init(void);
57 void bcm43xx_debugfs_exit(void);
58 void bcm43xx_debugfs_add_device(struct bcm43xx_wldev
*dev
);
59 void bcm43xx_debugfs_remove_device(struct bcm43xx_wldev
*dev
);
60 void bcm43xx_debugfs_log_txstat(struct bcm43xx_wldev
*dev
,
61 const struct bcm43xx_txstatus
*status
);
63 /* Debug helper: Dump binary data through printk. */
64 void bcm43xx_printk_dump(const char *data
,
66 const char *description
);
67 /* Debug helper: Dump bitwise binary data through printk. */
68 void bcm43xx_printk_bitdump(const unsigned char *data
,
69 size_t bytes
, int msb_to_lsb
,
70 const char *description
);
71 #define bcm43xx_printk_bitdumpt(pointer, msb_to_lsb, description) \
73 bcm43xx_printk_bitdump((const unsigned char *)(pointer), \
79 #else /* CONFIG_BCM43XX_MAC80211_DEBUG*/
82 int bcm43xx_debug(struct bcm43xx_wldev
*dev
, enum bcm43xx_dyndbg feature
)
88 void bcm43xx_debugfs_init(void) { }
90 void bcm43xx_debugfs_exit(void) { }
92 void bcm43xx_debugfs_add_device(struct bcm43xx_wldev
*dev
) { }
94 void bcm43xx_debugfs_remove_device(struct bcm43xx_wldev
*dev
) { }
96 void bcm43xx_debugfs_log_txstat(struct bcm43xx_wldev
*dev
,
97 const struct bcm43xx_txstatus
*status
) { }
100 void bcm43xx_printk_dump(const char *data
,
102 const char *description
)
106 void bcm43xx_printk_bitdump(const unsigned char *data
,
107 size_t bytes
, int msb_to_lsb
,
108 const char *description
)
111 #define bcm43xx_printk_bitdumpt(pointer, msb_to_lsb, description) do { /* nothing */ } while (0)
113 #endif /* CONFIG_BCM43XX_MAC80211_DEBUG*/
115 /* Ugly helper macros to make incomplete code more verbose on runtime */
121 printk(KERN_INFO PFX "TODO: Incomplete code in %s() at %s:%d\n", \
122 __FUNCTION__, __FILE__, __LINE__); \
130 printk(KERN_INFO PFX "FIXME: Possibly broken code in %s() at %s:%d\n", \
131 __FUNCTION__, __FILE__, __LINE__); \
134 #endif /* BCM43xx_DEBUGFS_H_ */