[HAL]
[reactos.git] / reactos / drivers / network / ndis / include / debug.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS NDIS library
4 * FILE: include/debug.h
5 * PURPOSE: Debugging support macros
6 * DEFINES: DBG - Enable debug output
7 */
8
9 #pragma once
10
11 #define NORMAL_MASK 0x000000FF
12 #define SPECIAL_MASK 0xFFFFFF00
13 #define MIN_TRACE 0x00000001
14 #define MID_TRACE 0x00000002
15 #define MAX_TRACE 0x00000003
16
17 #define DEBUG_MINIPORT 0x00000200
18 #define DEBUG_PROTOCOL 0x00000400
19 #define DEBUG_PACKET 0x00000800
20 #define DEBUG_ULTRA 0xFFFFFFFF
21
22 #if DBG
23
24 extern ULONG DebugTraceLevel;
25
26 #ifdef _MSC_VER
27
28 #define NDIS_DbgPrint(_t_, _x_) \
29 if (((DebugTraceLevel & NORMAL_MASK) >= _t_) || \
30 ((DebugTraceLevel & _t_) > NORMAL_MASK)) { \
31 DbgPrint("(%s:%d) ", __FILE__, __LINE__); \
32 DbgPrint _x_ ; \
33 }
34
35 #else /* _MSC_VER */
36
37 #define NDIS_DbgPrint(_t_, _x_) \
38 if (((DebugTraceLevel & NORMAL_MASK) >= _t_) || \
39 ((DebugTraceLevel & _t_) > NORMAL_MASK)) { \
40 DbgPrint("(%s:%d)(%s) ", __FILE__, __LINE__, __FUNCTION__); \
41 DbgPrint _x_ ; \
42 }
43
44 #endif /* _MSC_VER */
45
46 #define ASSERT_IRQL(x) ASSERT(KeGetCurrentIrql() <= (x))
47
48 #else /* DBG */
49
50 #define NDIS_DbgPrint(_t_, _x_)
51
52 #define ASSERT_IRQL(x)
53 /*#define ASSERT(x)*/
54
55 #endif /* DBG */
56
57
58 #define assert(x) ASSERT(x)
59 #define assert_irql(x) ASSERT_IRQL(x)
60
61
62 #define UNIMPLEMENTED \
63 NDIS_DbgPrint(MIN_TRACE, ("Unimplemented.\n", __FUNCTION__));
64
65
66 #define CHECKPOINT \
67 do { NDIS_DbgPrint(MIN_TRACE, ("\n")); } while(0);
68
69 #define CP CHECKPOINT
70
71 /* EOF */