32#ifndef _CAM_CAM_DEBUG_H
33#define _CAM_CAM_DEBUG_H 1
51#ifndef CAM_DEBUG_FLAGS
52#define CAM_DEBUG_FLAGS CAM_DEBUG_NONE
55#ifndef CAM_DEBUG_COMPILE
57#define CAM_DEBUG_COMPILE (-1)
59#define CAM_DEBUG_COMPILE (CAM_DEBUG_INFO | CAM_DEBUG_CDB | \
60 CAM_DEBUG_PERIPH | CAM_DEBUG_PROBE | \
66#define CAM_DEBUG_BUS CAM_BUS_WILDCARD
68#ifndef CAM_DEBUG_TARGET
69#define CAM_DEBUG_TARGET CAM_TARGET_WILDCARD
72#define CAM_DEBUG_LUN CAM_LUN_WILDCARD
75#ifndef CAM_DEBUG_DELAY
76#define CAM_DEBUG_DELAY 0
87#define CAM_DEBUGGED(path, flag) \
88 (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags) \
89 && (cam_dpath != NULL) \
90 && (xpt_path_comp(cam_dpath, path) >= 0) \
91 && (xpt_path_comp(cam_dpath, path) < 2))
93#define CAM_DEBUG(path, flag, printfargs) \
94 if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags) \
95 && (cam_dpath != NULL) \
96 && (xpt_path_comp(cam_dpath, path) >= 0) \
97 && (xpt_path_comp(cam_dpath, path) < 2)) { \
98 xpt_print_path(path); \
100 if (cam_debug_delay != 0) \
101 DELAY(cam_debug_delay); \
104#define CAM_DEBUG_DEV(dev, flag, printfargs) \
105 if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags) \
106 && (cam_dpath != NULL) \
107 && (xpt_path_comp_dev(cam_dpath, dev) >= 0) \
108 && (xpt_path_comp_dev(cam_dpath, dev) < 2)) { \
109 xpt_print_device(dev); \
111 if (cam_debug_delay != 0) \
112 DELAY(cam_debug_delay); \
115#define CAM_DEBUG_PRINT(flag, printfargs) \
116 if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags)) { \
117 printf("cam_debug: "); \
119 if (cam_debug_delay != 0) \
120 DELAY(cam_debug_delay); \
123#define CAM_DEBUG_PATH_PRINT(flag, path, printfargs) \
124 if (((flag) & (CAM_DEBUG_COMPILE) & cam_dflags)) { \
125 xpt_print(path, "cam_debug: "); \
127 if (cam_debug_delay != 0) \
128 DELAY(cam_debug_delay); \
133#define CAM_DEBUGGED(A, B) 0
134#define CAM_DEBUG(A, B, C)
135#define CAM_DEBUG_PRINT(A, B)
136#define CAM_DEBUG_PATH_PRINT(A, B, C)
u_int32_t cam_debug_delay
struct cam_path * cam_dpath