linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / infiniband / hw / mthca / mthca_eq.c
index a29b1b6..2eabb27 100644 (file)
@@ -497,7 +497,7 @@ static int __devinit mthca_create_eq(struct mthca_dev *dev,
 
        eq->dev  = dev;
        eq->nent = roundup_pow_of_two(max(nent, 2));
-       npages = ALIGN(eq->nent * MTHCA_EQ_ENTRY_SIZE, PAGE_SIZE) / PAGE_SIZE;
+       npages = ALIGN(eq->nent * MTHCA_EQ_ENTRY_SIZE, PAGE_SIZE) / PAGE_SIZE;
 
        eq->page_list = kmalloc(npages * sizeof *eq->page_list,
                                GFP_KERNEL);
@@ -695,6 +695,10 @@ static void mthca_unmap_reg(struct mthca_dev *dev, unsigned long offset,
 
 static int __devinit mthca_map_eq_regs(struct mthca_dev *dev)
 {
+       unsigned long mthca_base;
+
+       mthca_base = pci_resource_start(dev->pdev, 0);
+
        if (mthca_is_memfree(dev)) {
                /*
                 * We assume that the EQ arm and EQ set CI registers
@@ -761,7 +765,7 @@ static int __devinit mthca_map_eq_regs(struct mthca_dev *dev)
 
 }
 
-static void mthca_unmap_eq_regs(struct mthca_dev *dev)
+static void __devexit mthca_unmap_eq_regs(struct mthca_dev *dev)
 {
        if (mthca_is_memfree(dev)) {
                mthca_unmap_reg(dev, (pci_resource_len(dev->pdev, 0) - 1) &
@@ -817,11 +821,11 @@ int __devinit mthca_map_eq_icm(struct mthca_dev *dev, u64 icm_virt)
        return ret;
 }
 
-void mthca_unmap_eq_icm(struct mthca_dev *dev)
+void __devexit mthca_unmap_eq_icm(struct mthca_dev *dev)
 {
        u8 status;
 
-       mthca_UNMAP_ICM(dev, dev->eq_table.icm_virt, 1, &status);
+       mthca_UNMAP_ICM(dev, dev->eq_table.icm_virt, PAGE_SIZE / 4096, &status);
        pci_unmap_page(dev->pdev, dev->eq_table.icm_dma, PAGE_SIZE,
                       PCI_DMA_BIDIRECTIONAL);
        __free_page(dev->eq_table.icm_page);
@@ -900,7 +904,7 @@ int __devinit mthca_init_eq_table(struct mthca_dev *dev)
                                  mthca_is_memfree(dev) ?
                                  mthca_arbel_interrupt :
                                  mthca_tavor_interrupt,
-                                 IRQF_SHARED, DRV_NAME, dev);
+                                 SA_SHIRQ, DRV_NAME, dev);
                if (err)
                        goto err_out_cmd;
                dev->eq_table.have_irq = 1;
@@ -924,7 +928,7 @@ int __devinit mthca_init_eq_table(struct mthca_dev *dev)
                mthca_warn(dev, "MAP_EQ for cmd EQ %d returned status 0x%02x\n",
                           dev->eq_table.eq[MTHCA_EQ_CMD].eqn, status);
 
-       for (i = 0; i < MTHCA_NUM_EQ; ++i)
+       for (i = 0; i < MTHCA_EQ_CMD; ++i)
                if (mthca_is_memfree(dev))
                        arbel_eq_req_not(dev, dev->eq_table.eq[i].eqn_mask);
                else
@@ -950,7 +954,7 @@ err_out_free:
        return err;
 }
 
-void mthca_cleanup_eq_table(struct mthca_dev *dev)
+void __devexit mthca_cleanup_eq_table(struct mthca_dev *dev)
 {
        u8 status;
        int i;