Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 63144
b: refs/heads/master
c: 5c1b91b
h: refs/heads/master
v: v3
  • Loading branch information
Prakash, Sathya authored and James Bottomley committed Jul 28, 2007
1 parent 7a4a7c7 commit 5413457
Show file tree
Hide file tree
Showing 5 changed files with 309 additions and 230 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 92631fa4d0afa64b82144eab714fbf2f4049dabe
refs/heads/master: 5c1b91b9923d1b3d33576e391ff7b587bdff7a3e
14 changes: 14 additions & 0 deletions trunk/drivers/message/fusion/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,18 @@ config FUSION_LAN

If unsure whether you really want or need this, say N.

config FUSION_LOGGING
bool "Fusion MPT logging facility"
depends on FUSION
---help---
This turns on a logging facility that can be used to debug a number
of Fusion MPT related problems.

The debug level can be programmed on the fly via SysFS (hex values)

echo [level] > /sys/class/scsi_host/host#/debug_level

There are various debug levels that an be found in the source:
file:drivers/message/fusion/mptdebug.h

endmenu
37 changes: 3 additions & 34 deletions trunk/drivers/message/fusion/Makefile
Original file line number Diff line number Diff line change
@@ -1,39 +1,8 @@
# Fusion MPT drivers; recognized debug defines...
# MPT general:
#EXTRA_CFLAGS += -DMPT_DEBUG
#EXTRA_CFLAGS += -DMPT_DEBUG_MSG_FRAME
#EXTRA_CFLAGS += -DMPT_DEBUG_SG
#EXTRA_CFLAGS += -DMPT_DEBUG_EVENTS
#EXTRA_CFLAGS += -DMPT_DEBUG_VERBOSE_EVENTS
#EXTRA_CFLAGS += -DMPT_DEBUG_INIT
#EXTRA_CFLAGS += -DMPT_DEBUG_EXIT
#EXTRA_CFLAGS += -DMPT_DEBUG_FAIL
#EXTRA_CFLAGS += -DMPT_DEBUG_DV
#EXTRA_CFLAGS += -DMPT_DEBUG_TM
#EXTRA_CFLAGS += -DMPT_DEBUG_REPLY

#
# driver/module specifics...
#
# For mptbase:
#CFLAGS_mptbase.o += -DMPT_DEBUG_HANDSHAKE
#CFLAGS_mptbase.o += -DMPT_DEBUG_CONFIG
#CFLAGS_mptbase.o += -DMPT_DEBUG_DL
#CFLAGS_mptbase.o += -DMPT_DEBUG_IRQ
#CFLAGS_mptbase.o += -DMPT_DEBUG_RESET
#
# For mptscsih:
#CFLAGS_mptscsih.o += -DMPT_DEBUG_SCSI
#
# For mptctl:
#CFLAGS_mptctl.o += -DMPT_DEBUG_IOCTL
#
# For mptfc:
#CFLAGS_mptfc.o += -DMPT_DEBUG_FC

# For mptsas:
#CFLAGS_mptsas.o += -DMPT_DEBUG_SAS
#CFLAGS_mptsas.o += -DMPT_DEBUG_SAS_WIDE
# enable verbose logging
# CONFIG_FUSION_LOGGING needs to be enabled in Kconfig
#EXTRA_CFLAGS += -DMPT_DEBUG_VERBOSE


#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC
Expand Down
198 changes: 3 additions & 195 deletions trunk/drivers/message/fusion/mptbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
* MPT drivers. NOTE: Users of these macro defs must
* themselves define their own MYNAM.
*/
#define MYIOC_s_DEBUG_FMT KERN_DEBUG MYNAM ": %s: "
#define MYIOC_s_INFO_FMT KERN_INFO MYNAM ": %s: "
#define MYIOC_s_NOTE_FMT KERN_NOTICE MYNAM ": %s: "
#define MYIOC_s_WARN_FMT KERN_WARNING MYNAM ": %s: WARNING - "
Expand Down Expand Up @@ -543,6 +544,7 @@ typedef struct _MPT_ADAPTER
char board_tracer[16];
u16 nvdata_version_persistent;
u16 nvdata_version_default;
int debug_level;
u8 io_missing_delay;
u8 device_missing_delay;
SYSIF_REGS __iomem *chip; /* == c8817000 (mmap) */
Expand Down Expand Up @@ -718,171 +720,7 @@ typedef struct _mpt_sge {
/*
* Funky (private) macros...
*/
#ifdef MPT_DEBUG
#define dprintk(x) printk x
#else
#define dprintk(x)
#endif

#ifdef MPT_DEBUG_INIT
#define dinitprintk(x) printk x
#define DBG_DUMP_FW_REQUEST_FRAME(mfp) \
{ int i, n = 10; \
u32 *m = (u32 *)(mfp); \
printk(KERN_INFO " "); \
for (i=0; i<n; i++) \
printk(" %08x", le32_to_cpu(m[i])); \
printk("\n"); \
}
#else
#define dinitprintk(x)
#define DBG_DUMP_FW_REQUEST_FRAME(mfp)
#endif

#ifdef MPT_DEBUG_EXIT
#define dexitprintk(x) printk x
#else
#define dexitprintk(x)
#endif

#if defined MPT_DEBUG_FAIL || defined (MPT_DEBUG_SG)
#define dfailprintk(x) printk x
#else
#define dfailprintk(x)
#endif

#ifdef MPT_DEBUG_HANDSHAKE
#define dhsprintk(x) printk x
#else
#define dhsprintk(x)
#endif

#if defined(MPT_DEBUG_EVENTS) || defined(MPT_DEBUG_VERBOSE_EVENTS)
#define devtprintk(x) printk x
#else
#define devtprintk(x)
#endif

#ifdef MPT_DEBUG_VERBOSE_EVENTS
#define devtverboseprintk(x) printk x
#else
#define devtverboseprintk(x)
#endif

#ifdef MPT_DEBUG_RESET
#define drsprintk(x) printk x
#else
#define drsprintk(x)
#endif

//#if defined(MPT_DEBUG) || defined(MPT_DEBUG_MSG_FRAME)
#if defined(MPT_DEBUG_MSG_FRAME)
#define dmfprintk(x) printk x
#define DBG_DUMP_REQUEST_FRAME(mfp) \
{ int i, n = 24; \
u32 *m = (u32 *)(mfp); \
for (i=0; i<n; i++) { \
if (i && ((i%8)==0)) \
printk("\n"); \
printk("%08x ", le32_to_cpu(m[i])); \
} \
printk("\n"); \
}
#else
#define dmfprintk(x)
#define DBG_DUMP_REQUEST_FRAME(mfp)
#endif

#ifdef MPT_DEBUG_IRQ
#define dirqprintk(x) printk x
#else
#define dirqprintk(x)
#endif

#ifdef MPT_DEBUG_SG
#define dsgprintk(x) printk x
#else
#define dsgprintk(x)
#endif

#if defined(MPT_DEBUG_DL) || defined(MPT_DEBUG)
#define ddlprintk(x) printk x
#else
#define ddlprintk(x)
#endif

#ifdef MPT_DEBUG_DV
#define ddvprintk(x) printk x
#else
#define ddvprintk(x)
#endif

#if defined(MPT_DEBUG_DV) || defined(MPT_DEBUG_DV_TINY)
#define ddvtprintk(x) printk x
#else
#define ddvtprintk(x)
#endif

#ifdef MPT_DEBUG_IOCTL
#define dctlprintk(x) printk x
#else
#define dctlprintk(x)
#endif

#ifdef MPT_DEBUG_REPLY
#define dreplyprintk(x) printk x
#else
#define dreplyprintk(x)
#endif

#ifdef DMPT_DEBUG_FC
#define dfcprintk(x) printk x
#else
#define dfcprintk(x)
#endif

#ifdef MPT_DEBUG_TM
#define dtmprintk(x) printk x
#define DBG_DUMP_TM_REQUEST_FRAME(mfp) \
{ u32 *m = (u32 *)(mfp); \
int i, n = 13; \
printk("TM_REQUEST:\n"); \
for (i=0; i<n; i++) { \
if (i && ((i%8)==0)) \
printk("\n"); \
printk("%08x ", le32_to_cpu(m[i])); \
} \
printk("\n"); \
}
#define DBG_DUMP_TM_REPLY_FRAME(mfp) \
{ u32 *m = (u32 *)(mfp); \
int i, n = (le32_to_cpu(m[0]) & 0x00FF0000) >> 16; \
printk("TM_REPLY MessageLength=%d:\n", n); \
for (i=0; i<n; i++) { \
if (i && ((i%8)==0)) \
printk("\n"); \
printk(" %08x", le32_to_cpu(m[i])); \
} \
printk("\n"); \
}
#else
#define dtmprintk(x)
#define DBG_DUMP_TM_REQUEST_FRAME(mfp)
#define DBG_DUMP_TM_REPLY_FRAME(mfp)
#endif

#if defined(MPT_DEBUG_CONFIG) || defined(MPT_DEBUG)
#define dcprintk(x) printk x
#else
#define dcprintk(x)
#endif

#if defined(MPT_DEBUG_SCSI) || defined(MPT_DEBUG) || defined(MPT_DEBUG_MSG_FRAME)
#define dsprintk(x) printk x
#else
#define dsprintk(x)
#endif

#include "mptdebug.h"

#define MPT_INDEX_2_MFPTR(ioc,idx) \
(MPT_FRAME_HDR*)( (u8*)(ioc)->req_frames + (ioc)->req_sz * (idx) )
Expand All @@ -893,36 +731,6 @@ typedef struct _mpt_sge {
#define MPT_INDEX_2_RFPTR(ioc,idx) \
(MPT_FRAME_HDR*)( (u8*)(ioc)->reply_frames + (ioc)->req_sz * (idx) )

#if defined(MPT_DEBUG) || defined(MPT_DEBUG_MSG_FRAME)
#define DBG_DUMP_REPLY_FRAME(mfp) \
{ u32 *m = (u32 *)(mfp); \
int i, n = (le32_to_cpu(m[0]) & 0x00FF0000) >> 16; \
printk(KERN_INFO " "); \
for (i=0; i<n; i++) \
printk(" %08x", le32_to_cpu(m[i])); \
printk("\n"); \
}
#define DBG_DUMP_REQUEST_FRAME_HDR(mfp) \
{ int i, n = 3; \
u32 *m = (u32 *)(mfp); \
printk(KERN_INFO " "); \
for (i=0; i<n; i++) \
printk(" %08x", le32_to_cpu(m[i])); \
printk("\n"); \
}
#else
#define DBG_DUMP_REPLY_FRAME(mfp)
#define DBG_DUMP_REQUEST_FRAME_HDR(mfp)
#endif

// debug sas wide ports
#ifdef MPT_DEBUG_SAS_WIDE
#define dsaswideprintk(x) printk x
#else
#define dsaswideprintk(x)
#endif


/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/

#define SCSI_STD_SENSE_BYTES 18
Expand Down
Loading

0 comments on commit 5413457

Please sign in to comment.