ide: add IDE_HFLAG_LEGACY_IRQS host flag
[safe/jmp/linux-2.6] / drivers / ide / setup-pci.c
index 479add4..7989f52 100644 (file)
@@ -185,9 +185,9 @@ static unsigned long ide_get_or_set_dma_base(ide_pci_device_t *d, ide_hwif_t *hw
                        case PCI_DEVICE_ID_CMD_643:
                        case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE:
                        case PCI_DEVICE_ID_REVOLUTION:
-                               simplex_stat = hwif->INB(dma_base + 2);
-                               hwif->OUTB((simplex_stat&0x60),(dma_base + 2));
-                               simplex_stat = hwif->INB(dma_base + 2);
+                               simplex_stat = inb(dma_base + 2);
+                               outb(simplex_stat & 0x60, dma_base + 2);
+                               simplex_stat = inb(dma_base + 2);
                                if (simplex_stat & 0x80) {
                                        printk(KERN_INFO "%s: simplex device: "
                                                         "DMA forced\n",
@@ -478,7 +478,6 @@ static void ide_hwif_setup_dma(struct pci_dev *dev, ide_pci_device_t *d, ide_hwi
 static int ide_setup_pci_controller(struct pci_dev *dev, ide_pci_device_t *d, int noisy, int *config)
 {
        int ret;
-       u32 class_rev;
        u16 pcicmd;
 
        if (noisy)
@@ -501,10 +500,9 @@ static int ide_setup_pci_controller(struct pci_dev *dev, ide_pci_device_t *d, in
                printk(KERN_INFO "%s: device enabled (Linux)\n", d->name);
        }
 
-       pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
-       class_rev &= 0xff;
        if (noisy)
-               printk(KERN_INFO "%s: chipset revision %d\n", d->name, class_rev);
+               printk(KERN_INFO "%s: chipset revision %d\n",
+                                d->name, dev->revision);
 out:
        return ret;
 }
@@ -564,9 +562,21 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a
                if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0)
                        ide_hwif_setup_dma(dev, d, hwif);
 
+               if ((d->host_flags & IDE_HFLAG_LEGACY_IRQS) && hwif->irq == 0)
+                       hwif->irq = port ? 15 : 14;
+
                hwif->host_flags = d->host_flags;
                hwif->pio_mask = d->pio_mask;
 
+               if ((d->host_flags & IDE_HFLAG_SERIALIZE) && hwif->mate)
+                       hwif->mate->serialized = hwif->serialized = 1;
+
+               if (hwif->dma_base) {
+                       hwif->swdma_mask = d->swdma_mask;
+                       hwif->mwdma_mask = d->mwdma_mask;
+                       hwif->ultra_mask = d->udma_mask;
+               }
+
                if (d->init_hwif)
                        /* Call chipset-specific routine
                         * for each enabled hwif