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