s390/pci: rename instruction wrappers
[pandora-kernel.git] / arch / s390 / pci / pci.c
index 27b4c17..2b21749 100644 (file)
@@ -99,9 +99,6 @@ static int __read_mostly aisb_max;
 static struct kmem_cache *zdev_irq_cache;
 static struct kmem_cache *zdev_fmb_cache;
 
-debug_info_t *pci_debug_msg_id;
-debug_info_t *pci_debug_err_id;
-
 static inline int irq_to_msi_nr(unsigned int irq)
 {
        return irq & ZPCI_MSI_MASK;
@@ -179,7 +176,7 @@ static int zpci_register_airq(struct zpci_dev *zdev, unsigned int aisb,
        fib->aisb = (u64) bucket->aisb + aisb / 8;
        fib->aisbo = aisb & ZPCI_MSI_MASK;
 
-       rc = mpcifc_instr(req, fib);
+       rc = s390pci_mod_fc(req, fib);
        pr_debug("%s mpcifc returned noi: %d\n", __func__, fib->noi);
 
        free_page((unsigned long) fib);
@@ -209,7 +206,7 @@ static int mod_pci(struct zpci_dev *zdev, int fn, u8 dmaas, struct mod_pci_args
        fib->iota = args->iota;
        fib->fmb_addr = args->fmb_addr;
 
-       rc = mpcifc_instr(req, fib);
+       rc = s390pci_mod_fc(req, fib);
        free_page((unsigned long) fib);
        return rc;
 }
@@ -249,10 +246,9 @@ int zpci_fmb_enable_device(struct zpci_dev *zdev)
        if (zdev->fmb)
                return -EINVAL;
 
-       zdev->fmb = kmem_cache_alloc(zdev_fmb_cache, GFP_KERNEL);
+       zdev->fmb = kmem_cache_zalloc(zdev_fmb_cache, GFP_KERNEL);
        if (!zdev->fmb)
                return -ENOMEM;
-       memset(zdev->fmb, 0, sizeof(*zdev->fmb));
        WARN_ON((u64) zdev->fmb & 0xf);
 
        args.fmb_addr = virt_to_phys(zdev->fmb);
@@ -284,7 +280,7 @@ static int zpci_cfg_load(struct zpci_dev *zdev, int offset, u32 *val, u8 len)
        u64 data;
        int rc;
 
-       rc = pcilg_instr(&data, req, offset);
+       rc = s390pci_load(&data, req, offset);
        data = data << ((8 - len) * 8);
        data = le64_to_cpu(data);
        if (!rc)
@@ -302,7 +298,7 @@ static int zpci_cfg_store(struct zpci_dev *zdev, int offset, u32 val, u8 len)
 
        data = cpu_to_le64(data);
        data = data >> ((8 - len) * 8);
-       rc = pcistg_instr(data, req, offset);
+       rc = s390pci_store(data, req, offset);
        return rc;
 }
 
@@ -474,7 +470,7 @@ scan:
        }
 
        /* enable interrupts again */
-       sic_instr(SIC_IRQ_MODE_SINGLE, NULL, PCI_ISC);
+       set_irq_ctrl(SIC_IRQ_MODE_SINGLE, NULL, PCI_ISC);
 
        /* check again to not lose initiative */
        rmb();
@@ -789,7 +785,7 @@ static int __init zpci_irq_init(void)
        spin_lock_init(&bucket->lock);
        /* set summary to 1 to be called every time for the ISC */
        *zpci_irq_si = 1;
-       sic_instr(SIC_IRQ_MODE_SINGLE, NULL, PCI_ISC);
+       set_irq_ctrl(SIC_IRQ_MODE_SINGLE, NULL, PCI_ISC);
        return 0;
 
 out_ai:
@@ -872,6 +868,17 @@ static void zpci_free_iomap(struct zpci_dev *zdev, int entry)
        spin_unlock(&zpci_iomap_lock);
 }
 
+int pcibios_add_device(struct pci_dev *pdev)
+{
+       struct zpci_dev *zdev = get_zdev(pdev);
+
+       zpci_debug_init_device(zdev);
+       zpci_fmb_enable_device(zdev);
+       zpci_map_resources(zdev);
+
+       return 0;
+}
+
 static int zpci_create_device_bus(struct zpci_dev *zdev)
 {
        struct resource *res;
@@ -959,6 +966,13 @@ out:
 }
 EXPORT_SYMBOL_GPL(zpci_enable_device);
 
+int zpci_disable_device(struct zpci_dev *zdev)
+{
+       zpci_dma_exit_device(zdev);
+       return clp_disable_fh(zdev);
+}
+EXPORT_SYMBOL_GPL(zpci_disable_device);
+
 int zpci_create_device(struct zpci_dev *zdev)
 {
        int rc;
@@ -1016,9 +1030,6 @@ int zpci_scan_device(struct zpci_dev *zdev)
                goto out;
        }
 
-       zpci_debug_init_device(zdev);
-       zpci_fmb_enable_device(zdev);
-       zpci_map_resources(zdev);
        pci_bus_add_devices(zdev->bus);
 
        /* now that pdev was added to the bus mark it as used */