Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=873c82ed165a345fa381415b9734d26e9af4ec96
Commit:     873c82ed165a345fa381415b9734d26e9af4ec96
Parent:     5a9c47b1344b514758d5d7f193c672850390cc36
Author:     Eric Moore <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 29 09:44:06 2007 -0700
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Fri Feb 2 20:50:25 2007 -0600

    [SCSI] fusion - added mptspi debug
    
    helpful debug for mptspi module
    
    Signed-off-by: Eric Moore <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 drivers/message/fusion/Makefile  |    3 +-
 drivers/message/fusion/mptbase.h |    6 ---
 drivers/message/fusion/mptspi.c  |   66 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 67 insertions(+), 8 deletions(-)

diff --git a/drivers/message/fusion/Makefile b/drivers/message/fusion/Makefile
index 3217076..6171783 100644
--- a/drivers/message/fusion/Makefile
+++ b/drivers/message/fusion/Makefile
@@ -8,6 +8,7 @@
 #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
 
 #
@@ -21,8 +22,6 @@
 #CFLAGS_mptbase.o += -DMPT_DEBUG_RESET
 #
 #  For mptscsih:
-#CFLAGS_mptscsih.o += -DMPT_DEBUG_DV
-#CFLAGS_mptscsih.o += -DMPT_DEBUG_NEGO
 #CFLAGS_mptscsih.o += -DMPT_DEBUG_SCSI
 #CFLAGS_mptscsih.o += -DMPT_DEBUG_REPLY
 #
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index f82a817..a0ce2f4 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -791,12 +791,6 @@ typedef struct _mpt_sge {
 #define ddvprintk(x)
 #endif
 
-#ifdef MPT_DEBUG_NEGO
-#define dnegoprintk(x)  printk x
-#else
-#define dnegoprintk(x)
-#endif
-
 #if defined(MPT_DEBUG_DV) || defined(MPT_DEBUG_DV_TINY)
 #define ddvtprintk(x)  printk x
 #else
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index 4896d7c..06a7b86 100644
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@ -65,6 +65,7 @@
 #include <scsi/scsi_tcq.h>
 #include <scsi/scsi_transport.h>
 #include <scsi/scsi_transport_spi.h>
+#include <scsi/scsi_dbg.h>
 
 #include "mptbase.h"
 #include "mptscsih.h"
@@ -454,6 +455,56 @@ mptspi_target_destroy(struct scsi_target *starget)
        starget->hostdata = NULL;
 }
 
+/**
+ *     mptspi_print_write_nego - negotiation parameters debug info that is 
being sent
+ *     @hd: Pointer to a SCSI HOST structure
+ *     @starget: SCSI target
+ *     @ii: negotiation parameters
+ *
+ */
+static void
+mptspi_print_write_nego(struct _MPT_SCSI_HOST *hd, struct scsi_target 
*starget, u32 ii)
+{
+       ddvprintk((MYIOC_s_INFO_FMT "id=%d Requested = 0x%08x"
+           " ( %s factor = 0x%02x @ offset = 0x%02x %s%s%s%s%s%s%s%s)\n",
+           hd->ioc->name, starget->id, ii,
+           ii & MPI_SCSIDEVPAGE0_NP_WIDE ? "Wide ": "",
+           ((ii >> 8) & 0xFF), ((ii >> 16) & 0xFF),
+           ii & MPI_SCSIDEVPAGE0_NP_IU ? "IU ": "",
+           ii & MPI_SCSIDEVPAGE0_NP_DT ? "DT ": "",
+           ii & MPI_SCSIDEVPAGE0_NP_QAS ? "QAS ": "",
+           ii & MPI_SCSIDEVPAGE0_NP_HOLD_MCS ? "HOLDMCS ": "",
+           ii & MPI_SCSIDEVPAGE0_NP_WR_FLOW ? "WRFLOW ": "",
+           ii & MPI_SCSIDEVPAGE0_NP_RD_STRM ? "RDSTRM ": "",
+           ii & MPI_SCSIDEVPAGE0_NP_RTI ? "RTI ": "",
+           ii & MPI_SCSIDEVPAGE0_NP_PCOMP_EN ? "PCOMP ": ""));
+}
+
+/**
+ *     mptspi_print_read_nego - negotiation parameters debug info that is 
being read
+ *     @hd: Pointer to a SCSI HOST structure
+ *     @starget: SCSI target
+ *     @ii: negotiation parameters
+ *
+ */
+static void
+mptspi_print_read_nego(struct _MPT_SCSI_HOST *hd, struct scsi_target *starget, 
u32 ii)
+{
+       ddvprintk((MYIOC_s_INFO_FMT "id=%d Read = 0x%08x"
+           " ( %s factor = 0x%02x @ offset = 0x%02x %s%s%s%s%s%s%s%s)\n",
+           hd->ioc->name, starget->id, ii,
+           ii & MPI_SCSIDEVPAGE0_NP_WIDE ? "Wide ": "",
+           ((ii >> 8) & 0xFF), ((ii >> 16) & 0xFF),
+           ii & MPI_SCSIDEVPAGE0_NP_IU ? "IU ": "",
+           ii & MPI_SCSIDEVPAGE0_NP_DT ? "DT ": "",
+           ii & MPI_SCSIDEVPAGE0_NP_QAS ? "QAS ": "",
+           ii & MPI_SCSIDEVPAGE0_NP_HOLD_MCS ? "HOLDMCS ": "",
+           ii & MPI_SCSIDEVPAGE0_NP_WR_FLOW ? "WRFLOW ": "",
+           ii & MPI_SCSIDEVPAGE0_NP_RD_STRM ? "RDSTRM ": "",
+           ii & MPI_SCSIDEVPAGE0_NP_RTI ? "RTI ": "",
+           ii & MPI_SCSIDEVPAGE0_NP_PCOMP_EN ? "PCOMP ": ""));
+}
+
 static int mptspi_read_spi_device_pg0(struct scsi_target *starget,
                             struct _CONFIG_PAGE_SCSI_DEVICE_0 *pass_pg0)
 {
@@ -507,6 +558,8 @@ static int mptspi_read_spi_device_pg0(struct scsi_target 
*starget,
        err = 0;
        memcpy(pass_pg0, pg0, size);
 
+       mptspi_print_read_nego(hd, starget, 
le32_to_cpu(pg0->NegotiatedParameters));
+
  out_free:
        dma_free_coherent(&ioc->pcidev->dev, size, pg0, pg0_dma);
        return err;
@@ -681,6 +734,12 @@ static int mptspi_slave_configure(struct scsi_device *sdev)
 
        mptspi_initTarget(hd, vtarget, sdev);
 
+       ddvprintk((MYIOC_s_INFO_FMT "id=%d min_period=0x%02x"
+               " max_offset=0x%02x max_width=%d\n", hd->ioc->name,
+               sdev->id, spi_min_period(scsi_target(sdev)),
+               spi_max_offset(scsi_target(sdev)),
+               spi_max_width(scsi_target(sdev))));
+
        if ((sdev->channel == 1 ||
             !(mptspi_is_raid(hd, sdev->id))) &&
            !spi_initial_dv(sdev->sdev_target))
@@ -708,6 +767,11 @@ mptspi_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct 
scsi_cmnd *))
                return 0;
        }
 
+#ifdef MPT_DEBUG_DV
+       if (spi_dv_pending(scsi_target(SCpnt->device)))
+               scsi_print_command(SCpnt);
+#endif
+
        return mptscsih_qcmd(SCpnt,done);
 }
 
@@ -806,6 +870,8 @@ static int mptspi_write_spi_device_pg1(struct scsi_target 
*starget,
        pg1->Header.PageNumber = hdr.PageNumber;
        pg1->Header.PageType = hdr.PageType;
 
+       mptspi_print_write_nego(hd, starget, 
le32_to_cpu(pg1->RequestedParameters));
+
        if (mpt_config(ioc, &cfg)) {
                starget_printk(KERN_ERR, starget, "mpt_config failed\n");
                goto out_free;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to