3 Copyright (C) Microsoft Corporation, 1991 - 1999
26 VOID
ClassDebugPrint(CLASS_DEBUG_LEVEL DebugPrintLevel
, PCCHAR DebugMessage
, ...);
30 typedef struct _CLASSPNP_GLOBALS
{
33 // whether or not to ASSERT for lost irps
36 ULONG BreakOnLostIrps
;
37 ULONG SecondsToWaitForIrps
;
40 // use a buffered debug print to help
41 // catch timing issues that do not
42 // reproduce with std debugprints enabled
45 ULONG UseBufferedDebugPrint
;
46 ULONG UseDelayedRetry
;
49 // the next four are the buffered printing support
50 // (currently unimplemented) and require the spinlock
54 ULONG Index
; // index into buffer
56 PUCHAR Buffer
; // requires spinlock to access
57 ULONG NumberOfBuffers
; // number of buffers available
58 SIZE_T EachBufferSize
; // size of each buffer
61 // interlocked variables to initialize
62 // this data only once
68 } CLASSPNP_GLOBALS
, *PCLASSPNP_GLOBALS
;
70 #define DBGTRACE(dbgTraceLevel, args_in_parens) \
71 if (ClassDebug & (1 << (dbgTraceLevel+15))){ \
72 DbgPrint("CLASSPNP> *** TRACE *** (file %s, line %d)\n", __FILE__, __LINE__ ); \
74 DbgPrint args_in_parens; \
76 if (DebugTrapOnWarn && (dbgTraceLevel == ClassDebugWarning)){ \
80 #define DBGWARN(args_in_parens) \
82 DbgPrint("CLASSPNP> *** WARNING *** (file %s, line %d)\n", __FILE__, __LINE__ ); \
84 DbgPrint args_in_parens; \
86 if (DebugTrapOnWarn){ \
90 #define DBGERR(args_in_parens) \
92 DbgPrint("CLASSPNP> *** ERROR *** (file %s, line %d)\n", __FILE__, __LINE__ ); \
94 DbgPrint args_in_parens; \
98 #define DBGTRAP(args_in_parens) \
100 DbgPrint("CLASSPNP> *** COVERAGE TRAP *** (file %s, line %d)\n", __FILE__, __LINE__ ); \
102 DbgPrint args_in_parens; \
108 #define DBGGETIOCTLSTR(_ioctl) DbgGetIoctlStr(_ioctl)
109 #define DBGGETSCSIOPSTR(_pSrb) DbgGetScsiOpStr(_pSrb)
110 #define DBGGETSENSECODESTR(_pSrb) DbgGetSenseCodeStr(_pSrb)
111 #define DBGGETADSENSECODESTR(_pSrb) DbgGetAdditionalSenseCodeStr(_pSrb)
112 #define DBGGETADSENSEQUALIFIERSTR(_pSrb) DbgGetAdditionalSenseCodeQualifierStr(_pSrb)
113 #define DBGCHECKRETURNEDPKT(_pkt) DbgCheckReturnedPkt(_pkt)
114 #define DBGGETSRBSTATUSSTR(_pSrb) DbgGetSrbStatusStr(_pSrb)
116 VOID
ClasspInitializeDebugGlobals(VOID
);
117 char *DbgGetIoctlStr(ULONG ioctl
);
118 char *DbgGetScsiOpStr(PSCSI_REQUEST_BLOCK Srb
);
119 char *DbgGetSenseCodeStr(PSCSI_REQUEST_BLOCK Srb
);
120 char *DbgGetAdditionalSenseCodeStr(PSCSI_REQUEST_BLOCK Srb
);
121 char *DbgGetAdditionalSenseCodeQualifierStr(PSCSI_REQUEST_BLOCK Srb
);
122 VOID
DbgCheckReturnedPkt(TRANSFER_PACKET
*Pkt
);
123 char *DbgGetSrbStatusStr(PSCSI_REQUEST_BLOCK Srb
);
126 extern CLASSPNP_GLOBALS ClasspnpGlobals
;
127 extern LONG ClassDebug
;
128 extern BOOLEAN DebugTrapOnWarn
;
132 #define ClasspInitializeDebugGlobals()
133 #define DBGWARN(args_in_parens)
134 #define DBGERR(args_in_parens)
135 #define DBGTRACE(dbgTraceLevel, args_in_parens)
136 #define DBGTRAP(args_in_parens)
138 #define DBGGETIOCTLSTR(_ioctl)
139 #define DBGGETSCSIOPSTR(_pSrb)
140 #define DBGGETSENSECODESTR(_pSrb)
141 #define DBGGETADSENSECODESTR(_pSrb)
142 #define DBGGETADSENSEQUALIFIERSTR(_pSrb)
143 #define DBGCHECKRETURNEDPKT(_pkt)
144 #define DBGGETSRBSTATUSSTR(_pSrb)