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