summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@flint.arm.linux.org.uk>2005-03-02 18:50:36 +0000
committerRussell King <rmk@flint.arm.linux.org.uk>2005-03-02 18:50:36 +0000
commitffb764177d30624cfadefd87bcb9928919f1209d (patch)
treee72ab81b019956843406d69cdd60c1dedb497e23
parent4661fb3f27d545aaef57995e371565e887198378 (diff)
[ARM] SCSI: Move host->dma_channel to info->scsi.dma
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r--drivers/scsi/arm/arxescsi.c2
-rw-r--r--drivers/scsi/arm/cumana_2.c26
-rw-r--r--drivers/scsi/arm/eesox.c27
-rw-r--r--drivers/scsi/arm/fas216.c2
-rw-r--r--drivers/scsi/arm/fas216.h1
-rw-r--r--drivers/scsi/arm/powertec.c27
6 files changed, 44 insertions, 41 deletions
diff --git a/drivers/scsi/arm/arxescsi.c b/drivers/scsi/arm/arxescsi.c
index 690717627963..b2f1f1cf6815 100644
--- a/drivers/scsi/arm/arxescsi.c
+++ b/drivers/scsi/arm/arxescsi.c
@@ -306,7 +306,6 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
}
host->base = (unsigned long)base;
- host->dma_channel = NO_DMA;
info = (struct arxescsi_info *)host->hostdata;
info->ec = ec;
@@ -314,6 +313,7 @@ arxescsi_probe(struct expansion_card *ec, const struct ecard_id *id)
info->info.scsi.io_base = base + 0x2000;
info->info.scsi.irq = NO_IRQ;
+ info->info.scsi.dma = NO_DMA;
info->info.scsi.io_shift = 5;
info->info.ifcfg.clockrate = 24; /* MHz */
info->info.ifcfg.select_timeout = 255;
diff --git a/drivers/scsi/arm/cumana_2.c b/drivers/scsi/arm/cumana_2.c
index 0a86d23394d0..2b7175e47ccb 100644
--- a/drivers/scsi/arm/cumana_2.c
+++ b/drivers/scsi/arm/cumana_2.c
@@ -162,7 +162,7 @@ cumanascsi_2_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
{
struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata;
struct device *dev = scsi_get_device(host);
- int dmach = host->dma_channel;
+ int dmach = info->info.scsi.dma;
writeb(ALATCH_DIS_DMA, info->base + CUMANASCSI2_ALATCH);
@@ -286,9 +286,9 @@ static void
cumanascsi_2_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp)
{
struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata;
- if (host->dma_channel != NO_DMA) {
+ if (info->info.scsi.dma != NO_DMA) {
writeb(ALATCH_DIS_DMA, info->base + CUMANASCSI2_ALATCH);
- disable_dma(host->dma_channel);
+ disable_dma(info->info.scsi.dma);
}
}
@@ -428,7 +428,6 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id)
}
host->base = (unsigned long)base;
- host->dma_channel = ec->dma;
ecard_set_drvdata(ec, host);
@@ -441,6 +440,7 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id)
info->info.scsi.io_base = base + CUMANASCSI2_FAS216_OFFSET;
info->info.scsi.io_shift = CUMANASCSI2_FAS216_SHIFT;
info->info.scsi.irq = ec->irq;
+ info->info.scsi.dma = ec->dma;
info->info.ifcfg.clockrate = 40; /* MHz */
info->info.ifcfg.select_timeout = 255;
info->info.ifcfg.asyncperiod = 200; /* ns */
@@ -470,13 +470,13 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id)
goto out_release;
}
- if (host->dma_channel != NO_DMA) {
- if (request_dma(host->dma_channel, "cumanascsi2")) {
+ if (info->info.scsi.dma != NO_DMA) {
+ if (request_dma(info->info.scsi.dma, "cumanascsi2")) {
printk("scsi%d: DMA%d not free, using PIO\n",
- host->host_no, host->dma_channel);
- host->dma_channel = NO_DMA;
+ host->host_no, info->info.scsi.dma);
+ info->info.scsi.dma = NO_DMA;
} else {
- set_dma_speed(host->dma_channel, 180);
+ set_dma_speed(info->info.scsi.dma, 180);
info->info.ifcfg.capabilities |= FASCAP_DMA;
}
}
@@ -485,8 +485,8 @@ cumanascsi2_probe(struct expansion_card *ec, const struct ecard_id *id)
if (ret == 0)
goto out;
- if (host->dma_channel != NO_DMA)
- free_dma(host->dma_channel);
+ if (info->info.scsi.dma != NO_DMA)
+ free_dma(info->info.scsi.dma);
free_irq(ec->irq, host);
out_release:
@@ -513,8 +513,8 @@ static void __devexit cumanascsi2_remove(struct expansion_card *ec)
ecard_set_drvdata(ec, NULL);
fas216_remove(host);
- if (host->dma_channel != NO_DMA)
- free_dma(host->dma_channel);
+ if (info->info.scsi.dma != NO_DMA)
+ free_dma(info->info.scsi.dma);
free_irq(ec->irq, info);
iounmap(info->base);
diff --git a/drivers/scsi/arm/eesox.c b/drivers/scsi/arm/eesox.c
index 51bde5dcf498..cadb37311d40 100644
--- a/drivers/scsi/arm/eesox.c
+++ b/drivers/scsi/arm/eesox.c
@@ -163,7 +163,7 @@ eesoxscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
{
struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
struct device *dev = scsi_get_device(host);
- int dmach = host->dma_channel;
+ int dmach = info->info.scsi.dma;
if (dmach != NO_DMA &&
(min_type == fasdma_real_all || SCp->this_residual >= 512)) {
@@ -372,8 +372,9 @@ eesoxscsi_dma_pseudo(struct Scsi_Host *host, Scsi_Pointer *SCp,
static void
eesoxscsi_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp)
{
- if (host->dma_channel != NO_DMA)
- disable_dma(host->dma_channel);
+ struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
+ if (info->info.scsi.dma != NO_DMA)
+ disable_dma(info->info.scsi.dma);
}
/* Prototype: const char *eesoxscsi_info(struct Scsi_Host * host)
@@ -545,7 +546,6 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
}
host->base = (unsigned long)base;
- host->dma_channel = ec->dma;
ecard_set_drvdata(ec, host);
@@ -559,6 +559,7 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
info->info.scsi.io_base = base + EESOX_FAS216_OFFSET;
info->info.scsi.io_shift = EESOX_FAS216_SHIFT;
info->info.scsi.irq = ec->irq;
+ info->info.scsi.dma = ec->dma;
info->info.ifcfg.clockrate = 40; /* MHz */
info->info.ifcfg.select_timeout = 255;
info->info.ifcfg.asyncperiod = 200; /* ns */
@@ -589,13 +590,13 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
goto out_remove;
}
- if (host->dma_channel != NO_DMA) {
- if (request_dma(host->dma_channel, "eesox")) {
+ if (info->info.scsi.dma != NO_DMA) {
+ if (request_dma(info->info.scsi.dma, "eesox")) {
printk("scsi%d: DMA%d not free, DMA disabled\n",
- host->host_no, host->dma_channel);
- host->dma_channel = NO_DMA;
+ host->host_no, info->info.scsi.dma);
+ info->info.scsi.dma = NO_DMA;
} else {
- set_dma_speed(host->dma_channel, 180);
+ set_dma_speed(info->info.scsi.dma, 180);
info->info.ifcfg.capabilities |= FASCAP_DMA;
info->info.ifcfg.cntl3 |= CNTL3_BS8;
}
@@ -605,8 +606,8 @@ eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
if (ret == 0)
goto out;
- if (host->dma_channel != NO_DMA)
- free_dma(host->dma_channel);
+ if (info->info.scsi.dma != NO_DMA)
+ free_dma(info->info.scsi.dma);
free_irq(ec->irq, host);
out_remove:
@@ -634,8 +635,8 @@ static void __devexit eesoxscsi_remove(struct expansion_card *ec)
ecard_set_drvdata(ec, NULL);
fas216_remove(host);
- if (host->dma_channel != NO_DMA)
- free_dma(host->dma_channel);
+ if (info->info.scsi.dma != NO_DMA)
+ free_dma(info->info.scsi.dma);
free_irq(ec->irq, info);
device_remove_file(&ec->dev, &dev_attr_bus_term);
diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c
index 3aa02fa54937..8a22385caceb 100644
--- a/drivers/scsi/arm/fas216.c
+++ b/drivers/scsi/arm/fas216.c
@@ -2971,7 +2971,7 @@ int fas216_print_host(FAS216_Info *info, char *buffer)
" IRQ : %d\n"
" DMA : %d\n",
info->scsi.type, info->host->io_port,
- info->scsi.irq, info->host->dma_channel);
+ info->scsi.irq, info->scsi.dma);
}
int fas216_print_stats(FAS216_Info *info, char *buffer)
diff --git a/drivers/scsi/arm/fas216.h b/drivers/scsi/arm/fas216.h
index 8c80f0f8f5b4..fd6140ff1f60 100644
--- a/drivers/scsi/arm/fas216.h
+++ b/drivers/scsi/arm/fas216.h
@@ -242,6 +242,7 @@ typedef struct {
unsigned char cfg[4]; /* configuration registers */
const char *type; /* chip type */
unsigned int irq; /* interrupt */
+ int dma; /* dma channel */
Scsi_Pointer SCp; /* current commands data pointer */
diff --git a/drivers/scsi/arm/powertec.c b/drivers/scsi/arm/powertec.c
index b29db2e70412..08e47728bb9e 100644
--- a/drivers/scsi/arm/powertec.c
+++ b/drivers/scsi/arm/powertec.c
@@ -137,7 +137,7 @@ powertecscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
{
struct powertec_info *info = (struct powertec_info *)host->hostdata;
struct device *dev = scsi_get_device(host);
- int dmach = host->dma_channel;
+ int dmach = info->info.scsi.dma;
if (info->info.ifcfg.capabilities & FASCAP_DMA &&
min_type == fasdma_real_all) {
@@ -176,8 +176,9 @@ powertecscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
static void
powertecscsi_dma_stop(struct Scsi_Host *host, Scsi_Pointer *SCp)
{
- if (host->dma_channel != NO_DMA)
- disable_dma(host->dma_channel);
+ struct powertec_info *info = (struct powertec_info *)host->hostdata;
+ if (info->info.scsi.dma != NO_DMA)
+ disable_dma(info->info.scsi.dma);
}
/* Prototype: const char *powertecscsi_info(struct Scsi_Host * host)
@@ -340,7 +341,6 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
}
host->base = (unsigned long)base;
- host->dma_channel = ec->dma;
ecard_set_drvdata(ec, host);
@@ -351,6 +351,7 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
info->info.scsi.io_base = base + POWERTEC_FAS216_OFFSET;
info->info.scsi.io_shift = POWERTEC_FAS216_SHIFT;
info->info.scsi.irq = ec->irq;
+ info->info.scsi.dma = ec->dma;
info->info.ifcfg.clockrate = 40; /* MHz */
info->info.ifcfg.select_timeout = 255;
info->info.ifcfg.asyncperiod = 200; /* ns */
@@ -382,13 +383,13 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
goto out_release;
}
- if (host->dma_channel != NO_DMA) {
- if (request_dma(host->dma_channel, "powertec")) {
+ if (info->info.scsi.dma != NO_DMA) {
+ if (request_dma(info->info.scsi.dma, "powertec")) {
printk("scsi%d: DMA%d not free, using PIO\n",
- host->host_no, host->dma_channel);
- host->dma_channel = NO_DMA;
+ host->host_no, info->info.scsi.dma);
+ info->info.scsi.dma = NO_DMA;
} else {
- set_dma_speed(host->dma_channel, 180);
+ set_dma_speed(info->info.scsi.dma, 180);
info->info.ifcfg.capabilities |= FASCAP_DMA;
}
}
@@ -397,8 +398,8 @@ powertecscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
if (ret == 0)
goto out;
- if (host->dma_channel != NO_DMA)
- free_dma(host->dma_channel);
+ if (info->info.scsi.dma != NO_DMA)
+ free_dma(info->info.scsi.dma);
free_irq(ec->irq, host);
out_release:
@@ -428,8 +429,8 @@ static void __devexit powertecscsi_remove(struct expansion_card *ec)
device_remove_file(&ec->dev, &dev_attr_bus_term);
- if (host->dma_channel != NO_DMA)
- free_dma(host->dma_channel);
+ if (info->info.scsi.dma != NO_DMA)
+ free_dma(info->info.scsi.dma);
free_irq(ec->irq, info);
iounmap(info->base);