aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2007-05-15 16:34:05 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-05-26 20:09:22 -0400
commit9482ef855ef42acb8259f95296b1e93bfb474e74 (patch)
tree7bcd5c5a7d2ce4406330e3eec5e7ce258ce12008 /drivers/scsi
parent772a5c3f3bbc7749971a3dd4ff35cd77a9e12201 (diff)
[SCSI] sym53c500_cs: 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/pcmcia/sym53c500_cs.c42
1 files changed, 19 insertions, 23 deletions
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index ffe75c431b25..2695b7187b2f 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -370,8 +370,6 @@ SYM53C500_intr(int irq, void *dev_id)
370 DEB(unsigned char seq_reg;) 370 DEB(unsigned char seq_reg;)
371 unsigned char status, int_reg; 371 unsigned char status, int_reg;
372 unsigned char pio_status; 372 unsigned char pio_status;
373 struct scatterlist *sglist;
374 unsigned int sgcount;
375 int port_base = dev->io_port; 373 int port_base = dev->io_port;
376 struct sym53c500_data *data = 374 struct sym53c500_data *data =
377 (struct sym53c500_data *)dev->hostdata; 375 (struct sym53c500_data *)dev->hostdata;
@@ -434,20 +432,19 @@ SYM53C500_intr(int irq, void *dev_id)
434 switch (status & 0x07) { /* scsi phase */ 432 switch (status & 0x07) { /* scsi phase */
435 case 0x00: /* DATA-OUT */ 433 case 0x00: /* DATA-OUT */
436 if (int_reg & 0x10) { /* Target requesting info transfer */ 434 if (int_reg & 0x10) { /* Target requesting info transfer */
435 struct scatterlist *sg;
436 int i;
437
437 curSC->SCp.phase = data_out; 438 curSC->SCp.phase = data_out;
438 VDEB(printk("SYM53C500: Data-Out phase\n")); 439 VDEB(printk("SYM53C500: Data-Out phase\n"));
439 outb(FLUSH_FIFO, port_base + CMD_REG); 440 outb(FLUSH_FIFO, port_base + CMD_REG);
440 LOAD_DMA_COUNT(port_base, curSC->request_bufflen); /* Max transfer size */ 441 LOAD_DMA_COUNT(port_base, scsi_bufflen(curSC)); /* Max transfer size */
441 outb(TRANSFER_INFO | DMA_OP, port_base + CMD_REG); 442 outb(TRANSFER_INFO | DMA_OP, port_base + CMD_REG);
442 if (!curSC->use_sg) /* Don't use scatter-gather */ 443
443 SYM53C500_pio_write(fast_pio, port_base, curSC->request_buffer, curSC->request_bufflen); 444 scsi_for_each_sg(curSC, sg, scsi_sg_count(curSC), i) {
444 else { /* use scatter-gather */ 445 SYM53C500_pio_write(fast_pio, port_base,
445 sgcount = curSC->use_sg; 446 page_address(sg->page) + sg->offset,
446 sglist = curSC->request_buffer; 447 sg->length);
447 while (sgcount--) {
448 SYM53C500_pio_write(fast_pio, port_base, page_address(sglist->page) + sglist->offset, sglist->length);
449 sglist++;
450 }
451 } 448 }
452 REG0(port_base); 449 REG0(port_base);
453 } 450 }
@@ -455,20 +452,19 @@ SYM53C500_intr(int irq, void *dev_id)
455 452
456 case 0x01: /* DATA-IN */ 453 case 0x01: /* DATA-IN */
457 if (int_reg & 0x10) { /* Target requesting info transfer */ 454 if (int_reg & 0x10) { /* Target requesting info transfer */
455 struct scatterlist *sg;
456 int i;
457
458 curSC->SCp.phase = data_in; 458 curSC->SCp.phase = data_in;
459 VDEB(printk("SYM53C500: Data-In phase\n")); 459 VDEB(printk("SYM53C500: Data-In phase\n"));
460 outb(FLUSH_FIFO, port_base + CMD_REG); 460 outb(FLUSH_FIFO, port_base + CMD_REG);
461 LOAD_DMA_COUNT(port_base, curSC->request_bufflen); /* Max transfer size */ 461 LOAD_DMA_COUNT(port_base, scsi_bufflen(curSC)); /* Max transfer size */
462 outb(TRANSFER_INFO | DMA_OP, port_base + CMD_REG); 462 outb(TRANSFER_INFO | DMA_OP, port_base + CMD_REG);
463 if (!curSC->use_sg) /* Don't use scatter-gather */ 463
464 SYM53C500_pio_read(fast_pio, port_base, curSC->request_buffer, curSC->request_bufflen); 464 scsi_for_each_sg(curSC, sg, scsi_sg_count(curSC), i) {
465 else { /* Use scatter-gather */ 465 SYM53C500_pio_read(fast_pio, port_base,
466 sgcount = curSC->use_sg; 466 page_address(sg->page) + sg->offset,
467 sglist = curSC->request_buffer; 467 sg->length);
468 while (sgcount--) {
469 SYM53C500_pio_read(fast_pio, port_base, page_address(sglist->page) + sglist->offset, sglist->length);
470 sglist++;
471 }
472 } 468 }
473 REG0(port_base); 469 REG0(port_base);
474 } 470 }
@@ -578,7 +574,7 @@ SYM53C500_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
578 574
579 DEB(printk("cmd=%02x, cmd_len=%02x, target=%02x, lun=%02x, bufflen=%d\n", 575 DEB(printk("cmd=%02x, cmd_len=%02x, target=%02x, lun=%02x, bufflen=%d\n",
580 SCpnt->cmnd[0], SCpnt->cmd_len, SCpnt->device->id, 576 SCpnt->cmnd[0], SCpnt->cmd_len, SCpnt->device->id,
581 SCpnt->device->lun, SCpnt->request_bufflen)); 577 SCpnt->device->lun, scsi_bufflen(SCpnt)));
582 578
583 VDEB(for (i = 0; i < SCpnt->cmd_len; i++) 579 VDEB(for (i = 0; i < SCpnt->cmd_len; i++)
584 printk("cmd[%d]=%02x ", i, SCpnt->cmnd[i])); 580 printk("cmd[%d]=%02x ", i, SCpnt->cmnd[i]));