diff options
Diffstat (limited to 'drivers/scsi/NCR5380.c')
-rw-r--r-- | drivers/scsi/NCR5380.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index 2597209183d0..1e9f82884f70 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c | |||
@@ -295,16 +295,16 @@ static __inline__ void initialize_SCp(Scsi_Cmnd * cmd) | |||
295 | * various queues are valid. | 295 | * various queues are valid. |
296 | */ | 296 | */ |
297 | 297 | ||
298 | if (cmd->use_sg) { | 298 | if (scsi_bufflen(cmd)) { |
299 | cmd->SCp.buffer = (struct scatterlist *) cmd->request_buffer; | 299 | cmd->SCp.buffer = scsi_sglist(cmd); |
300 | cmd->SCp.buffers_residual = cmd->use_sg - 1; | 300 | cmd->SCp.buffers_residual = scsi_sg_count(cmd) - 1; |
301 | cmd->SCp.ptr = sg_virt(cmd->SCp.buffer); | 301 | cmd->SCp.ptr = sg_virt(cmd->SCp.buffer); |
302 | cmd->SCp.this_residual = cmd->SCp.buffer->length; | 302 | cmd->SCp.this_residual = cmd->SCp.buffer->length; |
303 | } else { | 303 | } else { |
304 | cmd->SCp.buffer = NULL; | 304 | cmd->SCp.buffer = NULL; |
305 | cmd->SCp.buffers_residual = 0; | 305 | cmd->SCp.buffers_residual = 0; |
306 | cmd->SCp.ptr = (char *) cmd->request_buffer; | 306 | cmd->SCp.ptr = NULL; |
307 | cmd->SCp.this_residual = cmd->request_bufflen; | 307 | cmd->SCp.this_residual = 0; |
308 | } | 308 | } |
309 | } | 309 | } |
310 | 310 | ||
@@ -975,14 +975,14 @@ static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) | |||
975 | case WRITE_6: | 975 | case WRITE_6: |
976 | case WRITE_10: | 976 | case WRITE_10: |
977 | hostdata->time_write[cmd->device->id] -= (jiffies - hostdata->timebase); | 977 | hostdata->time_write[cmd->device->id] -= (jiffies - hostdata->timebase); |
978 | hostdata->bytes_write[cmd->device->id] += cmd->request_bufflen; | 978 | hostdata->bytes_write[cmd->device->id] += scsi_bufflen(cmd); |
979 | hostdata->pendingw++; | 979 | hostdata->pendingw++; |
980 | break; | 980 | break; |
981 | case READ: | 981 | case READ: |
982 | case READ_6: | 982 | case READ_6: |
983 | case READ_10: | 983 | case READ_10: |
984 | hostdata->time_read[cmd->device->id] -= (jiffies - hostdata->timebase); | 984 | hostdata->time_read[cmd->device->id] -= (jiffies - hostdata->timebase); |
985 | hostdata->bytes_read[cmd->device->id] += cmd->request_bufflen; | 985 | hostdata->bytes_read[cmd->device->id] += scsi_bufflen(cmd); |
986 | hostdata->pendingr++; | 986 | hostdata->pendingr++; |
987 | break; | 987 | break; |
988 | } | 988 | } |