#include <asm/ide.h>
+/* needed on alpha, x86/x86_64, ia64, mips, ppc32 and sh */
+#ifndef IDE_ARCH_OBSOLETE_DEFAULTS
+# define ide_default_io_base(index) (0)
+# define ide_default_irq(base) (0)
+# define ide_init_default_irq(base) (0)
+#endif
+
/*
* ide_init_hwif_ports() is OBSOLETE and will be removed in 2.7 series.
- *
- * arm26, arm, h8300, m68k, m68knommu (broken) and i386-pc9800 (broken)
- * still have their own versions.
+ * New ports shouldn't define IDE_ARCH_OBSOLETE_INIT in <asm/ide.h>.
*/
-#if !defined(CONFIG_ARM) && !defined(CONFIG_H8300) && !defined(CONFIG_M68K)
+#ifdef IDE_ARCH_OBSOLETE_INIT
static inline void ide_init_hwif_ports(hw_regs_t *hw,
unsigned long io_addr,
unsigned long ctl_addr,
int *irq)
{
if (!ctl_addr)
- ide_std_init_ports(hw, io_addr, io_addr + 0x206);
+ ide_std_init_ports(hw, io_addr, ide_default_io_ctl(io_addr));
else
ide_std_init_ports(hw, io_addr, ctl_addr);
ppc_ide_md.ide_init_hwif(hw, io_addr, ctl_addr, irq);
#endif
}
-#endif /* !ARM && !H8300 && !M68K */
+#else
+static inline void ide_init_hwif_ports(hw_regs_t *hw,
+ unsigned long io_addr,
+ unsigned long ctl_addr,
+ int *irq)
+{
+ if (io_addr || ctl_addr)
+ printk(KERN_WARNING "%s: must not be called\n", __FUNCTION__);
+}
+#endif /* IDE_ARCH_OBSOLETE_INIT */
/* Currently only m68k, apus and m8xx need it */
#ifndef IDE_ARCH_ACK_INTR
typedef enum {
ide_stopped, /* no drive operation was started */
ide_started, /* a drive operation was started, handler was set */
- ide_released, /* as ide_started, but bus also released */
} ide_startstop_t;
struct ide_driver_s;
u8 keep_settings; /* restore settings after drive reset */
u8 autodma; /* device can safely use dma on host */
u8 using_dma; /* disk is using dma for read/write */
- u8 using_tcq; /* disk is using queueing */
u8 retry_pio; /* retrying dma capable host in pio */
u8 state; /* retry state */
u8 waiting_for_dma; /* dma currently in progress */
unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */
unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */
unsigned vdma : 1; /* 1=doing PIO over DMA 0=doing normal DMA */
+ unsigned stroke : 1; /* from: hdx=stroke */
unsigned addressing; /* : 3;
* 0=28-bit
* 1=48-bit
u8 sect; /* "real" sectors per track */
u8 bios_head; /* BIOS/fdisk/LILO number of heads */
u8 bios_sect; /* BIOS/fdisk/LILO sectors per track */
- u8 queue_depth; /* max queue depth */
unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */
unsigned int cyl; /* "real" number of cyls */
extern struct semaphore ide_setting_sem;
extern int ide_add_setting(ide_drive_t *drive, const char *name, int rw, int read_ioctl, int write_ioctl, int data_type, int min, int max, int mul_factor, int div_factor, void *data, ide_procset_t *set);
-extern void ide_remove_setting(ide_drive_t *drive, char *name);
extern ide_settings_t *ide_find_setting_by_name(ide_drive_t *drive, char *name);
extern int ide_read_setting(ide_drive_t *t, ide_settings_t *setting);
extern int ide_write_setting(ide_drive_t *drive, ide_settings_t *setting, int val);
extern void proc_ide_create(void);
extern void proc_ide_destroy(void);
-extern void destroy_proc_ide_device(ide_hwif_t *, ide_drive_t *);
extern void destroy_proc_ide_drives(ide_hwif_t *);
extern void create_proc_ide_interfaces(void);
extern void ide_add_proc_entries(struct proc_dir_entry *, ide_proc_entry_t *, void *);
*/
extern void ide_end_drive_cmd(ide_drive_t *, u8, u8);
+extern void try_to_flush_leftover_data(ide_drive_t *);
+
/*
* Issue ATA command and wait for completion.
* Use for implementing commands in kernel
int ide_cmd_ioctl(ide_drive_t *, unsigned int, unsigned long);
int ide_task_ioctl(ide_drive_t *, unsigned int, unsigned long);
-extern void ide_delay_50ms(void);
extern int system_bus_clock(void);
extern u8 ide_auto_reduce_xfer(ide_drive_t *);
#define NODMA 0
#define NOAUTODMA 1
#define AUTODMA 2
-#define EOL 255
typedef struct ide_pci_enablebit_s {
u8 reg; /* byte pci reg holding the enable-bit */
u8 val; /* value of masked reg when "enabled" */
} ide_pci_enablebit_t;
+enum {
+ /* Uses ISA control ports not PCI ones. */
+ IDEPCI_FLAG_ISA_PORTS = (1 << 0),
+
+ IDEPCI_FLAG_FORCE_MASTER = (1 << 1),
+ IDEPCI_FLAG_FORCE_PDC = (1 << 2),
+};
+
typedef struct ide_pci_device_s {
- u16 vendor;
- u16 device;
char *name;
void (*init_setup)(struct pci_dev *, struct ide_pci_device_s *);
void (*init_setup_dma)(struct pci_dev *, struct ide_pci_device_s *, ide_hwif_t *);
u8 bootable;
unsigned int extra;
struct ide_pci_device_s *next;
- u8 isa_ports; /* Uses ISA control ports not PCI ones */
+ u8 flags;
} ide_pci_device_t;
extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
extern int __ide_dma_timeout(ide_drive_t *);
#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
-#ifdef CONFIG_BLK_DEV_IDE_TCQ
-extern int __ide_dma_queued_on(ide_drive_t *drive);
-extern int __ide_dma_queued_off(ide_drive_t *drive);
-extern ide_startstop_t __ide_dma_queued_read(ide_drive_t *drive);
-extern ide_startstop_t __ide_dma_queued_write(ide_drive_t *drive);
-extern ide_startstop_t __ide_dma_queued_start(ide_drive_t *drive);
-#endif
-
#else
static inline int __ide_dma_off(ide_drive_t *drive) { return 0; }
#endif /* CONFIG_BLK_DEV_IDEDMA */
#define local_irq_set(flags) do { local_save_flags((flags)); local_irq_enable(); } while (0)
-#define IDE_MAX_TAG 32
-#ifdef CONFIG_BLK_DEV_IDE_TCQ
-static inline int ata_pending_commands(ide_drive_t *drive)
-{
- if (drive->using_tcq)
- return blk_queue_tag_depth(drive->queue);
-
- return 0;
-}
-
-static inline int ata_can_queue(ide_drive_t *drive)
-{
- if (drive->using_tcq)
- return blk_queue_tag_queue(drive->queue);
-
- return 1;
-}
-#else
-#define ata_pending_commands(drive) (0)
-#define ata_can_queue(drive) (1)
-#endif
-
extern struct bus_type ide_bus_type;
#endif /* _IDE_H */