xref: /freebsd/sys/cam/ctl/ctl_debug.h (revision e1e636193db45630c7881246d25902e57c43d24e)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
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  */
34 /*
35  * CAM Target Layer debugging interface.
36  *
37  * Author: Ken Merry <ken@FreeBSD.org>
38  */
39 
40 #ifndef	_CTL_DEBUG_H_
41 #define	_CTL_DEBUG_H_
42 
43 /*
44  * Debugging flags.
45  */
46 typedef enum {
47 	CTL_DEBUG_NONE		= 0x00,	/* no debugging */
48 	CTL_DEBUG_INFO		= 0x01,	/* SCSI errors */
49 	CTL_DEBUG_CDB		= 0x02,	/* SCSI CDBs and tasks */
50 	CTL_DEBUG_CDB_DATA	= 0x04	/* SCSI CDB DATA */
51 } ctl_debug_flags;
52 
53 #ifdef	CAM_CTL_DEBUG
54 #define	CTL_DEBUG_PRINT(X)		\
55 	do {				\
56 		printf("ctl_debug: ");	\
57 		printf X;		\
58 	} while (0)
59 #else /* CAM_CTL_DEBUG */
60 #define	CTL_DEBUG_PRINT(X)
61 #endif /* CAM_CTL_DEBUG */
62 
63 #endif	/* _CTL_DEBUG_H_ */
64