1
2
3
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 \
23 \
24 \
25 OZ_DBG_HUB | \
26 \
27 \
28 0)
29
30extern 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, ...) \
37do { \
38 if (oz_want_dbg(mask)) \
39 pr_debug(fmt, ##__VA_ARGS__); \
40} while (0)
41
42#define oz_cdev_dbg(cdev, mask, fmt, ...) \
43do { \
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, ...) \
49do { \
50 if (oz_want_dbg(mask)) \
51 pr_debug(fmt, ##__VA_ARGS__); \
52} while (0)
53
54#endif
55