Committer: Michael Beasley <mike@snafu.setup>
[mikesnafu-overlay.git] / drivers / net / wireless / bcm43xx / bcm43xx_debugfs.h
bloba40d1af355452eca3ec1d16fb967a58a2ca847c7
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>
12 struct dentry;
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;
29 int xmitstatus_ptr;
30 int xmitstatus_cnt;
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 {
42 struct dentry *root;
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,
55 size_t size,
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) \
62 do { \
63 bcm43xx_printk_bitdump((const unsigned char *)(pointer), \
64 sizeof(*(pointer)), \
65 (msb_to_lsb), \
66 (description)); \
67 } while (0)
69 #else /* CONFIG_BCM43XX_DEBUG*/
71 static inline
72 void bcm43xx_debugfs_init(void) { }
73 static inline
74 void bcm43xx_debugfs_exit(void) { }
75 static inline
76 void bcm43xx_debugfs_add_device(struct bcm43xx_private *bcm) { }
77 static inline
78 void bcm43xx_debugfs_remove_device(struct bcm43xx_private *bcm) { }
79 static inline
80 void bcm43xx_debugfs_log_txstat(struct bcm43xx_private *bcm,
81 struct bcm43xx_xmitstatus *status) { }
83 static inline
84 void bcm43xx_printk_dump(const char *data,
85 size_t size,
86 const char *description)
89 static inline
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 */
100 #ifdef TODO
101 # undef TODO
102 #endif
103 #define TODO() \
104 do { \
105 printk(KERN_INFO PFX "TODO: Incomplete code in %s() at %s:%d\n", \
106 __FUNCTION__, __FILE__, __LINE__); \
107 } while (0)
109 #ifdef FIXME
110 # undef FIXME
111 #endif
112 #define FIXME() \
113 do { \
114 printk(KERN_INFO PFX "FIXME: Possibly broken code in %s() at %s:%d\n", \
115 __FUNCTION__, __FILE__, __LINE__); \
116 } while (0)
118 #endif /* BCM43xx_DEBUGFS_H_ */