aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/sym53c500_cs.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/pcmcia/sym53c500_cs.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/pcmcia/sym53c500_cs.c')
-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]));