3 Copyright (C) Microsoft Corporation, 1991 - 1999
27 VOID
ClassDebugPrint(CLASS_DEBUG_LEVEL DebugPrintLevel
, PCCHAR DebugMessage
, ...);
31 typedef struct _CLASSPNP_GLOBALS
{
34 // whether or not to ASSERT for lost irps
37 ULONG BreakOnLostIrps
;
38 ULONG SecondsToWaitForIrps
;
41 // use a buffered debug print to help
42 // catch timing issues that do not
43 // reproduce with std debugprints enabled
46 ULONG UseBufferedDebugPrint
;
47 ULONG UseDelayedRetry
;
50 // the next four are the buffered printing support
51 // (currently unimplemented) and require the spinlock
55 ULONG Index
; // index into buffer
57 PSTR Buffer
; // requires spinlock to access
58 ULONG NumberOfBuffers
; // number of buffers available
59 SIZE_T EachBufferSize
; // size of each buffer
62 // interlocked variables to initialize
63 // this data only once
69 } CLASSPNP_GLOBALS
, *PCLASSPNP_GLOBALS
;
71 #define DBGTRACE(dbgTraceLevel, args_in_parens) \
72 if (ClassDebug & (1 << (dbgTraceLevel+15))){ \
73 DbgPrint("CLASSPNP> *** TRACE *** (file %s, line %d)\n", __FILE__, __LINE__ ); \
75 DbgPrint args_in_parens; \
77 if (DebugTrapOnWarn && (dbgTraceLevel == ClassDebugWarning)){ \
81 #define DBGWARN(args_in_parens) \
83 DbgPrint("CLASSPNP> *** WARNING *** (file %s, line %d)\n", __FILE__, __LINE__ ); \
85 DbgPrint args_in_parens; \
87 if (DebugTrapOnWarn){ \
91 #define DBGERR(args_in_parens) \
93 DbgPrint("CLASSPNP> *** ERROR *** (file %s, line %d)\n", __FILE__, __LINE__ ); \
95 DbgPrint args_in_parens; \
99 #define DBGTRAP(args_in_parens) \
101 DbgPrint("CLASSPNP> *** COVERAGE TRAP *** (file %s, line %d)\n", __FILE__, __LINE__ ); \
103 DbgPrint args_in_parens; \
109 #define DBGGETIOCTLSTR(_ioctl) DbgGetIoctlStr(_ioctl)
110 #define DBGGETSCSIOPSTR(_pSrb) DbgGetScsiOpStr(_pSrb)
111 #define DBGGETSENSECODESTR(_pSrb) DbgGetSenseCodeStr(_pSrb)
112 #define DBGGETADSENSECODESTR(_pSrb) DbgGetAdditionalSenseCodeStr(_pSrb)
113 #define DBGGETADSENSEQUALIFIERSTR(_pSrb) DbgGetAdditionalSenseCodeQualifierStr(_pSrb)
114 #define DBGCHECKRETURNEDPKT(_pkt) DbgCheckReturnedPkt(_pkt)
115 #define DBGGETSRBSTATUSSTR(_pSrb) DbgGetSrbStatusStr(_pSrb)
117 VOID
ClasspInitializeDebugGlobals(VOID
);
118 char *DbgGetIoctlStr(ULONG ioctl
);
119 char *DbgGetScsiOpStr(PSCSI_REQUEST_BLOCK Srb
);
120 char *DbgGetSenseCodeStr(PSCSI_REQUEST_BLOCK Srb
);
121 char *DbgGetAdditionalSenseCodeStr(PSCSI_REQUEST_BLOCK Srb
);
122 char *DbgGetAdditionalSenseCodeQualifierStr(PSCSI_REQUEST_BLOCK Srb
);
123 VOID
DbgCheckReturnedPkt(TRANSFER_PACKET
*Pkt
);
124 char *DbgGetSrbStatusStr(PSCSI_REQUEST_BLOCK Srb
);
127 extern CLASSPNP_GLOBALS ClasspnpGlobals
;
128 extern LONG ClassDebug
;
129 extern BOOLEAN DebugTrapOnWarn
;
133 #define ClasspInitializeDebugGlobals()
134 #define DBGWARN(args_in_parens)
135 #define DBGERR(args_in_parens)
136 #define DBGTRACE(dbgTraceLevel, args_in_parens)
137 #define DBGTRAP(args_in_parens)
139 #define DBGGETIOCTLSTR(_ioctl)
140 #define DBGGETSCSIOPSTR(_pSrb)
141 #define DBGGETSENSECODESTR(_pSrb)
142 #define DBGGETADSENSECODESTR(_pSrb)
143 #define DBGGETADSENSEQUALIFIERSTR(_pSrb)
144 #define DBGCHECKRETURNEDPKT(_pkt)
145 #define DBGGETSRBSTATUSSTR(_pSrb)