diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2007-05-14 06:27:06 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-05-26 20:18:10 -0400 |
commit | e7d6cf55ea47684b704d67a6046044c29bad4824 (patch) | |
tree | a74757d0a889d551d5ebdc84db80f04814d9fc58 /drivers/scsi/wd7000.c | |
parent | 58e2a02eb18393e76a469580fedf7caec190eb5e (diff) |
[SCSI] wd7000: convert to use the data buffer accessors
- remove the unnecessary map_single path.
- convert to use the new accessors for the sg lists and the
parameters.
Jens Axboe <jens.axboe@oracle.com> did the for_each_sg cleanup.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/wd7000.c')
-rw-r--r-- | drivers/scsi/wd7000.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c index 30be76514c43..d6fd4259c56b 100644 --- a/drivers/scsi/wd7000.c +++ b/drivers/scsi/wd7000.c | |||
@@ -1091,6 +1091,7 @@ static int wd7000_queuecommand(struct scsi_cmnd *SCpnt, | |||
1091 | unchar *cdb = (unchar *) SCpnt->cmnd; | 1091 | unchar *cdb = (unchar *) SCpnt->cmnd; |
1092 | unchar idlun; | 1092 | unchar idlun; |
1093 | short cdblen; | 1093 | short cdblen; |
1094 | int nseg; | ||
1094 | Adapter *host = (Adapter *) SCpnt->device->host->hostdata; | 1095 | Adapter *host = (Adapter *) SCpnt->device->host->hostdata; |
1095 | 1096 | ||
1096 | cdblen = SCpnt->cmd_len; | 1097 | cdblen = SCpnt->cmd_len; |
@@ -1106,28 +1107,29 @@ static int wd7000_queuecommand(struct scsi_cmnd *SCpnt, | |||
1106 | SCpnt->host_scribble = (unchar *) scb; | 1107 | SCpnt->host_scribble = (unchar *) scb; |
1107 | scb->host = host; | 1108 | scb->host = host; |
1108 | 1109 | ||
1109 | if (SCpnt->use_sg) { | 1110 | nseg = scsi_sg_count(SCpnt); |
1110 | struct scatterlist *sg = (struct scatterlist *) SCpnt->request_buffer; | 1111 | if (nseg) { |
1112 | struct scatterlist *sg; | ||
1111 | unsigned i; | 1113 | unsigned i; |
1112 | 1114 | ||
1113 | if (SCpnt->device->host->sg_tablesize == SG_NONE) { | 1115 | if (SCpnt->device->host->sg_tablesize == SG_NONE) { |
1114 | panic("wd7000_queuecommand: scatter/gather not supported.\n"); | 1116 | panic("wd7000_queuecommand: scatter/gather not supported.\n"); |
1115 | } | 1117 | } |
1116 | dprintk("Using scatter/gather with %d elements.\n", SCpnt->use_sg); | 1118 | dprintk("Using scatter/gather with %d elements.\n", nseg); |
1117 | 1119 | ||
1118 | sgb = scb->sgb; | 1120 | sgb = scb->sgb; |
1119 | scb->op = 1; | 1121 | scb->op = 1; |
1120 | any2scsi(scb->dataptr, (int) sgb); | 1122 | any2scsi(scb->dataptr, (int) sgb); |
1121 | any2scsi(scb->maxlen, SCpnt->use_sg * sizeof(Sgb)); | 1123 | any2scsi(scb->maxlen, nseg * sizeof(Sgb)); |
1122 | 1124 | ||
1123 | for (i = 0; i < SCpnt->use_sg; i++) { | 1125 | scsi_for_each_sg(SCpnt, sg, nseg, i) { |
1124 | any2scsi(sgb[i].ptr, isa_page_to_bus(sg[i].page) + sg[i].offset); | 1126 | any2scsi(sgb[i].ptr, isa_page_to_bus(sg->page) + sg->offset); |
1125 | any2scsi(sgb[i].len, sg[i].length); | 1127 | any2scsi(sgb[i].len, sg->length); |
1126 | } | 1128 | } |
1127 | } else { | 1129 | } else { |
1128 | scb->op = 0; | 1130 | scb->op = 0; |
1129 | any2scsi(scb->dataptr, isa_virt_to_bus(SCpnt->request_buffer)); | 1131 | any2scsi(scb->dataptr, isa_virt_to_bus(scsi_sglist(SCpnt))); |
1130 | any2scsi(scb->maxlen, SCpnt->request_bufflen); | 1132 | any2scsi(scb->maxlen, scsi_bufflen(SCpnt)); |
1131 | } | 1133 | } |
1132 | 1134 | ||
1133 | /* FIXME: drop lock and yield here ? */ | 1135 | /* FIXME: drop lock and yield here ? */ |