diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2007-05-14 06:24:01 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-05-26 20:21:09 -0400 |
commit | bc1ebfba1a3a27122462fd342d11216e3faea53f (patch) | |
tree | e720d6139dee7a8dc0fc7db55e748d178a3b79ca /drivers/scsi | |
parent | fea97f9ab26a17c29eadc102c04b88776d6262d4 (diff) |
[SCSI] qlogicfas408: 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')
-rw-r--r-- | drivers/scsi/qlogicfas408.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/drivers/scsi/qlogicfas408.c b/drivers/scsi/qlogicfas408.c index 2e7db18f5aef..2bfbf26c00ed 100644 --- a/drivers/scsi/qlogicfas408.c +++ b/drivers/scsi/qlogicfas408.c | |||
@@ -265,8 +265,6 @@ static unsigned int ql_pcmd(struct scsi_cmnd *cmd) | |||
265 | unsigned int message; /* scsi returned message */ | 265 | unsigned int message; /* scsi returned message */ |
266 | unsigned int phase; /* recorded scsi phase */ | 266 | unsigned int phase; /* recorded scsi phase */ |
267 | unsigned int reqlen; /* total length of transfer */ | 267 | unsigned int reqlen; /* total length of transfer */ |
268 | struct scatterlist *sglist; /* scatter-gather list pointer */ | ||
269 | unsigned int sgcount; /* sg counter */ | ||
270 | char *buf; | 268 | char *buf; |
271 | struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd); | 269 | struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd); |
272 | int qbase = priv->qbase; | 270 | int qbase = priv->qbase; |
@@ -301,9 +299,10 @@ static unsigned int ql_pcmd(struct scsi_cmnd *cmd) | |||
301 | if (inb(qbase + 7) & 0x1f) /* if some bytes in fifo */ | 299 | if (inb(qbase + 7) & 0x1f) /* if some bytes in fifo */ |
302 | outb(1, qbase + 3); /* clear fifo */ | 300 | outb(1, qbase + 3); /* clear fifo */ |
303 | /* note that request_bufflen is the total xfer size when sg is used */ | 301 | /* note that request_bufflen is the total xfer size when sg is used */ |
304 | reqlen = cmd->request_bufflen; | 302 | reqlen = scsi_bufflen(cmd); |
305 | /* note that it won't work if transfers > 16M are requested */ | 303 | /* note that it won't work if transfers > 16M are requested */ |
306 | if (reqlen && !((phase = inb(qbase + 4)) & 6)) { /* data phase */ | 304 | if (reqlen && !((phase = inb(qbase + 4)) & 6)) { /* data phase */ |
305 | struct scatterlist *sg; | ||
307 | rtrc(2) | 306 | rtrc(2) |
308 | outb(reqlen, qbase); /* low-mid xfer cnt */ | 307 | outb(reqlen, qbase); /* low-mid xfer cnt */ |
309 | outb(reqlen >> 8, qbase + 1); /* low-mid xfer cnt */ | 308 | outb(reqlen >> 8, qbase + 1); /* low-mid xfer cnt */ |
@@ -311,23 +310,16 @@ static unsigned int ql_pcmd(struct scsi_cmnd *cmd) | |||
311 | outb(0x90, qbase + 3); /* command do xfer */ | 310 | outb(0x90, qbase + 3); /* command do xfer */ |
312 | /* PIO pseudo DMA to buffer or sglist */ | 311 | /* PIO pseudo DMA to buffer or sglist */ |
313 | REG1; | 312 | REG1; |
314 | if (!cmd->use_sg) | 313 | |
315 | ql_pdma(priv, phase, cmd->request_buffer, | 314 | scsi_for_each_sg(cmd, sg, scsi_sg_count(cmd), i) { |
316 | cmd->request_bufflen); | 315 | if (priv->qabort) { |
317 | else { | 316 | REG0; |
318 | sgcount = cmd->use_sg; | 317 | return ((priv->qabort == 1 ? |
319 | sglist = cmd->request_buffer; | 318 | DID_ABORT : DID_RESET) << 16); |
320 | while (sgcount--) { | ||
321 | if (priv->qabort) { | ||
322 | REG0; | ||
323 | return ((priv->qabort == 1 ? | ||
324 | DID_ABORT : DID_RESET) << 16); | ||
325 | } | ||
326 | buf = page_address(sglist->page) + sglist->offset; | ||
327 | if (ql_pdma(priv, phase, buf, sglist->length)) | ||
328 | break; | ||
329 | sglist++; | ||
330 | } | 319 | } |
320 | buf = page_address(sg->page) + sg->offset; | ||
321 | if (ql_pdma(priv, phase, buf, sg->length)) | ||
322 | break; | ||
331 | } | 323 | } |
332 | REG0; | 324 | REG0; |
333 | rtrc(2) | 325 | rtrc(2) |