Commit ffb76417 authored by Russell King's avatar Russell King

[ARM] SCSI: Move host->dma_channel to info->scsi.dma

Signed-off-by: default avatarRussell King <rmk@arm.linux.org.uk>
parent 4661fb3f
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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)
......
......@@ -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 */
......
......@@ -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);
......
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