PM / sleep: Asynchronous threads for suspend_noirq
[linux/fpc-iii.git] / drivers / staging / ozwpan / ozdbg.h
blobb86a2b7e0178779f5d6bdfd404971a1910c1e0fe
1 /* -----------------------------------------------------------------------------
2 * Copyright (c) 2011 Ozmo Inc
3 * Released under the GNU General Public License Version 2 (GPLv2).
4 * ---------------------------------------------------------------------------*/
6 #ifndef _OZDBG_H
7 #define _OZDBG_H
9 #define OZ_WANT_DBG 0
10 #define OZ_WANT_VERBOSE_DBG 1
12 #define OZ_DBG_ON 0x0
13 #define OZ_DBG_STREAM 0x1
14 #define OZ_DBG_URB 0x2
15 #define OZ_DBG_CTRL_DETAIL 0x4
16 #define OZ_DBG_HUB 0x8
17 #define OZ_DBG_RX_FRAMES 0x10
18 #define OZ_DBG_TX_FRAMES 0x20
20 #define OZ_DEFAULT_DBG_MASK \
21 ( \
22 /* OZ_DBG_STREAM | */ \
23 /* OZ_DBG_URB | */ \
24 /* OZ_DBG_CTRL_DETAIL | */ \
25 OZ_DBG_HUB | \
26 /* OZ_DBG_RX_FRAMES | */ \
27 /* OZ_DBG_TX_FRAMES | */ \
30 extern unsigned int oz_dbg_mask;
32 #define oz_want_dbg(mask) \
33 ((OZ_WANT_DBG && (OZ_DBG_##mask == OZ_DBG_ON)) || \
34 (OZ_WANT_VERBOSE_DBG && (OZ_DBG_##mask & oz_dbg_mask)))
36 #define oz_dbg(mask, fmt, ...) \
37 do { \
38 if (oz_want_dbg(mask)) \
39 pr_debug(fmt, ##__VA_ARGS__); \
40 } while (0)
42 #define oz_cdev_dbg(cdev, mask, fmt, ...) \
43 do { \
44 if (oz_want_dbg(mask)) \
45 netdev_dbg((cdev)->dev, fmt, ##__VA_ARGS__); \
46 } while (0)
48 #define oz_pd_dbg(pd, mask, fmt, ...) \
49 do { \
50 if (oz_want_dbg(mask)) \
51 pr_debug(fmt, ##__VA_ARGS__); \
52 } while (0)
54 #endif /* _OZDBG_H */