#ifndef _SCSI_SCSI_DEBUG_H
#define _SCSI_SCSI_DEBUG_H
#ifdef _KERNEL
#define SDEV_DB1 0x0010
#define SDEV_DB2 0x0020
#define SDEV_DB3 0x0040
#define SDEV_DB4 0x0080
#ifdef SCSIDEBUG
#ifndef SCSIDEBUG_BUSES
#define SCSIDEBUG_BUSES 0
#endif
#ifndef SCSIDEBUG_TARGETS
#define SCSIDEBUG_TARGETS 0
#endif
#ifndef SCSIDEBUG_LUNS
#define SCSIDEBUG_LUNS 0
#endif
#ifndef SCSIDEBUG_LEVEL
#define SCSIDEBUG_LEVEL (SDEV_DB1|SDEV_DB2)
#endif
extern u_int32_t scsidebug_buses, scsidebug_targets, scsidebug_luns;
extern int scsidebug_level;
extern const char *flagnames[];
extern const char *quirknames[];
extern const char *devicetypenames[32];
struct scsi_xfer;
void scsi_show_sense(struct scsi_xfer *);
void scsi_show_xs(struct scsi_xfer *);
void scsi_show_mem(u_char *, int);
void scsi_show_flags(u_int32_t, const char **);
void scsi_show_inquiry_header(struct scsi_inquiry_data *);
void scsi_show_inquiry_match(struct scsi_inquiry_data *);
#define SC_DEBUG(link,Level,Printstuff) do { \
if ((link)->flags & (Level)) { \
sc_print_addr(link); \
printf Printstuff; \
} \
} while (0)
#define SC_DEBUGN(link,Level,Printstuff) do { \
if ((link)->flags & (Level)) { \
printf Printstuff; \
} \
} while (0)
#define SC_DEBUG_SENSE(xs) do { \
scsi_show_sense(xs); \
} while (0)
#else
#define SC_DEBUG(link,level,Printstuff)
#define SC_DEBUGN(link,level,Printstuff)
#define SC_DEBUG_SENSE(xs)
#endif
#endif
#endif