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