Sync with trunk head (part 1 of 2)
[reactos.git] / drivers / usb / nt4compat / usbdriver / debug.h
1 #ifndef _UHCIDBG_H_
2 #define _UHCIDBG_H_
3
4 #define DBGLVL_OFF 0 // if gDebugLevel set to this, there is NO debug output
5 #define DBGLVL_MINIMUM 1 // minimum verbosity
6 #define DBGLVL_DEFAULT 2 // default verbosity level if no registry override
7 #define DBGLVL_MEDIUM 3 // medium verbosity
8 #define DBGLVL_HIGH 4 // highest 'safe' level (without severely affecting timing )
9 #define DBGLVL_MAXIMUM 5 // maximum level, may be dangerous
10 #define DBGLVL_ULTRA 6 // ultra, prints hell lots of stuff from ISR/allocs/etc
11
12 #ifndef DBGSTR_PREFIX
13 #define DBGSTR_PREFIX "wood_uhci: "
14 #endif
15
16 #define DEBUG_UHCI TRUE
17 #define DEBUG_HUB TRUE
18 #define DEBUG_DEV_MGR TRUE
19
20 #define DPRINT DbgPrint
21
22
23 #define UHCI_DBGOUTSIZE 512
24
25 #define hcd_dbg_print_cond( ilev, cond, _x_) \
26 if( debug_level && ( ilev <= debug_level ) && ( cond )) { \
27 DPRINT( DBGSTR_PREFIX ); \
28 DPRINT _x_ ; \
29 }
30
31 #define hcd_dbg_print( ilev, _x_) hcd_dbg_print_cond( ilev, TRUE, _x_ )
32
33 extern ULONG debug_level;
34
35 #if DBG
36
37 #define uhci_dbg_print_cond( ilev, cond, _x_ ) hcd_dbg_print_cond( ilev, cond, _x_ )
38 #define uhci_dbg_print( ilev, _x_) hcd_dbg_print_cond( ilev, TRUE, _x_ )
39
40 #define uhci_trap_cond( ilev, cond ) if ( debug_level && ( ilev <= debug_level ) && (cond) ) TRAP()
41 #define uhci_trap( ilev ) uhci_trap_cond( ilev, TRUE )
42
43
44 #define uhci_assert( cond ) ASSERT( cond )
45 #define dbg_count_list( _x_ ) usb_count_list( _x_ )
46
47 #define TRAP() DbgBreakPoint()
48
49 #else // if not DBG
50
51 // dummy definitions that go away in the retail build
52
53 #define uhci_dbg_print_cond( ilev, cond, _x_ )
54 #define uhci_dbg_print( ilev, _x_)
55 #define uhci_trap_cont( ilev, cond )
56 #define uhci_trap( ilev )
57 #define uhci_assert( cond )
58 #define TRAP()
59 #define dbg_count_list( _x_ ) 0
60
61 #endif //DBG
62
63 #define usb_dbg_print( ilev, _x_ ) uhci_dbg_print( ilev, _x_ )
64 #define ehci_dbg_print( ilev, _x_ ) uhci_dbg_print( ilev, _x_ )
65 #define ohci_dbg_print( ilev, _x_ ) uhci_dbg_print( ilev, _x_ )
66 #define ehci_dbg_print_cond( ilev, cond, _x_ ) uhci_dbg_print_cond( ilev, cond, _x_ )
67
68 #define DO_NOTHING
69
70 LONG usb_count_list( struct _LIST_ENTRY* list_head );
71 #endif // included