#ifndef MPTDEBUG_H_INCLUDED
#define MPTDEBUG_H_INCLUDED
#define MPT_DEBUG …
#define MPT_DEBUG_MSG_FRAME …
#define MPT_DEBUG_SG …
#define MPT_DEBUG_EVENTS …
#define MPT_DEBUG_VERBOSE_EVENTS …
#define MPT_DEBUG_INIT …
#define MPT_DEBUG_EXIT …
#define MPT_DEBUG_FAIL …
#define MPT_DEBUG_TM …
#define MPT_DEBUG_DV …
#define MPT_DEBUG_REPLY …
#define MPT_DEBUG_HANDSHAKE …
#define MPT_DEBUG_CONFIG …
#define MPT_DEBUG_DL …
#define MPT_DEBUG_RESET …
#define MPT_DEBUG_SCSI …
#define MPT_DEBUG_IOCTL …
#define MPT_DEBUG_FC …
#define MPT_DEBUG_SAS …
#define MPT_DEBUG_SAS_WIDE …
#define MPT_DEBUG_36GB_MEM …
#ifdef CONFIG_FUSION_LOGGING
#define MPT_CHECK_LOGGING(IOC, CMD, BITS) …
#else
#define MPT_CHECK_LOGGING …
#endif
#define dprintk(IOC, CMD) …
#define dsgprintk(IOC, CMD) …
#define devtprintk(IOC, CMD) …
#define devtverboseprintk(IOC, CMD) …
#define dinitprintk(IOC, CMD) …
#define dexitprintk(IOC, CMD) …
#define dfailprintk(IOC, CMD) …
#define dtmprintk(IOC, CMD) …
#define ddvprintk(IOC, CMD) …
#define dreplyprintk(IOC, CMD) …
#define dhsprintk(IOC, CMD) …
#define dcprintk(IOC, CMD) …
#define ddlprintk(IOC, CMD) …
#define drsprintk(IOC, CMD) …
#define dsprintk(IOC, CMD) …
#define dctlprintk(IOC, CMD) …
#define dfcprintk(IOC, CMD) …
#define dsasprintk(IOC, CMD) …
#define dsaswideprintk(IOC, CMD) …
#define d36memprintk(IOC, CMD) …
#if defined(MPT_DEBUG_VERBOSE) && defined(CONFIG_FUSION_LOGGING)
static inline void
DBG_DUMP_FW_DOWNLOAD(MPT_ADAPTER *ioc, u32 *mfp, int numfrags)
{
int i;
if (!(ioc->debug_level & MPT_DEBUG))
return;
printk(KERN_DEBUG "F/W download request:\n");
for (i=0; i < 7+numfrags*2; i++)
printk(" %08x", le32_to_cpu(mfp[i]));
printk("\n");
}
static inline void
DBG_DUMP_PUT_MSG_FRAME(MPT_ADAPTER *ioc, u32 *mfp)
{
int ii, n;
if (!(ioc->debug_level & MPT_DEBUG_MSG_FRAME))
return;
printk(KERN_DEBUG "%s: About to Put msg frame @ %p:\n",
ioc->name, mfp);
n = ioc->req_sz/4 - 1;
while (mfp[n] == 0)
n--;
for (ii=0; ii<=n; ii++) {
if (ii && ((ii%8)==0))
printk("\n");
printk(" %08x", le32_to_cpu(mfp[ii]));
}
printk("\n");
}
static inline void
DBG_DUMP_FW_REQUEST_FRAME(MPT_ADAPTER *ioc, u32 *mfp)
{
int i, n;
if (!(ioc->debug_level & MPT_DEBUG_MSG_FRAME))
return;
n = 10;
printk(KERN_INFO " ");
for (i = 0; i < n; i++)
printk(" %08x", le32_to_cpu(mfp[i]));
printk("\n");
}
static inline void
DBG_DUMP_REQUEST_FRAME(MPT_ADAPTER *ioc, u32 *mfp)
{
int i, n;
if (!(ioc->debug_level & MPT_DEBUG_MSG_FRAME))
return;
n = 24;
for (i=0; i<n; i++) {
if (i && ((i%8)==0))
printk("\n");
printk("%08x ", le32_to_cpu(mfp[i]));
}
printk("\n");
}
static inline void
DBG_DUMP_REPLY_FRAME(MPT_ADAPTER *ioc, u32 *mfp)
{
int i, n;
if (!(ioc->debug_level & MPT_DEBUG_MSG_FRAME))
return;
n = (le32_to_cpu(mfp[0]) & 0x00FF0000) >> 16;
printk(KERN_INFO " ");
for (i=0; i<n; i++)
printk(" %08x", le32_to_cpu(mfp[i]));
printk("\n");
}
static inline void
DBG_DUMP_REQUEST_FRAME_HDR(MPT_ADAPTER *ioc, u32 *mfp)
{
int i, n;
if (!(ioc->debug_level & MPT_DEBUG_MSG_FRAME))
return;
n = 3;
printk(KERN_INFO " ");
for (i=0; i<n; i++)
printk(" %08x", le32_to_cpu(mfp[i]));
printk("\n");
}
static inline void
DBG_DUMP_TM_REQUEST_FRAME(MPT_ADAPTER *ioc, u32 *mfp)
{
int i, n;
if (!(ioc->debug_level & MPT_DEBUG_TM))
return;
n = 13;
printk(KERN_DEBUG "TM_REQUEST:\n");
for (i=0; i<n; i++) {
if (i && ((i%8)==0))
printk("\n");
printk("%08x ", le32_to_cpu(mfp[i]));
}
printk("\n");
}
static inline void
DBG_DUMP_TM_REPLY_FRAME(MPT_ADAPTER *ioc, u32 *mfp)
{
int i, n;
if (!(ioc->debug_level & MPT_DEBUG_TM))
return;
n = (le32_to_cpu(mfp[0]) & 0x00FF0000) >> 16;
printk(KERN_DEBUG "TM_REPLY MessageLength=%d:\n", n);
for (i=0; i<n; i++) {
if (i && ((i%8)==0))
printk("\n");
printk(" %08x", le32_to_cpu(mfp[i]));
}
printk("\n");
}
#define dmfprintk …
# else
#define DBG_DUMP_FW_DOWNLOAD(IOC, mfp, numfrags) …
#define DBG_DUMP_PUT_MSG_FRAME(IOC, mfp) …
#define DBG_DUMP_FW_REQUEST_FRAME(IOC, mfp) …
#define DBG_DUMP_REQUEST_FRAME(IOC, mfp) …
#define DBG_DUMP_REPLY_FRAME(IOC, mfp) …
#define DBG_DUMP_REQUEST_FRAME_HDR(IOC, mfp) …
#define DBG_DUMP_TM_REQUEST_FRAME(IOC, mfp) …
#define DBG_DUMP_TM_REPLY_FRAME(IOC, mfp) …
#define dmfprintk(IOC, CMD) …
#endif
#endif