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