aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptspi.c
diff options
context:
space:
mode:
authorEric Moore <eric.moore@lsi.com>2007-01-29 11:44:06 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-02-02 21:50:25 -0500
commit873c82ed165a345fa381415b9734d26e9af4ec96 (patch)
tree62bb559f2768e887987c1f7dffeef126908b0cbf /drivers/message/fusion/mptspi.c
parent5a9c47b1344b514758d5d7f193c672850390cc36 (diff)
[SCSI] fusion - added mptspi debug
helpful debug for mptspi module Signed-off-by: Eric Moore <Eric.Moore@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message/fusion/mptspi.c')
-rw-r--r--drivers/message/fusion/mptspi.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index 4896d7cc681a..06a7b86f5f23 100644
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@ -65,6 +65,7 @@
65#include <scsi/scsi_tcq.h> 65#include <scsi/scsi_tcq.h>
66#include <scsi/scsi_transport.h> 66#include <scsi/scsi_transport.h>
67#include <scsi/scsi_transport_spi.h> 67#include <scsi/scsi_transport_spi.h>
68#include <scsi/scsi_dbg.h>
68 69
69#include "mptbase.h" 70#include "mptbase.h"
70#include "mptscsih.h" 71#include "mptscsih.h"
@@ -454,6 +455,56 @@ mptspi_target_destroy(struct scsi_target *starget)
454 starget->hostdata = NULL; 455 starget->hostdata = NULL;
455} 456}
456 457
458/**
459 * mptspi_print_write_nego - negotiation parameters debug info that is being sent
460 * @hd: Pointer to a SCSI HOST structure
461 * @starget: SCSI target
462 * @ii: negotiation parameters
463 *
464 */
465static void
466mptspi_print_write_nego(struct _MPT_SCSI_HOST *hd, struct scsi_target *starget, u32 ii)
467{
468 ddvprintk((MYIOC_s_INFO_FMT "id=%d Requested = 0x%08x"
469 " ( %s factor = 0x%02x @ offset = 0x%02x %s%s%s%s%s%s%s%s)\n",
470 hd->ioc->name, starget->id, ii,
471 ii & MPI_SCSIDEVPAGE0_NP_WIDE ? "Wide ": "",
472 ((ii >> 8) & 0xFF), ((ii >> 16) & 0xFF),
473 ii & MPI_SCSIDEVPAGE0_NP_IU ? "IU ": "",
474 ii & MPI_SCSIDEVPAGE0_NP_DT ? "DT ": "",
475 ii & MPI_SCSIDEVPAGE0_NP_QAS ? "QAS ": "",
476 ii & MPI_SCSIDEVPAGE0_NP_HOLD_MCS ? "HOLDMCS ": "",
477 ii & MPI_SCSIDEVPAGE0_NP_WR_FLOW ? "WRFLOW ": "",
478 ii & MPI_SCSIDEVPAGE0_NP_RD_STRM ? "RDSTRM ": "",
479 ii & MPI_SCSIDEVPAGE0_NP_RTI ? "RTI ": "",
480 ii & MPI_SCSIDEVPAGE0_NP_PCOMP_EN ? "PCOMP ": ""));
481}
482
483/**
484 * mptspi_print_read_nego - negotiation parameters debug info that is being read
485 * @hd: Pointer to a SCSI HOST structure
486 * @starget: SCSI target
487 * @ii: negotiation parameters
488 *
489 */
490static void
491mptspi_print_read_nego(struct _MPT_SCSI_HOST *hd, struct scsi_target *starget, u32 ii)
492{
493 ddvprintk((MYIOC_s_INFO_FMT "id=%d Read = 0x%08x"
494 " ( %s factor = 0x%02x @ offset = 0x%02x %s%s%s%s%s%s%s%s)\n",
495 hd->ioc->name, starget->id, ii,
496 ii & MPI_SCSIDEVPAGE0_NP_WIDE ? "Wide ": "",
497 ((ii >> 8) & 0xFF), ((ii >> 16) & 0xFF),
498 ii & MPI_SCSIDEVPAGE0_NP_IU ? "IU ": "",
499 ii & MPI_SCSIDEVPAGE0_NP_DT ? "DT ": "",
500 ii & MPI_SCSIDEVPAGE0_NP_QAS ? "QAS ": "",
501 ii & MPI_SCSIDEVPAGE0_NP_HOLD_MCS ? "HOLDMCS ": "",
502 ii & MPI_SCSIDEVPAGE0_NP_WR_FLOW ? "WRFLOW ": "",
503 ii & MPI_SCSIDEVPAGE0_NP_RD_STRM ? "RDSTRM ": "",
504 ii & MPI_SCSIDEVPAGE0_NP_RTI ? "RTI ": "",
505 ii & MPI_SCSIDEVPAGE0_NP_PCOMP_EN ? "PCOMP ": ""));
506}
507
457static int mptspi_read_spi_device_pg0(struct scsi_target *starget, 508static int mptspi_read_spi_device_pg0(struct scsi_target *starget,
458 struct _CONFIG_PAGE_SCSI_DEVICE_0 *pass_pg0) 509 struct _CONFIG_PAGE_SCSI_DEVICE_0 *pass_pg0)
459{ 510{
@@ -507,6 +558,8 @@ static int mptspi_read_spi_device_pg0(struct scsi_target *starget,
507 err = 0; 558 err = 0;
508 memcpy(pass_pg0, pg0, size); 559 memcpy(pass_pg0, pg0, size);
509 560
561 mptspi_print_read_nego(hd, starget, le32_to_cpu(pg0->NegotiatedParameters));
562
510 out_free: 563 out_free:
511 dma_free_coherent(&ioc->pcidev->dev, size, pg0, pg0_dma); 564 dma_free_coherent(&ioc->pcidev->dev, size, pg0, pg0_dma);
512 return err; 565 return err;
@@ -681,6 +734,12 @@ static int mptspi_slave_configure(struct scsi_device *sdev)
681 734
682 mptspi_initTarget(hd, vtarget, sdev); 735 mptspi_initTarget(hd, vtarget, sdev);
683 736
737 ddvprintk((MYIOC_s_INFO_FMT "id=%d min_period=0x%02x"
738 " max_offset=0x%02x max_width=%d\n", hd->ioc->name,
739 sdev->id, spi_min_period(scsi_target(sdev)),
740 spi_max_offset(scsi_target(sdev)),
741 spi_max_width(scsi_target(sdev))));
742
684 if ((sdev->channel == 1 || 743 if ((sdev->channel == 1 ||
685 !(mptspi_is_raid(hd, sdev->id))) && 744 !(mptspi_is_raid(hd, sdev->id))) &&
686 !spi_initial_dv(sdev->sdev_target)) 745 !spi_initial_dv(sdev->sdev_target))
@@ -708,6 +767,11 @@ mptspi_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
708 return 0; 767 return 0;
709 } 768 }
710 769
770#ifdef MPT_DEBUG_DV
771 if (spi_dv_pending(scsi_target(SCpnt->device)))
772 scsi_print_command(SCpnt);
773#endif
774
711 return mptscsih_qcmd(SCpnt,done); 775 return mptscsih_qcmd(SCpnt,done);
712} 776}
713 777
@@ -806,6 +870,8 @@ static int mptspi_write_spi_device_pg1(struct scsi_target *starget,
806 pg1->Header.PageNumber = hdr.PageNumber; 870 pg1->Header.PageNumber = hdr.PageNumber;
807 pg1->Header.PageType = hdr.PageType; 871 pg1->Header.PageType = hdr.PageType;
808 872
873 mptspi_print_write_nego(hd, starget, le32_to_cpu(pg1->RequestedParameters));
874
809 if (mpt_config(ioc, &cfg)) { 875 if (mpt_config(ioc, &cfg)) {
810 starget_printk(KERN_ERR, starget, "mpt_config failed\n"); 876 starget_printk(KERN_ERR, starget, "mpt_config failed\n");
811 goto out_free; 877 goto out_free;