aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/wd7000.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/wd7000.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/wd7000.c')
-rw-r--r--drivers/scsi/wd7000.c20
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 ? */