patch-2.1.121 linux/drivers/acorn/block/ide-ics.c
Next file: linux/drivers/acorn/block/ide-rapide.c
Previous file: linux/arch/sparc64/mm/asyncd.c
Back to the patch index
Back to the overall index
- Lines: 66
- Date:
Sun Sep 6 10:46:07 1998
- Orig file:
v2.1.120/linux/drivers/acorn/block/ide-ics.c
- Orig date:
Mon Feb 23 18:12:03 1998
diff -u --recursive --new-file v2.1.120/linux/drivers/acorn/block/ide-ics.c linux/drivers/acorn/block/ide-ics.c
@@ -163,6 +163,23 @@
return iftype;
}
+static int icside_register_port(unsigned long dataport, unsigned long ctrlport, int stepping, int irq)
+{
+ hw_regs_t hw;
+ int i;
+
+ memset(&hw, 0, sizeof(hw));
+
+ for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
+ hw.io_ports[i] = (ide_ioreg_t)dataport;
+ dataport += 1 << stepping;
+ }
+ hw.io_ports[IDE_CONTROL_OFFSET] = ctrlport;
+ hw.irq = irq;
+
+ return ide_register_hw(&hw, NULL);
+}
+
/* Prototype: icside_register (struct expansion_card *ec)
* Purpose : register an ICS IDE card with the IDE driver
* Notes : we make sure that interrupts are disabled from the card
@@ -189,11 +206,10 @@
* Be on the safe side - disable interrupts
*/
inb (port + ICS_ARCIN_V5_INTROFFSET);
- result[index][0] =
- ide_register_port (port + ICS_ARCIN_V5_IDEOFFSET,
- port + ICS_ARCIN_V5_IDEALTOFFSET,
- ICS_ARCIN_V5_IDESTEPPING,
- ec->irq);
+ result[index][0] = icside_register_port(port + ICS_ARCIN_V5_IDEOFFSET,
+ port + ICS_ARCIN_V5_IDEALTOFFSET,
+ ICS_ARCIN_V5_IDESTEPPING,
+ ec->irq);
break;
case ics_if_arcin_v6:
@@ -206,16 +222,15 @@
*/
inb (port + ICS_ARCIN_V6_INTROFFSET_1);
inb (port + ICS_ARCIN_V6_INTROFFSET_2);
- result[index][0] =
- ide_register_port (port + ICS_ARCIN_V6_IDEOFFSET_1,
- port + ICS_ARCIN_V6_IDEALTOFFSET_1,
- ICS_ARCIN_V6_IDESTEPPING,
- ec->irq);
- result[index][1] =
- ide_register_port (port + ICS_ARCIN_V6_IDEOFFSET_2,
- port + ICS_ARCIN_V6_IDEALTOFFSET_2,
- ICS_ARCIN_V6_IDESTEPPING,
- ec->irq);
+
+ result[index][0] = icside_register_port(port + ICS_ARCIN_V6_IDEOFFSET_1,
+ port + ICS_ARCIN_V6_IDEALTOFFSET_1,
+ ICS_ARCIN_V6_IDESTEPPING,
+ ec->irq);
+ result[index][1] = icside_register_port(port + ICS_ARCIN_V6_IDEOFFSET_2,
+ port + ICS_ARCIN_V6_IDEALTOFFSET_2,
+ ICS_ARCIN_V6_IDESTEPPING,
+ ec->irq);
break;
}
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov