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,
{
}
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 = {
&no_ide_default_irq,
&no_ide_default_io_base,
&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
&no_ide_init_hwif_ports
};
......@@ -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;
}
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 = {
&std_ide_default_irq,
&std_ide_default_io_base,
&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
&std_ide_init_hwif_ports
};
......@@ -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 = {
&no_ide_default_irq,
&no_ide_default_io_base,
&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
&no_ide_init_hwif_ports
};
......@@ -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;
}
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 = {
&std_ide_default_irq,
&std_ide_default_io_base,
&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
&std_ide_init_hwif_ports
};
......@@ -256,29 +256,6 @@ ppc4xx_progress(char *s, unsigned short hex)
* IDE stuff.
* 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)
static void
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,
** m8xx_setup.c, prep_setup.c use
** defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
*/
#if defined (CONFIG_IDE)
ppc_ide_md.ide_request_region = ppc4xx_ide_request_region;
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)
#ifdef CONFIG_IDE
# if defined(CONFIG_BLK_DEV_IDEPCI)
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.ide_init_hwif = nonpci_ide_init_hwif_ports;
#endif
# endif
#endif
board_init();
......
......@@ -463,33 +463,6 @@ chrp_init2(void)
#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
* 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,
ppc_md.smp_ops = &chrp_smp_ops;
#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
* can be printed. -- Cort
......
......@@ -55,24 +55,6 @@ static unsigned int cpu_6xx[16] = {
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
/* 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
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,
ppc_md.nvram_write_val = todc_direct_write_val;
#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;
#endif
}
......
......@@ -154,13 +154,6 @@ lopec_ide_default_irq(ide_ioreg_t base)
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
lopec_ide_default_io_base(int index)
{
......@@ -169,19 +162,6 @@ lopec_ide_default_io_base(int 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
lopec_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data,
ide_ioreg_t ctl, int *irq)
......@@ -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)
ppc_ide_md.default_irq = lopec_ide_default_irq;
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;
#endif
}
......@@ -322,29 +322,6 @@ mcpn765_ide_default_io_base(int 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
mcpn765_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port,
ide_ioreg_t ctrl_port, int *irq)
......@@ -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)
ppc_ide_md.default_irq = mcpn765_ide_default_irq;
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;
#endif
......
......@@ -199,27 +199,6 @@ menf1_map_io(void)
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
/* 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
menf1_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port,
ide_ioreg_t ctrl_port, int *irq)
......@@ -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)
ppc_ide_md.default_io_base = menf1_ide_default_io_base;
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;
#endif
}
......@@ -601,45 +601,6 @@ pmac_halt(void)
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.
*/
......@@ -796,12 +757,6 @@ pmac_init(unsigned long r3, unsigned long r4, unsigned long r5,
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
ppc_md.progress = pmac_progress;
#endif /* CONFIG_BOOTX_TEXT */
......
......@@ -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
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,
#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_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;
#endif
......
......@@ -733,27 +733,6 @@ prep_ide_default_io_base(int index)
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
#ifdef CONFIG_SMP
......@@ -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)
ppc_ide_md.default_irq = prep_ide_default_irq;
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
#ifdef CONFIG_VT
......
......@@ -85,8 +85,8 @@ extern bd_t m8xx_board_info;
/* for pcmcia sandisk */
#ifdef CONFIG_IDE
#define MAX_HWIFS 1
#define ide_request_irq(irq,hand,flg,dev,id) request_8xxirq((irq),(hand),(flg),(dev),(id))
# define MAX_HWIFS 1
# define request_irq(irq,hand,flg,dev,id) request_8xxirq((irq),(hand),(flg),(dev),(id))
#endif
#endif
......
......@@ -72,8 +72,8 @@ extern bd_t m8xx_board_info;
#define _IO_BASE_SIZE 0x1000
#ifdef CONFIG_IDE
#define MAX_HWIFS 1
#define ide_request_irq(irq,hand,flg,dev,id) request_8xxirq((irq),(hand),(flg),(dev),(id))
# define MAX_HWIFS 1
# define request_irq(irq,hand,flg,dev,id) request_8xxirq((irq),(hand),(flg),(dev),(id))
#endif
/* We don't use the 8259.
......
......@@ -491,29 +491,6 @@ sandpoint_ide_default_io_base(int 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
sandpoint_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port,
ide_ioreg_t ctrl_port, int *irq)
......@@ -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)
ppc_ide_md.default_irq = sandpoint_ide_default_irq;
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;
#endif
......
......@@ -434,150 +434,131 @@ static inline void probe_for_drive (ide_drive_t *drive)
}
}
/*
* Calculate the region that this interface occupies,
* handling interfaces where the registers may not be
* ordered sanely. We deal with the CONTROL register
* separately.
*/
static int hwif_check_regions(struct ata_channel *hwif)
{
int region_errors = 0;
hwif->straight8 = 0;
region_errors = ide_check_region(hwif->io_ports[IDE_DATA_OFFSET], 1);
region_errors += ide_check_region(hwif->io_ports[IDE_ERROR_OFFSET], 1);
region_errors += ide_check_region(hwif->io_ports[IDE_NSECTOR_OFFSET], 1);
region_errors += ide_check_region(hwif->io_ports[IDE_SECTOR_OFFSET], 1);
region_errors += ide_check_region(hwif->io_ports[IDE_LCYL_OFFSET], 1);
region_errors += ide_check_region(hwif->io_ports[IDE_HCYL_OFFSET], 1);
region_errors += ide_check_region(hwif->io_ports[IDE_SELECT_OFFSET], 1);
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.
*/
return(region_errors);
}
static void hwif_register(struct ata_channel *hwif)
{
/* Register this hardware interface within the global device tree.
*/
sprintf(hwif->dev.bus_id, "%04x", hwif->io_ports[IDE_DATA_OFFSET]);
sprintf(hwif->dev.name, "ide");
hwif->dev.driver_data = hwif;
#ifdef CONFIG_BLK_DEV_IDEPCI
if (hwif->pci_dev)
hwif->dev.parent = &hwif->pci_dev->dev;
else
#endif
hwif->dev.parent = NULL; /* Would like to do = &device_legacy */
device_register(&hwif->dev);
if (((unsigned long)hwif->io_ports[IDE_DATA_OFFSET] | 7) ==
((unsigned long)hwif->io_ports[IDE_STATUS_OFFSET])) {
ide_request_region(hwif->io_ports[IDE_DATA_OFFSET], 8, hwif->name);
hwif->straight8 = 1;
} else {
if (hwif->io_ports[IDE_DATA_OFFSET])
ide_request_region(hwif->io_ports[IDE_DATA_OFFSET], 1, hwif->name);
if (hwif->io_ports[IDE_ERROR_OFFSET])
ide_request_region(hwif->io_ports[IDE_ERROR_OFFSET], 1, hwif->name);
if (hwif->io_ports[IDE_NSECTOR_OFFSET])
ide_request_region(hwif->io_ports[IDE_NSECTOR_OFFSET], 1, hwif->name);
if (hwif->io_ports[IDE_SECTOR_OFFSET])
ide_request_region(hwif->io_ports[IDE_SECTOR_OFFSET], 1, hwif->name);
if (hwif->io_ports[IDE_LCYL_OFFSET])
ide_request_region(hwif->io_ports[IDE_LCYL_OFFSET], 1, hwif->name);
if (hwif->io_ports[IDE_HCYL_OFFSET])
ide_request_region(hwif->io_ports[IDE_HCYL_OFFSET], 1, hwif->name);
if (hwif->io_ports[IDE_SELECT_OFFSET])
ide_request_region(hwif->io_ports[IDE_SELECT_OFFSET], 1, hwif->name);
if (hwif->io_ports[IDE_STATUS_OFFSET])
ide_request_region(hwif->io_ports[IDE_STATUS_OFFSET], 1, hwif->name);
}
if (hwif->io_ports[IDE_CONTROL_OFFSET])
ide_request_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1, hwif->name);
#if defined(CONFIG_AMIGA) || defined(CONFIG_MAC)
if (hwif->io_ports[IDE_IRQ_OFFSET])
ide_request_region(hwif->io_ports[IDE_IRQ_OFFSET], 1, hwif->name);
#endif
}
/*
* This routine only knows how to look for drive units 0 and 1
* on an interface, so any setting of MAX_DRIVES > 2 won't work here.
*/
static void probe_hwif(struct ata_channel *hwif)
static void probe_hwif(struct ata_channel *ch)
{
unsigned int unit;
unsigned long flags;
if (hwif->noprobe)
if (ch->noprobe)
return;
if (
#if CONFIG_BLK_DEV_PDC4030
(hwif->chipset != ide_pdc4030 || hwif->unit == 0) &&
#endif
hwif_check_regions(hwif)) {
int msgout = 0;
for (unit = 0; unit < MAX_DRIVES; ++unit) {
ide_drive_t *drive = &hwif->drives[unit];
if (drive->present) {
drive->present = 0;
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;
}
ch->straight8 = 0;
__save_flags(flags); /* local CPU only */
__sti(); /* local CPU only; needed for jiffies and irq probing */
/*
* Second drive should only exist if first drive was found,
* but a lot of cdrom drives are configured as single slaves.
* Check for the presence of a channel by probing for drives on it.
*/
for (unit = 0; unit < MAX_DRIVES; ++unit) {
ide_drive_t *drive = &hwif->drives[unit];
probe_for_drive (drive);
if (drive->present && !hwif->present) {
hwif->present = 1;
hwif_register(hwif);
struct ata_device *drive = &ch->drives[unit];
probe_for_drive(drive);
if (drive->present && !ch->present) {
ch->present = 1;
}
}
if (ch->present) {
int error = 0;
if (((unsigned long)ch->io_ports[IDE_DATA_OFFSET] | 7) ==
((unsigned long)ch->io_ports[IDE_STATUS_OFFSET])) {
error += !request_region(ch->io_ports[IDE_DATA_OFFSET], 8, ch->name);
ch->straight8 = 1;
} else {
if (ch->io_ports[IDE_DATA_OFFSET])
error += !request_region(ch->io_ports[IDE_DATA_OFFSET], 1, ch->name);
if (ch->io_ports[IDE_ERROR_OFFSET])
error += !request_region(ch->io_ports[IDE_ERROR_OFFSET], 1, ch->name);
if (ch->io_ports[IDE_NSECTOR_OFFSET])
error += !request_region(ch->io_ports[IDE_NSECTOR_OFFSET], 1, ch->name);
if (ch->io_ports[IDE_SECTOR_OFFSET])
error += !request_region(ch->io_ports[IDE_SECTOR_OFFSET], 1, ch->name);
if (ch->io_ports[IDE_LCYL_OFFSET])
error += !request_region(ch->io_ports[IDE_LCYL_OFFSET], 1, ch->name);
if (ch->io_ports[IDE_HCYL_OFFSET])
error += !request_region(ch->io_ports[IDE_HCYL_OFFSET], 1, ch->name);
if (ch->io_ports[IDE_SELECT_OFFSET])
error += !request_region(ch->io_ports[IDE_SELECT_OFFSET], 1, ch->name);
if (ch->io_ports[IDE_STATUS_OFFSET])
error += !request_region(ch->io_ports[IDE_STATUS_OFFSET], 1, ch->name);
}
if (ch->io_ports[IDE_CONTROL_OFFSET])
error += !request_region(ch->io_ports[IDE_CONTROL_OFFSET], 1, ch->name);
#if defined(CONFIG_AMIGA) || defined(CONFIG_MAC)
if (ch->io_ports[IDE_IRQ_OFFSET])
error += !request_region(ch->io_ports[IDE_IRQ_OFFSET], 1, ch->name);
#endif
/* Some neccessary register area was already used. Skip this
* device.
*/
if (
#if CONFIG_BLK_DEV_PDC4030
(ch->chipset != ide_pdc4030 || ch->unit == 0) &&
#endif
error) {
/* FIXME: We should be dealing properly with partial IO
* region allocations here.
*/
ch->present = 0;
printk("%s: error: ports already in use!\n", ch->name);
}
}
if (hwif->io_ports[IDE_CONTROL_OFFSET] && hwif->reset) {
unsigned long timeout = jiffies + WAIT_WORSTCASE;
byte stat;
printk("%s: reset\n", hwif->name);
OUT_BYTE(12, hwif->io_ports[IDE_CONTROL_OFFSET]);
udelay(10);
OUT_BYTE(8, hwif->io_ports[IDE_CONTROL_OFFSET]);
do {
ide_delay_50ms();
stat = IN_BYTE(hwif->io_ports[IDE_STATUS_OFFSET]);
} while ((stat & BUSY_STAT) && 0 < (signed long)(timeout - jiffies));
if (ch->present) {
/* Register this hardware interface within the global device tree.
*/
sprintf(ch->dev.bus_id, "%04x", ch->io_ports[IDE_DATA_OFFSET]);
sprintf(ch->dev.name, "ide");
ch->dev.driver_data = ch;
#ifdef CONFIG_BLK_DEV_IDEPCI
if (ch->pci_dev)
ch->dev.parent = &ch->pci_dev->dev;
else
#endif
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;
byte stat;
printk("%s: reset\n", ch->name);
OUT_BYTE(12, ch->io_ports[IDE_CONTROL_OFFSET]);
udelay(10);
OUT_BYTE(8, ch->io_ports[IDE_CONTROL_OFFSET]);
do {
ide_delay_50ms();
stat = IN_BYTE(ch->io_ports[IDE_STATUS_OFFSET]);
} while ((stat & BUSY_STAT) && 0 < (signed long)(timeout - jiffies));
}
}
__restore_flags(flags); /* local CPU only */
for (unit = 0; unit < MAX_DRIVES; ++unit) {
ide_drive_t *drive = &hwif->drives[unit];
if (drive->present && (drive->autotune == 1)) {
if (drive->channel->tuneproc != NULL)
drive->channel->tuneproc(drive, 255); /* auto-tune PIO mode */
/*
* Now setup the PIO transfer modes of the drives on this channel.
*/
if (ch->present) {
for (unit = 0; unit < MAX_DRIVES; ++unit) {
struct ata_device *drive = &ch->drives[unit];
if (drive->present && (drive->autotune == 1)) {
if (drive->channel->tuneproc)
drive->channel->tuneproc(drive, 255); /* auto-tune PIO mode */
}
}
}
}
......@@ -585,12 +566,12 @@ static void probe_hwif(struct ata_channel *hwif)
/*
* 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;
int max_sectors = 255;
q->queuedata = HWGROUP(drive);
q->queuedata = drive->channel;
blk_init_queue(q, do_ide_request, &ide_lock);
blk_queue_segment_boundary(q, 0xffff);
......@@ -637,23 +618,24 @@ static void save_match(struct ata_channel *hwif, struct ata_channel *new,
#endif
/*
* This routine sets up the irq for an ide interface, and creates a new
* hwgroup for the irq/hwif if none was previously assigned.
* This routine sets up the irq for an ide interface, and creates a new hwgroup
* for the irq/channel if none was previously assigned.
*
* Much of the code is for correctly detecting/handling irq sharing
* and irq serialization situations. This is somewhat complex because
* it handles static as well as dynamic (PCMCIA) IDE interfaces.
* Much of the code is for correctly detecting/handling irq sharing and irq
* serialization situations. This is somewhat complex because it handles
* static as well as dynamic (PCMCIA) IDE interfaces.
*
* The SA_INTERRUPT in sa_flags means ide_intr() is always entered with
* interrupts completely disabled. This can be bad for interrupt latency,
* but anything else has led to problems on some machines. We re-enable
* interrupts as much as we can safely do in most places.
* The SA_INTERRUPT in sa_flags means ata_irq_request() is always entered with
* interrupts completely disabled. This can be bad for interrupt latency, but
* anything else has led to problems on some machines. We re-enable interrupts
* 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 int index;
ide_hwgroup_t *hwgroup, *new_hwgroup;
ide_hwgroup_t *hwgroup;
ide_hwgroup_t *new_hwgroup;
struct ata_channel *match = NULL;
......@@ -662,26 +644,26 @@ static int init_irq(struct ata_channel *hwif)
new_hwgroup = kmalloc(sizeof(ide_hwgroup_t),GFP_KERNEL);
spin_lock_irqsave(&ide_lock, flags);
hwif->hwgroup = NULL;
ch->hwgroup = NULL;
#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++) {
struct ata_channel *h = &ide_hwifs[index];
if (h->hwgroup) { /* scan only initialized hwif's */
if (hwif->irq == h->irq) {
hwif->sharing_irq = h->sharing_irq = 1;
if (hwif->chipset != ide_pci || h->chipset != ide_pci)
save_match(hwif, h, &match);
if (h->hwgroup) { /* scan only initialized channels */
if (ch->irq == h->irq) {
ch->sharing_irq = h->sharing_irq = 1;
if (ch->chipset != ide_pci || h->chipset != ide_pci)
save_match(ch, h, &match);
/* FIXME: This is still confusing. What would
* happen if we match-ed two times?
*/
if (hwif->serialized || h->serialized)
save_match(hwif, h, &match);
if (ch->serialized || h->serialized)
save_match(ch, h, &match);
}
}
}
......@@ -700,33 +682,35 @@ static int init_irq(struct ata_channel *hwif)
return 1;
}
memset(hwgroup, 0, sizeof(ide_hwgroup_t));
hwgroup->hwif = hwif->next = hwif;
hwgroup->hwif = ch->next = ch;
hwgroup->rq = NULL;
hwgroup->handler = NULL;
hwgroup->drive = NULL;
hwgroup->flags = 0;
init_timer(&hwgroup->timer);
hwgroup->timer.function = &ide_timer_expiry;
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
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
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
if (hwif->io_ports[IDE_CONTROL_OFFSET])
OUT_BYTE(0x08, hwif->io_ports[IDE_CONTROL_OFFSET]); /* clear nIEN */
if (ch->io_ports[IDE_CONTROL_OFFSET])
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)
kfree(hwgroup);
spin_unlock_irqrestore(&ide_lock, flags);
return 1;
}
}
......@@ -734,45 +718,49 @@ static int init_irq(struct ata_channel *hwif)
/*
* Everything is okay, so link us into the hwgroup.
*/
hwif->hwgroup = hwgroup;
hwif->next = hwgroup->hwif->next;
hwgroup->hwif->next = hwif;
ch->hwgroup = hwgroup;
ch->next = hwgroup->hwif->next;
hwgroup->hwif->next = ch;
for (index = 0; index < MAX_DRIVES; ++index) {
ide_drive_t *drive = &hwif->drives[index];
struct ata_device *drive = &ch->drives[index];
if (!drive->present)
continue;
if (!hwgroup->drive)
hwgroup->drive = drive;
drive->next = hwgroup->drive->next;
hwgroup->drive->next = drive;
ide_init_queue(drive);
init_device_queue(drive);
}
if (!hwgroup->hwif) {
hwgroup->hwif = hwgroup->drive->channel;
#ifdef DEBUG
printk("%s : Adding missed hwif to hwgroup!!\n", hwif->name);
printk("%s : Adding missed channel to hwgroup!!\n", ch->name);
#endif
}
spin_unlock_irqrestore(&ide_lock, flags);
#if !defined(__mc68000__) && !defined(CONFIG_APUS) && !defined(__sparc__)
printk("%s at 0x%03x-0x%03x,0x%03x on irq %d", hwif->name,
hwif->io_ports[IDE_DATA_OFFSET],
hwif->io_ports[IDE_DATA_OFFSET]+7,
hwif->io_ports[IDE_CONTROL_OFFSET], hwif->irq);
printk("%s at 0x%03x-0x%03x,0x%03x on irq %d", ch->name,
ch->io_ports[IDE_DATA_OFFSET],
ch->io_ports[IDE_DATA_OFFSET]+7,
ch->io_ports[IDE_CONTROL_OFFSET], ch->irq);
#elif defined(__sparc__)
printk("%s at 0x%03lx-0x%03lx,0x%03lx on irq %s", hwif->name,
hwif->io_ports[IDE_DATA_OFFSET],
hwif->io_ports[IDE_DATA_OFFSET]+7,
hwif->io_ports[IDE_CONTROL_OFFSET], __irq_itoa(hwif->irq));
printk("%s at 0x%03lx-0x%03lx,0x%03lx on irq %s", ch->name,
ch->io_ports[IDE_DATA_OFFSET],
ch->io_ports[IDE_DATA_OFFSET]+7,
ch->io_ports[IDE_CONTROL_OFFSET], __irq_itoa(ch->irq));
#else
printk("%s at %p on irq 0x%08x", hwif->name,
hwif->io_ports[IDE_DATA_OFFSET], hwif->irq);
printk("%s at %p on irq 0x%08x", ch->name,
ch->io_ports[IDE_DATA_OFFSET], ch->irq);
#endif /* __mc68000__ && CONFIG_APUS */
if (match)
printk(" (%sed with %s)",
hwif->sharing_irq ? "shar" : "serializ", match->name);
ch->sharing_irq ? "shar" : "serializ", match->name);
printk("\n");
return 0;
}
......@@ -868,15 +856,15 @@ static int hwif_init(struct ata_channel *hwif)
printk("%s: CANNOT SHARE IRQ WITH OLD HARDDISK DRIVER (hd.c)\n", hwif->name);
return (hwif->present = 0);
}
#endif /* CONFIG_BLK_DEV_HD */
#endif
hwif->present = 0; /* we set it back to 1 if all is ok below */
if (devfs_register_blkdev (hwif->major, hwif->name, ide_fops)) {
printk("%s: UNABLE TO GET MAJOR NUMBER %d\n", hwif->name, hwif->major);
return (hwif->present = 0);
}
if (init_irq(hwif)) {
int i = hwif->irq;
/*
......
......@@ -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,
* which is shared between several drivers.
*/
static int ide_intr_lock;
static int irq_lock;
#endif
int noautodma = 0;
......@@ -568,42 +568,45 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive)
{
ide_hwgroup_t *hwgroup = HWGROUP(drive);
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)) {
BUG_ON(HWGROUP(drive)->handler);
ide_set_handler (drive, &reset_pollfunc, HZ/20, NULL);
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++;
} else {
printk("%s: reset: ", hwif->name);
if ((tmp = GET_ERR()) == 1) {
if ((stat = GET_ERR()) == 1) {
printk("success\n");
drive->failures = 0;
} else {
drive->failures++;
char *msg = "";
char *msg;
#if FANCY_STATUS_DUMPS
u8 val;
static const char *messages[5] = {
" passed",
" formatter device",
" sector buffer",
" ECC circuitry",
" controlling MPU error"
};
printk("master:");
switch (tmp & 0x7f) {
case 1: msg = " passed";
break;
case 2: msg = " formatter device";
break;
case 3: msg = " sector buffer";
break;
case 4: msg = " ECC circuitry";
break;
case 5: msg = " controlling MPU error";
break;
}
if (tmp & 0x80)
val = stat & 0x7f;
if (val >= 1 && val <= 5)
msg = messages[val -1];
else
msg = "";
if (stat & 0x80)
printk("; slave:");
#endif
printk("%s error [%02x]\n", msg, tmp);
printk("%s error [%02x]\n", msg, stat);
drive->failures++;
}
}
hwgroup->poll_timeout = 0; /* done polling */
......@@ -765,30 +768,33 @@ byte ide_dump_status (ide_drive_t *drive, const char *msg, byte stat)
__save_flags (flags); /* 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(" { ");
if (stat & BUSY_STAT)
printk("Busy ");
else {
if (stat & READY_STAT)
printk("DriveReady ");
if (stat & WRERR_STAT)
printk("DeviceFault ");
if (stat & SEEK_STAT)
printk("SeekComplete ");
if (stat & DRQ_STAT)
printk("DataRequest ");
if (stat & ECC_STAT)
printk("CorrectedError ");
if (stat & INDEX_STAT)
printk("Index ");
if (stat & ERR_STAT)
printk("Error ");
}
printk("}");
{
char *msg = "";
if (stat & BUSY_STAT)
msg = "Busy";
else {
if (stat & READY_STAT)
msg = "DriveReady";
if (stat & WRERR_STAT)
msg = "DeviceFault";
if (stat & SEEK_STAT)
msg = "SeekComplete";
if (stat & DRQ_STAT)
msg = "DataRequest";
if (stat & ECC_STAT)
msg = "CorrectedError";
if (stat & INDEX_STAT)
msg = "Index";
if (stat & ERR_STAT)
msg = "Error";
}
}
printk("%s }\n", msg);
#endif
printk("\n");
if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) {
err = GET_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)
* 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.
*/
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;
struct ata_channel *hwif;
ide_hwgroup_t *hwgroup = ch->hwgroup;
struct ata_device *drive;
ide_startstop_t startstop;
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 */
......@@ -1255,6 +1261,7 @@ static void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq)
drive = choose_drive(hwgroup);
if (drive == NULL) {
unsigned long sleep = 0;
hwgroup->rq = NULL;
drive = hwgroup->drive;
do {
......@@ -1263,10 +1270,12 @@ static void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq)
} while ((drive = drive->next) != hwgroup->drive);
if (sleep) {
/*
* Take a short snooze, and then wake up this hwgroup again.
* This gives other hwgroups on the same a chance to
* play fairly with us, just in case there are big differences
* in relative throughputs.. don't want to hog the cpu too much.
* Take a short snooze, and then wake up this
* hwgroup again. This gives other hwgroups on
* the same a chance to play fairly with us,
* 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))
sleep = jiffies + WAIT_MIN_SLEEP;
......@@ -1278,22 +1287,23 @@ static void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq)
mod_timer(&hwgroup->timer, sleep);
/* we purposely leave hwgroup busy while sleeping */
} else {
/* Ugly, but how can we sleep for the lock otherwise? perhaps from tq_disk? */
ide_release_lock(&ide_intr_lock);/* for atari only */
/* Ugly, but how can we sleep for the lock
* otherwise? perhaps from tq_disk? */
ide_release_lock(&irq_lock);/* for atari only */
clear_bit(IDE_BUSY, &hwgroup->flags);
}
return; /* no more work for this hwgroup (for now) */
}
hwif = drive->channel;
if (hwgroup->hwif->sharing_irq && hwif != hwgroup->hwif && hwif->io_ports[IDE_CONTROL_OFFSET]) {
/* set nIEN for previous hwif */
ch = drive->channel;
if (hwgroup->hwif->sharing_irq && ch != hwgroup->hwif && ch->io_ports[IDE_CONTROL_OFFSET]) {
/* set nIEN for previous channel */
if (hwif->intrproc)
hwif->intrproc(drive);
if (ch->intrproc)
ch->intrproc(drive);
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;
drive->PADAM_sleep = 0;
drive->PADAM_service_start = jiffies;
......@@ -1307,21 +1317,23 @@ static void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq)
rq = hwgroup->rq = elv_next_request(&drive->queue);
/*
* Some systems have trouble with IDE IRQs arriving while
* the driver is still setting things up. So, here we disable
* the IRQ used by this interface while the request is being started.
* This may look bad at first, but pretty much the same thing
* happens anyway when any interrupt comes in, IDE or otherwise
* -- the kernel masks the IRQ while it is being handled.
* Some systems have trouble with IDE IRQs arriving while the
* driver is still setting things up. So, here we disable the
* IRQ used by this interface while the request is being
* started. This may look bad at first, but pretty much the
* same thing happens anyway when any interrupt comes in, IDE
* 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);
ide__sti(); /* allow other IRQs while we start this request */
startstop = start_request(drive, rq);
spin_lock_irq(&ide_lock);
if (masked_irq && hwif->irq != masked_irq)
enable_irq(hwif->irq);
if (masked_irq && ch->irq != masked_irq)
enable_irq(ch->irq);
if (startstop == ide_stopped)
clear_bit(IDE_BUSY, &hwgroup->flags);
}
......@@ -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)
{
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! */
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)
{
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
* all away
*/
......@@ -1459,8 +1468,8 @@ void ide_timer_expiry(unsigned long data)
startstop = handler(drive);
} else if (drive_is_ready(drive)) {
if (drive->waiting_for_dma)
(void) hwgroup->hwif->dmaproc(ide_dma_lostirq, drive);
(void)ide_ack_intr(hwif);
hwgroup->hwif->dmaproc(ide_dma_lostirq, drive);
(void) ide_ack_intr(hwif);
printk("%s: lost interrupt\n", drive->name);
startstop = handler(drive);
} else {
......@@ -1478,7 +1487,9 @@ void ide_timer_expiry(unsigned long data)
clear_bit(IDE_BUSY, &hwgroup->flags);
}
}
ide_do_request(hwgroup, 0);
ide_do_request(hwgroup->hwif, 0);
spin_unlock_irqrestore(&ide_lock, flags);
}
......@@ -1536,24 +1547,26 @@ static void unexpected_intr(int irq, ide_hwgroup_t *hwgroup)
/*
* 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;
ide_hwgroup_t *hwgroup = (ide_hwgroup_t *)dev_id;
struct ata_channel *hwif;
ide_drive_t *drive;
struct ata_device *drive;
ide_handler_t *handler;
ide_startstop_t startstop;
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;
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.
* That means this could be:
......@@ -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.
*/
#ifdef CONFIG_BLK_DEV_IDEPCI
if (hwif->pci_dev && !hwif->pci_dev->vendor)
if (ch->pci_dev && !ch->pci_dev->vendor)
#endif
{
/*
......@@ -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.
*/
IN_BYTE(hwif->io_ports[IDE_STATUS_OFFSET]);
IN_BYTE(ch->io_ports[IDE_STATUS_OFFSET]);
#endif
}
goto out_lock;
......@@ -1604,12 +1617,12 @@ void ide_intr(int irq, void *dev_id, struct pt_regs *regs)
}
/* paranoia */
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;
del_timer(&hwgroup->timer);
spin_unlock(&ide_lock);
if (hwif->unmask)
if (ch->unmask)
ide__sti(); /* local CPU only */
startstop = handler(drive); /* service this interrupt, may set handler for next interrupt */
spin_lock_irq(&ide_lock);
......@@ -1626,9 +1639,9 @@ void ide_intr(int irq, void *dev_id, struct pt_regs *regs)
if (startstop == ide_stopped) {
if (hwgroup->handler == NULL) { /* paranoia */
clear_bit(IDE_BUSY, &hwgroup->flags);
ide_do_request(hwgroup, hwif->irq);
ide_do_request(ch, ch->irq);
} 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
queue_head = queue_head->next;
}
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);
if (action == ide_wait) {
wait_for_completion(&wait); /* wait for it to be serviced */
......@@ -1908,30 +1921,30 @@ ide_proc_entry_t generic_subdriver_entries[] = {
static void hwif_unregister(struct ata_channel *hwif)
{
if (hwif->straight8) {
ide_release_region(hwif->io_ports[IDE_DATA_OFFSET], 8);
release_region(hwif->io_ports[IDE_DATA_OFFSET], 8);
} else {
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])
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])
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])
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])
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])
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])
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])
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])
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 (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
}
......@@ -3249,7 +3262,6 @@ devfs_handle_t ide_devfs_handle;
EXPORT_SYMBOL(ide_lock);
EXPORT_SYMBOL(drive_is_flashcard);
EXPORT_SYMBOL(ide_timer_expiry);
EXPORT_SYMBOL(ide_intr);
EXPORT_SYMBOL(ide_get_queue);
EXPORT_SYMBOL(ide_add_generic_settings);
EXPORT_SYMBOL(do_ide_request);
......@@ -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(__mc68000__) || defined(CONFIG_APUS)
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_nosync(ide_hwifs[0].irq);
}
......@@ -3438,7 +3450,7 @@ static int __init ata_module_init(void)
# if defined(__mc68000__) || defined(CONFIG_APUS)
if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET]) {
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
......
......@@ -283,15 +283,6 @@ void __init ide_init_trm290(struct ata_channel *hwif)
old = inw(hwif->config_data) & ~1;
if (old != compat && inb(old+2) == 0xff) {
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;
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);
......
......@@ -105,12 +105,6 @@ typedef union {
} b;
} 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
*/
......
......@@ -44,12 +44,6 @@ typedef union {
} b;
} 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
*/
......
......@@ -119,20 +119,6 @@ typedef union {
#undef SUPPORT_SLOW_DATA_PORTS
#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
*/
......
......@@ -109,12 +109,6 @@ typedef union {
} b;
} 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
*/
......
......@@ -115,12 +115,6 @@ typedef union {
} b;
} 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
*/
......
......@@ -103,64 +103,6 @@ typedef union {
} b;
} 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
#define SUPPORT_SLOW_DATA_PORTS 0
......
......@@ -31,14 +31,6 @@ struct ide_ops {
ide_ioreg_t (*ide_default_io_base)(int index);
void (*ide_init_hwif_ports)(hw_regs_t *hw, ide_ioreg_t data_port,
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;
......@@ -112,34 +104,6 @@ typedef union {
} b;
} 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
#define SUPPORT_VLB_SYNC 0
......
......@@ -34,14 +34,6 @@ struct ide_ops {
ide_ioreg_t (*ide_default_io_base)(int index);
void (*ide_init_hwif_ports)(hw_regs_t *hw, ide_ioreg_t data_port,
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;
......@@ -99,35 +91,6 @@ typedef union {
} b;
} 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__)
#ifdef insl
......
......@@ -104,12 +104,6 @@ typedef union {
} b;
} 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
*/
......
......@@ -35,12 +35,6 @@ extern void ppc_generic_ide_fix_driveid(struct hd_driveid *id);
struct ide_machdep_calls {
int (*default_irq)(ide_ioreg_t base);
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,
ide_ioreg_t data_port,
ide_ioreg_t ctrl_port,
......@@ -118,25 +112,6 @@ static __inline__ void ide_init_default_hwifs(void)
#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 {
unsigned all : 8; /* all of the bits together */
struct {
......@@ -160,14 +135,6 @@ typedef union {
} b;
} 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
* unless direct IDE on 8xx
......
......@@ -77,12 +77,6 @@ typedef union {
} b;
} 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
*/
......
......@@ -40,12 +40,6 @@ typedef union {
} b;
} 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
*/
......
......@@ -40,12 +40,6 @@ typedef union {
} b;
} 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
*/
......
......@@ -130,12 +130,6 @@ typedef union {
} b;
} 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
*/
......
......@@ -96,33 +96,6 @@ typedef union {
} b;
} 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
#define SUPPORT_SLOW_DATA_PORTS 0
......
......@@ -92,34 +92,6 @@ typedef union {
} b;
} 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
#define SUPPORT_SLOW_DATA_PORTS 0
......
......@@ -109,12 +109,6 @@ typedef union {
} b;
} 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
*/
......
......@@ -827,7 +827,7 @@ extern int drive_is_flashcard(ide_drive_t *drive);
int ide_spin_wait_hwgroup (ide_drive_t *drive);
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 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