Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[pandora-kernel.git] / include / linux / ide.h
index 32fd77b..eddb6da 100644 (file)
@@ -153,7 +153,7 @@ enum {              ide_unknown,    ide_generic,    ide_pci,
                ide_qd65xx,     ide_umc8672,    ide_ht6560b,
                ide_rz1000,     ide_trm290,
                ide_cmd646,     ide_cy82c693,   ide_4drives,
-               ide_pmac,       ide_etrax100,   ide_acorn,
+               ide_pmac,       ide_acorn,
                ide_au1xxx,     ide_palm3710
 };
 
@@ -189,6 +189,21 @@ static inline void ide_std_init_ports(hw_regs_t *hw,
        hw->io_ports.ctl_addr = ctl_addr;
 }
 
+/* for IDE PCI controllers in legacy mode, temporary */
+static inline int __ide_default_irq(unsigned long base)
+{
+       switch (base) {
+#ifdef CONFIG_IA64
+       case 0x1f0: return isa_irq_to_vector(14);
+       case 0x170: return isa_irq_to_vector(15);
+#else
+       case 0x1f0: return 14;
+       case 0x170: return 15;
+#endif
+       }
+       return 0;
+}
+
 #include <asm/ide.h>
 
 #if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED)
@@ -427,6 +442,8 @@ struct ide_dma_ops {
        void    (*dma_timeout)(struct ide_drive_s *);
 };
 
+struct ide_task_s;
+
 typedef struct hwif_s {
        struct hwif_s *next;            /* for linked-list in ide_hwgroup_t */
        struct hwif_s *mate;            /* other hwif from same PCI chip */
@@ -467,24 +484,18 @@ typedef struct hwif_s {
        const struct ide_port_ops       *port_ops;
        const struct ide_dma_ops        *dma_ops;
 
-       void (*ata_input_data)(ide_drive_t *, void *, u32);
-       void (*ata_output_data)(ide_drive_t *, void *, u32);
+       void (*tf_load)(ide_drive_t *, struct ide_task_s *);
+       void (*tf_read)(ide_drive_t *, struct ide_task_s *);
 
-       void (*atapi_input_bytes)(ide_drive_t *, void *, u32);
-       void (*atapi_output_bytes)(ide_drive_t *, void *, u32);
+       void (*input_data)(ide_drive_t *, struct request *, void *, unsigned);
+       void (*output_data)(ide_drive_t *, struct request *, void *, unsigned);
 
        void (*ide_dma_clear_irq)(ide_drive_t *drive);
 
        void (*OUTB)(u8 addr, unsigned long port);
        void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port);
-       void (*OUTW)(u16 addr, unsigned long port);
-       void (*OUTSW)(unsigned long port, void *addr, u32 count);
-       void (*OUTSL)(unsigned long port, void *addr, u32 count);
 
        u8  (*INB)(unsigned long port);
-       u16 (*INW)(unsigned long port);
-       void (*INSW)(unsigned long port, void *addr, u32 count);
-       void (*INSL)(unsigned long port, void *addr, u32 count);
 
        /* dma physical region descriptor table (cpu view) */
        unsigned int    *dmatable_cpu;
@@ -509,10 +520,7 @@ typedef struct hwif_s {
 
        unsigned long   dma_base;       /* base addr for dma ports */
        unsigned long   dma_command;    /* dma command register */
-       unsigned long   dma_vendor1;    /* dma vendor 1 register */
        unsigned long   dma_status;     /* dma status register */
-       unsigned long   dma_vendor3;    /* dma vendor 3 register */
-       unsigned long   dma_prdtable;   /* actual prd table address */
 
        unsigned long   config_data;    /* for use by chipset-specific code */
        unsigned long   select_data;    /* for use by chipset-specific code */
@@ -547,7 +555,7 @@ typedef ide_startstop_t (ide_handler_t)(ide_drive_t *);
 typedef int (ide_expiry_t)(ide_drive_t *);
 
 /* used by ide-cd, ide-floppy, etc. */
-typedef void (xfer_func_t)(ide_drive_t *, void *, u32);
+typedef void (xfer_func_t)(ide_drive_t *, struct request *rq, void *, unsigned);
 
 typedef struct hwgroup_s {
                /* irq handler, if active */
@@ -829,6 +837,10 @@ extern void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler, unsigne
 void ide_execute_command(ide_drive_t *, u8, ide_handler_t *, unsigned int,
                         ide_expiry_t *);
 
+void ide_execute_pkt_cmd(ide_drive_t *);
+
+void ide_pad_transfer(ide_drive_t *, int, int);
+
 ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8);
 
 ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat);
@@ -965,11 +977,9 @@ typedef struct ide_task_s {
        void                    *special;       /* valid_t generally */
 } ide_task_t;
 
-void ide_tf_load(ide_drive_t *, ide_task_t *);
-void ide_tf_read(ide_drive_t *, ide_task_t *);
+void ide_tf_dump(const char *, struct ide_taskfile *);
 
 extern void SELECT_DRIVE(ide_drive_t *);
-extern void SELECT_MASK(ide_drive_t *, int);
 
 extern int drive_is_ready(ide_drive_t *);
 
@@ -1062,8 +1072,8 @@ enum {
        IDE_HFLAG_NO_SET_MODE           = (1 << 9),
        /* trust BIOS for programming chipset/device for DMA */
        IDE_HFLAG_TRUST_BIOS_FOR_DMA    = (1 << 10),
-       /* host uses VDMA (tied with IDE_HFLAG_CS5520 for now) */
-       IDE_HFLAG_VDMA                  = (1 << 11),
+       /* host is CS5510/CS5520 */
+       IDE_HFLAG_CS5520                = (1 << 11),
        /* ATAPI DMA is unsupported */
        IDE_HFLAG_NO_ATAPI_DMA          = (1 << 12),
        /* set if host is a "non-bootable" controller */
@@ -1072,8 +1082,8 @@ enum {
        IDE_HFLAG_NO_DMA                = (1 << 14),
        /* check if host is PCI IDE device before allowing DMA */
        IDE_HFLAG_NO_AUTODMA            = (1 << 15),
-       /* host is CS5510/CS5520 */
-       IDE_HFLAG_CS5520                = IDE_HFLAG_VDMA,
+       /* host uses MMIO */
+       IDE_HFLAG_MMIO                  = (1 << 16),
        /* no LBA48 */
        IDE_HFLAG_NO_LBA48              = (1 << 17),
        /* no LBA48 DMA */
@@ -1103,6 +1113,8 @@ enum {
        IDE_HFLAG_NO_IO_32BIT           = (1 << 30),
        /* never unmask IRQs */
        IDE_HFLAG_NO_UNMASK_IRQS        = (1 << 31),
+       /* host uses VDMA (disabled for now) */
+       IDE_HFLAG_VDMA                  = 0,
 };
 
 #ifdef CONFIG_BLK_DEV_OFFBOARD
@@ -1360,27 +1372,4 @@ static inline u8 ide_read_error(ide_drive_t *drive)
 
        return hwif->INB(hwif->io_ports.error_addr);
 }
-
-/*
- * Too bad. The drive wants to send us data which we are not ready to accept.
- * Just throw it away.
- */
-static inline void ide_atapi_discard_data(ide_drive_t *drive, unsigned bcount)
-{
-       ide_hwif_t *hwif = drive->hwif;
-
-       /* FIXME: use ->atapi_input_bytes */
-       while (bcount--)
-               (void)hwif->INB(hwif->io_ports.data_addr);
-}
-
-static inline void ide_atapi_write_zeros(ide_drive_t *drive, unsigned bcount)
-{
-       ide_hwif_t *hwif = drive->hwif;
-
-       /* FIXME: use ->atapi_output_bytes */
-       while (bcount--)
-               hwif->OUTB(0, hwif->io_ports.data_addr);
-}
-
 #endif /* _IDE_H */