aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2007-11-05 04:21:40 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-11 19:22:39 -0500
commit9a3dd65bafcfa3338cfb4b6b7e12ff59aca0ac28 (patch)
treec48e89bac733c362ab2526ffdf61b5965071c3c1
parentfe7ed98fd49a28287aca8b0ba8da8fb9ca35a055 (diff)
[SCSI] wd7000: proper fix for boards without sg support
- code used to set sg_tablesize to zero for board revision less than 6. This is no longer supported, therefore I use sg_tablesize=1 and open code the sg handling for that case. - Get rid of use of SG_NONE which will be removed soon. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: James <James.Bottomley@HansenPartnership.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--drivers/scsi/wd7000.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c
index 03cd44f231df..b4304ae78527 100644
--- a/drivers/scsi/wd7000.c
+++ b/drivers/scsi/wd7000.c
@@ -1108,13 +1108,10 @@ static int wd7000_queuecommand(struct scsi_cmnd *SCpnt,
1108 scb->host = host; 1108 scb->host = host;
1109 1109
1110 nseg = scsi_sg_count(SCpnt); 1110 nseg = scsi_sg_count(SCpnt);
1111 if (nseg) { 1111 if (nseg > 1) {
1112 struct scatterlist *sg; 1112 struct scatterlist *sg;
1113 unsigned i; 1113 unsigned i;
1114 1114
1115 if (SCpnt->device->host->sg_tablesize == SG_NONE) {
1116 panic("wd7000_queuecommand: scatter/gather not supported.\n");
1117 }
1118 dprintk("Using scatter/gather with %d elements.\n", nseg); 1115 dprintk("Using scatter/gather with %d elements.\n", nseg);
1119 1116
1120 sgb = scb->sgb; 1117 sgb = scb->sgb;
@@ -1128,7 +1125,10 @@ static int wd7000_queuecommand(struct scsi_cmnd *SCpnt,
1128 } 1125 }
1129 } else { 1126 } else {
1130 scb->op = 0; 1127 scb->op = 0;
1131 any2scsi(scb->dataptr, isa_virt_to_bus(scsi_sglist(SCpnt))); 1128 if (nseg) {
1129 struct scatterlist *sg = scsi_sglist(SCpnt);
1130 any2scsi(scb->dataptr, isa_page_to_bus(sg_page(sg)) + sg->offset);
1131 }
1132 any2scsi(scb->maxlen, scsi_bufflen(SCpnt)); 1132 any2scsi(scb->maxlen, scsi_bufflen(SCpnt));
1133 } 1133 }
1134 1134
@@ -1524,7 +1524,7 @@ static __init int wd7000_detect(struct scsi_host_template *tpnt)
1524 * For boards before rev 6.0, scatter/gather isn't supported. 1524 * For boards before rev 6.0, scatter/gather isn't supported.
1525 */ 1525 */
1526 if (host->rev1 < 6) 1526 if (host->rev1 < 6)
1527 sh->sg_tablesize = SG_NONE; 1527 sh->sg_tablesize = 1;
1528 1528
1529 present++; /* count it */ 1529 present++; /* count it */
1530 1530