scsi_debug.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* $OpenBSD: scsi_debug.h,v 1.11 2015/06/07 19:13:27 krw Exp $ */
  2. /* $NetBSD: scsi_debug.h,v 1.7 1996/10/12 23:23:16 christos Exp $ */
  3. /*
  4. * Written by Julian Elischer (julian@tfs.com)
  5. */
  6. #ifndef _SCSI_SCSI_DEBUG_H
  7. #define _SCSI_SCSI_DEBUG_H 1
  8. #ifdef _KERNEL
  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 0x0010 /* scsi commands, errors, data */
  15. #define SDEV_DB2 0x0020 /* routine flow tracking */
  16. #define SDEV_DB3 0x0040 /* internal to routine flows */
  17. #define SDEV_DB4 0x0080 /* level 4 debugging for this dev */
  18. /* targets and LUNs we want to debug */
  19. #ifndef SCSIDEBUG_BUSES
  20. #define SCSIDEBUG_BUSES 0
  21. #endif
  22. #ifndef SCSIDEBUG_TARGETS
  23. #define SCSIDEBUG_TARGETS 0
  24. #endif
  25. #ifndef SCSIDEBUG_LUNS
  26. #define SCSIDEBUG_LUNS 0
  27. #endif
  28. #ifndef SCSIDEBUG_LEVEL
  29. #define SCSIDEBUG_LEVEL (SDEV_DB1|SDEV_DB2)
  30. #endif
  31. extern u_int32_t scsidebug_buses, scsidebug_targets, scsidebug_luns;
  32. extern int scsidebug_level;
  33. /*
  34. * This is the usual debug macro for use with the above bits
  35. */
  36. #ifdef SCSIDEBUG
  37. #define SC_DEBUG(sc_link,Level,Printstuff) \
  38. if ((sc_link)->flags & (Level)) { \
  39. sc_print_addr(sc_link); \
  40. printf Printstuff; \
  41. }
  42. #define SC_DEBUGN(sc_link,Level,Printstuff) \
  43. if ((sc_link)->flags & (Level)) { \
  44. printf Printstuff; \
  45. }
  46. #else
  47. #define SC_DEBUG(A,B,C)
  48. #define SC_DEBUGN(A,B,C)
  49. #endif
  50. #endif /* _KERNEL */
  51. #endif /* _SCSI_SCSI_DEBUG_H */