diff options
author | Ondrej Zary <linux@rainbow-software.org> | 2015-02-06 17:11:24 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-04-09 21:03:33 -0400 |
commit | 10be62506f5dd8013bf76f168c89ed4f7608c4d4 (patch) | |
tree | 5dce67879294aad6610a0dcd8c42aa7bb667d7fe | |
parent | 6f82fbf3868712576f137ebdf0b9a72aa99b5935 (diff) |
aha1542: Remove SCSI_BUF_PA, SCSI_SG_PA, AHA1542_SCATTER and AHA1542_CMDLUN
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
-rw-r--r-- | drivers/scsi/aha1542.c | 23 | ||||
-rw-r--r-- | drivers/scsi/aha1542.h | 2 |
2 files changed, 10 insertions, 15 deletions
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index 506e33e9440f..197480de2152 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c | |||
@@ -46,10 +46,6 @@ | |||
46 | #include "scsi.h" | 46 | #include "scsi.h" |
47 | #include <scsi/scsi_host.h> | 47 | #include <scsi/scsi_host.h> |
48 | #include "aha1542.h" | 48 | #include "aha1542.h" |
49 | |||
50 | #define SCSI_BUF_PA(address) isa_virt_to_bus(address) | ||
51 | #define SCSI_SG_PA(sgent) (isa_page_to_bus(sg_page((sgent))) + (sgent)->offset) | ||
52 | |||
53 | #include <linux/stat.h> | 49 | #include <linux/stat.h> |
54 | 50 | ||
55 | #ifdef DEBUG | 51 | #ifdef DEBUG |
@@ -463,7 +459,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost) | |||
463 | return; | 459 | return; |
464 | }; | 460 | }; |
465 | 461 | ||
466 | mbo = (scsi2int(mb[mbi].ccbptr) - (SCSI_BUF_PA(&ccb[0]))) / sizeof(struct ccb); | 462 | mbo = (scsi2int(mb[mbi].ccbptr) - (isa_virt_to_bus(&ccb[0]))) / sizeof(struct ccb); |
467 | mbistatus = mb[mbi].status; | 463 | mbistatus = mb[mbi].status; |
468 | mb[mbi].status = 0; | 464 | mb[mbi].status = 0; |
469 | HOSTDATA(shost)->aha1542_last_mbi_used = mbi; | 465 | HOSTDATA(shost)->aha1542_last_mbi_used = mbi; |
@@ -622,7 +618,7 @@ static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd * | |||
622 | printk(KERN_DEBUG "Sending command (%d %x)...", mbo, done); | 618 | printk(KERN_DEBUG "Sending command (%d %x)...", mbo, done); |
623 | #endif | 619 | #endif |
624 | 620 | ||
625 | any2scsi(mb[mbo].ccbptr, SCSI_BUF_PA(&ccb[mbo])); /* This gets trashed for some reason */ | 621 | any2scsi(mb[mbo].ccbptr, isa_virt_to_bus(&ccb[mbo])); /* This gets trashed for some reason */ |
626 | 622 | ||
627 | memset(&ccb[mbo], 0, sizeof(struct ccb)); | 623 | memset(&ccb[mbo], 0, sizeof(struct ccb)); |
628 | 624 | ||
@@ -653,11 +649,12 @@ static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd * | |||
653 | return SCSI_MLQUEUE_HOST_BUSY; | 649 | return SCSI_MLQUEUE_HOST_BUSY; |
654 | } | 650 | } |
655 | scsi_for_each_sg(SCpnt, sg, sg_count, i) { | 651 | scsi_for_each_sg(SCpnt, sg, sg_count, i) { |
656 | any2scsi(cptr[i].dataptr, SCSI_SG_PA(sg)); | 652 | any2scsi(cptr[i].dataptr, isa_page_to_bus(sg_page(sg)) |
653 | + sg->offset); | ||
657 | any2scsi(cptr[i].datalen, sg->length); | 654 | any2scsi(cptr[i].datalen, sg->length); |
658 | }; | 655 | }; |
659 | any2scsi(ccb[mbo].datalen, sg_count * sizeof(struct chain)); | 656 | any2scsi(ccb[mbo].datalen, sg_count * sizeof(struct chain)); |
660 | any2scsi(ccb[mbo].dataptr, SCSI_BUF_PA(cptr)); | 657 | any2scsi(ccb[mbo].dataptr, isa_virt_to_bus(cptr)); |
661 | #ifdef DEBUG | 658 | #ifdef DEBUG |
662 | printk("cptr %x: ", cptr); | 659 | printk("cptr %x: ", cptr); |
663 | ptr = (unsigned char *) cptr; | 660 | ptr = (unsigned char *) cptr; |
@@ -713,10 +710,10 @@ static void setup_mailboxes(int bse, struct Scsi_Host *shpnt) | |||
713 | 710 | ||
714 | for (i = 0; i < AHA1542_MAILBOXES; i++) { | 711 | for (i = 0; i < AHA1542_MAILBOXES; i++) { |
715 | mb[i].status = mb[AHA1542_MAILBOXES + i].status = 0; | 712 | mb[i].status = mb[AHA1542_MAILBOXES + i].status = 0; |
716 | any2scsi(mb[i].ccbptr, SCSI_BUF_PA(&ccb[i])); | 713 | any2scsi(mb[i].ccbptr, isa_virt_to_bus(&ccb[i])); |
717 | }; | 714 | }; |
718 | aha1542_intr_reset(bse); /* reset interrupts, so they don't block */ | 715 | aha1542_intr_reset(bse); /* reset interrupts, so they don't block */ |
719 | any2scsi((cmd + 2), SCSI_BUF_PA(mb)); | 716 | any2scsi((cmd + 2), isa_virt_to_bus(mb)); |
720 | aha1542_out(bse, cmd, 5); | 717 | aha1542_out(bse, cmd, 5); |
721 | WAIT(INTRFLAGS(bse), INTRMASK, HACC, 0); | 718 | WAIT(INTRFLAGS(bse), INTRMASK, HACC, 0); |
722 | while (0) { | 719 | while (0) { |
@@ -1139,7 +1136,7 @@ static int aha1542_dev_reset(Scsi_Cmnd * SCpnt) | |||
1139 | HOSTDATA(SCpnt->device->host)->aha1542_last_mbo_used = mbo; | 1136 | HOSTDATA(SCpnt->device->host)->aha1542_last_mbo_used = mbo; |
1140 | spin_unlock_irqrestore(&aha1542_lock, flags); | 1137 | spin_unlock_irqrestore(&aha1542_lock, flags); |
1141 | 1138 | ||
1142 | any2scsi(mb[mbo].ccbptr, SCSI_BUF_PA(&ccb[mbo])); /* This gets trashed for some reason */ | 1139 | any2scsi(mb[mbo].ccbptr, isa_virt_to_bus(&ccb[mbo])); /* This gets trashed for some reason */ |
1143 | 1140 | ||
1144 | memset(&ccb[mbo], 0, sizeof(struct ccb)); | 1141 | memset(&ccb[mbo], 0, sizeof(struct ccb)); |
1145 | 1142 | ||
@@ -1328,8 +1325,8 @@ static struct scsi_host_template driver_template = { | |||
1328 | .bios_param = aha1542_biosparam, | 1325 | .bios_param = aha1542_biosparam, |
1329 | .can_queue = AHA1542_MAILBOXES, | 1326 | .can_queue = AHA1542_MAILBOXES, |
1330 | .this_id = 7, | 1327 | .this_id = 7, |
1331 | .sg_tablesize = AHA1542_SCATTER, | 1328 | .sg_tablesize = 16, |
1332 | .cmd_per_lun = AHA1542_CMDLUN, | 1329 | .cmd_per_lun = 1, |
1333 | .unchecked_isa_dma = 1, | 1330 | .unchecked_isa_dma = 1, |
1334 | .use_clustering = ENABLE_CLUSTERING, | 1331 | .use_clustering = ENABLE_CLUSTERING, |
1335 | }; | 1332 | }; |
diff --git a/drivers/scsi/aha1542.h b/drivers/scsi/aha1542.h index af911258076b..812a40670973 100644 --- a/drivers/scsi/aha1542.h +++ b/drivers/scsi/aha1542.h | |||
@@ -138,7 +138,5 @@ static int aha1542_biosparam(struct scsi_device *, struct block_device *, | |||
138 | sector_t, int *); | 138 | sector_t, int *); |
139 | 139 | ||
140 | #define AHA1542_MAILBOXES 8 | 140 | #define AHA1542_MAILBOXES 8 |
141 | #define AHA1542_SCATTER 16 | ||
142 | #define AHA1542_CMDLUN 1 | ||
143 | 141 | ||
144 | #endif | 142 | #endif |