diff options
author | Boaz Harrosh <bharrosh@panasas.com> | 2007-11-05 04:23:35 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-01-11 19:22:39 -0500 |
commit | 9e0fe44ddb9ed037188ac711af1e981ac32d3c32 (patch) | |
tree | 830f97b6e359696fd7a939d3b4a5689bbda01b54 /drivers/scsi/sun3_NCR5380.c | |
parent | 9a3dd65bafcfa3338cfb4b6b7e12ff59aca0ac28 (diff) |
[SCSI] NCR5380 family: convert to accessors & !use_sg cleanup
- This patch depends on:
NCR5380: Use scsi_eh API for REQUEST_SENSE invocation
- convert to accessors and !use_sg cleanup
- FIXME: Not sg-chain ready look for ++cmd->SCp.buffer
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/sun3_NCR5380.c')
-rw-r--r-- | drivers/scsi/sun3_NCR5380.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c index 2dcde373b20e..264f14ab5a61 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 | } |