xref: /freebsd/sys/cam/ctl/ctl_debug.h (revision 2ff63af9b88c7413b7d71715b5532625752a248e)
1130f4520SKenneth D. Merry /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3bec9534dSPedro F. Giffuni  *
4130f4520SKenneth D. Merry  * Copyright (c) 2003 Silicon Graphics International Corp.
5130f4520SKenneth D. Merry  * All rights reserved.
6130f4520SKenneth D. Merry  *
7130f4520SKenneth D. Merry  * Redistribution and use in source and binary forms, with or without
8130f4520SKenneth D. Merry  * modification, are permitted provided that the following conditions
9130f4520SKenneth D. Merry  * are met:
10130f4520SKenneth D. Merry  * 1. Redistributions of source code must retain the above copyright
11130f4520SKenneth D. Merry  *    notice, this list of conditions, and the following disclaimer,
12130f4520SKenneth D. Merry  *    without modification.
13130f4520SKenneth D. Merry  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
14130f4520SKenneth D. Merry  *    substantially similar to the "NO WARRANTY" disclaimer below
15130f4520SKenneth D. Merry  *    ("Disclaimer") and any redistribution must be conditioned upon
16130f4520SKenneth D. Merry  *    including a substantially similar Disclaimer requirement for further
17130f4520SKenneth D. Merry  *    binary redistribution.
18130f4520SKenneth D. Merry  *
19130f4520SKenneth D. Merry  * NO WARRANTY
20130f4520SKenneth D. Merry  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21130f4520SKenneth D. Merry  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22130f4520SKenneth D. Merry  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
23130f4520SKenneth D. Merry  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24130f4520SKenneth D. Merry  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25130f4520SKenneth D. Merry  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26130f4520SKenneth D. Merry  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27130f4520SKenneth D. Merry  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28130f4520SKenneth D. Merry  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29130f4520SKenneth D. Merry  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30130f4520SKenneth D. Merry  * POSSIBILITY OF SUCH DAMAGES.
31130f4520SKenneth D. Merry  *
32130f4520SKenneth D. Merry  * $Id: //depot/users/kenm/FreeBSD-test2/sys/cam/ctl/ctl_debug.h#2 $
33130f4520SKenneth D. Merry  */
34130f4520SKenneth D. Merry /*
35130f4520SKenneth D. Merry  * CAM Target Layer debugging interface.
36130f4520SKenneth D. Merry  *
37130f4520SKenneth D. Merry  * Author: Ken Merry <ken@FreeBSD.org>
38130f4520SKenneth D. Merry  */
39130f4520SKenneth D. Merry 
40130f4520SKenneth D. Merry #ifndef	_CTL_DEBUG_H_
41130f4520SKenneth D. Merry #define	_CTL_DEBUG_H_
42130f4520SKenneth D. Merry 
43218d5d4bSAlexander Motin /*
44218d5d4bSAlexander Motin  * Debugging flags.
45218d5d4bSAlexander Motin  */
46218d5d4bSAlexander Motin typedef enum {
47218d5d4bSAlexander Motin 	CTL_DEBUG_NONE		= 0x00,	/* no debugging */
48218d5d4bSAlexander Motin 	CTL_DEBUG_INFO		= 0x01,	/* SCSI errors */
49218d5d4bSAlexander Motin 	CTL_DEBUG_CDB		= 0x02,	/* SCSI CDBs and tasks */
50218d5d4bSAlexander Motin 	CTL_DEBUG_CDB_DATA	= 0x04	/* SCSI CDB DATA */
51218d5d4bSAlexander Motin } ctl_debug_flags;
52218d5d4bSAlexander Motin 
53130f4520SKenneth D. Merry #ifdef	CAM_CTL_DEBUG
54130f4520SKenneth D. Merry #define	CTL_DEBUG_PRINT(X)		\
55130f4520SKenneth D. Merry 	do {				\
56130f4520SKenneth D. Merry 		printf("ctl_debug: ");	\
57130f4520SKenneth D. Merry 		printf X;		\
58130f4520SKenneth D. Merry 	} while (0)
59130f4520SKenneth D. Merry #else /* CAM_CTL_DEBUG */
60130f4520SKenneth D. Merry #define	CTL_DEBUG_PRINT(X)
61130f4520SKenneth D. Merry #endif /* CAM_CTL_DEBUG */
62130f4520SKenneth D. Merry 
63130f4520SKenneth D. Merry #endif	/* _CTL_DEBUG_H_ */
64