aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/NCR53c406a.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-15 19:51:54 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-15 19:51:54 -0400
commitbc06cffdec85d487c77109dffcd2f285bdc502d3 (patch)
treeadc6e6398243da87e66c56102840597a329183a0 /drivers/scsi/NCR53c406a.c
parentd3502d7f25b22cfc9762bf1781faa9db1bb3be2e (diff)
parent9413d7b8aa777dd1fc7db9563ce5e80d769fe7b5 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (166 commits) [SCSI] ibmvscsi: convert to use the data buffer accessors [SCSI] dc395x: convert to use the data buffer accessors [SCSI] ncr53c8xx: convert to use the data buffer accessors [SCSI] sym53c8xx: convert to use the data buffer accessors [SCSI] ppa: coding police and printk levels [SCSI] aic7xxx_old: remove redundant GFP_ATOMIC from kmalloc [SCSI] i2o: remove redundant GFP_ATOMIC from kmalloc from device.c [SCSI] remove the dead CYBERSTORMIII_SCSI option [SCSI] don't build scsi_dma_{map,unmap} for !HAS_DMA [SCSI] Clean up scsi_add_lun a bit [SCSI] 53c700: Remove printk, which triggers because of low scsi clock on SNI RMs [SCSI] sni_53c710: Cleanup [SCSI] qla4xxx: Fix underrun/overrun conditions [SCSI] megaraid_mbox: use mutex instead of semaphore [SCSI] aacraid: add 51245, 51645 and 52245 adapters to documentation. [SCSI] qla2xxx: update version to 8.02.00-k1. [SCSI] qla2xxx: add support for NPIV [SCSI] stex: use resid for xfer len information [SCSI] Add Brownie 1200U3P to blacklist [SCSI] scsi.c: convert to use the data buffer accessors ...
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 }