ide: remove ->noprobe field from ide_hwif_t
[cascardo/linux.git] / include / linux / ide.h
index 5f3e82a..a612c89 100644 (file)
@@ -170,7 +170,6 @@ typedef struct hw_regs_s {
        struct device   *dev;
 } hw_regs_t;
 
-struct hwif_s * ide_find_port(unsigned long);
 void ide_init_port_data(struct hwif_s *, unsigned int);
 void ide_init_port_hw(struct hwif_s *, hw_regs_t *);
 
@@ -388,6 +387,32 @@ typedef struct ide_drive_s {
 
 struct ide_port_info;
 
+struct ide_port_ops {
+       /* host specific initialization of devices on a port */
+       void    (*port_init_devs)(struct hwif_s *);
+       /* routine to program host for PIO mode */
+       void    (*set_pio_mode)(ide_drive_t *, const u8);
+       /* routine to program host for DMA mode */
+       void    (*set_dma_mode)(ide_drive_t *, const u8);
+       /* tweaks hardware to select drive */
+       void    (*selectproc)(ide_drive_t *);
+       /* chipset polling based on hba specifics */
+       int     (*reset_poll)(ide_drive_t *);
+       /* chipset specific changes to default for device-hba resets */
+       void    (*pre_reset)(ide_drive_t *);
+       /* routine to reset controller after a disk reset */
+       void    (*resetproc)(ide_drive_t *);
+       /* special host masking for drive selection */
+       void    (*maskproc)(ide_drive_t *, int);
+       /* check host's drive quirk list */
+       void    (*quirkproc)(ide_drive_t *);
+
+       u8      (*mdma_filter)(ide_drive_t *);
+       u8      (*udma_filter)(ide_drive_t *);
+
+       u8      (*cable_detect)(struct hwif_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 */
@@ -427,32 +452,7 @@ typedef struct hwif_s {
 
        void (*rw_disk)(ide_drive_t *, struct request *);
 
-#if 0
-       ide_hwif_ops_t  *hwifops;
-#else
-       /* host specific initialization of devices on a port */
-       void    (*port_init_devs)(struct hwif_s *);
-       /* routine to program host for PIO mode */
-       void    (*set_pio_mode)(ide_drive_t *, const u8);
-       /* routine to program host for DMA mode */
-       void    (*set_dma_mode)(ide_drive_t *, const u8);
-       /* tweaks hardware to select drive */
-       void    (*selectproc)(ide_drive_t *);
-       /* chipset polling based on hba specifics */
-       int     (*reset_poll)(ide_drive_t *);
-       /* chipset specific changes to default for device-hba resets */
-       void    (*pre_reset)(ide_drive_t *);
-       /* routine to reset controller after a disk reset */
-       void    (*resetproc)(ide_drive_t *);
-       /* special host masking for drive selection */
-       void    (*maskproc)(ide_drive_t *, int);
-       /* check host's drive quirk list */
-       void    (*quirkproc)(ide_drive_t *);
-#endif
-       u8 (*mdma_filter)(ide_drive_t *);
-       u8 (*udma_filter)(ide_drive_t *);
-
-       u8 (*cable_detect)(struct hwif_s *);
+       const struct ide_port_ops       *port_ops;
 
        void (*ata_input_data)(ide_drive_t *, void *, u32);
        void (*ata_output_data)(ide_drive_t *, void *, u32);
@@ -515,14 +515,12 @@ typedef struct hwif_s {
        unsigned long   extra_base;     /* extra addr for dma ports */
        unsigned        extra_ports;    /* number of extra dma ports */
 
-       unsigned        noprobe    : 1; /* don't probe for this interface */
        unsigned        present    : 1; /* this interface exists */
        unsigned        serialized : 1; /* serialized all channel operation */
        unsigned        sharing_irq: 1; /* 1 = sharing irq with another hwif */
        unsigned        reset      : 1; /* reset after probe */
        unsigned        sg_mapped  : 1; /* sg_table and sg_nents are ready */
        unsigned        mmio       : 1; /* host uses MMIO */
-       unsigned        straight8  : 1; /* Alan's straight 8 check */
 
        struct device           gendev;
        struct device           *portdev;
@@ -809,6 +807,13 @@ extern     ide_hwif_t      ide_hwifs[];            /* master data repository */
 #endif
 extern int noautodma;
 
+ide_hwif_t *ide_find_port_slot(const struct ide_port_info *);
+
+static inline ide_hwif_t *ide_find_port(void)
+{
+       return ide_find_port_slot(NULL);
+}
+
 extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs);
 int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq,
                             int uptodate, int nr_sectors);
@@ -1027,8 +1032,8 @@ enum {
        IDE_HFLAG_SINGLE                = (1 << 1),
        /* don't use legacy PIO blacklist */
        IDE_HFLAG_PIO_NO_BLACKLIST      = (1 << 2),
-       /* don't use conservative PIO "downgrade" */
-       IDE_HFLAG_PIO_NO_DOWNGRADE      = (1 << 3),
+       /* set for the second port of QD65xx */
+       IDE_HFLAG_QD_2ND_PORT           = (1 << 3),
        /* use PIO8/9 for prefetch off/on */
        IDE_HFLAG_ABUSE_PREFETCH        = (1 << 4),
        /* use PIO6/7 for fast-devsel off/on */
@@ -1050,8 +1055,8 @@ enum {
        IDE_HFLAG_VDMA                  = (1 << 11),
        /* ATAPI DMA is unsupported */
        IDE_HFLAG_NO_ATAPI_DMA          = (1 << 12),
-       /* set if host is a "bootable" controller */
-       IDE_HFLAG_BOOTABLE              = (1 << 13),
+       /* set if host is a "non-bootable" controller */
+       IDE_HFLAG_NON_BOOTABLE          = (1 << 13),
        /* host doesn't support DMA */
        IDE_HFLAG_NO_DMA                = (1 << 14),
        /* check if host is PCI IDE device before allowing DMA */
@@ -1079,8 +1084,6 @@ enum {
        /* unmask IRQs */
        IDE_HFLAG_UNMASK_IRQS           = (1 << 25),
        IDE_HFLAG_ABUSE_SET_DMA_MODE    = (1 << 26),
-       /* host is CY82C693 */
-       IDE_HFLAG_CY82C693              = (1 << 27),
        /* force host out of "simplex" mode */
        IDE_HFLAG_CLEAR_SIMPLEX         = (1 << 28),
        /* DSC overlap is unsupported */
@@ -1092,9 +1095,9 @@ enum {
 };
 
 #ifdef CONFIG_BLK_DEV_OFFBOARD
-# define IDE_HFLAG_OFF_BOARD   IDE_HFLAG_BOOTABLE
-#else
 # define IDE_HFLAG_OFF_BOARD   0
+#else
+# define IDE_HFLAG_OFF_BOARD   IDE_HFLAG_NON_BOOTABLE
 #endif
 
 struct ide_port_info {
@@ -1103,6 +1106,9 @@ struct ide_port_info {
        void                    (*init_iops)(ide_hwif_t *);
        void                    (*init_hwif)(ide_hwif_t *);
        void                    (*init_dma)(ide_hwif_t *, unsigned long);
+
+       const struct ide_port_ops       *port_ops;
+
        ide_pci_enablebit_t     enablebits[2];
        hwif_chipset_t          chipset;
        u8                      extra;