aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/NCR53c406a.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2007-05-15 18:01:23 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-05-26 20:08:20 -0400
commit03cde46b6bd74672bcb88a2f155aa3e3b6ff4fa1 (patch)
tree6d75c8a37572e75c069333c5b4cb59294b7b897e /drivers/scsi/NCR53c406a.c
parent646158c203ae8e76a44bb38634fc82f2da041824 (diff)
[SCSI] NCR53c406a: 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/NCR53c406a.c')
-rw-r--r--drivers/scsi/NCR53c406a.c45
1 files changed, 18 insertions, 27 deletions
diff --git a/drivers/scsi/NCR53c406a.c b/drivers/scsi/NCR53c406a.c
index 7c0b17f86903..eda8c48f6be7 100644
--- a/drivers/scsi/NCR53c406a.c
+++ b/drivers/scsi/NCR53c406a.c
@@ -698,7 +698,7 @@ static int NCR53c406a_queue(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
698 int i; 698 int i;
699 699
700 VDEB(printk("NCR53c406a_queue called\n")); 700 VDEB(printk("NCR53c406a_queue called\n"));
701 DEB(printk("cmd=%02x, cmd_len=%02x, target=%02x, lun=%02x, bufflen=%d\n", SCpnt->cmnd[0], SCpnt->cmd_len, SCpnt->target, SCpnt->lun, SCpnt->request_bufflen)); 701 DEB(printk("cmd=%02x, cmd_len=%02x, target=%02x, lun=%02x, bufflen=%d\n", SCpnt->cmnd[0], SCpnt->cmd_len, SCpnt->target, SCpnt->lun, scsi_bufflen(SCpnt)));
702 702
703#if 0 703#if 0
704 VDEB(for (i = 0; i < SCpnt->cmd_len; i++) 704 VDEB(for (i = 0; i < SCpnt->cmd_len; i++)
@@ -785,8 +785,8 @@ static void NCR53c406a_intr(void *dev_id)
785 unsigned char status, int_reg; 785 unsigned char status, int_reg;
786#if USE_PIO 786#if USE_PIO
787 unsigned char pio_status; 787 unsigned char pio_status;
788 struct scatterlist *sglist; 788 struct scatterlist *sg;
789 unsigned int sgcount; 789 int i;
790#endif 790#endif
791 791
792 VDEB(printk("NCR53c406a_intr called\n")); 792 VDEB(printk("NCR53c406a_intr called\n"));
@@ -866,22 +866,18 @@ static void NCR53c406a_intr(void *dev_id)
866 current_SC->SCp.phase = data_out; 866 current_SC->SCp.phase = data_out;
867 VDEB(printk("NCR53c406a: Data-Out phase\n")); 867 VDEB(printk("NCR53c406a: Data-Out phase\n"));
868 outb(FLUSH_FIFO, CMD_REG); 868 outb(FLUSH_FIFO, CMD_REG);
869 LOAD_DMA_COUNT(current_SC->request_bufflen); /* Max transfer size */ 869 LOAD_DMA_COUNT(scsi_bufflen(current_SC)); /* Max transfer size */
870#if USE_DMA /* No s/g support for DMA */ 870#if USE_DMA /* No s/g support for DMA */
871 NCR53c406a_dma_write(current_SC->request_buffer, current_SC->request_bufflen); 871 NCR53c406a_dma_write(scsi_sglist(current_SC),
872 scsdi_bufflen(current_SC));
873
872#endif /* USE_DMA */ 874#endif /* USE_DMA */
873 outb(TRANSFER_INFO | DMA_OP, CMD_REG); 875 outb(TRANSFER_INFO | DMA_OP, CMD_REG);
874#if USE_PIO 876#if USE_PIO
875 if (!current_SC->use_sg) /* Don't use scatter-gather */ 877 scsi_for_each_sg(current_SC, sg, scsi_sg_count(current_SC), i) {
876 NCR53c406a_pio_write(current_SC->request_buffer, current_SC->request_bufflen); 878 NCR53c406a_pio_write(page_address(sg->page) + sg->offset,
877 else { /* use scatter-gather */ 879 sg->length);
878 sgcount = current_SC->use_sg; 880 }
879 sglist = current_SC->request_buffer;
880 while (sgcount--) {
881 NCR53c406a_pio_write(page_address(sglist->page) + sglist->offset, sglist->length);
882 sglist++;
883 }
884 }
885 REG0; 881 REG0;
886#endif /* USE_PIO */ 882#endif /* USE_PIO */
887 } 883 }
@@ -893,22 +889,17 @@ static void NCR53c406a_intr(void *dev_id)
893 current_SC->SCp.phase = data_in; 889 current_SC->SCp.phase = data_in;
894 VDEB(printk("NCR53c406a: Data-In phase\n")); 890 VDEB(printk("NCR53c406a: Data-In phase\n"));
895 outb(FLUSH_FIFO, CMD_REG); 891 outb(FLUSH_FIFO, CMD_REG);
896 LOAD_DMA_COUNT(current_SC->request_bufflen); /* Max transfer size */ 892 LOAD_DMA_COUNT(scsi_bufflen(current_SC)); /* Max transfer size */
897#if USE_DMA /* No s/g support for DMA */ 893#if USE_DMA /* No s/g support for DMA */
898 NCR53c406a_dma_read(current_SC->request_buffer, current_SC->request_bufflen); 894 NCR53c406a_dma_read(scsi_sglist(current_SC),
895 scsdi_bufflen(current_SC));
899#endif /* USE_DMA */ 896#endif /* USE_DMA */
900 outb(TRANSFER_INFO | DMA_OP, CMD_REG); 897 outb(TRANSFER_INFO | DMA_OP, CMD_REG);
901#if USE_PIO 898#if USE_PIO
902 if (!current_SC->use_sg) /* Don't use scatter-gather */ 899 scsi_for_each_sg(current_SC, sg, scsi_sg_count(current_SC), i) {
903 NCR53c406a_pio_read(current_SC->request_buffer, current_SC->request_bufflen); 900 NCR53c406a_pio_read(page_address(sg->page) + sg->offset,
904 else { /* Use scatter-gather */ 901 sg->length);
905 sgcount = current_SC->use_sg; 902 }
906 sglist = current_SC->request_buffer;
907 while (sgcount--) {
908 NCR53c406a_pio_read(page_address(sglist->page) + sglist->offset, sglist->length);
909 sglist++;
910 }
911 }
912 REG0; 903 REG0;
913#endif /* USE_PIO */ 904#endif /* USE_PIO */
914 } 905 }