1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Driver for Broadcom MPI3 Storage Controllers
4  *
5  * Copyright (C) 2017-2021 Broadcom Inc.
6  *  (mailto: mpi3mr-linuxdrv.pdl@broadcom.com)
7  *
8  */
9 
10 #ifndef MPI3SAS_DEBUG_H_INCLUDED
11 
12 #define MPI3SAS_DEBUG_H_INCLUDED
13 
14 /*
15  * debug levels
16  */
17 #define MPI3_DEBUG			0x00000001
18 #define MPI3_DEBUG_MSG_FRAME		0x00000002
19 #define MPI3_DEBUG_SG			0x00000004
20 #define MPI3_DEBUG_EVENTS		0x00000008
21 #define MPI3_DEBUG_EVENT_WORK_TASK	0x00000010
22 #define MPI3_DEBUG_INIT			0x00000020
23 #define MPI3_DEBUG_EXIT			0x00000040
24 #define MPI3_DEBUG_FAIL			0x00000080
25 #define MPI3_DEBUG_TM			0x00000100
26 #define MPI3_DEBUG_REPLY		0x00000200
27 #define MPI3_DEBUG_HANDSHAKE		0x00000400
28 #define MPI3_DEBUG_CONFIG		0x00000800
29 #define MPI3_DEBUG_DL			0x00001000
30 #define MPI3_DEBUG_RESET		0x00002000
31 #define MPI3_DEBUG_SCSI			0x00004000
32 #define MPI3_DEBUG_IOCTL		0x00008000
33 #define MPI3_DEBUG_CSMISAS		0x00010000
34 #define MPI3_DEBUG_SAS			0x00020000
35 #define MPI3_DEBUG_TRANSPORT		0x00040000
36 #define MPI3_DEBUG_TASK_SET_FULL	0x00080000
37 #define MPI3_DEBUG_TRIGGER_DIAG		0x00200000
38 
39 
40 /*
41  * debug macros
42  */
43 
44 #define ioc_err(ioc, fmt, ...) \
45 	pr_err("%s: " fmt, (ioc)->name, ##__VA_ARGS__)
46 #define ioc_notice(ioc, fmt, ...) \
47 	pr_notice("%s: " fmt, (ioc)->name, ##__VA_ARGS__)
48 #define ioc_warn(ioc, fmt, ...) \
49 	pr_warn("%s: " fmt, (ioc)->name, ##__VA_ARGS__)
50 #define ioc_info(ioc, fmt, ...) \
51 	pr_info("%s: " fmt, (ioc)->name, ##__VA_ARGS__)
52 
53 
54 #define dbgprint(IOC, FMT, ...) \
55 	do { \
56 		if (IOC->logging_level & MPI3_DEBUG) \
57 			pr_info("%s: " FMT, (IOC)->name, ##__VA_ARGS__); \
58 	} while (0)
59 
60 #endif /* MPT3SAS_DEBUG_H_INCLUDED */
61