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/atari_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/atari_NCR5380.c')
-rw-r--r-- | drivers/scsi/atari_NCR5380.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c index a9680b5e8ac6..d2ca3fa4fcf5 100644 --- a/drivers/scsi/atari_NCR5380.c +++ b/drivers/scsi/atari_NCR5380.c | |||
@@ -511,9 +511,9 @@ static inline void initialize_SCp(Scsi_Cmnd *cmd) | |||
511 | * various queues are valid. | 511 | * various queues are valid. |
512 | */ | 512 | */ |
513 | 513 | ||
514 | if (cmd->use_sg) { | 514 | if (scsi_bufflen(cmd)) { |
515 | cmd->SCp.buffer = (struct scatterlist *)cmd->request_buffer; | 515 | cmd->SCp.buffer = scsi_sglist(cmd); |
516 | cmd->SCp.buffers_residual = cmd->use_sg - 1; | 516 | cmd->SCp.buffers_residual = scsi_sg_count(cmd) - 1; |
517 | cmd->SCp.ptr = sg_virt(cmd->SCp.buffer); | 517 | cmd->SCp.ptr = sg_virt(cmd->SCp.buffer); |
518 | cmd->SCp.this_residual = cmd->SCp.buffer->length; | 518 | cmd->SCp.this_residual = cmd->SCp.buffer->length; |
519 | /* ++roman: Try to merge some scatter-buffers if they are at | 519 | /* ++roman: Try to merge some scatter-buffers if they are at |
@@ -523,8 +523,8 @@ static inline void initialize_SCp(Scsi_Cmnd *cmd) | |||
523 | } else { | 523 | } else { |
524 | cmd->SCp.buffer = NULL; | 524 | cmd->SCp.buffer = NULL; |
525 | cmd->SCp.buffers_residual = 0; | 525 | cmd->SCp.buffers_residual = 0; |
526 | cmd->SCp.ptr = (char *)cmd->request_buffer; | 526 | cmd->SCp.ptr = NULL; |
527 | cmd->SCp.this_residual = cmd->request_bufflen; | 527 | cmd->SCp.this_residual = 0; |
528 | } | 528 | } |
529 | } | 529 | } |
530 | 530 | ||
@@ -936,21 +936,21 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) | |||
936 | } | 936 | } |
937 | # endif | 937 | # endif |
938 | # ifdef NCR5380_STAT_LIMIT | 938 | # ifdef NCR5380_STAT_LIMIT |
939 | if (cmd->request_bufflen > NCR5380_STAT_LIMIT) | 939 | if (scsi_bufflen(cmd) > NCR5380_STAT_LIMIT) |
940 | # endif | 940 | # endif |
941 | switch (cmd->cmnd[0]) { | 941 | switch (cmd->cmnd[0]) { |
942 | case WRITE: | 942 | case WRITE: |
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 | } |
@@ -1352,21 +1352,21 @@ static irqreturn_t NCR5380_intr(int irq, void *dev_id) | |||
1352 | static void collect_stats(struct NCR5380_hostdata* hostdata, Scsi_Cmnd *cmd) | 1352 | static void collect_stats(struct NCR5380_hostdata* hostdata, Scsi_Cmnd *cmd) |
1353 | { | 1353 | { |
1354 | # ifdef NCR5380_STAT_LIMIT | 1354 | # ifdef NCR5380_STAT_LIMIT |
1355 | if (cmd->request_bufflen > NCR5380_STAT_LIMIT) | 1355 | if (scsi_bufflen(cmd) > NCR5380_STAT_LIMIT) |
1356 | # endif | 1356 | # endif |
1357 | switch (cmd->cmnd[0]) { | 1357 | switch (cmd->cmnd[0]) { |
1358 | case WRITE: | 1358 | case WRITE: |
1359 | case WRITE_6: | 1359 | case WRITE_6: |
1360 | case WRITE_10: | 1360 | case WRITE_10: |
1361 | hostdata->time_write[cmd->device->id] += (jiffies - hostdata->timebase); | 1361 | hostdata->time_write[cmd->device->id] += (jiffies - hostdata->timebase); |
1362 | /*hostdata->bytes_write[cmd->device->id] += cmd->request_bufflen;*/ | 1362 | /*hostdata->bytes_write[cmd->device->id] += scsi_bufflen(cmd);*/ |
1363 | hostdata->pendingw--; | 1363 | hostdata->pendingw--; |
1364 | break; | 1364 | break; |
1365 | case READ: | 1365 | case READ: |
1366 | case READ_6: | 1366 | case READ_6: |
1367 | case READ_10: | 1367 | case READ_10: |
1368 | hostdata->time_read[cmd->device->id] += (jiffies - hostdata->timebase); | 1368 | hostdata->time_read[cmd->device->id] += (jiffies - hostdata->timebase); |
1369 | /*hostdata->bytes_read[cmd->device->id] += cmd->request_bufflen;*/ | 1369 | /*hostdata->bytes_read[cmd->device->id] += scsi_bufflen(cmd);*/ |
1370 | hostdata->pendingr--; | 1370 | hostdata->pendingr--; |
1371 | break; | 1371 | break; |
1372 | } | 1372 | } |