diff options
Diffstat (limited to 'drivers/scsi/sun3_NCR5380.c')
-rw-r--r-- | drivers/scsi/sun3_NCR5380.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c index 2dcde373b20e..bcaba86060ab 100644 --- a/drivers/scsi/sun3_NCR5380.c +++ b/drivers/scsi/sun3_NCR5380.c | |||
@@ -515,9 +515,9 @@ static __inline__ void initialize_SCp(struct scsi_cmnd *cmd) | |||
515 | * various queues are valid. | 515 | * various queues are valid. |
516 | */ | 516 | */ |
517 | 517 | ||
518 | if (cmd->use_sg) { | 518 | if (scsi_bufflen(cmd)) { |
519 | cmd->SCp.buffer = (struct scatterlist *) cmd->request_buffer; | 519 | cmd->SCp.buffer = scsi_sglist(cmd); |
520 | cmd->SCp.buffers_residual = cmd->use_sg - 1; | 520 | cmd->SCp.buffers_residual = scsi_sg_count(cmd) - 1; |
521 | cmd->SCp.ptr = (char *) SGADDR(cmd->SCp.buffer); | 521 | cmd->SCp.ptr = (char *) SGADDR(cmd->SCp.buffer); |
522 | cmd->SCp.this_residual = cmd->SCp.buffer->length; | 522 | cmd->SCp.this_residual = cmd->SCp.buffer->length; |
523 | 523 | ||
@@ -528,8 +528,8 @@ static __inline__ void initialize_SCp(struct scsi_cmnd *cmd) | |||
528 | } else { | 528 | } else { |
529 | cmd->SCp.buffer = NULL; | 529 | cmd->SCp.buffer = NULL; |
530 | cmd->SCp.buffers_residual = 0; | 530 | cmd->SCp.buffers_residual = 0; |
531 | cmd->SCp.ptr = (char *) cmd->request_buffer; | 531 | cmd->SCp.ptr = NULL; |
532 | cmd->SCp.this_residual = cmd->request_bufflen; | 532 | cmd->SCp.this_residual = 0; |
533 | } | 533 | } |
534 | 534 | ||
535 | } | 535 | } |
@@ -935,7 +935,7 @@ static int NCR5380_queue_command(struct scsi_cmnd *cmd, | |||
935 | } | 935 | } |
936 | # endif | 936 | # endif |
937 | # ifdef NCR5380_STAT_LIMIT | 937 | # ifdef NCR5380_STAT_LIMIT |
938 | if (cmd->request_bufflen > NCR5380_STAT_LIMIT) | 938 | if (scsi_bufflen(cmd) > NCR5380_STAT_LIMIT) |
939 | # endif | 939 | # endif |
940 | switch (cmd->cmnd[0]) | 940 | switch (cmd->cmnd[0]) |
941 | { | 941 | { |
@@ -943,14 +943,14 @@ static int NCR5380_queue_command(struct scsi_cmnd *cmd, | |||
943 | case WRITE_6: | 943 | case WRITE_6: |
944 | case WRITE_10: | 944 | case WRITE_10: |
945 | hostdata->time_write[cmd->device->id] -= (jiffies - hostdata->timebase); | 945 | hostdata->time_write[cmd->device->id] -= (jiffies - hostdata->timebase); |
946 | hostdata->bytes_write[cmd->device->id] += cmd->request_bufflen; | 946 | hostdata->bytes_write[cmd->device->id] += scsi_bufflen(cmd); |
947 | hostdata->pendingw++; | 947 | hostdata->pendingw++; |
948 | break; | 948 | break; |
949 | case READ: | 949 | case READ: |
950 | case READ_6: | 950 | case READ_6: |
951 | case READ_10: | 951 | case READ_10: |
952 | hostdata->time_read[cmd->device->id] -= (jiffies - hostdata->timebase); | 952 | hostdata->time_read[cmd->device->id] -= (jiffies - hostdata->timebase); |
953 | hostdata->bytes_read[cmd->device->id] += cmd->request_bufflen; | 953 | hostdata->bytes_read[cmd->device->id] += scsi_bufflen(cmd); |
954 | hostdata->pendingr++; | 954 | hostdata->pendingr++; |
955 | break; | 955 | break; |
956 | } | 956 | } |
@@ -1345,7 +1345,7 @@ static void collect_stats(struct NCR5380_hostdata *hostdata, | |||
1345 | struct scsi_cmnd *cmd) | 1345 | struct scsi_cmnd *cmd) |
1346 | { | 1346 | { |
1347 | # ifdef NCR5380_STAT_LIMIT | 1347 | # ifdef NCR5380_STAT_LIMIT |
1348 | if (cmd->request_bufflen > NCR5380_STAT_LIMIT) | 1348 | if (scsi_bufflen(cmd) > NCR5380_STAT_LIMIT) |
1349 | # endif | 1349 | # endif |
1350 | switch (cmd->cmnd[0]) | 1350 | switch (cmd->cmnd[0]) |
1351 | { | 1351 | { |
@@ -1353,14 +1353,14 @@ static void collect_stats(struct NCR5380_hostdata *hostdata, | |||
1353 | case WRITE_6: | 1353 | case WRITE_6: |
1354 | case WRITE_10: | 1354 | case WRITE_10: |
1355 | hostdata->time_write[cmd->device->id] += (jiffies - hostdata->timebase); | 1355 | hostdata->time_write[cmd->device->id] += (jiffies - hostdata->timebase); |
1356 | /*hostdata->bytes_write[cmd->device->id] += cmd->request_bufflen;*/ | 1356 | /*hostdata->bytes_write[cmd->device->id] += scsi_bufflen(cmd);*/ |
1357 | hostdata->pendingw--; | 1357 | hostdata->pendingw--; |
1358 | break; | 1358 | break; |
1359 | case READ: | 1359 | case READ: |
1360 | case READ_6: | 1360 | case READ_6: |
1361 | case READ_10: | 1361 | case READ_10: |
1362 | hostdata->time_read[cmd->device->id] += (jiffies - hostdata->timebase); | 1362 | hostdata->time_read[cmd->device->id] += (jiffies - hostdata->timebase); |
1363 | /*hostdata->bytes_read[cmd->device->id] += cmd->request_bufflen;*/ | 1363 | /*hostdata->bytes_read[cmd->device->id] += scsi_bufflen(cmd);*/ |
1364 | hostdata->pendingr--; | 1364 | hostdata->pendingr--; |
1365 | break; | 1365 | break; |
1366 | } | 1366 | } |
@@ -1863,7 +1863,7 @@ static int do_abort (struct Scsi_Host *host) | |||
1863 | * the target sees, so we just handshake. | 1863 | * the target sees, so we just handshake. |
1864 | */ | 1864 | */ |
1865 | 1865 | ||
1866 | while (!(tmp = NCR5380_read(STATUS_REG)) & SR_REQ); | 1866 | while (!((tmp = NCR5380_read(STATUS_REG)) & SR_REQ)); |
1867 | 1867 | ||
1868 | NCR5380_write(TARGET_COMMAND_REG, PHASE_SR_TO_TCR(tmp)); | 1868 | NCR5380_write(TARGET_COMMAND_REG, PHASE_SR_TO_TCR(tmp)); |
1869 | 1869 | ||