aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2007-03-04 15:19:07 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-03-04 15:33:20 -0500
commit6b4df7ee1f636f0dbf3896235582559c86cb18aa (patch)
treed808dfae2f33116427df7eaf10f4b4bf6274b9ee /drivers/scsi
parentbb71f99f8daefb4a2c2441298bc127aaff9af947 (diff)
[ARM] ARM FAS216: don't modify scsi_cmnd request_bufflen
SCSI doesn't want drivers to modify request_bufflen, so keep a driver-private copy of this in the scsi_pointer structure instead. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/arm/fas216.c9
-rw-r--r--drivers/scsi/arm/scsi.h2
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c
index 2969cc0ff259..fb5f20284389 100644
--- a/drivers/scsi/arm/fas216.c
+++ b/drivers/scsi/arm/fas216.c
@@ -633,7 +633,7 @@ static void fas216_updateptrs(FAS216_Info *info, int bytes_transferred)
633 633
634 BUG_ON(bytes_transferred < 0); 634 BUG_ON(bytes_transferred < 0);
635 635
636 info->SCpnt->request_bufflen -= bytes_transferred; 636 SCp->phase -= bytes_transferred;
637 637
638 while (bytes_transferred != 0) { 638 while (bytes_transferred != 0) {
639 if (SCp->this_residual > bytes_transferred) 639 if (SCp->this_residual > bytes_transferred)
@@ -715,7 +715,7 @@ static void fas216_cleanuptransfer(FAS216_Info *info)
715 return; 715 return;
716 716
717 if (dmatype == fasdma_real_all) 717 if (dmatype == fasdma_real_all)
718 total = info->SCpnt->request_bufflen; 718 total = info->scsi.SCp.phase;
719 else 719 else
720 total = info->scsi.SCp.this_residual; 720 total = info->scsi.SCp.this_residual;
721 721
@@ -753,7 +753,7 @@ static void fas216_transfer(FAS216_Info *info)
753 fas216_log(info, LOG_BUFFER, 753 fas216_log(info, LOG_BUFFER,
754 "starttransfer: buffer %p length 0x%06x reqlen 0x%06x", 754 "starttransfer: buffer %p length 0x%06x reqlen 0x%06x",
755 info->scsi.SCp.ptr, info->scsi.SCp.this_residual, 755 info->scsi.SCp.ptr, info->scsi.SCp.this_residual,
756 info->SCpnt->request_bufflen); 756 info->scsi.SCp.phase);
757 757
758 if (!info->scsi.SCp.ptr) { 758 if (!info->scsi.SCp.ptr) {
759 fas216_log(info, LOG_ERROR, "null buffer passed to " 759 fas216_log(info, LOG_ERROR, "null buffer passed to "
@@ -784,7 +784,7 @@ static void fas216_transfer(FAS216_Info *info)
784 info->dma.transfer_type = dmatype; 784 info->dma.transfer_type = dmatype;
785 785
786 if (dmatype == fasdma_real_all) 786 if (dmatype == fasdma_real_all)
787 fas216_set_stc(info, info->SCpnt->request_bufflen); 787 fas216_set_stc(info, info->scsi.SCp.phase);
788 else 788 else
789 fas216_set_stc(info, info->scsi.SCp.this_residual); 789 fas216_set_stc(info, info->scsi.SCp.this_residual);
790 790
@@ -2114,6 +2114,7 @@ request_sense:
2114 SCpnt->SCp.buffers_residual = 0; 2114 SCpnt->SCp.buffers_residual = 0;
2115 SCpnt->SCp.ptr = (char *)SCpnt->sense_buffer; 2115 SCpnt->SCp.ptr = (char *)SCpnt->sense_buffer;
2116 SCpnt->SCp.this_residual = sizeof(SCpnt->sense_buffer); 2116 SCpnt->SCp.this_residual = sizeof(SCpnt->sense_buffer);
2117 SCpnt->SCp.phase = sizeof(SCpnt->sense_buffer);
2117 SCpnt->SCp.Message = 0; 2118 SCpnt->SCp.Message = 0;
2118 SCpnt->SCp.Status = 0; 2119 SCpnt->SCp.Status = 0;
2119 SCpnt->request_bufflen = sizeof(SCpnt->sense_buffer); 2120 SCpnt->request_bufflen = sizeof(SCpnt->sense_buffer);
diff --git a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h
index 3a39579bd08e..21ba57155bea 100644
--- a/drivers/scsi/arm/scsi.h
+++ b/drivers/scsi/arm/scsi.h
@@ -80,6 +80,7 @@ static inline void init_SCp(struct scsi_cmnd *SCpnt)
80 (page_address(SCpnt->SCp.buffer->page) + 80 (page_address(SCpnt->SCp.buffer->page) +
81 SCpnt->SCp.buffer->offset); 81 SCpnt->SCp.buffer->offset);
82 SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length; 82 SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length;
83 SCpnt->SCp.phase = SCpnt->request_bufflen;
83 84
84#ifdef BELT_AND_BRACES 85#ifdef BELT_AND_BRACES
85 /* 86 /*
@@ -98,6 +99,7 @@ static inline void init_SCp(struct scsi_cmnd *SCpnt)
98 } else { 99 } else {
99 SCpnt->SCp.ptr = (unsigned char *)SCpnt->request_buffer; 100 SCpnt->SCp.ptr = (unsigned char *)SCpnt->request_buffer;
100 SCpnt->SCp.this_residual = SCpnt->request_bufflen; 101 SCpnt->SCp.this_residual = SCpnt->request_bufflen;
102 SCpnt->SCp.phase = SCpnt->request_bufflen;
101 } 103 }
102 104
103 /* 105 /*