Add the rt linux 4.1.3-rt3 as base
[kvmfornfv.git] / kernel / drivers / staging / ozwpan / ozdbg.h
1 /* -----------------------------------------------------------------------------
2  * Copyright (c) 2011 Ozmo Inc
3  * Released under the GNU General Public License Version 2 (GPLv2).
4  * ---------------------------------------------------------------------------*/
5
6 #ifndef _OZDBG_H
7 #define _OZDBG_H
8
9 #define OZ_WANT_DBG 0
10 #define OZ_WANT_VERBOSE_DBG 1
11
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
19
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 | */                \
28         0)
29
30 extern unsigned int oz_dbg_mask;
31
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)))
35
36 #define oz_dbg(mask, fmt, ...)                                          \
37 do {                                                                    \
38         if (oz_want_dbg(mask))                                          \
39                 pr_debug(fmt, ##__VA_ARGS__);                           \
40 } while (0)
41
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)
47
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)
53
54 #endif /* _OZDBG_H */