1 /* $OpenBSD: scsi_debug.h,v 1.8 2004/01/25 00:09:20 krw Exp $ */
2 /* $NetBSD: scsi_debug.h,v 1.7 1996/10/12 23:23:16 christos Exp $ */
3
4 /*
5 * Written by Julian Elischer (julian@tfs.com)
6 */
7 #ifndef _SCSI_SCSI_DEBUG_H
8 #define _SCSI_SCSI_DEBUG_H 1
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 0x0010 /* scsi commands, errors, data */
16 #define SDEV_DB2 0x0020 /* routine flow tracking */
17 #define SDEV_DB3 0x0040 /* internal to routine flows */
18 #define SDEV_DB4 0x0080 /* level 4 debugging for this dev */
19
20 /* targets and LUNs we want to debug */
21 #ifndef SCSIDEBUG_BUSES
22 #define SCSIDEBUG_BUSES 0
23 #endif
24 #ifndef SCSIDEBUG_TARGETS
25 #define SCSIDEBUG_TARGETS 0
26 #endif
27 #ifndef SCSIDEBUG_LUNS
28 #define SCSIDEBUG_LUNS 0
29 #endif
30 #ifndef SCSIDEBUG_LEVEL
31 #define SCSIDEBUG_LEVEL (SDEV_DB1|SDEV_DB2)
32 #endif
33
34
35 extern int scsidebug_buses, scsidebug_targets, scsidebug_luns, scsidebug_level;
36
37 /*
38 * This is the usual debug macro for use with the above bits
39 */
40 #ifdef SCSIDEBUG
41 #define SC_DEBUG(sc_link,Level,Printstuff) \
42 if ((sc_link)->flags & (Level)) { \
43 sc_print_addr(sc_link); \
44 printf Printstuff; \
45 }
46 #define SC_DEBUGN(sc_link,Level,Printstuff) \
47 if ((sc_link)->flags & (Level)) { \
48 printf Printstuff; \
49 }
50 #else
51 #define SC_DEBUG(A,B,C)
52 #define SC_DEBUGN(A,B,C)
53 #endif
54
55 #endif /* _SCSI_SCSI_DEBUG_H */