Commit 5ef2759c authored by Martin Dalecki's avatar Martin Dalecki Committed by Kai Germaschewski

[PATCH] 2.5.10 IDE 43

Some of the following is a bit of sensitive... but anyway it has to be done.

- Scarp "portability" macros ide_request_irq() and ide_free_irq().  What a
   great of a surprise in the face of a kernel nowadays ported to nearly any
   major CPU out there, but apparently no platform needs something special here.
   All of them are just using the normal request_irq() and free_irq(). If some
   unusual platform (read obsolete door blocker) I have overlooked intentionally
   needs something special - please just hack the platform specific
   request_irq() and free_irq()-  they are *far off* from being performance
   relevant. (Hint: You could use cooked default irq values to detect there
   whatever the caller was the ATA driver to decide what to do about it.)

- Kill ide_check_region() ide_request_region() and ide_release_region()
   altogether. Add comments explaining the code there.  Same arguments as above
   apply. Additionally we want to be able at some time to do for example mmapped
   PCI address space access on IA32 instead of port IO.

- Rewrite the initialization code to don't use check_region at all. Add some
   comments there, which explain what's actually happening.

- Fix creeping in of a c99 construct.

- Make the main interrupt handler take a channel as data instead of the
   hwgroup. This is the entity an interrupt is physically associated with. PCI
   interrupt sharing is handled in a generically anyway. Analogously the main
   data entity of a device request queue (q->queuedata) is the device and not
   the hwgroup.  However right now we are only able to push it down to the
   channel level. The intention is to advance the choose_drive() function to
   just check for equal interrupt values for serialization of request and
   thus to get rid of the hwgroup altogether.
parent 9dbf0015
...@@ -30,42 +30,8 @@ static void no_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port, ...@@ -30,42 +30,8 @@ static void no_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port,
{ {
} }
static int no_ide_request_irq(unsigned int irq,
void (*handler)(int,void *, struct pt_regs *),
unsigned long flags, const char *device,
void *dev_id)
{
panic("no_no_ide_request_irq called - shouldn't happen");
}
static void no_ide_free_irq(unsigned int irq, void *dev_id)
{
panic("no_ide_free_irq called - shouldn't happen");
}
static int no_ide_check_region(ide_ioreg_t from, unsigned int extent)
{
panic("no_ide_check_region called - shouldn't happen");
}
static void no_ide_request_region(ide_ioreg_t from, unsigned int extent,
const char *name)
{
panic("no_ide_request_region called - shouldn't happen");
}
static void no_ide_release_region(ide_ioreg_t from, unsigned int extent)
{
panic("no_ide_release_region called - shouldn't happen");
}
struct ide_ops no_ide_ops = { struct ide_ops no_ide_ops = {
&no_ide_default_irq, &no_ide_default_irq,
&no_ide_default_io_base, &no_ide_default_io_base,
&no_ide_init_hwif_ports, &no_ide_init_hwif_ports
&no_ide_request_irq,
&no_ide_free_irq,
&no_ide_check_region,
&no_ide_request_region,
&no_ide_release_region
}; };
...@@ -62,42 +62,8 @@ static void std_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port, ...@@ -62,42 +62,8 @@ static void std_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port,
hw->io_ports[IDE_IRQ_OFFSET] = 0; hw->io_ports[IDE_IRQ_OFFSET] = 0;
} }
static int std_ide_request_irq(unsigned int irq,
void (*handler)(int,void *, struct pt_regs *),
unsigned long flags, const char *device,
void *dev_id)
{
return request_irq(irq, handler, flags, device, dev_id);
}
static void std_ide_free_irq(unsigned int irq, void *dev_id)
{
free_irq(irq, dev_id);
}
static int std_ide_check_region(ide_ioreg_t from, unsigned int extent)
{
return check_region(from, extent);
}
static void std_ide_request_region(ide_ioreg_t from, unsigned int extent,
const char *name)
{
request_region(from, extent, name);
}
static void std_ide_release_region(ide_ioreg_t from, unsigned int extent)
{
release_region(from, extent);
}
struct ide_ops std_ide_ops = { struct ide_ops std_ide_ops = {
&std_ide_default_irq, &std_ide_default_irq,
&std_ide_default_io_base, &std_ide_default_io_base,
&std_ide_init_hwif_ports, &std_ide_init_hwif_ports
&std_ide_request_irq,
&std_ide_free_irq,
&std_ide_check_region,
&std_ide_request_region,
&std_ide_release_region
}; };
...@@ -29,42 +29,8 @@ static void no_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port, ...@@ -29,42 +29,8 @@ static void no_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port,
{ {
} }
static int no_ide_request_irq(unsigned int irq,
void (*handler)(int,void *, struct pt_regs *),
unsigned long flags, const char *device,
void *dev_id)
{
panic("no_no_ide_request_irq called - shouldn't happen");
}
static void no_ide_free_irq(unsigned int irq, void *dev_id)
{
panic("no_ide_free_irq called - shouldn't happen");
}
static int no_ide_check_region(ide_ioreg_t from, unsigned int extent)
{
panic("no_ide_check_region called - shouldn't happen");
}
static void no_ide_request_region(ide_ioreg_t from, unsigned int extent,
const char *name)
{
panic("no_ide_request_region called - shouldn't happen");
}
static void no_ide_release_region(ide_ioreg_t from, unsigned int extent)
{
panic("no_ide_release_region called - shouldn't happen");
}
struct ide_ops no_ide_ops = { struct ide_ops no_ide_ops = {
&no_ide_default_irq, &no_ide_default_irq,
&no_ide_default_io_base, &no_ide_default_io_base,
&no_ide_init_hwif_ports, &no_ide_init_hwif_ports
&no_ide_request_irq,
&no_ide_free_irq,
&no_ide_check_region,
&no_ide_request_region,
&no_ide_release_region
}; };
...@@ -62,42 +62,8 @@ static void std_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port, ...@@ -62,42 +62,8 @@ static void std_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port,
hw->io_ports[IDE_IRQ_OFFSET] = 0; hw->io_ports[IDE_IRQ_OFFSET] = 0;
} }
static int std_ide_request_irq(unsigned int irq,
void (*handler)(int,void *, struct pt_regs *),
unsigned long flags, const char *device,
void *dev_id)
{
return request_irq(irq, handler, flags, device, dev_id);
}
static void std_ide_free_irq(unsigned int irq, void *dev_id)
{
free_irq(irq, dev_id);
}
static int std_ide_check_region(ide_ioreg_t from, unsigned int extent)
{
return check_region(from, extent);
}
static void std_ide_request_region(ide_ioreg_t from, unsigned int extent,
const char *name)
{
request_region(from, extent, name);
}
static void std_ide_release_region(ide_ioreg_t from, unsigned int extent)
{
release_region(from, extent);
}
struct ide_ops std_ide_ops = { struct ide_ops std_ide_ops = {
&std_ide_default_irq, &std_ide_default_irq,
&std_ide_default_io_base, &std_ide_default_io_base,
&std_ide_init_hwif_ports, &std_ide_init_hwif_ports
&std_ide_request_irq,
&std_ide_free_irq,
&std_ide_check_region,
&std_ide_request_region,
&std_ide_release_region
}; };
...@@ -256,29 +256,6 @@ ppc4xx_progress(char *s, unsigned short hex) ...@@ -256,29 +256,6 @@ ppc4xx_progress(char *s, unsigned short hex)
* IDE stuff. * IDE stuff.
* should be generic for every IDE PCI chipset * should be generic for every IDE PCI chipset
*/ */
#if defined(CONFIG_BLK_DEV_IDE)
static int
ppc4xx_ide_check_region(ide_ioreg_t from, unsigned int extent)
{
return check_region(from, extent);
}
static void
ppc4xx_ide_request_region(ide_ioreg_t from, unsigned int extent,
const char *name)
{
request_region(from, extent, name);
return;
}
static void
ppc4xx_ide_release_region(ide_ioreg_t from, unsigned int extent)
{
release_region(from, extent);
return;
}
#endif
#if defined(CONFIG_BLK_DEV_IDEPCI) #if defined(CONFIG_BLK_DEV_IDEPCI)
static void static void
ppc4xx_ide_init_hwif_ports(hw_regs_t * hw, ide_ioreg_t data_port, ppc4xx_ide_init_hwif_ports(hw_regs_t * hw, ide_ioreg_t data_port,
...@@ -398,16 +375,13 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -398,16 +375,13 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
** m8xx_setup.c, prep_setup.c use ** m8xx_setup.c, prep_setup.c use
** defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) ** defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
*/ */
#if defined (CONFIG_IDE) #ifdef CONFIG_IDE
ppc_ide_md.ide_request_region = ppc4xx_ide_request_region; # if defined(CONFIG_BLK_DEV_IDEPCI)
ppc_ide_md.ide_release_region = ppc4xx_ide_release_region;
ppc_ide_md.ide_check_region = ppc4xx_ide_check_region;
#if defined(CONFIG_BLK_DEV_IDEPCI)
ppc_ide_md.ide_init_hwif = ppc4xx_ide_init_hwif_ports; ppc_ide_md.ide_init_hwif = ppc4xx_ide_init_hwif_ports;
#elif defined (CONFIG_DMA_NONPCI) /* ON board IDE */ # elif defined (CONFIG_DMA_NONPCI) /* ON board IDE */
ppc_ide_md.default_irq = nonpci_ide_default_irq; ppc_ide_md.default_irq = nonpci_ide_default_irq;
ppc_ide_md.ide_init_hwif = nonpci_ide_init_hwif_ports; ppc_ide_md.ide_init_hwif = nonpci_ide_init_hwif_ports;
#endif # endif
#endif #endif
board_init(); board_init();
......
...@@ -463,33 +463,6 @@ chrp_init2(void) ...@@ -463,33 +463,6 @@ chrp_init2(void)
#endif /* CONFIG_VT && (CONFIG_ADB_KEYBOARD || CONFIG_INPUT) */ #endif /* CONFIG_VT && (CONFIG_ADB_KEYBOARD || CONFIG_INPUT) */
} }
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
/*
* IDE stuff.
*/
static int __chrp
chrp_ide_check_region(ide_ioreg_t from, unsigned int extent)
{
return check_region(from, extent);
}
static void __chrp
chrp_ide_request_region(ide_ioreg_t from,
unsigned int extent,
const char *name)
{
request_region(from, extent, name);
}
static void __chrp
chrp_ide_release_region(ide_ioreg_t from,
unsigned int extent)
{
release_region(from, extent);
}
#endif
/* /*
* One of the main thing these mappings are needed for is so that * One of the main thing these mappings are needed for is so that
* xmon can get to the serial port early on. We probably should * xmon can get to the serial port early on. We probably should
...@@ -597,12 +570,6 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -597,12 +570,6 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.smp_ops = &chrp_smp_ops; ppc_md.smp_ops = &chrp_smp_ops;
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
ppc_ide_md.ide_check_region = chrp_ide_check_region;
ppc_ide_md.ide_request_region = chrp_ide_request_region;
ppc_ide_md.ide_release_region = chrp_ide_release_region;
#endif
/* /*
* Print the banner, then scroll down so boot progress * Print the banner, then scroll down so boot progress
* can be printed. -- Cort * can be printed. -- Cort
......
...@@ -55,24 +55,6 @@ static unsigned int cpu_6xx[16] = { ...@@ -55,24 +55,6 @@ static unsigned int cpu_6xx[16] = {
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
/* IDE functions */ /* IDE functions */
static int
k2_ide_check_region(ide_ioreg_t from, unsigned int extent)
{
return check_region(from, extent);
}
static void
k2_ide_request_region(ide_ioreg_t from, unsigned int extent,
const char *name)
{
request_region(from, extent, name);
}
static void
k2_ide_release_region(ide_ioreg_t from, unsigned int extent)
{
release_region(from, extent);
}
static void __init static void __init
k2_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port, k2_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port,
...@@ -373,9 +355,6 @@ void __init platform_init(unsigned long r3, unsigned long r4, ...@@ -373,9 +355,6 @@ void __init platform_init(unsigned long r3, unsigned long r4,
ppc_md.nvram_write_val = todc_direct_write_val; ppc_md.nvram_write_val = todc_direct_write_val;
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
ppc_ide_md.ide_check_region = k2_ide_check_region;
ppc_ide_md.ide_request_region = k2_ide_request_region;
ppc_ide_md.ide_release_region = k2_ide_release_region;
ppc_ide_md.ide_init_hwif = k2_ide_init_hwif_ports; ppc_ide_md.ide_init_hwif = k2_ide_init_hwif_ports;
#endif #endif
} }
......
...@@ -154,13 +154,6 @@ lopec_ide_default_irq(ide_ioreg_t base) ...@@ -154,13 +154,6 @@ lopec_ide_default_irq(ide_ioreg_t base)
return 0; return 0;
} }
static void
lopec_ide_request_region(ide_ioreg_t from, unsigned int to,
const char *name)
{
request_region(from, to, name);
}
static ide_ioreg_t static ide_ioreg_t
lopec_ide_default_io_base(int index) lopec_ide_default_io_base(int index)
{ {
...@@ -169,19 +162,6 @@ lopec_ide_default_io_base(int index) ...@@ -169,19 +162,6 @@ lopec_ide_default_io_base(int index)
return lopec_ide_regbase[index]; return lopec_ide_regbase[index];
} }
static int
lopec_ide_check_region(ide_ioreg_t from, unsigned int to)
{
return check_region(from, to);
}
static void
lopec_ide_release_region(ide_ioreg_t from, unsigned int to)
{
release_region(from, to);
}
static void __init static void __init
lopec_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data, lopec_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data,
ide_ioreg_t ctl, int *irq) ide_ioreg_t ctl, int *irq)
...@@ -350,9 +330,6 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -350,9 +330,6 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_ID_MODULE) #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_ID_MODULE)
ppc_ide_md.default_irq = lopec_ide_default_irq; ppc_ide_md.default_irq = lopec_ide_default_irq;
ppc_ide_md.default_io_base = lopec_ide_default_io_base; ppc_ide_md.default_io_base = lopec_ide_default_io_base;
ppc_ide_md.ide_request_region = lopec_ide_request_region;
ppc_ide_md.ide_check_region = lopec_ide_check_region;
ppc_ide_md.ide_release_region = lopec_ide_release_region;
ppc_ide_md.ide_init_hwif = lopec_ide_init_hwif_ports; ppc_ide_md.ide_init_hwif = lopec_ide_init_hwif_ports;
#endif #endif
} }
...@@ -322,29 +322,6 @@ mcpn765_ide_default_io_base(int index) ...@@ -322,29 +322,6 @@ mcpn765_ide_default_io_base(int index)
return mcpn765_ide_regbase[index]; return mcpn765_ide_regbase[index];
} }
static int
mcpn765_ide_check_region(ide_ioreg_t from, unsigned int extent)
{
return check_region(from, extent);
}
static void
mcpn765_ide_request_region(ide_ioreg_t from,
unsigned int extent,
const char *name)
{
request_region(from, extent, name);
return;
}
static void
mcpn765_ide_release_region(ide_ioreg_t from,
unsigned int extent)
{
release_region(from, extent);
return;
}
static void __init static void __init
mcpn765_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, mcpn765_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port,
ide_ioreg_t ctrl_port, int *irq) ide_ioreg_t ctrl_port, int *irq)
...@@ -492,9 +469,6 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -492,9 +469,6 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
ppc_ide_md.default_irq = mcpn765_ide_default_irq; ppc_ide_md.default_irq = mcpn765_ide_default_irq;
ppc_ide_md.default_io_base = mcpn765_ide_default_io_base; ppc_ide_md.default_io_base = mcpn765_ide_default_io_base;
ppc_ide_md.ide_check_region = mcpn765_ide_check_region;
ppc_ide_md.ide_request_region = mcpn765_ide_request_region;
ppc_ide_md.ide_release_region = mcpn765_ide_release_region;
ppc_ide_md.ide_init_hwif = mcpn765_ide_init_hwif_ports; ppc_ide_md.ide_init_hwif = mcpn765_ide_init_hwif_ports;
#endif #endif
......
...@@ -199,27 +199,6 @@ menf1_map_io(void) ...@@ -199,27 +199,6 @@ menf1_map_io(void)
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
/* IDE functions */ /* IDE functions */
static int
menf1_ide_check_region(ide_ioreg_t from, unsigned int extent)
{
return check_region(from, extent);
}
static void
menf1_ide_request_region(ide_ioreg_t from,
unsigned int extent,
const char *name)
{
request_region(from, extent, name);
}
static void
menf1_ide_release_region(ide_ioreg_t from,
unsigned int extent)
{
release_region(from, extent);
}
static void __init static void __init
menf1_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port, menf1_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port,
ide_ioreg_t ctrl_port, int *irq) ide_ioreg_t ctrl_port, int *irq)
...@@ -305,9 +284,6 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -305,9 +284,6 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
ppc_ide_md.default_io_base = menf1_ide_default_io_base; ppc_ide_md.default_io_base = menf1_ide_default_io_base;
ppc_ide_md.default_irq = menf1_ide_default_irq; ppc_ide_md.default_irq = menf1_ide_default_irq;
ppc_ide_md.ide_check_region = menf1_ide_check_region;
ppc_ide_md.ide_request_region = menf1_ide_request_region;
ppc_ide_md.ide_release_region = menf1_ide_release_region;
ppc_ide_md.ide_init_hwif = menf1_ide_init_hwif_ports; ppc_ide_md.ide_init_hwif = menf1_ide_init_hwif_ports;
#endif #endif
} }
...@@ -601,45 +601,6 @@ pmac_halt(void) ...@@ -601,45 +601,6 @@ pmac_halt(void)
pmac_power_off(); pmac_power_off();
} }
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
/*
* IDE stuff.
*/
static int __pmac
pmac_ide_check_region(ide_ioreg_t from, unsigned int extent)
{
#ifdef CONFIG_BLK_DEV_IDE_PMAC
if (pmac_ide_check_base(from) >= 0)
return 0;
#endif
return check_region(from, extent);
}
static void __pmac
pmac_ide_request_region(ide_ioreg_t from,
unsigned int extent,
const char *name)
{
#ifdef CONFIG_BLK_DEV_IDE_PMAC
if (pmac_ide_check_base(from) >= 0)
return;
#endif
request_region(from, extent, name);
}
static void __pmac
pmac_ide_release_region(ide_ioreg_t from,
unsigned int extent)
{
#ifdef CONFIG_BLK_DEV_IDE_PMAC
if (pmac_ide_check_base(from) >= 0)
return;
#endif
release_region(from, extent);
}
#endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */
/* /*
* Read in a property describing some pieces of memory. * Read in a property describing some pieces of memory.
*/ */
...@@ -796,12 +757,6 @@ pmac_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -796,12 +757,6 @@ pmac_init(unsigned long r3, unsigned long r4, unsigned long r5,
select_adb_keyboard(); select_adb_keyboard();
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
ppc_ide_md.ide_check_region = pmac_ide_check_region;
ppc_ide_md.ide_request_region = pmac_ide_request_region;
ppc_ide_md.ide_release_region = pmac_ide_release_region;
#endif /* defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) */
#ifdef CONFIG_BOOTX_TEXT #ifdef CONFIG_BOOTX_TEXT
ppc_md.progress = pmac_progress; ppc_md.progress = pmac_progress;
#endif /* CONFIG_BOOTX_TEXT */ #endif /* CONFIG_BOOTX_TEXT */
......
...@@ -263,27 +263,6 @@ pplus_ide_default_io_base(int index) ...@@ -263,27 +263,6 @@ pplus_ide_default_io_base(int index)
} }
} }
static int
pplus_ide_check_region(ide_ioreg_t from, unsigned int extent)
{
return check_region(from, extent);
}
static void
pplus_ide_request_region(ide_ioreg_t from,
unsigned int extent,
const char *name)
{
request_region(from, extent, name);
}
static void
pplus_ide_release_region(ide_ioreg_t from,
unsigned int extent)
{
release_region(from, extent);
}
static void __init static void __init
pplus_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq) pplus_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq)
{ {
...@@ -528,9 +507,6 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -528,9 +507,6 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
ppc_ide_md.default_irq = pplus_ide_default_irq; ppc_ide_md.default_irq = pplus_ide_default_irq;
ppc_ide_md.default_io_base = pplus_ide_default_io_base; ppc_ide_md.default_io_base = pplus_ide_default_io_base;
ppc_ide_md.ide_check_region = pplus_ide_check_region;
ppc_ide_md.ide_request_region = pplus_ide_request_region;
ppc_ide_md.ide_release_region = pplus_ide_release_region;
ppc_ide_md.ide_init_hwif = pplus_ide_init_hwif_ports; ppc_ide_md.ide_init_hwif = pplus_ide_init_hwif_ports;
#endif #endif
......
...@@ -733,27 +733,6 @@ prep_ide_default_io_base(int index) ...@@ -733,27 +733,6 @@ prep_ide_default_io_base(int index)
return 0; return 0;
} }
} }
static int __prep
prep_ide_check_region(ide_ioreg_t from, unsigned int extent)
{
return check_region(from, extent);
}
static void __prep
prep_ide_request_region(ide_ioreg_t from,
unsigned int extent,
const char *name)
{
request_region(from, extent, name);
}
static void __prep
prep_ide_release_region(ide_ioreg_t from,
unsigned int extent)
{
release_region(from, extent);
}
#endif #endif
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
...@@ -916,9 +895,6 @@ prep_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -916,9 +895,6 @@ prep_init(unsigned long r3, unsigned long r4, unsigned long r5,
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
ppc_ide_md.default_irq = prep_ide_default_irq; ppc_ide_md.default_irq = prep_ide_default_irq;
ppc_ide_md.default_io_base = prep_ide_default_io_base; ppc_ide_md.default_io_base = prep_ide_default_io_base;
ppc_ide_md.ide_check_region = prep_ide_check_region;
ppc_ide_md.ide_request_region = prep_ide_request_region;
ppc_ide_md.ide_release_region = prep_ide_release_region;
#endif #endif
#ifdef CONFIG_VT #ifdef CONFIG_VT
......
...@@ -85,8 +85,8 @@ extern bd_t m8xx_board_info; ...@@ -85,8 +85,8 @@ extern bd_t m8xx_board_info;
/* for pcmcia sandisk */ /* for pcmcia sandisk */
#ifdef CONFIG_IDE #ifdef CONFIG_IDE
#define MAX_HWIFS 1 # define MAX_HWIFS 1
#define ide_request_irq(irq,hand,flg,dev,id) request_8xxirq((irq),(hand),(flg),(dev),(id)) # define request_irq(irq,hand,flg,dev,id) request_8xxirq((irq),(hand),(flg),(dev),(id))
#endif #endif
#endif #endif
......
...@@ -72,8 +72,8 @@ extern bd_t m8xx_board_info; ...@@ -72,8 +72,8 @@ extern bd_t m8xx_board_info;
#define _IO_BASE_SIZE 0x1000 #define _IO_BASE_SIZE 0x1000
#ifdef CONFIG_IDE #ifdef CONFIG_IDE
#define MAX_HWIFS 1 # define MAX_HWIFS 1
#define ide_request_irq(irq,hand,flg,dev,id) request_8xxirq((irq),(hand),(flg),(dev),(id)) # define request_irq(irq,hand,flg,dev,id) request_8xxirq((irq),(hand),(flg),(dev),(id))
#endif #endif
/* We don't use the 8259. /* We don't use the 8259.
......
...@@ -491,29 +491,6 @@ sandpoint_ide_default_io_base(int index) ...@@ -491,29 +491,6 @@ sandpoint_ide_default_io_base(int index)
return sandpoint_ide_regbase[index]; return sandpoint_ide_regbase[index];
} }
static int
sandpoint_ide_check_region(ide_ioreg_t from, unsigned int extent)
{
return check_region(from, extent);
}
static void
sandpoint_ide_request_region(ide_ioreg_t from,
unsigned int extent,
const char *name)
{
request_region(from, extent, name);
return;
}
static void
sandpoint_ide_release_region(ide_ioreg_t from,
unsigned int extent)
{
release_region(from, extent);
return;
}
static void __init static void __init
sandpoint_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, sandpoint_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port,
ide_ioreg_t ctrl_port, int *irq) ide_ioreg_t ctrl_port, int *irq)
...@@ -684,9 +661,6 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -684,9 +661,6 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
ppc_ide_md.default_irq = sandpoint_ide_default_irq; ppc_ide_md.default_irq = sandpoint_ide_default_irq;
ppc_ide_md.default_io_base = sandpoint_ide_default_io_base; ppc_ide_md.default_io_base = sandpoint_ide_default_io_base;
ppc_ide_md.ide_check_region = sandpoint_ide_check_region;
ppc_ide_md.ide_request_region = sandpoint_ide_request_region;
ppc_ide_md.ide_release_region = sandpoint_ide_release_region;
ppc_ide_md.ide_init_hwif = sandpoint_ide_init_hwif_ports; ppc_ide_md.ide_init_hwif = sandpoint_ide_init_hwif_ports;
#endif #endif
......
...@@ -435,162 +435,143 @@ static inline void probe_for_drive (ide_drive_t *drive) ...@@ -435,162 +435,143 @@ static inline void probe_for_drive (ide_drive_t *drive)
} }
/* /*
* Calculate the region that this interface occupies, * This routine only knows how to look for drive units 0 and 1
* handling interfaces where the registers may not be * on an interface, so any setting of MAX_DRIVES > 2 won't work here.
* ordered sanely. We deal with the CONTROL register
* separately.
*/ */
static int hwif_check_regions(struct ata_channel *hwif) static void probe_hwif(struct ata_channel *ch)
{ {
int region_errors = 0; unsigned int unit;
unsigned long flags;
hwif->straight8 = 0;
region_errors = ide_check_region(hwif->io_ports[IDE_DATA_OFFSET], 1); if (ch->noprobe)
region_errors += ide_check_region(hwif->io_ports[IDE_ERROR_OFFSET], 1); return;
region_errors += ide_check_region(hwif->io_ports[IDE_NSECTOR_OFFSET], 1);
region_errors += ide_check_region(hwif->io_ports[IDE_SECTOR_OFFSET], 1); ch->straight8 = 0;
region_errors += ide_check_region(hwif->io_ports[IDE_LCYL_OFFSET], 1);
region_errors += ide_check_region(hwif->io_ports[IDE_HCYL_OFFSET], 1); __save_flags(flags); /* local CPU only */
region_errors += ide_check_region(hwif->io_ports[IDE_SELECT_OFFSET], 1); __sti(); /* local CPU only; needed for jiffies and irq probing */
region_errors += ide_check_region(hwif->io_ports[IDE_STATUS_OFFSET], 1);
if (hwif->io_ports[IDE_CONTROL_OFFSET])
region_errors += ide_check_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1);
#if defined(CONFIG_AMIGA) || defined(CONFIG_MAC)
if (hwif->io_ports[IDE_IRQ_OFFSET])
region_errors += ide_check_region(hwif->io_ports[IDE_IRQ_OFFSET], 1);
#endif /* (CONFIG_AMIGA) || (CONFIG_MAC) */
/* /*
* If any errors are return, we drop the hwif interface. * Check for the presence of a channel by probing for drives on it.
*/ */
return(region_errors);
}
static void hwif_register(struct ata_channel *hwif) for (unit = 0; unit < MAX_DRIVES; ++unit) {
{ struct ata_device *drive = &ch->drives[unit];
/* Register this hardware interface within the global device tree.
*/ probe_for_drive(drive);
sprintf(hwif->dev.bus_id, "%04x", hwif->io_ports[IDE_DATA_OFFSET]);
sprintf(hwif->dev.name, "ide"); if (drive->present && !ch->present) {
hwif->dev.driver_data = hwif; ch->present = 1;
#ifdef CONFIG_BLK_DEV_IDEPCI }
if (hwif->pci_dev) }
hwif->dev.parent = &hwif->pci_dev->dev;
else if (ch->present) {
#endif int error = 0;
hwif->dev.parent = NULL; /* Would like to do = &device_legacy */
device_register(&hwif->dev);
if (((unsigned long)hwif->io_ports[IDE_DATA_OFFSET] | 7) == if (((unsigned long)ch->io_ports[IDE_DATA_OFFSET] | 7) ==
((unsigned long)hwif->io_ports[IDE_STATUS_OFFSET])) { ((unsigned long)ch->io_ports[IDE_STATUS_OFFSET])) {
ide_request_region(hwif->io_ports[IDE_DATA_OFFSET], 8, hwif->name); error += !request_region(ch->io_ports[IDE_DATA_OFFSET], 8, ch->name);
hwif->straight8 = 1; ch->straight8 = 1;
} else { } else {
if (hwif->io_ports[IDE_DATA_OFFSET]) if (ch->io_ports[IDE_DATA_OFFSET])
ide_request_region(hwif->io_ports[IDE_DATA_OFFSET], 1, hwif->name); error += !request_region(ch->io_ports[IDE_DATA_OFFSET], 1, ch->name);
if (hwif->io_ports[IDE_ERROR_OFFSET]) if (ch->io_ports[IDE_ERROR_OFFSET])
ide_request_region(hwif->io_ports[IDE_ERROR_OFFSET], 1, hwif->name); error += !request_region(ch->io_ports[IDE_ERROR_OFFSET], 1, ch->name);
if (hwif->io_ports[IDE_NSECTOR_OFFSET]) if (ch->io_ports[IDE_NSECTOR_OFFSET])
ide_request_region(hwif->io_ports[IDE_NSECTOR_OFFSET], 1, hwif->name); error += !request_region(ch->io_ports[IDE_NSECTOR_OFFSET], 1, ch->name);
if (hwif->io_ports[IDE_SECTOR_OFFSET]) if (ch->io_ports[IDE_SECTOR_OFFSET])
ide_request_region(hwif->io_ports[IDE_SECTOR_OFFSET], 1, hwif->name); error += !request_region(ch->io_ports[IDE_SECTOR_OFFSET], 1, ch->name);
if (hwif->io_ports[IDE_LCYL_OFFSET]) if (ch->io_ports[IDE_LCYL_OFFSET])
ide_request_region(hwif->io_ports[IDE_LCYL_OFFSET], 1, hwif->name); error += !request_region(ch->io_ports[IDE_LCYL_OFFSET], 1, ch->name);
if (hwif->io_ports[IDE_HCYL_OFFSET]) if (ch->io_ports[IDE_HCYL_OFFSET])
ide_request_region(hwif->io_ports[IDE_HCYL_OFFSET], 1, hwif->name); error += !request_region(ch->io_ports[IDE_HCYL_OFFSET], 1, ch->name);
if (hwif->io_ports[IDE_SELECT_OFFSET]) if (ch->io_ports[IDE_SELECT_OFFSET])
ide_request_region(hwif->io_ports[IDE_SELECT_OFFSET], 1, hwif->name); error += !request_region(ch->io_ports[IDE_SELECT_OFFSET], 1, ch->name);
if (hwif->io_ports[IDE_STATUS_OFFSET]) if (ch->io_ports[IDE_STATUS_OFFSET])
ide_request_region(hwif->io_ports[IDE_STATUS_OFFSET], 1, hwif->name); error += !request_region(ch->io_ports[IDE_STATUS_OFFSET], 1, ch->name);
} }
if (hwif->io_ports[IDE_CONTROL_OFFSET]) if (ch->io_ports[IDE_CONTROL_OFFSET])
ide_request_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1, hwif->name); error += !request_region(ch->io_ports[IDE_CONTROL_OFFSET], 1, ch->name);
#if defined(CONFIG_AMIGA) || defined(CONFIG_MAC) #if defined(CONFIG_AMIGA) || defined(CONFIG_MAC)
if (hwif->io_ports[IDE_IRQ_OFFSET]) if (ch->io_ports[IDE_IRQ_OFFSET])
ide_request_region(hwif->io_ports[IDE_IRQ_OFFSET], 1, hwif->name); error += !request_region(ch->io_ports[IDE_IRQ_OFFSET], 1, ch->name);
#endif #endif
}
/* /* Some neccessary register area was already used. Skip this
* This routine only knows how to look for drive units 0 and 1 * device.
* on an interface, so any setting of MAX_DRIVES > 2 won't work here.
*/ */
static void probe_hwif(struct ata_channel *hwif)
{
unsigned int unit;
unsigned long flags;
if (hwif->noprobe)
return;
if ( if (
#if CONFIG_BLK_DEV_PDC4030 #if CONFIG_BLK_DEV_PDC4030
(hwif->chipset != ide_pdc4030 || hwif->unit == 0) && (ch->chipset != ide_pdc4030 || ch->unit == 0) &&
#endif #endif
hwif_check_regions(hwif)) { error) {
int msgout = 0; /* FIXME: We should be dealing properly with partial IO
for (unit = 0; unit < MAX_DRIVES; ++unit) { * region allocations here.
ide_drive_t *drive = &hwif->drives[unit]; */
if (drive->present) { ch->present = 0;
drive->present = 0; printk("%s: error: ports already in use!\n", ch->name);
printk("%s: ERROR, PORTS ALREADY IN USE\n", drive->name);
msgout = 1;
}
} }
if (!msgout)
printk("%s: ports already in use, skipping probe\n", hwif->name);
return;
} }
__save_flags(flags); /* local CPU only */ if (ch->present) {
__sti(); /* local CPU only; needed for jiffies and irq probing */ /* Register this hardware interface within the global device tree.
/*
* Second drive should only exist if first drive was found,
* but a lot of cdrom drives are configured as single slaves.
*/ */
for (unit = 0; unit < MAX_DRIVES; ++unit) { sprintf(ch->dev.bus_id, "%04x", ch->io_ports[IDE_DATA_OFFSET]);
ide_drive_t *drive = &hwif->drives[unit]; sprintf(ch->dev.name, "ide");
probe_for_drive (drive); ch->dev.driver_data = ch;
if (drive->present && !hwif->present) { #ifdef CONFIG_BLK_DEV_IDEPCI
hwif->present = 1; if (ch->pci_dev)
hwif_register(hwif); ch->dev.parent = &ch->pci_dev->dev;
} else
} #endif
if (hwif->io_ports[IDE_CONTROL_OFFSET] && hwif->reset) { ch->dev.parent = NULL; /* Would like to do = &device_legacy */
device_register(&ch->dev);
if (ch->io_ports[IDE_CONTROL_OFFSET] && ch->reset) {
unsigned long timeout = jiffies + WAIT_WORSTCASE; unsigned long timeout = jiffies + WAIT_WORSTCASE;
byte stat; byte stat;
printk("%s: reset\n", hwif->name); printk("%s: reset\n", ch->name);
OUT_BYTE(12, hwif->io_ports[IDE_CONTROL_OFFSET]); OUT_BYTE(12, ch->io_ports[IDE_CONTROL_OFFSET]);
udelay(10); udelay(10);
OUT_BYTE(8, hwif->io_ports[IDE_CONTROL_OFFSET]); OUT_BYTE(8, ch->io_ports[IDE_CONTROL_OFFSET]);
do { do {
ide_delay_50ms(); ide_delay_50ms();
stat = IN_BYTE(hwif->io_ports[IDE_STATUS_OFFSET]); stat = IN_BYTE(ch->io_ports[IDE_STATUS_OFFSET]);
} while ((stat & BUSY_STAT) && 0 < (signed long)(timeout - jiffies)); } while ((stat & BUSY_STAT) && 0 < (signed long)(timeout - jiffies));
} }
}
__restore_flags(flags); /* local CPU only */ __restore_flags(flags); /* local CPU only */
/*
* Now setup the PIO transfer modes of the drives on this channel.
*/
if (ch->present) {
for (unit = 0; unit < MAX_DRIVES; ++unit) { for (unit = 0; unit < MAX_DRIVES; ++unit) {
ide_drive_t *drive = &hwif->drives[unit]; struct ata_device *drive = &ch->drives[unit];
if (drive->present && (drive->autotune == 1)) { if (drive->present && (drive->autotune == 1)) {
if (drive->channel->tuneproc != NULL) if (drive->channel->tuneproc)
drive->channel->tuneproc(drive, 255); /* auto-tune PIO mode */ drive->channel->tuneproc(drive, 255); /* auto-tune PIO mode */
} }
} }
}
} }
/* /*
* init request queue * init request queue
*/ */
static void ide_init_queue(ide_drive_t *drive) static void init_device_queue(struct ata_device *drive)
{ {
request_queue_t *q = &drive->queue; request_queue_t *q = &drive->queue;
int max_sectors = 255; int max_sectors = 255;
q->queuedata = HWGROUP(drive); q->queuedata = drive->channel;
blk_init_queue(q, do_ide_request, &ide_lock); blk_init_queue(q, do_ide_request, &ide_lock);
blk_queue_segment_boundary(q, 0xffff); blk_queue_segment_boundary(q, 0xffff);
...@@ -637,23 +618,24 @@ static void save_match(struct ata_channel *hwif, struct ata_channel *new, ...@@ -637,23 +618,24 @@ static void save_match(struct ata_channel *hwif, struct ata_channel *new,
#endif #endif
/* /*
* This routine sets up the irq for an ide interface, and creates a new * This routine sets up the irq for an ide interface, and creates a new hwgroup
* hwgroup for the irq/hwif if none was previously assigned. * for the irq/channel if none was previously assigned.
* *
* Much of the code is for correctly detecting/handling irq sharing * Much of the code is for correctly detecting/handling irq sharing and irq
* and irq serialization situations. This is somewhat complex because * serialization situations. This is somewhat complex because it handles
* it handles static as well as dynamic (PCMCIA) IDE interfaces. * static as well as dynamic (PCMCIA) IDE interfaces.
* *
* The SA_INTERRUPT in sa_flags means ide_intr() is always entered with * The SA_INTERRUPT in sa_flags means ata_irq_request() is always entered with
* interrupts completely disabled. This can be bad for interrupt latency, * interrupts completely disabled. This can be bad for interrupt latency, but
* but anything else has led to problems on some machines. We re-enable * anything else has led to problems on some machines. We re-enable interrupts
* interrupts as much as we can safely do in most places. * as much as we can safely do in most places.
*/ */
static int init_irq(struct ata_channel *hwif) static int init_irq(struct ata_channel *ch)
{ {
unsigned long flags; unsigned long flags;
unsigned int index; unsigned int index;
ide_hwgroup_t *hwgroup, *new_hwgroup; ide_hwgroup_t *hwgroup;
ide_hwgroup_t *new_hwgroup;
struct ata_channel *match = NULL; struct ata_channel *match = NULL;
...@@ -662,26 +644,26 @@ static int init_irq(struct ata_channel *hwif) ...@@ -662,26 +644,26 @@ static int init_irq(struct ata_channel *hwif)
new_hwgroup = kmalloc(sizeof(ide_hwgroup_t),GFP_KERNEL); new_hwgroup = kmalloc(sizeof(ide_hwgroup_t),GFP_KERNEL);
spin_lock_irqsave(&ide_lock, flags); spin_lock_irqsave(&ide_lock, flags);
hwif->hwgroup = NULL; ch->hwgroup = NULL;
#if MAX_HWIFS > 1 #if MAX_HWIFS > 1
/* /*
* Group up with any other hwifs that share our irq(s). * Group up with any other channels that share our irq(s).
*/ */
for (index = 0; index < MAX_HWIFS; index++) { for (index = 0; index < MAX_HWIFS; index++) {
struct ata_channel *h = &ide_hwifs[index]; struct ata_channel *h = &ide_hwifs[index];
if (h->hwgroup) { /* scan only initialized hwif's */ if (h->hwgroup) { /* scan only initialized channels */
if (hwif->irq == h->irq) { if (ch->irq == h->irq) {
hwif->sharing_irq = h->sharing_irq = 1; ch->sharing_irq = h->sharing_irq = 1;
if (hwif->chipset != ide_pci || h->chipset != ide_pci) if (ch->chipset != ide_pci || h->chipset != ide_pci)
save_match(hwif, h, &match); save_match(ch, h, &match);
/* FIXME: This is still confusing. What would /* FIXME: This is still confusing. What would
* happen if we match-ed two times? * happen if we match-ed two times?
*/ */
if (hwif->serialized || h->serialized) if (ch->serialized || h->serialized)
save_match(hwif, h, &match); save_match(ch, h, &match);
} }
} }
} }
...@@ -700,33 +682,35 @@ static int init_irq(struct ata_channel *hwif) ...@@ -700,33 +682,35 @@ static int init_irq(struct ata_channel *hwif)
return 1; return 1;
} }
memset(hwgroup, 0, sizeof(ide_hwgroup_t)); memset(hwgroup, 0, sizeof(ide_hwgroup_t));
hwgroup->hwif = hwif->next = hwif; hwgroup->hwif = ch->next = ch;
hwgroup->rq = NULL; hwgroup->rq = NULL;
hwgroup->handler = NULL; hwgroup->handler = NULL;
hwgroup->drive = NULL; hwgroup->drive = NULL;
hwgroup->flags = 0; hwgroup->flags = 0;
init_timer(&hwgroup->timer); init_timer(&hwgroup->timer);
hwgroup->timer.function = &ide_timer_expiry; hwgroup->timer.function = &ide_timer_expiry;
hwgroup->timer.data = (unsigned long) hwgroup; hwgroup->timer.data = (unsigned long) hwgroup;
} }
/* /*
* Allocate the irq, if not already obtained for another hwif * Allocate the irq, if not already obtained for another channel
*/ */
if (!match || match->irq != hwif->irq) { if (!match || match->irq != ch->irq) {
#ifdef CONFIG_IDEPCI_SHARE_IRQ #ifdef CONFIG_IDEPCI_SHARE_IRQ
int sa = IDE_CHIPSET_IS_PCI(hwif->chipset) ? SA_SHIRQ : SA_INTERRUPT; int sa = IDE_CHIPSET_IS_PCI(ch->chipset) ? SA_SHIRQ : SA_INTERRUPT;
#else #else
int sa = IDE_CHIPSET_IS_PCI(hwif->chipset) ? SA_INTERRUPT|SA_SHIRQ : SA_INTERRUPT; int sa = IDE_CHIPSET_IS_PCI(ch->chipset) ? SA_INTERRUPT|SA_SHIRQ : SA_INTERRUPT;
#endif #endif
if (hwif->io_ports[IDE_CONTROL_OFFSET]) if (ch->io_ports[IDE_CONTROL_OFFSET])
OUT_BYTE(0x08, hwif->io_ports[IDE_CONTROL_OFFSET]); /* clear nIEN */ OUT_BYTE(0x08, ch->io_ports[IDE_CONTROL_OFFSET]); /* clear nIEN */
if (ide_request_irq(hwif->irq, &ide_intr, sa, hwif->name, hwgroup)) { if (request_irq(ch->irq, &ata_irq_request, sa, ch->name, ch)) {
if (!match) if (!match)
kfree(hwgroup); kfree(hwgroup);
spin_unlock_irqrestore(&ide_lock, flags); spin_unlock_irqrestore(&ide_lock, flags);
return 1; return 1;
} }
} }
...@@ -734,45 +718,49 @@ static int init_irq(struct ata_channel *hwif) ...@@ -734,45 +718,49 @@ static int init_irq(struct ata_channel *hwif)
/* /*
* Everything is okay, so link us into the hwgroup. * Everything is okay, so link us into the hwgroup.
*/ */
hwif->hwgroup = hwgroup; ch->hwgroup = hwgroup;
hwif->next = hwgroup->hwif->next; ch->next = hwgroup->hwif->next;
hwgroup->hwif->next = hwif; hwgroup->hwif->next = ch;
for (index = 0; index < MAX_DRIVES; ++index) { for (index = 0; index < MAX_DRIVES; ++index) {
ide_drive_t *drive = &hwif->drives[index]; struct ata_device *drive = &ch->drives[index];
if (!drive->present) if (!drive->present)
continue; continue;
if (!hwgroup->drive) if (!hwgroup->drive)
hwgroup->drive = drive; hwgroup->drive = drive;
drive->next = hwgroup->drive->next; drive->next = hwgroup->drive->next;
hwgroup->drive->next = drive; hwgroup->drive->next = drive;
ide_init_queue(drive);
init_device_queue(drive);
} }
if (!hwgroup->hwif) { if (!hwgroup->hwif) {
hwgroup->hwif = hwgroup->drive->channel; hwgroup->hwif = hwgroup->drive->channel;
#ifdef DEBUG #ifdef DEBUG
printk("%s : Adding missed hwif to hwgroup!!\n", hwif->name); printk("%s : Adding missed channel to hwgroup!!\n", ch->name);
#endif #endif
} }
spin_unlock_irqrestore(&ide_lock, flags); spin_unlock_irqrestore(&ide_lock, flags);
#if !defined(__mc68000__) && !defined(CONFIG_APUS) && !defined(__sparc__) #if !defined(__mc68000__) && !defined(CONFIG_APUS) && !defined(__sparc__)
printk("%s at 0x%03x-0x%03x,0x%03x on irq %d", hwif->name, printk("%s at 0x%03x-0x%03x,0x%03x on irq %d", ch->name,
hwif->io_ports[IDE_DATA_OFFSET], ch->io_ports[IDE_DATA_OFFSET],
hwif->io_ports[IDE_DATA_OFFSET]+7, ch->io_ports[IDE_DATA_OFFSET]+7,
hwif->io_ports[IDE_CONTROL_OFFSET], hwif->irq); ch->io_ports[IDE_CONTROL_OFFSET], ch->irq);
#elif defined(__sparc__) #elif defined(__sparc__)
printk("%s at 0x%03lx-0x%03lx,0x%03lx on irq %s", hwif->name, printk("%s at 0x%03lx-0x%03lx,0x%03lx on irq %s", ch->name,
hwif->io_ports[IDE_DATA_OFFSET], ch->io_ports[IDE_DATA_OFFSET],
hwif->io_ports[IDE_DATA_OFFSET]+7, ch->io_ports[IDE_DATA_OFFSET]+7,
hwif->io_ports[IDE_CONTROL_OFFSET], __irq_itoa(hwif->irq)); ch->io_ports[IDE_CONTROL_OFFSET], __irq_itoa(ch->irq));
#else #else
printk("%s at %p on irq 0x%08x", hwif->name, printk("%s at %p on irq 0x%08x", ch->name,
hwif->io_ports[IDE_DATA_OFFSET], hwif->irq); ch->io_ports[IDE_DATA_OFFSET], ch->irq);
#endif /* __mc68000__ && CONFIG_APUS */ #endif /* __mc68000__ && CONFIG_APUS */
if (match) if (match)
printk(" (%sed with %s)", printk(" (%sed with %s)",
hwif->sharing_irq ? "shar" : "serializ", match->name); ch->sharing_irq ? "shar" : "serializ", match->name);
printk("\n"); printk("\n");
return 0; return 0;
} }
...@@ -868,7 +856,7 @@ static int hwif_init(struct ata_channel *hwif) ...@@ -868,7 +856,7 @@ static int hwif_init(struct ata_channel *hwif)
printk("%s: CANNOT SHARE IRQ WITH OLD HARDDISK DRIVER (hd.c)\n", hwif->name); printk("%s: CANNOT SHARE IRQ WITH OLD HARDDISK DRIVER (hd.c)\n", hwif->name);
return (hwif->present = 0); return (hwif->present = 0);
} }
#endif /* CONFIG_BLK_DEV_HD */ #endif
hwif->present = 0; /* we set it back to 1 if all is ok below */ hwif->present = 0; /* we set it back to 1 if all is ok below */
......
...@@ -215,7 +215,7 @@ static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */ ...@@ -215,7 +215,7 @@ static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */
* This is used by the Atari code to obtain access to the IDE interrupt, * This is used by the Atari code to obtain access to the IDE interrupt,
* which is shared between several drivers. * which is shared between several drivers.
*/ */
static int ide_intr_lock; static int irq_lock;
#endif #endif
int noautodma = 0; int noautodma = 0;
...@@ -568,42 +568,45 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive) ...@@ -568,42 +568,45 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive)
{ {
ide_hwgroup_t *hwgroup = HWGROUP(drive); ide_hwgroup_t *hwgroup = HWGROUP(drive);
struct ata_channel *hwif = drive->channel; struct ata_channel *hwif = drive->channel;
byte tmp; u8 stat;
if (!OK_STAT(tmp=GET_STAT(), 0, BUSY_STAT)) { if (!OK_STAT(stat=GET_STAT(), 0, BUSY_STAT)) {
if (time_before(jiffies, hwgroup->poll_timeout)) { if (time_before(jiffies, hwgroup->poll_timeout)) {
BUG_ON(HWGROUP(drive)->handler); BUG_ON(HWGROUP(drive)->handler);
ide_set_handler (drive, &reset_pollfunc, HZ/20, NULL); ide_set_handler (drive, &reset_pollfunc, HZ/20, NULL);
return ide_started; /* continue polling */ return ide_started; /* continue polling */
} }
printk("%s: reset timed-out, status=0x%02x\n", hwif->name, tmp); printk("%s: reset timed-out, status=0x%02x\n", hwif->name, stat);
drive->failures++; drive->failures++;
} else { } else {
printk("%s: reset: ", hwif->name); printk("%s: reset: ", hwif->name);
if ((tmp = GET_ERR()) == 1) { if ((stat = GET_ERR()) == 1) {
printk("success\n"); printk("success\n");
drive->failures = 0; drive->failures = 0;
} else { } else {
drive->failures++; char *msg;
char *msg = "";
#if FANCY_STATUS_DUMPS #if FANCY_STATUS_DUMPS
u8 val;
static const char *messages[5] = {
" passed",
" formatter device",
" sector buffer",
" ECC circuitry",
" controlling MPU error"
};
printk("master:"); printk("master:");
switch (tmp & 0x7f) { val = stat & 0x7f;
case 1: msg = " passed"; if (val >= 1 && val <= 5)
break; msg = messages[val -1];
case 2: msg = " formatter device"; else
break; msg = "";
case 3: msg = " sector buffer"; if (stat & 0x80)
break;
case 4: msg = " ECC circuitry";
break;
case 5: msg = " controlling MPU error";
break;
}
if (tmp & 0x80)
printk("; slave:"); printk("; slave:");
#endif #endif
printk("%s error [%02x]\n", msg, tmp); printk("%s error [%02x]\n", msg, stat);
drive->failures++;
} }
} }
hwgroup->poll_timeout = 0; /* done polling */ hwgroup->poll_timeout = 0; /* done polling */
...@@ -765,30 +768,33 @@ byte ide_dump_status (ide_drive_t *drive, const char *msg, byte stat) ...@@ -765,30 +768,33 @@ byte ide_dump_status (ide_drive_t *drive, const char *msg, byte stat)
__save_flags (flags); /* local CPU only */ __save_flags (flags); /* local CPU only */
ide__sti(); /* local CPU only */ ide__sti(); /* local CPU only */
printk("%s: %s: status=0x%02x", drive->name, msg, stat); #if !(FANCY_STATUS_DUMPS)
#if FANCY_STATUS_DUMPS printk("%s: %s: status=0x%02x\n", drive->name, msg, stat);
#else
printk(" { "); printk(" { ");
{
char *msg = "";
if (stat & BUSY_STAT) if (stat & BUSY_STAT)
printk("Busy "); msg = "Busy";
else { else {
if (stat & READY_STAT) if (stat & READY_STAT)
printk("DriveReady "); msg = "DriveReady";
if (stat & WRERR_STAT) if (stat & WRERR_STAT)
printk("DeviceFault "); msg = "DeviceFault";
if (stat & SEEK_STAT) if (stat & SEEK_STAT)
printk("SeekComplete "); msg = "SeekComplete";
if (stat & DRQ_STAT) if (stat & DRQ_STAT)
printk("DataRequest "); msg = "DataRequest";
if (stat & ECC_STAT) if (stat & ECC_STAT)
printk("CorrectedError "); msg = "CorrectedError";
if (stat & INDEX_STAT) if (stat & INDEX_STAT)
printk("Index "); msg = "Index";
if (stat & ERR_STAT) if (stat & ERR_STAT)
printk("Error "); msg = "Error";
} }
printk("}"); }
printk("%s }\n", msg);
#endif #endif
printk("\n");
if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) { if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) {
err = GET_ERR(); err = GET_ERR();
printk("%s: %s: error=0x%02x", drive->name, msg, err); printk("%s: %s: error=0x%02x", drive->name, msg, err);
...@@ -1240,14 +1246,14 @@ static inline ide_drive_t *choose_drive(ide_hwgroup_t *hwgroup) ...@@ -1240,14 +1246,14 @@ static inline ide_drive_t *choose_drive(ide_hwgroup_t *hwgroup)
* will start the next request from the queue. If no more work remains, * will start the next request from the queue. If no more work remains,
* the driver will clear the hwgroup->flags IDE_BUSY flag and exit. * the driver will clear the hwgroup->flags IDE_BUSY flag and exit.
*/ */
static void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq) static void ide_do_request(struct ata_channel *ch, int masked_irq)
{ {
ide_drive_t *drive; ide_hwgroup_t *hwgroup = ch->hwgroup;
struct ata_channel *hwif; struct ata_device *drive;
ide_startstop_t startstop; ide_startstop_t startstop;
struct request *rq; struct request *rq;
ide_get_lock(&ide_intr_lock, ide_intr, hwgroup);/* for atari only: POSSIBLY BROKEN HERE(?) */ ide_get_lock(&irq_lock, ata_irq_request, hwgroup);/* for atari only: POSSIBLY BROKEN HERE(?) */
__cli(); /* necessary paranoia: ensure IRQs are masked on local CPU */ __cli(); /* necessary paranoia: ensure IRQs are masked on local CPU */
...@@ -1255,6 +1261,7 @@ static void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq) ...@@ -1255,6 +1261,7 @@ static void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq)
drive = choose_drive(hwgroup); drive = choose_drive(hwgroup);
if (drive == NULL) { if (drive == NULL) {
unsigned long sleep = 0; unsigned long sleep = 0;
hwgroup->rq = NULL; hwgroup->rq = NULL;
drive = hwgroup->drive; drive = hwgroup->drive;
do { do {
...@@ -1263,10 +1270,12 @@ static void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq) ...@@ -1263,10 +1270,12 @@ static void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq)
} while ((drive = drive->next) != hwgroup->drive); } while ((drive = drive->next) != hwgroup->drive);
if (sleep) { if (sleep) {
/* /*
* Take a short snooze, and then wake up this hwgroup again. * Take a short snooze, and then wake up this
* This gives other hwgroups on the same a chance to * hwgroup again. This gives other hwgroups on
* play fairly with us, just in case there are big differences * the same a chance to play fairly with us,
* in relative throughputs.. don't want to hog the cpu too much. * just in case there are big differences in
* relative throughputs.. don't want to hog the
* cpu too much.
*/ */
if (0 < (signed long)(jiffies + WAIT_MIN_SLEEP - sleep)) if (0 < (signed long)(jiffies + WAIT_MIN_SLEEP - sleep))
sleep = jiffies + WAIT_MIN_SLEEP; sleep = jiffies + WAIT_MIN_SLEEP;
...@@ -1278,22 +1287,23 @@ static void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq) ...@@ -1278,22 +1287,23 @@ static void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq)
mod_timer(&hwgroup->timer, sleep); mod_timer(&hwgroup->timer, sleep);
/* we purposely leave hwgroup busy while sleeping */ /* we purposely leave hwgroup busy while sleeping */
} else { } else {
/* Ugly, but how can we sleep for the lock otherwise? perhaps from tq_disk? */ /* Ugly, but how can we sleep for the lock
ide_release_lock(&ide_intr_lock);/* for atari only */ * otherwise? perhaps from tq_disk? */
ide_release_lock(&irq_lock);/* for atari only */
clear_bit(IDE_BUSY, &hwgroup->flags); clear_bit(IDE_BUSY, &hwgroup->flags);
} }
return; /* no more work for this hwgroup (for now) */ return; /* no more work for this hwgroup (for now) */
} }
hwif = drive->channel; ch = drive->channel;
if (hwgroup->hwif->sharing_irq && hwif != hwgroup->hwif && hwif->io_ports[IDE_CONTROL_OFFSET]) { if (hwgroup->hwif->sharing_irq && ch != hwgroup->hwif && ch->io_ports[IDE_CONTROL_OFFSET]) {
/* set nIEN for previous hwif */ /* set nIEN for previous channel */
if (hwif->intrproc) if (ch->intrproc)
hwif->intrproc(drive); ch->intrproc(drive);
else else
OUT_BYTE((drive)->ctl|2, hwif->io_ports[IDE_CONTROL_OFFSET]); OUT_BYTE((drive)->ctl|2, ch->io_ports[IDE_CONTROL_OFFSET]);
} }
hwgroup->hwif = hwif; hwgroup->hwif = ch;
hwgroup->drive = drive; hwgroup->drive = drive;
drive->PADAM_sleep = 0; drive->PADAM_sleep = 0;
drive->PADAM_service_start = jiffies; drive->PADAM_service_start = jiffies;
...@@ -1307,21 +1317,23 @@ static void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq) ...@@ -1307,21 +1317,23 @@ static void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq)
rq = hwgroup->rq = elv_next_request(&drive->queue); rq = hwgroup->rq = elv_next_request(&drive->queue);
/* /*
* Some systems have trouble with IDE IRQs arriving while * Some systems have trouble with IDE IRQs arriving while the
* the driver is still setting things up. So, here we disable * driver is still setting things up. So, here we disable the
* the IRQ used by this interface while the request is being started. * IRQ used by this interface while the request is being
* This may look bad at first, but pretty much the same thing * started. This may look bad at first, but pretty much the
* happens anyway when any interrupt comes in, IDE or otherwise * same thing happens anyway when any interrupt comes in, IDE
* -- the kernel masks the IRQ while it is being handled. * or otherwise -- the kernel masks the IRQ while it is being
*/ * handled.
if (masked_irq && hwif->irq != masked_irq) */
disable_irq_nosync(hwif->irq);
if (masked_irq && ch->irq != masked_irq)
disable_irq_nosync(ch->irq);
spin_unlock(&ide_lock); spin_unlock(&ide_lock);
ide__sti(); /* allow other IRQs while we start this request */ ide__sti(); /* allow other IRQs while we start this request */
startstop = start_request(drive, rq); startstop = start_request(drive, rq);
spin_lock_irq(&ide_lock); spin_lock_irq(&ide_lock);
if (masked_irq && hwif->irq != masked_irq) if (masked_irq && ch->irq != masked_irq)
enable_irq(hwif->irq); enable_irq(ch->irq);
if (startstop == ide_stopped) if (startstop == ide_stopped)
clear_bit(IDE_BUSY, &hwgroup->flags); clear_bit(IDE_BUSY, &hwgroup->flags);
} }
...@@ -1332,22 +1344,19 @@ static void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq) ...@@ -1332,22 +1344,19 @@ static void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq)
*/ */
request_queue_t *ide_get_queue(kdev_t dev) request_queue_t *ide_get_queue(kdev_t dev)
{ {
struct ata_channel *channel = (struct ata_channel *)blk_dev[major(dev)].data; struct ata_channel *ch = (struct ata_channel *)blk_dev[major(dev)].data;
/* FIXME: ALLERT: This discriminates between master and slave! */ /* FIXME: ALLERT: This discriminates between master and slave! */
return &channel->drives[DEVICE_NR(dev) & 1].queue; return &ch->drives[DEVICE_NR(dev) & 1].queue;
} }
/*
* Passes the stuff to ide_do_request
*/
void do_ide_request(request_queue_t *q) void do_ide_request(request_queue_t *q)
{ {
ide_do_request(q->queuedata, 0); ide_do_request(q->queuedata, 0);
} }
/* /*
* un-busy the hwgroup etc, and clear any pending DMA status. we want to * Un-busy the hwgroup etc, and clear any pending DMA status. we want to
* retry the current request in PIO mode instead of risking tossing it * retry the current request in PIO mode instead of risking tossing it
* all away * all away
*/ */
...@@ -1459,8 +1468,8 @@ void ide_timer_expiry(unsigned long data) ...@@ -1459,8 +1468,8 @@ void ide_timer_expiry(unsigned long data)
startstop = handler(drive); startstop = handler(drive);
} else if (drive_is_ready(drive)) { } else if (drive_is_ready(drive)) {
if (drive->waiting_for_dma) if (drive->waiting_for_dma)
(void) hwgroup->hwif->dmaproc(ide_dma_lostirq, drive); hwgroup->hwif->dmaproc(ide_dma_lostirq, drive);
(void)ide_ack_intr(hwif); (void) ide_ack_intr(hwif);
printk("%s: lost interrupt\n", drive->name); printk("%s: lost interrupt\n", drive->name);
startstop = handler(drive); startstop = handler(drive);
} else { } else {
...@@ -1478,7 +1487,9 @@ void ide_timer_expiry(unsigned long data) ...@@ -1478,7 +1487,9 @@ void ide_timer_expiry(unsigned long data)
clear_bit(IDE_BUSY, &hwgroup->flags); clear_bit(IDE_BUSY, &hwgroup->flags);
} }
} }
ide_do_request(hwgroup, 0);
ide_do_request(hwgroup->hwif, 0);
spin_unlock_irqrestore(&ide_lock, flags); spin_unlock_irqrestore(&ide_lock, flags);
} }
...@@ -1536,24 +1547,26 @@ static void unexpected_intr(int irq, ide_hwgroup_t *hwgroup) ...@@ -1536,24 +1547,26 @@ static void unexpected_intr(int irq, ide_hwgroup_t *hwgroup)
/* /*
* entry point for all interrupts, caller does __cli() for us * entry point for all interrupts, caller does __cli() for us
*/ */
void ide_intr(int irq, void *dev_id, struct pt_regs *regs) void ata_irq_request(int irq, void *data, struct pt_regs *regs)
{ {
struct ata_channel *ch = data;
ide_hwgroup_t *hwgroup = ch->hwgroup;
unsigned long flags; unsigned long flags;
ide_hwgroup_t *hwgroup = (ide_hwgroup_t *)dev_id; struct ata_device *drive;
struct ata_channel *hwif;
ide_drive_t *drive;
ide_handler_t *handler; ide_handler_t *handler;
ide_startstop_t startstop; ide_startstop_t startstop;
spin_lock_irqsave(&ide_lock, flags); spin_lock_irqsave(&ide_lock, flags);
hwif = hwgroup->hwif; ch = hwgroup->hwif;
if (!ide_ack_intr(hwif)) if (!ide_ack_intr(ch))
goto out_lock; goto out_lock;
if ((handler = hwgroup->handler) == NULL || hwgroup->poll_timeout != 0) { if ((handler = hwgroup->handler) == NULL || hwgroup->poll_timeout != 0) {
printk(KERN_INFO "ide: unexpected interrupt %d %d\n", hwif->unit, irq); #if 0
printk(KERN_INFO "ide: unexpected interrupt %d %d\n", ch->unit, irq);
#endif
/* /*
* Not expecting an interrupt from this drive. * Not expecting an interrupt from this drive.
* That means this could be: * That means this could be:
...@@ -1567,7 +1580,7 @@ void ide_intr(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1567,7 +1580,7 @@ void ide_intr(int irq, void *dev_id, struct pt_regs *regs)
* so in that case we just ignore it and hope it goes away. * so in that case we just ignore it and hope it goes away.
*/ */
#ifdef CONFIG_BLK_DEV_IDEPCI #ifdef CONFIG_BLK_DEV_IDEPCI
if (hwif->pci_dev && !hwif->pci_dev->vendor) if (ch->pci_dev && !ch->pci_dev->vendor)
#endif #endif
{ {
/* /*
...@@ -1580,7 +1593,7 @@ void ide_intr(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1580,7 +1593,7 @@ void ide_intr(int irq, void *dev_id, struct pt_regs *regs)
/* /*
* Whack the status register, just in case we have a leftover pending IRQ. * Whack the status register, just in case we have a leftover pending IRQ.
*/ */
IN_BYTE(hwif->io_ports[IDE_STATUS_OFFSET]); IN_BYTE(ch->io_ports[IDE_STATUS_OFFSET]);
#endif #endif
} }
goto out_lock; goto out_lock;
...@@ -1604,12 +1617,12 @@ void ide_intr(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1604,12 +1617,12 @@ void ide_intr(int irq, void *dev_id, struct pt_regs *regs)
} }
/* paranoia */ /* paranoia */
if (!test_and_set_bit(IDE_BUSY, &hwgroup->flags)) if (!test_and_set_bit(IDE_BUSY, &hwgroup->flags))
printk("%s: ide_intr: hwgroup was not busy??\n", drive->name); printk(KERN_ERR "%s: %s: hwgroup was not busy!?\n", drive->name, __FUNCTION__);
hwgroup->handler = NULL; hwgroup->handler = NULL;
del_timer(&hwgroup->timer); del_timer(&hwgroup->timer);
spin_unlock(&ide_lock); spin_unlock(&ide_lock);
if (hwif->unmask) if (ch->unmask)
ide__sti(); /* local CPU only */ ide__sti(); /* local CPU only */
startstop = handler(drive); /* service this interrupt, may set handler for next interrupt */ startstop = handler(drive); /* service this interrupt, may set handler for next interrupt */
spin_lock_irq(&ide_lock); spin_lock_irq(&ide_lock);
...@@ -1626,9 +1639,9 @@ void ide_intr(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1626,9 +1639,9 @@ void ide_intr(int irq, void *dev_id, struct pt_regs *regs)
if (startstop == ide_stopped) { if (startstop == ide_stopped) {
if (hwgroup->handler == NULL) { /* paranoia */ if (hwgroup->handler == NULL) { /* paranoia */
clear_bit(IDE_BUSY, &hwgroup->flags); clear_bit(IDE_BUSY, &hwgroup->flags);
ide_do_request(hwgroup, hwif->irq); ide_do_request(ch, ch->irq);
} else { } else {
printk("%s: ide_intr: huh? expected NULL handler on exit\n", drive->name); printk("%s: %s: huh? expected NULL handler on exit\n", drive->name, __FUNCTION__);
} }
} }
...@@ -1721,7 +1734,7 @@ int ide_do_drive_cmd(ide_drive_t *drive, struct request *rq, ide_action_t action ...@@ -1721,7 +1734,7 @@ int ide_do_drive_cmd(ide_drive_t *drive, struct request *rq, ide_action_t action
queue_head = queue_head->next; queue_head = queue_head->next;
} }
q->elevator.elevator_add_req_fn(q, rq, queue_head); q->elevator.elevator_add_req_fn(q, rq, queue_head);
ide_do_request(hwgroup, 0); ide_do_request(drive->channel, 0);
spin_unlock_irqrestore(&ide_lock, flags); spin_unlock_irqrestore(&ide_lock, flags);
if (action == ide_wait) { if (action == ide_wait) {
wait_for_completion(&wait); /* wait for it to be serviced */ wait_for_completion(&wait); /* wait for it to be serviced */
...@@ -1908,30 +1921,30 @@ ide_proc_entry_t generic_subdriver_entries[] = { ...@@ -1908,30 +1921,30 @@ ide_proc_entry_t generic_subdriver_entries[] = {
static void hwif_unregister(struct ata_channel *hwif) static void hwif_unregister(struct ata_channel *hwif)
{ {
if (hwif->straight8) { if (hwif->straight8) {
ide_release_region(hwif->io_ports[IDE_DATA_OFFSET], 8); release_region(hwif->io_ports[IDE_DATA_OFFSET], 8);
} else { } else {
if (hwif->io_ports[IDE_DATA_OFFSET]) if (hwif->io_ports[IDE_DATA_OFFSET])
ide_release_region(hwif->io_ports[IDE_DATA_OFFSET], 1); release_region(hwif->io_ports[IDE_DATA_OFFSET], 1);
if (hwif->io_ports[IDE_ERROR_OFFSET]) if (hwif->io_ports[IDE_ERROR_OFFSET])
ide_release_region(hwif->io_ports[IDE_ERROR_OFFSET], 1); release_region(hwif->io_ports[IDE_ERROR_OFFSET], 1);
if (hwif->io_ports[IDE_NSECTOR_OFFSET]) if (hwif->io_ports[IDE_NSECTOR_OFFSET])
ide_release_region(hwif->io_ports[IDE_NSECTOR_OFFSET], 1); release_region(hwif->io_ports[IDE_NSECTOR_OFFSET], 1);
if (hwif->io_ports[IDE_SECTOR_OFFSET]) if (hwif->io_ports[IDE_SECTOR_OFFSET])
ide_release_region(hwif->io_ports[IDE_SECTOR_OFFSET], 1); release_region(hwif->io_ports[IDE_SECTOR_OFFSET], 1);
if (hwif->io_ports[IDE_LCYL_OFFSET]) if (hwif->io_ports[IDE_LCYL_OFFSET])
ide_release_region(hwif->io_ports[IDE_LCYL_OFFSET], 1); release_region(hwif->io_ports[IDE_LCYL_OFFSET], 1);
if (hwif->io_ports[IDE_HCYL_OFFSET]) if (hwif->io_ports[IDE_HCYL_OFFSET])
ide_release_region(hwif->io_ports[IDE_HCYL_OFFSET], 1); release_region(hwif->io_ports[IDE_HCYL_OFFSET], 1);
if (hwif->io_ports[IDE_SELECT_OFFSET]) if (hwif->io_ports[IDE_SELECT_OFFSET])
ide_release_region(hwif->io_ports[IDE_SELECT_OFFSET], 1); release_region(hwif->io_ports[IDE_SELECT_OFFSET], 1);
if (hwif->io_ports[IDE_STATUS_OFFSET]) if (hwif->io_ports[IDE_STATUS_OFFSET])
ide_release_region(hwif->io_ports[IDE_STATUS_OFFSET], 1); release_region(hwif->io_ports[IDE_STATUS_OFFSET], 1);
} }
if (hwif->io_ports[IDE_CONTROL_OFFSET]) if (hwif->io_ports[IDE_CONTROL_OFFSET])
ide_release_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1); release_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1);
#if defined(CONFIG_AMIGA) || defined(CONFIG_MAC) #if defined(CONFIG_AMIGA) || defined(CONFIG_MAC)
if (hwif->io_ports[IDE_IRQ_OFFSET]) if (hwif->io_ports[IDE_IRQ_OFFSET])
ide_release_region(hwif->io_ports[IDE_IRQ_OFFSET], 1); release_region(hwif->io_ports[IDE_IRQ_OFFSET], 1);
#endif #endif
} }
...@@ -3249,7 +3262,6 @@ devfs_handle_t ide_devfs_handle; ...@@ -3249,7 +3262,6 @@ devfs_handle_t ide_devfs_handle;
EXPORT_SYMBOL(ide_lock); EXPORT_SYMBOL(ide_lock);
EXPORT_SYMBOL(drive_is_flashcard); EXPORT_SYMBOL(drive_is_flashcard);
EXPORT_SYMBOL(ide_timer_expiry); EXPORT_SYMBOL(ide_timer_expiry);
EXPORT_SYMBOL(ide_intr);
EXPORT_SYMBOL(ide_get_queue); EXPORT_SYMBOL(ide_get_queue);
EXPORT_SYMBOL(ide_add_generic_settings); EXPORT_SYMBOL(ide_add_generic_settings);
EXPORT_SYMBOL(do_ide_request); EXPORT_SYMBOL(do_ide_request);
...@@ -3427,7 +3439,7 @@ static int __init ata_module_init(void) ...@@ -3427,7 +3439,7 @@ static int __init ata_module_init(void)
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
# if defined(__mc68000__) || defined(CONFIG_APUS) # if defined(__mc68000__) || defined(CONFIG_APUS)
if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET]) { if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET]) {
ide_get_lock(&ide_intr_lock, NULL, NULL);/* for atari only */ ide_get_lock(&irq_lock, NULL, NULL);/* for atari only */
disable_irq(ide_hwifs[0].irq); /* disable_irq_nosync ?? */ disable_irq(ide_hwifs[0].irq); /* disable_irq_nosync ?? */
// disable_irq_nosync(ide_hwifs[0].irq); // disable_irq_nosync(ide_hwifs[0].irq);
} }
...@@ -3438,7 +3450,7 @@ static int __init ata_module_init(void) ...@@ -3438,7 +3450,7 @@ static int __init ata_module_init(void)
# if defined(__mc68000__) || defined(CONFIG_APUS) # if defined(__mc68000__) || defined(CONFIG_APUS)
if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET]) { if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET]) {
enable_irq(ide_hwifs[0].irq); enable_irq(ide_hwifs[0].irq);
ide_release_lock(&ide_intr_lock);/* for atari only */ ide_release_lock(&irq_lock);/* for atari only */
} }
# endif # endif
#endif #endif
......
...@@ -283,15 +283,6 @@ void __init ide_init_trm290(struct ata_channel *hwif) ...@@ -283,15 +283,6 @@ void __init ide_init_trm290(struct ata_channel *hwif)
old = inw(hwif->config_data) & ~1; old = inw(hwif->config_data) & ~1;
if (old != compat && inb(old+2) == 0xff) { if (old != compat && inb(old+2) == 0xff) {
compat += (next_offset += 0x400); /* leave lower 10 bits untouched */ compat += (next_offset += 0x400); /* leave lower 10 bits untouched */
#if 1
if (ide_check_region(compat + 2, 1))
printk("Aieee %s: ide_check_region failure at 0x%04x\n", hwif->name, (compat + 2));
/*
* The region check is not needed; however.........
* Since this is the checked in ide-probe.c,
* this is only an assignment.
*/
#endif
hwif->io_ports[IDE_CONTROL_OFFSET] = compat + 2; hwif->io_ports[IDE_CONTROL_OFFSET] = compat + 2;
outw(compat|1, hwif->config_data); outw(compat|1, hwif->config_data);
printk("%s: control basereg workaround: old=0x%04x, new=0x%04x\n", hwif->name, old, inw(hwif->config_data) & ~1); printk("%s: control basereg workaround: old=0x%04x, new=0x%04x\n", hwif->name, old, inw(hwif->config_data) & ~1);
......
...@@ -105,12 +105,6 @@ typedef union { ...@@ -105,12 +105,6 @@ typedef union {
} b; } b;
} control_t; } control_t;
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
#define ide_check_region(from,extent) check_region((from), (extent))
#define ide_request_region(from,extent,name) request_region((from), (extent), (name))
#define ide_release_region(from,extent) release_region((from), (extent))
/* /*
* The following are not needed for the non-m68k ports * The following are not needed for the non-m68k ports
*/ */
......
...@@ -44,12 +44,6 @@ typedef union { ...@@ -44,12 +44,6 @@ typedef union {
} b; } b;
} control_t; } control_t;
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
#define ide_check_region(from,extent) check_region((from), (extent))
#define ide_request_region(from,extent,name) request_region((from), (extent), (name))
#define ide_release_region(from,extent) release_region((from), (extent))
/* /*
* The following are not needed for the non-m68k ports * The following are not needed for the non-m68k ports
*/ */
......
...@@ -119,20 +119,6 @@ typedef union { ...@@ -119,20 +119,6 @@ typedef union {
#undef SUPPORT_SLOW_DATA_PORTS #undef SUPPORT_SLOW_DATA_PORTS
#define SUPPORT_SLOW_DATA_PORTS 0 #define SUPPORT_SLOW_DATA_PORTS 0
/* request and free a normal interrupt */
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
/* ide-probe.c calls ide_request_region and stuff on the io_ports defined,
* but since they are not actually memory-mapped in the ETRAX driver, we don't
* do anything.
*/
#define ide_check_region(from,extent) (0)
#define ide_request_region(from,extent,name) do {} while(0)
#define ide_release_region(from,extent) do {} while(0)
/* /*
* The following are not needed for the non-m68k ports * The following are not needed for the non-m68k ports
*/ */
......
...@@ -109,12 +109,6 @@ typedef union { ...@@ -109,12 +109,6 @@ typedef union {
} b; } b;
} control_t; } control_t;
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
#define ide_check_region(from,extent) check_region((from), (extent))
#define ide_request_region(from,extent,name) request_region((from), (extent), (name))
#define ide_release_region(from,extent) release_region((from), (extent))
/* /*
* The following are not needed for the non-m68k ports * The following are not needed for the non-m68k ports
*/ */
......
...@@ -115,12 +115,6 @@ typedef union { ...@@ -115,12 +115,6 @@ typedef union {
} b; } b;
} control_t; } control_t;
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
#define ide_check_region(from,extent) check_region((from), (extent))
#define ide_request_region(from,extent,name) request_region((from), (extent), (name))
#define ide_release_region(from,extent) release_region((from), (extent))
/* /*
* The following are not needed for the non-m68k ports * The following are not needed for the non-m68k ports
*/ */
......
...@@ -103,64 +103,6 @@ typedef union { ...@@ -103,64 +103,6 @@ typedef union {
} b; } b;
} control_t; } control_t;
static __inline__ int ide_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
unsigned long flags, const char *device, void *dev_id)
{
#ifdef CONFIG_AMIGA
if (MACH_IS_AMIGA)
return request_irq(irq, handler, 0, device, dev_id);
#endif /* CONFIG_AMIGA */
#ifdef CONFIG_Q40
if (MACH_IS_Q40)
return request_irq(irq, handler, 0, device, dev_id);
#endif /* CONFIG_Q40*/
#ifdef CONFIG_MAC
if (MACH_IS_MAC)
return request_irq(irq, handler, 0, device, dev_id);
#endif /* CONFIG_MAC */
return 0;
}
static __inline__ void ide_free_irq(unsigned int irq, void *dev_id)
{
#ifdef CONFIG_AMIGA
if (MACH_IS_AMIGA)
free_irq(irq, dev_id);
#endif /* CONFIG_AMIGA */
#ifdef CONFIG_Q40
if (MACH_IS_Q40)
free_irq(irq, dev_id);
#endif /* CONFIG_Q40*/
#ifdef CONFIG_MAC
if (MACH_IS_MAC)
free_irq(irq, dev_id);
#endif /* CONFIG_MAC */
}
/*
* We should really implement those some day.
*/
static __inline__ int ide_check_region (ide_ioreg_t from, unsigned int extent)
{
return 0;
}
static __inline__ void ide_request_region (ide_ioreg_t from, unsigned int extent, const char *name)
{
#ifdef CONFIG_Q40
if (MACH_IS_Q40)
request_region((q40ide_ioreg_t)from,extent,name);
#endif
}
static __inline__ void ide_release_region (ide_ioreg_t from, unsigned int extent)
{
#ifdef CONFIG_Q40
if (MACH_IS_Q40)
release_region((q40ide_ioreg_t)from,extent);
#endif
}
#undef SUPPORT_SLOW_DATA_PORTS #undef SUPPORT_SLOW_DATA_PORTS
#define SUPPORT_SLOW_DATA_PORTS 0 #define SUPPORT_SLOW_DATA_PORTS 0
......
...@@ -31,14 +31,6 @@ struct ide_ops { ...@@ -31,14 +31,6 @@ struct ide_ops {
ide_ioreg_t (*ide_default_io_base)(int index); ide_ioreg_t (*ide_default_io_base)(int index);
void (*ide_init_hwif_ports)(hw_regs_t *hw, ide_ioreg_t data_port, void (*ide_init_hwif_ports)(hw_regs_t *hw, ide_ioreg_t data_port,
ide_ioreg_t ctrl_port, int *irq); ide_ioreg_t ctrl_port, int *irq);
int (*ide_request_irq)(unsigned int irq, void (*handler)(int, void *,
struct pt_regs *), unsigned long flags,
const char *device, void *dev_id);
void (*ide_free_irq)(unsigned int irq, void *dev_id);
int (*ide_check_region) (ide_ioreg_t from, unsigned int extent);
void (*ide_request_region)(ide_ioreg_t from, unsigned int extent,
const char *name);
void (*ide_release_region)(ide_ioreg_t from, unsigned int extent);
}; };
extern struct ide_ops *ide_ops; extern struct ide_ops *ide_ops;
...@@ -112,34 +104,6 @@ typedef union { ...@@ -112,34 +104,6 @@ typedef union {
} b; } b;
} control_t; } control_t;
static __inline__ int ide_request_irq(unsigned int irq, void (*handler)(int,void *, struct pt_regs *),
unsigned long flags, const char *device, void *dev_id)
{
return ide_ops->ide_request_irq(irq, handler, flags, device, dev_id);
}
static __inline__ void ide_free_irq(unsigned int irq, void *dev_id)
{
ide_ops->ide_free_irq(irq, dev_id);
}
static __inline__ int ide_check_region (ide_ioreg_t from, unsigned int extent)
{
return ide_ops->ide_check_region(from, extent);
}
static __inline__ void ide_request_region(ide_ioreg_t from,
unsigned int extent, const char *name)
{
ide_ops->ide_request_region(from, extent, name);
}
static __inline__ void ide_release_region(ide_ioreg_t from,
unsigned int extent)
{
ide_ops->ide_release_region(from, extent);
}
#undef SUPPORT_VLB_SYNC #undef SUPPORT_VLB_SYNC
#define SUPPORT_VLB_SYNC 0 #define SUPPORT_VLB_SYNC 0
......
...@@ -34,14 +34,6 @@ struct ide_ops { ...@@ -34,14 +34,6 @@ struct ide_ops {
ide_ioreg_t (*ide_default_io_base)(int index); ide_ioreg_t (*ide_default_io_base)(int index);
void (*ide_init_hwif_ports)(hw_regs_t *hw, ide_ioreg_t data_port, void (*ide_init_hwif_ports)(hw_regs_t *hw, ide_ioreg_t data_port,
ide_ioreg_t ctrl_port, int *irq); ide_ioreg_t ctrl_port, int *irq);
int (*ide_request_irq)(unsigned int irq, void (*handler)(int, void *,
struct pt_regs *), unsigned long flags,
const char *device, void *dev_id);
void (*ide_free_irq)(unsigned int irq, void *dev_id);
int (*ide_check_region) (ide_ioreg_t from, unsigned int extent);
void (*ide_request_region)(ide_ioreg_t from, unsigned int extent,
const char *name);
void (*ide_release_region)(ide_ioreg_t from, unsigned int extent);
}; };
extern struct ide_ops *ide_ops; extern struct ide_ops *ide_ops;
...@@ -99,35 +91,6 @@ typedef union { ...@@ -99,35 +91,6 @@ typedef union {
} b; } b;
} control_t; } control_t;
static __inline__ int ide_request_irq(unsigned int irq, void (*handler)(int,void *, struct pt_regs *),
unsigned long flags, const char *device, void *dev_id)
{
return ide_ops->ide_request_irq(irq, handler, flags, device, dev_id);
}
static __inline__ void ide_free_irq(unsigned int irq, void *dev_id)
{
ide_ops->ide_free_irq(irq, dev_id);
}
static __inline__ int ide_check_region (ide_ioreg_t from, unsigned int extent)
{
return ide_ops->ide_check_region(from, extent);
}
static __inline__ void ide_request_region(ide_ioreg_t from,
unsigned int extent, const char *name)
{
ide_ops->ide_request_region(from, extent, name);
}
static __inline__ void ide_release_region(ide_ioreg_t from,
unsigned int extent)
{
ide_ops->ide_release_region(from, extent);
}
#if defined(CONFIG_SWAP_IO_SPACE) && defined(__MIPSEB__) #if defined(CONFIG_SWAP_IO_SPACE) && defined(__MIPSEB__)
#ifdef insl #ifdef insl
......
...@@ -104,12 +104,6 @@ typedef union { ...@@ -104,12 +104,6 @@ typedef union {
} b; } b;
} control_t; } control_t;
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
#define ide_check_region(from,extent) check_region((from), (extent))
#define ide_request_region(from,extent,name) request_region((from), (extent), (name))
#define ide_release_region(from,extent) release_region((from), (extent))
/* /*
* The following are not needed for the non-m68k ports * The following are not needed for the non-m68k ports
*/ */
......
...@@ -35,12 +35,6 @@ extern void ppc_generic_ide_fix_driveid(struct hd_driveid *id); ...@@ -35,12 +35,6 @@ extern void ppc_generic_ide_fix_driveid(struct hd_driveid *id);
struct ide_machdep_calls { struct ide_machdep_calls {
int (*default_irq)(ide_ioreg_t base); int (*default_irq)(ide_ioreg_t base);
ide_ioreg_t (*default_io_base)(int index); ide_ioreg_t (*default_io_base)(int index);
int (*ide_check_region)(ide_ioreg_t from, unsigned int extent);
void (*ide_request_region)(ide_ioreg_t from,
unsigned int extent,
const char *name);
void (*ide_release_region)(ide_ioreg_t from,
unsigned int extent);
void (*ide_init_hwif)(hw_regs_t *hw, void (*ide_init_hwif)(hw_regs_t *hw,
ide_ioreg_t data_port, ide_ioreg_t data_port,
ide_ioreg_t ctrl_port, ide_ioreg_t ctrl_port,
...@@ -118,25 +112,6 @@ static __inline__ void ide_init_default_hwifs(void) ...@@ -118,25 +112,6 @@ static __inline__ void ide_init_default_hwifs(void)
#endif /* CONFIG_BLK_DEV_IDEPCI */ #endif /* CONFIG_BLK_DEV_IDEPCI */
} }
static __inline__ int ide_check_region (ide_ioreg_t from, unsigned int extent)
{
if (ppc_ide_md.ide_check_region)
return ppc_ide_md.ide_check_region(from, extent);
return 0;
}
static __inline__ void ide_request_region (ide_ioreg_t from, unsigned int extent, const char *name)
{
if (ppc_ide_md.ide_request_region)
ppc_ide_md.ide_request_region(from, extent, name);
}
static __inline__ void ide_release_region (ide_ioreg_t from, unsigned int extent)
{
if (ppc_ide_md.ide_release_region)
ppc_ide_md.ide_release_region(from, extent);
}
typedef union { typedef union {
unsigned all : 8; /* all of the bits together */ unsigned all : 8; /* all of the bits together */
struct { struct {
...@@ -160,14 +135,6 @@ typedef union { ...@@ -160,14 +135,6 @@ typedef union {
} b; } b;
} control_t; } control_t;
#if !defined(ide_request_irq)
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#endif
#if !defined(ide_free_irq)
#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
#endif
/* /*
* The following are not needed for the non-m68k ports * The following are not needed for the non-m68k ports
* unless direct IDE on 8xx * unless direct IDE on 8xx
......
...@@ -77,12 +77,6 @@ typedef union { ...@@ -77,12 +77,6 @@ typedef union {
} b; } b;
} control_t; } control_t;
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
#define ide_check_region(from,extent) check_region((from), (extent))
#define ide_request_region(from,extent,name) request_region((from), (extent), (name))
#define ide_release_region(from,extent) release_region((from), (extent))
/* /*
* The following are not needed for the non-m68k ports * The following are not needed for the non-m68k ports
*/ */
......
...@@ -40,12 +40,6 @@ typedef union { ...@@ -40,12 +40,6 @@ typedef union {
} b; } b;
} control_t; } control_t;
#define ide_request_irq(irq,hand,flg,dev,id) do {} while (0)
#define ide_free_irq(irq,dev_id) do {} while (0)
#define ide_check_region(from,extent) do {} while (0)
#define ide_request_region(from,extent,name) do {} while (0)
#define ide_release_region(from,extent) do {} while (0)
/* /*
* The following are not needed for the non-m68k ports * The following are not needed for the non-m68k ports
*/ */
......
...@@ -40,12 +40,6 @@ typedef union { ...@@ -40,12 +40,6 @@ typedef union {
} b; } b;
} control_t; } control_t;
#define ide_request_irq(irq,hand,flg,dev,id) do {} while (0)
#define ide_free_irq(irq,dev_id) do {} while (0)
#define ide_check_region(from,extent) do {} while (0)
#define ide_request_region(from,extent,name) do {} while (0)
#define ide_release_region(from,extent) do {} while (0)
/* /*
* The following are not needed for the non-m68k ports * The following are not needed for the non-m68k ports
*/ */
......
...@@ -130,12 +130,6 @@ typedef union { ...@@ -130,12 +130,6 @@ typedef union {
} b; } b;
} control_t; } control_t;
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
#define ide_check_region(from,extent) check_region((from), (extent))
#define ide_request_region(from,extent,name) request_region((from), (extent), (name))
#define ide_release_region(from,extent) release_region((from), (extent))
/* /*
* The following are not needed for the non-m68k ports * The following are not needed for the non-m68k ports
*/ */
......
...@@ -96,33 +96,6 @@ typedef union { ...@@ -96,33 +96,6 @@ typedef union {
} b; } b;
} control_t; } control_t;
static __inline__ int ide_request_irq(unsigned int irq,
void (*handler)(int, void *, struct pt_regs *),
unsigned long flags, const char *name, void *devid)
{
return request_irq(irq, handler, SA_SHIRQ, name, devid);
}
static __inline__ void ide_free_irq(unsigned int irq, void *dev_id)
{
free_irq(irq, dev_id);
}
static __inline__ int ide_check_region(ide_ioreg_t base, unsigned int size)
{
/* We leave these empty because pcic.c calls sparc_alloc_io() */
return 0;
}
static __inline__ void ide_request_region(ide_ioreg_t base, unsigned int size,
const char *name)
{
}
static __inline__ void ide_release_region(ide_ioreg_t base, unsigned int size)
{
}
#undef SUPPORT_SLOW_DATA_PORTS #undef SUPPORT_SLOW_DATA_PORTS
#define SUPPORT_SLOW_DATA_PORTS 0 #define SUPPORT_SLOW_DATA_PORTS 0
......
...@@ -92,34 +92,6 @@ typedef union { ...@@ -92,34 +92,6 @@ typedef union {
} b; } b;
} control_t; } control_t;
static __inline__ int ide_request_irq(unsigned int irq,
void (*handler)(int, void *, struct pt_regs *),
unsigned long flags, const char *name, void *devid)
{
return request_irq(irq, handler, SA_SHIRQ, name, devid);
}
static __inline__ void ide_free_irq(unsigned int irq, void *dev_id)
{
free_irq(irq, dev_id);
}
static __inline__ int ide_check_region(ide_ioreg_t base, unsigned int size)
{
return check_region(base, size);
}
static __inline__ void ide_request_region(ide_ioreg_t base, unsigned int size,
const char *name)
{
request_region(base, size, name);
}
static __inline__ void ide_release_region(ide_ioreg_t base, unsigned int size)
{
release_region(base, size);
}
#undef SUPPORT_SLOW_DATA_PORTS #undef SUPPORT_SLOW_DATA_PORTS
#define SUPPORT_SLOW_DATA_PORTS 0 #define SUPPORT_SLOW_DATA_PORTS 0
......
...@@ -109,12 +109,6 @@ typedef union { ...@@ -109,12 +109,6 @@ typedef union {
} b; } b;
} control_t; } control_t;
#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id))
#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id))
#define ide_check_region(from,extent) check_region((from), (extent))
#define ide_request_region(from,extent,name) request_region((from), (extent), (name))
#define ide_release_region(from,extent) release_region((from), (extent))
/* /*
* The following are not needed for the non-m68k ports * The following are not needed for the non-m68k ports
*/ */
......
...@@ -827,7 +827,7 @@ extern int drive_is_flashcard(ide_drive_t *drive); ...@@ -827,7 +827,7 @@ extern int drive_is_flashcard(ide_drive_t *drive);
int ide_spin_wait_hwgroup (ide_drive_t *drive); int ide_spin_wait_hwgroup (ide_drive_t *drive);
void ide_timer_expiry (unsigned long data); void ide_timer_expiry (unsigned long data);
void ide_intr (int irq, void *dev_id, struct pt_regs *regs); extern void ata_irq_request(int irq, void *data, struct pt_regs *regs);
void do_ide_request (request_queue_t * q); void do_ide_request (request_queue_t * q);
void ide_init_subdrivers (void); void ide_init_subdrivers (void);
......
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