Commit 6b4df7ee authored by Russell King's avatar Russell King Committed by Russell King

[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: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent bb71f99f
...@@ -633,7 +633,7 @@ static void fas216_updateptrs(FAS216_Info *info, int bytes_transferred) ...@@ -633,7 +633,7 @@ static void fas216_updateptrs(FAS216_Info *info, int bytes_transferred)
BUG_ON(bytes_transferred < 0); BUG_ON(bytes_transferred < 0);
info->SCpnt->request_bufflen -= bytes_transferred; SCp->phase -= bytes_transferred;
while (bytes_transferred != 0) { while (bytes_transferred != 0) {
if (SCp->this_residual > bytes_transferred) if (SCp->this_residual > bytes_transferred)
...@@ -715,7 +715,7 @@ static void fas216_cleanuptransfer(FAS216_Info *info) ...@@ -715,7 +715,7 @@ static void fas216_cleanuptransfer(FAS216_Info *info)
return; return;
if (dmatype == fasdma_real_all) if (dmatype == fasdma_real_all)
total = info->SCpnt->request_bufflen; total = info->scsi.SCp.phase;
else else
total = info->scsi.SCp.this_residual; total = info->scsi.SCp.this_residual;
...@@ -753,7 +753,7 @@ static void fas216_transfer(FAS216_Info *info) ...@@ -753,7 +753,7 @@ static void fas216_transfer(FAS216_Info *info)
fas216_log(info, LOG_BUFFER, fas216_log(info, LOG_BUFFER,
"starttransfer: buffer %p length 0x%06x reqlen 0x%06x", "starttransfer: buffer %p length 0x%06x reqlen 0x%06x",
info->scsi.SCp.ptr, info->scsi.SCp.this_residual, info->scsi.SCp.ptr, info->scsi.SCp.this_residual,
info->SCpnt->request_bufflen); info->scsi.SCp.phase);
if (!info->scsi.SCp.ptr) { if (!info->scsi.SCp.ptr) {
fas216_log(info, LOG_ERROR, "null buffer passed to " fas216_log(info, LOG_ERROR, "null buffer passed to "
...@@ -784,7 +784,7 @@ static void fas216_transfer(FAS216_Info *info) ...@@ -784,7 +784,7 @@ static void fas216_transfer(FAS216_Info *info)
info->dma.transfer_type = dmatype; info->dma.transfer_type = dmatype;
if (dmatype == fasdma_real_all) if (dmatype == fasdma_real_all)
fas216_set_stc(info, info->SCpnt->request_bufflen); fas216_set_stc(info, info->scsi.SCp.phase);
else else
fas216_set_stc(info, info->scsi.SCp.this_residual); fas216_set_stc(info, info->scsi.SCp.this_residual);
...@@ -2114,6 +2114,7 @@ fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result) ...@@ -2114,6 +2114,7 @@ fas216_std_done(FAS216_Info *info, struct scsi_cmnd *SCpnt, unsigned int result)
SCpnt->SCp.buffers_residual = 0; SCpnt->SCp.buffers_residual = 0;
SCpnt->SCp.ptr = (char *)SCpnt->sense_buffer; SCpnt->SCp.ptr = (char *)SCpnt->sense_buffer;
SCpnt->SCp.this_residual = sizeof(SCpnt->sense_buffer); SCpnt->SCp.this_residual = sizeof(SCpnt->sense_buffer);
SCpnt->SCp.phase = sizeof(SCpnt->sense_buffer);
SCpnt->SCp.Message = 0; SCpnt->SCp.Message = 0;
SCpnt->SCp.Status = 0; SCpnt->SCp.Status = 0;
SCpnt->request_bufflen = sizeof(SCpnt->sense_buffer); SCpnt->request_bufflen = sizeof(SCpnt->sense_buffer);
......
...@@ -80,6 +80,7 @@ static inline void init_SCp(struct scsi_cmnd *SCpnt) ...@@ -80,6 +80,7 @@ static inline void init_SCp(struct scsi_cmnd *SCpnt)
(page_address(SCpnt->SCp.buffer->page) + (page_address(SCpnt->SCp.buffer->page) +
SCpnt->SCp.buffer->offset); SCpnt->SCp.buffer->offset);
SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length; SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length;
SCpnt->SCp.phase = SCpnt->request_bufflen;
#ifdef BELT_AND_BRACES #ifdef BELT_AND_BRACES
/* /*
...@@ -98,6 +99,7 @@ static inline void init_SCp(struct scsi_cmnd *SCpnt) ...@@ -98,6 +99,7 @@ static inline void init_SCp(struct scsi_cmnd *SCpnt)
} else { } else {
SCpnt->SCp.ptr = (unsigned char *)SCpnt->request_buffer; SCpnt->SCp.ptr = (unsigned char *)SCpnt->request_buffer;
SCpnt->SCp.this_residual = SCpnt->request_bufflen; SCpnt->SCp.this_residual = SCpnt->request_bufflen;
SCpnt->SCp.phase = SCpnt->request_bufflen;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment