scsipi_debug.h revision 1.2 1 1.1 mycroft /*#define SCSIDEBUG 1*/
2 1.1 mycroft /*
3 1.1 mycroft * Written by Julian Elischer (julian (at) tfs.com)
4 1.1 mycroft *
5 1.2 briggs * $Id: scsipi_debug.h,v 1.2 1994/01/22 14:16:58 briggs Exp $
6 1.1 mycroft */
7 1.1 mycroft #ifndef _SCSI_SCSI_DEBUG_H
8 1.1 mycroft #define _SCSI_SCSI_DEBUG_H 1
9 1.1 mycroft
10 1.1 mycroft /*
11 1.1 mycroft * These are the new debug bits. (Sat Oct 2 12:46:46 WST 1993)
12 1.1 mycroft * the following DEBUG bits are defined to exist in the flags word of
13 1.1 mycroft * the scsi_link structure.
14 1.1 mycroft */
15 1.1 mycroft #define SDEV_DB1 0x10 /* scsi commands, errors, data */
16 1.1 mycroft #define SDEV_DB2 0x20 /* routine flow tracking */
17 1.1 mycroft #define SDEV_DB3 0x40 /* internal to routine flows */
18 1.1 mycroft #define SDEV_DB4 0x80 /* level 4 debugging for this dev */
19 1.1 mycroft
20 1.1 mycroft /* target and LUN we want to debug */
21 1.1 mycroft #define DEBUGTARG 9 /*9 = dissable*/
22 1.1 mycroft #define DEBUGLUN 0
23 1.1 mycroft #define DEBUGLEVEL (SDEV_DB1|SDEV_DB2)
24 1.1 mycroft
25 1.1 mycroft /*
26 1.1 mycroft * This is the usual debug macro for use with the above bits
27 1.1 mycroft */
28 1.1 mycroft #ifdef SCSIDEBUG
29 1.1 mycroft #define SC_DEBUG(sc_link,Level,Printstuff) \
30 1.1 mycroft if((sc_link)->flags & (Level)) \
31 1.1 mycroft { \
32 1.1 mycroft printf("%s%d(%s%d:%d:%d): ", \
33 1.1 mycroft sc_link->device->name, \
34 1.1 mycroft sc_link->dev_unit, \
35 1.1 mycroft sc_link->adapter->name, \
36 1.2 briggs sc_link->scsibus, \
37 1.1 mycroft sc_link->target, \
38 1.1 mycroft sc_link->lun); \
39 1.1 mycroft printf Printstuff; \
40 1.1 mycroft }
41 1.1 mycroft #define SC_DEBUGN(sc_link,Level,Printstuff) \
42 1.1 mycroft if((sc_link)->flags & (Level)) \
43 1.1 mycroft { \
44 1.1 mycroft printf Printstuff; \
45 1.1 mycroft }
46 1.1 mycroft #else
47 1.1 mycroft #define SC_DEBUG(A,B,C) /* not included */
48 1.1 mycroft #define SC_DEBUGN(A,B,C) /* not included */
49 1.1 mycroft #endif
50 1.1 mycroft
51 1.1 mycroft #endif /*_SCSI_SCSI_DEBUG_H*/
52 1.1 mycroft /* END OF FILE */
53 1.1 mycroft
54