scsipi_debug.h revision 1.11 1 /* $NetBSD: scsipi_debug.h,v 1.11 1998/02/13 04:19:31 enami Exp $ */
2
3 /*
4 * Written by Julian Elischer (julian (at) tfs.com)
5 */
6
7 #ifndef _DEV_SCSIPI_SCSIPI_DEBUG_H_
8 #define _DEV_SCSIPI_SCSIPI_DEBUG_H_
9
10 /*
11 * These are the new debug bits. (Sat Oct 2 12:46:46 WST 1993)
12 * the following DEBUG bits are defined to exist in the flags word of
13 * the scsi_link structure.
14 */
15 #define SDEV_DB1 0x10 /* scsi commands, errors, data */
16 #define SDEV_DB2 0x20 /* routine flow tracking */
17 #define SDEV_DB3 0x40 /* internal to routine flows */
18 #define SDEV_DB4 0x80 /* level 4 debugging for this dev */
19
20 /* type, target and LUN we want to debug */
21 #define DEBUGTYPE BUS_ATAPI
22 #define DEBUGTARGET -1 /* -1 = disable. This is the drive
23 number for ATAPI */
24 #define DEBUGLUN 0
25 #define DEBUGLEVEL (SDEV_DB1|SDEV_DB2|SDEV_DB3)
26
27 /*
28 * This is the usual debug macro for use with the above bits
29 */
30 #ifdef SCSIDEBUG
31 #define SC_DEBUG(sc_link,Level,Printstuff) \
32 do { \
33 if ((sc_link)->flags & (Level)) { \
34 sc_link->sc_print_addr(sc_link); \
35 printf Printstuff; \
36 } \
37 } while (0)
38
39 #define SC_DEBUGN(sc_link,Level,Printstuff) \
40 do { \
41 if ((sc_link)->flags & (Level)) { \
42 printf Printstuff; \
43 } \
44 } while (0)
45 #else
46 #define SC_DEBUG(A,B,C)
47 #define SC_DEBUGN(A,B,C)
48 #endif
49
50 #endif /* _DEV_SCSIPI_SCSIPI_DEBUG_H_ */
51