aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion
diff options
context:
space:
mode:
authorPrakash, Sathya <sathya.prakash@lsi.com>2007-07-24 06:10:08 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-07-28 11:25:35 -0400
commit5c1b91b9923d1b3d33576e391ff7b587bdff7a3e (patch)
tree7c688d0c3a2e46ec50d3c0263689a236cd669204 /drivers/message/fusion
parent92631fa4d0afa64b82144eab714fbf2f4049dabe (diff)
[SCSI] mpt fusion: logging support in Kconfig, Makefile, mptbase.h and addition of mptdebug.h
This patch adds a new file mptdebug.h in the fusion source directory, which contains different debug macros. The existing debug macros and flags are removed from the mptbase.h and Makefile In Kconfig a new configuration parameter FUSION_LOGGING is added to enable/disable the logging support during compile time. signed-off-by: Sathya Prakash <sathya.prakash@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message/fusion')
-rw-r--r--drivers/message/fusion/Kconfig14
-rw-r--r--drivers/message/fusion/Makefile37
-rw-r--r--drivers/message/fusion/mptbase.h198
-rw-r--r--drivers/message/fusion/mptdebug.h288
4 files changed, 308 insertions, 229 deletions
diff --git a/drivers/message/fusion/Kconfig b/drivers/message/fusion/Kconfig
index 4494e0fd36c6..f55cc03a75c9 100644
--- a/drivers/message/fusion/Kconfig
+++ b/drivers/message/fusion/Kconfig
@@ -102,4 +102,18 @@ config FUSION_LAN
102 102
103 If unsure whether you really want or need this, say N. 103 If unsure whether you really want or need this, say N.
104 104
105config FUSION_LOGGING
106 bool "Fusion MPT logging facility"
107 depends on FUSION
108 ---help---
109 This turns on a logging facility that can be used to debug a number
110 of Fusion MPT related problems.
111
112 The debug level can be programmed on the fly via SysFS (hex values)
113
114 echo [level] > /sys/class/scsi_host/host#/debug_level
115
116 There are various debug levels that an be found in the source:
117 file:drivers/message/fusion/mptdebug.h
118
105endmenu 119endmenu
diff --git a/drivers/message/fusion/Makefile b/drivers/message/fusion/Makefile
index 6003b46c8438..95c9532cb07c 100644
--- a/drivers/message/fusion/Makefile
+++ b/drivers/message/fusion/Makefile
@@ -1,39 +1,8 @@
1# Fusion MPT drivers; recognized debug defines... 1# Fusion MPT drivers; recognized debug defines...
2# MPT general:
3#EXTRA_CFLAGS += -DMPT_DEBUG
4#EXTRA_CFLAGS += -DMPT_DEBUG_MSG_FRAME
5#EXTRA_CFLAGS += -DMPT_DEBUG_SG
6#EXTRA_CFLAGS += -DMPT_DEBUG_EVENTS
7#EXTRA_CFLAGS += -DMPT_DEBUG_VERBOSE_EVENTS
8#EXTRA_CFLAGS += -DMPT_DEBUG_INIT
9#EXTRA_CFLAGS += -DMPT_DEBUG_EXIT
10#EXTRA_CFLAGS += -DMPT_DEBUG_FAIL
11#EXTRA_CFLAGS += -DMPT_DEBUG_DV
12#EXTRA_CFLAGS += -DMPT_DEBUG_TM
13#EXTRA_CFLAGS += -DMPT_DEBUG_REPLY
14 2
15# 3# enable verbose logging
16# driver/module specifics... 4# CONFIG_FUSION_LOGGING needs to be enabled in Kconfig
17# 5#EXTRA_CFLAGS += -DMPT_DEBUG_VERBOSE
18# For mptbase:
19#CFLAGS_mptbase.o += -DMPT_DEBUG_HANDSHAKE
20#CFLAGS_mptbase.o += -DMPT_DEBUG_CONFIG
21#CFLAGS_mptbase.o += -DMPT_DEBUG_DL
22#CFLAGS_mptbase.o += -DMPT_DEBUG_IRQ
23#CFLAGS_mptbase.o += -DMPT_DEBUG_RESET
24#
25# For mptscsih:
26#CFLAGS_mptscsih.o += -DMPT_DEBUG_SCSI
27#
28# For mptctl:
29#CFLAGS_mptctl.o += -DMPT_DEBUG_IOCTL
30#
31# For mptfc:
32#CFLAGS_mptfc.o += -DMPT_DEBUG_FC
33
34# For mptsas:
35#CFLAGS_mptsas.o += -DMPT_DEBUG_SAS
36#CFLAGS_mptsas.o += -DMPT_DEBUG_SAS_WIDE
37 6
38 7
39#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC 8#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index 98eb9c688e17..15ff22645844 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -186,6 +186,7 @@
186 * MPT drivers. NOTE: Users of these macro defs must 186 * MPT drivers. NOTE: Users of these macro defs must
187 * themselves define their own MYNAM. 187 * themselves define their own MYNAM.
188 */ 188 */
189#define MYIOC_s_DEBUG_FMT KERN_DEBUG MYNAM ": %s: "
189#define MYIOC_s_INFO_FMT KERN_INFO MYNAM ": %s: " 190#define MYIOC_s_INFO_FMT KERN_INFO MYNAM ": %s: "
190#define MYIOC_s_NOTE_FMT KERN_NOTICE MYNAM ": %s: " 191#define MYIOC_s_NOTE_FMT KERN_NOTICE MYNAM ": %s: "
191#define MYIOC_s_WARN_FMT KERN_WARNING MYNAM ": %s: WARNING - " 192#define MYIOC_s_WARN_FMT KERN_WARNING MYNAM ": %s: WARNING - "
@@ -543,6 +544,7 @@ typedef struct _MPT_ADAPTER
543 char board_tracer[16]; 544 char board_tracer[16];
544 u16 nvdata_version_persistent; 545 u16 nvdata_version_persistent;
545 u16 nvdata_version_default; 546 u16 nvdata_version_default;
547 int debug_level;
546 u8 io_missing_delay; 548 u8 io_missing_delay;
547 u8 device_missing_delay; 549 u8 device_missing_delay;
548 SYSIF_REGS __iomem *chip; /* == c8817000 (mmap) */ 550 SYSIF_REGS __iomem *chip; /* == c8817000 (mmap) */
@@ -718,171 +720,7 @@ typedef struct _mpt_sge {
718/* 720/*
719 * Funky (private) macros... 721 * Funky (private) macros...
720 */ 722 */
721#ifdef MPT_DEBUG 723#include "mptdebug.h"
722#define dprintk(x) printk x
723#else
724#define dprintk(x)
725#endif
726
727#ifdef MPT_DEBUG_INIT
728#define dinitprintk(x) printk x
729#define DBG_DUMP_FW_REQUEST_FRAME(mfp) \
730 { int i, n = 10; \
731 u32 *m = (u32 *)(mfp); \
732 printk(KERN_INFO " "); \
733 for (i=0; i<n; i++) \
734 printk(" %08x", le32_to_cpu(m[i])); \
735 printk("\n"); \
736 }
737#else
738#define dinitprintk(x)
739#define DBG_DUMP_FW_REQUEST_FRAME(mfp)
740#endif
741
742#ifdef MPT_DEBUG_EXIT
743#define dexitprintk(x) printk x
744#else
745#define dexitprintk(x)
746#endif
747
748#if defined MPT_DEBUG_FAIL || defined (MPT_DEBUG_SG)
749#define dfailprintk(x) printk x
750#else
751#define dfailprintk(x)
752#endif
753
754#ifdef MPT_DEBUG_HANDSHAKE
755#define dhsprintk(x) printk x
756#else
757#define dhsprintk(x)
758#endif
759
760#if defined(MPT_DEBUG_EVENTS) || defined(MPT_DEBUG_VERBOSE_EVENTS)
761#define devtprintk(x) printk x
762#else
763#define devtprintk(x)
764#endif
765
766#ifdef MPT_DEBUG_VERBOSE_EVENTS
767#define devtverboseprintk(x) printk x
768#else
769#define devtverboseprintk(x)
770#endif
771
772#ifdef MPT_DEBUG_RESET
773#define drsprintk(x) printk x
774#else
775#define drsprintk(x)
776#endif
777
778//#if defined(MPT_DEBUG) || defined(MPT_DEBUG_MSG_FRAME)
779#if defined(MPT_DEBUG_MSG_FRAME)
780#define dmfprintk(x) printk x
781#define DBG_DUMP_REQUEST_FRAME(mfp) \
782 { int i, n = 24; \
783 u32 *m = (u32 *)(mfp); \
784 for (i=0; i<n; i++) { \
785 if (i && ((i%8)==0)) \
786 printk("\n"); \
787 printk("%08x ", le32_to_cpu(m[i])); \
788 } \
789 printk("\n"); \
790 }
791#else
792#define dmfprintk(x)
793#define DBG_DUMP_REQUEST_FRAME(mfp)
794#endif
795
796#ifdef MPT_DEBUG_IRQ
797#define dirqprintk(x) printk x
798#else
799#define dirqprintk(x)
800#endif
801
802#ifdef MPT_DEBUG_SG
803#define dsgprintk(x) printk x
804#else
805#define dsgprintk(x)
806#endif
807
808#if defined(MPT_DEBUG_DL) || defined(MPT_DEBUG)
809#define ddlprintk(x) printk x
810#else
811#define ddlprintk(x)
812#endif
813
814#ifdef MPT_DEBUG_DV
815#define ddvprintk(x) printk x
816#else
817#define ddvprintk(x)
818#endif
819
820#if defined(MPT_DEBUG_DV) || defined(MPT_DEBUG_DV_TINY)
821#define ddvtprintk(x) printk x
822#else
823#define ddvtprintk(x)
824#endif
825
826#ifdef MPT_DEBUG_IOCTL
827#define dctlprintk(x) printk x
828#else
829#define dctlprintk(x)
830#endif
831
832#ifdef MPT_DEBUG_REPLY
833#define dreplyprintk(x) printk x
834#else
835#define dreplyprintk(x)
836#endif
837
838#ifdef DMPT_DEBUG_FC
839#define dfcprintk(x) printk x
840#else
841#define dfcprintk(x)
842#endif
843
844#ifdef MPT_DEBUG_TM
845#define dtmprintk(x) printk x
846#define DBG_DUMP_TM_REQUEST_FRAME(mfp) \
847 { u32 *m = (u32 *)(mfp); \
848 int i, n = 13; \
849 printk("TM_REQUEST:\n"); \
850 for (i=0; i<n; i++) { \
851 if (i && ((i%8)==0)) \
852 printk("\n"); \
853 printk("%08x ", le32_to_cpu(m[i])); \
854 } \
855 printk("\n"); \
856 }
857#define DBG_DUMP_TM_REPLY_FRAME(mfp) \
858 { u32 *m = (u32 *)(mfp); \
859 int i, n = (le32_to_cpu(m[0]) & 0x00FF0000) >> 16; \
860 printk("TM_REPLY MessageLength=%d:\n", n); \
861 for (i=0; i<n; i++) { \
862 if (i && ((i%8)==0)) \
863 printk("\n"); \
864 printk(" %08x", le32_to_cpu(m[i])); \
865 } \
866 printk("\n"); \
867 }
868#else
869#define dtmprintk(x)
870#define DBG_DUMP_TM_REQUEST_FRAME(mfp)
871#define DBG_DUMP_TM_REPLY_FRAME(mfp)
872#endif
873
874#if defined(MPT_DEBUG_CONFIG) || defined(MPT_DEBUG)
875#define dcprintk(x) printk x
876#else
877#define dcprintk(x)
878#endif
879
880#if defined(MPT_DEBUG_SCSI) || defined(MPT_DEBUG) || defined(MPT_DEBUG_MSG_FRAME)
881#define dsprintk(x) printk x
882#else
883#define dsprintk(x)
884#endif
885
886 724
887#define MPT_INDEX_2_MFPTR(ioc,idx) \ 725#define MPT_INDEX_2_MFPTR(ioc,idx) \
888 (MPT_FRAME_HDR*)( (u8*)(ioc)->req_frames + (ioc)->req_sz * (idx) ) 726 (MPT_FRAME_HDR*)( (u8*)(ioc)->req_frames + (ioc)->req_sz * (idx) )
@@ -893,36 +731,6 @@ typedef struct _mpt_sge {
893#define MPT_INDEX_2_RFPTR(ioc,idx) \ 731#define MPT_INDEX_2_RFPTR(ioc,idx) \
894 (MPT_FRAME_HDR*)( (u8*)(ioc)->reply_frames + (ioc)->req_sz * (idx) ) 732 (MPT_FRAME_HDR*)( (u8*)(ioc)->reply_frames + (ioc)->req_sz * (idx) )
895 733
896#if defined(MPT_DEBUG) || defined(MPT_DEBUG_MSG_FRAME)
897#define DBG_DUMP_REPLY_FRAME(mfp) \
898 { u32 *m = (u32 *)(mfp); \
899 int i, n = (le32_to_cpu(m[0]) & 0x00FF0000) >> 16; \
900 printk(KERN_INFO " "); \
901 for (i=0; i<n; i++) \
902 printk(" %08x", le32_to_cpu(m[i])); \
903 printk("\n"); \
904 }
905#define DBG_DUMP_REQUEST_FRAME_HDR(mfp) \
906 { int i, n = 3; \
907 u32 *m = (u32 *)(mfp); \
908 printk(KERN_INFO " "); \
909 for (i=0; i<n; i++) \
910 printk(" %08x", le32_to_cpu(m[i])); \
911 printk("\n"); \
912 }
913#else
914#define DBG_DUMP_REPLY_FRAME(mfp)
915#define DBG_DUMP_REQUEST_FRAME_HDR(mfp)
916#endif
917
918// debug sas wide ports
919#ifdef MPT_DEBUG_SAS_WIDE
920#define dsaswideprintk(x) printk x
921#else
922#define dsaswideprintk(x)
923#endif
924
925
926/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 734/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
927 735
928#define SCSI_STD_SENSE_BYTES 18 736#define SCSI_STD_SENSE_BYTES 18
diff --git a/drivers/message/fusion/mptdebug.h b/drivers/message/fusion/mptdebug.h
new file mode 100644
index 000000000000..ffdb0a6191b4
--- /dev/null
+++ b/drivers/message/fusion/mptdebug.h
@@ -0,0 +1,288 @@
1/*
2 * linux/drivers/message/fusion/mptdebug.h
3 * For use with LSI PCI chip/adapter(s)
4 * running LSI Fusion MPT (Message Passing Technology) firmware.
5 *
6 * Copyright (c) 1999-2007 LSI Corporation
7 * (mailto:DL-MPTFusionLinux@lsi.com)
8 *
9 */
10/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
11
12#ifndef MPTDEBUG_H_INCLUDED
13#define MPTDEBUG_H_INCLUDED
14
15/*
16 * debug level can be programmed on the fly via SysFS (hex values)
17 *
18 * Example: (programming for MPT_DEBUG_EVENTS on host 5)
19 *
20 * echo 8 > /sys/class/scsi_host/host5/debug_level
21 *
22 * --------------------------------------------------------
23 * mpt_debug_level - command line parameter
24 * this allow enabling debug at driver load time (for all iocs)
25 *
26 * Example (programming for MPT_DEBUG_EVENTS)
27 *
28 * insmod mptbase.ko mpt_debug_level=8
29 *
30 * --------------------------------------------------------
31 * CONFIG_FUSION_LOGGING - enables compiling debug into driver
32 * this can be enabled in the driver Makefile
33 *
34 *
35 * --------------------------------------------------------
36 * Please note most debug prints are set to logging priority = debug
37 * This is the lowest level, and most verbose. Please refer to manual
38 * pages for syslogd or syslogd-ng on how to configure this.
39 */
40
41#define MPT_DEBUG 0x00000001
42#define MPT_DEBUG_MSG_FRAME 0x00000002
43#define MPT_DEBUG_SG 0x00000004
44#define MPT_DEBUG_EVENTS 0x00000008
45#define MPT_DEBUG_VERBOSE_EVENTS 0x00000010
46#define MPT_DEBUG_INIT 0x00000020
47#define MPT_DEBUG_EXIT 0x00000040
48#define MPT_DEBUG_FAIL 0x00000080
49#define MPT_DEBUG_TM 0x00000100
50#define MPT_DEBUG_DV 0x00000200
51#define MPT_DEBUG_REPLY 0x00000400
52#define MPT_DEBUG_HANDSHAKE 0x00000800
53#define MPT_DEBUG_CONFIG 0x00001000
54#define MPT_DEBUG_DL 0x00002000
55#define MPT_DEBUG_RESET 0x00008000
56#define MPT_DEBUG_SCSI 0x00010000
57#define MPT_DEBUG_IOCTL 0x00020000
58#define MPT_DEBUG_FC 0x00080000
59#define MPT_DEBUG_SAS 0x00100000
60#define MPT_DEBUG_SAS_WIDE 0x00200000
61
62/*
63 * CONFIG_FUSION_LOGGING - enabled in Kconfig
64 */
65
66#ifdef CONFIG_FUSION_LOGGING
67#define MPT_CHECK_LOGGING(IOC, CMD, BITS) \
68{ \
69 if (IOC->debug_level & BITS) \
70 CMD; \
71}
72#else
73#define MPT_CHECK_LOGGING(IOC, CMD, BITS)
74#endif
75
76
77/*
78 * debug macros
79 */
80
81#define dprintk(IOC, CMD) \
82 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG)
83
84#define dsgprintk(IOC, CMD) \
85 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_SG)
86
87#define devtprintk(IOC, CMD) \
88 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_EVENTS)
89
90#define devtverboseprintk(IOC, CMD) \
91 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_VERBOSE_EVENTS)
92
93#define dinitprintk(IOC, CMD) \
94 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_INIT)
95
96#define dexitprintk(IOC, CMD) \
97 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_EXIT)
98
99#define dfailprintk(IOC, CMD) \
100 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_FAIL)
101
102#define dtmprintk(IOC, CMD) \
103 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_TM)
104
105#define ddvprintk(IOC, CMD) \
106 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_DV)
107
108#define dreplyprintk(IOC, CMD) \
109 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_REPLY)
110
111#define dhsprintk(IOC, CMD) \
112 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_HANDSHAKE)
113
114#define dcprintk(IOC, CMD) \
115 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_CONFIG)
116
117#define ddlprintk(IOC, CMD) \
118 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_DL)
119
120#define drsprintk(IOC, CMD) \
121 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_RESET)
122
123#define dsprintk(IOC, CMD) \
124 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_SCSI)
125
126#define dctlprintk(IOC, CMD) \
127 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_IOCTL)
128
129#define dfcprintk(IOC, CMD) \
130 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_FC)
131
132#define dsasprintk(IOC, CMD) \
133 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_SAS)
134
135#define dsaswideprintk(IOC, CMD) \
136 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_SAS_WIDE)
137
138
139
140/*
141 * Verbose logging
142 */
143#if defined(MPT_DEBUG_VERBOSE) && defined(CONFIG_FUSION_LOGGING)
144static inline void
145DBG_DUMP_FW_DOWNLOAD(MPT_ADAPTER *ioc, u32 *mfp, int numfrags)
146{
147 int i;
148
149 if (!(ioc->debug_level & MPT_DEBUG))
150 return;
151 printk(KERN_DEBUG "F/W download request:\n");
152 for (i=0; i < 7+numfrags*2; i++)
153 printk(" %08x", le32_to_cpu(mfp[i]));
154 printk("\n");
155}
156
157static inline void
158DBG_DUMP_PUT_MSG_FRAME(MPT_ADAPTER *ioc, u32 *mfp)
159{
160 int ii, n;
161
162 if (!(ioc->debug_level & MPT_DEBUG_MSG_FRAME))
163 return;
164 printk(KERN_DEBUG "%s: About to Put msg frame @ %p:\n",
165 ioc->name, mfp);
166 n = ioc->req_sz/4 - 1;
167 while (mfp[n] == 0)
168 n--;
169 for (ii=0; ii<=n; ii++) {
170 if (ii && ((ii%8)==0))
171 printk("\n");
172 printk(" %08x", le32_to_cpu(mfp[ii]));
173 }
174 printk("\n");
175}
176
177static inline void
178DBG_DUMP_FW_REQUEST_FRAME(MPT_ADAPTER *ioc, u32 *mfp)
179{
180 int i, n;
181
182 if (!(ioc->debug_level & MPT_DEBUG_MSG_FRAME))
183 return;
184 n = 10;
185 printk(KERN_INFO " ");
186 for (i = 0; i < n; i++)
187 printk(" %08x", le32_to_cpu(mfp[i]));
188 printk("\n");
189}
190
191static inline void
192DBG_DUMP_REQUEST_FRAME(MPT_ADAPTER *ioc, u32 *mfp)
193{
194 int i, n;
195
196 if (!(ioc->debug_level & MPT_DEBUG_MSG_FRAME))
197 return;
198 n = 24;
199 for (i=0; i<n; i++) {
200 if (i && ((i%8)==0))
201 printk("\n");
202 printk("%08x ", le32_to_cpu(mfp[i]));
203 }
204 printk("\n");
205}
206
207static inline void
208DBG_DUMP_REPLY_FRAME(MPT_ADAPTER *ioc, u32 *mfp)
209{
210 int i, n;
211
212 if (!(ioc->debug_level & MPT_DEBUG_MSG_FRAME))
213 return;
214 n = (le32_to_cpu(mfp[0]) & 0x00FF0000) >> 16;
215 printk(KERN_INFO " ");
216 for (i=0; i<n; i++)
217 printk(" %08x", le32_to_cpu(mfp[i]));
218 printk("\n");
219}
220
221static inline void
222DBG_DUMP_REQUEST_FRAME_HDR(MPT_ADAPTER *ioc, u32 *mfp)
223{
224 int i, n;
225
226 if (!(ioc->debug_level & MPT_DEBUG_MSG_FRAME))
227 return;
228 n = 3;
229 printk(KERN_INFO " ");
230 for (i=0; i<n; i++)
231 printk(" %08x", le32_to_cpu(mfp[i]));
232 printk("\n");
233}
234
235static inline void
236DBG_DUMP_TM_REQUEST_FRAME(MPT_ADAPTER *ioc, u32 *mfp)
237{
238 int i, n;
239
240 if (!(ioc->debug_level & MPT_DEBUG_TM))
241 return;
242 n = 13;
243 printk(KERN_DEBUG "TM_REQUEST:\n");
244 for (i=0; i<n; i++) {
245 if (i && ((i%8)==0))
246 printk("\n");
247 printk("%08x ", le32_to_cpu(mfp[i]));
248 }
249 printk("\n");
250}
251
252static inline void
253DBG_DUMP_TM_REPLY_FRAME(MPT_ADAPTER *ioc, u32 *mfp)
254{
255 int i, n;
256
257 if (!(ioc->debug_level & MPT_DEBUG_TM))
258 return;
259 n = (le32_to_cpu(mfp[0]) & 0x00FF0000) >> 16;
260 printk(KERN_DEBUG "TM_REPLY MessageLength=%d:\n", n);
261 for (i=0; i<n; i++) {
262 if (i && ((i%8)==0))
263 printk("\n");
264 printk(" %08x", le32_to_cpu(mfp[i]));
265 }
266 printk("\n");
267}
268
269#define dmfprintk(IOC, CMD) \
270 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_MSG_FRAME)
271
272# else /* ifdef MPT_DEBUG_MF */
273
274#define DBG_DUMP_FW_DOWNLOAD(IOC, mfp, numfrags)
275#define DBG_DUMP_PUT_MSG_FRAME(IOC, mfp)
276#define DBG_DUMP_FW_REQUEST_FRAME(IOC, mfp)
277#define DBG_DUMP_REQUEST_FRAME(IOC, mfp)
278#define DBG_DUMP_REPLY_FRAME(IOC, mfp)
279#define DBG_DUMP_REQUEST_FRAME_HDR(IOC, mfp)
280#define DBG_DUMP_TM_REQUEST_FRAME(IOC, mfp)
281#define DBG_DUMP_TM_REPLY_FRAME(IOC, mfp)
282
283#define dmfprintk(IOC, CMD) \
284 MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_MSG_FRAME)
285
286#endif /* defined(MPT_DEBUG_VERBOSE) && defined(CONFIG_FUSION_LOGGING) */
287
288#endif /* ifndef MPTDEBUG_H_INCLUDED */