Commit 10be6250 authored by Ondrej Zary's avatar Ondrej Zary Committed by James Bottomley

aha1542: Remove SCSI_BUF_PA, SCSI_SG_PA, AHA1542_SCATTER and AHA1542_CMDLUN

Signed-off-by: default avatarOndrej Zary <linux@rainbow-software.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent 6f82fbf3
...@@ -46,10 +46,6 @@ ...@@ -46,10 +46,6 @@
#include "scsi.h" #include "scsi.h"
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include "aha1542.h" #include "aha1542.h"
#define SCSI_BUF_PA(address) isa_virt_to_bus(address)
#define SCSI_SG_PA(sgent) (isa_page_to_bus(sg_page((sgent))) + (sgent)->offset)
#include <linux/stat.h> #include <linux/stat.h>
#ifdef DEBUG #ifdef DEBUG
...@@ -463,7 +459,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost) ...@@ -463,7 +459,7 @@ static void aha1542_intr_handle(struct Scsi_Host *shost)
return; return;
}; };
mbo = (scsi2int(mb[mbi].ccbptr) - (SCSI_BUF_PA(&ccb[0]))) / sizeof(struct ccb); mbo = (scsi2int(mb[mbi].ccbptr) - (isa_virt_to_bus(&ccb[0]))) / sizeof(struct ccb);
mbistatus = mb[mbi].status; mbistatus = mb[mbi].status;
mb[mbi].status = 0; mb[mbi].status = 0;
HOSTDATA(shost)->aha1542_last_mbi_used = mbi; HOSTDATA(shost)->aha1542_last_mbi_used = mbi;
...@@ -622,7 +618,7 @@ static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd * ...@@ -622,7 +618,7 @@ static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *
printk(KERN_DEBUG "Sending command (%d %x)...", mbo, done); printk(KERN_DEBUG "Sending command (%d %x)...", mbo, done);
#endif #endif
any2scsi(mb[mbo].ccbptr, SCSI_BUF_PA(&ccb[mbo])); /* This gets trashed for some reason */ any2scsi(mb[mbo].ccbptr, isa_virt_to_bus(&ccb[mbo])); /* This gets trashed for some reason */
memset(&ccb[mbo], 0, sizeof(struct ccb)); memset(&ccb[mbo], 0, sizeof(struct ccb));
...@@ -653,11 +649,12 @@ static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd * ...@@ -653,11 +649,12 @@ static int aha1542_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *
return SCSI_MLQUEUE_HOST_BUSY; return SCSI_MLQUEUE_HOST_BUSY;
} }
scsi_for_each_sg(SCpnt, sg, sg_count, i) { scsi_for_each_sg(SCpnt, sg, sg_count, i) {
any2scsi(cptr[i].dataptr, SCSI_SG_PA(sg)); any2scsi(cptr[i].dataptr, isa_page_to_bus(sg_page(sg))
+ sg->offset);
any2scsi(cptr[i].datalen, sg->length); any2scsi(cptr[i].datalen, sg->length);
}; };
any2scsi(ccb[mbo].datalen, sg_count * sizeof(struct chain)); any2scsi(ccb[mbo].datalen, sg_count * sizeof(struct chain));
any2scsi(ccb[mbo].dataptr, SCSI_BUF_PA(cptr)); any2scsi(ccb[mbo].dataptr, isa_virt_to_bus(cptr));
#ifdef DEBUG #ifdef DEBUG
printk("cptr %x: ", cptr); printk("cptr %x: ", cptr);
ptr = (unsigned char *) cptr; ptr = (unsigned char *) cptr;
...@@ -713,10 +710,10 @@ static void setup_mailboxes(int bse, struct Scsi_Host *shpnt) ...@@ -713,10 +710,10 @@ static void setup_mailboxes(int bse, struct Scsi_Host *shpnt)
for (i = 0; i < AHA1542_MAILBOXES; i++) { for (i = 0; i < AHA1542_MAILBOXES; i++) {
mb[i].status = mb[AHA1542_MAILBOXES + i].status = 0; mb[i].status = mb[AHA1542_MAILBOXES + i].status = 0;
any2scsi(mb[i].ccbptr, SCSI_BUF_PA(&ccb[i])); any2scsi(mb[i].ccbptr, isa_virt_to_bus(&ccb[i]));
}; };
aha1542_intr_reset(bse); /* reset interrupts, so they don't block */ aha1542_intr_reset(bse); /* reset interrupts, so they don't block */
any2scsi((cmd + 2), SCSI_BUF_PA(mb)); any2scsi((cmd + 2), isa_virt_to_bus(mb));
aha1542_out(bse, cmd, 5); aha1542_out(bse, cmd, 5);
WAIT(INTRFLAGS(bse), INTRMASK, HACC, 0); WAIT(INTRFLAGS(bse), INTRMASK, HACC, 0);
while (0) { while (0) {
...@@ -1139,7 +1136,7 @@ static int aha1542_dev_reset(Scsi_Cmnd * SCpnt) ...@@ -1139,7 +1136,7 @@ static int aha1542_dev_reset(Scsi_Cmnd * SCpnt)
HOSTDATA(SCpnt->device->host)->aha1542_last_mbo_used = mbo; HOSTDATA(SCpnt->device->host)->aha1542_last_mbo_used = mbo;
spin_unlock_irqrestore(&aha1542_lock, flags); spin_unlock_irqrestore(&aha1542_lock, flags);
any2scsi(mb[mbo].ccbptr, SCSI_BUF_PA(&ccb[mbo])); /* This gets trashed for some reason */ any2scsi(mb[mbo].ccbptr, isa_virt_to_bus(&ccb[mbo])); /* This gets trashed for some reason */
memset(&ccb[mbo], 0, sizeof(struct ccb)); memset(&ccb[mbo], 0, sizeof(struct ccb));
...@@ -1328,8 +1325,8 @@ static struct scsi_host_template driver_template = { ...@@ -1328,8 +1325,8 @@ static struct scsi_host_template driver_template = {
.bios_param = aha1542_biosparam, .bios_param = aha1542_biosparam,
.can_queue = AHA1542_MAILBOXES, .can_queue = AHA1542_MAILBOXES,
.this_id = 7, .this_id = 7,
.sg_tablesize = AHA1542_SCATTER, .sg_tablesize = 16,
.cmd_per_lun = AHA1542_CMDLUN, .cmd_per_lun = 1,
.unchecked_isa_dma = 1, .unchecked_isa_dma = 1,
.use_clustering = ENABLE_CLUSTERING, .use_clustering = ENABLE_CLUSTERING,
}; };
......
...@@ -138,7 +138,5 @@ static int aha1542_biosparam(struct scsi_device *, struct block_device *, ...@@ -138,7 +138,5 @@ static int aha1542_biosparam(struct scsi_device *, struct block_device *,
sector_t, int *); sector_t, int *);
#define AHA1542_MAILBOXES 8 #define AHA1542_MAILBOXES 8
#define AHA1542_SCATTER 16
#define AHA1542_CMDLUN 1
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment