diff options
Diffstat (limited to 'drivers/scsi/pcmcia')
-rw-r--r-- | drivers/scsi/pcmcia/sym53c500_cs.c | 42 |
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])); |