Commit 795c3847 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] cpqarray: I/O address fixes

From: <mikem@beardog.cca.cpqcorp.net>

* cpqarray in kernel 2.6.1 seems to be based from 2.4.18 kernel with
  specific 2.6.x stuff added.

* Defines io_mem_addr and io_mem_length to replace ioaddr (change from
  2.4.18 to 2.4.19)
parent a1587fde
......@@ -224,7 +224,7 @@ static int ida_proc_get_info(char *buffer, char **start, off_t offset, int lengt
(unsigned long)h->board_id,
h->firm_rev[0], h->firm_rev[1], h->firm_rev[2], h->firm_rev[3],
(unsigned long)h->ctlr_sig, (unsigned long)h->vaddr,
(unsigned int) h->ioaddr, (unsigned int)h->intr,
(unsigned int) h->io_mem_addr, (unsigned int)h->intr,
h->log_drives, h->phys_drives,
h->Qdepth, h->maxQsinceinit);
......@@ -570,7 +570,7 @@ DBGINFO(
);
c->intr = irq;
c->ioaddr = addr[0];
c->io_mem_addr = addr[0];
c->paddr = 0;
for(i=0; i<6; i++)
......@@ -678,7 +678,7 @@ static int cpqarray_eisa_detect(void)
continue;
}
memset(hba[nr_ctlr], 0, sizeof(ctlr_info_t));
hba[nr_ctlr]->ioaddr = eisa[i];
hba[nr_ctlr]->io_mem_addr = eisa[i];
/*
* Read the config register to find our interrupt
......
......@@ -92,7 +92,8 @@ struct ctlr_info {
void *vaddr;
unsigned long paddr;
unsigned long ioaddr;
unsigned long io_mem_addr;
unsigned long io_mem_length;
int intr;
int usage_count;
drv_info_t drv[NWD];
......
......@@ -156,27 +156,27 @@ static struct access_method smart2_access = {
*/
static void smart2e_submit_command(ctlr_info_t *h, cmdlist_t *c)
{
outl(c->busaddr, h->ioaddr + COMMAND_FIFO);
outl(c->busaddr, h->io_mem_addr + COMMAND_FIFO);
}
static void smart2e_intr_mask(ctlr_info_t *h, unsigned long val)
{
outl(val, h->ioaddr + INTR_MASK);
outl(val, h->io_mem_addr + INTR_MASK);
}
static unsigned long smart2e_fifo_full(ctlr_info_t *h)
{
return inl(h->ioaddr + COMMAND_FIFO);
return inl(h->io_mem_addr + COMMAND_FIFO);
}
static unsigned long smart2e_completed(ctlr_info_t *h)
{
return inl(h->ioaddr + COMMAND_COMPLETE_FIFO);
return inl(h->io_mem_addr + COMMAND_COMPLETE_FIFO);
}
static unsigned long smart2e_intr_pending(ctlr_info_t *h)
{
return inl(h->ioaddr + INTR_PENDING);
return inl(h->io_mem_addr + INTR_PENDING);
}
static struct access_method smart2e_access = {
......@@ -212,30 +212,30 @@ static void smart1_submit_command(ctlr_info_t *h, cmdlist_t *c)
*/
c->hdr.size = 0;
outb(CHANNEL_CLEAR, h->ioaddr + SMART1_SYSTEM_DOORBELL);
outb(CHANNEL_CLEAR, h->io_mem_addr + SMART1_SYSTEM_DOORBELL);
outl(c->busaddr, h->ioaddr + SMART1_LISTADDR);
outw(c->size, h->ioaddr + SMART1_LISTLEN);
outl(c->busaddr, h->io_mem_addr + SMART1_LISTADDR);
outw(c->size, h->io_mem_addr + SMART1_LISTLEN);
outb(CHANNEL_BUSY, h->ioaddr + SMART1_LOCAL_DOORBELL);
outb(CHANNEL_BUSY, h->io_mem_addr + SMART1_LOCAL_DOORBELL);
}
static void smart1_intr_mask(ctlr_info_t *h, unsigned long val)
{
if (val == 1) {
outb(0xFD, h->ioaddr + SMART1_SYSTEM_DOORBELL);
outb(CHANNEL_BUSY, h->ioaddr + SMART1_LOCAL_DOORBELL);
outb(0x01, h->ioaddr + SMART1_INTR_MASK);
outb(0x01, h->ioaddr + SMART1_SYSTEM_MASK);
outb(0xFD, h->io_mem_addr + SMART1_SYSTEM_DOORBELL);
outb(CHANNEL_BUSY, h->io_mem_addr + SMART1_LOCAL_DOORBELL);
outb(0x01, h->io_mem_addr + SMART1_INTR_MASK);
outb(0x01, h->io_mem_addr + SMART1_SYSTEM_MASK);
} else {
outb(0, h->ioaddr + 0xC8E);
outb(0, h->io_mem_addr + 0xC8E);
}
}
static unsigned long smart1_fifo_full(ctlr_info_t *h)
{
unsigned char chan;
chan = inb(h->ioaddr + SMART1_SYSTEM_DOORBELL) & CHANNEL_CLEAR;
chan = inb(h->io_mem_addr + SMART1_SYSTEM_DOORBELL) & CHANNEL_CLEAR;
return chan;
}
......@@ -244,13 +244,13 @@ static unsigned long smart1_completed(ctlr_info_t *h)
unsigned char status;
unsigned long cmd;
if (inb(h->ioaddr + SMART1_SYSTEM_DOORBELL) & CHANNEL_BUSY) {
outb(CHANNEL_BUSY, h->ioaddr + SMART1_SYSTEM_DOORBELL);
if (inb(h->io_mem_addr + SMART1_SYSTEM_DOORBELL) & CHANNEL_BUSY) {
outb(CHANNEL_BUSY, h->io_mem_addr + SMART1_SYSTEM_DOORBELL);
cmd = inl(h->ioaddr + SMART1_COMPLETE_ADDR);
status = inb(h->ioaddr + SMART1_LISTSTATUS);
cmd = inl(h->io_mem_addr + SMART1_COMPLETE_ADDR);
status = inb(h->io_mem_addr + SMART1_LISTSTATUS);
outb(CHANNEL_CLEAR, h->ioaddr + SMART1_LOCAL_DOORBELL);
outb(CHANNEL_CLEAR, h->io_mem_addr + SMART1_LOCAL_DOORBELL);
/*
* this is x86 (actually compaq x86) only, so it's ok
......@@ -265,7 +265,7 @@ static unsigned long smart1_completed(ctlr_info_t *h)
static unsigned long smart1_intr_pending(ctlr_info_t *h)
{
unsigned char chan;
chan = inb(h->ioaddr + SMART1_SYSTEM_DOORBELL) & CHANNEL_BUSY;
chan = inb(h->io_mem_addr + SMART1_SYSTEM_DOORBELL) & CHANNEL_BUSY;
return chan;
}
......
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