[SCSI] mptfusion: Adding inline data padding support for TAPE drive.
authorKashyap, Desai <kashyap.desai@lsi.com>
Tue, 26 Apr 2011 06:39:46 +0000 (12:09 +0530)
committerJames Bottomley <James.Bottomley@suse.de>
Sun, 1 May 2011 16:57:50 +0000 (11:57 -0500)
Adding support for inline data padding for TAPE drive when running U320.

[jejb: whitespace fixes]
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/message/fusion/mptspi.c

index 6d9568d2ec59693235e2bf886c6daf46199e659f..8f61ba6aac239c210fbc99b1365e8115650fd2ed 100644 (file)
@@ -867,6 +867,10 @@ static int mptspi_write_spi_device_pg1(struct scsi_target *starget,
        struct _x_config_parms cfg;
        struct _CONFIG_PAGE_HEADER hdr;
        int err = -EBUSY;
+       u32 nego_parms;
+       u32 period;
+       struct scsi_device *sdev;
+       int i;
 
        /* don't allow updating nego parameters on RAID devices */
        if (starget->channel == 0 &&
@@ -904,6 +908,24 @@ static int mptspi_write_spi_device_pg1(struct scsi_target *starget,
        pg1->Header.PageNumber = hdr.PageNumber;
        pg1->Header.PageType = hdr.PageType;
 
+       nego_parms = le32_to_cpu(pg1->RequestedParameters);
+       period = (nego_parms & MPI_SCSIDEVPAGE1_RP_MIN_SYNC_PERIOD_MASK) >>
+               MPI_SCSIDEVPAGE1_RP_SHIFT_MIN_SYNC_PERIOD;
+       if (period == 8) {
+               /* Turn on inline data padding for TAPE when running U320 */
+               for (i = 0 ; i < 16; i++) {
+                       sdev = scsi_device_lookup_by_target(starget, i);
+                       if (sdev && sdev->type == TYPE_TAPE) {
+                               sdev_printk(KERN_DEBUG, sdev, MYIOC_s_FMT
+                                           "IDP:ON\n", ioc->name);
+                               nego_parms |= MPI_SCSIDEVPAGE1_RP_IDP;
+                               pg1->RequestedParameters =
+                                   cpu_to_le32(nego_parms);
+                               break;
+                       }
+               }
+       }
+
        mptspi_print_write_nego(hd, starget, le32_to_cpu(pg1->RequestedParameters));
 
        if (mpt_config(ioc, &cfg)) {