xref: /freebsd/sys/cam/ctl/ctl_debug.h (revision a0b9e2e854027e6ff61fb075a1309dbc71c42b54)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2003 Silicon Graphics International Corp.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions, and the following disclaimer,
12  *    without modification.
13  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
14  *    substantially similar to the "NO WARRANTY" disclaimer below
15  *    ("Disclaimer") and any redistribution must be conditioned upon
16  *    including a substantially similar Disclaimer requirement for further
17  *    binary redistribution.
18  *
19  * NO WARRANTY
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGES.
31  *
32  * $Id: //depot/users/kenm/FreeBSD-test2/sys/cam/ctl/ctl_debug.h#2 $
33  * $FreeBSD$
34  */
35 /*
36  * CAM Target Layer debugging interface.
37  *
38  * Author: Ken Merry <ken@FreeBSD.org>
39  */
40 
41 #ifndef	_CTL_DEBUG_H_
42 #define	_CTL_DEBUG_H_
43 
44 /*
45  * Debugging flags.
46  */
47 typedef enum {
48 	CTL_DEBUG_NONE		= 0x00,	/* no debugging */
49 	CTL_DEBUG_INFO		= 0x01,	/* SCSI errors */
50 	CTL_DEBUG_CDB		= 0x02,	/* SCSI CDBs and tasks */
51 	CTL_DEBUG_CDB_DATA	= 0x04	/* SCSI CDB DATA */
52 } ctl_debug_flags;
53 
54 #ifdef	CAM_CTL_DEBUG
55 #define	CTL_DEBUG_PRINT(X)		\
56 	do {				\
57 		printf("ctl_debug: ");	\
58 		printf X;		\
59 	} while (0)
60 #else /* CAM_CTL_DEBUG */
61 #define	CTL_DEBUG_PRINT(X)
62 #endif /* CAM_CTL_DEBUG */
63 
64 #endif	/* _CTL_DEBUG_H_ */
65