diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_dbg.h')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_dbg.h | 187 |
1 files changed, 47 insertions, 140 deletions
diff --git a/drivers/scsi/qla2xxx/qla_dbg.h b/drivers/scsi/qla2xxx/qla_dbg.h index 930414541ec6..98a377b99017 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.h +++ b/drivers/scsi/qla2xxx/qla_dbg.h | |||
@@ -8,146 +8,6 @@ | |||
8 | #include "qla_def.h" | 8 | #include "qla_def.h" |
9 | 9 | ||
10 | /* | 10 | /* |
11 | * Driver debug definitions. | ||
12 | */ | ||
13 | /* #define QL_DEBUG_LEVEL_1 */ /* Output register accesses to COM1 */ | ||
14 | /* #define QL_DEBUG_LEVEL_2 */ /* Output error msgs to COM1 */ | ||
15 | /* #define QL_DEBUG_LEVEL_3 */ /* Output function trace msgs to COM1 */ | ||
16 | /* #define QL_DEBUG_LEVEL_4 */ /* Output NVRAM trace msgs to COM1 */ | ||
17 | /* #define QL_DEBUG_LEVEL_5 */ /* Output ring trace msgs to COM1 */ | ||
18 | /* #define QL_DEBUG_LEVEL_6 */ /* Output WATCHDOG timer trace to COM1 */ | ||
19 | /* #define QL_DEBUG_LEVEL_7 */ /* Output RISC load trace msgs to COM1 */ | ||
20 | /* #define QL_DEBUG_LEVEL_8 */ /* Output ring saturation msgs to COM1 */ | ||
21 | /* #define QL_DEBUG_LEVEL_9 */ /* Output IOCTL trace msgs */ | ||
22 | /* #define QL_DEBUG_LEVEL_10 */ /* Output IOCTL error msgs */ | ||
23 | /* #define QL_DEBUG_LEVEL_11 */ /* Output Mbx Cmd trace msgs */ | ||
24 | /* #define QL_DEBUG_LEVEL_12 */ /* Output IP trace msgs */ | ||
25 | /* #define QL_DEBUG_LEVEL_13 */ /* Output fdmi function trace msgs */ | ||
26 | /* #define QL_DEBUG_LEVEL_14 */ /* Output RSCN trace msgs */ | ||
27 | /* #define QL_DEBUG_LEVEL_15 */ /* Output NPIV trace msgs */ | ||
28 | /* #define QL_DEBUG_LEVEL_16 */ /* Output ISP84XX trace msgs */ | ||
29 | /* #define QL_DEBUG_LEVEL_17 */ /* Output EEH trace messages */ | ||
30 | /* #define QL_DEBUG_LEVEL_18 */ /* Output T10 CRC trace messages */ | ||
31 | |||
32 | /* | ||
33 | * Macros use for debugging the driver. | ||
34 | */ | ||
35 | |||
36 | #define DEBUG(x) do { if (ql2xextended_error_logging) { x; } } while (0) | ||
37 | |||
38 | #if defined(QL_DEBUG_LEVEL_1) | ||
39 | #define DEBUG1(x) do {x;} while (0) | ||
40 | #else | ||
41 | #define DEBUG1(x) do {} while (0) | ||
42 | #endif | ||
43 | |||
44 | #define DEBUG2(x) do { if (ql2xextended_error_logging) { x; } } while (0) | ||
45 | #define DEBUG2_3(x) do { if (ql2xextended_error_logging) { x; } } while (0) | ||
46 | #define DEBUG2_3_11(x) do { if (ql2xextended_error_logging) { x; } } while (0) | ||
47 | #define DEBUG2_9_10(x) do { if (ql2xextended_error_logging) { x; } } while (0) | ||
48 | #define DEBUG2_11(x) do { if (ql2xextended_error_logging) { x; } } while (0) | ||
49 | #define DEBUG2_13(x) do { if (ql2xextended_error_logging) { x; } } while (0) | ||
50 | #define DEBUG2_16(x) do { if (ql2xextended_error_logging) { x; } } while (0) | ||
51 | #define DEBUG2_17(x) do { if (ql2xextended_error_logging) { x; } } while (0) | ||
52 | |||
53 | #if defined(QL_DEBUG_LEVEL_3) | ||
54 | #define DEBUG3(x) do {x;} while (0) | ||
55 | #define DEBUG3_11(x) do {x;} while (0) | ||
56 | #else | ||
57 | #define DEBUG3(x) do {} while (0) | ||
58 | #endif | ||
59 | |||
60 | #if defined(QL_DEBUG_LEVEL_4) | ||
61 | #define DEBUG4(x) do {x;} while (0) | ||
62 | #else | ||
63 | #define DEBUG4(x) do {} while (0) | ||
64 | #endif | ||
65 | |||
66 | #if defined(QL_DEBUG_LEVEL_5) | ||
67 | #define DEBUG5(x) do {x;} while (0) | ||
68 | #else | ||
69 | #define DEBUG5(x) do {} while (0) | ||
70 | #endif | ||
71 | |||
72 | #if defined(QL_DEBUG_LEVEL_7) | ||
73 | #define DEBUG7(x) do {x;} while (0) | ||
74 | #else | ||
75 | #define DEBUG7(x) do {} while (0) | ||
76 | #endif | ||
77 | |||
78 | #if defined(QL_DEBUG_LEVEL_9) | ||
79 | #define DEBUG9(x) do {x;} while (0) | ||
80 | #define DEBUG9_10(x) do {x;} while (0) | ||
81 | #else | ||
82 | #define DEBUG9(x) do {} while (0) | ||
83 | #endif | ||
84 | |||
85 | #if defined(QL_DEBUG_LEVEL_10) | ||
86 | #define DEBUG10(x) do {x;} while (0) | ||
87 | #define DEBUG9_10(x) do {x;} while (0) | ||
88 | #else | ||
89 | #define DEBUG10(x) do {} while (0) | ||
90 | #if !defined(DEBUG9_10) | ||
91 | #define DEBUG9_10(x) do {} while (0) | ||
92 | #endif | ||
93 | #endif | ||
94 | |||
95 | #if defined(QL_DEBUG_LEVEL_11) | ||
96 | #define DEBUG11(x) do{x;} while(0) | ||
97 | #if !defined(DEBUG3_11) | ||
98 | #define DEBUG3_11(x) do{x;} while(0) | ||
99 | #endif | ||
100 | #else | ||
101 | #define DEBUG11(x) do{} while(0) | ||
102 | #if !defined(QL_DEBUG_LEVEL_3) | ||
103 | #define DEBUG3_11(x) do{} while(0) | ||
104 | #endif | ||
105 | #endif | ||
106 | |||
107 | #if defined(QL_DEBUG_LEVEL_12) | ||
108 | #define DEBUG12(x) do {x;} while (0) | ||
109 | #else | ||
110 | #define DEBUG12(x) do {} while (0) | ||
111 | #endif | ||
112 | |||
113 | #if defined(QL_DEBUG_LEVEL_13) | ||
114 | #define DEBUG13(x) do {x;} while (0) | ||
115 | #else | ||
116 | #define DEBUG13(x) do {} while (0) | ||
117 | #endif | ||
118 | |||
119 | #if defined(QL_DEBUG_LEVEL_14) | ||
120 | #define DEBUG14(x) do {x;} while (0) | ||
121 | #else | ||
122 | #define DEBUG14(x) do {} while (0) | ||
123 | #endif | ||
124 | |||
125 | #if defined(QL_DEBUG_LEVEL_15) | ||
126 | #define DEBUG15(x) do {x;} while (0) | ||
127 | #else | ||
128 | #define DEBUG15(x) do {} while (0) | ||
129 | #endif | ||
130 | |||
131 | #if defined(QL_DEBUG_LEVEL_16) | ||
132 | #define DEBUG16(x) do {x;} while (0) | ||
133 | #else | ||
134 | #define DEBUG16(x) do {} while (0) | ||
135 | #endif | ||
136 | |||
137 | #if defined(QL_DEBUG_LEVEL_17) | ||
138 | #define DEBUG17(x) do {x;} while (0) | ||
139 | #else | ||
140 | #define DEBUG17(x) do {} while (0) | ||
141 | #endif | ||
142 | |||
143 | #if defined(QL_DEBUG_LEVEL_18) | ||
144 | #define DEBUG18(x) do {if (ql2xextended_error_logging) x; } while (0) | ||
145 | #else | ||
146 | #define DEBUG18(x) do {} while (0) | ||
147 | #endif | ||
148 | |||
149 | |||
150 | /* | ||
151 | * Firmware Dump structure definition | 11 | * Firmware Dump structure definition |
152 | */ | 12 | */ |
153 | 13 | ||
@@ -370,3 +230,50 @@ struct qla2xxx_fw_dump { | |||
370 | struct qla81xx_fw_dump isp81; | 230 | struct qla81xx_fw_dump isp81; |
371 | } isp; | 231 | } isp; |
372 | }; | 232 | }; |
233 | |||
234 | #define QL_MSGHDR "qla2xxx" | ||
235 | |||
236 | #define ql_log_fatal 0 /* display fatal errors */ | ||
237 | #define ql_log_warn 1 /* display critical errors */ | ||
238 | #define ql_log_info 2 /* display all recovered errors */ | ||
239 | #define ql_log_all 3 /* This value is only used by ql_errlev. | ||
240 | * No messages will use this value. | ||
241 | * This should be always highest value | ||
242 | * as compared to other log levels. | ||
243 | */ | ||
244 | |||
245 | extern int ql_errlev; | ||
246 | |||
247 | void | ||
248 | ql_dbg(uint32_t, scsi_qla_host_t *vha, int32_t, char *, ...); | ||
249 | void | ||
250 | ql_dbg_pci(uint32_t, struct pci_dev *pdev, int32_t, char *, ...); | ||
251 | |||
252 | void | ||
253 | ql_log(uint32_t, scsi_qla_host_t *vha, int32_t, char *, ...); | ||
254 | void | ||
255 | ql_log_pci(uint32_t, struct pci_dev *pdev, int32_t, char *, ...); | ||
256 | |||
257 | /* Debug Levels */ | ||
258 | /* The 0x40000000 is the max value any debug level can have | ||
259 | * as ql2xextended_error_logging is of type signed int | ||
260 | */ | ||
261 | #define ql_dbg_init 0x40000000 /* Init Debug */ | ||
262 | #define ql_dbg_mbx 0x20000000 /* MBX Debug */ | ||
263 | #define ql_dbg_disc 0x10000000 /* Device Discovery Debug */ | ||
264 | #define ql_dbg_io 0x08000000 /* IO Tracing Debug */ | ||
265 | #define ql_dbg_dpc 0x04000000 /* DPC Thead Debug */ | ||
266 | #define ql_dbg_async 0x02000000 /* Async events Debug */ | ||
267 | #define ql_dbg_timer 0x01000000 /* Timer Debug */ | ||
268 | #define ql_dbg_user 0x00800000 /* User Space Interations Debug */ | ||
269 | #define ql_dbg_taskm 0x00400000 /* Task Management Debug */ | ||
270 | #define ql_dbg_aer 0x00200000 /* AER/EEH Debug */ | ||
271 | #define ql_dbg_multiq 0x00100000 /* MultiQ Debug */ | ||
272 | #define ql_dbg_p3p 0x00080000 /* P3P specific Debug */ | ||
273 | #define ql_dbg_vport 0x00040000 /* Virtual Port Debug */ | ||
274 | #define ql_dbg_buffer 0x00020000 /* For dumping the buffer/regs */ | ||
275 | #define ql_dbg_misc 0x00010000 /* For dumping everything that is not | ||
276 | * not covered by upper categories | ||
277 | */ | ||
278 | |||
279 | #define QL_DBG_BUF_LEN 512 | ||